summaryrefslogtreecommitdiffstats
path: root/kernel/kcsan
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2020-02-14 22:10:35 +0100
committerIngo Molnar <mingo@kernel.org>2020-03-21 09:44:41 +0100
commitf5d2313bd3c540be405c4977a63840cd6d0167b5 (patch)
tree25a8bfd1f857fc11aab179fb67ac36071e9c1503 /kernel/kcsan
parentkcsan: Introduce ASSERT_EXCLUSIVE_BITS(var, mask) (diff)
downloadlinux-f5d2313bd3c540be405c4977a63840cd6d0167b5.tar.xz
linux-f5d2313bd3c540be405c4977a63840cd6d0167b5.zip
kcsan, trace: Make KCSAN compatible with tracing
Previously the system would lock up if ftrace was enabled together with KCSAN. This is due to recursion on reporting if the tracer code is instrumented with KCSAN. To avoid this for all types of tracing, disable KCSAN instrumentation for all of kernel/trace. Furthermore, since KCSAN relies on udelay() to introduce delay, we have to disable ftrace for udelay() (currently done for x86) in case KCSAN is used together with lockdep and ftrace. The reason is that it may corrupt lockdep IRQ flags tracing state due to a peculiar case of recursion (details in Makefile comment). Reported-by: Qian Cai <cai@lca.pw> Tested-by: Qian Cai <cai@lca.pw> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/kcsan')
-rw-r--r--kernel/kcsan/Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile
index df6b7799e492..d4999b38d1be 100644
--- a/kernel/kcsan/Makefile
+++ b/kernel/kcsan/Makefile
@@ -4,6 +4,8 @@ KCOV_INSTRUMENT := n
UBSAN_SANITIZE := n
CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_debugfs.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
CFLAGS_core.o := $(call cc-option,-fno-conserve-stack,) \
$(call cc-option,-fno-stack-protector,)