From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Wang Ming <machel@vivo.com>,
Steffen Klassert <steffen.klassert@secunet.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Tariq Toukan <tariqt@nvidia.com>
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH net v1] net: ipv4: Use kfree_sensitive instead of kfree
Date: Mon, 17 Jul 2023 21:29:52 +0300 [thread overview]
Message-ID: <20db661e-9006-afc8-fcba-ec9825ca8092@gmail.com> (raw)
In-Reply-To: <20230717095932.18677-1-machel@vivo.com>
On 17/07/2023 12:59, Wang Ming wrote:
> key might contain private part of the key, so better use
> kfree_sensitive to free it.
>
> Fixes: 38320c70d282 ("[IPSEC]: Use crypto_aead and authenc in ESP")
> Signed-off-by: Wang Ming <machel@vivo.com>
> ---
> net/ipv4/esp4.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
> index ba06ed42e428..2be2d4922557 100644
> --- a/net/ipv4/esp4.c
> +++ b/net/ipv4/esp4.c
> @@ -1132,7 +1132,7 @@ static int esp_init_authenc(struct xfrm_state *x,
> err = crypto_aead_setkey(aead, key, keylen);
>
> free_key:
> - kfree(key);
> + kfree_sensitive(key);
>
> error:
> return err;
LGTM.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
next prev parent reply other threads:[~2023-07-17 18:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 9:59 [PATCH net v1] net: ipv4: Use kfree_sensitive instead of kfree Wang Ming
2023-07-17 18:29 ` Tariq Toukan [this message]
2023-07-17 18:48 ` Kuniyuki Iwashima
2023-07-19 10:10 ` patchwork-bot+netdevbpf
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=20db661e-9006-afc8-fcba-ec9825ca8092@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=machel@vivo.com \
--cc=netdev@vger.kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.com \
--cc=tariqt@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).