random: fix locking in crng_fast_load()
crng_init is protected by primary_crng->lock, so keep holding that lock
when incrementing crng_init from 0 to 1 in crng_fast_load(). The call to
pr_notice() can wait until the lock is released; this code path cannot
be reached twice, as crng_fast_load() aborts early if crng_init > 0.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
[Jason: Note - this is only possible now that invalidate_batched_
entropy() is a simple atomic_inc(), so this must be ordered after that,
even though it appears on first glance as independent.]
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>