KernelScan.io

HIGH Introduced in 6.7

io_uring Waitid UAF

CVE-2026-99227

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.0HIGH

01

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.

02

Engine v0.10.0

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.

Affectedio_uring/waitid.c (io_uring subsystem)

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+).

03

BranchIntroducedFixed inPatch commit
6.126.76.12.11520b67288574c
6.186.76.18.605bfeee177479
7.26.77.2.14857aa2012b91
7.36.77.3.122fb4a4518e3
mainline6.77.4-rc198787d3fa4e9