From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2754C433EF for ; Mon, 4 Jul 2022 20:25:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 202176B0071; Mon, 4 Jul 2022 16:25:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18B8D6B0073; Mon, 4 Jul 2022 16:25:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 004C86B0074; Mon, 4 Jul 2022 16:25:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id DF7526B0071 for ; Mon, 4 Jul 2022 16:25:19 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A44D0B03 for ; Mon, 4 Jul 2022 20:25:19 +0000 (UTC) X-FDA: 79650547158.29.7F47906 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by imf04.hostedemail.com (Postfix) with ESMTP id 89E0940008 for ; Mon, 4 Jul 2022 20:25:18 +0000 (UTC) Received: by mail-ej1-f51.google.com with SMTP id sb34so18307554ejc.11 for ; Mon, 04 Jul 2022 13:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8NHXRzMNJPY/okJiN7rxUFnMFdO+6UnOx+ybcPBWQtw=; b=QhD7FvbczvS7ySqve4lgmGKe6XQqf2tkErpFbk227PNJlSK9nINruRTNggBVzaq6hn Vm06wsisRqXUdJvpIFNLX7oFVacVFtCt6NbzXypYAbFcxemoyYNqmZPiyTxlGlD7Sr1U /8FS/9iTlnawFf71gWUa5iOfR8gUphFcHgYu4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8NHXRzMNJPY/okJiN7rxUFnMFdO+6UnOx+ybcPBWQtw=; b=C7mAFAGjVFmL+HFhqkCUAd6lyUL3yHKvwm/CVAZ73dnDckyum2uR8jM3JMaKWciYA1 jeodOES6lqnHm+MbfntptYfPZciYW9MBdJ0MToFRqDDqP2Egd6JyKEWoQ8zWt+Sekdqi unxU7BFUadBzevrrrVvgDkdrY6NI3VrNm4EzRkQYN8zClW6RvkaKbJhrLMVlq6CAGr83 1QcaAffUmz98O27SwJxM3WVQrBSntpGTUsdI5Vfg/do5h2UlXn5C6nkGHtyuhdME+MCz uK8WLeKf2X/rEsjghJHSCgEqVast+E7fl3T4P/zI0ach6DQiI3aFbx923sIx1N83bSwd SX6A== X-Gm-Message-State: AJIora+63tD4QZCwDTSsnu2xmrDNZUieTn7N90SNSsPj1iDUkkwot53k f5NJlIVBwpidJXe5xWyfzQW3VKHtG0qoZITIgVM= X-Google-Smtp-Source: AGRyM1tOZyRPh/SOr8WNd6Hr9f6/GGH6xj9GnNXAZFXv+pgViETlQL5zMxEvWp78b9gxu9pgxhPB/Q== X-Received: by 2002:a17:906:8a5b:b0:72a:8b2b:c5b4 with SMTP id gx27-20020a1709068a5b00b0072a8b2bc5b4mr19646487ejc.75.1656966316739; Mon, 04 Jul 2022 13:25:16 -0700 (PDT) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com. [209.85.208.43]) by smtp.gmail.com with ESMTPSA id z10-20020aa7c64a000000b0043a21e3b4a5sm4058683edr.40.2022.07.04.13.25.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jul 2022 13:25:15 -0700 (PDT) Received: by mail-ed1-f43.google.com with SMTP id c65so12928805edf.4 for ; Mon, 04 Jul 2022 13:25:15 -0700 (PDT) X-Received: by 2002:a5d:64e7:0:b0:21b:ad72:5401 with SMTP id g7-20020a5d64e7000000b0021bad725401mr27424083wri.442.1656966304591; Mon, 04 Jul 2022 13:25:04 -0700 (PDT) MIME-Version: 1.0 References: <20220701142310.2188015-1-glider@google.com> <20220701142310.2188015-44-glider@google.com> In-Reply-To: From: Linus Torvalds Date: Mon, 4 Jul 2022 13:24:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 43/45] namei: initialize parameters passed to step_into() To: Al Viro Cc: Alexander Potapenko , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev , Linux-MM , linux-arch , Linux Kernel Mailing List , Evgenii Stepanov , Nathan Chancellor , Nick Desaulniers , Segher Boessenkool , Vitaly Buka , linux-toolchains Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=QhD7Fvbc; dmarc=none; spf=pass (imf04.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.218.51 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656966318; a=rsa-sha256; cv=none; b=NY8mmcfrr4lGLZQdYqTI9rotowGKERfF9XBugJ0ju/qfj0+9N43jCcVrOi5pGnQlyedd+O JpyPKZaoSSGbGCDC11ZFShZ1kjAqj9QmB6S1KZKY0ObAuOzUEN5ToMPeNkF93DGRdmwDam OZkORg0SJ8793ZvxybEpmL3g2QHXlQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656966318; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8NHXRzMNJPY/okJiN7rxUFnMFdO+6UnOx+ybcPBWQtw=; b=g9hcYBpK/BSVtF6q21PAbdAq8/8x46ppIHsSAWLMGg8NEitIDMedZK0RwUOf75B8jDirzZ khcTzQWVwzsJiBBMWFwrz/41H0mkJCEzq9OMBgd7iPqsrw8U0SVnN4DtjFPQMik8KK7dsV qjkC5qx05lfl7Dy01mG3sfAqWBop81Y= Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=QhD7Fvbc; dmarc=none; spf=pass (imf04.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.218.51 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: wu44za9nbpypo3hbkmo7chke88fgeuow X-Rspamd-Queue-Id: 89E0940008 X-HE-Tag: 1656966318-4894 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jul 4, 2022 at 12:55 PM Al Viro wrote: > > You are checking the wrong thing here. It's really about mount_lock - > ->d_seq is *not* bumped when we or attach in some namespace. I think we're talking past each other. Yes, we need to check the mount sequence lock too, because we're doing that mount traversal. But I think we *also* need to check the dentry sequence count, because the dentry itself could have been moved to another parent. The two are entirely independent, aren't they? And the dentry sequence point check should go along with the "we're now updating the sequence point from the old dentry to the new". The mount point check should go around the "check dentry mount point", but it's a separate issue from the whole "we are now jumping to a different dentry, we should check that the previous dentry hasn't changed". Linus