summaryrefslogtreecommitdiffstats
path: root/ipc/namespace.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-09-12 13:52:43 +0200
committerChristian Brauner <brauner@kernel.org>2025-09-19 14:26:15 +0200
commit74b24a582e1ff3960f0454f57afc2bcdbc52562e (patch)
tree65ab4ac5b2407abafb1dfffc6e59a0c52ffd40a9 /ipc/namespace.c
parentcgroup: support ns lookup (diff)
downloadlinux-74b24a582e1ff3960f0454f57afc2bcdbc52562e.tar.gz
linux-74b24a582e1ff3960f0454f57afc2bcdbc52562e.zip
ipc: support ns lookup
Support the generic ns lookup infrastructure to support file handles for namespaces. Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'ipc/namespace.c')
-rw-r--r--ipc/namespace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipc/namespace.c b/ipc/namespace.c
index d4188a88ee57..9f923c1a1eb3 100644
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -15,6 +15,7 @@
#include <linux/mount.h>
#include <linux/user_namespace.h>
#include <linux/proc_ns.h>
+#include <linux/nstree.h>
#include <linux/sched/task.h>
#include "util.h"
@@ -85,6 +86,7 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns,
sem_init_ns(ns);
shm_init_ns(ns);
+ ns_tree_add(ns);
return ns;
@@ -201,6 +203,7 @@ void put_ipc_ns(struct ipc_namespace *ns)
mq_clear_sbinfo(ns);
spin_unlock(&mq_lock);
+ ns_tree_remove(ns);
if (llist_add(&ns->mnt_llist, &free_ipc_list))
schedule_work(&free_ipc_work);
}