diff options
-rw-r--r-- | Documentation/kasan.txt | 8 | ||||
-rw-r--r-- | lib/Kconfig.kasan | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/Documentation/kasan.txt b/Documentation/kasan.txt index 092fc10961fe..4692241789b1 100644 --- a/Documentation/kasan.txt +++ b/Documentation/kasan.txt | |||
@@ -9,7 +9,9 @@ a fast and comprehensive solution for finding use-after-free and out-of-bounds | |||
9 | bugs. | 9 | bugs. |
10 | 10 | ||
11 | KASan uses compile-time instrumentation for checking every memory access, | 11 | KASan uses compile-time instrumentation for checking every memory access, |
12 | therefore you will need a certain version of GCC > 4.9.2 | 12 | therefore you will need a gcc version of 4.9.2 or later. KASan could detect out |
13 | of bounds accesses to stack or global variables, but only if gcc 5.0 or later was | ||
14 | used to built the kernel. | ||
13 | 15 | ||
14 | Currently KASan is supported only for x86_64 architecture and requires that the | 16 | Currently KASan is supported only for x86_64 architecture and requires that the |
15 | kernel be built with the SLUB allocator. | 17 | kernel be built with the SLUB allocator. |
@@ -23,8 +25,8 @@ To enable KASAN configure kernel with: | |||
23 | 25 | ||
24 | and choose between CONFIG_KASAN_OUTLINE and CONFIG_KASAN_INLINE. Outline/inline | 26 | and choose between CONFIG_KASAN_OUTLINE and CONFIG_KASAN_INLINE. Outline/inline |
25 | is compiler instrumentation types. The former produces smaller binary the | 27 | is compiler instrumentation types. The former produces smaller binary the |
26 | latter is 1.1 - 2 times faster. Inline instrumentation requires GCC 5.0 or | 28 | latter is 1.1 - 2 times faster. Inline instrumentation requires a gcc version |
27 | latter. | 29 | of 5.0 or later. |
28 | 30 | ||
29 | Currently KASAN works only with the SLUB memory allocator. | 31 | Currently KASAN works only with the SLUB memory allocator. |
30 | For better bug detection and nicer report, enable CONFIG_STACKTRACE and put | 32 | For better bug detection and nicer report, enable CONFIG_STACKTRACE and put |
diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 4fecaedc80a2..777eda7d1ab4 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan | |||
@@ -10,8 +10,11 @@ config KASAN | |||
10 | help | 10 | help |
11 | Enables kernel address sanitizer - runtime memory debugger, | 11 | Enables kernel address sanitizer - runtime memory debugger, |
12 | designed to find out-of-bounds accesses and use-after-free bugs. | 12 | designed to find out-of-bounds accesses and use-after-free bugs. |
13 | This is strictly debugging feature. It consumes about 1/8 | 13 | This is strictly a debugging feature and it requires a gcc version |
14 | of available memory and brings about ~x3 performance slowdown. | 14 | of 4.9.2 or later. Detection of out of bounds accesses to stack or |
15 | global variables requires gcc 5.0 or later. | ||
16 | This feature consumes about 1/8 of available memory and brings about | ||
17 | ~x3 performance slowdown. | ||
15 | For better error detection enable CONFIG_STACKTRACE, | 18 | For better error detection enable CONFIG_STACKTRACE, |
16 | and add slub_debug=U to boot cmdline. | 19 | and add slub_debug=U to boot cmdline. |
17 | 20 | ||
@@ -40,6 +43,7 @@ config KASAN_INLINE | |||
40 | memory accesses. This is faster than outline (in some workloads | 43 | memory accesses. This is faster than outline (in some workloads |
41 | it gives about x2 boost over outline instrumentation), but | 44 | it gives about x2 boost over outline instrumentation), but |
42 | make kernel's .text size much bigger. | 45 | make kernel's .text size much bigger. |
46 | This requires a gcc version of 5.0 or later. | ||
43 | 47 | ||
44 | endchoice | 48 | endchoice |
45 | 49 | ||