Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2617609ybb; Sat, 30 Mar 2019 09:19:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwjwMvNEGBv9ylYdajmxvBVcidTY0D+G9ew5D+lYs0j49QPLY0NA41a+TALF+9iF7vo8ps X-Received: by 2002:a63:3185:: with SMTP id x127mr51678926pgx.299.1553962764313; Sat, 30 Mar 2019 09:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553962764; cv=none; d=google.com; s=arc-20160816; b=k06/iy98hTJnGM9tgkmISz1F+9OSkd1a1/ZgZi5/Z8O8TOF+vuadK0bK1h+SeSfVvq NNhsj+bdqIXMmW2NQWQyF3g10hxWdMjvXfJ5h2BNOmC0o5EqAe9gvP6dCnyCszilxI0a ToI9w7jarGlzDakiq+xI+ZrZDxuCnO8NYyywdnGCsww/REt68xFlLgHAGZq9QLR/wJ0A RjrawZ+hWM+h6Y/2pUhaTSLNCM9JjpA4GTUMM8ozWYnmogi3rxUVTTXEAT8tTxUK1Orf VSmiWp/ZGWHljcVVWkIy+nvEMGL3RjzfcAJnUDJN4KyFz59Q9LuPen91dlmOuiGCjeAo hDLA== 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=X9Q5EM7FJZ8qECdEOjmqySeDC40RA5f9xl6j61uK/Ow=; b=CWKVSTshuvmniroR5VSAW//iFOeTQc3icO4FMZVQS6fPqG6epMN73u5aaw6OMBM2fd 5kvvgNVFfaj3JGhcyzFwg6HId+xzxpeyEwGHdaKnUx+tXCiwA6xyXrUw5mDy48PcdsKR 45DmIEOWVCGsp3zNViWGlWj0GbanoHkOrSU3nyRAgTDPmbjNTa99NG2YN9S81AA4jNWg hDxtm0VCiXz6Z1+cuMyPW8ek6RRwAGHv986TWZBoM157lwCjAdotI1Dpsbyd3Tft0kND 3HiueJfLWibcVx4ARcQ2IMyOp/4PE7nIQGckuzm472qijv/1H4S/wO4wm3xz+/V43Xtm 0I2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=V9F2JHO1; 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 z11si4877385pgc.145.2019.03.30.09.19.08; Sat, 30 Mar 2019 09:19:24 -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=V9F2JHO1; 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 S1730986AbfC3QRH (ORCPT + 99 others); Sat, 30 Mar 2019 12:17:07 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:39486 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730742AbfC3QRH (ORCPT ); Sat, 30 Mar 2019 12:17:07 -0400 Received: by mail-lj1-f195.google.com with SMTP id l7so4504537ljg.6 for ; Sat, 30 Mar 2019 09:17:05 -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=X9Q5EM7FJZ8qECdEOjmqySeDC40RA5f9xl6j61uK/Ow=; b=V9F2JHO1K3LzzF5pbpCBVQsUlNP1D6GHYIBZINelXujGiD+qUH/aUTcyMQhCYJPWF/ Wp8H+ClPcE+PICvD0SloFHz2V5s0H76v6+baiKYupHHsb72tOb9V9lU/45Q/lee0rR2b krDqMGkzC6jUctn18Wxw7l+2TMRhTaU9eAOYw= 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=X9Q5EM7FJZ8qECdEOjmqySeDC40RA5f9xl6j61uK/Ow=; b=cgZJDVSdjMLamsWnvY/SUhlpR09cMdspvjNKOmley3h6oTnhh+3nJZu+6QHNKJoKeD sRsc+jPYt3adnJLutMETRNZNY+/AGf1xdJA6ueZDASRXRkisn4FkoKZ09cV9xoyyjQIC qCD+YpHdl4r3Xrvcf1CKp2NjoDIEAr1HsuA7ky8SDTEansjqpWbueZMZqaB12cReHLUG z6HtCEK+CJsfaqfS/hUx44HDUR97hSbLlMsx7mEITFM3firZyxr6s9wwX0isg7lnOU7Z zFlx0PwgIlXFz7qK9VsFZlZLJGn+SvQZtIAqjrIQfBFapbxedeQiEiOMSEbvUYxLanX5 R+bQ== X-Gm-Message-State: APjAAAWCNayjjNeKpzVwySXaHWxeq5TgS3xzpYdS4pQwhmjjYNfqeOos CVSLp82yMR6qquDg+H6jODYFRFnT3rE= X-Received: by 2002:a2e:9e47:: with SMTP id g7mr5811364ljk.48.1553962624852; Sat, 30 Mar 2019 09:17:04 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id r27sm889496lfn.87.2019.03.30.09.17.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2019 09:17:02 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id b7so3435946lfg.9 for ; Sat, 30 Mar 2019 09:17:02 -0700 (PDT) X-Received: by 2002:ac2:4354:: with SMTP id o20mr14930297lfl.62.1553962621816; Sat, 30 Mar 2019 09:17:01 -0700 (PDT) MIME-Version: 1.0 References: <20190329155425.26059-1-christian@brauner.io> In-Reply-To: From: Linus Torvalds Date: Sat, 30 Mar 2019 09:16:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/5] pid: add pidfd_open() To: Daniel Colascione Cc: Christian Brauner , 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 , Al Viro , 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 Sat, Mar 30, 2019 at 9:11 AM Daniel Colascione wrote: > > How do you propose that someone open the /proc//status file in a > race-free manner starting with the result of calling pidfd_open? CXhrist. If you want to open a /proc file, then open a /proc file. Don't use pidfd_open(). Just open /proc// Then you can use openat() to open whatever sub-files you want. You have two choices: either you use /proc, or you don't. Don't mix the two. And no, we are *NOT* making pidfd_open() into some "let's expose /proc even when it's not mounted" horror. Seriously. That's disgusting, wrong, insecure and stupid. Linus