CVE-2026-99915: mm/page_vma_mapped: continue past nonmatching huge PMDs
In the Linux kernel, the following vulnerability has been resolved:
mm/pagevmamapped: continue past nonmatching huge PMDs
A PTE-mapped large folio can straddle PMD boundaries after an unaligned mremap(). If the first part is discarded and replaced with an unrelated huge PMD, pagevmamappedwalk() stops instead of looking for the rest of the folio in subsequent PMDs.
This also affects migration entries. A walk that stops at an unrelated huge PMD can leave migration PTEs behind when migration or an anonymous folio split restores the mappings. Those entries do not hold mapping references and can outlive the source folio.
This issue can lead to memory corruption and I have a reproducer for it.
Skip the current PMD rather than ending the walk on a flag or PFN mismatch. Do the same if the PMD became nonpresent before the locked recheck. Release the PMD lock, clear the per-PMD state and advance with stepforward(), so the existing range limit controls termination. This covers present, migration and device-private huge PMDs while preserving the matching-PMD and split-to-PTE paths.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - 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.4
Event History
Frequently Asked Questions
What memory-management sequence is required for this issue to occur?
A PTE-mapped large folio must straddle PMD boundaries after an unaligned mremap(). The first part must then be discarded and replaced by an unrelated huge PMD, causing the page-vma mapping walk to encounter a nonmatching PMD before it reaches the rest of the folio.
Which huge-PMD states are relevant to the faulty walk?
The affected walk behavior applies to present huge PMDs, migration huge PMDs, and device-private huge PMDs. A PMD that becomes nonpresent before the locked recheck is also handled by the fix.
What can happen after the walk stops at an unrelated huge PMD?
Migration PTEs can be left behind when migration or an anonymous folio split restores mappings. Those entries do not hold mapping references, can outlive the source folio, and can lead to memory corruption.