提交 ae11e0f1 编写于 作者: Z Zhao Hongjiang 提交者: 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: NZhao Hongjiang <zhaohongjiang@huawei.com>
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册