]> err.no Git - linux-2.6/commitdiff
[IPX]: Header length validation needed
authorStephen Hemminger <shemminger@osdl.org>
Tue, 8 Aug 2006 03:09:20 +0000 (20:09 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Aug 2006 03:09:20 +0000 (20:09 -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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipx/af_ipx.c

index aa34ff4b707ca9a4151c6ce783761370901eaf4c..c13e86b14f69a4aa1e1ed0bcfb9acb948bf0f074 100644 (file)
@@ -1646,7 +1646,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 &&