* [PATCH] tipc: use kfree_sensitive() for aead cleanup
@ 2025-05-23 11:47 Zilin Guan
2025-05-26 1:02 ` Tung Quang Nguyen
2025-05-28 1:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Zilin Guan @ 2025-05-23 11:47 UTC (permalink / raw)
To: jmaloy
Cc: davem, edumazet, kuba, pabeni, horms, netdev, tipc-discussion,
linux-kernel, jianhao.xu, Zilin Guan
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>
---
net/tipc/crypto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] tipc: use kfree_sensitive() for aead cleanup
2025-05-23 11:47 [PATCH] tipc: use kfree_sensitive() for aead cleanup Zilin Guan
@ 2025-05-26 1:02 ` Tung Quang Nguyen
2025-05-28 1:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Tung Quang Nguyen @ 2025-05-26 1:02 UTC (permalink / raw)
To: Zilin Guan
Cc: davem, edumazet, kuba, pabeni, horms, netdev, tipc-discussion,
linux-kernel, jianhao.xu, jmaloy
>Subject: [PATCH] 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>
>---
> net/tipc/crypto.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>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)
>--
>2.34.1
>
Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tipc: use kfree_sensitive() for aead cleanup
2025-05-23 11:47 [PATCH] tipc: use kfree_sensitive() for aead cleanup Zilin Guan
2025-05-26 1:02 ` Tung Quang Nguyen
@ 2025-05-28 1:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-28 1:20 UTC (permalink / raw)
To: Zilin Guan
Cc: jmaloy, davem, edumazet, kuba, pabeni, horms, netdev,
tipc-discussion, linux-kernel, jianhao.xu
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 23 May 2025 11:47:17 +0000 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- tipc: use kfree_sensitive() for aead cleanup
https://git.kernel.org/netdev/net-next/c/c8ef20fe7274
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-28 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-23 11:47 [PATCH] tipc: use kfree_sensitive() for aead cleanup Zilin Guan
2025-05-26 1:02 ` Tung Quang Nguyen
2025-05-28 1:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®