arm64, kfence: enable KFENCE for ARM64

Linux Kernel / Linux Kernel - Marco Elver [google.com] - 26 February 2021 17:41 UTC

Add architecture specific implementation details for KFENCE and enable KFENCE for the arm64 architecture. In particular, this implements the required interface in .

KFENCE requires that attributes for pages from its memory pool can individually be set. Therefore, force the entire linear map to be mapped at page granularity. Doing so may result in extra memory allocated for page tables in case rodata=full is not set; however, currently CONFIG_RODATA_FULL_DEFAULT_ENABLED=y is the default, and the common case is therefore not affected by this change.

[elver@google.com: add missing copyright and description header] Link: https://lkml.kernel.org/r/20210118092159.145934-3-elver@google.com

Link: https://lkml.kernel.org/r/20201103175841.3495947-4-elver@google.com

840b23986344 arm64, kfence: enable KFENCE for ARM64
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/kfence.h | 24 ++++++++++++++++++++++++
arch/arm64/mm/fault.c | 4 ++++
arch/arm64/mm/mmu.c | 8 +++++++-
4 files changed, 36 insertions(+), 1 deletion(-)

Upstream: git.kernel.org


  • Share