CVE-2026-138867: mm/memory: constrain generic_access_phys() to page boundary
In the Linux kernel, the following vulnerability has been resolved:
mm/memory: constrain genericaccessphys() to page boundary
This patch addresses an issue in genericaccessphys() where accessing memory across page boundaries in PFNMAP VMAs assumes physical pages are contiguous, which can lead to accessing unintended physical memory or exceeding VMA boundaries.
genericaccessphys() improperly validates the memory access range: it only validates the start address using followpfnmapstart() and passes PAGEALIGN(len + offset) to ioremapprot().
This poses two problems: 1. In PFNMAP VMAs, consecutive virtual pages are not guaranteed to be physically contiguous, and individual PTEs may have different access permissions or writability. 2. The mapping may cross VMA boundaries if len extends beyond vma->vmend.
Constrain the access in genericaccessphys() to at most the current page boundary (PAGESIZE - offset) and map only a single PAGESIZE via ioremapprot(). Since the caller accessremotevm() already loops over the requested length and handles partial transfers, it will naturally iterate over the remaining pages.
Also add a missing (resourcesizet) cast during PFN re-validation to avoid truncation on 32-bit PAE systems.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.3 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.5 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.11 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.13 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.15 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.19 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.20 - 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.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1Fixed in 7.3.4-1
Event History
Frequently Asked Questions
What memory mappings are relevant to this issue?
The issue is specific to PFNMAP VMAs. It becomes relevant when an access spans a page boundary, because adjacent virtual pages in such mappings are not guaranteed to refer to contiguous physical memory and may have different permissions.
What can happen when the vulnerable path handles a multi-page access?
It may access unintended physical memory or extend beyond the end of the VMA. The original range validation checks only the starting address while mapping a length that can cover additional pages.
What behavior does the fix enforce?
Each operation is limited to the remainder of the current page, and only one page is mapped at a time. Remaining bytes are handled by the existing remote-memory access loop on subsequent iterations.