Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp719714yba; Thu, 16 May 2019 07:55:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpBsHRxeq9WIDZSF35an5yhpYJVig7sAEMI0U+acpgQ4HIC7Rugg4DvJd7mQAtsRUH5AYG X-Received: by 2002:a63:191b:: with SMTP id z27mr51136829pgl.327.1558018543822; Thu, 16 May 2019 07:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558018543; cv=none; d=google.com; s=arc-20160816; b=kC2NF3fWCvYkPkcLKHaj63jnoCqeRrRK08/p2C4omHhrRfVDIvxfW4e1cPt96Hnnz6 f+Vwba/kXHWhC/c2LJX7Fbh6yjMvVnjZNrK+UhNgd1LJeLUC5mAuhN1bVT4zOJjjyrpw hQV+DnmVd1RR+xvJ3w3cgxVKqcYHWr6jMGRrf9EfU159KfdWTyDAG6JokFlfPH8vMuDA kxZx9JfDxEFOHKETqErn+izTp1Fw3SxQ/Gqk3AuPTTMceDTv6tpCeGreWWYHUs+C14GL WCwTjSy7JmqhIG9IZpLLNEkScOGxSpqN55p7pZ6e9G7TP4NIMos+sdUDZQycEFlt0dsk sZ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=N4P5r4oaqMhDAiQCiIueH8aMIpv5uhOgbzR3rctQ0x4=; b=zDKc+jIVYH3IXk9a8clALSW8Q4QFvnYJ+l/rF6Jlm3C7IJ3ZJdKqf+7+Iap9kJApi+ Obx6zx103RU70CG6DgU9BN7ZA3FyFXSuptu86ZfWlW/JbsN0Bted+ByASdOhfvtOoY0q J9RnvxvH9A7nyO7kBrw3lyRwKVbI5g2tEGdvKf037MTn3yXkuvRYY1kYngKFwws/JBtD wY+k8SIZ4IGy77x67fLEo/R3D1lW+5i98KfaWtF2d3jJebnHNdYRlGBVzjR/sSDQ6Ic3 lHdggotY1UeBTTp8GRaK4EhijV/yzqfwXWiLao1RoCt2wTD5D/qHEdn8kE4BnZNePwAp +Bhg== ARC-Authentication-Results: i=1; mx.google.com; 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 g9si4892285pgs.364.2019.05.16.07.55.28; Thu, 16 May 2019 07:55:43 -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; 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 S1727229AbfEPOyL (ORCPT + 99 others); Thu, 16 May 2019 10:54:11 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:33296 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbfEPOyK (ORCPT ); Thu, 16 May 2019 10:54:10 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id D2A514E9C7; Thu, 16 May 2019 16:54:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id sn3AhIsEBiJY; Thu, 16 May 2019 16:54:00 +0200 (CEST) Date: Fri, 17 May 2019 00:53:41 +1000 From: Aleksa Sarai To: Christian Brauner Cc: Daniel Colascione , Jann Horn , Oleg Nesterov , Al Viro , Linus Torvalds , linux-kernel , Arnd Bergmann , David Howells , Andrew Morton , "Eric W. Biederman" , elena.reshetova@intel.com, Kees Cook , Andy Lutomirski , Andy Lutomirski , Thomas Gleixner , linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, Linux API , linux-arch@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH 1/2] pid: add pidfd_open() Message-ID: <20190516145341.xx7bpyakezvpqujj@yavin> References: <20190515100400.3450-1-christian@brauner.io> <20190516130813.i66ujfzftbgpqhnh@brauner.io> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rl3rpkoiju4ooj2k" Content-Disposition: inline In-Reply-To: <20190516130813.i66ujfzftbgpqhnh@brauner.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --rl3rpkoiju4ooj2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-05-16, Christian Brauner wrote: > On Wed, May 15, 2019 at 10:45:06AM -0700, Daniel Colascione wrote: > > On Wed, May 15, 2019 at 3:04 AM Christian Brauner wrote: > > > + if (pid <=3D 0) > > > + return -EINVAL; > >=20 > > WDYT of defining pid =3D=3D 0 to mean "open myself"? >=20 > I'm torn. It be a nice shortcut of course but pid being 0 is usually an > indicator for child processes. So unless the getpid() before > pidfd_open() is an issue I'd say let's leave it as is. If you really > want the shortcut might -1 be better? I'd suggest not using negative numbers, and instead reserving them for PIDTYPE_TGID if we ever want to have that in the future. IMHO, doing pfd =3D pidfd_open(getpid(), 0); is not the end of the world. --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --rl3rpkoiju4ooj2k Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEb6Gz4/mhjNy+aiz1Snvnv3Dem58FAlzdeXUACgkQSnvnv3De m58cOhAArH3Suh66uovI36Cs+UiaKF7pQq8Uj5fLxF9TEp/xA0aglqcZbJKrUIKr DIaXBIm1GOitsaCBH/+k2puVlhgNpCPaskXKCWTACjS5l6z7NBQ3o4ZDgmy9sS6/ MgIMUnFpdpX+4qRBZPsvsfknvtBO9eI8cVfZIzo4NZnUzs5zRU6qToEKWCjQNscK RzO+BsCNNkQXXlHBkNrdX4ue058LJyEAYop8gqPAMorepNpbcydpkRq1YWGbd4iS 3F5ZTCHdstprw5ZmFcLUaedwf4O1X9B+eulR82Y2PHSVoOHgidE3KcdouxMEXQlh 8KOVL1cpD2h+AdGu9znbvhKLP87kDoSbTSznKZ3dlFdk6YQQbOMvofXAay/zXRnJ 6GXTZ6r8KDhtoJTNdYRoBQUf+pgzLKLwPdnkzLfu3CFPMy6YpaBMFFt7DwTNG6Du Q1nI8HIBPe0Sf7VNyv5qaixRR5rfKnqv80FPdQZD0MGsXTU7z7Iv9rZ7/g+/4ZdH yLhuLIARtcqLd2LSNmHQFuBbuDxODQbtqS/89FmshKn+WHowS3/406NNYsvvdwTY NGeva57n7Ke7NmdsO1uVsxPmTUHaxp55Vx0BTIQN4+in7mlYdf6I4qD0cVE1TGJQ 3AF3dH8bQrznZvmJUjXZY8dWRD4StRbAp822rBOY4+QyhbySjoY= =SYyW -----END PGP SIGNATURE----- --rl3rpkoiju4ooj2k--