summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc
diff options
context:
space:
mode:
authorChris Mason <mason@kernel.org>2026-10-31 10:39:50 +0100
committerDavid Hildenbrand (Arm) <david@kernel.org>2026-11-03 20:20:52 +0100
commit1dfe4b276c23189394afb42d114ee8a54cc3aff2 (patch)
tree90ebd4f5ebd72e633ad6a0246bdefbe8de1058eb /tools/lib/python/kdoc
parentc83ee2fa5a94edb2e04102b9dd4f1ee0eeb2b932 (diff)
mm/gup: fix out-of-bounds write for nr_pages == 0 in GUP-fast
With nr_pages == 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 nr_pages == 0 before starting the walk, just like GUP-slow. Fix generated by an LLM and sent by Chris Mason in private. Fixes: c28b1fc70390 ("mm/gup: reorganize internal_get_user_pages_fast()") Cc: stable@vger.kernel.org Signed-off-by: Chris Mason <mason@kernel.org> [ david: simplify description ] Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org> Acked-by: Muchun Song <muchun.song@linux.dev> Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com> Link: https://patch.msgid.link/20261031-fixes_core-v3-21-d6437171ecc3@kernel.org Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions