mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hangyu Hua <hbh25y@gmail.com>
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()
Date: Tue, 28 Jun 2022 10:59:21 +0800	[thread overview]
Message-ID: <20220628025921.14767-1-hbh25y@gmail.com> (raw)

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


             reply	other threads:[~2022-06-28  3:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  2:59 Hangyu Hua [this message]
     [not found] ` <DB9PR05MB9078C87512422E22556EDA3888B89@DB9PR05MB9078.eurprd05.prod.outlook.com>
2022-06-28  8:21   ` Hangyu Hua
2022-07-04 14:03 ` Jon Maloy

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=20220628025921.14767-1-hbh25y@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=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 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®