Re: [PATCH 1/3] crypto: caam: Fix DMA mapping leak in the cbc(paes) job path
Herbert Xu <[email protected]> Thu, 30 Jul 2026 17:25:50 +1000
| Newsgroups | org.kernel.vger.linux-crypto,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> > Signed-off-by: Richard Weinberger <[email protected]> > --- > 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 <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt