From: Sasha Levin <levinsasha928@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
David Miller <davem@davemloft.net>,
lauro.venancio@openbossa.org, aloisio.almeida@openbossa.org,
Dave Jones <davej@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: net: nfc: BUG and panic in accept() on 3.5-rc2
Date: Mon, 11 Jun 2012 16:50:41 +0200 [thread overview]
Message-ID: <1339426241.4999.62.camel@lappy> (raw)
In-Reply-To: <1339425693.6001.2268.camel@edumazet-glaptop>
On Mon, 2012-06-11 at 16:41 +0200, Eric Dumazet wrote:
> On Mon, 2012-06-11 at 16:41 +0200, Samuel Ortiz wrote:
> > Hi Sasha,
> >
> > On Mon, Jun 11, 2012 at 04:00:41PM +0200, Sasha Levin wrote:
> > > Hi all,
> > >
> > > I've stumbled on the following while fuzzing with trinity inside a KVM tools guest, running on 3.5-rc2:
> > >
> > Thanks for the report, it could be worth adding this one to
> > bugzilla.kernel.org.
> >
> > What's trinity ?
> > Also, if this one is reproducible, would you mind sharing some details about
> > how we could reproduce it ?
>
> Well, bugfix should be trivial enough ;)
>
> diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
> index ec1134c..208416e 100644
> --- a/net/nfc/rawsock.c
> +++ b/net/nfc/rawsock.c
> @@ -54,11 +54,12 @@ static int rawsock_release(struct socket *sock)
> {
> struct sock *sk = sock->sk;
>
> - pr_debug("sock=%p\n", sock);
> -
> - sock_orphan(sk);
> - sock_put(sk);
> + pr_debug("sock=%p sk=%p\n", sock, sk);
>
> + if (sk) {
> + sock_orphan(sk);
> + sock_put(sk);
> + }
> return 0;
> }
Eric, Is there something that documents at what state each of the
callbacks in the network subsystem can be called? Like a big flow chart
of some sorts?
I'm asking because I've looked at this as well before sending this mail,
and while the fix does look trivial, I wasn't sure whether it is really
the correct fix, or the problem is that this callback wasn't supposed be
called at all so something else is broken (we had such issue with
namespaces and unshare() not long ago).
next prev parent reply other threads:[~2012-06-11 14:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 14:00 net: nfc: BUG and panic in accept() on 3.5-rc2 Sasha Levin
2012-06-11 14:41 ` Samuel Ortiz
2012-06-11 14:41 ` Eric Dumazet
2012-06-11 14:50 ` Sasha Levin [this message]
2012-06-11 14:58 ` Eric Dumazet
2012-06-11 16:55 ` Sasha Levin
2012-06-11 14:57 ` Samuel Ortiz
2012-06-11 14:59 ` Eric Dumazet
2012-06-11 15:20 ` Samuel Ortiz
2012-06-11 16:56 ` Sasha Levin
2012-06-11 17:25 ` Dave Jones
2012-06-11 19:49 ` Samuel Ortiz
2012-06-25 15:04 ` Sasha Levin
2012-06-25 15:53 ` [PATCH] net: nfc: fix panic in accept() Eric Dumazet
2012-06-25 17:15 ` Samuel Ortiz
2012-06-28 12:11 ` Sasha Levin
2012-06-28 12:56 ` Samuel Ortiz
2012-06-28 13:42 ` John W. Linville
2012-06-11 15:05 ` net: nfc: BUG and panic in accept() on 3.5-rc2 Dave Jones
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=1339426241.4999.62.camel@lappy \
--to=levinsasha928@gmail.com \
--cc=aloisio.almeida@openbossa.org \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=lauro.venancio@openbossa.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sameo@linux.intel.com \
/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).