mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] net/tcp: use kfree_sensitive() instend of kfree() in tcp_md5_twsk_free_rcu()
@ 2023-11-07  2:34 Minjie Du
  2023-11-07  3:40 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: Minjie Du @ 2023-11-07  2:34 UTC (permalink / raw)
  To: Eric Dumazet, David S. Miller, David Ahern, Jakub Kicinski,
	Paolo Abeni, open list:NETWORKING [TCP],
	open list
  Cc: opensource.kernel, Minjie Du

key might contain private information, so better use
kfree_sensitive to free it.
In tcp_md5_twsk_free_rcu() use kfree_sensitive().

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 net/ipv4/tcp_minisocks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index a9807eeb311c..a7be78096783 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -368,7 +368,7 @@ static void tcp_md5_twsk_free_rcu(struct rcu_head *head)
 	struct tcp_md5sig_key *key;
 
 	key = container_of(head, struct tcp_md5sig_key, rcu);
-	kfree(key);
+	kfree_sensitive(key);
 	static_branch_slow_dec_deferred(&tcp_md5_needed);
 	tcp_md5_release_sigpool();
 }
-- 
2.39.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-07  3:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07  2:34 [PATCH v1] net/tcp: use kfree_sensitive() instend of kfree() in tcp_md5_twsk_free_rcu() Minjie Du
2023-11-07  3:40 ` Eric Dumazet

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®