summaryrefslogtreecommitdiffstats
path: root/lib/Kconfig.ubsan
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2016-09-12 14:37:19 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-09-20 14:26:08 +0200
commit725c4d22bbc4fcac5779963e0ff9cdf232afbb90 (patch)
treeaa31d4784fc88800c8c26d18ecf90efa59480ee2 /lib/Kconfig.ubsan
parentf296190e41ee1e1e6912f0ddae09b28e9cfae48d (diff)
downloadlinux-725c4d22bbc4fcac5779963e0ff9cdf232afbb90.tar.gz
linux-725c4d22bbc4fcac5779963e0ff9cdf232afbb90.tar.bz2
linux-725c4d22bbc4fcac5779963e0ff9cdf232afbb90.zip
ubsan: allow to disable the null sanitizer
Some architectures use a hardware defined structure at address zero. Checking for a null pointer will result in many ubsan reports. Allow users to disable the null sanitizer. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'lib/Kconfig.ubsan')
-rw-r--r--lib/Kconfig.ubsan11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index 39494af9a84a..bc6e651df68c 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -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
@@ -34,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.