aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-07 17:48:03 -0700
committerJens Axboe <axboe@kernel.dk>2024-03-07 17:48:03 -0700
commitdeaef31bc1ec7966698a427da8c161930830e1cf (patch)
tree9b5c0c57d8dac2dc7bc87afe26cf915ebba04971 /io_uring
parentb5311dbc2c2eefac00f12888dcd15e90238d1828 (diff)
downloadlinux-deaef31bc1ec7966698a427da8c161930830e1cf.tar.gz
io_uring/net: correctly handle multishot recvmsg retry setup
If we loop for multishot receive on the initial attempt, and then abort later on to wait for more, we miss a case where we should be copying the io_async_msghdr from the stack to stable storage. This leads to the next retry potentially failing, if the application had the msghdr on the stack. Cc: stable@vger.kernel.org Fixes: 9bb66906f23e ("io_uring: support multishot in recvmsg") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index e50947e7cd5764..52f0d3b735fd0d 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -931,7 +931,8 @@ retry_multishot:
kfree(kmsg->free_iov);
io_netmsg_recycle(req, issue_flags);
req->flags &= ~REQ_F_NEED_CLEANUP;
- }
+ } else if (ret == -EAGAIN)
+ return io_setup_async_msg(req, kmsg, issue_flags);
return ret;
}