From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Graf Subject: Re: [PATCH 1/3] netfilter: nft_hash: no need for rcu in the hash set destroy path Date: Tue, 2 Sep 2014 12:02:13 +0100 Message-ID: <20140902110213.GA6778@casper.infradead.org> References: <1409650721-9621-1-git-send-email-pablo@netfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netfilter-devel@vger.kernel.org, kaber@trash.net To: Pablo Neira Ayuso Return-path: Received: from casper.infradead.org ([85.118.1.10]:33269 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753225AbaIBLCO (ORCPT ); Tue, 2 Sep 2014 07:02:14 -0400 Content-Disposition: inline In-Reply-To: <1409650721-9621-1-git-send-email-pablo@netfilter.org> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On 09/02/14 at 11:38am, Pablo Neira Ayuso wrote: > The sets are released from the rcu callback, after the rule is removed > from the chain list, which implies that nfnetlink cannot update the > hashes (thus, no resizing may occur) and no packets are walking on the > set anymore. > > This resolves a lockdep splat in the nft_hash_destroy() path since the > nfnl mutex is not held there. > > =============================== > [ INFO: suspicious RCU usage. ] > 3.16.0-rc2+ #168 Not tainted > ------------------------------- > net/netfilter/nft_hash.c:362 suspicious rcu_dereference_protected() usage! > > other info that might help us debug this: > > rcu_scheduler_active = 1, debug_locks = 1 > 1 lock held by ksoftirqd/0/3: > #0: (rcu_callback){......}, at: [] rcu_process_callbacks+0x27e/0x4c7 > > stack backtrace: > CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 3.16.0-rc2+ #168 > Hardware name: LENOVO 23259H1/23259H1, BIOS G2ET32WW (1.12 ) 05/30/2012 > 0000000000000001 ffff88011769bb98 ffffffff8142c922 0000000000000006 > ffff880117694090 ffff88011769bbc8 ffffffff8107c3ff ffff8800cba52400 > ffff8800c476bea8 ffff8800c476bea8 ffff8800cba52400 ffff88011769bc08 > Call Trace: > [] dump_stack+0x4e/0x68 > [] lockdep_rcu_suspicious+0xfa/0x103 > [] nft_hash_destroy+0x50/0x137 [nft_hash] > [] nft_set_destroy+0x11/0x2a [nf_tables] > > Signed-off-by: Pablo Neira Ayuso Acked-by: Thomas Graf