Re: 5.18.1 has thousands of similar lines in dmesg with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y

From: Jason A. Donenfeld
Date: Mon May 30 2022 - 15:47:15 EST


Hi Toralf,

On Mon, May 30, 2022 at 11:24:55AM +0200, Toralf Förster wrote:
> This deletes the early boot messages in dmesg:
>
> /var/log # head dmesg
> [ 3.114274] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114286] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114291] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114297] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114304] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114315] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114323] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114329] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114333] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0
> [ 3.114345] random: get_random_u32 called from
> allocate_slab+0x144/0x480 with crng_init=0

This was simplified here:

https://lore.kernel.org/lkml/20220509172426.612649-1-Jason@xxxxxxxxx/
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc1e127bfa95b5fb2f9307e7168bf8b2b45b4c5e

I'm happy to consider other heuristics than the one there if you find
this one problematic. But I think as a debug option, the current
behavior encapsulates well what somebody might want to know when
debugging a kernel. Either way, please let me know if this poses a
problem for you.

Jason