Skip to contentSkip to conversation

userns: fix return value on mntns_install() failure

PATCH Applied Zhao Hongjiang 3 participants 3 messages Sep 13, 2012 – Sep 16, 2012 1 message not in the archive VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 userns: fix return value on mntns_install() failure

From: Zhao Hongjiang <[email protected]>

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

---
 fs/namespace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/namespace.c +1 -1
index 72be266..1e79d20 100644
@@ -2764,7 +2764,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.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#2 lore raw
Quoted 5 lines · Zhao Hongjiang

From: Zhao Hongjiang <[email protected]>

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

That also matches what other *_install do.

Quoted 22 lines
---
 fs/namespace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/namespace.c +1 -2
index 72be266..1e79d20 100644
@@ -2764,7 +2764,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.1

_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linuxfoundation.org/mailman/listinfo/containers