All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] pidfd: use one helper for pid namespace visibility checks
@ 2026-11-20 13:42 Christian Brauner
  2026-11-20 13:42 ` [PATCH 1/3] pid: move pid_in_current_pidns() into kernel/pid.c Christian Brauner
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Christian Brauner @ 2026-11-20 13:42 UTC (permalink / raw)
  To: linux-fsdevel, Jann Horn
  Cc: Oleg Nesterov, Alexander Viro, Jan Kara, Jiwoo Kim, Chen Linxuan,
	linux-mm, Christian Brauner (Amutable)

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-20 16:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 13:42 [PATCH 0/3] pidfd: use one helper for pid namespace visibility checks Christian Brauner
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

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.