[PATCH] rockchip: board: Increase rng-seed size to make it sufficient for modern Linux

Marek Vasut marex at denx.de
Sun Oct 13 22:35:30 CEST 2024


On 10/13/24 11:32 AM, Alex Shumsky wrote:
> Modern Linux requires 32 byte seed to initialize random pool, but u-boot
> currently provides only 8 bytes. Increase rng-seed size to make Linux happy and
> initialize rng pool instantly.
> 
> Boot with 8 byte rng-seed:
>      # dmesg | grep crng
>      [   12.089286] random: crng init done
> Boot with 32 byte rng-seed:
>      # dmesg | grep crng
>      [    0.000000] random: crng init done
> 
> https://github.com/torvalds/linux/blob/7234e2ea0edd00bfb6bb2159e55878c19885ce68/drivers/char/random.c#L632
> 
> Signed-off-by: Alex Shumsky <alexthreed at gmail.com>
> Fixes: d2048ba ("rockchip: board: Add board_rng_seed() for all Rockchip devices")

Fixes uses 12-character commit SHA.

> ---
> 
>   arch/arm/mach-rockchip/board.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
> index 3fadf7e412..eee75f7bcb 100644
> --- a/arch/arm/mach-rockchip/board.c
> +++ b/arch/arm/mach-rockchip/board.c
> @@ -472,7 +472,7 @@ __weak int misc_init_r(void)
>   __weak int board_rng_seed(struct abuf *buf)
>   {
>   	struct udevice *dev;
> -	size_t len = 0x8;
> +	size_t len = 32;
Let's make this override-able via environment variable, because this 
might be growing in the future again. Does this work ?

size_t len = env_get_ulong("kaslrseed_size", 10, 32);


More information about the U-Boot mailing list