Skip to content

Commit 44ea43b

Browse files
tytsogregkh
authored andcommitted
random: rate limit unseeded randomness warnings
commit 4e00b339e264802851aff8e73cde7d24b57b18ce upstream. On systems without sufficient boot randomness, no point spamming dmesg. Signed-off-by: Theodore Ts'o <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 32988e2 commit 44ea43b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/char/random.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,8 +1637,9 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller,
16371637
#ifndef CONFIG_WARN_ALL_UNSEEDED_RANDOM
16381638
print_once = true;
16391639
#endif
1640-
pr_notice("random: %s called from %pS with crng_init=%d\n",
1641-
func_name, caller, crng_init);
1640+
if (__ratelimit(&unseeded_warning))
1641+
pr_notice("random: %s called from %pS with crng_init=%d\n",
1642+
func_name, caller, crng_init);
16421643
}
16431644

16441645
/*

0 commit comments

Comments
 (0)