Skip to content

Commit 197bb04

Browse files
author
Xin Long
committed
tipc: use kfree_sensitive() for aead cleanup
JIRA: https://issues.redhat.com/browse/RHEL-115652 Tested: compile only commit c8ef20f Author: Zilin Guan <zilin@seu.edu.cn> Date: Fri May 23 11:47:17 2025 +0000 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> Signed-off-by: Xin Long <lxin@redhat.com>
1 parent fa7a378 commit 197bb04

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)