Re: [PATCH v2 1/2] kconfig: randconfig: parse KCONFIG_SEED with strtoull()

From: Julian Braha

Date: Sat Dec 05 2026 - 12:12:24 EST


On 12/1/26 06:22, Priyanshu Singh wrote:
> set_randconfig_seed() parses KCONFIG_SEED with signed strtol(). On 32-bit
> hosts where long is 32 bits, valid unsigned 32-bit seeds in
> [0x80000000, 0xFFFFFFFF] exceed LONG_MAX (0x7FFFFFFF), so strtol() clamps
> them to 0x7FFFFFFF. Since randconfig itself prints seeds via
> "KCONFIG_SEED=0x%X\n", roughly half of all generated seeds fail to replay
> accurately on 32-bit hosts.
>
> Switch to strtoull() so the full 32-bit unsigned seed range parses
> identically across 32-bit and 64-bit hosts.
>
> Fixes: 0d8024c6ebad ("kconfig: allow specifying the seed for randconfig")
> Signed-off-by: Priyanshu Singh <singhpriyanshu9838@xxxxxxxxx>

Tested-by: Julian Braha <julianbraha@xxxxxxxxx>
Reviewed-by: Julian Braha <julianbraha@xxxxxxxxx>

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature