From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933339AbbCYPLZ (ORCPT ); Wed, 25 Mar 2015 11:11:25 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:35493 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933320AbbCYPLT (ORCPT ); Wed, 25 Mar 2015 11:11:19 -0400 Message-ID: <5512D014.9080305@gmail.com> Date: Wed, 25 Mar 2015 16:11:16 +0100 From: Patrick Marlier User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: paulmck@linux.vnet.ibm.com CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] netfilter: fix list_entry_rcu usage. References: <55113D10.4050309@gmail.com> <20150325143607.GA27413@linux.vnet.ibm.com> In-Reply-To: <20150325143607.GA27413@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/25/2015 03:36 PM, Paul E. McKenney wrote: > On Tue, Mar 24, 2015 at 11:31:44AM +0100, Patrick Marlier wrote: >> >Signed-off-by: Patrick Marlier >> >--- >> > net/netfilter/core.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> >diff --git a/net/netfilter/core.c b/net/netfilter/core.c >> >index fea9ef5..05bd311 100644 >> >--- a/net/netfilter/core.c >> >+++ b/net/netfilter/core.c >> >@@ -174,7 +174,7 @@ int nf_hook_slow(u_int8_t pf, unsigned int hook, >> >struct sk_buff *skb, >> > /* We may already have this, but read-locks nest anyway */ >> > rcu_read_lock(); >> > >> >- elem = list_entry_rcu(&nf_hooks[pf][hook], struct nf_hook_ops, list); >> >+ elem = list_entry_rcu(nf_hooks[pf][hook].next, struct nf_hook_ops, list); > And this departs from the list_entry() API. Is this really a good idea? No opinion on that but AFAIK there are only 2 spots in the whole kernel source where the ".next" is not used with list_entry_rcu. -- Patrick Marlier