From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id AEF1D6B0007 for ; Wed, 1 Aug 2018 09:53:02 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id t4-v6so13684574plo.0 for ; Wed, 01 Aug 2018 06:53:02 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 69-v6sor2774927pla.99.2018.08.01.06.53.01 for (Google Transport Security); Wed, 01 Aug 2018 06:53:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180801134628.ueyzwg2gszrvk2hc@breakpoint.cc> References: <01000164f169bc6b-c73a8353-d7d9-47ec-a782-90aadcb86bfb-000000@email.amazonses.com> <20180801103537.d36t3snzulyuge7g@breakpoint.cc> <20180801114048.ufkr7zwmir7ps3vl@breakpoint.cc> <20180801134628.ueyzwg2gszrvk2hc@breakpoint.cc> From: Dmitry Vyukov Date: Wed, 1 Aug 2018 15:52:40 +0200 Message-ID: Subject: Re: SLAB_TYPESAFE_BY_RCU without constructors (was Re: [PATCH v4 13/17] khwasan: add hooks implementation) Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Florian Westphal 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 , DRI , Eric Dumazet , Alexey Kuznetsov , Hideaki YOSHIFUJI , Ursula Braun , linux-s390 , Linux Kernel Mailing List , Andrew Morton , linux-mm , Andrey Konovalov 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.