summaryrefslogtreecommitdiffstats
path: root/net/sched/act_nat.c
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-07-29 15:41:46 +0200
committerDavid S. Miller <davem@davemloft.net>2010-08-01 07:04:54 +0200
commit072d79a31a3b870b49886f4347e23f81b7eca3ac (patch)
treee007177c6d42e63a610ba0a8a811c0b4b1c0841a /net/sched/act_nat.c
parentbridge: Fix skb leak when multicast parsing fails on TX (diff)
downloadlinux-072d79a31a3b870b49886f4347e23f81b7eca3ac.tar.xz
linux-072d79a31a3b870b49886f4347e23f81b7eca3ac.zip
act_nat: fix wild pointer
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>
Diffstat (limited to 'net/sched/act_nat.c')
-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 724553e8ed7b..ea008f57fc83 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;