Skip to content

Commit c8ef20f

Browse files
GoodLuck612kuba-moo
authored andcommitted
tipc: use kfree_sensitive() for aead cleanup
The tipc_aead_free() function currently uses kfree() to release the aead structure. However, this structure contains sensitive information, such as key's SALT value, which should be securely erased from memory to prevent potential leakage. To enhance security, replace kfree() with kfree_sensitive() when freeing the aead structure. This change ensures that sensitive data is explicitly cleared before memory deallocation, aligning with the approach used in tipc_aead_init() and adhering to best practices for handling confidential information. Signed-off-by: Zilin Guan <zilin@seu.edu.cn> Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech> Link: https://patch.msgid.link/20250523114717.4021518-1-zilin@seu.edu.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 09d7ff0 commit c8ef20f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static void tipc_aead_free(struct rcu_head *rp)
425425
}
426426
free_percpu(aead->tfm_entry);
427427
kfree_sensitive(aead->key);
428-
kfree(aead);
428+
kfree_sensitive(aead);
429429
}
430430

431431
static int tipc_aead_users(struct tipc_aead __rcu *aead)

0 commit comments

Comments
 (0)