Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757479AbaAIU4h (ORCPT ); Thu, 9 Jan 2014 15:56:37 -0500 Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:37014 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756189AbaAIU42 (ORCPT ); Thu, 9 Jan 2014 15:56:28 -0500 Date: Thu, 9 Jan 2014 21:56:22 +0100 From: Florian Westphal To: Andrew Vagin Cc: Florian Westphal , Eric Dumazet , Andrey Vagin , netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, vvs@openvz.org, Pablo Neira Ayuso , Patrick McHardy , Jozsef Kadlecsik , "David S. Miller" , Cyrill Gorcunov Subject: Re: [PATCH] netfilter: nf_conntrack: fix RCU race in nf_conntrack_find_get Message-ID: <20140109205622.GA29458@breakpoint.cc> References: <1389090711-15843-1-git-send-email-avagin@openvz.org> <1389107305.26646.20.camel@edumazet-glaptop2.roam.corp.google.com> <20140107152520.GF9894@breakpoint.cc> <20140109203206.GA26348@paralelels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140109203206.GA26348@paralelels.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew Vagin wrote: > Can we allocate conntrack with zero ct_general.use and increment it at > the first time before inserting the conntrack into the hash table? > When conntrack is allocated it is attached exclusively to one skb. > It must be destroyed with skb, if it has not been confirmed, so we > don't need refcnt on this stage. > > I found only one place, where a reference counter of unconfirmed > conntract can incremented. It's ctnetlink_dump_table(). What about skb_clone, etc? They will also increment the refcnt if a conntrack entry is attached to the skb. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/