1 # SPDX-License-Identifier: GPL-2.0-only
2 config ARCH_HAS_UBSAN_SANITIZE_ALL
6 bool "Undefined behaviour sanity checker"
8 This option enables undefined behaviour sanity checker
9 Compile-time instrumentation is used to detect various undefined
10 behaviours in runtime. Various types of checks may be enabled
11 via boot parameter ubsan_handle
12 (see: Documentation/dev-tools/ubsan.rst).
14 config UBSAN_SANITIZE_ALL
15 bool "Enable instrumentation for the entire kernel"
17 depends on ARCH_HAS_UBSAN_SANITIZE_ALL
19 # We build with -Wno-maybe-uninitilzed, but we still want to
20 # use -Wmaybe-uninitilized in allmodconfig builds.
21 # So dependsy bellow used to disable this option in allmodconfig
22 depends on !COMPILE_TEST
25 This option activates instrumentation for the entire kernel.
26 If you don't enable this option, you have to explicitly specify
27 UBSAN_SANITIZE := y for the files/directories you want to check for UB.
28 Enabling this option will get kernel image size increased
31 config UBSAN_NO_ALIGNMENT
32 bool "Disable checking of pointers alignment"
34 default y if HAVE_EFFICIENT_UNALIGNED_ACCESS
36 This option disables the check of unaligned memory accesses.
37 This option should be used when building allmodconfig.
38 Disabling this option on architectures that support unaligned
39 accesses may produce a lot of false positives.
41 config UBSAN_ALIGNMENT
42 def_bool !UBSAN_NO_ALIGNMENT
45 tristate "Module for testing for undefined behavior detection"
48 This is a test module for UBSAN.
49 It triggers various undefined behavior, and detect it.