diff options
author | Linus Lüssing <linus.luessing@web.de> | 2011-03-26 16:27:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-30 05:28:20 -0400 |
commit | ff9a57a62afbbe2d0f3a09af321f1fd7645f38a5 (patch) | |
tree | 74a3d7cf9a7b10ad042eccf6adacf30aae8c7c15 /net | |
parent | fd1d9188f2cb81fe63c789d9f5463dca402ade12 (diff) |
bridge: mcast snooping, fix length check of snooped MLDv1/2
"len = ntohs(ip6h->payload_len)" does not include the length of the ipv6
header itself, which the rest of this function assumes, though.
This leads to a length check less restrictive as it should be in the
following line for one thing. For another, it very likely leads to an
integer underrun when substracting the offset and therefore to a very
high new value of 'len' due to its unsignedness. This will ultimately
lead to the pskb_trim_rcsum() practically never being called, even in
the cases where it should.
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, 1 insertions, 1 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index f61eb2eff3fd..59660c909a7c 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -1475,7 +1475,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, | |||
1475 | ip6h->payload_len == 0) | 1475 | ip6h->payload_len == 0) |
1476 | return 0; | 1476 | return 0; |
1477 | 1477 | ||
1478 | len = ntohs(ip6h->payload_len); | 1478 | len = ntohs(ip6h->payload_len) + sizeof(*ip6h); |
1479 | if (skb->len < len) | 1479 | if (skb->len < len) |
1480 | return -EINVAL; | 1480 | return -EINVAL; |
1481 | 1481 | ||