Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp520577imw; Mon, 4 Jul 2022 14:06:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vl8dcmsJWrJX5V3Ag+srz3H7n9meQQIs3jxiUoNF8HbKWH2Zu5lM9eBIxke7PPib5ll1Qu X-Received: by 2002:a17:902:f546:b0:16b:e4c7:671b with SMTP id h6-20020a170902f54600b0016be4c7671bmr6984603plf.129.1656968796011; Mon, 04 Jul 2022 14:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656968796; cv=none; d=google.com; s=arc-20160816; b=PHR/ZEyKxzMZOOR4wiqVSLTv+lxNr+j/Sx1SSZ917pk5CRdK9pU9kIcdm9X2TAdz0g zugOm/r1BFEBMJRRvp4+mNpdmMkjJvSynTJjwAwMVEM5462HxbbmvWfxDkexcHqCWNU1 t5p++lIc2O13ri3ZbxFJIZpcw2QYzg8+yf1jvq2mpUizzp38POuSVl8zjN1IqC9KBI1d GnxJyPHlch/mzl3b7hjUhQbehOWTI8BXuerO/loCmOiB05m6mIgkqPjs2udocg6Q7VWM ICA94HiRwGKOxE5QgYBPG9xzVjGlpfO025Vr4oaWUkhsxkb4FkZdM2dIs7rYOKIYPMFw gI7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/yAZeAbMlA0MlzGxn2hN3/XK5qxO5T7qF19l5UEr4Zc=; b=Jx33DjfuWy9FRDtPDeToGNP/iL/fxS2Aa1mPce0XG/gZvFSN7ZVcioSRASfNpu/fOG XrR93ZLcTG/ZOFlJPDV40pyhTPJzTXUdAo9AyZ6AaEazLJvecp8j3Pl6UQD400yvGoVf 5lkpH4ubbWg2lpm/IhIBhXPl4jOlw8/7rsOC/t79z3Nb/iTe7Bz+ZFQmUoB6ZAIi6rgf lzVOluiLaiumM6DV83c4XiJbCXyjl1yfc0Dw/0eEDh2ONa0/fqgRiftpmLwbrWxLpxkA AdbFzMamAW0lM5g5tF7EttkWJyhu4M7GFAMC7m4wUYWm/mfWwwruR7obeDF0Q2OPS2+4 UtkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=W2hmMHZI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc19-20020a656d93000000b0040d5ab9fe24si45090313pgb.429.2022.07.04.14.06.23; Mon, 04 Jul 2022 14:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=W2hmMHZI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233565AbiGDUsX (ORCPT + 99 others); Mon, 4 Jul 2022 16:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbiGDUsU (ORCPT ); Mon, 4 Jul 2022 16:48:20 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 632A3DE91 for ; Mon, 4 Jul 2022 13:48:19 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id r9so12245286ljp.9 for ; Mon, 04 Jul 2022 13:48:19 -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=/yAZeAbMlA0MlzGxn2hN3/XK5qxO5T7qF19l5UEr4Zc=; b=W2hmMHZIlVX17hX5ZnI6HTuqm3ZJ5p54D5d8aHf5QuKGwRZw6Y8EIH14PLiK5scdIY S9pthMsINqNnHDQkpKpYyIuOQlL07OnPavYF6D5xWccffjl/XEumDJl0Z3l2tdCrOtCA Dnuf6bnFzN/s3d72H3m8z7XBSeLvJTx0CJSdg= 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=/yAZeAbMlA0MlzGxn2hN3/XK5qxO5T7qF19l5UEr4Zc=; b=XqV0CxvjrG1mmrLHZ7mlH0pgNIaGGrfnln4Zwfah/HphnfBXZq1pdzPOOZBWFsBTDz DzGIfR4lS+5sEEFQG5ULIFrgkUGHhNwUDMIMo9dt4sUZUn1FkluKgXfsu5SojyKuIgIm hZ2HniRB/GQxr4eubymbcG4zCeKA59yRFl+nDEjT5KfdzCpwuiJOavb2MkcV5ZhC2K+b QFm64SE8or3MrxlHwoQkVEIReDgzrYnE9mn+eA/5n6LKf7nmMLIBfCCtNebPjLQa1s+1 f9OGGl/f93BpEvGGJconQZtg1TtpOVIR20mg1XKpMMufbbwLdthUBBD8U5Zw0QmZWCIb uRaw== X-Gm-Message-State: AJIora/7F8PfWlKZ6QpNpWqYsyL/OQXgBvMpb7O0yxZ+Oz7+BrUO53vo NVfbL57ok1Rt33njvQWNu5XwOl0e0UsX5uj58+E= X-Received: by 2002:a05:651c:101:b0:250:896d:f870 with SMTP id a1-20020a05651c010100b00250896df870mr18184626ljb.235.1656967697467; Mon, 04 Jul 2022 13:48:17 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id z11-20020a056512370b00b0047f8de9e6absm955712lfr.115.2022.07.04.13.48.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jul 2022 13:48:16 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id b23so12259825ljh.7 for ; Mon, 04 Jul 2022 13:48:16 -0700 (PDT) X-Received: by 2002:a5d:59a5:0:b0:21d:205b:3c5b with SMTP id p5-20020a5d59a5000000b0021d205b3c5bmr28828449wrr.97.1656967686356; Mon, 04 Jul 2022 13:48:06 -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:47:50 -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" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 4, 2022 at 1:24 PM Linus Torvalds wrote: > > 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". Maybe it doesn't really matter, because we never actually end up dereferencing the previous dentry (exactly since we're following the mount point on it). It feels like the sequence point checks are basically tied to the "we're looking at the inode that the dentry pointed to", and because the mount-point traversal doesn't need to look at the inode, the sequence point check also isn't done. But it feels wrong to traverse a dentry under RCU - even if we don't then look at the inode itself - without having verified that the dentry is still valid. Yes, the d_seq lock protects against the inode going away (aka "unlink()") and that cannot happen when it's a mount-point. But it _also_ ends up changing for __d_move() when the name of the dentry changes. And I think that name change is relevant even to "look up a mount point", exactly because we used that name to look up the dentry in the first place, so if the name is changing, we shouldn't traverse that mount point. But I may have just confused myself terminally here. Linus