From: Paul Moore <paul.moore@hp.com>
To: James Morris <jmorris@namei.org>
Cc: Valdis.Kletnieks@vt.edu, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, sds@tycho.nsa.gov,
netdev@vger.kernel.org
Subject: Re: 2.6.24-rc6-mm1 - git-lblnet.patch and networking horkage
Date: Mon, 31 Dec 2007 17:01:24 -0500 [thread overview]
Message-ID: <200712311701.24685.paul.moore@hp.com> (raw)
In-Reply-To: <Xine.LNX.4.64.0801010841060.25768@us.intercode.com.au>
On Monday 31 December 2007 4:46:09 pm James Morris wrote:
> On Mon, 31 Dec 2007, Paul Moore wrote:
> > I'm pretty certain this is an uninitialized value problem now and not a
> > use-after-free issue. The invalid/garbage ->iif value seems to only
> > happen on packets that are generated locally and sent back into the stack
> > for local consumption, e.g. loopback. These local packets also need to
> > have been cloned at some point, either on the output or input path.
>
> I think we need to find out exactly what's happening, first.
The more I've looked at the code this afternoon, I'm certain this is the case.
I've also been running a patched kernel (using option #2 from below) and all
of the skbs coming up the stack have valid ->iif values. Granted, I haven't
examined the code from the avahi daemon or the tcl test cases and traced the
entire code path through the kernel but I _am_ certain that at some point in
that code path the packet is cloned and due to a problem in skb_clone()
the ->iif field is not copied correctly causing the problems we have all
seen.
How much smoke needs to be coming from the gun? :)
> > The problem appears to be a skb_clone() function which does not clear the
> > skb structure properly and fails to copy the ->iif value from the
> > original skb to the cloned skb. From what I can tell, there are two
> > possible solutions to this problem:
> >
> > 1. Clear all of the cloned skb fields in skb_clone() via memset()
>
> Sounds like it's not going to fly for performance reasons in any case.
That was my gut feeling. I was also a little unsure where exactly the correct
placement should be for the memset() call.
> > 2. Copy the ->iif field in __copy_skb_header()
>
> Seems valid.
Okay, I'll stick with this approach. I'll post a patch backed against
net-2.6.25 tomorrow as an RFC to see if anyone on netdev has any strong
feelings. If no one complains, I'll add it to the lblnet git tree.
--
paul moore
linux security @ hp
next prev parent reply other threads:[~2007-12-31 22:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-26 15:57 2.6.24-rc6-mm1 - git-lblnet.patch and networking horkage Paul Moore
2007-12-26 21:52 ` James Morris
2007-12-28 14:21 ` Paul Moore
2007-12-31 17:13 ` Paul Moore
2007-12-31 20:06 ` Paul Moore
2007-12-31 21:46 ` James Morris
2007-12-31 22:01 ` Paul Moore [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-12-23 7:30 2.6.24-rc6-mm1 Andrew Morton
2007-12-26 5:43 ` 2.6.24-rc6-mm1 - git-lblnet.patch and networking horkage Valdis.Kletnieks
2007-12-26 7:34 ` James Morris
2007-12-26 8:25 ` Valdis.Kletnieks
2007-12-26 8:52 ` James Morris
2007-12-26 14:16 ` James Morris
2007-12-26 22:46 ` Andrew Morton
2007-12-26 16:44 ` Valdis.Kletnieks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200712311701.24685.paul.moore@hp.com \
--to=paul.moore@hp.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox