提交 5d124e99 编写于 作者: P Pavel 提交者: Linus Torvalds

[PATCH] nsproxy cloning error path fix

This patch fixes copy_namespaces()'s error path.

when new nsproxy (new_ns) is created pointers to namespaces (ipc, uts) are
copied from the old nsproxy.  Later in copy_utsname, copy_ipcs, etc.
according namespaces are get-ed.  On error path needed namespaces are
put-ed, so there's no need to put new nsproxy itelf as it woud cause
putting namespaces for the second time.

Found when incorporating namespaces into OpenVZ kernel.
Signed-off-by: NPavel Emelianov <xemul@openvz.org>
Acked-by: NSerge Hallyn <serue@us.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 fcfbd547
......@@ -123,7 +123,7 @@ int copy_namespaces(int flags, struct task_struct *tsk)
put_namespace(new_ns->namespace);
out_ns:
tsk->nsproxy = old_ns;
put_nsproxy(new_ns);
kfree(new_ns);
goto out;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册