Skip to contentSkip to conversation

net: tipc: fix possible infoleak in tipc_mon_rcv()

PATCH Superseded Hangyu Hua 2 participants 3 messages Jun 28, 2022 – Jul 4, 2022 1 message not in the archive

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Hangyu Hua

author
#0 lore raw

PATCH 1/1 net: tipc: fix possible infoleak in tipc_mon_rcv()

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")
---
 net/tipc/monitor.c | 1 +
 1 file changed, 1 insertion(+)
net/tipc/monitor.c +1 -0
index 2f4d23238a7e..67084e5aa15c 100644
@@ -534,6 +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 */
+	memset(&dom_bef, 0, sizeof(dom_bef));
 	dom_bef.member_cnt = 0;
 	dom = peer->domain;
 	if (dom)
Signature · 1 line
2.25.1

A message that is not in the archive (sent off-list or not yet received): DB9PR05MB9078C87512422E22556EDA3888B89@DB9PR05MB9078.eurprd05.prod.outlook.com

author
#2 lore raw
Quoted 27 lines · Tung Quang Nguyen
Quoted 27 lines

-----Original Message-----
From: Hangyu Hua <[email protected]>
Sent: Tuesday, June 28, 2022 9:59 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Hangyu Hua <[email protected]>
Subject: [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv()

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 <[email protected] <mailto:[email protected]>>

---
  net/tipc/monitor.c | 1 +

  1 file changed, 1 insertion(+)
net/tipc/monitor.c +0 -0
index 2f4d23238a7e..67084e5aa15c 100644
@@ -534,6 +534,7 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
         state->peer_gen = new_gen;
 
Quoted 4 lines

net/tipc/monitor.c void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr, · line 538

Quoted 3 lines
net/tipc/monitor.c +1 -0
         /* Cache current domain record for later use */
+     memset(&dom_bef, 0, sizeof(dom_bef));
         dom_bef.member_cnt = 0;

Please remove /dom_bef.member_cnt = 0;/ if memset() is used instead.

I get it. I will send a v2.

Thanks,
Hangyu

Quoted 4 lines
Quoted 4 lines
net/tipc/monitor.c +0 -1
         dom = peer->domain;
         if (dom)
--

2.25.1

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Hangyu Hua
Quoted 17 lines · 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")
---
  net/tipc/monitor.c | 1 +
  1 file changed, 1 insertion(+)
net/tipc/monitor.c +0 -0
index 2f4d23238a7e..67084e5aa15c 100644

net/tipc/monitor.c void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr, · line 540

Quoted 7 lines
net/tipc/monitor.c +1 -0
@@ -534,6 +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 */
+	memset(&dom_bef, 0, sizeof(dom_bef));
  	dom_bef.member_cnt = 0;
  	dom = peer->domain;
  	if (dom)