act_nat: fix wild pointer
Subsystems (3)
PATCH 1/1 act_nat: fix wild pointer
pskb_may_pull() may change skb pointers, so adjust icmph after pskb_may_pull().
Signed-off-by Changli Gao <[email protected]>
----
net/sched/act_nat.c | 1 + 1 file changed, 1 insertion(+)
net/sched/act_nat.c +1 -0
@@ -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;
Quoted 3 lines · Changli Gao
pskb_may_pull()may change skb pointers, so adjust icmph afterpskb_may_pull().Signed-off-by Changli Gao <[email protected]>
Acked-by Herbert Xu <[email protected]>
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
From: Herbert Xu <[email protected]>
Date: Fri, 30 Jul 2010 15:18:38 +0800
Quoted 6 lines · Changli Gao
Quoted 3 lines
pskb_may_pull()may change skb pointers, so adjust icmph afterpskb_may_pull().Signed-off-by Changli Gao <[email protected]>Acked-by Herbert Xu <[email protected]>
Applied.