Commit 1d9de44e authored by Herbert Xu's avatar Herbert Xu

random: Wake up all getrandom(2) callers when pool is ready

If more than one application invokes getrandom(2) before the pool
is ready, then all bar one will be stuck forever because we use
wake_up_interruptible which wakes up a single task.

This patch replaces it with wake_up_all.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 374d4ad1
...@@ -660,7 +660,7 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits) ...@@ -660,7 +660,7 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits)
r->entropy_total = 0; r->entropy_total = 0;
if (r == &nonblocking_pool) { if (r == &nonblocking_pool) {
prandom_reseed_late(); prandom_reseed_late();
wake_up_interruptible(&urandom_init_wait); wake_up_all(&urandom_init_wait);
pr_notice("random: %s pool is initialized\n", r->name); pr_notice("random: %s pool is initialized\n", r->name);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment