Skip to content

Commit daa7514

Browse files
Wang Mingdavem330
authored andcommitted
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: 38320c7 ("[IPSEC]: Use crypto_aead and authenc in ESP") Signed-off-by: Wang Ming <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7f5acea commit daa7514

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/esp4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ static int esp_init_authenc(struct xfrm_state *x,
11321132
err = crypto_aead_setkey(aead, key, keylen);
11331133

11341134
free_key:
1135-
kfree(key);
1135+
kfree_sensitive(key);
11361136

11371137
error:
11381138
return err;

0 commit comments

Comments
 (0)