Re: [PATCH 46/46] fs/proc/task_mmu: refuse addresses beyond 32 bits on 32bit
From: Pedro Falcato
Date: Tue Oct 27 2026 - 12:17:54 EST
On Tue, Oct 27, 2026 at 12:18:06AM +0100, David Hildenbrand (Arm) wrote:
> From: Josef Bacik <josef@xxxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxx>
> Acked-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>
--
Pedro