]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:24:29 +0000 (10:24 +0100)
commit36d0a678fb25a7bce5bf9b2828c0d9395fa9a990
treeed500363a67889db4305e94fb294bc653cfe472b
parent99b329b4611a17df15e7122fdf4bbfb8a1245d67
crypto: af_alg - Fix race around ctx->rcvused by making it atomic_t

[ Upstream commit af955bf15d2c27496b0269b1f05c26f758c68314 ]

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: 7d2c3f54e6f6 ("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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/af_alg.c
crypto/algif_aead.c
crypto/algif_skcipher.c
include/crypto/if_alg.h