Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1622202ybd; Wed, 26 Jun 2019 21:58:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvLwFrfKO0m4MH2HhpgYxfoM0t+6NNQUfheFTqCd9vdKLhgUY/J9vmRI7ezmhiu1yxTXjz X-Received: by 2002:a65:63d1:: with SMTP id n17mr1845937pgv.382.1561611511552; Wed, 26 Jun 2019 21:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561611511; cv=none; d=google.com; s=arc-20160816; b=Wk1OO48pQ7gAZ5LhJ+C5nGH0wQ57B3lFEqUFLTimogMZpxPWCEYPNN43DWPzSK0PE7 MEroTafymrA/nUtJ3zOEZ9ENYRwlwzod3UsXf/2yMI+C4NB+WeR8016eSBXNd8FlRwq5 fWi62w2VMmXe5XlhxAYURGrUtHmVeqt4RJG7zT8Lt1QBLYP0kU4NR7prTcS4fjn1II93 gnJbdRe0klYMUqXEPN5KV47GF1v5KIowHaoN0dO2o83Hw4fZHQxItH9ftTTFC3GaUHlp oSwg6Vz3Jt/7MbwXDGbbLpuJ3g1t+qkLhbMCZSs9YMiPjmoEhiDtdEwxhsnDca6BUUW1 y7bQ== 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=+8atdZXcP26doj8gcmpkPizKujo7rTZABpJLivd+l/g=; b=n13Xv6Yp8yfycb5GVah4w1XF53+pwafPTaibOXhqL9m4L+LjhF4nKF1tqUJ49lNfvR 7VMMNiE69Q4goar8roPRDk2FCpE21ShRkx3/pwxL0YePaHIgniTHn1Z0JQhRC7Kod982 YWFfACEZOOcflQMvtTVQWUDMupXK2p8VN+tJQ4BYqZH04xo8IF1UfrvNx5KahyLWif2O 73AJStLQtqG2emf6o4gvyjrSY5bsInq/Jk1k9BghJUfQdlOJSiVkztG/vdUCuzieg3uQ eepXcL/zb09zT74BPbSjUXWQJNoJeXwhg4SSiydtffW/aY5Y93IO35TzsD/WXsyx9I+y ke4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=Al8t9Ovv; 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 s19si1082878pgg.20.2019.06.26.21.58.05; Wed, 26 Jun 2019 21:58:31 -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=Al8t9Ovv; 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 S1727041AbfF0E4H (ORCPT + 99 others); Thu, 27 Jun 2019 00:56:07 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54196 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725385AbfF0E4H (ORCPT ); Thu, 27 Jun 2019 00:56:07 -0400 Received: by mail-wm1-f68.google.com with SMTP id x15so4266805wmj.3 for ; Wed, 26 Jun 2019 21:56:05 -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=+8atdZXcP26doj8gcmpkPizKujo7rTZABpJLivd+l/g=; b=Al8t9OvvZ+xRpBu862DxLn2RyIAoI4BpdiwOst38nWRc7z78jeXonDgzrkCfBcNzcA iTaLpPNA8eHJXrQipyG6IEFSEl6a146SbFTv7dApD8s3dmi/cLyPXSxs92uJ1x8wco68 QsvBjYxL0JYrrNzBXc20B4utdvwI95Zwojm3nFHtmJYwKOYwYrYR7rbmqvgao/wQhodY Hvr/qT2Fv2NIgVOBnVNxZq1M0ZXOAs8UhBUl/+HDQQ0sUU1LRqz+FrXtz05Tmy4LrP8/ 8Lvl0JV2gIsNgLM+jd+0XCUyzfEBLwyLPJSkXns/u671anTr0BdKUKFxEef1dDezGAcZ A2XA== 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=+8atdZXcP26doj8gcmpkPizKujo7rTZABpJLivd+l/g=; b=sFnXy2EDWQi9kljlo63uLBMJI99PvzGIK6jwEFfcLhj5aIFNDdBwlBG/2aEirXCZZX 9W1X5tknQ1WLxexN+5Gooq6y6eSeRcpIFQv6k6Le7zaXrEeqMbDDdJeU86gLBVfdduv6 vFsUi1Taq7B0FnGn8F9B8lSD4Zzu7HlPUD1s408bqdjSZAiuOicwUHOY4k4AO/yhCJC0 koOxE6g01swk/yw6df7N1LbJMtUW7QdfNNbXNkKUGI64RB5e5qmoqw96KFl/W6pFR3Vi hpHck3fRMDXvS8A6/nthQSnt+FgxP9/BasMPQqmLm8X++rCZ3/lnGQWnfqwc1vcCHLhU VZfg== X-Gm-Message-State: APjAAAUi4I07+nnRUWi8dEJIOtIjmkPgrnnsRpuoYYf62N3VJBTyhMD7 lYalhXMFaVvOHQ/pVml+S4rE0/HcTnYU5A== X-Received: by 2002:a05:600c:c6:: with SMTP id u6mr1561236wmm.153.1561611365093; Wed, 26 Jun 2019 21:56:05 -0700 (PDT) Received: from brauner.io ([212.91.227.56]) by smtp.gmail.com with ESMTPSA id w7sm2689028wmc.46.2019.06.26.21.56.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 21:56:04 -0700 (PDT) Date: Thu, 27 Jun 2019 06:56:03 +0200 From: Christian Brauner To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, ldv@altlinux.org, viro@zeniv.linux.org.uk, jannh@google.com Subject: Re: [GIT PULL] fixes for v5.2-rc7 Message-ID: <20190627045602.pqv67qxjj7ooaqir@brauner.io> References: <20190626140733.21538-1-christian@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190626140733.21538-1-christian@brauner.io> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 04:07:33PM +0200, Christian Brauner wrote: > Hi Linus, > > This pull request removes the validation of the pidfd return argument if > CLONE_PIDFD is specified: > > The following changes since commit 4b972a01a7da614b4796475f933094751a295a2f: > > Linux 5.2-rc6 (2019-06-22 16:01:36 -0700) > > are available in the Git repository at: > > git@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux tags/for-linus-20190626 > > for you to fetch changes up to bee19cd8f241ab3cd1bf79e03884e5371f9ef514: > > samples: make pidfd-metadata fail gracefully on older kernels (2019-06-24 15:55:50 +0200) > > Userspace tools and libraries such as strace or glibc need a cheap and > reliable way to tell whether CLONE_PIDFD is supported. > The easiest way is to pass an invalid fd value in the return argument, > perform the syscall and verify the value in the return argument has been > changed to a valid fd. > > However, if CLONE_PIDFD is specified we currently check if pidfd == 0 and > return EINVAL if not. > > The check for pidfd == 0 was originally added to enable us to abuse the > return argument for passing additional flags along with CLONE_PIDFD in the > future. > > However, extending legacy clone this way would be a terrible idea and with > clone3 on the horizon and the ability to reuse CLONE_DETACHED with > CLONE_PIDFD there's no real need for this clutch. So remove the pidfd == 0 > check and help userspace out. > > Please consider pulling these changes from the signed for-linus-20190626 tag. Al has another patch that removes the use of anon_inode_getfd() for the sake of anon_inode_getfile() + fd_install() to avoid the use of ksys_close(). I'll put it in my fixes branch and send a new PR with all those fixes in a few hours. Thanks! Christian