Re: [PATCH] crypto: jitter - reuse allocated entropy collector

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 07, 2023 at 09:10:43AM +0200, Stephan Müller wrote:
> In case a health test error occurs during runtime, the power-up health
> tests are rerun to verify that the noise source is still good and
> that the reported health test error was an outlier. For performing this
> power-up health test, the already existing entropy collector instance
> is used instead of allocating a new one. This change has the following
> implications:
> 
> * The noise that is collected as part of the newly run health tests is
>   inserted into the entropy collector and thus stirs the existing
>   data present in there further. Thus, the entropy collected during
>   the health test is not wasted. This is also allowed by SP800-90B.
> 
> * The power-on health test is not affected by the state of the entropy
>   collector, because it resets the APT / RCT state. The remainder of
>   the state is unrelated to the health test as it is only applied to
>   newly obtained time stamps.
> 
> This change also fixes a bug report about an allocation while in an
> atomic lock (the lock is taken in jent_kcapi_random, jent_read_entropy
> is called and this can call jent_entropy_init).
> 
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Stephan Mueller <smueller@xxxxxxxxxx>
> ---
>  crypto/jitterentropy-kcapi.c |  2 +-
>  crypto/jitterentropy.c       | 36 ++++++++++++++++++++++++++----------
>  crypto/jitterentropy.h       |  2 +-
>  3 files changed, 28 insertions(+), 12 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux