Skip to content

Commit ff9a57a

Browse files
T-Xdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fd1d918 commit ff9a57a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bridge/br_multicast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
14751475
ip6h->payload_len == 0)
14761476
return 0;
14771477

1478-
len = ntohs(ip6h->payload_len);
1478+
len = ntohs(ip6h->payload_len) + sizeof(*ip6h);
14791479
if (skb->len < len)
14801480
return -EINVAL;
14811481

0 commit comments

Comments
 (0)