Skip to content

Commit

Permalink
bridge: fix smatch warning / potential null pointer dereference
Browse files Browse the repository at this point in the history
"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 dc4eb53
("bridge: adhere to querier election mechanism specified by RFCs")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Linus Lüssing authored and David S. Miller committed Jun 12, 2014
1 parent 1795843 commit 6c03ee8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,8 @@ static int br_ip6_multicast_query(struct net_bridge *br,
br_multicast_query_received(br, port, &br->ip6_other_query,
&saddr, max_delay);
goto out;
} else if (!group) {
goto out;
}

mp = br_mdb_ip6_get(mlock_dereference(br->mdb, br), group, vid);
Expand Down

0 comments on commit 6c03ee8

Please sign in to comment.