From: Hangyu Hua <hbh25y@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: jmaloy@redhat.com, ying.xue@windriver.com, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com,
tung.q.nguyen@dektech.com.au, netdev@vger.kernel.org,
tipc-discussion@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: tipc: fix possible infoleak in tipc_mon_rcv()
Date: Thu, 30 Jun 2022 17:19:21 +0800 [thread overview]
Message-ID: <665de056-6ec1-e4e1-adf9-4df3e35628b7@gmail.com> (raw)
In-Reply-To: <20220629203118.7bdcc87f@kernel.org>
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@gmail.com>
next prev parent reply other threads:[~2022-06-30 9:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-06-30 15:27 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=665de056-6ec1-e4e1-adf9-4df3e35628b7@gmail.com \
--to=hbh25y@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jmaloy@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=tung.q.nguyen@dektech.com.au \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.