This is a note to let you know that I've just added the patch titled io_uring/net: fail zc send when unsupported by socket to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-net-fail-zc-send-when-unsupported-by-socket.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From edf81438799ccead7122948446d7e44b083e788d Mon Sep 17 00:00:00 2001 From: Pavel Begunkov <asml.silence@xxxxxxxxx> Date: Fri, 21 Oct 2022 11:16:40 +0100 Subject: io_uring/net: fail zc send when unsupported by socket From: Pavel Begunkov <asml.silence@xxxxxxxxx> commit edf81438799ccead7122948446d7e44b083e788d upstream. If a protocol doesn't support zerocopy it will silently fall back to copying. This type of behaviour has always been a source of troubles so it's better to fail such requests instead. Cc: <stable@xxxxxxxxxxxxxxx> # 6.0 Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> Link: https://lore.kernel.org/r/2db3c7f16bb6efab4b04569cd16e6242b40c5cb3.1666346426.git.asml.silence@xxxxxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- io_uring/net.c | 2 ++ 1 file changed, 2 insertions(+) --- a/io_uring/net.c +++ b/io_uring/net.c @@ -1001,6 +1001,8 @@ int io_send_zc(struct io_kiocb *req, uns sock = sock_from_file(req->file); if (unlikely(!sock)) return -ENOTSOCK; + if (!test_bit(SOCK_SUPPORT_ZC, &sock->flags)) + return -EOPNOTSUPP; msg.msg_name = NULL; msg.msg_control = NULL; Patches currently in stable-queue which might be from asml.silence@xxxxxxxxx are queue-6.0/net-flag-sockets-supporting-msghdr-originated-zerocopy.patch queue-6.0/io_uring-net-fail-zc-send-when-unsupported-by-socket.patch