Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ubsan/overflow: Enable ignorelist parsing and add type filter

Limit integer wrap-around mitigation to only the "size_t" type (for
now). Notably this covers all special functions/builtins that return
"size_t", like sizeof(). This remains an experimental feature and is
likely to be replaced with type annotations.

Reviewed-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20250307041914.937329-3-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>

+6 -1
+1
lib/Kconfig.ubsan
··· 125 125 depends on $(cc-option,-fsanitize=unsigned-integer-overflow) 126 126 depends on $(cc-option,-fsanitize=implicit-signed-integer-truncation) 127 127 depends on $(cc-option,-fsanitize=implicit-unsigned-integer-truncation) 128 + depends on $(cc-option,-fsanitize-ignorelist=/dev/null) 128 129 help 129 130 This option enables all of the sanitizers involved in integer overflow 130 131 (wrap-around) mitigation: signed-integer-overflow, unsigned-integer-overflow,
+2 -1
scripts/Makefile.ubsan
··· 19 19 -fsanitize=signed-integer-overflow \ 20 20 -fsanitize=unsigned-integer-overflow \ 21 21 -fsanitize=implicit-signed-integer-truncation \ 22 - -fsanitize=implicit-unsigned-integer-truncation 22 + -fsanitize=implicit-unsigned-integer-truncation \ 23 + -fsanitize-ignorelist=$(srctree)/scripts/integer-wrap-ignore.scl 23 24 export CFLAGS_UBSAN_INTEGER_WRAP := $(ubsan-integer-wrap-cflags-y)
+3
scripts/integer-wrap-ignore.scl
··· 1 + [{unsigned-integer-overflow,signed-integer-overflow,implicit-signed-integer-truncation,implicit-unsigned-integer-truncation}] 2 + type:* 3 + type:size_t=sanitize