Skip to contentSkip to conversation

ARM: disable KASAN in call stack capturing routines

PATCH New Ard Biesheuvel 1 participant 1 message Nov 16, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: disable KASAN in call stack capturing routines

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.

---
 arch/arm/kernel/Makefile | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/kernel/Makefile +3 -0
index 9e465efcc8b6..c38c8b019d24 100644
@@ -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
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel