]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/ipv4/route.c
[PATCH] ip_route_input panic fix (CVE-2006-1525)
[karo-tx-linux.git] / net / ipv4 / route.c
index fca5fe0cf94a397fe957f26a39ebd82054f9582c..a67955e26371ffc5c0bfc8661bb5d79b951f0395 100644 (file)
@@ -2750,7 +2750,10 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
        /* Reserve room for dummy headers, this skb can pass
           through good chunk of routing engine.
         */
-       skb->mac.raw = skb->data;
+       skb->mac.raw = skb->nh.raw = skb->data;
+
+       /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
+       skb->nh.iph->protocol = IPPROTO_ICMP;
        skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
 
        if (rta[RTA_SRC - 1])