Skip to content

Commit 034aa9c

Browse files
committed
arm64: pgtable: Clear the GP bit for non-executable kernel pages
Commit cca98e9 ("mm: enforce that vmap can't map pages executable") introduced 'pgprot_nx(prot)' for arm64 but collided silently with the BTI support during the merge window, which endeavours to clear the GP bit for non-executable kernel mappings in set_memory_nx(). For consistency between the two APIs, clear the GP bit in pgprot_nx(). Acked-by: Mark Rutland <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 8dd4daa commit 034aa9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static inline pmd_t pmd_mkdevmap(pmd_t pmd)
416416
__pgprot((pgprot_val(prot) & ~(mask)) | (bits))
417417

418418
#define pgprot_nx(prot) \
419-
__pgprot_modify(prot, 0, PTE_PXN)
419+
__pgprot_modify(prot, PTE_MAYBE_GP, PTE_PXN)
420420

421421
/*
422422
* Mark the prot value as uncacheable and unbufferable.

0 commit comments

Comments
 (0)