[PATCH 06/10] crypto: talitos - Remove duplicate IV unmap in AEAD encrypt path
From: Lee Jones
Date: Mon Nov 23 2026 - 10:12:08 EST
Commit 2e13ce0812c6 ("crypto: talitos - DMA map key in setkey()") moved
key DMA mapping into setkey(), but inadvertently added an extra
dma_unmap_single() call on edesc->iv_dma in ipsec_esp_encrypt_done().
Because ipsec_esp() populates civ_ptr with edesc->iv_dma and
ipsec_esp_unmap() already unmaps civ_ptr via
unmap_single_talitos_ptr(), calling dma_unmap_single() on edesc->iv_dma
after ipsec_esp_unmap() unmaps the same IV DMA address twice on every
completed AEAD encryption request.
Remove the duplicate dma_unmap_single() call and the now-unused local
variables from ipsec_esp_encrypt_done().
Fixes: 2e13ce0812c6 ("crypto: talitos - DMA map key in setkey()")
Closes: https://sashiko.dev/#/bug/linux-d3edc145-eaef-4da2-b463-3374b9a54d57
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/crypto/talitos.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 8a9f0d1e7df9..e9af242c7134 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1097,16 +1097,12 @@ static void ipsec_esp_encrypt_done(struct device *dev,
int err)
{
struct aead_request *areq = context;
- struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
- unsigned int ivsize = crypto_aead_ivsize(authenc);
struct talitos_edesc *edesc;
edesc = container_of(desc, struct talitos_edesc, desc);
ipsec_esp_unmap(dev, edesc, areq, true);
- dma_unmap_single(dev, edesc->iv_dma, ivsize, DMA_TO_DEVICE);
-
kfree(edesc);
aead_request_complete(areq, err);
--
2.56.1.750.gf70dc682cf-goog