public inbox for linux-api@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Aleksa Sarai <cyphar@cyphar.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	 Jonathan Corbet <corbet@lwn.net>, Shuah Khan <shuah@kernel.org>,
	 Andy Lutomirski <luto@amacapital.net>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	 linux-api@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v4 0/4] procfs: make reference pidns more user-visible
Date: Mon, 15 Sep 2025 13:54:21 +0200	[thread overview]
Message-ID: <20250915-sesshaft-lackieren-c7f074e8fc4a@brauner> (raw)
In-Reply-To: <2025-09-05-kinky-napping-auction-creeks-pbN1Vi@cyphar.com>

> The main issues are:
> 
> 1. pid1 can often be non-dumpable, which can block you from doing that.
>    In principle, because the dumpable flag is reset on execve, it is
>    theoretically possible to get access to /proc/$pid/ns/pid if you win
>    the race in a pid namespace with lots of process activity, but this
>    kind of sucks.
> 
> 2. This approach doesn't work for empty pid namesapces.
>    pidns_for_children doesn't let you get a handle to an empty pid
>    namespace either (I briefly looked at the history and it seems this
>    was silently changed in v2 of the patchset based on some feedback
>    that I'm not sure was entirely correct).
> 
> 3. Now that you can configure the procfs mount, it seems like a
>    half-baked interface to not provide diagnostic information about the
>    namespace. (I suspect the criu folks would be happy to have this too
>    ;).)

I think the easiest would be to add an ioctl that returns a pid
namespace based on a procfs root if the caller is located in the pid
namespace of the procfs instance (like
current_in_namespace(proc->pid_ns) or if the caller is privileged over
the owning ns. That would be simple and doesn't need to involve any
ptrace.

      reply	other threads:[~2025-09-15 11:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05  5:45 [PATCH v4 0/4] procfs: make reference pidns more user-visible Aleksa Sarai
2025-08-05  5:45 ` [PATCH v4 1/4] pidns: move is-ancestor logic to helper Aleksa Sarai
2025-08-05  5:45 ` [PATCH v4 2/4] procfs: add "pidns" mount option Aleksa Sarai
2025-08-05  7:29   ` Aleksa Sarai
2025-08-06 10:25     ` Askar Safin
2025-08-06 14:12       ` Aleksa Sarai
2025-08-07  7:17         ` Aleksa Sarai
2025-08-08 14:09           ` Christian Brauner
2025-08-08 15:51             ` Aleksa Sarai
2025-08-06  0:19   ` Randy Dunlap
2025-08-05  5:45 ` [PATCH v4 3/4] procfs: add PROCFS_GET_PID_NAMESPACE ioctl Aleksa Sarai
2025-08-06  0:25   ` Randy Dunlap
2025-08-06 18:02     ` Aleksa Sarai
2025-08-06 18:57       ` Randy Dunlap
2025-08-08 14:12         ` Christian Brauner
2025-08-05  5:45 ` [PATCH v4 4/4] selftests/proc: add tests for new pidns APIs Aleksa Sarai
2025-09-02  9:54 ` (subset) [PATCH v4 0/4] procfs: make reference pidns more user-visible Christian Brauner
2025-09-02 10:02 ` Christian Brauner
2025-09-05 14:48   ` Aleksa Sarai
2025-09-15 11:54     ` Christian Brauner [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20250915-sesshaft-lackieren-c7f074e8fc4a@brauner \
    --to=brauner@kernel.org \
    --cc=corbet@lwn.net \
    --cc=cyphar@cyphar.com \
    --cc=jack@suse.cz \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=shuah@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox