Skip to contentSkip to conversation

FAILED: patch "[PATCH] lib/Kconfig.ubsan: Remove 'default UBSAN' from" failed to apply to 6.12-stable tree

PATCH In review [email protected] 4 participants 7 messages Apr 21, 2025 – Apr 24, 2025

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x cdc2e1d9d929d7f7009b3a5edca52388a2b0891f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025042120-backward-waged-41cf@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From cdc2e1d9d929d7f7009b3a5edca52388a2b0891f Mon Sep 17 00:00:00 2001
From: Nathan Chancellor <[email protected]>
Date: Mon, 14 Apr 2025 15:00:59 -0700
Subject: [PATCH] lib/Kconfig.ubsan: Remove 'default UBSAN' from
UBSAN_INTEGER_WRAP

CONFIG_UBSAN_INTEGER_WRAP is 'default UBSAN', which is problematic for a couple of reasons.

The first is that this sanitizer is under active development on the compiler side to come up with a solution that is maintainable on the compiler side and usable on the kernel side. As a result of this, there are many warnings when the sanitizer is enabled that have no clear path to resolution yet but users may see them and report them in the meantime.

The second is that this option was renamed from CONFIG_UBSAN_SIGNED_WRAP, meaning that if a configuration has CONFIG_UBSAN=y but CONFIG_UBSAN_SIGNED_WRAP=n and it is upgraded via olddefconfig (common in non-interactive scenarios such as CI), CONFIG_UBSAN_INTEGER_WRAP will be silently enabled again.

Remove 'default UBSAN' from CONFIG_UBSAN_INTEGER_WRAP until it is ready for regular usage and testing from a broader community than the folks actively working on the feature.

lib/Kconfig.ubsan +0 -1
index 4216b3a4ff21..f6ea0c5b5da3 100644
@@ -118,7 +118,6 @@ config UBSAN_UNREACHABLE
 
 config UBSAN_INTEGER_WRAP
 	bool "Perform checking for integer arithmetic wrap-around"
-	default UBSAN
 	depends on !COMPILE_TEST
 	depends on $(cc-option,-fsanitize-undefined-ignore-overflow-pattern=all)
 	depends on $(cc-option,-fsanitize=signed-integer-overflow)
#1 lore raw

PATCH 1/1 lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

commit ed2b548f1017586c44f50654ef9febb42d491f31 upstream.

CONFIG_UBSAN_INTEGER_WRAP is 'default UBSAN', which is problematic for a couple of reasons.

The first is that this sanitizer is under active development on the compiler side to come up with a solution that is maintainable on the compiler side and usable on the kernel side. As a result of this, there are many warnings when the sanitizer is enabled that have no clear path to resolution yet but users may see them and report them in the meantime.

The second is that this option was renamed from CONFIG_UBSAN_SIGNED_WRAP, meaning that if a configuration has CONFIG_UBSAN=y but CONFIG_UBSAN_SIGNED_WRAP=n and it is upgraded via olddefconfig (common in non-interactive scenarios such as CI), CONFIG_UBSAN_INTEGER_WRAP will be silently enabled again.

Remove 'default UBSAN' from CONFIG_UBSAN_INTEGER_WRAP until it is ready for regular usage and testing from a broader community than the folks actively working on the feature.

Fixes 557f8c582a9b ("ubsan: Reintroduce signed overflow sanitizer")
[nathan: Fix conflict due to lack of rename from ed2b548f1017 in stable]
---
 lib/Kconfig.ubsan | 1 -
 1 file changed, 1 deletion(-)
lib/Kconfig.ubsan +0 -1
index 1d4aa7a83b3a..37655f58b855 100644
@@ -118,7 +118,6 @@ config UBSAN_UNREACHABLE
 
 config UBSAN_SIGNED_WRAP
 	bool "Perform checking for signed arithmetic wrap-around"
-	default UBSAN
 	depends on !COMPILE_TEST
 	# The no_sanitize attribute was introduced in GCC with version 8.
 	depends on !CC_IS_GCC || GCC_VERSION >= 80000

