mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
fc832ad364
commit
b515498f5b
@@ -80,6 +80,11 @@ static struct nsproxy *create_new_namespaces(unsigned long flags,
|
||||
err = PTR_ERR(new_nsp->ipc_ns);
|
||||
goto out_ipc;
|
||||
}
|
||||
if (new_nsp->ipc_ns != tsk->nsproxy->ipc_ns) {
|
||||
put_user_ns(new_nsp->ipc_ns->user_ns);
|
||||
new_nsp->ipc_ns->user_ns = task_cred_xxx(tsk, user)->user_ns;
|
||||
get_user_ns(new_nsp->ipc_ns->user_ns);
|
||||
}
|
||||
|
||||
new_nsp->pid_ns = copy_pid_ns(flags, task_active_pid_ns(tsk));
|
||||
if (IS_ERR(new_nsp->pid_ns)) {
|
||||
|
Reference in New Issue
Block a user