diff options
author | Kees Cook <keescook@chromium.org> | 2024-01-24 01:32:54 +0100 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2024-02-06 11:21:38 +0100 |
commit | 167ebeda36fae4bb47ace32bcacecde7d24d2850 (patch) | |
tree | 51d004541f34a9a83f9ba6b5071f4584a07fdf24 /scripts | |
parent | MAINTAINERS: Add UBSAN section (diff) | |
download | linux-167ebeda36fae4bb47ace32bcacecde7d24d2850.tar.xz linux-167ebeda36fae4bb47ace32bcacecde7d24d2850.zip |
ubsan: Use Clang's -fsanitize-trap=undefined option
Clang changed the way it enables UBSan trapping mode. Update the Makefile
logic to discover it.
Suggested-by: Fangrui Song <maskray@google.com>
Link: https://lore.kernel.org/lkml/CAFP8O3JivZh+AAV7N90Nk7U2BHRNST6MRP0zHtfQ-Vj0m4+pDA@mail.gmail.com/
Reviewed-by: Fangrui Song <maskray@google.com>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: linux-kbuild@vger.kernel.org
Cc: llvm@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.ubsan | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.ubsan b/scripts/Makefile.ubsan index 4749865c1b2c..7cf42231042b 100644 --- a/scripts/Makefile.ubsan +++ b/scripts/Makefile.ubsan @@ -10,6 +10,6 @@ ubsan-cflags-$(CONFIG_UBSAN_DIV_ZERO) += -fsanitize=integer-divide-by-zero ubsan-cflags-$(CONFIG_UBSAN_UNREACHABLE) += -fsanitize=unreachable ubsan-cflags-$(CONFIG_UBSAN_BOOL) += -fsanitize=bool ubsan-cflags-$(CONFIG_UBSAN_ENUM) += -fsanitize=enum -ubsan-cflags-$(CONFIG_UBSAN_TRAP) += -fsanitize-undefined-trap-on-error +ubsan-cflags-$(CONFIG_UBSAN_TRAP) += $(call cc-option,-fsanitize-trap=undefined,-fsanitize-undefined-trap-on-error) export CFLAGS_UBSAN := $(ubsan-cflags-y) |