summaryrefslogtreecommitdiff
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-05-06 22:51:33 +0300
committerWill Deacon <will@kernel.org>2020-05-07 19:53:20 +0300
commit67d4a1cd09765db92581dbce8438305ea0e06004 (patch)
tree01ad148f8f9a897754128dce0b94e94524e4bf58 /arch/arm64/mm
parentfa76cfe65c1d748ef418e930a4b631a03b28f04c (diff)
downloadlinux-67d4a1cd09765db92581dbce8438305ea0e06004.tar.xz
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 <broonie@kernel.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20200506195138.22086-7-broonie@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/pageattr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
index 250c49008d73..bde08090b838 100644
--- a/arch/arm64/mm/pageattr.c
+++ b/arch/arm64/mm/pageattr.c
@@ -126,13 +126,13 @@ int set_memory_nx(unsigned long addr, int numpages)
{
return change_memory_common(addr, numpages,
__pgprot(PTE_PXN),
- __pgprot(0));
+ __pgprot(PTE_MAYBE_GP));
}
int set_memory_x(unsigned long addr, int numpages)
{
return change_memory_common(addr, numpages,
- __pgprot(0),
+ __pgprot(PTE_MAYBE_GP),
__pgprot(PTE_PXN));
}