Re: [PATCH] ns: don't add init_ipc_ns and init_net without namespace support

From: Christian Brauner

Date: Fri Oct 30 2026 - 12:22:01 EST


On Fri, 30 Oct 2026 16:50:07 +0100, Christian Brauner wrote:
> When CONFIG_IPC_NS or CONFIG_NET_NS are turned off we still add the
> initial ipc and network namespace to the namespace trees. ipc_ns_init()
> calls ns_tree_add(&init_ipc_ns) whenever CONFIG_SYSVIPC is set and
> setup_net() calls ns_tree_add_raw() on init_net whenever CONFIG_NET is
> set.
>
> But without CONFIG_IPC_NS and CONFIG_NET_NS these aren't namespaces
> userspace can do anything with. They don't have proc_ns_operations so
> there's no /proc/<pid>/ns/{ipc,net} for them, nsfs_fh_to_dentry()
> refuses them with -EOPNOTSUPP, and since ns->ops is NULL
> __ns_tree_add_raw() doesn't add them to the owner list of init_user_ns
> either. So they end up half registered. That's also not how we treat
> any of the other namespace types. Without CONFIG_UTS_NS, CONFIG_PID_NS,
> CONFIG_TIME_NS or CONFIG_USER_NS the initial namespace is never added
> to the tree.
>
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] ns: don't add init_ipc_ns and init_net without namespace support
https://git.kernel.org/vfs/vfs/c/82f1c815aaef