aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.ubsan
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-05-03 11:46:20 -0700
committerKees Cook <kees@kernel.org>2025-05-08 09:42:06 -0700
commit11bb1678e249e51cd748e8f91e5241b3ce71da3a (patch)
treee537068b8ea9df65fe6ca1f7c85af1c7cdada40a /scripts/Makefile.ubsan
parentrandstruct: Force full rebuild when seed changes (diff)
downloadlinux-11bb1678e249e51cd748e8f91e5241b3ce71da3a.tar.gz
linux-11bb1678e249e51cd748e8f91e5241b3ce71da3a.zip
integer-wrap: Force full rebuild when .scl file changes
Since the integer wrapping sanitizer's behavior depends on its associated .scl file, we must force a full rebuild if the file changes. If not, instrumentation may differ between targets based on when they were built. Generate a new header file, integer-wrap.h, any time the Clang .scl file changes. Include the header file in compiler-version.h when its associated feature name, INTEGER_WRAP, is defined. This will be picked up by fixdep and force rebuilds where needed. Acked-by: Justin Stitt <justinstitt@google.com> Link: https://lore.kernel.org/r/20250503184623.2572355-3-kees@kernel.org Reviewed-by: Nicolas Schier <n.schier@avm.de> Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'scripts/Makefile.ubsan')
-rw-r--r--scripts/Makefile.ubsan1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/Makefile.ubsan b/scripts/Makefile.ubsan
index 9e35198edbf0..653f7117819c 100644
--- a/scripts/Makefile.ubsan
+++ b/scripts/Makefile.ubsan
@@ -15,6 +15,7 @@ ubsan-cflags-$(CONFIG_UBSAN_TRAP) += $(call cc-option,-fsanitize-trap=undefined
export CFLAGS_UBSAN := $(ubsan-cflags-y)
ubsan-integer-wrap-cflags-$(CONFIG_UBSAN_INTEGER_WRAP) += \
+ -DINTEGER_WRAP \
-fsanitize-undefined-ignore-overflow-pattern=all \
-fsanitize=signed-integer-overflow \
-fsanitize=unsigned-integer-overflow \