Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp870839yba; Sun, 31 Mar 2019 15:35:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwp6NYwNQVOz85nXoUEFTq6FCnZqxsLCUhFOstqCT5v6icdsAXi5IGuj8N0/tNUcQ8xXzbc X-Received: by 2002:a17:902:988e:: with SMTP id s14mr48442493plp.167.1554071720251; Sun, 31 Mar 2019 15:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554071720; cv=none; d=google.com; s=arc-20160816; b=lcHoh1vmayxT9qsBdja78Vv4WH/7TLsWF417ynv5iyCo20iRjehT5HaBrre7LB1Jbz yIUfJRQ1+w3vHyjet/gMwuzgIjQ+pf866/QXiPRFWJ1WryHESVdmvMY11aX3dWmFZUmW ESPQ9fFz1lEdnOVBqDFZpuVAr2NzjEREDxCSjTAJPbLOKPDukfqxullv9Ki/Br7svFL2 IGtA8pko3Hg9C8ihSLSeMelrkTlklo7aUJpKSTDiRMKEfQ40fhWOqey+FTcCtxBeWksA rOp/DWGK10ioeOncJEdzkShaINB/S3XDu8tZYORwGH8neGEngqOPTZ4J++rZPZY9xveC oVDw== 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=LGHPCkilx8rq8Do6cGLs4RYJVLdG3bSlxpBgseCpd8I=; b=ZmrGLV333advZSu6vq14lXsoAfTQTLPJQ2DDucOdUZJ7GKHqn24358zzoEwBawAdtD PcFjoF44LF6oWDgxO35/H2Oe94wd8lX91QTKKMhZByu4YArZyTaWSXHeNRNyW/9Cc0FL QZXDfwpNtSlvDm4COJtuybgb6YsoL3YQRk9aWlxOI/wS448Qp4YSMGLmgUvoXg1GdkMT z/W+Cg8s8ndXcFwUpV38YC8/ppRrve1a1ynxcWGiUkLE7M2i7YMP05x37kvGbBYPvNuD AuYaYI2OmG8uX/vXDK2AMLOzChkpZOnffibf3Lx1N9QGr57kvTx2NJ7/NUnzmzhqXxHo dAlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b="ZoX/Sfis"; 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 z4si7337586plo.166.2019.03.31.15.34.56; Sun, 31 Mar 2019 15:35:20 -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="ZoX/Sfis"; 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 S1731421AbfCaWeA (ORCPT + 99 others); Sun, 31 Mar 2019 18:34:00 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:40104 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731172AbfCaWd7 (ORCPT ); Sun, 31 Mar 2019 18:33:59 -0400 Received: by mail-ed1-f67.google.com with SMTP id h22so6503987edw.7 for ; Sun, 31 Mar 2019 15:33:58 -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=LGHPCkilx8rq8Do6cGLs4RYJVLdG3bSlxpBgseCpd8I=; b=ZoX/SfisD4/HKwjammMPZCDtCXxAdSknWeCk8cMTqiAAejMReVW01NWZ7QLMvqydM0 NGX4JQsqT4JJ+1dvro2NM6z2UD1p/Is9yuLy/xHw5cs5W4hU8UZWl4MhdidXJbGLkUbV DEbbAX95j1wY8fT73Rh/5u3gD5lFkSQwzo5f19m87IhMd2FaHVT41O85kIH/LVRGSm6k pQ6uiqFi5I55Sd9wQFY8J3dVSnVFRJMzrjG9BUE5/F8AD5B/yLSXyDZoK72h95SlCFQ9 t6wF9PMzCchmV76fzZ14CXa0rNm1HzQ9gkXnx9dc9STPbt/wKxH2SlRN+5VA+ne+2eN7 h/Xw== 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=LGHPCkilx8rq8Do6cGLs4RYJVLdG3bSlxpBgseCpd8I=; b=iCfE6ayKyjszOEU6C4okZlz5+Wk88i8Xz3WDoy2Hf3N1JJfEkvvQgRPNTf0huMMyYR SuMwjTb1fi3NWtYUPVtOvaiWbhNuJ5zomu6wCIgqyA+rCm5JDP7bkMnCY+EgG/BbMlNR 23z2MxId7uL+ZYEv7uypfZpHi26HV7P8IaaYxcAvhaI+OuiggX6NXePc8E2+Qw9QPWqK e/ub16ZB1RYQXrSsQZ8YGm35HHzDCk8yI2oXROIZQMthAotLoleTAfaVsIE4TYdBfDIs 1u7iVYdCVzO0dTefRXz4jDQz7xff2Or1gYCdLIaUlYfRKDtO7qczjmvILoell+mlUQvE 6Enw== X-Gm-Message-State: APjAAAUuCoGPA1QEBe/Xy4l1cr+wcpvgxfknPhV6yAnwctYSqBahG5+l KlKC5B7K7NoNLG4ffqJyuK4igg== X-Received: by 2002:a50:a704:: with SMTP id h4mr30969652edc.7.1554071637990; Sun, 31 Mar 2019 15:33:57 -0700 (PDT) Received: from brauner.io ([2a02:8109:b6bf:d24a:b136:35b0:7c8c:280a]) by smtp.gmail.com with ESMTPSA id 21sm1532774ejj.75.2019.03.31.15.33.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 31 Mar 2019 15:33:57 -0700 (PDT) Date: Mon, 1 Apr 2019 00:33:56 +0200 From: Christian Brauner To: Linus Torvalds Cc: 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 , Al Viro , Joel Fernandes Subject: Re: [PATCH v2 0/5] pid: add pidfd_open() Message-ID: <20190331223355.vfbnnkmevl63etvv@brauner.io> References: <20190330171215.3yrfxwodstmgzmxy@brauner.io> <132107F4-F56B-4D6E-9E00-A6F7C092E6BD@amacapital.net> <20190331211041.vht7dnqg4e4bilr2@brauner.io> <20190331220259.qntxynluk765hpnt@brauner.io> 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 03:16:47PM -0700, Linus Torvalds wrote: > On Sun, Mar 31, 2019 at 3:03 PM Christian Brauner wrote: > > > > Thanks for the input. The problem Jann and I saw with this is that it > > would be awkward to have the kernel open a file in some procfs instance, > > since then userspace would have to specify which procfs instance the fd > > should come from. > > I would actually suggest we just make the rules be that the > pidfd_open() always return the internal /proc entry regardless of any > mount-point (or any "hidepid") but also suggest that exactly *because* > it gives you visibility into the target pid, you'd basically require > the strictest kind of control of the process you're trying to get the > pidfd of. > > Ie likely something along the lines of > > ptrace_may_access(task, PTRACE_MODE_ATTACH_REALCREDS) I can live with that but I would like to hear what Jann thinks too if that's ok. Christian