linux/drivers/crypto/chelsio
Eric Biggers 9fa40efc49 crypto: chelsio - fix writing tfm flags to wrong place
commit bd56cea012 upstream.

The chelsio crypto driver is casting 'struct crypto_aead' directly to
'struct crypto_tfm', which is incorrect because the crypto_tfm isn't the
first field of 'struct crypto_aead'.  Consequently, the calls to
crypto_tfm_set_flags() are modifying some other field in the struct.

Also, the driver is setting CRYPTO_TFM_RES_BAD_KEY_LEN in
->setauthsize(), not just in ->setkey().  This is incorrect since this
flag is for bad key lengths, not for bad authentication tag lengths.

Fix these bugs by removing the broken crypto_tfm_set_flags() calls from
->setauthsize() and by fixing them in ->setkey().

Fixes: 324429d741 ("chcr: Support for Chelsio's Crypto Hardware")
Cc: <stable@vger.kernel.org> # v4.9+
Cc: Atul Gupta <atul.gupta@chelsio.com>
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>
History 2020-02-01 09:32:55 +00:00
..
chtls Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-11-25 20:02:57 -08:00
chcr_algo.c crypto: chelsio - fix writing tfm flags to wrong place 2020-02-01 09:32:55 +00:00
chcr_algo.h crypto: chelsio - switch to skcipher API 2019-11-17 09:02:47 +08:00
chcr_core.c crypto: chelsio - Fix softlockup with heavy I/O 2019-05-09 13:17:22 +08:00
chcr_core.h crypto: chelsio - avoid using sa_entry imm 2019-01-25 18:41:51 +08:00
chcr_crypto.h crypto: chelsio - switch to skcipher API 2019-11-17 09:02:47 +08:00
chcr_ipsec.c cxgb4/chcr: update SGL DMA unmap for USO 2019-11-22 16:44:39 -08:00
Kconfig net/tls: allow compiling TLS TOE out 2019-10-04 14:07:07 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00