Hi Guenter,
On Fri, May 27, 2022 at 09:59:14AM -0700, Guenter Roeck wrote:
Given that we (ChromeOS) have been hit by rng related issues before (specifically boot stalls on some hardware), I am quite concerned about the possible impact of this series for stable releases.
The urandom try_to_generate_entropy() change from 5.18 wasn't backported.
zx2c4@thinkpad ~/Projects/random-linux $ git diff linux-5.10.y:drivers/char/random.c master:drivers/char/random.c [...snip...] @@ -1292,6 +1311,13 @@ static ssize_t urandom_read_iter(struct kiocb *kiocb, struct iov_iter *iter) { static int maxwarn = 10;
+ /* + * Opportunistically attempt to initialize the RNG on platforms that + * have fast cycle counters, but don't (for now) require it to succeed. + */ + if (!crng_ready()) + try_to_generate_entropy(); + if (!crng_ready()) { if (!ratelimit_disable && maxwarn <= 0) ++urandom_warning.missed;
Jason