random: Add callback API for random pool readiness
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 9 Jun 2015 10:19:39 +0000 (18:19 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 10 Jun 2015 11:13:56 +0000 (19:13 +0800)
commit205a525c334295e3cd4cc7755fd2c0398e3a787f
tree90a62c129458c30fcce01cdde1c4c5f34820fb5a
parent05dee9c7ebc06719df2dd11bfd3bea96aeaf9707
random: Add callback API for random pool readiness

The get_blocking_random_bytes API is broken because the wait can
be arbitrarily long (potentially forever) so there is no safe way
of calling it from within the kernel.

This patch replaces it with a callback API instead.  The callback
is invoked potentially from interrupt context so the user needs
to schedule their own work thread if necessary.

In addition to adding callbacks, they can also be removed as
otherwise this opens up a way for user-space to allocate kernel
memory with no bound (by opening algif_rng descriptors and then
closing them).

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/random.c
include/linux/random.h
This page took 0.02586 seconds and 5 git commands to generate.