Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4450966img; Tue, 26 Mar 2019 09:37:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLaxyRQSJfb1juORfFlyLSDikeV3Lk2IGRIB5z2gNfFAn9u0za9eDR1ol1ZA3FqW8LznUQ X-Received: by 2002:a17:902:3f83:: with SMTP id a3mr30468451pld.6.1553618252213; Tue, 26 Mar 2019 09:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553618252; cv=none; d=google.com; s=arc-20160816; b=ziHtjymfj0RZJVdaSLrt9uOOZB+w0uj2HP2yTlJco98YPb1pbU35oRqNi1hllyStDs ScAi4nxFSMaiJsKmEGYJttaiXsYgJsIUBr3k1n05YuCRt3gOgJ+7EeicCEln3cuX8pDg ZRE5fjGnu6as/LWY+xw6g8nnMD2W4DGQ41YoS+1GdtC1PTId5nsFuz05EySeudeABdDu PWIAAV+XOsNz5zis93IAEUar+nX7mreqFnQqoVr/1+tOCwWYMCJqA6iS0PX6g5hVUP5M c0POupoEKbW4BwxIJ4QHqNH1XuHRGt28TUaJd5bfmjsdtLFsoQUiPykowhJiaedxZgpw 5GXA== 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=uhKIZ8TUnlMSSQGGMRtLqbaYuRj+7mZCO6B+dsUkCqY=; b=JTb/uhIZXCkuMkPzLQAnNOYPKXkKOT1JTKkbPO5XU5UVzeFnLSC/54fnqAdkWCT3AR f2AwyVcogr/USr15E4Z3WGXdxzyu6pYwI4cwDbcI577+X2AIOxiTvLSKPxFysc8taSoa 51+gVMhuhdfI3N3FisnX4bVHr7LT0sGu6C73RL48I6Frbaq2nWiyFdM+l6JfHkIj21VZ gVe5hfx1S8Omw7sj3QB7ejMst1XQYUwOFlyW/VFHFj7V9+6a4O+iDcW3d5YAjZ26pQHy e4fSLydxza5YM0wdULifUD34As4Tv7Ohc4N21mOPHl+odrc5V4brVmU8wC9K6OYd6eiE ZBIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=CccCLRso; 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 j188si16797764pfb.75.2019.03.26.09.37.16; Tue, 26 Mar 2019 09:37:32 -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=CccCLRso; 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 S1731981AbfCZQe6 (ORCPT + 99 others); Tue, 26 Mar 2019 12:34:58 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40143 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728314AbfCZQe5 (ORCPT ); Tue, 26 Mar 2019 12:34:57 -0400 Received: by mail-ed1-f66.google.com with SMTP id h22so11341692edw.7 for ; Tue, 26 Mar 2019 09:34:56 -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=uhKIZ8TUnlMSSQGGMRtLqbaYuRj+7mZCO6B+dsUkCqY=; b=CccCLRsoGNz69rhZaHHllAZ2djVdT9wcbzWzSlPXcm/dpS60RE8ukVlDX/ig+9hPBj N3yEQu+bgrNvHV3hH/mgZnQA9A5W8UBOBxw1fOpPwDNZDA0o2qvq2fn5iL/ojaRucek4 i8Gx4tIP96CyG0Dw9CJ6wfCNoo4cpVkZAd14+eifQGWLb35S+/i6vwp8GmzyX1Nt/tDz ecQNBHf7makUomgg+6q6ARNJoIi6lF0Mh5SOd2tnmpdu0oGQbbwIIw9uEVbUPS9WyKi2 hdhmauxG6xcNw6j7WlVPYKbp4egppkwfVrGpqYhDyLRY3hcdqqD2D7RBxhO1RtSf3TmK UsBw== 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=uhKIZ8TUnlMSSQGGMRtLqbaYuRj+7mZCO6B+dsUkCqY=; b=pYMIb1n75WEnrzKrcvCN6g4uz34chaAH03EYaLMLoKvdd9mJnxyhviYok0QW7PyZe8 SW5k7sLO1QQz82bWQMoqcXa/MeTX76tSGShy0v46wS2Zs/DF8AxE+GgnhAIq0iplizfE 4ZfCaXuFSyd0L4WTvn3rUi3ViSwVVs4i3O2LfV9fmhgEdNSVrUO3lHuHSVXvdr6RxVLl lIHW2mj6EYMgon/OXwMdCQCMolb/kwN64E77p9zcL5cfyWVsePvNFM2Q1i9RvLwBg6Xc KafVd9wx0aFaZGDohtVicbhh+lcv2QQW38iS8PWBBUk9GDwxIxTNUJf48kzoJCAKmx4C paYw== X-Gm-Message-State: APjAAAXVQ1Lhvw2F+pD+0AKHFx8Pz6V7SALLDlC3dq+znBpVDZG6Lfjm YvE1kaHurT2Uq8U8BxwwuFJvHQ== X-Received: by 2002:aa7:c697:: with SMTP id n23mr20631407edq.231.1553618095657; Tue, 26 Mar 2019 09:34:55 -0700 (PDT) Received: from brauner.io (x59cc895e.dyn.telefonica.de. [89.204.137.94]) by smtp.gmail.com with ESMTPSA id z2sm4170721ejn.37.2019.03.26.09.34.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 26 Mar 2019 09:34:55 -0700 (PDT) Date: Tue, 26 Mar 2019 17:34:52 +0100 From: Christian Brauner To: Daniel Colascione 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 , Jonathan Kowalski , "Dmitry V. Levin" , Andrew Morton , Oleg Nesterov , Nagarathnam Muthusamy , Aleksa Sarai , Al Viro , Joel Fernandes Subject: Re: [PATCH v1 2/4] pid: add pidctl() Message-ID: <20190326163452.uku4bgkessxzxvai@brauner.io> References: <20190326155513.26964-1-christian@brauner.io> <20190326155513.26964-3-christian@brauner.io> <20190326162337.o256x7hiodu2qfyg@brauner.io> <20190326163142.4eh5qpgiqvygf26w@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190326163142.4eh5qpgiqvygf26w@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 Tue, Mar 26, 2019 at 05:31:42PM +0100, Christian Brauner wrote: > On Tue, Mar 26, 2019 at 05:23:37PM +0100, Christian Brauner wrote: > > On Tue, Mar 26, 2019 at 09:17:07AM -0700, Daniel Colascione wrote: > > > Thanks for the patch. > > > > > > On Tue, Mar 26, 2019 at 8:55 AM Christian Brauner wrote: > > > > > > > > The pidctl() syscalls builds on, extends, and improves translate_pid() [4]. > > > > I quote Konstantins original patchset first that has already been acked and > > > > picked up by Eric before and whose functionality is preserved in this > > > > syscall: > > > > > > We still haven't had a much-needed conversation about splitting this > > > system call into smaller logical operations. It's important that we > > > address this point before this patch is merged and becomes permanent > > > kernel ABI. > > > > I don't particularly mind splitting this into an additional syscall like > > e.g. pidfd_open() but then we have - and yes, I know you'll say > > syscalls are cheap - translate_pid(), and pidfd_open(). What I like > > about this rn is that it connects both apis in a single syscall > > and allows pidfd retrieval across pid namespaces. So I guess we'll see > > what other people think. > > There's something to be said for > > pidfd_open(pid_t pid, int pidfd, unsigned int flags); > > /* get pidfd */ > int pidfd = pidfd_open(1234, -1, 0); > > /* convert to procfd */ > int procfd = pidfd_open(-1, 4, 0); > > /* convert to pidfd */ > int pidfd = pidfd_open(4, -1, 0); probably rather: int pidfd = pidfd_open(-1, 4, PIDFD_TO_PROCFD); int procfd = pidfd_open(-1, 4, PROCFD_TO_PIDFD); int pidfd = pidfd_open(1234, -1, 0);