From: Steffen Klassert <steffen.klassert@secunet.com>
To: Zilin Guan <zilin@seu.edu.cn>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<horms@kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <jianhao.xu@seu.edu.cn>
Subject: Re: [PATCH v2] xfrm: use kfree_sensitive() for SA secret zeroization
Date: Wed, 21 May 2025 08:00:17 +0200 [thread overview]
Message-ID: <aC1r8VfDy2/mlpwf@gauss3.secunet.de> (raw)
In-Reply-To: <20250514084839.118825-1-zilin@seu.edu.cn>
On Wed, May 14, 2025 at 08:48:39AM +0000, Zilin Guan wrote:
> High-level copy_to_user_* APIs already redact SA secret fields when
> redaction is enabled, but the state teardown path still freed aead,
> aalg and ealg structs with plain kfree(), which does not clear memory
> before deallocation. This can leave SA keys and other confidential
> data in memory, risking exposure via post-free vulnerabilities.
>
> Since this path is outside the packet fast path, the cost of zeroization
> is acceptable and prevents any residual key material. This patch
> replaces those kfree() calls unconditionally with kfree_sensitive(),
> which zeroizes the entire buffer before freeing.
>
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Applied to ipsec-next, thanks!
prev parent reply other threads:[~2025-05-21 6:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 8:48 Zilin Guan
2025-05-21 6:00 ` Steffen Klassert [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=aC1r8VfDy2/mlpwf@gauss3.secunet.de \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=jianhao.xu@seu.edu.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=zilin@seu.edu.cn \
/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®