From: Julian Braha <julianbraha@gmail.com>
To: Dmitrii Tulnov <tulnov.dl@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>
Cc: Peter Korsgaard <jacmet@uclibc.org>,
"Yann E. MORIN" <yann.morin.1998@free.fr>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6] kconfig: warn about malformed KCONFIG_PROBABILITY values
Date: Sat, 19 Sep 2026 12:46:58 +0100 [thread overview]
Message-ID: <4d1eee3a-a5f9-467e-880e-4f2815851b09@gmail.com> (raw)
In-Reply-To: <20260918213430.3-1-tulnov.dl@gmail.com>
On 9/18/26 22:34, Dmitrii Tulnov wrote:
> randconfig checks the numeric range of each probability but does not
> validate where strtol() stops. For example, KCONFIG_PROBABILITY=50% is
> accepted as 50:0:0: the '%' is parsed repeatedly as zero. For the
> documented value 50, tristate y/m/n probabilities are 25%/25%/50%.
> With 50%, both y/m probabilities silently become zero, reducing the
> coverage of random configuration builds. Empty fields and extra fields
> are also accepted.
>
> Warn when the value does not follow the documented decimal format. For
> malformed inputs whose parsed probabilities are in range, preserve the
> existing interpretation unless KCONFIG_WERROR is set. In that case, exit
> with an error before writing the configuration. Leading whitespace and
> signs are accepted by strtol(), but also trigger the warning because they
> are outside the documented format.
>
> Keep the strtol() result as long until the range check. This rejects
> out-of-range values that narrowing to int previously made valid, such as
> 4294967296 becoming zero on a 64-bit host, regardless of KCONFIG_WERROR.
>
> Add regression tests for one warning per malformed input, preserved
> configurations, KCONFIG_WERROR, out-of-range values, the supported
> probability formats, and the documented empty-value default.
>
> Fixes: e43956e60769 ("kconfig: implement KCONFIG_PROBABILITY for randconfig")
> Assisted-by: LLM
> Signed-off-by: Dmitrii Tulnov <tulnov.dl@gmail.com>
Tested-by: Julian Braha <julianbraha@gmail.com>
Reviewed-by: Julian Braha <julianbraha@gmail.com>
prev parent reply other threads:[~2026-09-19 11:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 19:45 [PATCH] kconfig: reject " Dmitrii Tulnov
2026-09-08 19:24 ` Julian Braha
2026-09-08 20:35 ` Dmitrii Tulnov
2026-09-08 20:36 ` [PATCH v2] kconfig: warn about " Dmitrii Tulnov
2026-09-10 0:05 ` Julian Braha
2026-09-10 9:13 ` Dmitrii Tulnov
2026-09-10 11:25 ` Julian Braha
2026-09-10 12:04 ` [PATCH v3] " Dmitrii Tulnov
2026-09-10 21:17 ` Julian Braha
2026-09-10 21:52 ` [PATCH v4] " Dmitrii Tulnov
2026-09-15 13:13 ` Julian Braha
2026-09-15 15:18 ` [PATCH v5] " Dmitrii Tulnov
2026-09-18 19:27 ` Julian Braha
2026-09-18 21:34 ` [PATCH v6] " Dmitrii Tulnov
2026-09-19 11:46 ` Julian Braha [this message]
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=4d1eee3a-a5f9-467e-880e-4f2815851b09@gmail.com \
--to=julianbraha@gmail.com \
--cc=jacmet@uclibc.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=tulnov.dl@gmail.com \
--cc=yann.morin.1998@free.fr \
/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
all inboxes | Powered by JetHome®