diff options
author | Wang Ming <machel@vivo.com> | 2023-07-17 11:59:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-19 12:03:03 +0200 |
commit | daa751444fd9d4184270b1479d8af49aaf1a1ee6 (patch) | |
tree | b35c23792339e7a0115708a1d97e840ee128fba3 /net/ipv4 | |
parent | Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/n... (diff) | |
download | linux-daa751444fd9d4184270b1479d8af49aaf1a1ee6.tar.xz linux-daa751444fd9d4184270b1479d8af49aaf1a1ee6.zip |
net: ipv4: Use kfree_sensitive instead of kfree
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>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/esp4.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |