From: Dmitry Vyukov Subject: Re: SLAB_TYPESAFE_BY_RCU without constructors (was Re: [PATCH v4 13/17] khwasan: add hooks implementation) Date: Wed, 1 Aug 2018 15:52:40 +0200 Message-ID: References: <01000164f169bc6b-c73a8353-d7d9-47ec-a782-90aadcb86bfb-000000@email.amazonses.com> <20180801103537.d36t3snzulyuge7g@breakpoint.cc> <20180801114048.ufkr7zwmir7ps3vl@breakpoint.cc> <20180801134628.ueyzwg2gszrvk2hc@breakpoint.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linus Torvalds , Christoph Lameter , Andrey Ryabinin , "Theodore Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, Greg Kroah-Hartman , Pablo Neira Ayuso , Jozsef Kadlecsik , David Miller , NetFilter , coreteam@netfilter.org, Network Development , Gerrit Renker , dccp@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Dave Airlie , intel-gfx Return-path: In-Reply-To: <20180801134628.ueyzwg2gszrvk2hc@breakpoint.cc> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-ext4.vger.kernel.org On Wed, Aug 1, 2018 at 3:46 PM, Florian Westphal wrote: > Dmitry Vyukov wrote: >> If that scenario is possible that a fix would be to make > > Looks possible. > >> __nf_conntrack_find_get ever return NULL iff it got NULL from >> ____nf_conntrack_find (not if any of the checks has failed). > > I don't see why we need to restart on nf_ct_is_dying(), but other > than that this seems ok. Because it can be a wrong entry dying. When we check dying, we don't yet know if we are looking at the right entry or not. If we successfully acquire a reference, then recheck nf_ct_key_equal and _then_ check dying, then we don't need to restart on dying. But with the current check order, we need to restart on dying too.