CVE-2026-99667: mm/khugepaged: always recheck the pmd in try_collapse_pte_mapped_thp()
In the Linux kernel, the following vulnerability has been resolved:
mm/khugepaged: always recheck the pmd in trycollapseptemappedthp()
trycollapseptemappedthp() drops the PTE lock after it has cleared the page table, and takes the PMD lock and the PTE lock to remove it.
In between, MADVDONTNEED with CONFIGPTRECLAIM can reclaim the page table. The pmdsame() check is supposed to handle this, but it is only done with CONFIGSPLITPTEPTLOCKS.
Fix it by performing the check unconditionally.
Fix generated by an LLM and sent by Josef Bacik in private.
[ david: adjust description ]
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.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 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What conditions are required for this race to occur?
The race requires try_collapse_pte_mapped_thp() to drop the PTE lock after clearing the page table, while MADV_DONTNEED and CONFIG_PT_RECLAIM reclaim that page table before it is removed. The vulnerable path exists because the PMD consistency check was previously limited to CONFIG_SPLIT_PTE_PTLOCKS builds.
Are systems without CONFIG_SPLIT_PTE_PTLOCKS affected?
Yes. The issue is that the required pmd_same() validation was performed only when CONFIG_SPLIT_PTE_PTLOCKS was enabled, even though page-table reclamation can occur during the unlocked interval. The fix makes the validation unconditional.
What can be done if the kernel cannot be updated immediately?
The provided information identifies CONFIG_PT_RECLAIM and MADV_DONTNEED as participating in the race, but does not provide a validated workaround or configuration mitigation. Applying a kernel release containing the referenced fixes is the documented remediation.