blob: bc6e651df68c31e413552356fd5d67ad32cc11c0 [file] [log] [blame]
Andrey Ryabininc6d30852016-01-20 15:00:55 -08001config ARCH_HAS_UBSAN_SANITIZE_ALL
2 bool
3
Christian Borntraeger725c4d22016-09-12 14:37:19 +02004config ARCH_WANTS_UBSAN_NO_NULL
5 def_bool n
6
Andrey Ryabininc6d30852016-01-20 15:00:55 -08007config UBSAN
8 bool "Undefined behaviour sanity checker"
9 help
10 This option enables undefined behaviour sanity checker
11 Compile-time instrumentation is used to detect various undefined
12 behaviours in runtime. Various types of checks may be enabled
13 via boot parameter ubsan_handle (see: Documentation/ubsan.txt).
14
15config UBSAN_SANITIZE_ALL
16 bool "Enable instrumentation for the entire kernel"
17 depends on UBSAN
18 depends on ARCH_HAS_UBSAN_SANITIZE_ALL
Andrey Ryabinindde5cf32016-03-22 14:27:45 -070019
20 # We build with -Wno-maybe-uninitilzed, but we still want to
21 # use -Wmaybe-uninitilized in allmodconfig builds.
22 # So dependsy bellow used to disable this option in allmodconfig
23 depends on !COMPILE_TEST
Andrey Ryabininc6d30852016-01-20 15:00:55 -080024 default y
25 help
26 This option activates instrumentation for the entire kernel.
27 If you don't enable this option, you have to explicitly specify
28 UBSAN_SANITIZE := y for the files/directories you want to check for UB.
Yang Shi77075352016-02-11 16:12:55 -080029 Enabling this option will get kernel image size increased
30 significantly.
Andrey Ryabininc6d30852016-01-20 15:00:55 -080031
32config UBSAN_ALIGNMENT
33 bool "Enable checking of pointers alignment"
34 depends on UBSAN
35 default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS
36 help
37 This option enables detection of unaligned memory accesses.
Yang Shi77075352016-02-11 16:12:55 -080038 Enabling this option on architectures that support unaligned
Andrey Ryabininc6d30852016-01-20 15:00:55 -080039 accesses may produce a lot of false positives.
Christian Borntraeger725c4d22016-09-12 14:37:19 +020040
41config UBSAN_NULL
42 bool "Enable checking of null pointers"
43 depends on UBSAN
44 default y if !ARCH_WANTS_UBSAN_NO_NULL
45 help
46 This option enables detection of memory accesses via a
47 null pointer.