From: Herbert Xu <herbert@gondor.apana.org.au>
To: Richard Weinberger <richard@nod.at>
Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
davem@davemloft.net, gaurav.jain@nxp.com, pankaj.gupta@nxp.com,
horia.geanta@nxp.com, ebiggers@kernel.org,
upstream+linux@sigma-star.at
Subject: Re: [PATCH 1/3] crypto: caam: Fix DMA mapping leak in the cbc(paes) job path
Date: Thu, 30 Jul 2026 17:25:50 +1000 [thread overview]
Message-ID: <amr8fnn5tkynYpxa@gondor.apana.org.au> (raw)
In-Reply-To: <20260726081504.2182951-1-richard@nod.at>
On Sun, Jul 26, 2026 at 10:15:02AM +0200, Richard Weinberger wrote:
> For a protected key, init_skcipher_job() maps the second job descriptor
> so that the blob decapsulation descriptor can jump to it, but keeps the
> address in a local variable. Nothing can ever unmap it, and the buffer
> it covers lives in edesc, which skcipher_crypt_done() frees while the
> mapping is still live. The mapping error is not checked either.
>
> cbc(paes) is reachable through AF_ALG, so an unprivileged process leaks
> one mapping per request, exhausting IOVA space or swiotlb buffers.
>
> Store the mapping in the extended descriptor, release it in
> skcipher_unmap() and propagate mapping failures to the caller.
>
> Assisted-by: Claude-Code:claude-fable-5
> Reported-by: Eric Biggers <ebiggers@kernel.org>
> Signed-off-by: Richard Weinberger <richard@nod.at>
> ---
> drivers/crypto/caam/caamalg.c | 31 +++++++++++++++++++++++++++----
> 1 file changed, 27 insertions(+), 4 deletions(-)
Please check the Sashiko comments:
https://sashiko.dev/#/patchset/20260726081504.2182951-1-richard%40nod.at
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2026-07-30 7:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 8:15 [PATCH 1/3] crypto: caam: Fix DMA mapping leak in the cbc(paes) job path Richard Weinberger
2026-07-26 8:15 ` [PATCH 2/3] crypto: caam: Map the paes protected key once per tfm Richard Weinberger
2026-07-26 8:15 ` [PATCH 3/3] crypto: caam: Validate the protected key header in setkey Richard Weinberger
2026-07-30 7:25 ` Herbert Xu [this message]
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=amr8fnn5tkynYpxa@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=ebiggers@kernel.org \
--cc=gaurav.jain@nxp.com \
--cc=horia.geanta@nxp.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pankaj.gupta@nxp.com \
--cc=richard@nod.at \
--cc=upstream+linux@sigma-star.at \
/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