summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-07-29 13:41:46 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-26 16:46:01 -0700
commit1cd65f87cbf31684d778155b31ea32384f8df5d1 (patch)
tree6bcc334d0254094d1b696aecf3117baffb996cf3 /net
parent1378008ccdfdfcedbd6503f00e52124bfce1e0f7 (diff)
downloadkernel-common-1cd65f87cbf31684d778155b31ea32384f8df5d1.tar.gz
kernel-common-1cd65f87cbf31684d778155b31ea32384f8df5d1.tar.bz2
kernel-common-1cd65f87cbf31684d778155b31ea32384f8df5d1.zip
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 <xiaosuo@gmail.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/sched/act_nat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
index 4e7c24ae2ac5..abbf4fa66a0b 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;