This is a note to let you know that I've just added the patch titled io_uring/net: disable partial retries for recvmsg with cmsg to the 5.15-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-disable-partial-retries-for-recvmsg-with-cmsg.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From b3f9442fb5b504d240e6710f483232641beb1b8f Mon Sep 17 00:00:00 2001 From: Jens Axboe <axboe@xxxxxxxxx> Date: Fri, 23 Jun 2023 07:41:10 -0600 Subject: io_uring/net: disable partial retries for recvmsg with cmsg From: Jens Axboe <axboe@xxxxxxxxx> Commit 78d0d2063bab954d19a1696feae4c7706a626d48 upstream. We cannot sanely handle partial retries for recvmsg if we have cmsg attached. If we don't, then we'd just be overwriting the initial cmsg header on retries. Alternatively we could increment and handle this appropriately, but it doesn't seem worth the complication. Move the MSG_WAITALL check into the non-multishot case while at it, since MSG_WAITALL is explicitly disabled for multishot anyway. Link: https://lore.kernel.org/io-uring/0b0d4411-c8fd-4272-770b-e030af6919a0@xxxxxxxxx/ Cc: stable@xxxxxxxxxxxxxxx # 5.10+ Reported-by: Stefan Metzmacher <metze@xxxxxxxxx> Reviewed-by: Stefan Metzmacher <metze@xxxxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -5201,7 +5201,7 @@ static int io_recvmsg(struct io_kiocb *r flags = req->sr_msg.msg_flags; if (force_nonblock) flags |= MSG_DONTWAIT; - if (flags & MSG_WAITALL) + if (flags & MSG_WAITALL && !kmsg->msg.msg_controllen) min_ret = iov_iter_count(&kmsg->msg.msg_iter); ret = __sys_recvmsg_sock(sock, &kmsg->msg, req->sr_msg.umsg, Patches currently in stable-queue which might be from axboe@xxxxxxxxx are queue-5.15/io_uring-net-clear-msg_controllen-on-partial-sendmsg-retry.patch queue-5.15/io_uring-net-disable-partial-retries-for-recvmsg-with-cmsg.patch queue-5.15/io_uring-net-save-msghdr-msg_control-for-retries.patch