Re: [RFC PATCH v5 15/25] rootns: Add ROOTNS_KILL ioctl
From: Jarkko Sakkinen
Date: Sat Nov 21 2026 - 06:24:26 EST
On Sat, Nov 21, 2026 at 03:19:38AM +0200, Jarkko Sakkinen wrote:
> On Sat, Nov 21, 2026 at 02:08:34AM +0200, Jarkko Sakkinen wrote:
> > Signaling every process inside a container from userspace via /proc is
> > racy against concurrent fork() calls.
> >
> > Add the ROOTNS_KILL ioctl to require an ancestor active PID namespace,
> > walk the root namespace's PID namespace IDR under tasklist_lock, and
> > deliver a validated signal once to each thread group including in-flight
> > forks, aggregating per-process delivery results.
> >
> > Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
>
> Will be gone i.e., can do also pidfd_send_signal(fd, signum, NULL, 0).
Wiring:
case PIDFD_SELF_THREAD_GROUP:
pid = get_task_pid(current, PIDTYPE_TGID);
type = PIDTYPE_TGID;
break;
default: {
CLASS(fd, f)(pidfd);
if (fd_empty(f))
return -EBADF;
if (is_rootns_file(fd_file(f)))
return rootns_send_signal(fd_file(f), sig, info, flags);
After this only ROONTS_GET_NSFD remains.
Br, Jarkko