Re: [PATCH] kconfig: warn about malformed KCONFIG_SEED values
From: Priyanshu Singh
Date: Thu Nov 26 2026 - 21:24:04 EST
Hi Nathan,
Thanks for taking a look and for the feedback.
On 11/25/26 23:10, Nathan Chancellor wrote:
> - Most people are just going to be using a previously generated
> KCONFIG_SEED; can these issues happen with the default logic?
Yes, in two ways when replaying a previously generated seed:
1. On 32-bit hosts, randconfig generates a full unsigned 32-bit seed
(0x0..0xFFFFFFFF). Half of those default-generated seeds
(>= 0x80000000) overflow 32-bit signed strtol() and quietly clamp
to 0x7FFFFFFF on replay instead of reproducing the original config.
2. Even on 64-bit hosts, copy-pasting a printed KCONFIG_SEED from a
build log or CI report with an accidental trailing space (or typo)
silently discards the seed and falls back to gettimeofday() with
status 0 and no warning, while leading whitespace is accepted
(asymmetric behavior).
I suspect it hasn't shown up in reports because the silent fallback to
0x7FFFFFFF or a clock seed just looks like a normal randconfig run that
failed to reproduce.
That being said, I completely agree v1 was heavier than warranted for
this (especially the test file). Once the 0b check is dropped and the
tests are trimmed per Julian's review, the C change is quite small and
brings KCONFIG_SEED in line with the existing warning for
KCONFIG_PROBABILITY.
Thanks,
Priyanshu