diff options
| author | David Hildenbrand (Arm) <david@kernel.org> | 2026-10-31 10:39:51 +0100 |
|---|---|---|
| committer | David Hildenbrand (Arm) <david@kernel.org> | 2026-11-03 20:20:52 +0100 |
| commit | 21a3888d3d2f87b7f15ccea1f0befd57346fe899 (patch) | |
| tree | 79d03b36a5e209c94250d7bcbb046b32a08d08ef /tools/lib/python/kdoc/python_version.py | |
| parent | 1dfe4b276c23189394afb42d114ee8a54cc3aff2 (diff) | |
mm/gup: check for overflow when converting nr_pages to bytes in GUP-fast
The overflow check in gup_fast_fallback() only covers the addition to
start. The preceding nr_pages << PAGE_SHIFT can already have truncated
the length on 32bit.
Users such as RapidIO's rio_dma_transfer() can derive such page counts
from a 64-bit userspace length.
Let's just check_shl_overflow() to reject any such overflow with
-EOVERFLOW early.
Fixes: c28b1fc70390 ("mm/gup: reorganize internal_get_user_pages_fast()")
Cc: stable@vger.kernel.org
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by: Barry Song <baohua@kernel.org>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-22-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
