CVE-2026-99654: mm: fix unmap_mapping_range() beyond 4 GiB on 32-bit
In the Linux kernel, the following vulnerability has been resolved:
mm: fix unmapmappingrange() beyond 4 GiB on 32-bit
Commit 9eab0421fa94 ("mm: fix unmapmappingrange high bits shift bug") made holebegin and holelen unsigned before they are shifted, by casting them to pgofft. That is an unsigned long: on a 32-bit kernel the cast cuts off the upper half of the two lofft values, so a hole which begins at 4 GiB or beyond is taken for one in the first 4 GiB of the file.
truncatepagecache() passes the new size of the file and asks for private COWed pages to be unmapped as well. If a file of 6 GiB is truncated to 5 GiB, everything from 1 GiB on is unmapped, and what a process has written to a private mapping of the range between 1 GiB and 5 GiB is lost: it reads the contents of the file again.
Where the range has an end, the wrong range is unmapped instead of the right one. The page cache copes with that, as it unmaps every folio that it removes. The callers which only have unmapmappingrange() to get rid of user mappings do not, for example drmvmanodeunmap(), whose fake offsets reach beyond 4 GiB on 32-bit, and revokeiomem() with physical addresses of more than 32 bits.
Cast to u64 instead. Nothing changes for 64-bit kernels.
Fix generated by an LLM and sent by Josef Bacik in private.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 4.20 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.5 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.11 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.16 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.2 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.7 - 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.5 - Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch 9eab0421fa94
Frequently Asked Questions
Which systems are exposed to this issue?
The issue affects 32-bit Linux kernels. It is triggered when unmap_mapping_range() handles ranges that begin at or extend beyond the 4 GiB boundary.
What conditions are needed to trigger the bug?
A relevant caller must unmap a mapping using offsets or addresses above 4 GiB on a 32-bit kernel. Examples in the provided information include truncating a file larger than 4 GiB, DRM VMA unmapping with fake offsets beyond 4 GiB, and revoking I/O memory with physical addresses above 32 bits.
What is the practical impact of an affected file truncation?
Truncating a 6 GiB file to 5 GiB can incorrectly unmap private COW mappings from 1 GiB onward. Data written by a process to private mappings between 1 GiB and 5 GiB can be lost, causing subsequent reads to return file contents again.
How can I tell whether a system is affected?
Confirm that the system runs a 32-bit Linux kernel and uses operations that unmap ranges beyond 4 GiB. The referenced stable kernel commits contain the resolved fix.