diff options
| author | Andrey Ryabinin <aryabinin@virtuozzo.com> | 2018-08-10 20:23:03 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-10 23:19:58 -0400 |
| commit | 3ca17b1f3628f916f79e0ab62f1bf0e45ec9ba92 (patch) | |
| tree | 079b00ad1bc4e3dd0770f091a7a8b62d851a73b8 /scripts | |
| parent | 5832fcf9990c0e72c468e0dc6022836bb1b8d1e8 (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 'scripts')
| -rw-r--r-- | scripts/Makefile.ubsan | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/scripts/Makefile.ubsan b/scripts/Makefile.ubsan index b593b36ccff8..38b2b4818e8e 100644 --- a/scripts/Makefile.ubsan +++ b/scripts/Makefile.ubsan | |||
| @@ -14,10 +14,6 @@ ifdef CONFIG_UBSAN_ALIGNMENT | |||
| 14 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment) | 14 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment) |
| 15 | endif | 15 | endif |
| 16 | 16 | ||
| 17 | ifdef CONFIG_UBSAN_NULL | ||
| 18 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=null) | ||
| 19 | endif | ||
| 20 | |||
| 21 | # -fsanitize=* options makes GCC less smart than usual and | 17 | # -fsanitize=* options makes GCC less smart than usual and |
| 22 | # increase number of 'maybe-uninitialized false-positives | 18 | # increase number of 'maybe-uninitialized false-positives |
| 23 | CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized) | 19 | CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized) |
