Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp883429imm; Wed, 1 Aug 2018 06:54:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdJZEilpvI8cK1OT7rp7scTGNh6tcETwkdhMQyM+a4zxAwsGdPIsa+HucVeTQ2AIJkHHN4s X-Received: by 2002:a63:e247:: with SMTP id y7-v6mr24801650pgj.231.1533131646640; Wed, 01 Aug 2018 06:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533131646; cv=none; d=google.com; s=arc-20160816; b=Ip/Is2sx+qVZ+YxM34pfBsVq9qXezizZx8x7RZTF1gxhKX0VTQ+3FbKQezNHI39EP0 LstFCo7zsjbmnOvnD24MgngqTl7QbI3wqoCdMy9nB4ROfmhSnOQqczYPAvyAfUsqikPM gDKcGg/x9XzuA+J5LX+7R+QPd0v6+H6LfI49rX8kxbEdWOkSlOL5QF9kT3OqhvFkEAAK Vpk0IVvKOVHd48W0KvUk1BFWS5lidH1NN34x4AoQmo7zaTYvSZaoEa/veyohZr+nU2x2 gMbCQL/hJX1nuGDIZ3I0Xxq6IgUx4q2W+X/XqYJQ9PwkPv+AQ0GEJHmwYfPJ9KgeD6tg EVNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=j8T4anH1xkGduRuYGBbfGYJQNBNV0RDS5hm0aa8moy8=; b=uEdlwVoEhL1Fyfi1f8DeTXUNWSmHmHENfvdCgN03NTSLOjMW+8L8gTo6us/BSXdk0+ DkuVnpLVo70hQ/wz+Fn/rjBZEyDgriYmFEbGEkUt0oZ3PgEM24C3DOeG9Mwn7lytQuDn wMuSOzKrsg6wU2JL3ryVld2moyq0WZxGUu+ZTqOVueM4kJz/8ot5TNHC0tMCr9RNgL1x itqixxH2uIvUV4Rdoi4o0kWXs/aS1TLTcGiR+u7lbUR7lkGBD8fl74zfpQmLrQNxLWor +PXXvLIX83fbUYc1e2eIMbLlsiomLkQ47r1OhAStkWyMltql/O9hLn0rYWB9mIGOPgkY l/2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Vqnq4Phu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t80-v6si17205563pfk.228.2018.08.01.06.53.51; Wed, 01 Aug 2018 06:54:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Vqnq4Phu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389460AbeHAPiy (ORCPT + 99 others); Wed, 1 Aug 2018 11:38:54 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:40753 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389436AbeHAPix (ORCPT ); Wed, 1 Aug 2018 11:38:53 -0400 Received: by mail-pl0-f66.google.com with SMTP id s17-v6so8852343plp.7 for ; Wed, 01 Aug 2018 06:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=j8T4anH1xkGduRuYGBbfGYJQNBNV0RDS5hm0aa8moy8=; b=Vqnq4Phuog+7WXzHOd3XxY3a3DS/gvoMCvI7eCttxcHe+GAvZkrZRDf2tnoZiWpyY+ c3pjc5By+XKH5qMp03rMSEyahiDYNF2Ilw9FINJIWsGRGOhhUvL+gpVRyLgOCwMT21Ce 1R2utOD97zkyF2LJSqxiwA1vHoCFiz2JxavecOOYwNlZhJksGF7JUKGYV3dN+SRb5NTU 8xEiMxoAdIY6hF7GpaERluFg+vsnihmS8t2u/YON842L1G2gD8vRJ+gGRBhFvh1uv874 QWEahwOGhKbQ669nxlUXO+IZzf+Q5ET7VMMl9q/0HKaCWxkMYMyoHddNjfMOrBiTe4NG oKWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=j8T4anH1xkGduRuYGBbfGYJQNBNV0RDS5hm0aa8moy8=; b=qsNLRK33QM8p28VT1VqLg68Jvnic12NSmT2x4TTp5A93Sxchp6B1r32jAa739YF9KE YoxzLMMMIPcl+BggWphHNY+7mCw53bqgZFFPg3CR6zmjpCJ3BvzoOPvnDNKUFqH5rkl0 8Btr5XPNBwG/QqxQBOo/9F2U9PU2HyktY9U/qk2kzHYQqKLVISY7sFv3KCz/2lO7Pbhx 8ARBp7mMtxTdzjvy0l724h1inrWb4ZxhLARo1bW5XGToVTocDGTdP54kocGarKeg/aa7 PZga3jWUyO/dCJmcR4uwHNekWf2nZ13aM0v4QQ0Y734GAeVXsxmql39e5B7DvxgKj9pe 6JmQ== X-Gm-Message-State: AOUpUlHVUBga9ry2jacky44AgL2A7k5MDo2aEZc0AkVZG/Ro/l7if9oM f5T3xyXJ19A51YvnqVYlxkHg6tMzm32gyny6kRiJMw== X-Received: by 2002:a17:902:4401:: with SMTP id k1-v6mr22667391pld.97.1533131581038; Wed, 01 Aug 2018 06:53:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:ac14:0:0:0:0 with HTTP; Wed, 1 Aug 2018 06:52:40 -0700 (PDT) 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) 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.