netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Cong Wang <cwang@twopensource.com>
Cc: Andrey Wagin <avagin@gmail.com>, netdev <netdev@vger.kernel.org>
Subject: Re: linux-next: net/netlink/diag.c:106 suspicious rcu_dereference_protected() usage!
Date: Wed, 6 Aug 2014 20:51:27 +0100	[thread overview]
Message-ID: <20140806195127.GA26832@casper.infradead.org> (raw)
In-Reply-To: <CAHA+R7N0c83by=AAgw2nKPibYETNyv6JTEWnu5XOo-67fHMELw@mail.gmail.com>

On 08/06/14 at 10:52am, Cong Wang wrote:
> On Wed, Aug 6, 2014 at 10:29 AM, Andrey Wagin <avagin@gmail.com> wrote:
> > [   40.072199] ===============================
> > [   40.072350] [ INFO: suspicious RCU usage. ]
> > [   40.072501] 3.16.0-next-20140806 #1 Not tainted
> > [   40.072659] -------------------------------
> > [   40.072807] net/netlink/diag.c:106 suspicious
> > rcu_dereference_protected() usage!
> > [   40.073047]
> > other info that might help us debug this:
> >
> > [   40.073276]
> > rcu_scheduler_active = 1, debug_locks = 0
> > [   40.073494] 4 locks held by criu/2838:
> > [   40.073635]  #0:  (sock_diag_mutex){+.+.+.}, at:
> > [<ffffffff81689afb>] sock_diag_rcv+0x1b/0x40
> > [   40.074226]  #1:  (sock_diag_table_mutex){+.+.+.}, at:
> > [<ffffffff81689c6d>] sock_diag_rcv_msg+0x6d/0x140
> > [   40.074803]  #2:  (nlk->cb_mutex){+.+.+.}, at: [<ffffffff816a28f1>]
> > netlink_dump+0x21/0x2d0
> > [   40.075382]  #3:  (nl_table_lock){.+.?..}, at: [<ffffffffa0286601>]
> > netlink_diag_dump+0x31/0xb0 [netlink_diag]
> > [   40.076351]
> 
> 
> Looks like we should hold rcu_read_lock() before calling __netlink_diag_dump().

netlink_diag_dump() still acquires nl_table_lock which is pointless as
a separate mutex has been introduced to protect mutations. I will send
a patch to RCU'ify it properly.

  reply	other threads:[~2014-08-06 19:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 17:29 linux-next: net/netlink/diag.c:106 suspicious rcu_dereference_protected() usage! Andrey Wagin
2014-08-06 17:52 ` Cong Wang
2014-08-06 19:51   ` Thomas Graf [this message]
2014-08-06 21:20     ` Cong Wang
2014-08-06 23:18       ` [PATCH net] netlink: hold nl_sock_hash_lock during diag dump Thomas Graf
2014-08-07  2:18         ` 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=20140806195127.GA26832@casper.infradead.org \
    --to=tgraf@suug.ch \
    --cc=avagin@gmail.com \
    --cc=cwang@twopensource.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).