2022-05-30 14:12:38

by Toralf Förster

[permalink] [raw]
Subject: 5.18.1 has thousands of similar lines in dmesg with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y

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

5.18.0 was fine

--
Toralf


2022-05-31 04:14:52

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: 5.18.1 has thousands of similar lines in dmesg with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y

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/[email protected]/
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

2022-05-31 05:53:33

by John Ogness

[permalink] [raw]
Subject: Re: 5.18.1 has thousands of similar lines in dmesg with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y

On 2022-05-30, Toralf Förster <[email protected]> wrote:
> On 5/30/22 11:24, Toralf Förster wrote:
>> This deletes the early boot messages in dmesg:
>
> changing CONFIG_LOG_BUF_SHIFT=18 to CONFIG_LOG_BUF_SHIFT=20 helps, but
> nevertheless:

FWIW, you can also use the boot argument "log_buf_len" to dynamically
allocate the dmesg buffer at boot.

For example: log_buf_len=16M

This is usually more convenient than reconfiguring/rebuilding your
kernel.

John Ogness

2022-05-31 18:23:34

by Toralf Förster

[permalink] [raw]
Subject: Re: 5.18.1 has thousands of similar lines in dmesg with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y

On 5/30/22 21:52, John Ogness wrote:
> FWIW, you can also use the boot argument "log_buf_len" to dynamically
> allocate the dmesg buffer at boot.
indeed.
Thx.

--
Toralf

2022-06-01 20:21:19

by Toralf Förster

[permalink] [raw]
Subject: Re: 5.18.1 has thousands of similar lines in dmesg with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y

On 5/30/22 11:24, Toralf Förster wrote:
> This deletes the early boot messages in dmesg:
>

Well,

changing CONFIG_LOG_BUF_SHIFT=18 to CONFIG_LOG_BUF_SHIFT=20 helps, but
nevertheless:

$ grep get_random_u dmesg-5.18.1 | wc
5541 38787 440908

For 5.15.44 there's no similar effect in dmesg after upgrading the kernel.

--
Toralf