summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorChris Mason <mason@kernel.org>2026-10-31 10:39:49 +0100
committerDavid Hildenbrand (Arm) <david@kernel.org>2026-11-03 20:20:52 +0100
commitc83ee2fa5a94edb2e04102b9dd4f1ee0eeb2b932 (patch)
treeab36b1ec7001bf997d9436b880ce1625f41a07c3 /tools/lib/python
parent79cb51d538abc459f74e046d27797d36b133ce0e (diff)
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. Fixes: 89c1905d9c14 ("mm/gup: introduce memfd_pin_folios() for pinning memfd folios") Cc: stable@vger.kernel.org Signed-off-by: Chris Mason <mason@kernel.org> [ david: simplify description and comment ] Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org> Reviewed-by: Samiullah Khawaja <skhawaja@google.com> Tested-by: Samiullah Khawaja <skhawaja@google.com> Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com> Link: https://patch.msgid.link/20261031-fixes_core-v3-20-d6437171ecc3@kernel.org Reviewed-by: Lance Yang <lance.yang@linux.dev> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions