CVE-2026-99663: mm/gup: fix clearing folios in memfd_pin_folios()
In the Linux kernel, the following vulnerability has been resolved:
mm/gup: fix clearing folios in memfdpinfolios()
memfdpinfolios() pins folios obtained directly from the page cache without checking whether they are uptodate. However, shmem fallocate() can leave newly allocated folios uncleared and not uptodate. Callers such as udmabuf can then expose uninitialized memory to userspace.
Clear non-uptodate folios and mark them uptodate under the folio lock before returning them to the caller.
Fix generated by an LLM and sent by Chris Mason in private.
[ david: simplify description and comment ]
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.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 6.1.176-1Fixed in 6.1.192-2Fixed in 7.3.5-1
Event History
Frequently Asked Questions
Which environments are most likely to be exposed?
Exposure requires a kernel path that pins folios through memfd_pin_folios(), with udmabuf identified as an example caller. The issue can arise when shmem fallocate() has created newly allocated folios that remain uncleared and not uptodate.
What would an attacker need to trigger the issue?
They would need access to a userspace-accessible path, such as one involving udmabuf, that obtains folios pinned from the page cache after the relevant shmem fallocate() condition. The resulting risk is exposure of uninitialized memory to userspace.
How can I identify a fixed kernel from the supplied information?
No affected or fixed kernel version ranges are provided. The supplied references identify three stable-tree commits associated with the fix; the fix clears non-uptodate folios and marks them uptodate while holding the folio lock.