netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: tipc: fix possible infoleak in tipc_mon_rcv()
@ 2022-06-28  8:31 Hangyu Hua
  2022-06-28 10:28 ` Tung Quang Nguyen
  2022-06-30  3:31 ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Hangyu Hua @ 2022-06-28  8:31 UTC (permalink / raw)
  To: jmaloy, ying.xue, davem, edumazet, kuba, pabeni, tung.q.nguyen
  Cc: netdev, tipc-discussion, linux-kernel, Hangyu Hua

dom_bef is use to cache current domain record only if current domain
exists. But when current domain does not exist, dom_bef will still be used
in mon_identify_lost_members. This may lead to an information leak.

Fix this by adding a memset before using dom_bef.

Fixes: 35c55c9877f8 ("tipc: add neighbor monitoring framework")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---

v2: remove redundant 'dom_bef.member_cnt = 0;'

 net/tipc/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index 2f4d23238a7e..03b5d0b65169 100644
--- a/net/tipc/monitor.c
+++ b/net/tipc/monitor.c
@@ -534,7 +534,7 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
 	state->peer_gen = new_gen;
 
 	/* Cache current domain record for later use */
-	dom_bef.member_cnt = 0;
+	memset(&dom_bef, 0, sizeof(dom_bef));
 	dom = peer->domain;
 	if (dom)
 		memcpy(&dom_bef, dom, dom->len);
-- 
2.25.1


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

end of thread, other threads:[~2022-06-30 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-28  8:31 [PATCH v2] net: tipc: fix possible infoleak in tipc_mon_rcv() Hangyu Hua
2022-06-28 10:28 ` Tung Quang Nguyen
2022-06-30  3:31 ` Jakub Kicinski
2022-06-30  9:19   ` Hangyu Hua
2022-06-30 15:27     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).