diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-04-17 20:27:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-04-17 20:27:11 -0400 |
commit | d2c962b8530b84f4e035df8ade7e35f353a57cbe (patch) | |
tree | 5cd3e1a27642f59caea6dd8dbfd3c5461a972e0c /net | |
parent | c19f7a9e1ac45b57375d51f033b02deca50f4d3f (diff) |
[IPV4]: ip_route_input panic fix
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=6388
The bug is caused by ip_route_input dereferencing skb->nh.protocol of
the dummy skb passed dow from inet_rtm_getroute (Thanks Thomas for seeing
it). It only happens if the route requested is for a multicast IP
address.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/route.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index ff434821909f..cc9423de7311 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2741,7 +2741,10 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) | |||
2741 | /* Reserve room for dummy headers, this skb can pass | 2741 | /* Reserve room for dummy headers, this skb can pass |
2742 | through good chunk of routing engine. | 2742 | through good chunk of routing engine. |
2743 | */ | 2743 | */ |
2744 | skb->mac.raw = skb->data; | 2744 | skb->mac.raw = skb->nh.raw = skb->data; |
2745 | |||
2746 | /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */ | ||
2747 | skb->nh.iph->protocol = IPPROTO_ICMP; | ||
2745 | skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr)); | 2748 | skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr)); |
2746 | 2749 | ||
2747 | if (rta[RTA_SRC - 1]) | 2750 | if (rta[RTA_SRC - 1]) |