summaryrefslogtreecommitdiff
path: root/crypto/shash.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2021-03-21 22:07:48 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-11 14:04:15 +0200
commit9ac2e8aadf7fd074c6b5a9a60a7d0b8567a1f1ec (patch)
tree7799120ae3e0458bd248bfeddae0099e63b41245 /crypto/shash.c
parent9ee4fcdc653d31bdc3804da8a983db1df27899e3 (diff)
downloadlinux-crypto-9ac2e8aadf7fd074c6b5a9a60a7d0b8567a1f1ec.tar.gz
linux-crypto-9ac2e8aadf7fd074c6b5a9a60a7d0b8567a1f1ec.zip
crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS
commit bf1e9b3dff85a0433aaea6755c3f8036840dacfb upstream. 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: 9b91cc7900ce ("crypto: rng - Fix a refcounting bug in crypto_rng_reset()") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto/shash.c')
0 files changed, 0 insertions, 0 deletions