summaryrefslogtreecommitdiff
path: root/scripts/kconfig/tests/transitional/initial_config
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-09-30 08:45:19 -0700
committerKees Cook <kees@kernel.org>2025-10-07 08:21:23 -0700
commit0902b3cb23ce7f436bddbdf6ba7b1ed427b36bd9 (patch)
tree140115df89a8232451361ed8142cbe38da6f362a /scripts/kconfig/tests/transitional/initial_config
parentfd94619c43360eb44d28bd3ef326a4f85c600a07 (diff)
kconfig: Avoid prompting for transitional symbols
The "transitional" symbol keyword, while working with the "olddefconfig" target, was prompting during "oldconfig". This occurred because these symbols were not being marked as user-defined when they received values from transitional symbols that had user values. The "olddefconfig" target explicitly doesn't prompt for anything, so this deficiency wasn't noticed. The issue manifested when a symbol's value came from a transitional symbol's user value but the receiving symbol wasn't marked with SYMBOL_DEF_USER. Thus the "oldconfig" logic would then prompt for these symbols unnecessarily. Check after value calculation whether a symbol without a user value gets its value from a single transitional symbol that does have a user value. In such cases, mark the receiving symbol as user-defined to prevent prompting. Update regression tests to verify that symbols with transitional defaults are not prompted in "oldconfig", except when conditional defaults evaluate to 'no' and should legitimately be prompted. Build tested with "make testconfig". Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Closes: https://lore.kernel.org/lkml/CAHk-=wgZjUk4Cy2XgNkTrQoO8XCmNUHrTe5D519Fij1POK+3qw@mail.gmail.com/ Fixes: f9afce4f32e9 ("kconfig: Add transitional symbol attribute for migration support") Cc: Vegard Nossum <vegard.nossum@oracle.com> Link: https://lore.kernel.org/r/20250930154514.it.623-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'scripts/kconfig/tests/transitional/initial_config')
-rw-r--r--scripts/kconfig/tests/transitional/initial_config4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/kconfig/tests/transitional/initial_config b/scripts/kconfig/tests/transitional/initial_config
index e648a65e504c..68b7da672426 100644
--- a/scripts/kconfig/tests/transitional/initial_config
+++ b/scripts/kconfig/tests/transitional/initial_config
@@ -14,3 +14,7 @@ CONFIG_NEW_HEX_PRECEDENCE=0xABCD
CONFIG_OLD_HEX_PRECEDENCE=0x5678
CONFIG_NEW_INT_PRECEDENCE=100
CONFIG_OLD_INT_PRECEDENCE=200
+# CONFIG_OLD_DISABLED is not set
+# CONFIG_OLD_DISABLED_UNSAVED is not set
+# CONFIG_DEPENDENCY_TEST is not set
+CONFIG_OLD_CONDITIONAL_DEFAULT=y