HIGH Introduced in 6.7
io_uring Waitid UAF
CVE-2026-99227
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: prevent cancel reference wrap io_waitid packs the cancellation state into bit 31 of ->refs and uses bits 30:0 as a 31-bit reference counter: #define IO_WAITID_CANCEL_FLAG BIT(31) #define IO_WAITID_REF_MASK GENMASK(30, 0) __io_waitid_cancel() marks a request canceled, then increments the low bits of ->refs to claim completion ownership. When another path owns the request, the increment remains even though cancellation returns false. The request remains discoverable by cancellation, so repeated failed attempts can wrap the 31-bit reference field to zero. A later cancellation can claim ownership and complete the request a second time. Use atomic_fetch_or() when setting the cancel flag and inspect the old flag value. The first cancel attempt continues to the existing ownership increment, preserving its wake and issuer handoff semantics. Later attempts see the cancel flag and return without incrementing the reference field. This makes repeated failed cancellation attempts idempotent while leaving the first-cancel state transitions unchanged.
02KernelScan AI Analysis
Risk summary
A local unprivileged user can exploit an integer wrap-around in the io_uring waitid cancellation path to trigger a use-after-free, leading to kernel privilege escalation. The bug requires approximately 2 billion failed cancellation attempts to wrap a 31-bit reference counter, making exploitation complex but feasible with heap grooming. Products exposing io_uring to untrusted code (containers, multi-tenant systems) are at highest risk.
Vulnerability analysis
The io_uring waitid implementation packs a cancellation flag and a 31-bit reference counter into a single atomic word. When cancelling a request owned by another path, the code still increments the reference counter even though cancellation fails, leaving the request discoverable for future cancellation attempts. Repeated failed cancellations — around 2 billion — wrap the counter to zero, allowing a subsequent cancellation to incorrectly claim ownership and complete the request a second time. This double completion creates a use-after-free condition exploitable for arbitrary kernel memory read/write. The fix makes failed cancellation attempts idempotent by using atomic_fetch_or to check whether the cancel flag was already set; only the first attempt increments the reference counter. The vulnerability is reachable by any local user with access to the io_uring interface (typically unprivileged), and does not require special hardware or configuration beyond CONFIG_IO_URING with IORING_OP_WAITID support (kernel 6.7+).
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.7 | 6.12.115 | 20b67288574c |
| 6.18 | 6.7 | 6.18.60 | 5bfeee177479 |
| 7.2 | 6.7 | 7.2.14 | 857aa2012b91 |
| 7.3 | 6.7 | 7.3.1 | 22fb4a4518e3 |
| mainline | 6.7 | 7.4-rc1 | 98787d3fa4e9 |
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) |