From 8b1e6c92907a08b4b7836da7cb47c3a68b258a64 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 28 Jan 2021 22:26:03 +0800 Subject: [PATCH] ARM: 9028/1: disable KASAN in call stack capturing routines mainline inclusion from mainline-5.11-rc1 commit 4d576cab16f57e1f87978f6997a725179398341e category: feature feature: ARM KASAN support bugzilla: 46872 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4d576cab16f57e1f87978f6997a725179398341e ------------------------------------------------- KASAN uses the routines in stacktrace.c to capture the call stack each time memory gets allocated or freed. Some of these routines are also used to log CPU and memory context when exceptions are taken, and so in some cases, memory accesses may be made that are not strictly in line with the KASAN constraints, and may therefore trigger false KASAN positives. So follow the example set by other architectures, and simply disable KASAN instrumentation for these routines. Reviewed-by: Linus Walleij Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (cherry picked from commit 4d576cab16f57e1f87978f6997a725179398341e) Signed-off-by: Kefeng Wang Reviewed-by: Jing Xiangfeng Signed-off-by: Zheng Zengkai --- arch/arm/kernel/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 9e465efcc8b6..c38c8b019d24 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -21,6 +21,9 @@ obj-y := elf.o entry-common.o irq.o opcodes.o \ setup.o signal.o sigreturn_codes.o \ stacktrace.o sys_arm.o time.o traps.o +KASAN_SANITIZE_stacktrace.o := n +KASAN_SANITIZE_traps.o := n + ifneq ($(CONFIG_ARM_UNWIND),y) obj-$(CONFIG_FRAME_POINTER) += return_address.o endif -- GitLab