CVE-2026-99662: mm/gup: fix out-of-bounds write for nr_pages == 0 in GUP-fast
In the Linux kernel, the following vulnerability has been resolved:
mm/gup: fix out-of-bounds write for nrpages == 0 in GUP-fast
With nrpages == 0, GUP-fast still enters its page table walk and can write past the caller's page array. The old end <= start check caught empty ranges, but was replaced with an overflow check.
Users such as OrangeFS can pass a zero page count derived from a userspace-supplied length. So let's return zero for nrpages == 0 before starting the walk, just like GUP-slow.
Fix generated by an LLM and sent by Chris Mason in private.
[ david: simplify 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 5.11 - 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
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What input is needed to trigger the vulnerable path?
GUP-fast must be called with nr_pages set to zero. One identified route is a zero page count derived by OrangeFS from a userspace-supplied length.
Does an empty page range avoid the affected page-table walk?
Not in the vulnerable behavior. Although an earlier end <= start check caught empty ranges, it was replaced by an overflow check, allowing GUP-fast to enter the page-table walk when nr_pages is zero.
What is the impact of reaching this condition?
GUP-fast can write beyond the caller-provided page array, resulting in an out-of-bounds write.
What mitigation is implemented by the fix?
The fix returns zero immediately when nr_pages is zero, before starting the page-table walk. This matches the handling used by GUP-slow.