From: Nathan Chancellor <nathan@kernel.org>
To: Kees Cook <kees@kernel.org>
Cc: Vegard Nossum <vegard.nossum@oracle.com>,
Nicolas Schier <nicolas.schier@linux.dev>,
Jonathan Corbet <corbet@lwn.net>,
Masahiro Yamada <masahiroy@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Arnd Bergmann <arnd@arndb.de>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org,
Sami Tolvanen <samitolvanen@google.com>,
Linus Walleij <linus.walleij@linaro.org>,
Mark Rutland <mark.rutland@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
Puranjay Mohan <puranjay@kernel.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3 2/3] kconfig: Add transitional symbol attribute for migration support
Date: Wed, 24 Sep 2025 09:38:27 -0700 [thread overview]
Message-ID: <20250924163827.GA3322486@ax162> (raw)
In-Reply-To: <20250923213422.1105654-2-kees@kernel.org>
On Tue, Sep 23, 2025 at 02:34:18PM -0700, Kees Cook wrote:
> During kernel option migrations (e.g. CONFIG_CFI_CLANG to CONFIG_CFI),
> existing .config files need to maintain backward compatibility while
> preventing deprecated options from appearing in newly generated
> configurations. This is challenging with existing Kconfig mechanisms
> because:
>
> 1. Simply removing old options breaks existing .config files.
> 2. Manually listing an option as "deprecated" leaves it needlessly
> visible and still writes them to new .config files.
> 3. Using any method to remove visibility (.e.g no 'prompt', 'if n',
> etc) prevents the option from being processed at all.
>
> Add a "transitional" attribute that creates symbols which are:
> - Processed during configuration (can influence other symbols' defaults)
> - Hidden from user menus (no prompts appear)
> - Omitted from newly written .config files (gets migrated)
> - Restricted to only having help sections (no defaults, selects, etc)
> making it truly just a "prior value pass-through" option.
>
> The transitional syntax requires a type argument and prevents type
> redefinition:
>
> config NEW_OPTION
> bool "New option"
> default OLD_OPTION
>
> config OLD_OPTION
> bool
> transitional
> help
> Transitional config for OLD_OPTION migration.
>
> This allows seamless migration: olddefconfig processes existing
> CONFIG_OLD_OPTION=y settings to enable CONFIG_NEW_OPTION=y, while
> CONFIG_OLD_OPTION is omitted from newly generated .config files.
>
> Added positive and negative testing via "testconfig" make target.
>
> Co-developed-by: Vegard Nossum <vegard.nossum@oracle.com>
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> Signed-off-by: Kees Cook <kees@kernel.org>
This seems reasonable to me but I am by no means a Kconfig expert.
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
next prev parent reply other threads:[~2025-09-24 16:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 21:34 [PATCH v3 0/3] kconfig: Add transitional symbol attribute for migration support Kees Cook
2025-09-23 21:34 ` [PATCH v3 1/3] kconfig: Fix BrokenPipeError warnings in selftests Kees Cook
2025-09-24 16:25 ` Nathan Chancellor
2025-09-23 21:34 ` [PATCH v3 2/3] kconfig: Add transitional symbol attribute for migration support Kees Cook
2025-09-24 16:38 ` Nathan Chancellor [this message]
2025-09-23 21:34 ` [PATCH v3 3/3] kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI Kees Cook
2025-09-24 16:45 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250924163827.GA3322486@ax162 \
--to=nathan@kernel.org \
--cc=arnd@arndb.de \
--cc=corbet@lwn.net \
--cc=kees@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=masahiroy@kernel.org \
--cc=nicolas.schier@linux.dev \
--cc=peterz@infradead.org \
--cc=puranjay@kernel.org \
--cc=rdunlap@infradead.org \
--cc=samitolvanen@google.com \
--cc=vegard.nossum@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox