Linux-Fsdevel Archive on
help / color / mirror / Atom feed
From: Christian Brauner <>
To: "Michael Kerrisk (man-pages)" <>
Cc: "" <>,
	lkml <>,
	Wolfgang Bumiller <>,
	Serge Hallyn <>,
	Alexander Viro <>
Subject: Re: [PATCH] nsfs: add NS_GET_INIT_PID ioctl
Date: Thu, 18 Jun 2020 11:18:57 +0200	[thread overview]
Message-ID: <20200618091857.atycw6ioaiuhddmj@wittgenstein> (raw)
In-Reply-To: <>

On Thu, Jun 18, 2020 at 11:03:25AM +0200, Michael Kerrisk (man-pages) wrote:
> On Thu, 18 Jun 2020 at 10:45, Christian Brauner
> <> wrote:
> >
> > Add an ioctl() to return the PID of the init process/child reaper of a pid
> > namespace as seen in the caller's pid namespace.
> What are the pros and cons of returning a PID FD instead of a PID?

A pidfd doesn't buy you much here since you can race-free turn the PID
into a pidfd via pidfd_open() right after.
But mostly, I don't want to introduce the pattern of returning pidfds
from all corners of the kernel especially when it's not strictly
required. The central entrypoints should remain clone{3}() and
pidfd_open() for now. I want to remain conservative with this until we
have had more of userspace rely on them for a while and the bugs and
features requests come trickling in. We've seen a good portion of that
but we'll likely see more. If we need to do global changes (e.g. sending
signals outside of your own pid namespace hierarchy or attaching
capabilities to them) we will be in better shape if we don't return them
from everywhere just yet.


  reply	other threads:[~2020-06-18  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18  8:45 Christian Brauner
2020-06-18  9:03 ` Michael Kerrisk (man-pages)
2020-06-18  9:18   ` Christian Brauner [this message]
2020-07-10 11:58 ` Qian Cai
2020-07-10 12:01   ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618091857.atycw6ioaiuhddmj@wittgenstein \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] nsfs: add NS_GET_INIT_PID ioctl' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).