arm64, kfence: enable KFENCE for ARM64 39/281539/1
authorMarco Elver <elver@google.com>
Tue, 3 Nov 2020 17:58:35 +0000 (18:58 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 20 Sep 2022 02:42:12 +0000 (11:42 +0900)
commit3b586d13502a89a53ff34752eb785e456657fe73
treec46e5f5d944514e03f93149d5cd1b3047081e58d
parent3992c7ab984555a01127e9ca48962b124436bd3e
arm64, kfence: enable KFENCE for ARM64

Add architecture specific implementation details for KFENCE and enable
KFENCE for the arm64 architecture. In particular, this implements the
required interface in <asm/kfence.h>.

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.

Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Co-developed-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Marco Elver <elver@google.com>
Reviewed-by: Jann Horn <jannh@google.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
[port kfence feature to rpi-5.10.95]
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I1cb00f8faea0324b850f4c5879a51b1721bc155f
arch/arm64/Kconfig
arch/arm64/include/asm/kfence.h [new file with mode: 0644]
arch/arm64/mm/fault.c
arch/arm64/mm/mmu.c