Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6456719ybv; Wed, 12 Feb 2020 12:35:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyicICeY+e5CNuRnpBSzsc26rJ2CGiLqvxKKkZKuvzuD/2HXFPfGygzIy7MZ9AhZw7CsCMn X-Received: by 2002:a9d:6e98:: with SMTP id a24mr10346053otr.53.1581539748459; Wed, 12 Feb 2020 12:35:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581539748; cv=none; d=google.com; s=arc-20160816; b=o1L3E4/2cd0jPBxmk1aK+jClGSv8PSj0r3tOhWzlS5sxGIFjtPQapz8I6TaNRsZsS5 7du+efAflQY4YPCoeByfuCBKAWrBf4Rg8GKnkt5X398cF7/WGNm970QgaXZ27Z4Mll/s DcKBdk84JabSSdw3kHRKDsxE6yShTPtggXjrtmgaAdoriYDmYSEZP0gXh5WN6XHCsrR2 aIuyMxcETSjPiVgFzvXM3xrppoDr4xRcsZK9qvM9tmIs+qTEahZ1aQw+Ohlab+UOOF2z fiFEs+/YvICWm4hbvRrkWF5SrWFCNrktsmjvHXr+/+GRxTFGnYBMrFICbkgRRCb3OsA0 HGuQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=bqyVLATGO6MwZ1NPxpHKDD7nGLBCP8OMxbpMcz0c8xI=; b=W5tF69ZtPXHYQvN1Wu0mSlW8osyP5im7BwPxObpoWIProgPhmlwspQYLZjLRSIclUy 13tPgG+CCEPzhWR/4AMtCO0ch0C8CSUcTWyx1T6wOZB0QCQ2M3qXxzICLVPxolIEcK8k xJhJbAkcaSXJUiyVCiA7e5WAyG2yuhnGc5VBkshCoZBqv4JM+NRWZ3EiO3aebLo7uUBm Xcgff1ZNkiZKC/fkf8skNvr2ON6+AQQY9WE6n7GBD92P8c+acT4E1sCaAS4zoXkiwcv4 cxbNYyaoFce6mTO2lOeBv30Sxdfz5aqqJBRDoa2cJrmgP1ofDZMuI4+jTtAJXhdfQ8Th 0coQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=IgiKGasr; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si829967oti.301.2020.02.12.12.35.35; Wed, 12 Feb 2020 12:35:48 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=IgiKGasr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728794AbgBLUfZ (ORCPT + 99 others); Wed, 12 Feb 2020 15:35:25 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:38712 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727947AbgBLUfZ (ORCPT ); Wed, 12 Feb 2020 15:35:25 -0500 Received: by mail-lf1-f68.google.com with SMTP id r14so2564175lfm.5 for ; Wed, 12 Feb 2020 12:35:23 -0800 (PST) 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=bqyVLATGO6MwZ1NPxpHKDD7nGLBCP8OMxbpMcz0c8xI=; b=IgiKGasrvpx5KEqTjK3uSOaiUPZJr6oQaxEeiUKRSC7Mzut+kfrtuMYf7JfgJYo2j9 r6YHIpl0Oomh/U1TMzjQtQYQDvEFopln06zrn/G9JdYxAN1cr+G4MM7V+yIgIdgHmkT5 mB2IAKAHrGr3Dq04+09yh6iga9CCs4Dv6Lzfk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bqyVLATGO6MwZ1NPxpHKDD7nGLBCP8OMxbpMcz0c8xI=; b=JIJcpfrA5BmzCoLAJpp00QHs4MnAYbYOgN05U9e8xkaAigXdja0xkCdGrWQb9uZVPn 4s06/Hgkb10BpwnAW/0hUBrwVQH1nLh/3csOzLEEw71YLja23xir6GMY9gdyM3WU0bkb nsK0Srr0JOE2LKfgW6AV9Qn09Xvz6g3O2JBAKbAKTlLZwaSbFh16ZkEhO9poCi//Ory8 fP1gd0u218tcoKt5kmVoJiEZkWxKAUjvLsLtUfa+8hILGIZG6s5iKlhjj16vgDivCMEA Ohn2En6meM0xtiekiOb/KWYciLfCIx6He3Q8L5ztOE+NnruZ47X2b8zbLzxg0xNtYWn5 3A+w== X-Gm-Message-State: APjAAAWfUTabrSFQo1Jm6hJRpN92rl7S39vFlbxgdtIGdTq/USYb8Rjw njrJDKjdwmrR35w71enBBY2bRfZtSmc= X-Received: by 2002:a19:f812:: with SMTP id a18mr538490lff.0.1581539722473; Wed, 12 Feb 2020 12:35:22 -0800 (PST) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id 4sm96905lfj.75.2020.02.12.12.35.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Feb 2020 12:35:21 -0800 (PST) Received: by mail-lj1-f175.google.com with SMTP id o15so3909435ljg.6 for ; Wed, 12 Feb 2020 12:35:21 -0800 (PST) X-Received: by 2002:a2e:9d92:: with SMTP id c18mr9321452ljj.265.1581539720898; Wed, 12 Feb 2020 12:35:20 -0800 (PST) MIME-Version: 1.0 References: <20200210150519.538333-1-gladkov.alexey@gmail.com> <20200210150519.538333-8-gladkov.alexey@gmail.com> <87v9odlxbr.fsf@x220.int.ebiederm.org> <20200212144921.sykucj4mekcziicz@comp-core-i7-2640m-0182e6> <87tv3vkg1a.fsf@x220.int.ebiederm.org> <87v9obipk9.fsf@x220.int.ebiederm.org> <20200212200335.GO23230@ZenIV.linux.org.uk> In-Reply-To: <20200212200335.GO23230@ZenIV.linux.org.uk> From: Linus Torvalds Date: Wed, 12 Feb 2020 12:35:04 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 07/11] proc: flush task dcache entries from all procfs instances To: Al Viro Cc: "Eric W. Biederman" , LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Oleg Nesterov , Solar Designer 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, Feb 12, 2020 at 12:03 PM Al Viro wrote: > > What's to prevent racing with fs shutdown while you are doing the second part? I was thinking that only the proc_flush_task() code would do this. And that holds a ref to the vfsmount through upid->ns. So I wasn't suggesting doing this in general - just splitting up the implementation of d_invalidate() so that proc_flush_task_mnt() could delay the complex part to after having traversed the RCU-protected list. But hey - I missed this part of the problem originally, so maybe I'm just missing something else this time. Wouldn't be the first time. Linus