[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <665de056-6ec1-e4e1-adf9-4df3e35628b7@gmail.com>
Date: Thu, 30 Jun 2022 17:19:21 +0800
From: Hangyu Hua <hbh25y@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: jmaloy@...hat.com, ying.xue@...driver.com, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com,
tung.q.nguyen@...tech.com.au, netdev@...r.kernel.org,
tipc-discussion@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: tipc: fix possible infoleak in tipc_mon_rcv()
On 2022/6/30 11:31, Jakub Kicinski wrote:
> On Tue, 28 Jun 2022 16:31:22 +0800 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.
>
> AFAICT applied_bef must be zero if peer->domain was 0, so I don't think
> mon_identify_lost_members() will do anything.
>
void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
struct tipc_mon_state *state, int bearer_id)
{
...
if (!dom || (dom->len < new_dlen)) {
kfree(dom);
dom = kmalloc(new_dlen, GFP_ATOMIC); <--- [1]
peer->domain = dom;
if (!dom)
goto exit;
}
...
}
peer->domain will be NULL when [1] fails. But there will not change
peer->applied to 0. In this case, if tipc_mon_rcv is called again then
an information leak will happen.
Thanks,
Hangyu.
>> Fix this by adding a memset before using dom_bef.
>>
>> Fixes: 35c55c9877f8 ("tipc: add neighbor monitoring framework")
>> Signed-off-by: Hangyu Hua <hbh25y@...il.com>
Powered by blists - more mailing lists