Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp929321yba; Sun, 31 Mar 2019 17:26:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvZ3BVbm/Lf08ecLm8c3Jg9+035c4SGezeHF6jfqrYvEZ0vnRoZ5nJMBdB42Uf/Fwl2de8 X-Received: by 2002:a63:df12:: with SMTP id u18mr57188223pgg.135.1554078396881; Sun, 31 Mar 2019 17:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554078396; cv=none; d=google.com; s=arc-20160816; b=eqnWGjT/2Ojp5M18owAKsQ2ydtPaUrH5ppIneBG3p+tnd4k36zE0wvNMl0H8iA3FR4 UoUAlvFD9HPY/gCgkbq8f0tA99XRgqlS+RZFTH+UD49onxJe9XpoyG8wJUMkGEHsSd68 d4/7VuMwCFnR+tD5m+784kTeWN0DE2rj74VEPadiMCBEoekytFYcePoq//SD+KNJzjKp PAlltw9YLlaSNOjNrU1oOM6HXYyMBvbqB2BXEJIgx2vvOGktkYgMsMvqWSYukwYT1S83 N/0McKOxVO/NEYj7GBeYdar5qZXcnz54ATTmA9s5g1bMcvwyZJDnHVzmOkK3kycXmBV6 4GNw== 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=CgOzCwH/SJ7qK2581G3q02wSm71bzzx5pKRzupg3V7Q=; b=UhtC/uSYQyp/mLRYZJvkGiUuBq8lmrfBv5QSEf0lSIl3ZWTdxS+2aBOt/5Mk7t+C7N pRvJpdh2ngUFq2aBcuaLVZzS66fnmFwkujQTh+fFvm3UlkLeFW9jxr7zm7DJXiw8nmvx gvONRh4EHguA5KwEI2e5QzUBRrxf8TD/j1Fr6+iFBYjH3PScdcJz2k6UkOSPCY0iKogy y0VCEpDP89pWQDxs3ihfPz6gQAsiFWr1GjqbnWITyw2Nz+/TYkePNKEg3fylN8Cy5jIJ ZeLudmdPVcWWGbd5bgiW7K5HzgKjDPNdKx0/6L+guLMR2XkK1Hlqo7hJpY2GLxLQiKCH 4xlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Qje35hWW; 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.26.21; Sun, 31 Mar 2019 17:26:36 -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=@linux-foundation.org header.s=google header.b=Qje35hWW; 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 S1731597AbfDAAZr (ORCPT + 99 others); Sun, 31 Mar 2019 20:25:47 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:40134 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731421AbfDAAZr (ORCPT ); Sun, 31 Mar 2019 20:25:47 -0400 Received: by mail-lj1-f194.google.com with SMTP id q66so6458098ljq.7 for ; Sun, 31 Mar 2019 17:25:45 -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=CgOzCwH/SJ7qK2581G3q02wSm71bzzx5pKRzupg3V7Q=; b=Qje35hWW/Cxw0pQE0rus6V9YXVEDHnfyXSVeOG0YG9QkZoi+9esE8tdOFKqvmBVY2f N8HqJXGUN/BMhWIklF2IYG3ORFWpjku5CeBYDigwwOxMgrJs+YRgPFd5OlHsBodWnJ+N fgyE+9dG+U6cOZvGFktFDMPpaUbBawYAYkmiU= 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=CgOzCwH/SJ7qK2581G3q02wSm71bzzx5pKRzupg3V7Q=; b=P46JTTC5AlIaRCxkxBGxl6ysIeu4wKAXJNptpVQ8uqNF3hR9sa3aJYcKO5UKlqnfFR yPM+3DpsPRMdphN00LzezMymchXw5hXEeVFCRXXTLdrouWRKqqya9xvXTrRzufrlfenF 87lzMWA9ojRA9kDTk3AMFctbYjsENjhlk4ASHmfjgAq/yS9qWIVRrSiVbCki7TMMqlK9 Q7DVDZynsFtqT2GPNBTlH4if2LFxWsVjP/zd2odGrJGhMx8Qu/xBcN12ADwJH2XgBN+t emqBZq8cvZFrmlJl6p+3kuKDDk8iyQ9Hv6JXhDheMpMXtbK6bafRDmnmWc6BuMXEMGk/ jwyw== X-Gm-Message-State: APjAAAUJSNQXbFiiCrnHkvxibBz2uQgNTR6bYvJXBxs6hzdj/76xba+F 2Pj6b0CCbXIdjsbt0u7cwSjqs46wBck= X-Received: by 2002:a2e:711a:: with SMTP id m26mr33322685ljc.40.1554078344668; Sun, 31 Mar 2019 17:25:44 -0700 (PDT) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id e5sm1731432lja.96.2019.03.31.17.25.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Mar 2019 17:25:44 -0700 (PDT) Received: by mail-lj1-f180.google.com with SMTP id q66so6458081ljq.7 for ; Sun, 31 Mar 2019 17:25:44 -0700 (PDT) X-Received: by 2002:a2e:22c4:: with SMTP id i187mr24151086lji.94.1554077907148; Sun, 31 Mar 2019 17:18:27 -0700 (PDT) MIME-Version: 1.0 References: <20190330171215.3yrfxwodstmgzmxy@brauner.io> <132107F4-F56B-4D6E-9E00-A6F7C092E6BD@amacapital.net> <20190331211041.vht7dnqg4e4bilr2@brauner.io> <20190331220259.qntxynluk765hpnt@brauner.io> <20190401000937.GG2217@ZenIV.linux.org.uk> In-Reply-To: <20190401000937.GG2217@ZenIV.linux.org.uk> From: Linus Torvalds Date: Sun, 31 Mar 2019 17:18:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/5] pid: add pidfd_open() To: Al Viro Cc: Christian Brauner , 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 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 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. > Al, back to normal life and digging through several flamefests from > hell... Yeah, I would like to see the actual aio.c pull request and the use-after-free fixes. All the patches look fine, I just don't have the final end result.. And that takes precedence anyway. Right now the "open_pidfd()" is a future discussion. Linus