* [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
* Re: [PATCH] act_nat: fix wild pointer
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
0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2010-07-30 7:18 UTC (permalink / raw)
To: Changli Gao; +Cc: Jamal Hadi Salim, David S. Miller, netdev
On Fri, Jul 30, 2010 at 07:41:46AM +0800, Changli Gao wrote:
> 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>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] act_nat: fix wild pointer
2010-07-30 7:18 ` Herbert Xu
@ 2010-08-01 5:05 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-08-01 5:05 UTC (permalink / raw)
To: herbert; +Cc: xiaosuo, hadi, netdev
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 30 Jul 2010 15:18:38 +0800
> On Fri, Jul 30, 2010 at 07:41:46AM +0800, Changli Gao wrote:
>> 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>
Applied.
^ permalink raw reply [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).