]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:10 +0000 (09:23 +0200)
commit6f0edf9532c2ffa66f1970ed176a6101ac91a701
tree842ea315229dcd750ff1cb003030f936e835eb7a
parent08e33cf20329e6129d0b4385fa9b5c686584e769
random: do not use batches when !crng_ready()

BugLink: https://bugs.launchpad.net/bugs/1981649
commit cbe89e5a375a51bbb952929b93fa973416fea74e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/char/random.c