CVE-2026-138833: proc/task_mmu: handle special PMDs in clear_refs and pagemap
In the Linux kernel, the following vulnerability has been resolved:
proc/taskmmu: handle special PMDs in clearrefs and pagemap
mshvvtllow can install a special PMD from a PFN supplied in the mmap file offset. That PFN need not have a memmap entry. Reading /proc/PID/pagemap or writing /proc/PID/clearrefs for such a mapping oopses the kernel.
With a test driver mapping the PFN at the 1 TiB mark:
echo 1 > /proc/self/clearrefs
BUG: unable to handle page fault for address: fffffb5b80000008 #PF: supervisor read access in kernel mode #PF: errorcode(0x0000) - not-present page RIP: 0010:clearrefspterange+0xb1/0x1e0 Call Trace: walkpgdrange+0x50a/0xad0 walkpagerange+0x6a/0x1d0 walkpagerangemmunsafe+0x193/0x230 clearrefswrite+0x18e/0x3f0
pread(pagemapfd, buf, 512 8, addr / PAGESIZE 8)
BUG: unable to handle page fault for address: fffff57840000008 RIP: 0010:pagemappmdrange+0x3cf/0x6b0 Call Trace: walkpgdrange+0x50a/0xad0 walkpagerange+0x6a/0x1d0 walkpagerangemmunsafe+0x193/0x230 pagemapread+0x1dc/0x350
clearrefspterange() passes the PMD to pmdfolio(), while pagemappmdrangethp() uses pmdpage() followed by pagefolio().
Both paths assume the PFN has a struct page and dereference bad address.
Use vmnormalfoliopmd() and vmnormalpagepmd() so clearrefs skips folio operations and pagemap skips folio-derived flags for special PMDs. This matches the PTE paths, which already use vmnormalfolio() and vmnormalpage().
User-facing notes: - Pagemap still reports PMPRESENT and the PFN to a CAPSYSADMIN reader.
- For a special PMD backed by a valid memmap entry and for the huge zero PMD, PMFILE changes from set to clear.
- PMMMAPEXCLUSIVE is already clear in both cases.
- The output for an anonymous THP is unchanged.
Tested in QEMU with the test driver on broken and fixed kernels. Both proc operations oops before the fix and return 0 after it.
This is technically reachable via mshvvtllow, so I tagged it stable.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to the crash condition?
Systems are exposed when mshv_vtl_low installs a special PMD from a PFN supplied through the mmap file offset and that PFN has no memmap entry. The affected mapping must then be examined through the process pagemap or clear_refs proc interfaces.
What operations trigger the failure?
Reading /proc/PID/pagemap for the affected mapping or writing to /proc/PID/clear_refs can trigger a kernel oops. The failing paths shown are clear_refs_pte_range() and pagemap_pmd_range().
How can an administrator recognize that this issue has occurred?
Kernel logs may report an unable-to-handle-page-fault error during supervisor read access in kernel mode. Stack traces can include clear_refs_pte_range, pagemap_pmd_range, walk_pgd_range, pagemap_read, or clear_refs_write.