From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Graf Subject: Re: linux-next: net/netlink/diag.c:106 suspicious rcu_dereference_protected() usage! Date: Wed, 6 Aug 2014 20:51:27 +0100 Message-ID: <20140806195127.GA26832@casper.infradead.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrey Wagin , netdev To: Cong Wang Return-path: Received: from casper.infradead.org ([85.118.1.10]:43937 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754494AbaHFTv3 (ORCPT ); Wed, 6 Aug 2014 15:51:29 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On 08/06/14 at 10:52am, Cong Wang wrote: > On Wed, Aug 6, 2014 at 10:29 AM, Andrey Wagin 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: > > [] sock_diag_rcv+0x1b/0x40 > > [ 40.074226] #1: (sock_diag_table_mutex){+.+.+.}, at: > > [] sock_diag_rcv_msg+0x6d/0x140 > > [ 40.074803] #2: (nlk->cb_mutex){+.+.+.}, at: [] > > netlink_dump+0x21/0x2d0 > > [ 40.075382] #3: (nl_table_lock){.+.?..}, at: [] > > 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.