HIGH Introduced in 6.19
io_uring Waitid UAF
CVE-2026-99231
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: io_uring/waitid: own the request before clearing ->head io_waitid_remove_wq() only takes the wait queue lock if ->head is set. io_waitid_wait() clears ->head first thing, before it tries to become the owner of the request by bumping ->refs. If somebody else owns the request at that point, nothing keeps it from completing the request while the wake up handler is still going to touch it: CPU0 (io_waitid_wait) CPU1 (io_waitid, holds a ref) list_del_init(&wait->entry) smp_store_release(&iw->head, NULL) __do_wait() finds another child io_waitid_remove_wq() // ->head == NULL, no locking io_waitid_finish(), IOU_COMPLETE // request freed and reused atomic_fetch_inc(&iw->refs) The same goes for __io_waitid_cancel() if it claims the request in that window. ->refs is part of the per opcode data of the request, so this increments whatever the next user of the request keeps there. If that happens to be zero, the handler concludes that it owns the request, and queues io_waitid_cb() for it. With the window held open by a delay, and the request reused for a receive that is waiting for data: BUG: KASAN: slab-use-after-free in __wake_up_common+0x1ca/0x1f0 __wake_up_sync_key+0x36/0x50 sock_def_readable+0xf1/0x420 unix_stream_sendmsg+0x60b/0x1110 Allocated by task 87: io_arm_apoll+0x1ed/0x940 Freed by task 87: __io_submit_flush_completions+0x118d/0x1a10 tctx_task_work_run+0x327/0x950 Only clear ->head once the handler owns the request. If it doesn't, the owner finds ->head set and has to wait for the lock, which is held by the caller of the handler. Deleting the already deleted entry again is harmless.
02KernelScan AI Analysis
Risk summary
A local attacker can exploit a race condition in io_uring's waitid handling to trigger a use-after-free, leading to kernel privilege escalation or denial of service. The vulnerability is reachable by any unprivileged local user with access to io_uring syscalls, including from within containers.
Vulnerability analysis
The io_uring waitid implementation clears a request's wait-queue head pointer before taking ownership of the request by incrementing its reference count. This creates a race window where another thread that already owns the request can complete and free it, then have the memory reused for a different operation. When the first thread subsequently increments the reference count on the now-freed object, it may incorrectly believe it owns the request and queue a callback on the recycled memory, causing a use-after-free. The fix reorders the operations so the reference count is incremented first; only if the thread successfully becomes the owner does it clear the head pointer, otherwise the existing owner must acquire the wait-queue lock (held by the first thread) before completing. Any local user who can invoke io_uring syscalls can trigger this race, making it exploitable from unprivileged contexts and containers.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.12.113 | 6.12.115 | bf01da1a9cca |
| 6.18 | 6.18.52 | 6.18.60 | 8381a912c65b |
| 7.2 | 6.19 | 7.2.14 | c10ad2813e15 |
| 7.3 | 6.19 | 7.3.2 | 6e11ce129b34 |
| mainline | 6.19 | 7.4-rc1 | c254eec4364b |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Affected — no CIP fix yet (latest 6.12.114-cip34) |