Skip to content

Commit 67d4a1c

Browse files
brooniewilldeacon
authored andcommitted
arm64: mm: Mark executable text as guarded pages
When the kernel is built for BTI and running on a system which supports make all executable text guarded pages to ensure that loadable module and JITed BPF code is protected by BTI. Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent fa76cfe commit 67d4a1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/mm/pageattr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ int set_memory_nx(unsigned long addr, int numpages)
126126
{
127127
return change_memory_common(addr, numpages,
128128
__pgprot(PTE_PXN),
129-
__pgprot(0));
129+
__pgprot(PTE_MAYBE_GP));
130130
}
131131

132132
int set_memory_x(unsigned long addr, int numpages)
133133
{
134134
return change_memory_common(addr, numpages,
135-
__pgprot(0),
135+
__pgprot(PTE_MAYBE_GP),
136136
__pgprot(PTE_PXN));
137137
}
138138

0 commit comments

Comments
 (0)