blob: e5b3fbe5560f903b4a27568d903cfdbbee6b1b65 [file] [log] [blame]
Andrey Ryabinin0b24bec2015-02-13 14:39:17 -08001config HAVE_ARCH_KASAN
2 bool
3
4if HAVE_ARCH_KASAN
5
6config KASAN
7 bool "KASan: runtime memory debugger"
8 help
9 Enables kernel address sanitizer - runtime memory debugger,
10 designed to find out-of-bounds accesses and use-after-free bugs.
11 This is strictly debugging feature. It consumes about 1/8
12 of available memory and brings about ~x3 performance slowdown.
13 For better error detection enable CONFIG_STACKTRACE,
14 and add slub_debug=U to boot cmdline.
15
16config KASAN_SHADOW_OFFSET
17 hex
18
19choice
20 prompt "Instrumentation type"
21 depends on KASAN
22 default KASAN_OUTLINE
23
24config KASAN_OUTLINE
25 bool "Outline instrumentation"
26 help
27 Before every memory access compiler insert function call
28 __asan_load*/__asan_store*. These functions performs check
29 of shadow memory. This is slower than inline instrumentation,
30 however it doesn't bloat size of kernel's .text section so
31 much as inline does.
32
33config KASAN_INLINE
34 bool "Inline instrumentation"
35 help
36 Compiler directly inserts code checking shadow memory before
37 memory accesses. This is faster than outline (in some workloads
38 it gives about x2 boost over outline instrumentation), but
39 make kernel's .text size much bigger.
40
41endchoice
42
43endif