summaryrefslogtreecommitdiff
path: root/io_uring/net.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2025-02-23 20:22:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 11:43:58 +0300
commitdc7bdc1f2d9c9d73644ba65c6802328681e3a23f (patch)
tree89624046fa3e89591f72fb53a1f667c44a7bf886 /io_uring/net.c
parentb8acdc413fd83134c96667af8b09bd5c481938e0 (diff)
downloadlinux-dc7bdc1f2d9c9d73644ba65c6802328681e3a23f.tar.xz
io_uring/net: fix accept multishot handling
Commit f6a89bf5278d6e15016a736db67043560d1b50d5 upstream. REQ_F_APOLL_MULTISHOT doesn't guarantee it's executed from the multishot context, so a multishot accept may get executed inline, fail io_req_post_cqe(), and ask the core code to kill the request with -ECANCELED by returning IOU_STOP_MULTISHOT even when a socket has been accepted and installed. Cc: stable@vger.kernel.org Fixes: 390ed29b5e425 ("io_uring: add IORING_ACCEPT_MULTISHOT for accept") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/51c6deb01feaa78b08565ca8f24843c017f5bc80.1740331076.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/net.c')
-rw-r--r--io_uring/net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index d56e8a47e50f..898990e71367 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1391,6 +1391,8 @@ retry:
goto retry;
io_req_set_res(req, ret, 0);
+ if (!(issue_flags & IO_URING_F_MULTISHOT))
+ return IOU_OK;
return IOU_STOP_MULTISHOT;
}