Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cgroup: add cgroup namespace to tree after owner is set

Otherwise we trip VFS_WARN_ON_ONC() in __ns_tree_add_raw().

Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-6-2e6f823ebdc0@kernel.org
Fixes: 7c6059398533 ("cgroup: support ns lookup")
Tested-by: syzbot@syzkaller.appspotmail.com
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+1 -1
+1 -1
kernel/cgroup/namespace.c
··· 30 30 ret = ns_common_init(new_ns); 31 31 if (ret) 32 32 return ERR_PTR(ret); 33 - ns_tree_add(new_ns); 34 33 return no_free_ptr(new_ns); 35 34 } 36 35 ··· 85 86 new_ns->ucounts = ucounts; 86 87 new_ns->root_cset = cset; 87 88 89 + ns_tree_add(new_ns); 88 90 return new_ns; 89 91 } 90 92