Skip to contentSkip to conversation

CVE-2026-99227: io_uring/waitid: prevent cancel reference wrap

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 2

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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.

The Linux kernel CVE team has assigned CVE-2026-99227 to this issue.

Severity
========

CVSS v3.1: 7.8 HIGH
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected and fixed versions
===========================

	Issue introduced in 6.7 with commit f31ecf671ddc498f20219453395794ff2383e06b and fixed in 6.12.115 with commit 20b67288574c7c3df6b8ea7ed3b7af90a868006f
	Issue introduced in 6.7 with commit f31ecf671ddc498f20219453395794ff2383e06b and fixed in 6.18.60 with commit 5bfeee1774791602a0d53eb717f00f172127a017
	Issue introduced in 6.7 with commit f31ecf671ddc498f20219453395794ff2383e06b and fixed in 7.2.14 with commit 857aa2012b91cad6fdef54a4b6c632d9d0b6e64f
	Issue introduced in 6.7 with commit f31ecf671ddc498f20219453395794ff2383e06b and fixed in 7.3.1 with commit 22fb4a4518e305164c7f203608287564de292f34

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99227

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
io_uring/waitid.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/20b67288574c7c3df6b8ea7ed3b7af90a868006f
	https://git.kernel.org/stable/c/5bfeee1774791602a0d53eb717f00f172127a017
	https://git.kernel.org/stable/c/857aa2012b91cad6fdef54a4b6c632d9d0b6e64f
	https://git.kernel.org/stable/c/22fb4a4518e305164c7f203608287564de292f34
	https://git.kernel.org/stable/c/98787d3fa4e99564d2b2bc21255b21f670c450d0