mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
725c4d22bb
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>
20 lines
861 B
Text
20 lines
861 B
Text
ifdef CONFIG_UBSAN
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=shift)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=integer-divide-by-zero)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=unreachable)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=vla-bound)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=signed-integer-overflow)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=bounds)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=object-size)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=returns-nonnull-attribute)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=bool)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=enum)
|
|
|
|
ifdef CONFIG_UBSAN_ALIGNMENT
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment)
|
|
endif
|
|
|
|
ifdef CONFIG_UBSAN_NULL
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=null)
|
|
endif
|
|
endif
|