Bug 216104

Summary: kernel log filled with random: get_random_u32 called ... with crng_init=1
Product: Drivers Reporter: Jan Palus (jpalus)
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: ARM   
OS: Linux   
Kernel Version: 5.18.3 Subsystem:
Regression: No Bisected commit-id:

Description Jan Palus 2022-06-09 13:47:41 UTC
After upgrading from 5.18.0 to 5.18.3 on arm64 boot time got slightly longer and `journalctl -b` reports:


cze 09 15:31:32 pine systemd-journald[302]: Journal started
cze 09 15:31:32 pine systemd-journald[302]: Runtime Journal (/run/log/journal/c7c64e672d904d78bc295eff5bc301bb) is 8.0M, max 193.2M, 185.2M free.
cze 09 15:31:38 pine systemd-journald[302]: Missed 331278 kernel messages
cze 09 15:31:38 pine kernel: random: get_random_u32 called from invoke_syscall+0xc4/0x140 with crng_init=1
cze 09 15:31:38 pine kernel: random: get_random_u32 called from invoke_syscall+0xc4/0x140 with crng_init=1
cze 09 15:31:38 pine kernel: random: get_random_u32 called from invoke_syscall+0xc4/0x140 with crng_init=1
cze 09 15:31:38 pine kernel: random: get_random_u32 called from invoke_syscall+0xc4/0x140 with crng_init=1
cze 09 15:31:38 pine kernel: random: get_random_u32 called from invoke_syscall+0xc4/0x140 with crng_init=1
...


goes on and on and I suspect "Missed 331278 kernel messages" refers also to these messages mostly. Ultimately it boots and works fine and at some point these messages stop being logged.
Comment 1 Jan Palus 2022-06-12 20:38:57 UTC
On slower ARM devices this log accounted for additional 40s of kernel boot time (while previously it was 5s total kernel boot time) which prevented some of them from booting at all since ie watchdog on Turris Omnia assumed device is stuck and reset the device putting it in boot loop.

Looks like it's intended behavior now after:

commit	443a7b15c858ec799ae7ba5146316c4d30c778d6 
author	Jason A. Donenfeld <Jason@zx2c4.com>
random: remove ratelimiting for in-kernel unseeded randomness

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=443a7b15c858ec799ae7ba5146316c4d30c778d6

and with CONFIG_WARN_ALL_UNSEEDED_RANDOM enabled.

Anyway disabling CONFIG_WARN_ALL_UNSEEDED_RANDOM fixes the issue.