aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/nsproxy.c
diff options
context:
space:
mode:
authorSerge E. Hallyn <serge@hallyn.com>2011-03-23 19:43:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:47:07 -0400
commitb515498f5bb5f38fc0e390b4ff7d00b6077de127 (patch)
treeb76dfc56415adee9aec5d8619124059ed3ab02a5 /kernel/nsproxy.c
parentfc832ad3645f0507f24d11752544525a50a83c71 (diff)
userns: add a user namespace owner of ipc ns
Changelog: Feb 15: Don't set new ipc->user_ns if we didn't create a new ipc_ns. Feb 23: Move extern declaration to ipc_namespace.h, and group fwd declarations at top. Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Daniel Lezcano <daniel.lezcano@free.fr> Acked-by: David Howells <dhowells@redhat.com> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/nsproxy.c')
-rw-r--r--kernel/nsproxy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index b97fc9d04ddf..ac8a56e90bf8 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -80,6 +80,11 @@ static struct nsproxy *create_new_namespaces(unsigned long flags,
80 err = PTR_ERR(new_nsp->ipc_ns); 80 err = PTR_ERR(new_nsp->ipc_ns);
81 goto out_ipc; 81 goto out_ipc;
82 } 82 }
83 if (new_nsp->ipc_ns != tsk->nsproxy->ipc_ns) {
84 put_user_ns(new_nsp->ipc_ns->user_ns);
85 new_nsp->ipc_ns->user_ns = task_cred_xxx(tsk, user)->user_ns;
86 get_user_ns(new_nsp->ipc_ns->user_ns);
87 }
83 88
84 new_nsp->pid_ns = copy_pid_ns(flags, task_active_pid_ns(tsk)); 89 new_nsp->pid_ns = copy_pid_ns(flags, task_active_pid_ns(tsk));
85 if (IS_ERR(new_nsp->pid_ns)) { 90 if (IS_ERR(new_nsp->pid_ns)) {