aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorZilin Guan <[email protected]>2025-05-23 11:47:17 +0000
committerJakub Kicinski <[email protected]>2025-05-28 00:31:42 +0000
commitc8ef20fe7274c5766a317f9193b70bed717b6b3d (patch)
treeb2fc7802321362651d7ce3f06b7f74f4c354886b /net/tipc
parenttools: ynl: parse extack for sub-messages (diff)
downloadkernel-c8ef20fe7274c5766a317f9193b70bed717b6b3d.tar.gz
kernel-c8ef20fe7274c5766a317f9193b70bed717b6b3d.zip
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 <[email protected]> Reviewed-by: Tung Nguyen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
index 8584893b4785..f4cfe88670f5 100644
--- a/net/tipc/crypto.c
+++ b/net/tipc/crypto.c
@@ -425,7 +425,7 @@ static void tipc_aead_free(struct rcu_head *rp)
}
free_percpu(aead->tfm_entry);
kfree_sensitive(aead->key);
- kfree(aead);
+ kfree_sensitive(aead);
}
static int tipc_aead_users(struct tipc_aead __rcu *aead)