base-commit: b6efa8ce222e58cfe2bbaa4e3329818c2b4bd74e

Signature · 1 line
2.49.0
maintainer
#2 lore raw

Re: [PATCH 6.12] lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected. No action required from the submitter.

The upstream commit SHA1 provided is correct: ed2b548f1017586c44f50654ef9febb42d491f31

WARNING: Author mismatch between patch and upstream commit:
Backport author: Nathan Chancellor<[email protected]> Commit author: Kees Cook<[email protected]>

Status in newer kernel trees:
6.14.y | Not found

Note: The patch differs from the upstream commit:
---

1:  ed2b548f10175 < -:  ------------- ubsan/overflow: Rework integer overflow sanitizer option to turn on everything
-:  ------------- > 1:  e3de54ebc19aa lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y       |  Success    |  Success   |
author maintainer
#3 lore raw

Re: [PATCH 6.12] lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

In reply to Nathan Chancellor
Quoted 1 line · Nathan Chancellor

commit ed2b548f1017586c44f50654ef9febb42d491f31 upstream.

Wrong git id :(

maintainer
#4 lore raw

Re: [PATCH 6.12] lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

Quoted 4 lines · Greg KH
Quoted 1 line · Nathan Chancellor

commit ed2b548f1017586c44f50654ef9febb42d491f31 upstream.

Wrong git id :(

Same as for 6.14:

Should be cdc2e1d9d929d7f7009b3a5edca52388a2b0891f

(ed2b548f1017586c44f50654ef9febb42d491f31 is what was fixed, I assume a paste-o)

Signature · 1 line
Kees Cook
#5 lore raw

PATCH v2 1/1 lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

In reply to [email protected]

commit cdc2e1d9d929d7f7009b3a5edca52388a2b0891f upstream.

CONFIG_UBSAN_INTEGER_WRAP is 'default UBSAN', which is problematic for a couple of reasons.

The first is that this sanitizer is under active development on the compiler side to come up with a solution that is maintainable on the compiler side and usable on the kernel side. As a result of this, there are many warnings when the sanitizer is enabled that have no clear path to resolution yet but users may see them and report them in the meantime.

The second is that this option was renamed from CONFIG_UBSAN_SIGNED_WRAP, meaning that if a configuration has CONFIG_UBSAN=y but CONFIG_UBSAN_SIGNED_WRAP=n and it is upgraded via olddefconfig (common in non-interactive scenarios such as CI), CONFIG_UBSAN_INTEGER_WRAP will be silently enabled again.

Remove 'default UBSAN' from CONFIG_UBSAN_INTEGER_WRAP until it is ready for regular usage and testing from a broader community than the folks actively working on the feature.

Fixes 557f8c582a9b ("ubsan: Reintroduce signed overflow sanitizer")
[nathan: Fix conflict due to lack of rename from ed2b548f1017 in stable]

---
v1 -> v2: Correct upstream ID

---
 lib/Kconfig.ubsan | 1 -
 1 file changed, 1 deletion(-)
lib/Kconfig.ubsan +0 -1
index 1d4aa7a83b3a..37655f58b855 100644
@@ -118,7 +118,6 @@ config UBSAN_UNREACHABLE
 
 config UBSAN_SIGNED_WRAP
 	bool "Perform checking for signed arithmetic wrap-around"
-	default UBSAN
 	depends on !COMPILE_TEST
 	# The no_sanitize attribute was introduced in GCC with version 8.
 	depends on !CC_IS_GCC || GCC_VERSION >= 80000

base-commit: b6efa8ce222e58cfe2bbaa4e3329818c2b4bd74e

Signature · 1 line
2.49.0
maintainer
#6 lore raw

Re: [PATCH 6.12 v2] lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected. No action required from the submitter.

The upstream commit SHA1 provided is correct: cdc2e1d9d929d7f7009b3a5edca52388a2b0891f

Status in newer kernel trees:
6.14.y | Not found

Note: The patch differs from the upstream commit:
---

1:  cdc2e1d9d929d < -:  ------------- lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP
-:  ------------- > 1:  31b9ab35d27ca lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y       |  Success    |  Success   |