[PATCH v2] arm64: io: Reject non-user protection in ioremap_prot()

Catalin Marinas catalin.marinas at arm.com
Wed Sep 16 05:35:08 PDT 2026


On Fri, Sep 11, 2026 at 09:58:59AM +0800, Zeng Heng wrote:
> diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
> index 21c8e400107c..31e67f6bd4a7 100644
> --- a/arch/arm64/include/asm/io.h
> +++ b/arch/arm64/include/asm/io.h
> @@ -272,7 +272,8 @@ static inline void __iomem *ioremap_prot(phys_addr_t phys, size_t size,
>  	pgprot_t prot;
>  	ptval_t user_prot_val = pgprot_val(user_prot);
>  
> -	if (WARN_ON_ONCE(!(user_prot_val & PTE_USER)))
> +	/* Reject PROT_NONE and exec-only */
> +	if (!(user_prot_val & PTE_USER))
>  		return NULL;
>  
>  	prot = __pgprot_modify(PAGE_KERNEL, PTE_ATTRINDX_MASK,

Looks alright to me:

Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>

It would be good to get Sashiko's finding sorted out as well
(pre-existing issue). I reckon that should go in the core code.

-- 
Catalin



More information about the linux-arm-kernel mailing list