Skip to content

Commit 7dd13f7

Browse files
committed
io_uring/waitid: always prune wait queue entry in io_waitid_wait()
jira VULN-162139 cve CVE-2025-40047 commit-author Jens Axboe <[email protected]> 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: [email protected] Fixes: f31ecf6 ("io_uring: add IORING_OP_WAITID support") Reported-by: [email protected] Tested-by: [email protected] Link: https://lore.kernel.org/io-uring/[email protected]/ Signed-off-by: Jens Axboe <[email protected]> (cherry picked from commit 2f8229d) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent 311903c commit 7dd13f7

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)