[patch userns-always-map-user-v64] userns: release the reference of old userns in userns_install

Gao feng gaofeng at cn.fujitsu.com
Fri Oct 12 02:47:04 UTC 2012


we should release the reference of old userns.

Signed-off-by: Gao feng <gaofeng at cn.fujitsu.com>
---
 kernel/user_namespace.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 054471d..dafa125 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -812,6 +812,7 @@ static int userns_install(struct nsproxy *nsproxy, void *ns)
 	if (!cred)
 		return -ENOMEM;
 
+	put_user_ns(cred->user_ns);
 	set_cred_user_ns(cred, get_user_ns(user_ns));
 
 	return commit_creds(cred);
-- 
1.7.7.6



More information about the Containers mailing list