]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ipx: header length validation needed
authorStephen Hemminger <shemminger@osdl.org>
Mon, 7 Aug 2006 23:36:02 +0000 (16:36 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Aug 2006 21:13:31 +0000 (14:13 -0700)
This patch will linearize and check there is enough data.
It handles the pprop case as well as avoiding a whole audit of
the routing code.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
net/ipx/af_ipx.c

index 811d998725bc6728bec208ad90ef81157f8235a0..e6a50e82603b9290599295e4f9b6421229119af6 100644 (file)
@@ -1647,7 +1647,8 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
        ipx_pktsize     = ntohs(ipx->ipx_pktsize);
        
        /* Too small or invalid header? */
-       if (ipx_pktsize < sizeof(struct ipxhdr) || ipx_pktsize > skb->len)
+       if (ipx_pktsize < sizeof(struct ipxhdr)
+          || !pskb_may_pull(skb, ipx_pktsize))
                goto drop;
                         
        if (ipx->ipx_checksum != IPX_NO_CHECKSUM &&