Skip to content

Commit e6551e1

Browse files
committed
io_uring/waitid: always prune wait queue entry in io_waitid_wait()
jira KERNEL-318 cve CVE-2025-40047 Rebuild_History Non-Buildable kernel-6.12.0-124.20.1.el10_1 commit-author Jens Axboe <axboe@kernel.dk> commit 2f8229d For a successful return, always remove our entry from the wait queue entry list. Previously this was skipped if a cancelation was in progress, but this can race with another invocation of the wait queue entry callback. Cc: stable@vger.kernel.org Fixes: f31ecf6 ("io_uring: add IORING_OP_WAITID support") Reported-by: syzbot+b9e83021d9c642a33d8c@syzkaller.appspotmail.com Tested-by: syzbot+b9e83021d9c642a33d8c@syzkaller.appspotmail.com Link: https://lore.kernel.org/io-uring/68e5195e.050a0220.256323.001f.GAE@google.com/ Signed-off-by: Jens Axboe <axboe@kernel.dk> (cherry picked from commit 2f8229d) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent b4012b5 commit e6551e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

io_uring/waitid.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,14 @@ static int io_waitid_wait(struct wait_queue_entry *wait, unsigned mode,
272272
if (!pid_child_should_wake(wo, p))
273273
return 0;
274274

275+
list_del_init(&wait->entry);
276+
275277
/* cancel is in progress */
276278
if (atomic_fetch_inc(&iw->refs) & IO_WAITID_REF_MASK)
277279
return 1;
278280

279281
req->io_task_work.func = io_waitid_cb;
280282
io_req_task_work_add(req);
281-
list_del_init(&wait->entry);
282283
return 1;
283284
}
284285

0 commit comments

Comments
 (0)