blob: a2ae4a8e4fa675e4dc9c9401f4ee86dbff669989 [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
Andreas Platschek04625542016-12-14 15:05:43 -080010 via boot parameter ubsan_handle
11 (see: Documentation/dev-tools/ubsan.rst).
Andrey Ryabininc6d30852016-01-20 15:00:55 -080012
13config UBSAN_SANITIZE_ALL
14 bool "Enable instrumentation for the entire kernel"
15 depends on UBSAN
16 depends on ARCH_HAS_UBSAN_SANITIZE_ALL
Andrey Ryabinindde5cf32016-03-22 14:27:45 -070017
18 # We build with -Wno-maybe-uninitilzed, but we still want to
19 # use -Wmaybe-uninitilized in allmodconfig builds.
20 # So dependsy bellow used to disable this option in allmodconfig
21 depends on !COMPILE_TEST
Andrey Ryabininc6d30852016-01-20 15:00:55 -080022 default y
23 help
24 This option activates instrumentation for the entire kernel.
25 If you don't enable this option, you have to explicitly specify
26 UBSAN_SANITIZE := y for the files/directories you want to check for UB.
Yang Shi77075352016-02-11 16:12:55 -080027 Enabling this option will get kernel image size increased
28 significantly.
Andrey Ryabininc6d30852016-01-20 15:00:55 -080029
Anders Roxell1a6a1db2019-03-07 16:30:16 -080030config UBSAN_NO_ALIGNMENT
31 bool "Disable checking of pointers alignment"
Andrey Ryabininc6d30852016-01-20 15:00:55 -080032 depends on UBSAN
Anders Roxell1a6a1db2019-03-07 16:30:16 -080033 default y if HAVE_EFFICIENT_UNALIGNED_ACCESS
Andrey Ryabininc6d30852016-01-20 15:00:55 -080034 help
Anders Roxell1a6a1db2019-03-07 16:30:16 -080035 This option disables the check of unaligned memory accesses.
36 This option should be used when building allmodconfig.
37 Disabling this option on architectures that support unaligned
Andrey Ryabininc6d30852016-01-20 15:00:55 -080038 accesses may produce a lot of false positives.
Christian Borntraeger725c4d22016-09-12 14:37:19 +020039
Anders Roxell1a6a1db2019-03-07 16:30:16 -080040config UBSAN_ALIGNMENT
41 def_bool !UBSAN_NO_ALIGNMENT
42
Jinbum Park854686f2018-04-10 16:32:58 -070043config TEST_UBSAN
44 tristate "Module for testing for undefined behavior detection"
45 depends on m && UBSAN
46 help
47 This is a test module for UBSAN.
48 It triggers various undefined behavior, and detect it.