hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/kernel/cgroup/namespace.c
....@@ -95,11 +95,12 @@
9595 return container_of(ns, struct cgroup_namespace, ns);
9696 }
9797
98
-static int cgroupns_install(struct nsproxy *nsproxy, struct ns_common *ns)
98
+static int cgroupns_install(struct nsset *nsset, struct ns_common *ns)
9999 {
100
+ struct nsproxy *nsproxy = nsset->nsproxy;
100101 struct cgroup_namespace *cgroup_ns = to_cg_ns(ns);
101102
102
- if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN) ||
103
+ if (!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN) ||
103104 !ns_capable(cgroup_ns->user_ns, CAP_SYS_ADMIN))
104105 return -EPERM;
105106
....@@ -148,9 +149,3 @@
148149 .install = cgroupns_install,
149150 .owner = cgroupns_owner,
150151 };
151
-
152
-static __init int cgroup_namespaces_init(void)
153
-{
154
- return 0;
155
-}
156
-subsys_initcall(cgroup_namespaces_init);