Skip to content

Commit 0828d6e

Browse files
isilencegregkh
authored andcommitted
io_uring/net: fix accept multishot handling
commit f6a89bf 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: 390ed29 ("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>
1 parent 00026f8 commit 0828d6e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

io_uring/net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,8 @@ int io_accept(struct io_kiocb *req, unsigned int issue_flags)
16161616
}
16171617

16181618
io_req_set_res(req, ret, cflags);
1619+
if (!(issue_flags & IO_URING_F_MULTISHOT))
1620+
return IOU_OK;
16191621
return IOU_STOP_MULTISHOT;
16201622
}
16211623

0 commit comments

Comments
 (0)