Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2754518ybl; Thu, 19 Dec 2019 20:36:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwXSuKFm+xJOlz0cE5WNzm7DNWV0rXNa4aE6TYDkLOaE1yjLWW3Nh0a8XLJd2iYToAoEajx X-Received: by 2002:a9d:21f4:: with SMTP id s107mr10854626otb.102.1576816576691; Thu, 19 Dec 2019 20:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576816576; cv=none; d=google.com; s=arc-20160816; b=ye0pinQsY9KP1HngwzwCquua+x53n6nDWHUvwUIxmyZQjnvZsjroodxp6TlHREbKAK pWadkOl2DXx7HNwS/A6ZnwmUd2uMB6RSFvFcB+6hbF4lU0/TzDSISV8qpHDifcHQJ+7P 08KAJSw66+XL2kDG/GEZyEKPGZm4ymI0DbZEM9D4IPKtptzvOCLEC2ZvsgDsbakx7dap u4gPtXCI934IFpWMct4vovZMJ+e90g82eg/xbwVY4+1a+f5DnuJ/mELFM8JORn/4er4R RxWbIcaAkKUIHMdU4w4i7Ean4qwUGcra2Dvg5Muu/ngBy+hvGlmCCtlIoeiUitL/Ntj+ vcAg== 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=XMzf7BMPT6BYMDg5tVHrJ+dc/ch1auBSypT2msGRi6M=; b=mGAtpo9GALe6m3g+uxxaRHYNeLmlyXAwPEVHka5DKCA1lN6OachjTDT2X1zd0J21PF 4M6cDOdYN3j/w0hXg7X4Btqs2T9CPJz8b5PHhFdluEWUad2bgza1iMDBBdkaeXSDcvP9 HvGX64UNez1XonxRX9QecOZXOtn2dSQSB+aee71pyA/YXdQ4OS7S6HsXXL8B3+S6cWUO HpU9Q5WqelHKn4OtzZzxJe3lRhxnXySxL8NVplvIybGDF94+/LQVFLplYiWw/o0NXRFH z+YwPjHKZfdPgRx+MTfcGWFYNa+IJ8CnDQyC/syz+ObhNRZy7itqFBJJiytjwM4oJ3e7 e4tQ== 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 v21si5463167otf.87.2019.12.19.20.36.05; Thu, 19 Dec 2019 20:36:16 -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; 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 S1727188AbfLTEfa (ORCPT + 99 others); Thu, 19 Dec 2019 23:35:30 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:18280 "EHLO mout-p-201.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726986AbfLTEfa (ORCPT ); Thu, 19 Dec 2019 23:35:30 -0500 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 mout-p-201.mailbox.org (Postfix) with ESMTPS id 47fGBk2v34zQjm6; Fri, 20 Dec 2019 05:35:26 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id 5BE2jh93RM9y; Fri, 20 Dec 2019 05:35:22 +0100 (CET) Date: Fri, 20 Dec 2019 15:35:10 +1100 From: Aleksa Sarai To: Sargun Dhillon Cc: Christian Brauner , Arnd Bergmann , Oleg Nesterov , Florian Weimer , "linux-kernel@vger.kernel.org" , Linux Containers , Linux API , Linux FS-devel Mailing List , Tycho Andersen , Jann Horn , Andy Lutomirski , Al Viro , Gian-Carlo Pascutto , Emilio Cobos =?utf-8?Q?=C3=81lvarez?= , Jed Davis Subject: Re: [PATCH v4 2/5] pid: Add PIDFD_IOCTL_GETFD to fetch file descriptors from processes Message-ID: <20191220043510.r5h6wvsp2p5glyjv@yavin.dot.cyphar.com> References: <20191218235459.GA17271@ircssh-2.c.rugged-nimbus-611.internal> <20191219103525.yqb5f4pbd2dvztkb@wittgenstein> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nmgp7ksjzcrpo6tt" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nmgp7ksjzcrpo6tt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-12-19, Sargun Dhillon wrote: > 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 >=20 > 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? If we end up making this a syscall, then we can re-use the copy_struct_from_user() API to make it both extensible and compatible in both directions. I wasn't aware that this was frowned upon for ioctls (sorry for the extra work) but there are several syscalls which use this model for extendability (clone3, openat2, sched_setattr, perf_events_open) so there shouldn't be any such complaints for a syscall which is extensible. --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --nmgp7ksjzcrpo6tt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXfxPewAKCRCdlLljIbnQ ElNGAP0QzHxTfcWUIyKQwziyZ7SKPlC5ve6y0476CjvwfTG0mQD+JDR19gzaS69O MYDK8035BURwBnELBe2PceZHzjVhlAQ= =Kwh+ -----END PGP SIGNATURE----- --nmgp7ksjzcrpo6tt--