* [PATCH v2] net/tcp: use kfree_sensitive() instend of kfree() in two functions
@ 2023-11-16 2:22 Minjie Du
2023-11-16 8:44 ` Eric Dumazet
2023-11-16 16:46 ` Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: Minjie Du @ 2023-11-16 2:22 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 use kfree_sensitive to free it.
In tcp_time_wait_init() and tcp_md5_twsk_free_rcu() use kfree_sensitive().
Signed-off-by: Minjie Du <duminjie@vivo.com>
---
net/ipv4/tcp_minisocks.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index a9807eeb311c..83686c7e7ce9 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -281,7 +281,7 @@ static void tcp_time_wait_init(struct sock *sk, struct tcp_timewait_sock *tcptw)
return;
out_free:
WARN_ON_ONCE(1);
- kfree(tcptw->tw_md5_key);
+ kfree_sensitive(tcptw->tw_md5_key);
tcptw->tw_md5_key = NULL;
#endif
}
@@ -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 related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net/tcp: use kfree_sensitive() instend of kfree() in two functions
2023-11-16 2:22 [PATCH v2] net/tcp: use kfree_sensitive() instend of kfree() in two functions Minjie Du
@ 2023-11-16 8:44 ` Eric Dumazet
2023-11-16 16:46 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2023-11-16 8:44 UTC (permalink / raw)
To: Minjie Du
Cc: David S. Miller, David Ahern, Jakub Kicinski, Paolo Abeni,
open list:NETWORKING [TCP], open list, opensource.kernel
On Thu, Nov 16, 2023 at 3:22 AM Minjie Du <duminjie@vivo.com> wrote:
>
> key might contain private information, so use kfree_sensitive to free it.
> In tcp_time_wait_init() and tcp_md5_twsk_free_rcu() use kfree_sensitive().
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
>
You have not addressed my prior feedback.
3) You forgot tcp_time_wait_init(), tcp_md5_do_del(), tcp_md5_key_copy(),
tcp_md5_do_add(), tcp_clear_md5_list().
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net/tcp: use kfree_sensitive() instend of kfree() in two functions
2023-11-16 2:22 [PATCH v2] net/tcp: use kfree_sensitive() instend of kfree() in two functions Minjie Du
2023-11-16 8:44 ` Eric Dumazet
@ 2023-11-16 16:46 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2023-11-16 16:46 UTC (permalink / raw)
To: Minjie Du, opensource.kernel, netdev
Cc: David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, LKML
Please avoid a typo in the patch subject.
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-16 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-16 2:22 [PATCH v2] net/tcp: use kfree_sensitive() instend of kfree() in two functions Minjie Du
2023-11-16 8:44 ` Eric Dumazet
2023-11-16 16:46 ` Markus Elfring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.