From: 赵金明 <zhaojinming@uniontech.com>
To: "Eric Biggers" <ebiggers@kernel.org>
Cc: brgl <brgl@kernel.org>, herbert <herbert@gondor.apana.org.au>,
davem <davem@davemloft.net>,
thara.gopinath <thara.gopinath@linaro.org>,
linux-crypto <linux-crypto@vger.kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH 0/3] crypto: qce - fix CCM AAD buffer leak and the AEAD error paths
Date: Mon, 19 Oct 2026 14:41:41 +0800 [thread overview]
Message-ID: <CA7A5103C91FA945+2026101914414023542111@uniontech.com> (raw)
In-Reply-To: <20261016155628.GA3947801@google.com>
Hi Eric,
Thanks - you're right, and I should have dug up the original thread
first. The Sashiko review only flagged these as pre-existing; you
reported them first. I'll credit that properly and resend:
Reported-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/linux-crypto/20260723183438.GB93534@quark/
I'll fold those trailers in and send a v2 shortly.
The remaining bugs you listed are on my radar; I can take them as
separate follow-ups unless you'd prefer otherwise.
Thanks,
ZhaoJinming
>On Fri, Oct 16, 2026 at 10:09:42AM +0800, ZhaoJinming wrote:
>> This series fixes a memory leak in the QCE AEAD driver together with two
>> bugs in the error handling around it.
>>
>> qce_aead_ccm_prepare_buf_assoclen() allocates rctx->adata for every CCM
>> request that carries associated data, but the buffer is never freed.
>>
>> While preparing that fix, two problems in the error path of
>> qce_aead_async_req_handle() turned out to matter:
>>
>>?? - It unmaps req->src although rctx->src_sg is the scatterlist that was
>>???? passed to dma_map_sg().? For CCM requests with associated data,
>>???? rctx->src_sg carries the AAD buffer, so its mapping is leaked, and
>>???? freeing rctx->adata there would free memory that is still DMA-mapped.
>>
>>?? - A dma_map_sg() failure for the source scatterlist is not detected,
>>???? because the result is checked for a negative value while
>>???? dma_map_sg() returns 0 on failure.? The error path then unmaps a
>>???? scatterlist that was never mapped.
>>
>> Patch 1 unmaps the correct scatterlist, patch 2 adds the missing frees
>> and patch 3 fixes the dma_map_sg() check.
>>
>> All three were reported as pre-existing in the Sashiko review of the QCE
>> BAM locking series.? They touch the same function that was recently fixed
>> by commit 7f2345f47dd1 ("crypto: qce - fix CCM AAD buffer
>> underallocation").
>
>Note that I reported these bugs (and others still unfixed) 3 months ago:
>https://lore.kernel.org/linux-crypto/20260723183438.GB93534@quark/
>
>- Eric
>
prev parent reply other threads:[~2026-10-19 6:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 2:09 ZhaoJinming
2026-10-16 2:09 ` [PATCH 1/3] crypto: qce - unmap the correct scatterlist in the CCM error path ZhaoJinming
2026-10-16 2:09 ` [PATCH 2/3] crypto: qce - fix memory leak of the CCM AAD buffer ZhaoJinming
2026-10-16 2:09 ` [PATCH 3/3] crypto: qce - check dma_map_sg() result for the source scatterlist ZhaoJinming
2026-10-16 13:40 ` [PATCH 0/3] crypto: qce - fix CCM AAD buffer leak and the AEAD error paths Bartosz Golaszewski
2026-10-16 15:56 ` Eric Biggers
2026-10-19 6:41 ` 赵金明 [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=CA7A5103C91FA945+2026101914414023542111@uniontech.com \
--to=zhaojinming@uniontech.com \
--cc=brgl@kernel.org \
--cc=davem@davemloft.net \
--cc=ebiggers@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=thara.gopinath@linaro.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
all inboxes | Powered by JetHome®