diff mbox series

kasan: disable stackleak plugin in report code

Message ID 20221011190548.blixlqj6dripitaf@treble (mailing list archive)
State New
Headers show
Series kasan: disable stackleak plugin in report code | expand

Commit Message

Josh Poimboeuf Oct. 11, 2022, 7:05 p.m. UTC
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

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 mm/kasan/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Torvalds Oct. 11, 2022, 10 p.m. UTC | #1
On Tue, Oct 11, 2022 at 12:05 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> 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.

I see Andrew already picked this up, but I can confirm that it
obviously fixes the problem here for me.

I'll get it the usual channels from Andrew.

Thanks,
            Linus
diff mbox series

Patch

diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile
index d4837bff3b60..da2976365197 100644
--- a/mm/kasan/Makefile
+++ b/mm/kasan/Makefile
@@ -27,7 +27,7 @@  CFLAGS_common.o := $(CC_FLAGS_KASAN_RUNTIME)
 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)