Thread (139 messages) 139 messages, 12 authors, 2024-08-20

Re: [PATCH v4 17/29] arm64: implement PKEYS support

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2024-07-05 17:00:02
Also in: kvmarm, linux-arm-kernel, linux-fsdevel, linux-mm

On Fri, May 03, 2024 at 02:01:35PM +0100, Joey Gouly wrote:
quoted hunk ↗ jump to hunk
@@ -163,7 +182,8 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys)
 #define pte_access_permitted_no_overlay(pte, write) \
 	(((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER)) && (!(write) || pte_write(pte)))
 #define pte_access_permitted(pte, write) \
-	pte_access_permitted_no_overlay(pte, write)
+	(pte_access_permitted_no_overlay(pte, write) && \
+	por_el0_allows_pkey(FIELD_GET(PTE_PO_IDX_MASK, pte_val(pte)), write, false))
I'm still not entirely convinced on checking the keys during fast GUP
but that's what x86 and powerpc do already, so I guess we'll follow the
same ABI.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help