blob: 39494af9a84ac89e6fbbc1f25d9407c70d19e66f [file] [log] [blame]
Andrey Ryabininc6d30852016-01-20 15:00:55 -08001config ARCH_HAS_UBSAN_SANITIZE_ALL
2 bool
3
4config UBSAN
5 bool "Undefined behaviour sanity checker"
6 help
7 This option enables undefined behaviour sanity checker
8 Compile-time instrumentation is used to detect various undefined
9 behaviours in runtime. Various types of checks may be enabled
10 via boot parameter ubsan_handle (see: Documentation/ubsan.txt).
11
12config UBSAN_SANITIZE_ALL
13 bool "Enable instrumentation for the entire kernel"
14 depends on UBSAN
15 depends on ARCH_HAS_UBSAN_SANITIZE_ALL
Andrey Ryabinindde5cf32016-03-22 14:27:45 -070016
17 # We build with -Wno-maybe-uninitilzed, but we still want to
18 # use -Wmaybe-uninitilized in allmodconfig builds.
19 # So dependsy bellow used to disable this option in allmodconfig
20 depends on !COMPILE_TEST
Andrey Ryabininc6d30852016-01-20 15:00:55 -080021 default y
22 help
23 This option activates instrumentation for the entire kernel.
24 If you don't enable this option, you have to explicitly specify
25 UBSAN_SANITIZE := y for the files/directories you want to check for UB.
Yang Shi77075352016-02-11 16:12:55 -080026 Enabling this option will get kernel image size increased
27 significantly.
Andrey Ryabininc6d30852016-01-20 15:00:55 -080028
29config UBSAN_ALIGNMENT
30 bool "Enable checking of pointers alignment"
31 depends on UBSAN
32 default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS
33 help
34 This option enables detection of unaligned memory accesses.
Yang Shi77075352016-02-11 16:12:55 -080035 Enabling this option on architectures that support unaligned
Andrey Ryabininc6d30852016-01-20 15:00:55 -080036 accesses may produce a lot of false positives.