Commit 0b159b8b authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by Greg Kroah-Hartman

net: bridge: mcast: fix stale ipv6 hdr pointer when handling v6 query

[ Upstream commit 3b26a5d0 ]

We get a pointer to the ipv6 hdr in br_ip6_multicast_query but we may
call pskb_may_pull afterwards and end up using a stale pointer.
So use the header directly, it's just 1 place where it's needed.

Fixes: 08b202b6 ("bridge br_multicast: IPv6 MLD support.")
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tested-by: default avatarMartin Weinelt <martin@linuxlounge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aa1a26b4
...@@ -1302,7 +1302,6 @@ static int br_ip6_multicast_query(struct net_bridge *br, ...@@ -1302,7 +1302,6 @@ static int br_ip6_multicast_query(struct net_bridge *br,
u16 vid) u16 vid)
{ {
unsigned int transport_len = ipv6_transport_len(skb); unsigned int transport_len = ipv6_transport_len(skb);
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
struct mld_msg *mld; struct mld_msg *mld;
struct net_bridge_mdb_entry *mp; struct net_bridge_mdb_entry *mp;
struct mld2_query *mld2q; struct mld2_query *mld2q;
...@@ -1346,7 +1345,7 @@ static int br_ip6_multicast_query(struct net_bridge *br, ...@@ -1346,7 +1345,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
if (is_general_query) { if (is_general_query) {
saddr.proto = htons(ETH_P_IPV6); saddr.proto = htons(ETH_P_IPV6);
saddr.u.ip6 = ip6h->saddr; saddr.u.ip6 = ipv6_hdr(skb)->saddr;
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment