Skip to content

Commit 5fc6266

Browse files
T-Xdavem330
authored andcommitted
bridge: mcast: Fix MLD2 Report IPv6 payload length check
Commit e57f618 ("net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling") introduced a bug in the IPv6 header payload length check which would potentially lead to rejecting a valid MLD2 Report: The check needs to take into account the 2 bytes for the "Number of Sources" field in the "Multicast Address Record" before reading it. And not the size of a pointer to this field. Fixes: e57f618 ("net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling") Acked-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: Linus Lüssing <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 394de11 commit 5fc6266

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
@@ -1007,7 +1007,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
10071007
nsrcs_offset = len + offsetof(struct mld2_grec, grec_nsrcs);
10081008

10091009
if (skb_transport_offset(skb) + ipv6_transport_len(skb) <
1010-
nsrcs_offset + sizeof(_nsrcs))
1010+
nsrcs_offset + sizeof(__nsrcs))
10111011
return -EINVAL;
10121012

10131013
_nsrcs = skb_header_pointer(skb, nsrcs_offset,

0 commit comments

Comments
 (0)