]> git.baikalelectronics.ru Git - kernel.git/commit
random: do not use batches when !crng_ready()
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 3 May 2022 12:14:32 +0000 (14:14 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 13 May 2022 21:59:23 +0000 (23:59 +0200)
commit75dc496f802234f7dd8073c1f44a99edf5f44cf2
tree7e679dde0dc8117d6a56934b74a497ee35dcb528
parent54872951b840f5c9d9c0eb6773a972bdc0ec1e16
random: do not use batches when !crng_ready()

It's too hard to keep the batches synchronized, and pointless anyway,
since in !crng_ready(), we're updating the base_crng key really often,
where batching only hurts. So instead, if the crng isn't ready, just
call into get_random_bytes(). At this stage nothing is performance
critical anyhow.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c