CVE-2026-99663: mm/gup: fix clearing folios in memfd_pin_folios()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
mm/gup: fix clearing folios in memfd_pin_folios()
memfd_pin_folios() 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 ]
The Linux kernel CVE team has assigned CVE-2026-99663 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.11 with commit 89c1905d9c140372b7f50ef48f42378cf85d9bc5 and fixed in 6.12.118 with commit 9b9c506018859bb33f01e4b9df213d41b9ca4cc2 Issue introduced in 6.11 with commit 89c1905d9c140372b7f50ef48f42378cf85d9bc5 and fixed in 6.18.64 with commit d56f6835532c59b1b5e2d43f373f31586e7e457f Issue introduced in 6.11 with commit 89c1905d9c140372b7f50ef48f42378cf85d9bc5 and fixed in 7.3.5 with commit 65f4a8ef0adf18601c6ddbfd0e3918afffaeb890 Issue introduced in 6.11 with commit 89c1905d9c140372b7f50ef48f42378cf85d9bc5 and fixed in 7.4-rc2 with commit c83ee2fa5a94edb2e04102b9dd4f1ee0eeb2b932
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-99663
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
mm/gup.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/9b9c506018859bb33f01e4b9df213d41b9ca4cc2 https://git.kernel.org/stable/c/d56f6835532c59b1b5e2d43f373f31586e7e457f https://git.kernel.org/stable/c/65f4a8ef0adf18601c6ddbfd0e3918afffaeb890 https://git.kernel.org/stable/c/c83ee2fa5a94edb2e04102b9dd4f1ee0eeb2b932