Commit 67d4a1cd authored by Mark Brown's avatar Mark Brown Committed by Will Deacon

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: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20200506195138.22086-7-broonie@kernel.orgSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent fa76cfe6
...@@ -126,13 +126,13 @@ int set_memory_nx(unsigned long addr, int numpages) ...@@ -126,13 +126,13 @@ int set_memory_nx(unsigned long addr, int numpages)
{ {
return change_memory_common(addr, numpages, return change_memory_common(addr, numpages,
__pgprot(PTE_PXN), __pgprot(PTE_PXN),
__pgprot(0)); __pgprot(PTE_MAYBE_GP));
} }
int set_memory_x(unsigned long addr, int numpages) int set_memory_x(unsigned long addr, int numpages)
{ {
return change_memory_common(addr, numpages, return change_memory_common(addr, numpages,
__pgprot(0), __pgprot(PTE_MAYBE_GP),
__pgprot(PTE_PXN)); __pgprot(PTE_PXN));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment