Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp927374yba; Sun, 31 Mar 2019 17:22:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3uWfDmyryxD+GlQIG//pQWZfimzsXCvysFwzlIfcoidN3zF4mxjuPdAVI30IOXa6ML6If X-Received: by 2002:a65:664d:: with SMTP id z13mr57419879pgv.389.1554078175999; Sun, 31 Mar 2019 17:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554078175; cv=none; d=google.com; s=arc-20160816; b=TqpKBc/F84f/D0uNTB5IChGdkGl6bg/r3njqsmcJ5G83sRRDdRfsgWov1PMjZzumpO BAvBwCkegNjcCFCqxqBmqCyTV9WCpyOArt6dtx5i5AbiPHog8Jl3dXwLo0cUlf8W5PQb Ey2AnBGwlfbzTFXSv6mUgmdI8mjKeEjMvptv8TERy85dqYSsA47OvxlS+zdVir7NOO6m +XCrQp2SqtUD8QGsWCZkLValC2rycaFVycR9UcpfA2vWb9LnasnETqCxKyuBX1kfHygh 2hU/TP3Wb9SIzSYbKTcbn471859/5mNSPFuyXLvHrMwDs94XvBZyquI9eZw9/J656w1S k/nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ugy64g5lxShNCgeI0XnKEHlsnAUFZXdH1UZzqRa7A5o=; b=lXw1uVpyd6HEjNBZC28POqWcqYFRyerj6lf4MWsMKUYoJ6CSv61bos4ddPbLPyzMKX dc14Mfxh41g4NwLUQfRfeWLOaYrGK43MAAKldNZNWhRs+kGPIK7SVAUy9cHxmdNrkmtN TYW7TDSYlXZ3dLv6VGhIhcHBqyU5vLCqgGcvNJb+lsxKFt00SoKCcOR41CxPX5OqxTAD 0NISFdY8RTGIbOkvpCWzlXw7g1B/1fQmaRW4yACeXcLU4m7U/CuZ9ZNeeKSnVaWnX0w4 AyM2t3MYkqPWaocYiiB/8JfwxCxZtta0M33lvAA8J2jGFFzKWTnOfut3azelWiXw8IYe /U8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=S3b9JyR0; 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 p3si6707175pld.76.2019.03.31.17.22.39; Sun, 31 Mar 2019 17:22:55 -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=@brauner.io header.s=google header.b=S3b9JyR0; 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 S1731602AbfDAAVy (ORCPT + 99 others); Sun, 31 Mar 2019 20:21:54 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:34444 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731554AbfDAAVx (ORCPT ); Sun, 31 Mar 2019 20:21:53 -0400 Received: by mail-ed1-f65.google.com with SMTP id x14so6645083eds.1 for ; Sun, 31 Mar 2019 17:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ugy64g5lxShNCgeI0XnKEHlsnAUFZXdH1UZzqRa7A5o=; b=S3b9JyR01XiCMlwAd/iDyqOU89cpGBuJrSVP78dj4/kzgPtB+jCFmHME8GMjb5ohWC X5v0ovtfFrh61KSo+WSohRcRv3K79/NdbDAtJQe4Uk/Dfn6VYQ2+nS6Y5L1G1sgF6i+z yIhULSPqkEO+C5QoGfuzFilePizaLghasLX7cNZFUuCvvnUw3UmFGrUtPZd8Zv/CUd1Y v08zjaY3AM4AkofEEHp+yEBBeU+uSq4lxLulgT1EWESky97N7eGSPHtx4ZJGCYfM3fH1 Zql2pmKPu5eQfYb9WOWb8staxub25Imd45S5YCCUS89jiPI9U7s/DZdvrK6wQwiw9b/p 8VXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ugy64g5lxShNCgeI0XnKEHlsnAUFZXdH1UZzqRa7A5o=; b=N9Dy8g9Zb0+QAfxIRzl5ypRHcGeZ/yXl3bZbvj6Ud0F5NqxOl8zexL2M+abBdAlKVh YALc4SocOoFXtTF9FaebqmFFeqhPUsSLy5MNvuQR7LUnijTRLNbu8e0Yyz9pPOcNtoqW mgamCSv5jTYsnjn03FzNOe/5aYpakvOwouv7Apfv+W8k+lyYQSjnv94iQSjST5RNfPMD An11L67aCuUlTXPoi6k3v2zrW22HoB/EOvVFA6SZnTmpc0cRU2bfqg4kqFz18PXqrmgi rKNn1fTIZ0Q81Iv9hP86hF4uHJJQ1s0hEABNkj0Guoq2MQiVfJ3mlHLiFwTthoO/V6h2 6vFw== X-Gm-Message-State: APjAAAUqGSCRYEbGsh2nwVCHZ5puhQLf4WkRVJ8E/jLYEbHPjiHEkwvt UEQIRovim54edaqee8G+GPZTaQ== X-Received: by 2002:aa7:d146:: with SMTP id r6mr40068006edo.235.1554078111993; Sun, 31 Mar 2019 17:21:51 -0700 (PDT) Received: from brauner.io ([2a02:8109:b6bf:d24a:b136:35b0:7c8c:280a]) by smtp.gmail.com with ESMTPSA id x54sm2716027edd.35.2019.03.31.17.21.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 31 Mar 2019 17:21:51 -0700 (PDT) Date: Mon, 1 Apr 2019 02:21:49 +0200 From: Christian Brauner To: Linus Torvalds Cc: Al Viro , Andy Lutomirski , Daniel Colascione , Jann Horn , Andrew Lutomirski , David Howells , "Serge E. Hallyn" , Linux API , Linux List Kernel Mailing , Arnd Bergmann , "Eric W. Biederman" , Konstantin Khlebnikov , Kees Cook , Alexey Dobriyan , Thomas Gleixner , Michael Kerrisk-manpages , Jonathan Kowalski , "Dmitry V. Levin" , Andrew Morton , Oleg Nesterov , Nagarathnam Muthusamy , Aleksa Sarai , Joel Fernandes Subject: Re: [PATCH v2 0/5] pid: add pidfd_open() Message-ID: <20190401002147.vv23md5spi34uyjz@brauner.io> References: <132107F4-F56B-4D6E-9E00-A6F7C092E6BD@amacapital.net> <20190331211041.vht7dnqg4e4bilr2@brauner.io> <20190331220259.qntxynluk765hpnt@brauner.io> <20190401000937.GG2217@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 31, 2019 at 05:18:10PM -0700, Linus Torvalds wrote: > On Sun, Mar 31, 2019 at 5:09 PM Al Viro wrote: > > > > Ugh... Which vfsmount would you have to go with it? > > I'd literally just do a lookup of "/proc" in the current root > directory in the lookup() function for that special pseudo-dentry. > > If it's not mounted, or not a /proc filesystem, screw it. > > > Except that we never let unattached _directory_ dentries out - if > > we can't reattach them to the tree, open-by-handle will tell you to > > take a hike. > > Absolutely. Which is why I said it's _conceptually_ similar to the alias lookup. > > And I suspect we can even use some of the same practical logic, but > it's definitely not _exactly_ the same. This thing very much involves > magic hooking into the lookup() function (but we then have to look up > the alias not for the path we're looking up, but for the _parent_ > we're looking that path up in, which is very different from the normal > case). > > > It's more than a tiny bit too clever for mine... > > Fair enough. The whole "just do the whole lookup at pidfd creation > time" is certainly a whole lot simpler. Even just from a pure maintenance perspective this sounds a better to me.