diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-03-08 03:48:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-03 16:32:17 +0300 |
commit | 847937bb9f19c1f53a24991d06e5e2a6c0c09517 (patch) | |
tree | e28fa9ace473ad53bd18b34eee89250405024a1e /io_uring | |
parent | 1f8f95955a4770ccafab8db97a8d5bf83feb90ad (diff) | |
download | linux-847937bb9f19c1f53a24991d06e5e2a6c0c09517.tar.xz |
io_uring/net: correctly handle multishot recvmsg retry setup
[ Upstream commit deaef31bc1ec7966698a427da8c161930830e1cf ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/net.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index 4aaeada03f1e..386a6745ae32 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -915,7 +915,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; } |