CVE-2026-74658: futex: Prevent robust futex exit race some more
Greg Kroah-Hartman <[email protected]>
| Newsgroups | org.kernel.vger.linux-cve-announce |
|---|---|
| Message-ID | <2026082227-CVE-2026-74658-3974@gregkh> |
From: Greg Kroah-Hartman <[email protected]> Description =========== 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 FUTEX_WAITERS - 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 FUTEX_WAITERS 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 FUTEX_WAITERS when it unlocks and wakes nobody. The remaining waiters sleep forever behind a free futex: A owns the futex, B and C sleep in FUTEX_WAIT uval == A | FUTEX_WAITERS A robust unlock: store 0, FUTEX_WAKE(1) wakes B uval == 0 D fast path acquire: cmpxchg(0 -> D) uval == D, no FUTEX_WAITERS B killed before acting on the wakeup B exit walk, pending op: owner D != B -> no action D unlock: no FUTEX_WAITERS -> no wake C sleeps forever This is clearly a shortcoming in the implementation, which fails to keep the FUTEX_WAITERS 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 FUTEX_WAITERS 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 ] The Linux kernel CVE team has assigned CVE-2026-74658 to this issue. Affected and fixed versions =========================== Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 5.10.265 with commit 83b0f71d5a313a765754acab51d2ecc5de76e0b9 Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 5.15.216 with commit a1c2b7b86a946b6b172bce44d74553da2323a36c Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 6.1.183 with commit 33bfa85458105d6169ebdb697f692b8bb8025bae Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 6.6.152 with commit aa5c571901c6b22b58373693a4bf889ecab11ff5 Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 6.12.104 with commit 925628656b73b70930972ccde421de4f758d8650 Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 6.18.45 with commit 7b8c53263f8878bdd12c87e147ac6feca5c05211 Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 7.1.9 with commit 7cf710e70f9bb8ea75f759ebed09871801315992 Issue introduced in 5.5 with commit ca16d5bee59807bf04deaab0a8eccecd5061528c and fixed in 7.2 with commit 6d4514ca9cdf61fec4ec634cf50386f6f7e69748 Issue introduced in 3.16.82 with commit 8dd558881e0f4d6942c19bd8f7b1a7c19becb59e Issue introduced in 4.9.264 with commit b90aa237f469c3575190a5e6a855b76ad1d2ce94 Issue introduced in 4.14.158 with commit 3e24098da750991f75819069c79e090dfd029219 Issue introduced in 4.19.87 with commit 2819f4030f43057238992a4adcd950d7c95aff65 Issue introduced in 5.3.14 with commit 2c60b44d8ba9d62c2693d2692f118177f212b1a8 Issue introduced in 5.4.1 with commit 82ca3ab31b9cf23b86436a85381e4c5757bc6b80 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-74658 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: kernel/futex/core.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/83b0f71d5a313a765754acab51d2ecc5de76e0b9 https://git.kernel.org/stable/c/a1c2b7b86a946b6b172bce44d74553da2323a36c https://git.kernel.org/stable/c/33bfa85458105d6169ebdb697f692b8bb8025bae https://git.kernel.org/stable/c/aa5c571901c6b22b58373693a4bf889ecab11ff5 https://git.kernel.org/stable/c/925628656b73b70930972ccde421de4f758d8650 https://git.kernel.org/stable/c/7b8c53263f8878bdd12c87e147ac6feca5c05211 https://git.kernel.org/stable/c/7cf710e70f9bb8ea75f759ebed09871801315992 https://git.kernel.org/stable/c/6d4514ca9cdf61fec4ec634cf50386f6f7e69748