From: Zhao Hongjiang Date: Thu, 13 Sep 2012 08:38:03 +0000 (+0800) Subject: userns: fix return value on mntns_install() failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ae11e0f18482bfe0cd83b9b61434ea7e0bd94e25;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git userns: fix return value on mntns_install() failure Change return value from -EINVAL to -EPERM when the permission check fails. Signed-off-by: Zhao Hongjiang Signed-off-by: Eric W. Biederman --- diff --git a/fs/namespace.c b/fs/namespace.c index 9ddc86f93221..cab78a74aca3 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2775,7 +2775,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns) if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) || !nsown_capable(CAP_SYS_CHROOT)) - return -EINVAL; + return -EPERM; if (fs->users != 1) return -EINVAL;