Skip to content

Commit d8b28c0

Browse files
author
CKI Backport Bot
committed
io_uring/waitid: always prune wait queue entry in io_waitid_wait()
JIRA: https://issues.redhat.com/browse/RHEL-124977 CVE: CVE-2025-40047 commit 2f8229d Author: Jens Axboe <axboe@kernel.dk> Date: Tue Oct 7 07:46:00 2025 -0600 io_uring/waitid: always prune wait queue entry in io_waitid_wait() 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> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 3fddb92 commit d8b28c0

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
@@ -232,13 +232,14 @@ static int io_waitid_wait(struct wait_queue_entry *wait, unsigned mode,
232232
if (!pid_child_should_wake(wo, p))
233233
return 0;
234234

235+
list_del_init(&wait->entry);
236+
235237
/* cancel is in progress */
236238
if (atomic_fetch_inc(&iw->refs) & IO_WAITID_REF_MASK)
237239
return 1;
238240

239241
req->io_task_work.func = io_waitid_cb;
240242
io_req_task_work_add(req);
241-
list_del_init(&wait->entry);
242243
return 1;
243244
}
244245

0 commit comments

Comments
 (0)