Skip to content

Commit 3826d5d

Browse files
committed
ipc: enable is_ns_init_id() assertions
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. Link: https://patch.msgid.link/20251110-work-namespace-nstree-fixes-v1-11-e8a9264e0fb9@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent d9a4408 commit 3826d5d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ipc/namespace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns,
6666
if (err)
6767
goto fail_free;
6868

69+
ns_tree_gen_id(ns);
6970
ns->user_ns = get_user_ns(user_ns);
7071
ns->ucounts = ucounts;
7172

@@ -86,7 +87,7 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns,
8687

8788
sem_init_ns(ns);
8889
shm_init_ns(ns);
89-
ns_tree_add(ns);
90+
ns_tree_add_raw(ns);
9091

9192
return ns;
9293

0 commit comments

Comments
 (0)