From: Thomas Huth <thuth@redhat.com>
To: Antoine Tenart <atenart@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Pascal van Leeuwen <pascalvanl@gmail.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data
Date: Wed, 19 Aug 2026 17:16:16 +0200 [thread overview]
Message-ID: <0ab5030d-7740-4c3c-af7d-e488d124bf16@redhat.com> (raw)
In-Reply-To: <aoWWgixBpVypLoWx@kwain>
On 19/08/2026 13.43, Antoine Tenart wrote:
> On Wed, Aug 19, 2026 at 12:58:36PM +0200, Thomas Huth wrote:
>> key_tmp[] in safexcel_xcbcmac_setkey() and consts[] / _const[] in
>> safexcel_cmac_setkey() contain crypto key material that should not
>> get exposed to the outside once the function is done. Scrub the
>> arrays with memzero_explicit() to avoid that the data could leak
>> via the stack.
>>
>> Reported-by: Sashiko <sashiko-bot@kernel.org>
>> Link: https://sashiko.dev/#/patchset/20260813134953.979481-1-thuth%40redhat.com
>> Fixes: 38f21b4bab11f ("crypto: inside-secure - Added support for the AES XCBC ahash")
>> Fixes: 7a627db9cafdb ("crypto: inside-secure - Added support for the AES-CMAC ahash")
>> Acked-by: Antoine Tenart <atenart@kernel.org>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> v2: Added "Fixes:" and "Reported-by:" tags
>>
>> drivers/crypto/inside-secure/safexcel_hash.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
>> index 3402e570d045c..1ae6fbec31298 100644
>> --- a/drivers/crypto/inside-secure/safexcel_hash.c
>> +++ b/drivers/crypto/inside-secure/safexcel_hash.c
>> @@ -1993,6 +1993,7 @@ static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key,
>> ret = aes_prepareenckey(ctx->aes,
>> (u8 *)key_tmp + 2 * AES_BLOCK_SIZE,
>> AES_MIN_KEY_SIZE);
>> + memzero_explicit(key_tmp, sizeof(key_tmp));
>> if (ret)
>> return ret;
>>
>> @@ -2104,6 +2105,9 @@ static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key,
>> }
>> ctx->cbcmac = false;
>>
>> +
>
> Sorry, I just noticed there's an extra empty line here.
Oops, that's embarrassing, not sure how I missed that looking at the patch
multiple times already... Thanks for spotting it, I'll send a v3.
Thomas
prev parent reply other threads:[~2026-08-19 15:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 10:58 [PATCH v2] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Thomas Huth
2026-08-19 11:43 ` Antoine Tenart
2026-08-19 15:16 ` Thomas Huth [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=0ab5030d-7740-4c3c-af7d-e488d124bf16@redhat.com \
--to=thuth@redhat.com \
--cc=atenart@kernel.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pascalvanl@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.