Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[cascardo/linux.git] / lib / Kconfig.ubsan
index e07c1ba..bc6e651 100644 (file)
@@ -1,6 +1,9 @@
 config ARCH_HAS_UBSAN_SANITIZE_ALL
        bool
 
+config ARCH_WANTS_UBSAN_NO_NULL
+       def_bool n
+
 config UBSAN
        bool "Undefined behaviour sanity checker"
        help
@@ -13,6 +16,11 @@ config UBSAN_SANITIZE_ALL
        bool "Enable instrumentation for the entire kernel"
        depends on UBSAN
        depends on ARCH_HAS_UBSAN_SANITIZE_ALL
+
+       # We build with -Wno-maybe-uninitilzed, but we still want to
+       # use -Wmaybe-uninitilized in allmodconfig builds.
+       # So dependsy bellow used to disable this option in allmodconfig
+       depends on !COMPILE_TEST
        default y
        help
          This option activates instrumentation for the entire kernel.
@@ -29,3 +37,11 @@ config UBSAN_ALIGNMENT
          This option enables detection of unaligned memory accesses.
          Enabling this option on architectures that support unaligned
          accesses may produce a lot of false positives.
+
+config UBSAN_NULL
+       bool "Enable checking of null pointers"
+       depends on UBSAN
+       default y if !ARCH_WANTS_UBSAN_NO_NULL
+       help
+         This option enables detection of memory accesses via a
+         null pointer.