[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231107023444.3141-1-duminjie@vivo.com>
Date: Tue, 7 Nov 2023 10:34:43 +0800
From: Minjie Du <duminjie@...o.com>
To: Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org (open list:NETWORKING [TCP]),
linux-kernel@...r.kernel.org (open list)
Cc: opensource.kernel@...o.com, Minjie Du <duminjie@...o.com>
Subject: [PATCH v1] net/tcp: use kfree_sensitive() instend of kfree() in tcp_md5_twsk_free_rcu()
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@...o.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
Powered by blists - more mailing lists