From: Lee Jones <lee@kernel.org>
To: Sahil Malhotra <sahil.malhotra@oss.nxp.com>
Cc: herbert@gondor.apana.org.au, horia.geanta@nxp.com,
pankaj.gupta@nxp.com, davem@davemloft.net, kernel@pengutronix.de,
meenakshi.aggarwal@nxp.com, Keisuke Tsukuda <tkdkei@outlook.jp>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 01/10] crypto: caam - Fix descriptor buffer overflow in caam_process_blob()
Date: Mon, 30 Nov 2026 14:38:36 +0000 [thread overview]
Message-ID: <20261130143836.GA90630@joneslee-mac.roam.internal> (raw)
In-Reply-To: <20261130102632.4032882-1-sahil.malhotra@oss.nxp.com>
On Mon, 30 Nov 2026, Sahil Malhotra wrote:
> On Mon, Nov 23, 2026 at 03:09:52PM +0000, Lee Jones wrote:
> > However, CAAM_BLOB_DESC_BYTES_MAX was not updated and still reserves
> > only 44 or 52 bytes (for 32-bit or 64-bit DMA addresses), whereas
> > caam_process_blob() now writes up to 60 bytes for standard blobs on
> > 64-bit DMA platforms and up to 72 or 88 bytes when encapsulating a
> > protected key, overflowing the kzalloc()-allocated job descriptor
> > buffer into adjacent slab memory.
>
> [...]
>
> > Update CAAM_BLOB_DESC_BYTES_MAX to account for the protected-key
> > commands and the extended sequence pointer length words.
>
> Hi Lee,
>
> Thanks for the patch.
>
> The analysis is correct, and the new macro covers the worst case of the
> current code.
>
> Keisuke Tsukuda has posted a fix for the same overflow:
>
> https://lore.kernel.org/linux-crypto/20261124002830.35444-1-tkdkei@outlook.jp/
>
> It drops CAAM_BLOB_DESC_BYTES_MAX and allocates CAAM_DESC_BYTES_MAX,
> the hardware limit for a job descriptor. I would prefer that approach.
> The overflow came from the hand-written size falling out of sync with
> the descriptor code, and a fixed maximum avoids the same problem the
> next time a command is added.
>
> Only one of the two should go in. Unless Herbert prefers this version,
> please drop this patch from the series and let Keisuke's go in.
No problem.
--
Lee Jones
next prev parent reply other threads:[~2026-11-30 14:38 UTC|newest]
Thread overview: 17+ 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-30 10:26 ` Sahil Malhotra
2026-11-30 14:38 ` Lee Jones [this message]
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-24 7:39 ` liulongfang
2026-11-23 15:09 ` [PATCH 06/10] crypto: talitos - Remove duplicate IV unmap in AEAD encrypt path Lee Jones
2026-11-23 15:09 ` [PATCH 07/10] crypto: safexcel - Check scatterlist errors before max() for in-place Lee Jones
2026-11-26 16:47 ` Antoine Tenart
2026-11-23 15:09 ` [PATCH 08/10] crypto: qce - Pass mapped scatterlist count to qce_dma_prep_sgs() Lee Jones
2026-11-24 12:49 ` Bartosz Golaszewski
2026-11-23 15:10 ` [PATCH 09/10] crypto: qce - Terminate RX DMA channel if TX preparation fails Lee Jones
2026-11-24 12:49 ` Bartosz Golaszewski
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=20261130143836.GA90630@joneslee-mac.roam.internal \
--to=lee@kernel.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=horia.geanta@nxp.com \
--cc=kernel@pengutronix.de \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=meenakshi.aggarwal@nxp.com \
--cc=pankaj.gupta@nxp.com \
--cc=sahil.malhotra@oss.nxp.com \
--cc=stable@vger.kernel.org \
--cc=tkdkei@outlook.jp \
/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
all inboxes | Powered by JetHome®