The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Paul Louvel <paul.louvel@bootlin.com>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	Kim Phillips <kim.phillips@freescale.com>,
	Christophe Leroy <chleroy@kernel.org>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 06/10] crypto: talitos - Remove duplicate IV unmap in AEAD encrypt path
Date: Mon, 23 Nov 2026 15:09:57 +0000	[thread overview]
Message-ID: <20261123151055.2533735-7-lee@kernel.org> (raw)
In-Reply-To: <20261123151055.2533735-1-lee@kernel.org>

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@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 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


  parent reply	other threads:[~2026-11-23 15:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 15:09 [PATCH 00/10] crypto: Assorted bug fixes across crypto drivers Lee Jones
2026-11-23 15:09 ` [PATCH 01/10] crypto: caam - Fix descriptor buffer overflow in caam_process_blob() Lee Jones
2026-11-23 15:09 ` [PATCH 02/10] crypto: marvell - Fix AEAD key buffer overflow for SHA-384/512 HMAC Lee Jones
2026-11-23 15:09 ` [PATCH 03/10] crypto: nx - Fix bounce buffer copy overflow in decompress() Lee Jones
2026-11-23 15:09 ` [PATCH 04/10] crypto: sun8i-ss - Fix scatterlist array overflow for HMAC requests Lee Jones
2026-11-23 15:09 ` [PATCH 05/10] crypto: hisilicon/hpre - Fix buffer overflow on odd ECDH input size Lee Jones
2026-11-23 15:09 ` Lee Jones [this message]
2026-11-23 15:09 ` [PATCH 07/10] crypto: safexcel - Check scatterlist errors before max() for in-place Lee Jones
2026-11-23 15:09 ` [PATCH 08/10] crypto: qce - Pass mapped scatterlist count to qce_dma_prep_sgs() Lee Jones
2026-11-23 15:10 ` [PATCH 09/10] crypto: qce - Terminate RX DMA channel if TX preparation fails Lee Jones
2026-11-23 15:10 ` [PATCH 10/10] crypto: atmel-tdes - Update output IV before clearing busy flag Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123151055.2533735-7-lee@kernel.org \
    --to=lee@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=johnpol@2ka.mipt.ru \
    --cc=kim.phillips@freescale.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.louvel@bootlin.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox