Skip to content

Commit fafab8b

Browse files
axboegregkh
authored andcommitted
io_uring/poll: ensure EPOLL_ONESHOT is propagated for EPOLL_URING_WAKE
commit 1967f0b upstream. Commit: aacf2f9 ("io_uring: fix req->apoll_events") fixed an issue where poll->events and req->apoll_events weren't synchronized, but then when the commit referenced in Fixes got added, it didn't ensure the same thing. If we mask in EPOLLONESHOT in the regular EPOLL_URING_WAKE path, then ensure it's done for both. Including a link to the original report below, even though it's mostly nonsense. But it includes a reproducer that does show that IORING_CQE_F_MORE is set in the previous CQE, while no more CQEs will be generated for this request. Just ignore anything that pretends this is security related in any way, it's just the typical AI nonsense. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/io-uring/CAM0zi7yQzF3eKncgHo4iVM5yFLAjsiob_ucqyWKs=hyd_GqiMg@mail.gmail.com/ Reported-by: Azizcan Daştan <azizcan.d@mileniumsec.com> Fixes: 4464853 ("io_uring: pass in EPOLL_URING_WAKE for eventfd signaling and wakeups") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cf52270 commit fafab8b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

io_uring/poll.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,10 @@ static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
441441
* disable multishot as there is a circular dependency between
442442
* CQ posting and triggering the event.
443443
*/
444-
if (mask & EPOLL_URING_WAKE)
444+
if (mask & EPOLL_URING_WAKE) {
445445
poll->events |= EPOLLONESHOT;
446+
req->apoll_events |= EPOLLONESHOT;
447+
}
446448

447449
/* optional, saves extra locking for removal in tw handler */
448450
if (mask && poll->events & EPOLLONESHOT) {

0 commit comments

Comments
 (0)