Commit ae11e0f1 authored by Zhao Hongjiang's avatar Zhao Hongjiang Committed by Eric W. Biederman

userns: fix return value on mntns_install() failure

Change return value from -EINVAL to -EPERM when the permission check fails.
Signed-off-by: default avatarZhao Hongjiang <zhaohongjiang@huawei.com>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 0c55cfc4
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment