[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100525124636.GA13161@gondor.apana.org.au>
Date: Tue, 25 May 2010 22:46:36 +1000
From: Herbert Xu <herbert@...dor.apana.org.au>
To: jamal <hadi@...erus.ca>
Cc: Jiri Pirko <jpirko@...hat.com>, netdev@...r.kernel.org,
davem@...emloft.net, kaber@...sh.net
Subject: Re: Question about an assignment in handle_ing()
On Tue, May 25, 2010 at 08:20:38AM -0400, jamal wrote:
> On Tue, 2010-05-25 at 22:12 +1000, Herbert Xu wrote:
>
> > It is guaranteed, it is illegal to hold onto the skb contents
> > without the reference that comes from cloning an skb.
>
> As i recall this was an issue. And the example i described earlier
> would have tcpdump show edited contents coming out of eth0.
That's not very surprising as you're not checking whether the
skb is cloned in act_pedit.c:
if (!(skb->tc_verd & TC_OK2MUNGE)) {
/* should we set skb->cloned? */
if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
return p->tcf_action;
}
}
This code needs to be changed to something like
if (skb_cloned(skb)) {
if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
return p->tcf_action;
}
}
BTW, this error handling also looks a bit suss. Shouldn't it
drop the packet instead of continuing as if we have successfully
modified it?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists