Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bridge: fix igmpv3 / mldv2 report parsing

With the newly introduced helper functions the skb pulling is hidden in
the checksumming function - and undone before returning to the caller.

The IGMPv3 and MLDv2 report parsing functions in the bridge still
assumed that the skb is pointing to the beginning of the IGMP/MLD
message while it is now kept at the beginning of the IPv4/6 header,
breaking the message parsing and creating packet loss.

Fixing this by taking the offset between IP and IGMP/MLD header into
account, too.

Fixes: 9afd85c9e455 ("net: Export IGMP/MLD message validation code")
Reported-by: Tobias Powalowski <tobias.powalowski@googlemail.com>
Tested-by: Tobias Powalowski <tobias.powalowski@googlemail.com>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Linus Lüssing and committed by
David S. Miller
c2d4fbd2 a19a19de

+2 -2
+2 -2
net/bridge/br_multicast.c
··· 1006 1006 1007 1007 ih = igmpv3_report_hdr(skb); 1008 1008 num = ntohs(ih->ngrec); 1009 - len = sizeof(*ih); 1009 + len = skb_transport_offset(skb) + sizeof(*ih); 1010 1010 1011 1011 for (i = 0; i < num; i++) { 1012 1012 len += sizeof(*grec); ··· 1067 1067 1068 1068 icmp6h = icmp6_hdr(skb); 1069 1069 num = ntohs(icmp6h->icmp6_dataun.un_data16[1]); 1070 - len = sizeof(*icmp6h); 1070 + len = skb_transport_offset(skb) + sizeof(*icmp6h); 1071 1071 1072 1072 for (i = 0; i < num; i++) { 1073 1073 __be16 *nsrcs, _nsrcs;