CVE-2026-99731: mm/filemap: don't lose a folio lock wakeup to a signal
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
mm/filemap: don't lose a folio lock wakeup to a signal
An exclusive waiter in folio_wait_bit_common() can leave the wait loop because of a fatal signal, then be woken by folio_unlock() before finish_wait(). If the waker did not hand over the lock, the waiter returns -EINTR without trying to acquire it.
folio_wake_bit() stops after waking the first exclusive waiter, so this loses the wakeup and can leave other waiters asleep indefinitely on an unlocked folio.
After finish_wait(), let a waiter woken without a lock handoff try once more to acquire the lock. If successful, return success so the caller's eventual unlock wakes the next waiter. Otherwise, the current lock owner will do so.
Fix generated by an LLM and sent by Josef Bacik in private.
[ david: clarify and simplify comment + description ]
The Linux kernel CVE team has assigned CVE-2026-99731 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.9 with commit 5ef64cc8987a9211d3f3667331ba3411a94ddc79 and fixed in 6.12.118 with commit 3ce549d0df658a36602f2d03882688af0ea03faf Issue introduced in 5.9 with commit 5ef64cc8987a9211d3f3667331ba3411a94ddc79 and fixed in 6.18.64 with commit da815f785e568accf0d4f2ec36233d316d5035c8 Issue introduced in 5.9 with commit 5ef64cc8987a9211d3f3667331ba3411a94ddc79 and fixed in 7.3.5 with commit 31cb998f208c078a6e9656b971bb311ea490ff1e Issue introduced in 5.9 with commit 5ef64cc8987a9211d3f3667331ba3411a94ddc79 and fixed in 7.4-rc2 with commit 8ccb6ded6a47b59b4907ed4f8c293cf8122de889 Issue introduced in 5.4.255 with commit c404e1e19780d8977f67411a3b951a964c6361ae
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-99731
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:
mm/filemap.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/3ce549d0df658a36602f2d03882688af0ea03faf https://git.kernel.org/stable/c/da815f785e568accf0d4f2ec36233d316d5035c8 https://git.kernel.org/stable/c/31cb998f208c078a6e9656b971bb311ea490ff1e https://git.kernel.org/stable/c/8ccb6ded6a47b59b4907ed4f8c293cf8122de889