CVE-2026-74658: futex: Prevent robust futex exit race some more
In the Linux kernel, the following vulnerability has been resolved:
futex: Prevent robust futex exit race some more
A robust futex unlock stores 0 over the whole futex value - wiping FUTEXWAITERS - and wakes a single waiter. That wakeup is a one-shot notification: the protocol relies on its recipient to either acquire the futex (and eventually unlock while aware of the remaining contention) or re-arm FUTEXWAITERS before sleeping again. If the woken waiter is killed before it can do either, the kernel must jump in and wake the next task down the line.
This is a known complication of the futex protocol with a previous partial fix in commit ca16d5bee598 ("futex: Prevent robust futex exit race"). Unfortunately, that fix is insufficient.
If a third task re-acquired the futex through the uncontended fast path in the meantime, the notification is lost: robust exit processing sees that it is owned by another task and does nothing, while the new owner sees no FUTEXWAITERS when it unlocks and wakes nobody. The remaining waiters sleep forever behind a free futex:
A owns the futex, B and C sleep in FUTEXWAIT uval == A | FUTEXWAITERS A robust unlock: store 0, FUTEXWAKE(1) wakes B uval == 0 D fast path acquire: cmpxchg(0 -> D) uval == D, no FUTEXWAITERS B killed before acting on the wakeup B exit walk, pending op: owner D != B -> no action D unlock: no FUTEXWAITERS -> no wake C sleeps forever
This is clearly a shortcoming in the implementation, which fails to keep the FUTEXWAITERS bit consistent.
Work around this by augmenting the robust list exit processing to also perform the extra wakeup if the futex word is owned by another thread but FUTEXWAITERS is not set.
This does not fix the problem of a non-contended take over/release and free sequence, which has been discussed for years and has been addressed by commit 3ca9595d9fb6 ("futex: Add support for unlocking robust futexes") and subsequent changes, but failed to take the problem described above into account.
A more complete solution which is based on the in kernel unlock of contended robust futexes has been discussed in the context of this change and should show up in mainline sooner than later.
[ tglx: Amend change log slightly and fixup coding style ]
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 3ca9595d9fb6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch ca16d5bee598 - Operational
Apply the mainline follow-up that amends the futex robust wakeup/exit handling: the change described as 'futex: Prevent robust futex exit race some more' and the robust futex unlock support in commits 3ca9595d9fb6 and ca16d5bee598.
Event History
Frequently Asked Questions
Which systems are realistically exposed to this issue?
Systems running Linux workloads that use robust futexes and can have multiple tasks contending for the same futex are exposed. The failure affects waiters that can remain blocked indefinitely after a specific race.
What sequence is required for the race to cause an indefinite wait?
A robust futex unlock must clear the FUTEX_WAITERS state and wake one waiter, and that woken waiter must be killed before acquiring the futex or restoring FUTEX_WAITERS. Another task must then reacquire the futex through the uncontended fast path, allowing remaining waiters to sleep behind a free futex.
What is the practical impact if the race occurs?
Remaining futex waiters can sleep forever even though the futex is no longer held. This can cause affected application tasks to hang.
What can be done if the affected kernel cannot be updated immediately?
The provided data identifies the resolved stable-kernel changes in the listed references. No configuration-based workaround or reliable runtime detection method is provided.