[PATCH 46/46] fs/proc/task_mmu: refuse addresses beyond 32 bits on 32bit

Pedro Falcato pfalcato at suse.de
Tue Oct 27 09:13:47 PDT 2026


On Tue, Oct 27, 2026 at 12:18:06AM +0100, David Hildenbrand (Arm) wrote:
> From: Josef Bacik <josef at toxicpanda.com>
> 
> The addresses in struct pm_scan_arg are 64 bits wide.  The first thing
> pagemap_scan_get_args() does with them is to cast them to unsigned
> long.  On a 32-bit kernel the upper half is dropped without a word:
> PAGEMAP_SCAN of 0x100001000-0x100002000 scans, and with
> PM_SCAN_WP_MATCHING write-protects, 0x1000-0x2000, stores the result
> at the lower half of vec, and reports success.
> 
> Return -EFAULT, as for other addresses outside of the address space.
> 
> This is probably not worth CCing stable.
> 
> Fix generated by an LLM and sent by Josef Bacik in private.
> 
> Fixes: 52526ca7fdb9 ("fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs")
> Signed-off-by: Josef Bacik <josef at toxicpanda.com>
> Acked-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>
> Signed-off-by: David Hildenbrand (Arm) <david at kernel.org>

Reviewed-by: Pedro Falcato <pfalcato at suse.de> 

-- 
Pedro



More information about the kexec mailing list