Thread (5 messages) 5 messages, 3 authors, 10d ago

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

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2026-09-16 12:35:20
Also in: lkml

On Fri, Sep 11, 2026 at 09:58:59AM +0800, Zeng Heng wrote:
quoted hunk ↗ jump to hunk
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@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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help