Re: [PATCH] crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS

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

 



Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
> From: Eric Biggers <ebiggers@xxxxxxxxxx>
> 
> crypto_stats_get() is a no-op when the kernel is compiled without
> CONFIG_CRYPTO_STATS, so pairing it with crypto_alg_put() unconditionally
> (as crypto_rng_reset() does) is wrong.
> 
> Fix this by moving the call to crypto_stats_get() to just before the
> actual algorithm operation which might need it.  This makes it always
> paired with crypto_stats_rng_seed().
> 
> Fixes: eed74b3eba9e ("crypto: rng - Fix a refcounting bug in crypto_rng_reset()")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> ---
> crypto/rng.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 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]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux