blob: 813d831a5a25ddbcc731a8f7de36320f7be5a3b1 [file] [log] [blame]
From: Josh Poimboeuf <jpoimboe@kernel.org>
Subject: kasan: disable stackleak plugin in report code
Date: Tue, 11 Oct 2022 12:05:48 -0700
kasan_report() has a uaccess critical section which can't have any
instrumentation calls in the middle. Disable the stackleak plugin for the
report code.
Fixes the following warning:
vmlinux.o: warning: objtool: kasan_report+0x12: call to stackleak_track_stack() with UACCESS enabled
Link: https://lkml.kernel.org/r/20221011190548.blixlqj6dripitaf@treble
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/kasan/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/kasan/Makefile~kasan-disable-stackleak-plugin-in-report-code
+++ a/mm/kasan/Makefile
@@ -27,7 +27,7 @@ CFLAGS_common.o := $(CC_FLAGS_KASAN_RUNT
CFLAGS_generic.o := $(CC_FLAGS_KASAN_RUNTIME)
CFLAGS_init.o := $(CC_FLAGS_KASAN_RUNTIME)
CFLAGS_quarantine.o := $(CC_FLAGS_KASAN_RUNTIME)
-CFLAGS_report.o := $(CC_FLAGS_KASAN_RUNTIME)
+CFLAGS_report.o := $(CC_FLAGS_KASAN_RUNTIME) $(DISABLE_STACKLEAK_PLUGIN)
CFLAGS_report_generic.o := $(CC_FLAGS_KASAN_RUNTIME)
CFLAGS_report_hw_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
CFLAGS_report_sw_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
_