net: tipc: fix possible infoleak in tipc_mon_rcv()
Subsystems (3)
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.
--- net/tipc/monitor.c | 1 + 1 file changed, 1 insertion(+)
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)
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
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 intipc_mon_rcv()
dom_befis use to cache current domain record only if current domain exists. But when current domain does not exist,dom_befwill still be used inmon_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@@ -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
-1dom = peer->domain; if (dom) --2.25.1
Quoted 17 lines · Hangyu Hua
dom_befis use to cache current domain record only if current domain exists. But when current domain does not exist,dom_befwill still be used inmon_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]>--- net/tipc/monitor.c | 1 + 1 file changed, 1 insertion(+)net/tipc/monitor.c +0
-0
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)