[RFC PATCH v5 15/25] rootns: Add ROOTNS_KILL ioctl

Jarkko Sakkinen jarkko at kernel.org
Sat Nov 21 11:24:14 UTC 2026


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 at kernel.org>
> 
> 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



More information about the Linux-security-module-archive mailing list