[PATCH v2 31/48] kernel: kmsan: don't instrument stacktrace.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When unwinding stack traces, the kernel may pick uninitialized data from
the stack. To avoid false reports on that data, we do not instrument
stacktrace.c

Signed-off-by: Alexander Potapenko <glider@xxxxxxxxxx>
---
Link: https://linux-review.googlesource.com/id/Iadb72036ff6868b1d7c9f1ed6630a66be6c57a42
---
 kernel/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/Makefile b/kernel/Makefile
index 80f6cfb60c020..1147f0bd6e022 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -40,6 +40,11 @@ KASAN_SANITIZE_kcov.o := n
 KCSAN_SANITIZE_kcov.o := n
 UBSAN_SANITIZE_kcov.o := n
 KMSAN_SANITIZE_kcov.o := n
+
+# Code in stactrace.c may branch on random values taken from the stack.
+# Prevent KMSAN false positives by not instrumenting this file.
+KMSAN_SANITIZE_stacktrace.o := n
+
 CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack) -fno-stack-protector
 
 # Don't instrument error handlers
-- 
2.35.1.1021.g381101b075-goog





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux