summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-06-23 16:39:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-28 11:28:09 +0300
commit826ee9fa3647785e45ca87aa70511b72d25c2588 (patch)
tree3b2e38d8e9c36994ffe693b8e9396c4b20055c1a /io_uring
parent5fdea4468f57db3fc304e366d03d7214ca3a209e (diff)
downloadlinux-826ee9fa3647785e45ca87aa70511b72d25c2588.tar.xz
io_uring/net: clear msg_controllen on partial sendmsg retry
Commit b1dc492087db0f2e5a45f1072a743d04618dd6be upstream. If we have cmsg attached AND we transferred partial data at least, clear msg_controllen on retry so we don't attempt to send that again. Cc: stable@vger.kernel.org # 5.10+ Fixes: cac9e4418f4c ("io_uring/net: save msghdr->msg_control for retries") Reported-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 1a76659659cf..42b5f9575d84 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -5064,6 +5064,8 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
if (ret == -ERESTARTSYS)
ret = -EINTR;
if (ret > 0 && io_net_retry(sock, flags)) {
+ kmsg->msg.msg_controllen = 0;
+ kmsg->msg.msg_control = NULL;
sr->done_io += ret;
req->flags |= REQ_F_PARTIAL_IO;
return io_setup_async_msg(req, kmsg);