]> git.baikalelectronics.ru Git - kernel.git/commit
lib/ubsan: remove null-pointer checks
authorAndrey Ryabinin <aryabinin@virtuozzo.com>
Sat, 11 Aug 2018 00:23:03 +0000 (17:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 11 Aug 2018 03:19:58 +0000 (20:19 -0700)
commit3531654918a2009d1d320911741e92023eb99348
tree079b00ad1bc4e3dd0770f091a7a8b62d851a73b8
parent08ab4b03f189a63ef08f0a9e9c095712e267adc7
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>
arch/parisc/Kconfig
arch/s390/Kconfig
lib/Kconfig.ubsan
scripts/Makefile.ubsan