Skip to content

Commit

Permalink
[IPX]: Header length validation needed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Aug 8, 2006
1 parent d14cc9a commit 8b5cc5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipx/af_ipx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 8b5cc5e

Please sign in to comment.