From: Thomas Huth <thuth@redhat.com>
To: "Thorsten Blum" <blum@kernel.org>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
"Michal Simek" <michal.simek@amd.com>,
"Harsh Jain" <h.jain@amd.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Takashi Sakamoto" <o-takashi@sakamocchi.jp>,
"Uwe Kleine-König (The Capable Hub)"
<u.kleine-koenig@baylibre.com>
Cc: Danilo Krummrich <dakr@kernel.org>,
linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: xilinx - clear AES key buffer before freeing it
Date: Wed, 9 Sep 2026 10:53:36 +0200 [thread overview]
Message-ID: <5a1c75b6-8d68-4bfe-bda8-b2ca25cdffab@redhat.com> (raw)
In-Reply-To: <20260908191607.405177-2-blum@kernel.org>
On 08/09/2026 21.16, Thorsten Blum wrote:
> In xilinx_aes_aead_exit(), the AES key buffer is freed without being
> cleared, which allows key material to remain in memory. Use
> kfree_sensitive() to clear the buffer before freeing it.
>
> Fixes: c315cb0005be ("crypto: xilinx - Change coherent DMA to streaming DMA API")
> Cc: stable@vger.kernel.org
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> ---
> drivers/crypto/xilinx/zynqmp-aes-gcm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/xilinx/zynqmp-aes-gcm.c b/drivers/crypto/xilinx/zynqmp-aes-gcm.c
> index d54c268dfe34..ebee37dddb1f 100644
> --- a/drivers/crypto/xilinx/zynqmp-aes-gcm.c
> +++ b/drivers/crypto/xilinx/zynqmp-aes-gcm.c
> @@ -766,7 +766,7 @@ static void xilinx_aes_aead_exit(struct crypto_aead *aead)
> struct xilinx_aead_tfm_ctx *tfm_ctx = crypto_tfm_ctx(tfm);
>
> dma_unmap_single(tfm_ctx->dev, tfm_ctx->key_dma_addr, AES_KEYSIZE_256, DMA_TO_DEVICE);
> - kfree(tfm_ctx->key);
> + kfree_sensitive(tfm_ctx->key);
> if (tfm_ctx->fbk_cipher) {
> crypto_free_aead(tfm_ctx->fbk_cipher);
> tfm_ctx->fbk_cipher = NULL;
Reviewed-by: Thomas Huth <thuth@redhat.com>
prev parent reply other threads:[~2026-09-09 8:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 19:16 [PATCH] crypto: xilinx - clear AES key buffer before freeing it Thorsten Blum
2026-09-09 8:53 ` 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=5a1c75b6-8d68-4bfe-bda8-b2ca25cdffab@redhat.com \
--to=thuth@redhat.com \
--cc=bhelgaas@google.com \
--cc=blum@kernel.org \
--cc=dakr@kernel.org \
--cc=davem@davemloft.net \
--cc=h.jain@amd.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=o-takashi@sakamocchi.jp \
--cc=u.kleine-koenig@baylibre.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.