diff options
author | Dan Carpenter <[email protected]> | 2024-11-14 11:59:32 +0300 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-11-14 22:43:48 -0800 |
commit | 669b0cb81e4e4e78cff77a5b367c7f70c0c6c05e (patch) | |
tree | d4dd283a7330b0a37d9a447f25fbba0d0bd330f5 /drivers/media/v4l2-core/v4l2-ctrls-request.c | |
parent | fd7b4f9f46d46acbc7af3a439bb0d869efdc5c58 (diff) |
fs/proc/task_mmu: prevent integer overflow in pagemap_scan_get_args()
The "arg->vec_len" variable is a u64 that comes from the user at the start
of the function. The "arg->vec_len * sizeof(struct page_region))"
multiplication can lead to integer wrapping. Use size_mul() to avoid
that.
Also the size_add/mul() functions work on unsigned long so for 32bit
systems we need to ensure that "arg->vec_len" fits in an unsigned long.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 52526ca7fdb9 ("fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs")
Signed-off-by: Dan Carpenter <[email protected]>
Cc: Andrei Vagin <[email protected]>
Cc: Andrii Nakryiko <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michał Mirosław <[email protected]>
Cc: Muhammad Usama Anjum <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Ryan Roberts <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-ctrls-request.c')
0 files changed, 0 insertions, 0 deletions