aio: don't let exit_aio() return before complete() is done
- CVE-2026-143173
- GHSA-5cqx-w9fv-94gw
- EUVD-2026-142823
Description
In the Linux kernel, the following vulnerability has been resolved: aio: don't let exit_aio() return before complete() is done exit_aio() kills all contexts in one go and waits for them with a single on-stack struct ctx_rq_wait. The count starts at table->nr, each killed context drops one count in free_ioctx_reqs() and exit_aio() subtracts the empty slots afterwards. Whoever drops the last count either calls complete() or, if it is exit_aio(), skips the wait. With a full table skipped is zero and atomic_sub_and_test(0, ...) only tells us whether the count already hit zero. free_ioctx_reqs() runs from the percpu_ref RCU callback, so if exit_aio() is off the CPU long enough the last callback can have done its atomic_dec_and_test() but not yet called complete(): free_ioctx_reqs() exit_aio() atomic_dec_and_test() // 1 -> 0 atomic_sub_and_test(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 exit_aio() itself. Then the last count is always dropped by exit_aio() after it waited, or by a callback while exit_aio() waits for it. An unprivileged user gets there with four io_setup() calls and an exit without io_destroy().
Text from the CVE.org record.
Recommendation
Linux
- If you run a version from 3.16.57 to before 3.17update to 3.17 or laterMinor version change: check the release notes
- If you run a version from 3.12.44 to before 3.13update to 3.13 or laterMinor version change: check the release notes
Some affected versions have no stated fix.
Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
Linux
Affected versions Fixed in from 3.16.57 to before 3.17 3.17 from 3.12.44 to before 3.13 3.13 from 4.0.6 to before 4.1 none stated 4.1 none stated before 4.1: not affected none stated from 5.10.276 up to 5.10.*: not affected none stated from 5.15.227 up to 5.15.*: not affected none stated from 6.12.120 up to 6.12.*: not affected none stated and 3 more
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.