mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
crypto: ccree - dec auth tag size from cryptlen map
[ Upstream commit 8962c6d2c2 ]
Remove the auth tag size from cryptlen before mapping the destination
in out-of-place AEAD decryption thus resolving a crash with
extended testmgr tests.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org # v4.19+
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a44ed69822
commit
dd5f4a0407
@@ -1021,8 +1021,12 @@ static int cc_aead_chain_data(struct cc_drvdata *drvdata,
|
||||
|
||||
if (req->src != req->dst) {
|
||||
size_for_map = areq_ctx->assoclen + req->cryptlen;
|
||||
size_for_map += (direct == DRV_CRYPTO_DIRECTION_ENCRYPT) ?
|
||||
authsize : 0;
|
||||
|
||||
if (direct == DRV_CRYPTO_DIRECTION_ENCRYPT)
|
||||
size_for_map += authsize;
|
||||
else
|
||||
size_for_map -= authsize;
|
||||
|
||||
if (is_gcm4543)
|
||||
size_for_map += crypto_aead_ivsize(tfm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user