CVE-2026-143173: aio: don't let exit_aio() return before complete() is done
In the Linux kernel, the following vulnerability has been resolved:
aio: don't let exitaio() return before complete() is done
exitaio() kills all contexts in one go and waits for them with a single on-stack struct ctxrqwait. The count starts at table->nr, each killed context drops one count in freeioctxreqs() and exitaio() subtracts the empty slots afterwards. Whoever drops the last count either calls complete() or, if it is exitaio(), skips the wait.
With a full table skipped is zero and atomicsubandtest(0, ...) only tells us whether the count already hit zero. freeioctxreqs() runs from the percpuref RCU callback, so if exitaio() is off the CPU long enough the last callback can have done its atomicdecandtest() but not yet called complete():
freeioctxreqs() exitaio() atomicdecandtest() // 1 -> 0 atomicsubandtest(0) // true kfree(table) return complete(&wait.comp)
complete() then locks and writes a completion on a stack frame that is gone. So hold an extra count for exitaio() itself. Then the last count is always dropped by exitaio() after it waited, or by a callback while exitaio() waits for it. An unprivileged user gets there with four iosetup() calls and an exit without iodestroy().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.13 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.17 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 4.1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.276 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.227 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7
Event History
Frequently Asked Questions
What level of access does an attacker need?
An unprivileged local user can reach the vulnerable condition. The described path uses four io_setup() calls.
What kind of failure can this trigger?
The race can cause complete() to write to a completion object on an exit_aio() stack frame after that function has returned and the frame is no longer valid.