linux/drivers/crypto/chelsio
Eric Biggers bd56cea012 crypto: chelsio - fix writing tfm flags to wrong place
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>
2020-01-09 11:30:51 +08:00
..
chtls crypto: chtls - Fixed memory leak 2019-12-27 18:18:04 +08:00
chcr_algo.c crypto: chelsio - fix writing tfm flags to wrong place 2020-01-09 11:30:51 +08: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 crypto: Kconfig - Fix indentation 2019-12-11 16:36:05 +08:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00