diff options
author | Linus Lüssing <linus.luessing@web.de> | 2014-06-12 03:41:23 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-12 22:00:24 +0400 |
commit | 6c03ee8bdaa10401f60dee25a719753d2fbbcc36 (patch) | |
tree | d1af9ca21125bb7f52341ea5d379946db1619cfc /net | |
parent | 179584388d7286190dfd9d2a248e25e1ffdfd472 (diff) | |
download | linux-6c03ee8bdaa10401f60dee25a719753d2fbbcc36.tar.xz |
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 dc4eb53a996a78bfb8ea07b47423ff5a3aadc362
("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>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_multicast.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index cd3cf394c477..876e5fb2a786 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -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); |