Re: [RFC PATCH v5 13/25] rootns: Add rootns() system call

From: Jarkko Sakkinen

Date: Sat Nov 21 2026 - 15:17:08 EST


On Sat, Nov 21, 2026 at 09:54:50PM +0200, Jarkko Sakkinen wrote:
> On Sat, Nov 21, 2026 at 09:12:44PM +0200, Jarkko Sakkinen wrote:
> > On Sat, Nov 21, 2026 at 09:10:59PM +0200, Jarkko Sakkinen wrote:
> > > On Sat, Nov 21, 2026 at 02:08:32AM +0200, Jarkko Sakkinen wrote:
> > > > Setting up an isolated namespace environment from a multithreaded
> > > > manager process currently requires helper processes to call unshare()
> > > > and pass file descriptors back over sockets.
> > > >
> > > > Add the rootns() system call to allocate a detached rootns instance
> > > > owning a fresh user namespace alongside dedicated empty mount
> > > > (CLONE_EMPTY_MNTNS), PID, UTS, IPC, network, cgroup, and time
> > > > namespaces, and return its control file descriptor. Finalize the nsproxy
> > > > time namespace and pin active references for the lifetime of the rootns.
> > > >
> > > > Co-developed-by: David Howells <dhowells@xxxxxxxxxx>
> > > > Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
> > > > Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
> > >
> > > Syscall name is outdated. I'll rename it as container_create(). Does
> > > not have to be final name, but is a better wip name.
> >
> > Something more non-generic as it inevitably would collide to something
> > (did not check). I'll figure something out.
>
> At least for the next iteration I call the object as "vault" and rename the
> syscall as vault_open(), and that is based on:
>
> $ cat /proc/kallsyms | sed -n '/call_meta__/p' | sed 's/.*call_meta__\(.*\)/\1/g; s/\(.*\)/SYS_\1 \1/; 1i #include <sys/syscall.h>' | gcc -E -P - | grep -v 'SYS_' | sort -n | uniq | grep _open
> 240 mq_open
> 298 perf_event_open
> 434 pidfd_open

https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/log/?h=vault

Br, Jarkko