Back to home page

LXR

 
 

    


0001 config ARCH_HAS_UBSAN_SANITIZE_ALL
0002         bool
0003 
0004 config ARCH_WANTS_UBSAN_NO_NULL
0005         def_bool n
0006 
0007 config UBSAN
0008         bool "Undefined behaviour sanity checker"
0009         help
0010           This option enables undefined behaviour sanity checker
0011           Compile-time instrumentation is used to detect various undefined
0012           behaviours in runtime. Various types of checks may be enabled
0013           via boot parameter ubsan_handle
0014           (see: Documentation/dev-tools/ubsan.rst).
0015 
0016 config UBSAN_SANITIZE_ALL
0017         bool "Enable instrumentation for the entire kernel"
0018         depends on UBSAN
0019         depends on ARCH_HAS_UBSAN_SANITIZE_ALL
0020 
0021         # We build with -Wno-maybe-uninitilzed, but we still want to
0022         # use -Wmaybe-uninitilized in allmodconfig builds.
0023         # So dependsy bellow used to disable this option in allmodconfig
0024         depends on !COMPILE_TEST
0025         default y
0026         help
0027           This option activates instrumentation for the entire kernel.
0028           If you don't enable this option, you have to explicitly specify
0029           UBSAN_SANITIZE := y for the files/directories you want to check for UB.
0030           Enabling this option will get kernel image size increased
0031           significantly.
0032 
0033 config UBSAN_ALIGNMENT
0034         bool "Enable checking of pointers alignment"
0035         depends on UBSAN
0036         default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS
0037         help
0038           This option enables detection of unaligned memory accesses.
0039           Enabling this option on architectures that support unaligned
0040           accesses may produce a lot of false positives.
0041 
0042 config UBSAN_NULL
0043         bool "Enable checking of null pointers"
0044         depends on UBSAN
0045         default y if !ARCH_WANTS_UBSAN_NO_NULL
0046         help
0047           This option enables detection of memory accesses via a
0048           null pointer.