netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] act_nat: fix wild pointer
@ 2010-07-29 23:41 Changli Gao
  2010-07-30  7:18 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Changli Gao @ 2010-07-29 23:41 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Jamal Hadi Salim, David S. Miller, netdev, Changli Gao

pskb_may_pull() may change skb pointers, so adjust icmph after pskb_may_pull().

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
 net/sched/act_nat.c |    1 +
 1 file changed, 1 insertion(+)
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
index 24e614c..b6d7c6f 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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-01  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 23:41 [PATCH] act_nat: fix wild pointer Changli Gao
2010-07-30  7:18 ` Herbert Xu
2010-08-01  5:05   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).