提交 6c03ee8b 编写于 作者: L Linus Lüssing 提交者: David S. Miller

bridge: fix smatch warning / potential null pointer dereference

"New smatch warnings:
  net/bridge/br_multicast.c:1368 br_ip6_multicast_query() error:
    we previously assumed 'group' could be null (see line 1349)"

In the rare (sort of broken) case of a query having a Maximum
Response Delay of zero, we could create a potential null pointer
dereference.

Fixing this by skipping the multicast specific MLD Query parsing again
if no multicast group address is available.

Introduced by dc4eb53a
("bridge: adhere to querier election mechanism specified by RFCs")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NLinus Lüssing <linus.luessing@web.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 17958438
...@@ -1373,6 +1373,8 @@ static int br_ip6_multicast_query(struct net_bridge *br, ...@@ -1373,6 +1373,8 @@ static int br_ip6_multicast_query(struct net_bridge *br,
br_multicast_query_received(br, port, &br->ip6_other_query, br_multicast_query_received(br, port, &br->ip6_other_query,
&saddr, max_delay); &saddr, max_delay);
goto out; goto out;
} else if (!group) {
goto out;
} }
mp = br_mdb_ip6_get(mlock_dereference(br->mdb, br), group, vid); mp = br_mdb_ip6_get(mlock_dereference(br->mdb, br), group, vid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册