summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Kconfig.debug2
-rw-r--r--lib/Kconfig.kasan11
-rw-r--r--scripts/Makefile.kasan2
3 files changed, 14 insertions, 1 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 1a1423923bcf..b66c264d4194 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -217,7 +217,7 @@ config ENABLE_MUST_CHECK
217config FRAME_WARN 217config FRAME_WARN
218 int "Warn for stack frames larger than (needs gcc 4.4)" 218 int "Warn for stack frames larger than (needs gcc 4.4)"
219 range 0 8192 219 range 0 8192
220 default 0 if KASAN 220 default 3072 if KASAN_EXTRA
221 default 2048 if GCC_PLUGIN_LATENT_ENTROPY 221 default 2048 if GCC_PLUGIN_LATENT_ENTROPY
222 default 1280 if (!64BIT && PARISC) 222 default 1280 if (!64BIT && PARISC)
223 default 1024 if (!64BIT && !PARISC) 223 default 1024 if (!64BIT && !PARISC)
diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
index bd38aab05929..3d35d062970d 100644
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -20,6 +20,17 @@ config KASAN
20 Currently CONFIG_KASAN doesn't work with CONFIG_DEBUG_SLAB 20 Currently CONFIG_KASAN doesn't work with CONFIG_DEBUG_SLAB
21 (the resulting kernel does not boot). 21 (the resulting kernel does not boot).
22 22
23config KASAN_EXTRA
24 bool "KAsan: extra checks"
25 depends on KASAN && DEBUG_KERNEL && !COMPILE_TEST
26 help
27 This enables further checks in the kernel address sanitizer, for now
28 it only includes the address-use-after-scope check that can lead
29 to excessive kernel stack usage, frame size warnings and longer
30 compile time.
31 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 has more
32
33
23choice 34choice
24 prompt "Instrumentation type" 35 prompt "Instrumentation type"
25 depends on KASAN 36 depends on KASAN
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
index 3fb382c69ff6..69552a39951d 100644
--- a/scripts/Makefile.kasan
+++ b/scripts/Makefile.kasan
@@ -38,7 +38,9 @@ else
38 38
39endif 39endif
40 40
41ifdef CONFIG_KASAN_EXTRA
41CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) 42CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope)
43endif
42 44
43CFLAGS_KASAN_NOSANITIZE := -fno-builtin 45CFLAGS_KASAN_NOSANITIZE := -fno-builtin
44 46