CVE-2026-99707: mm/khugepaged: flush deferred unmaps before dropping a failed folio
In the Linux kernel, the following vulnerability has been resolved:
mm/khugepaged: flush deferred unmaps before dropping a failed folio
collapsefile() can fail its reference-count or dirty-folio check after unmapping with TTUBATCHFLUSH. Both paths put back the isolated folio, then unlock it and drop the lookup reference before reaching the common trytounmapflush().
The page-cache reference does not keep the folio stable once the lock is released. Another collapse can replace and free it. With its PTEs already gone, that collapse cannot flush the first task's per-task TLB batch, and retractpagetables() skips short or unaligned VMAs. A CPU can therefore retain a user translation to the freed folio. This has been reproduced with unprivileged MADVCOLLAPSE on a memfd.
Flush at outunlock while the lookup reference and folio lock are still held. The common flush continues to cover the accumulated pagelist on both success and rollback, preserving batching on successful collapses.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What capabilities does an attacker need to reproduce this issue?
The issue has been reproduced by an unprivileged user using MADV_COLLAPSE on a memfd. The vulnerable condition involves a failed file-folio collapse after PTEs were unmapped with batched TLB flushing.
What is the security impact of the race?
A CPU can retain a user-space translation to a folio after that folio has been freed. This occurs when a subsequent collapse replaces and frees the folio before the first task's deferred per-task TLB batch is flushed.