mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
net: ipv4: Use kfree_sensitive instead of kfree
[ Upstream commitdaa751444f] key might contain private part of the key, so better use kfree_sensitive to free it. Fixes:38320c70d2("[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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fac47182d3
commit
205bad1b30
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user