]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tipc: use kfree_sensitive() for aead cleanup
authorZilin Guan <zilin@seu.edu.cn>
Fri, 23 May 2025 11:47:17 +0000 (11:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:31 +0000 (11:05 +0100)
commitd99e45521ebbfea60e2c2980946d47560213a389
treeeffba9d2f265ddba15bfee85ab1b4c7538c33a2f
parent722e716966c29a7b85c985a76e2be839ab77c9dd
tipc: use kfree_sensitive() for aead cleanup

[ Upstream commit c8ef20fe7274c5766a317f9193b70bed717b6b3d ]

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: Sasha Levin <sashal@kernel.org>
net/tipc/crypto.c