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