From: Zhao Hongjiang <[email protected]>

Change return value from -EINVAL to -EPERM when the permission check fails.

Signed-off-by: Zhao Hongjiang <[email protected]>
Signed-off-by: Eric W. Biederman <[email protected]>
---
 fs/namespace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 9ddc86f..cab78a7 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;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to