random: continually use hwgenerator randomness
authorDominik Brodowski <linux@dominikbrodowski.net>
Tue, 25 Jan 2022 20:14:57 +0000 (21:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:29:03 +0000 (09:29 +0200)
commitb53c9666e7146fdd60b004f0e90d62c1821173a2
treef6de4e9b4038488643f2e7ed9af0b34ac822ec7d
parentc1dc53d781fd3d5af0d75b053864fc54ef2ad664
random: continually use hwgenerator randomness

commit c321e907aa4803d562d6e70ebed9444ad082f953 upstream.

The rngd kernel thread may sleep indefinitely if the entropy count is
kept above random_write_wakeup_bits by other entropy sources. To make
best use of multiple sources of randomness, mix entropy from hardware
RNGs into the pool at least once within CRNG_RESEED_INTERVAL.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c