* [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv()
@ 2022-06-28 2:59 Hangyu Hua
[not found] ` <DB9PR05MB9078C87512422E22556EDA3888B89@DB9PR05MB9078.eurprd05.prod.outlook.com>
2022-07-04 14:03 ` Jon Maloy
0 siblings, 2 replies; 3+ messages in thread
From: Hangyu Hua @ 2022-06-28 2:59 UTC (permalink / raw)
To: jmaloy, ying.xue, davem, edumazet, kuba, pabeni
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>
---
net/tipc/monitor.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index 2f4d23238a7e..67084e5aa15c 100644
--- a/net/tipc/monitor.c
+++ b/net/tipc/monitor.c
@@ -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)
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <DB9PR05MB9078C87512422E22556EDA3888B89@DB9PR05MB9078.eurprd05.prod.outlook.com>]
* Re: [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv()
[not found] ` <DB9PR05MB9078C87512422E22556EDA3888B89@DB9PR05MB9078.eurprd05.prod.outlook.com>
@ 2022-06-28 8:21 ` Hangyu Hua
0 siblings, 0 replies; 3+ messages in thread
From: Hangyu Hua @ 2022-06-28 8:21 UTC (permalink / raw)
To: Tung Quang Nguyen
Cc: netdev, tipc-discussion, linux-kernel, jmaloy, ying.xue, davem,
edumazet, kuba, pabeni
On 2022/6/28 11:35, Tung Quang Nguyen wrote:
>> -----Original Message-----
>> From: Hangyu Hua <hbh25y@gmail.com>
>> Sent: Tuesday, June 28, 2022 9:59 AM
>> To: jmaloy@redhat.com; ying.xue@windriver.com; davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
>> pabeni@redhat.com
>> Cc: netdev@vger.kernel.org; tipc-discussion@lists.sourceforge.net; linux-kernel@vger.kernel.org; Hangyu Hua <hbh25y@gmail.com>
>> 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 <hbh25y@gmail.com <mailto:hbh25y@gmail.com>>
>> ---
>> net/tipc/monitor.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
>> index 2f4d23238a7e..67084e5aa15c 100644
>> --- a/net/tipc/monitor.c
>> +++ b/net/tipc/monitor.c
>> @@ -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;
> Please remove /dom_bef.member_cnt = 0;/ if memset() is used instead.
I get it. I will send a v2.
Thanks,
Hangyu
>> dom = peer->domain;
>> if (dom)
>> --
>> 2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv()
2022-06-28 2:59 [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv() Hangyu Hua
[not found] ` <DB9PR05MB9078C87512422E22556EDA3888B89@DB9PR05MB9078.eurprd05.prod.outlook.com>
@ 2022-07-04 14:03 ` Jon Maloy
1 sibling, 0 replies; 3+ messages in thread
From: Jon Maloy @ 2022-07-04 14:03 UTC (permalink / raw)
To: Hangyu Hua, ying.xue, davem, edumazet, kuba, pabeni
Cc: netdev, tipc-discussion, linux-kernel
On 6/27/22 22:59, Hangyu Hua wrote:
> 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>
> ---
> net/tipc/monitor.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
> index 2f4d23238a7e..67084e5aa15c 100644
> --- a/net/tipc/monitor.c
> +++ b/net/tipc/monitor.c
> @@ -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)
Acked-by: Jon Maloy <jmaloy@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-04 14:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 2:59 [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv() Hangyu Hua
[not found] ` <DB9PR05MB9078C87512422E22556EDA3888B89@DB9PR05MB9078.eurprd05.prod.outlook.com>
2022-06-28 8:21 ` Hangyu Hua
2022-07-04 14:03 ` Jon Maloy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®