From: Christian Brauner <brauner@kernel.org>
To: linux-fsdevel@vger.kernel.org, Jann Horn <jannh@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jan Kara <jack@suse.cz>, Jiwoo Kim <arpe1618@gmail.com>,
Chen Linxuan <me@black-desk.cn>,
linux-mm@kvack.org,
"Christian Brauner (Amutable)" <brauner@kernel.org>
Subject: [PATCH 0/3] pidfd: use one helper for pid namespace visibility checks
Date: Fri, 20 Nov 2026 14:42:08 +0100 [thread overview]
Message-ID: <20261120-work-pidfd-pidns_visible-v1-0-0e82d08469ae@kernel.org> (raw)
The pidfd api checks in a bunch of places whether the target of a pidfd
is visible in the caller's pid namespace. pidfs has
pid_in_current_pidns() for PIDFD_GET_INFO and the namespace and task
path ioctls. The pidfs file handle lookup open-codes pid_vnr() and
pidfd_getfd() does the same since Jiwoo's fix [1]. pidfd_send_signal()
walks the pid namespace hierarchy in its own access_pidfd_pidns().
Yuck, unify it.
The rule is the one we settled on a while ago [2]: anything that hands
out resources of the target requires the target to be visible in the
caller's pid namespace. That doesn't turn pid namespaces into a security
boundary. It just means a pidfd doesn't get you more than you could get
by naming the process yourself.
[1]: https://patch.msgid.link/20261117152332.1221-1-arpe1618@gmail.com
[2]: https://lore.kernel.org/all/20260925-gewischt-auftrag-tierzucht-c153cb3f9f74@brauner
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
Christian Brauner (3):
pid: move pid_in_current_pidns() into kernel/pid.c
pidfd: convert remaining visibility checks to pid_in_current_pidns()
pidfd: restrict pidfd_get_task() to the caller's pid namespace
fs/pidfs.c | 12 +-----------
include/linux/pid.h | 1 +
kernel/pid.c | 31 +++++++++++++++++++++++++++++--
kernel/signal.c | 23 +----------------------
4 files changed, 32 insertions(+), 35 deletions(-)
---
base-commit: 0a5864ad213c9fb2cf627a2dcd6f448a1fb7e065
change-id: 20261120-work-pidfd-pidns_visible-18c441f23784
next reply other threads:[~2026-11-20 13:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 13:42 Christian Brauner [this message]
2026-11-20 13:42 ` [PATCH 1/3] pid: move pid_in_current_pidns() into kernel/pid.c Christian Brauner
2026-11-20 14:10 ` Alexander Mikhalitsyn
2026-11-20 13:42 ` [PATCH 2/3] pidfd: convert remaining visibility checks to pid_in_current_pidns() Christian Brauner
2026-11-20 14:10 ` Alexander Mikhalitsyn
2026-11-20 13:42 ` [PATCH 3/3] pidfd: restrict pidfd_get_task() to the caller's pid namespace Christian Brauner
2026-11-20 14:33 ` [PATCH 0/3] pidfd: use one helper for pid namespace visibility checks Jiwoo Kim
2026-11-20 16:22 ` Oleg Nesterov
2026-11-20 16:30 ` Bradley Morgan
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=20261120-work-pidfd-pidns_visible-v1-0-0e82d08469ae@kernel.org \
--to=brauner@kernel.org \
--cc=arpe1618@gmail.com \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=me@black-desk.cn \
--cc=oleg@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.