[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20db661e-9006-afc8-fcba-ec9825ca8092@gmail.com>
Date: Mon, 17 Jul 2023 21:29:52 +0300
From: Tariq Toukan <ttoukan.linux@...il.com>
To: Wang Ming <machel@...o.com>,
Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Tariq Toukan <tariqt@...dia.com>
Cc: opensource.kernel@...o.com
Subject: Re: [PATCH net v1] net: ipv4: Use kfree_sensitive instead of kfree
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@...o.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@...dia.com>
Powered by blists - more mailing lists