mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
fa76cfe65c
commit
67d4a1cd09
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue