CVE-2026-142794: mm: khugepaged: fix folio is used after pte_unmap_unlock()
In the Linux kernel, the following vulnerability has been resolved:
mm: khugepaged: fix folio is used after pteunmapunlock()
After the page table lock has dropped, the folio can be freed concurrently. The tracemmkhugepagedscanpmd() is left with a dangling folio pointer.
So using the foliopfn() before dropping the page table lock, closing use-after-free window.
And other pre-existing bug, When the for (i = 0; i < HPAGEPMDNR; i++) iteration to terminate and the folio operation preceding is normal, but pfn will be incorrect. so we really only trace the PFN if it really was problematic.
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.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.3-1
Event History
Frequently Asked Questions
Which kernel subsystem and execution path are involved?
The issue is in the memory-management subsystem's khugepaged PMD scanning path, specifically the trace_mm_khugepaged_scan_pmd() tracing call.
What condition creates the unsafe access?
The page table lock is released before the folio is no longer needed. Another thread can free the folio after that unlock, leaving the tracing path with a dangling pointer.
What does the fix change besides closing the use-after-free window?
It obtains the PFN before dropping the page table lock. It also limits PFN tracing to cases that were actually problematic, avoiding an incorrect PFN after the page-iteration loop completes normally.