Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2114332ybl; Thu, 19 Dec 2019 08:17:49 -0800 (PST) X-Google-Smtp-Source: APXvYqysxrxuHdIgY5TXkCakah14sOacfqRQVd+k/rK0GJoBU/3tFKIZmw0aIx5A73Vxvwg0MmLe X-Received: by 2002:a05:6830:1595:: with SMTP id i21mr9717571otr.29.1576772269074; Thu, 19 Dec 2019 08:17:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576772269; cv=none; d=google.com; s=arc-20160816; b=r6BKDJUSzFXB4Xu5t3uGzePpRbv4krpo6ywWSAxc6MYVUvJ078OpgauKtb1bPfqCzm nF+W72nOLAXO0bIs63CJU07MVkk5z4GRCYLE/ODXSCerNAM3igh572118qE4nWdWXQYP EV93IuFy0cyDKHZp5sJ9pfToYCHRHp8OJ0UjisQizCL+dXD29pahoKAHT12hHgO+YC4J +dWEqKTT/3+ohFs/tEpZr0XwqFvLzXWwHwo9H/moE/RpNmDCyziJKslm+mRrdfg+MEbj G6Mh/H6wx2voFQhMX02zb7DUO/8dYCTsTI3ROAng+qqahdGYePgWA+j2C8Ok4fG3ncgd XazA== 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=xgC42fe1N8wsAY2Zpi//y6cU+ssloLAYZDPn1Fg0a/Q=; b=TBl1VUHUMIvzxkSKmb2/q0uuspwQBHjaCUIR99FqAcAmHzGX0IAHF2hv0SSLPJ9JjJ U2hBjb/XJ+Vuc1vo2ylSUi/i8v5BrTcxeHtKKpO2PDV3h8c6lmwlkihwQ4JIOrLXKAS4 bXG3kyhtl4KsQBfniPhKQpx+eWr6T7Qn3PZVaYakvs3Vut42KRaJKVRMBZNU1Io2LHBW ihwh1UtaFClCzjPrqaL4FnrgO4KfaH8vsDKo/KGi0/3Mn5Rb3tBrAGhOg+RwNWVibcRc iFKlF1U68SarOepINSFOf7THa5lKIjxBz0TcrhrmwClooLq0U58Tst0raSQCBpRoRkPs ZAkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=CRdleZru; 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 l8si3669335otq.75.2019.12.19.08.17.34; Thu, 19 Dec 2019 08:17:49 -0800 (PST) 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=@sargun.me header.s=google header.b=CRdleZru; 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 S1726935AbfLSQQH (ORCPT + 99 others); Thu, 19 Dec 2019 11:16:07 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:42395 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbfLSQQH (ORCPT ); Thu, 19 Dec 2019 11:16:07 -0500 Received: by mail-ed1-f65.google.com with SMTP id e10so5415564edv.9 for ; Thu, 19 Dec 2019 08:16:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xgC42fe1N8wsAY2Zpi//y6cU+ssloLAYZDPn1Fg0a/Q=; b=CRdleZru1BN0IO10qM3c/+ShZhD9u54Ow/x+ihrZrMg1kMI/Uhc5n0Kz0jBVzovz2A 7wBAnnk2QTrZykncxgmLNoo9u1auLtLGveneGj6/nZ4QhSB4vBB1zMz+ft2e03lT8zXY vxB5O8DU6BJacQeiY76F3DU2JM0AgLJ/hqGtU= 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=xgC42fe1N8wsAY2Zpi//y6cU+ssloLAYZDPn1Fg0a/Q=; b=TKOm9HTOOSN/1dA419/7hEqnANpGxX+hq9/mgt9pX8qGRpkIweOxt9Fi8C/PdxuQe8 jUq8XNPvfGpgM3/TvzERUmsGwpKHhbOasexbGijwlt9HCDGXjap89iMoiCPX8RtMz0fO 3H9oJCoy6kQ0O6TJv/yvJMQ5XEN/xOFCtvvEzdxmIpRbqZljiWKUtF5ZA7+KPC7xJQmV APzWOTrCBcbXTyJgNoy4EQDjinMkX2GCBVTCVtnFrWdySRf2DfBySbIIqqPA2v8e56VR e9m6F/h5cAaKtUqWjX40ZWABK52MmcGMuCRgBqOWEWIS50SoOdU0boWf/M5xscJyHx6y yWVw== X-Gm-Message-State: APjAAAXYJIG7B9E5iD9HeiK8s41zsEm8kJ9aEJS8eGNPjZl1/OW9To0s ed3aAdB8qIyzFKtyUoOVZA6uQHSojmuXI2GUr720dw== X-Received: by 2002:a17:906:5358:: with SMTP id j24mr10598276ejo.44.1576772164912; Thu, 19 Dec 2019 08:16:04 -0800 (PST) MIME-Version: 1.0 References: <20191218235459.GA17271@ircssh-2.c.rugged-nimbus-611.internal> <20191219103525.yqb5f4pbd2dvztkb@wittgenstein> In-Reply-To: <20191219103525.yqb5f4pbd2dvztkb@wittgenstein> From: Sargun Dhillon Date: Thu, 19 Dec 2019 08:15:29 -0800 Message-ID: Subject: Re: [PATCH v4 2/5] pid: Add PIDFD_IOCTL_GETFD to fetch file descriptors from processes To: Christian Brauner Cc: Arnd Bergmann , Oleg Nesterov , Florian Weimer , "linux-kernel@vger.kernel.org" , Linux Containers , Linux API , Linux FS-devel Mailing List , Tycho Andersen , Jann Horn , Aleksa Sarai , Andy Lutomirski , Al Viro , Gian-Carlo Pascutto , =?UTF-8?Q?Emilio_Cobos_=C3=81lvarez?= , Jed Davis 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 Thu, Dec 19, 2019 at 2:35 AM Christian Brauner wrote: > I guess this is the remaining question we should settle, i.e. what do we > prefer. > I still think that adding a new syscall for this seems a bit rich. On > the other hand it seems that a lot more people agree that using a > dedicated syscall instead of an ioctl is the correct way; especially > when it touches core kernel functionality. I mean that was one of the > takeaways from the pidfd API ioctl-vs-syscall discussion. > > A syscall is nicer especially for core-kernel code like this. > So I guess the only way to find out is to try the syscall approach and > either get yelled and switch to an ioctl() or have it accepted. > > What does everyone else think? Arnd, still in favor of a syscall I take > it. Oleg, you had suggested a syscall too, right? Florian, any > thoughts/worries on/about this from the glibc side? > > Christian My feelings towards this are that syscalls might pose a problem if we ever want to extend this API. Of course we can have a reserved "flags" field, and populate it later, but what if we turn out to need a proper struct? I already know we're going to want to add one around cgroup metadata (net_cls), and likely we'll want to add a "steal" flag as well. As Arnd mentioned earlier, this is trivial to fix in a traditional ioctl environment, as ioctls are "cheap". How do we feel about potentially adding a pidfd_getfd2? Or are we confident that reserved flags will save us?