Revert "BACKPORT: kasan: remove redundant config option"

This reverts commit 13aefe4bf8.

That commit might lead to stack overflows with x86 KASAN with stack
instrumentation enabled and has been dropped from the mm tree.
Revert the change for now.

Bug: 172318110
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: I5020ec2361d5f9976d0666e0c1ed6925e29fa5b2
This commit is contained in:
Andrey Konovalov
2021-02-26 21:00:20 +01:00
committed by Will Deacon
parent 49301bae6a
commit c0a166c983
8 changed files with 23 additions and 16 deletions

View File

@@ -2,12 +2,6 @@
CFLAGS_KASAN_NOSANITIZE := -fno-builtin
KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)
ifdef CONFIG_KASAN_STACK
stack_enable := 1
else
stack_enable := 0
endif
ifdef CONFIG_KASAN_GENERIC
ifdef CONFIG_KASAN_INLINE
@@ -33,7 +27,7 @@ else
CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \
$(call cc-param,asan-globals=1) \
$(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \
$(call cc-param,asan-stack=$(stack_enable)) \
$(call cc-param,asan-stack=$(CONFIG_KASAN_STACK)) \
$(call cc-param,asan-instrument-allocas=1)
endif
@@ -48,7 +42,7 @@ else
endif
CFLAGS_KASAN := -fsanitize=kernel-hwaddress \
-mllvm -hwasan-instrument-stack=$(stack_enable) \
-mllvm -hwasan-instrument-stack=$(CONFIG_KASAN_STACK) \
-mllvm -hwasan-use-short-granules=0 \
$(instrumentation_flags)