From: Changli Gao Date: Thu, 29 Jul 2010 13:41:46 +0000 (+0000) Subject: act_nat: fix wild pointer X-Git-Tag: v2.6.35.4~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cd65f87cbf31684d778155b31ea32384f8df5d1;p=thirdparty%2Fkernel%2Fstable.git act_nat: fix wild pointer [ Upstream commit 072d79a31a3b870b49886f4347e23f81b7eca3ac ] pskb_may_pull() may change skb pointers, so adjust icmph after pskb_may_pull(). Signed-off-by: Changli Gao Acked-by: Herbert Xu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 4e7c24ae2ac55..abbf4fa66a0b9 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c @@ -218,6 +218,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) goto drop; + icmph = (void *)(skb_network_header(skb) + ihl); iph = (void *)(icmph + 1); if (egress) addr = iph->daddr;