random: wake up /dev/random writers after zap
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 28 Jan 2022 22:44:03 +0000 (23:44 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 4 Feb 2022 18:22:32 +0000 (19:22 +0100)
commit042e293e16e3aa9794ce60c29f5b7b0c8170f933
treeb0f1c07c6222f4aa408dfa7aff26fbefb0bdc2db
parentc321e907aa4803d562d6e70ebed9444ad082f953
random: wake up /dev/random writers after zap

When account() is called, and the amount of entropy dips below
random_write_wakeup_bits, we wake up the random writers, so that they
can write some more in. However, the RNDZAPENTCNT/RNDCLEARPOOL ioctl
sets the entropy count to zero -- a potential reduction just like
account() -- but does not unblock writers. This commit adds the missing
logic to that ioctl to unblock waiting writers.

Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c