summaryrefslogtreecommitdiffstats
path: root/lib/Kconfig.ubsan
diff options
context:
space:
mode:
authorAndrey Ryabinin <aryabinin@virtuozzo.com>2018-08-10 20:23:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-10 23:19:58 -0400
commit3ca17b1f3628f916f79e0ab62f1bf0e45ec9ba92 (patch)
tree079b00ad1bc4e3dd0770f091a7a8b62d851a73b8 /lib/Kconfig.ubsan
parent5832fcf9990c0e72c468e0dc6022836bb1b8d1e8 (diff)
lib/ubsan: remove null-pointer checks
With gcc-8 fsanitize=null become very noisy. GCC started to complain about things like &a->b, where 'a' is NULL pointer. There is no NULL dereference, we just calculate address to struct member. It's technically undefined behavior so UBSAN is correct to report it. But as long as there is no real NULL-dereference, I think, we should be fine. -fno-delete-null-pointer-checks compiler flag should protect us from any consequences. So let's just no use -fsanitize=null as it's not useful for us. If there is a real NULL-deref we will see crash. Even if userspace mapped something at NULL (root can do this), with things like SMAP should catch the issue. Link: http://lkml.kernel.org/r/20180802153209.813-1-aryabinin@virtuozzo.com Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/Kconfig.ubsan')
-rw-r--r--lib/Kconfig.ubsan11
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index 19d42ea75ec2..98fa559ebd80 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -1,9 +1,6 @@
1config ARCH_HAS_UBSAN_SANITIZE_ALL 1config ARCH_HAS_UBSAN_SANITIZE_ALL
2 bool 2 bool
3 3
4config ARCH_WANTS_UBSAN_NO_NULL
5 def_bool n
6
7config UBSAN 4config UBSAN
8 bool "Undefined behaviour sanity checker" 5 bool "Undefined behaviour sanity checker"
9 help 6 help
@@ -39,14 +36,6 @@ config UBSAN_ALIGNMENT
39 Enabling this option on architectures that support unaligned 36 Enabling this option on architectures that support unaligned
40 accesses may produce a lot of false positives. 37 accesses may produce a lot of false positives.
41 38
42config UBSAN_NULL
43 bool "Enable checking of null pointers"
44 depends on UBSAN
45 default y if !ARCH_WANTS_UBSAN_NO_NULL
46 help
47 This option enables detection of memory accesses via a
48 null pointer.
49
50config TEST_UBSAN 39config TEST_UBSAN
51 tristate "Module for testing for undefined behavior detection" 40 tristate "Module for testing for undefined behavior detection"
52 depends on m && UBSAN 41 depends on m && UBSAN