소스 검색

bridge: Fix IPv6 multicast snooping by correcting offset in MLDv2 report

We actually want a pointer to the grec_nsrcr and not the following
field. Otherwise we can get very high values for *nsrcs as the first two
bytes of the IPv6 multicast address are being used instead, leading to
a failing pskb_may_pull() which results in MLDv2 reports not being
parsed.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Lüssing 14 년 전
부모
커밋
649e984d00
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      net/bridge/br_multicast.c

+ 1 - 1
net/bridge/br_multicast.c

@@ -1013,7 +1013,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
 
 
 		nsrcs = skb_header_pointer(skb,
 		nsrcs = skb_header_pointer(skb,
 					   len + offsetof(struct mld2_grec,
 					   len + offsetof(struct mld2_grec,
-							  grec_mca),
+							  grec_nsrcs),
 					   sizeof(_nsrcs), &_nsrcs);
 					   sizeof(_nsrcs), &_nsrcs);
 		if (!nsrcs)
 		if (!nsrcs)
 			return -EINVAL;
 			return -EINVAL;