Commit 24c69275 authored by David Stevens's avatar David Stevens Committed by David S. Miller

[IGMP]: workaround for IGMP v1/v2 bug

From: David Stevens <dlstevens@us.ibm.com>

As explained at:

	http://www.cs.ucsb.edu/~krishna/igmp_dos/

With IGMP version 1 and 2 it is possible to inject a unicast
report to a client which will make it ignore multicast
reports sent later by the router.

The fix is to only accept the report if is was sent to a
multicast or unicast address.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bf031fff
...@@ -897,6 +897,9 @@ int igmp_rcv(struct sk_buff *skb) ...@@ -897,6 +897,9 @@ int igmp_rcv(struct sk_buff *skb)
/* Is it our report looped back? */ /* Is it our report looped back? */
if (((struct rtable*)skb->dst)->fl.iif == 0) if (((struct rtable*)skb->dst)->fl.iif == 0)
break; break;
/* don't rely on MC router hearing unicast reports */
if (skb->pkt_type == PACKET_MULTICAST ||
skb->pkt_type == PACKET_BROADCAST)
igmp_heard_report(in_dev, ih->group); igmp_heard_report(in_dev, ih->group);
break; break;
case IGMP_PIM: case IGMP_PIM:
......
...@@ -1231,6 +1231,11 @@ int igmp6_event_report(struct sk_buff *skb) ...@@ -1231,6 +1231,11 @@ int igmp6_event_report(struct sk_buff *skb)
if (skb->pkt_type == PACKET_LOOPBACK) if (skb->pkt_type == PACKET_LOOPBACK)
return 0; return 0;
/* send our report if the MC router may not have heard this report */
if (skb->pkt_type != PACKET_MULTICAST &&
skb->pkt_type != PACKET_BROADCAST)
return 0;
if (!pskb_may_pull(skb, sizeof(struct in6_addr))) if (!pskb_may_pull(skb, sizeof(struct in6_addr)))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment