aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/nsproxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/nsproxy.c')
-rw-r--r--kernel/nsproxy.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index e38bed75367d..895e3a3f2044 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -79,8 +79,15 @@ static struct nsproxy *create_new_namespaces(int flags, struct task_struct *tsk,
79 if (IS_ERR(new_nsp->pid_ns)) 79 if (IS_ERR(new_nsp->pid_ns))
80 goto out_pid; 80 goto out_pid;
81 81
82 new_nsp->user_ns = copy_user_ns(flags, tsk->nsproxy->user_ns);
83 if (IS_ERR(new_nsp->user_ns))
84 goto out_user;
85
82 return new_nsp; 86 return new_nsp;
83 87
88out_user:
89 if (new_nsp->pid_ns)
90 put_pid_ns(new_nsp->pid_ns);
84out_pid: 91out_pid:
85 if (new_nsp->ipc_ns) 92 if (new_nsp->ipc_ns)
86 put_ipc_ns(new_nsp->ipc_ns); 93 put_ipc_ns(new_nsp->ipc_ns);
@@ -140,6 +147,8 @@ void free_nsproxy(struct nsproxy *ns)
140 put_ipc_ns(ns->ipc_ns); 147 put_ipc_ns(ns->ipc_ns);
141 if (ns->pid_ns) 148 if (ns->pid_ns)
142 put_pid_ns(ns->pid_ns); 149 put_pid_ns(ns->pid_ns);
150 if (ns->user_ns)
151 put_user_ns(ns->user_ns);
143 kfree(ns); 152 kfree(ns);
144} 153}
145 154