History

kasan: update required compiler versions in documentation

Updates the recently changed compiler requirements for KASAN. In particular, we require GCC >= 8.3.0, and add a note that Clang 11 supports OOB detection of globals.

Marco Elver committed 6 years ago

Commit ac4766b1 parent 7a3767f2 files · +17 −14Browse files

Unified · Split

2 files
  1. Documentation/dev-tools/kasan.rst +2 −5
  2. lib/Kconfig.kasan +15 −9
Documentation/dev-tools/kasan.rst+2−5
@@ -13,11 +13,8 @@ KASAN uses compile-time instrumentation to insert validity checks before every · 12 unmodified lines
1313 memory access, and therefore requires a compiler version that supports that.
1414
1515 Generic KASAN is supported in both GCC and Clang. With GCC it requires version
16−4.9.2 or later for basic support and version 5.0 or later for detection of
17−out-of-bounds accesses for stack and global variables and for inline
18−instrumentation mode (see the Usage section). With Clang it requires version
19−7.0.0 or later and it doesn't support detection of out-of-bounds accesses for
20−global variables yet.
16+8.3.0 or later. With Clang it requires version 7.0.0 or later, but detection of
17+out-of-bounds accesses for global variables is only supported since Clang 11.
2118
2219 Tag-based KASAN is only supported in Clang and requires version 7.0.0 or later.
2320
lib/Kconfig.kasan+15−9
@@ -40,6 +40,7 @@ choice · 39 unmodified lines
4040 software tag-based KASAN (a version based on software memory
4141 tagging, arm64 only, similar to userspace HWASan, enabled with
4242 CONFIG_KASAN_SW_TAGS).
43+
4344 Both generic and tag-based KASAN are strictly debugging features.
4445
4546 config KASAN_GENERIC
@@ -51,16 +52,18 @@ config KASAN_GENERIC · 5 unmodified lines
5152 select STACKDEPOT
5253 help
5354 Enables generic KASAN mode.
54− Supported in both GCC and Clang. With GCC it requires version 4.9.2
55− or later for basic support and version 5.0 or later for detection of
56− out-of-bounds accesses for stack and global variables and for inline
57− instrumentation mode (CONFIG_KASAN_INLINE). With Clang it requires
58− version 3.7.0 or later and it doesn't support detection of
59− out-of-bounds accesses for global variables yet.
55+
56+ This mode is supported in both GCC and Clang. With GCC it requires
57+ version 8.3.0 or later. With Clang it requires version 7.0.0 or
58+ later, but detection of out-of-bounds accesses for global variables
59+ is supported only since Clang 11.
60+
6061 This mode consumes about 1/8th of available memory at kernel start
6162 and introduces an overhead of ~x1.5 for the rest of the allocations.
6263 The performance slowdown is ~x3.
64+
6365 For better error detection enable CONFIG_STACKTRACE.
66+
6467 Currently CONFIG_KASAN_GENERIC doesn't work with CONFIG_DEBUG_SLAB
6568 (the resulting kernel does not boot).
6669
@@ -73,15 +76,19 @@ config KASAN_SW_TAGS · 6 unmodified lines
7376 select STACKDEPOT
7477 help
7578 Enables software tag-based KASAN mode.
79+
7680 This mode requires Top Byte Ignore support by the CPU and therefore
77− is only supported for arm64.
78− This mode requires Clang version 7.0.0 or later.
81+ is only supported for arm64. This mode requires Clang version 7.0.0
82+ or later.
83+
7984 This mode consumes about 1/16th of available memory at kernel start
8085 and introduces an overhead of ~20% for the rest of the allocations.
8186 This mode may potentially introduce problems relating to pointer
8287 casting and comparison, as it embeds tags into the top byte of each
8388 pointer.
89+
8490 For better error detection enable CONFIG_STACKTRACE.
91+
8592 Currently CONFIG_KASAN_SW_TAGS doesn't work with CONFIG_DEBUG_SLAB
8693 (the resulting kernel does not boot).
8794
@@ -107,7 +114,6 @@ config KASAN_INLINE · 19 unmodified lines
107114 memory accesses. This is faster than outline (in some workloads
108115 it gives about x2 boost over outline instrumentation), but
109116 make kernel's .text size much bigger.
110− For CONFIG_KASAN_GENERIC this requires GCC 5.0 or later.
111117
112118 endchoice
113119

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t