Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4448881img; Tue, 26 Mar 2019 09:35:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWOXc9gDGx7IFQZnFb8+2toTXN0PAxkaf/L8w+55zHkEd/qT9KmkDKV/RnYagnRlDCoMTB X-Received: by 2002:aa7:83ce:: with SMTP id j14mr2946735pfn.57.1553618107657; Tue, 26 Mar 2019 09:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553618107; cv=none; d=google.com; s=arc-20160816; b=QY2usCY0hnJnqwnArE6Vccni6OywgExgLP4mckFYfBzx8jIHvqnweLziaJdeUUSop/ CA/dPh2bRo03YAMdWqNuJawi3BfQXCmcdKvP22sbHBMVaG61jiAZAf5JOeDVhLqNRaL/ CQlqmXONnFXVu1RhPMKClsHTNxqe0GaUiW1XJnuFJK4gdj8ba8jycj5VTy5k40LcFX/m 3T3idaKTocBKMWiGK94876HbU90wQMFWCnb7rYhz//0cjZkfTNlt2rGnIVgu/eiR8Uki RIx5/Uj1YAEm1B1NxEP7vbXDZXO0HAcWTCK2H3ALfKAs7nQ7nlWgcsYjvnISQ86EGmjB ALeA== 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=faurlb/wNW6vWfzEIgf901C4vUon97CL0YpZomQpneY=; b=jTO8V3zqYf94+mQIPm7eEiHxUFefJqVCvnJE+zo7OWv9Oa9CQ6ScvA2aKNNElDRtvU KX2k9+VxoWASw1CSJgozxk49OEs6Gb5utPfMQ5ZMNYONVcHIbg6Ix9MKkTd040vHQFKn A5nXPhMumhxswdJjsCDmX7sDH3/CkO+0q9ICB3Do5T+RFf2PQs4s6fm3vK8TcFu0a05c z85ne63X2QLP6M/YEJYpszsNABeC6nvj33GWvOfD992hgN45MxeEOhYzymCRjY+UbjMs F0buyQa22CFZ+16jODdPSF+4QxBnLXyw5MPVz/6O8IjLM49fI8DRLJ/znnGFQeMmEkOU 8wLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qv7VGBCx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m22si16070916pgv.562.2019.03.26.09.34.52; Tue, 26 Mar 2019 09:35:07 -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=@google.com header.s=20161025 header.b=Qv7VGBCx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731894AbfCZQeK (ORCPT + 99 others); Tue, 26 Mar 2019 12:34:10 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:37887 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731770AbfCZQeF (ORCPT ); Tue, 26 Mar 2019 12:34:05 -0400 Received: by mail-oi1-f196.google.com with SMTP id v84so10445210oif.4 for ; Tue, 26 Mar 2019 09:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=faurlb/wNW6vWfzEIgf901C4vUon97CL0YpZomQpneY=; b=Qv7VGBCxKTz41fmcgJq7JWkQlzFJ1K5auhNzyk4BUhB5iFobsNJHXfTpTR51BVMuLf Lemd8P7P7ZRvi6m9XBaH8iYOe+avytUy6M1E6toWlNb+QVzgjPai7U3GNrkfms8cC2T3 Xij1SETlKtIuwZzTeD57b8g+w7nnLCjlGuMqJrRtS5uHNv5CfV+GkSccD6lB2kzjZg6d W8QIJEBtkFzqATA3dlQdmsjq2eKBAsxdH7pIfq0h8H5rWLa0cHQLhe+d7KU5XFAaErAt jyEDFKW6LpoJzmHd0CTiYYtn9BzZJ9bJa4FQrJ8wIaNomYPpgEnBtROzNp77oxadJE+Y geYA== 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=faurlb/wNW6vWfzEIgf901C4vUon97CL0YpZomQpneY=; b=TNQXhahNCa55v3yDxRCao1l5wgMRKhOk2nErATUYPXq6mTyMjWVcOhu+r8FAv+4jDE n43S2l//M9PJXBBnwBlGt1CsPJNDgUkLKCv2ASNWnNjvenJbKfv+E8psplgdFizhas3t t8tA7RpWmaRkCxyDqyxc7KdJaUu/37QM+reBRhLXv29pOMCjlbmnrTdpwQlckokh2pIC HTph7CZsqFpwEQP6SejnfMZuS0/TsdSIGxCkHP4Xzjx1feSt/qstSXSpfXJw3p8NSdwX T/Z1WrGEiP2dIdxXkaIHs959R8U40azA9ol/WKlQ1rGu9KVuMzWsoynJj2F4AuuesPps /yXA== X-Gm-Message-State: APjAAAV4W66xjT70A73DS7KgePWJ6Uw8A98SUhUF0WexgZ37gtblr2+Q zd1KGxMFuRRm2EcHJxKZVGDr5caOedlfxjyxDU/Jcw== X-Received: by 2002:aca:c3d8:: with SMTP id t207mr16517306oif.117.1553618044095; Tue, 26 Mar 2019 09:34:04 -0700 (PDT) MIME-Version: 1.0 References: <20190326155513.26964-1-christian@brauner.io> <20190326155513.26964-3-christian@brauner.io> <20190326162337.o256x7hiodu2qfyg@brauner.io> In-Reply-To: <20190326162337.o256x7hiodu2qfyg@brauner.io> From: Daniel Colascione Date: Tue, 26 Mar 2019 09:33:52 -0700 Message-ID: Subject: Re: [PATCH v1 2/4] pid: add pidctl() To: Christian Brauner 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 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 Tue, Mar 26, 2019 at 9:23 AM 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. Thanks. I also appreciate a clean unification of related functionality, but I'm concerned that this API in particular --- due in part to its *ctl() name --- will become a catch-all facility for doing *anything* with processes. (Granted, heavy use of a new, good, and clean API would be a good problem to have.) This single-system-call state of affairs would make it more awkward than necessary to do system-call level logging (say, strace -e), enable or disable tracing of specific operations with ftrace, apply some kinds of SELinux policy, and so on, and the only advantage of the single system call design that I can see right now is the logical cleanliness. I'd propose splitting the call, or if we can't do that, renaming it to something else --- pidfd_query --- so that it's less likely to become a catch-all operation holder.