Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdfc07c1 authored by Dan Aloni's avatar Dan Aloni Committed by Todd Kjos
Browse files

ANDROID: arm64: fix leftover RWX when using CONFIG_UNMAP_KERNEL_AT_EL0



With CONFIG_UNMAP_KERNEL_AT_EL0 enabled, before this change, there was an RWX
mapping at a fixed `fixmap` address (as discovered using CONFIG_ARM64_PTDUMP).

0xffff7ffffe7fc000-0xffff7ffffe7fd000 4K RW x SHD AF UXN MEM/NORMAL

Having PAGE_KERNEL_ROX by default for this fixmap makes sense for a security
POV, for reducing the ability to load and run shellcode.

Originally, the commit that introduced CONFIG_UNMAP_KERNEL_AT_EL0, had the following:

     pgprot_t prot = rodata_enabled ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;

However rodata_enabled is not available in arch/arm64 on this early version of
the kernel.

Change-Id: I21f26df498fb591fc28e32f4dfad671a9ed3d8d3
Fixes: 39685f55 ("FROMLIST: arm64: mm: Map entry trampoline into
trampoline and kernel page tables")
Signed-off-by: default avatarDan Aloni <daloni@magicleap.com>
parent e005abce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment