]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: disallow self-propelled ring polling
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 18 Nov 2022 15:41:41 +0000 (15:41 +0000)
committerJens Axboe <axboe@kernel.dk>
Fri, 18 Nov 2022 16:29:31 +0000 (09:29 -0700)
commitc2ea29defa8240f12f67543b61b4fb16f6c11764
treeee0554114e62170dd45f607cf99fc5a7c7dfedcb
parent125b96085c8709c5e5c977d13814ecf4074bda05
io_uring: disallow self-propelled ring polling

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@vger.kernel.org
Fixes: 3aeba5c7df18c ("io_uring: poll rework")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/3124038c0e7474d427538c2d915335ec28c92d21.1668785722.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/poll.c