From: Lennert Buytenhek <buytenh@wantstofly.org>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: oopses since "net: Optimize memory usage when splicing from sockets"
Date: Thu, 30 Apr 2009 14:40:36 +0200 [thread overview]
Message-ID: <20090430124036.GN14729@mail.wantstofly.org> (raw)
In-Reply-To: <20090430084321.GA2753@ami.dom.local>
On Thu, Apr 30, 2009 at 10:43:21AM +0200, Jarek Poplawski wrote:
> > Since 4fb669948116d928ae44262ab7743732c574630d ("net: Optimize memory
> > usage when splicing from sockets.") I'm seeing this oops (e.g. in
> > 2.6.30-rc3) when splicing from a TCP socket to /dev/null on a driver
> > (mv643xx_eth) that uses LRO in the skb mode (lro_receive_skb) rather
> > than the frag mode:
> ...
> > addr2line suggests skb->sk is NULL in linear_to_page():
> >
> >
> > static inline struct page *linear_to_page(struct page *page, unsigned int *len,
> > unsigned int *offset,
> > struct sk_buff *skb)
> > {
> > struct sock *sk = skb->sk;
> > struct page *p = sk->sk_sndmsg_page; <========
> > unsigned int off;
> >
> > if (!p) {
> >
> >
> > When we get here, skb->sk has apparently already been dropped, leading
> > to a NULL pointer deref. Backing out the offending commit makes the
> > oops go away (as does converting the driver to lro frag rx, but that
> > destroys routing performance).
> >
> > Thoughts? Should we just fall back to plain alloc_pages() if skb->sk
> > is NULL, or should have still have the socket reference when we get here?
>
> Hmm... I definitely need more time for this, but the first and maybe
> wrong impression is this is an skb from the frag_list. There are
> probably better ways of fixing it properly, but here is a quick hack
> for the beginning (alas not even compile-tested at the moment).
With your patch, at least the oops is gone, and I guess it makes
sense and looks correct, so:
Tested-by: Lennert Buytenhek <buytenh@wantstofly.org>
Thanks!
next prev parent reply other threads:[~2009-04-30 12:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-30 3:16 oopses since "net: Optimize memory usage when splicing from sockets" Lennert Buytenhek
2009-04-30 8:43 ` Jarek Poplawski
2009-04-30 12:40 ` Lennert Buytenhek [this message]
2009-04-30 12:40 ` David Miller
2009-04-30 12:45 ` Lennert Buytenhek
2009-04-30 12:43 ` David Miller
2009-04-30 12:47 ` Jarek Poplawski
2009-04-30 12:30 ` [PATCH net-2.6] " Jarek Poplawski
2009-04-30 12:33 ` David Miller
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=20090430124036.GN14729@mail.wantstofly.org \
--to=buytenh@wantstofly.org \
--cc=davem@davemloft.net \
--cc=jarkao2@gmail.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).