From: Stephen Hemminger Date: Tue, 8 Aug 2006 03:09:20 +0000 (-0700) Subject: [IPX]: Header length validation needed X-Git-Tag: v2.6.18-rc5~121^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b5cc5ef40c83c6ea4c90b203bb2c8b17edfa11b;p=linux-2.6 [IPX]: Header length validation needed 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 Signed-off-by: David S. Miller --- diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index aa34ff4b70..c13e86b14f 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -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 &&