Thread (20 messages) 20 messages, 3 authors, 2025-11-14
STALE216d

[PATCH 11/17] ipc: enable is_ns_init_id() assertions

From: Christian Brauner <brauner@kernel.org>
Date: 2025-11-10 15:09:38
Also in: bpf, cgroups, linux-fsdevel, lkml
Subsystem: the rest · Maintainer: Linus Torvalds

The ipc namespace may call put_ipc_ns() and get_ipc_ns() before it is
added to the namespace tree. Assign the id early like we do for a some
other namespaces.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 ipc/namespace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ipc/namespace.c b/ipc/namespace.c
index 59b12fcb40bd..c0dbfdd9015f 100644
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -66,6 +66,7 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns,
 	if (err)
 		goto fail_free;
 
+	ns_tree_gen_id(ns);
 	ns->user_ns = get_user_ns(user_ns);
 	ns->ucounts = ucounts;
 
@@ -86,7 +87,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);
+	ns_tree_add_raw(ns);
 
 	return ns;
 
-- 
2.47.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help