This is a note to let you know that I've just added the patch titled io_uring: disallow self-propelled ring polling to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-disallow-self-propelled-ring-polling.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7fdbc5f014c3f71bc44673a2d6c5bb2d12d45f25 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov <asml.silence@xxxxxxxxx> Date: Fri, 18 Nov 2022 15:41:41 +0000 Subject: io_uring: disallow self-propelled ring polling From: Pavel Begunkov <asml.silence@xxxxxxxxx> commit 7fdbc5f014c3f71bc44673a2d6c5bb2d12d45f25 upstream. When we post a CQE we wake all ring pollers as it normally should be. However, if a CQE was generated by a multishot poll request targeting its own ring, it'll wake that request up, which will make it to post a new CQE, which will wake the request and so on until it exhausts all CQ entries. Don't allow multishot polling io_uring files but downgrade them to oneshots, which was always stated as a correct behaviour that the userspace should check for. Cc: stable@xxxxxxxxxxxxxxx Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> Link: https://lore.kernel.org/r/3124038c0e7474d427538c2d915335ec28c92d21.1668785722.git.asml.silence@xxxxxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- io_uring/poll.c | 2 ++ 1 file changed, 2 insertions(+) --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -244,6 +244,8 @@ static int io_poll_check_events(struct i continue; if (req->apoll_events & EPOLLONESHOT) return IOU_POLL_DONE; + if (io_is_uring_fops(req->file)) + return IOU_POLL_DONE; /* multishot, just fill a CQE and proceed */ if (!(req->flags & REQ_F_APOLL_MULTISHOT)) { Patches currently in stable-queue which might be from asml.silence@xxxxxxxxx are queue-6.0/io_uring-update-res-mask-in-io_poll_check_events.patch queue-6.0/io_uring-fix-multishot-recv-request-leaks.patch queue-6.0/io_uring-fix-tw-losing-poll-events.patch queue-6.0/io_uring-fix-multishot-accept-request-leaks.patch queue-6.0/io_uring-poll-fix-double-poll-req-flags-races.patch queue-6.0/io_uring-disallow-self-propelled-ring-polling.patch