Skip to contentSkip to conversation

ubsan: integer-overflow: depend on BROKEN to keep this out of CI

PATCH In review Kees Cook 5 participants 6 messages May 28, 2025 – May 29, 2025

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author maintainer
#0 lore raw

PATCH 1/1 ubsan: integer-overflow: depend on BROKEN to keep this out of CI

Depending on !COMPILE_TEST isn't sufficient to keep this feature out of CI because we can't stop it from being included in randconfig builds. This feature is still highly experimental, and is developed in lock-step with Clang's Overflow Behavior Types[1]. Depend on BROKEN to keep it from being enabled by anyone not expecting it.

---
Cc: Justin Stitt <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: [email protected]
Cc: <[email protected]>

---
 lib/Kconfig.ubsan | 2 ++
 1 file changed, 2 insertions(+)
lib/Kconfig.ubsan +2 -0
index f6ea0c5b5da3..96cd89668467 100644
@@ -118,6 +118,8 @@ config UBSAN_UNREACHABLE
 
 config UBSAN_INTEGER_WRAP
 	bool "Perform checking for integer arithmetic wrap-around"
+	# This is very experimental so drop the next line if you really want it
+	depends on BROKEN
 	depends on !COMPILE_TEST
 	depends on $(cc-option,-fsanitize-undefined-ignore-overflow-pattern=all)
 	depends on $(cc-option,-fsanitize=signed-integer-overflow)
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines · Kees Cook

Depending on !COMPILE_TEST isn't sufficient to keep this feature out of CI because we can't stop it from being included in randconfig builds. This feature is still highly experimental, and is developed in lock-step with Clang's Overflow Behavior Types[1]. Depend on BROKEN to keep it from being enabled by anyone not expecting it.

---
Cc: Justin Stitt <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: [email protected]
Cc: <[email protected]>

---
 lib/Kconfig.ubsan | 2 ++
 1 file changed, 2 insertions(+)
lib/Kconfig.ubsan +0 -0
index f6ea0c5b5da3..96cd89668467 100644

lib/Kconfig.ubsan config UBSAN_UNREACHABLE · line 125

Quoted 8 lines
lib/Kconfig.ubsan +2 -0
@@ -118,6 +118,8 @@ config UBSAN_UNREACHABLE
 
 config UBSAN_INTEGER_WRAP
 	bool "Perform checking for integer arithmetic wrap-around"
+	# This is very experimental so drop the next line if you really want it
+	depends on BROKEN
 	depends on !COMPILE_TEST
 	depends on $(cc-option,-fsanitize-undefined-ignore-overflow-pattern=all)
 	depends on $(cc-option,-fsanitize=signed-integer-overflow)

- Eric

Reviewed-by on v1 1/1
#2 lore raw
In reply to Kees Cook
Quoted 8 lines · Kees Cook

Depending on !COMPILE_TEST isn't sufficient to keep this feature out of CI because we can't stop it from being included in randconfig builds. This feature is still highly experimental, and is developed in lock-step with Clang's Overflow Behavior Types[1]. Depend on BROKEN to keep it from being enabled by anyone not expecting it.

Should this have a 'Cc: [email protected]' on it? There might not be much randconfig testing on stable but it is still very much possible for some random user to turn this on and report problems.

Regardless of that though, I think this is a good idea with how much of this feature is still being ironed out.

Once this lands, I plan to mark all issues in the CBL issue tracker that came about from UBSAN_INTEGER_WRAP as 'have a workaround applied' since it will not be possible for regular users to hit them but you may consider notating them in case they need to be addressed before the feature can be reenabled.

Quoted 29 lines

---
Cc: Justin Stitt <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: [email protected]
Cc: <[email protected]>

---
 lib/Kconfig.ubsan | 2 ++
 1 file changed, 2 insertions(+)
lib/Kconfig.ubsan +2 -0
index f6ea0c5b5da3..96cd89668467 100644
@@ -118,6 +118,8 @@ config UBSAN_UNREACHABLE
 
 config UBSAN_INTEGER_WRAP
 	bool "Perform checking for integer arithmetic wrap-around"
+	# This is very experimental so drop the next line if you really want it
+	depends on BROKEN
 	depends on !COMPILE_TEST
 	depends on $(cc-option,-fsanitize-undefined-ignore-overflow-pattern=all)
 	depends on $(cc-option,-fsanitize=signed-integer-overflow)
Signature · 1 line
2.34.1
author maintainer
#3 lore raw
Quoted 7 lines · Nathan Chancellor
Quoted 6 lines · Kees Cook

Depending on !COMPILE_TEST isn't sufficient to keep this feature out of CI because we can't stop it from being included in randconfig builds. This feature is still highly experimental, and is developed in lock-step with Clang's Overflow Behavior Types[1]. Depend on BROKEN to keep it from being enabled by anyone not expecting it.

Quoted 6 lines
Quoted 2 lines

Should this have a 'Cc: [email protected]' on it? There might not be much randconfig testing on stable but it is still very much possible for some random user to turn this on and report problems.

Ah yeah, I should probably do this via a proper Fixes: tag. I'll add this.

Quoted 4 lines

Regardless of that though, I think this is a good idea with how much of this feature is still being ironed out.

Thanks!

Quoted 6 lines

Once this lands, I plan to mark all issues in the CBL issue tracker that came about from UBSAN_INTEGER_WRAP as 'have a workaround applied' since it will not be possible for regular users to hit them but you may consider notating them in case they need to be addressed before the feature can be reenabled.

Sounds good!

-Kees

Signature · 1 line
Kees Cook
#4 lore raw
Quoted 11 lines · Kees Cook
Quoted 10 lines · Nathan Chancellor
Quoted 8 lines · Kees Cook

Depending on !COMPILE_TEST isn't sufficient to keep this feature out of CI because we can't stop it from being included in randconfig builds. This feature is still highly experimental, and is developed in lock-step with Clang's Overflow Behavior Types[1]. Depend on BROKEN to keep it from being enabled by anyone not expecting it.

Quoted 6 lines
Quoted 3 lines

Should this have a 'Cc: [email protected]' on it? There might not be much randconfig testing on stable but it is still very much possible for some random user to turn this on and report problems.

Ah yeah, I should probably do this via a proper Fixes: tag. I'll add this.

Nit, "Fixes:" tags alone without a cc: stable do not guarantee they will end up in the stable trees. Always explicitly add a cc: please.

thanks,

greg k-h

reviewer Acked-by on v1 1/1
#5 lore raw
In reply to Kees Cook
Quoted 9 lines · Kees Cook

Depending on !COMPILE_TEST isn't sufficient to keep this feature out of CI because we can't stop it from being included in randconfig builds. This feature is still highly experimental, and is developed in lock-step with Clang's Overflow Behavior Types[1]. Depend on BROKEN to keep it from being enabled by anyone not expecting it.

Quoted 28 lines

---
Cc: Justin Stitt <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: [email protected]
Cc: <[email protected]>

---
 lib/Kconfig.ubsan | 2 ++
 1 file changed, 2 insertions(+)
lib/Kconfig.ubsan +2 -1
index f6ea0c5b5da3..96cd89668467 100644
@@ -118,6 +118,8 @@ config UBSAN_UNREACHABLE
 
 config UBSAN_INTEGER_WRAP
        bool "Perform checking for integer arithmetic wrap-around"
+       # This is very experimental so drop the next line if you really want it
+       depends on BROKEN
        depends on !COMPILE_TEST
        depends on $(cc-option,-fsanitize-undefined-ignore-overflow-pattern=all)
        depends on $(cc-option,-fsanitize=signed-integer-overflow)
--

2.34.1