]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: af_alg - Fix race around ctx->rcvused by making it atomic_t
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Dec 2017 10:27:24 +0000 (10:27 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Dec 2017 08:02:40 +0000 (19:02 +1100)
commit57ba8c5d3debffc19ca5fe676c1133ae7c98e0ec
tree93a46f7d3a6038882d956007e9b8a927df37b36c
parentf573b04bff9c162c03e0e9c7c665531c2d435471
crypto: af_alg - Fix race around ctx->rcvused by making it atomic_t

This variable was increased and decreased without any protection.
Result was an occasional misscount and negative wrap around resulting
in false resource allocation failures.

Fixes: e37259b31c75 ("crypto: af_alg - remove locking in async callback")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/af_alg.c
crypto/algif_aead.c
crypto/algif_skcipher.c
include/crypto/if_alg.h