Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5692090img; Wed, 27 Mar 2019 13:18:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd+HJovvOb6+3lm2LoZzkHS5a1XoyEtqbKpVfPtL+Vb04IPqkpR9pFGjHeoL5+0hb8NZJY X-Received: by 2002:a63:ef09:: with SMTP id u9mr12989535pgh.126.1553717915416; Wed, 27 Mar 2019 13:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553717915; cv=none; d=google.com; s=arc-20160816; b=X8umYkigNgi6+pmEwyHIl/G37IEGFyKl+MaKvpaULgQ96RLLbtlSaxPS/U1H91+a+H OQPTOUBuux4FStkVlpQxxk4p1BxSrVjQC8JP7Uy1+PejCLXTbKAiUjW5rKvz9Dn/fNnF ckABQEsp9WCf+Gya4wFyIxO3aRdi0CJX962xrWYL2xqwSXCYpxV+dl/Unscli0Eo02Yl Wq4WfbYFjHZcDZDTPBljyUCRNT3jah9b69TdWEbSXfh4hAjvoVjES6Cu2PstUyqGioBV lcBxZhUn9AzyCfj90NC2V/6XvBe6nRbiogr5rWbCDN80P7XifS17UPPmHNfkG8eYo4gy wL7w== 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=dLuA54w/8+kA9HFjVMb2IYadZJa1EC8H9/XOYotrFiM=; b=WFJi1K0W18gE3/pYZ7zUb2l+PEgPB/fg139mtqdQgekHbQXn/fZC9kD6B6+v8urt5S wWx2Z7btsi0wWRXTxKLqeVbsTJ5ABb2vKV7d5gU8B8LBYuX3lAtP1ieYV2YhYc1ZuwGO yn/Sj1X9vpMqWMjBBXFHeCWJFqHj6D/xQayu5RMASwKlf/20F8vtoD6S+dyM4tgWHhBK 4s+YBH8SOIn74S79+azFlMaHjfTbuFaEzanDRmeyIiWH5Zjn+CTsJ4+AV5V3GhtisXgj g3Z8SjkevT2cKK13tq8Wg1erWOgRgdsbBsIMm9T7xXz3esjSx0opKuHEZjHvBg5LNkVB 05/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hC83CVMh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20si19779170plr.136.2019.03.27.13.18.19; Wed, 27 Mar 2019 13:18:35 -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=@gmail.com header.s=20161025 header.b=hC83CVMh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727542AbfC0URj (ORCPT + 99 others); Wed, 27 Mar 2019 16:17:39 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:33387 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727000AbfC0URZ (ORCPT ); Wed, 27 Mar 2019 16:17:25 -0400 Received: by mail-qt1-f195.google.com with SMTP id k14so20510135qtb.0; Wed, 27 Mar 2019 13:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dLuA54w/8+kA9HFjVMb2IYadZJa1EC8H9/XOYotrFiM=; b=hC83CVMhbgqDRKAFkNSGM7c5eMJ5tAjXdnNMBpuSd+rH/dNzAtmhfOqbr5IPCpvKne Nl4IpZzeLQaJTG1tk2CwBRpZfPzwj2OiuCudmU6YN9PtwyaW6o5iAn/wDsWNT6ZcoO7c 6L2L15/S6hRNBZvE9z7jh3MqluPTLK2MZosMUI9emI1joeX7JdYCjH3ylmfmw/Y+0y+F T1tXHf98WjjcP+l453DCKGFDKGdVMgKSWKmbVYIjaivbvQ/Qz3a0iyKUPfyjHSngH1/t XxBAjVJ7JhTrkho/0YYvAdFGG0v5l2gwmotafBtm3UUYDtW5vAg+Tt1A9cjZNB1aV4rs GKpw== 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=dLuA54w/8+kA9HFjVMb2IYadZJa1EC8H9/XOYotrFiM=; b=HlQFT8g8bXyfGrfMiEXYJBzxr7+yO0gF6TYq2uQvcwlQvHjlxj9hpSrD9pMCDDvQfO W3Ot7/swbqI4r6IaKWB/fuBRcImzM0OIywHJjrWuMybbDwedfALNlRPKYsrTTdk0+C/O aAVTPxG4zBgGBZ2ALDl1n4W+P/dL5v+lZVCIRE39AvXoq5tulkmB2zgZVKeOkcvAp5cH sMaqJ8YJ6B3gJtKSgD1FGyh5C8Q3Tf8QcGn+SQzTaU0feyBDtSlrCeXjusDzOVDmCboG 7oxbmZWA0ooA4A+rQ9cr6UDWCIqJBhqs+sPW4FzsmkGY/Fp5zOQAiTO8qw2pPp9AVzXN q/0Q== X-Gm-Message-State: APjAAAUzsCxdokUPcnY7Ng3Zx4rO4S6+2a7RlTQsfCeq21mpPKuXBKXE gb68XDfN7bVBXkh/vjtuP0KSAcw8QJb/8rt5Ik8= X-Received: by 2002:ac8:3042:: with SMTP id g2mr32419237qte.1.1553717844543; Wed, 27 Mar 2019 13:17:24 -0700 (PDT) MIME-Version: 1.0 References: <20190327162147.23198-1-christian@brauner.io> <20190327162147.23198-3-christian@brauner.io> In-Reply-To: From: Jonathan Kowalski Date: Wed, 27 Mar 2019 20:17:14 +0000 Message-ID: Subject: Re: [PATCH 2/4] pid: add pidfd_open() To: Christian Brauner Cc: Jann Horn , Konstantin Khlebnikov , Andy Lutomirski , David Howells , "Serge E. Hallyn" , "Eric W. Biederman" , Linux API , linux-kernel , Arnd Bergmann , Kees Cook , Alexey Dobriyan , Thomas Gleixner , Michael Kerrisk-manpages , "Dmitry V. Levin" , Andrew Morton , Oleg Nesterov , Nagarathnam Muthusamy , Aleksa Sarai , Al Viro , Joel Fernandes , Daniel Colascione 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, Mar 27, 2019 at 7:38 PM Jonathan Kowalski wrote: > ... > ... the process cannot get it out > of thin air on its own (and you already mentioned it has nothing to do > with security). What I do worry about is one can use NS_GET_PARENT disregard this, it works as it should. > ioctl to get the parent pidns if the owning userns is the same, and > just passing that gives me back a pidfd for the task. **So, you might > want to add the constraint that the PID is actually reachable by the > current task as well, apart from being reachable in the passed in > namespace.** > > Lastly, I also see no need of /proc/ dir fd to pidfd conversion, > I would even recommend getting rid of that, so we only have one type > of pidfd, the anon inode one. What is the usecase behind that? It > would only be needed if you did not have a way to be able to metadata > access through a pidfd, which would be the case only prior to this > patch. > > I think this would simplify a lot of things, and ioctl_ns(2) is > probably already the place to do comparison operations and query > operations on hierarichal namespaces, just adding the relative PID bit > will make it gain feature parity with translate_pid.