From: Eric Dumazet <eric.dumazet@gmail.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
netdev <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: strange crashes in tcp_poll() via epoll_wait
Date: Fri, 19 Jul 2013 17:10:05 -0700 [thread overview]
Message-ID: <1374279005.26476.31.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130719235008.GA4518@dcvr.yhbt.net>
On Fri, 2013-07-19 at 23:50 +0000, Eric Wong wrote:
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Hi Al
> >
> > I tried to debug strange crashes in tcp_poll() called from
> > sys_epoll_wait() -> sock_poll()
> >
> > The symptom is that sock->sk is NULL and we therefore dereference a NULL
> > pointer.
> >
> > It's really rare crashes but still, it would be nice to understand where
> > is the bug. Presumably latest kernels would crash in sock_poll() because
> > of the sk_can_busy_loop(sock->sk) call.
> >
> > We do test sock->sk being NULL in sock_fasync(), but epoll should be
> > safe because of existing synchronization (epmutex) ?
>
> It should be safe because of ep->mtx, actually, as epmutex is not taken
> in sys_epoll_wait.
Hmm, it might be more complex than that for multi threaded programs :
eventpoll_release_file()
The problem might be because a thread closes a socket while an event
was queued for it.
>
> I took a look at this but have not found anything. I've yet to see this
> this on my machines.
>
> When did you start noticing this?
Hard to say, but we have these crashes on a 3.3+ based kernel.
Probability of said crashes is very very low.
next prev parent reply other threads:[~2013-07-20 0:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 16:24 strange crashes in tcp_poll() via epoll_wait Eric Dumazet
2013-07-19 23:50 ` Eric Wong
2013-07-20 0:10 ` Eric Dumazet [this message]
2013-07-20 2:03 ` Eric Wong
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=1374279005.26476.31.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=normalperson@yhbt.net \
--cc=viro@ZenIV.linux.org.uk \
/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).