[PATCH v2] arm64: mm: fix pass user prot to ioremap_prot in generic_access_phys

Andrew Morton akpm at linux-foundation.org
Tue Jan 27 13:10:11 PST 2026


On Tue, 27 Jan 2026 17:01:29 +0800 Jinjiang Tu <tujinjiang at huawei.com> wrote:

> The root cause is that generic_access_phys() passes a user pte to
> ioremap_prot(), the user pte sets PTE_USER and PTE_NG bits.  Consequently,
> any subsequent kernel-mode access to the remapped address raises a fault.
> 
> To fix it, define arch_mk_kernel_prot() to convert user prot to kernel
> prot for arm64, and call arch_mk_kernel_prot() in generic_access_phys(),
> so that a user prot is passed to ioremap_prot().

MM changes are Reviewed-by: Andrew Morton <akpm at linux-foundation.org>

Thanks.  I assume the arm maintainers will process this.

> Fixes: 893dea9ccd08 ("arm64: Add HAVE_IOREMAP_PROT support")

huh, three years.



More information about the linux-arm-kernel mailing list