| .. | .. |
|---|
| 95 | 95 | return container_of(ns, struct cgroup_namespace, ns); |
|---|
| 96 | 96 | } |
|---|
| 97 | 97 | |
|---|
| 98 | | -static int cgroupns_install(struct nsproxy *nsproxy, struct ns_common *ns) |
|---|
| 98 | +static int cgroupns_install(struct nsset *nsset, struct ns_common *ns) |
|---|
| 99 | 99 | { |
|---|
| 100 | + struct nsproxy *nsproxy = nsset->nsproxy; |
|---|
| 100 | 101 | struct cgroup_namespace *cgroup_ns = to_cg_ns(ns); |
|---|
| 101 | 102 | |
|---|
| 102 | | - if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN) || |
|---|
| 103 | + if (!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN) || |
|---|
| 103 | 104 | !ns_capable(cgroup_ns->user_ns, CAP_SYS_ADMIN)) |
|---|
| 104 | 105 | return -EPERM; |
|---|
| 105 | 106 | |
|---|
| .. | .. |
|---|
| 148 | 149 | .install = cgroupns_install, |
|---|
| 149 | 150 | .owner = cgroupns_owner, |
|---|
| 150 | 151 | }; |
|---|
| 151 | | - |
|---|
| 152 | | -static __init int cgroup_namespaces_init(void) |
|---|
| 153 | | -{ |
|---|
| 154 | | - return 0; |
|---|
| 155 | | -} |
|---|
| 156 | | -subsys_initcall(cgroup_namespaces_init); |
|---|