aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-11-10 16:08:23 +0100
committerChristian Brauner <brauner@kernel.org>2025-11-11 10:01:31 +0100
commit3826d5dd06996007c13352b7fa65625ab570f651 (patch)
treeb889cbfd77e47c5bdbcce03b0ecf6f2b4806c2c7 /ipc
parentd9a44089ac7754e470dfdaf3658c3455b2d7f7dd (diff)
downloadnet-3826d5dd06996007c13352b7fa65625ab570f651.tar.gz
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>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/namespace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipc/namespace.c b/ipc/namespace.c
index 59b12fcb40bdf4..c0dbfdd9015fb0 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;