userns: fix return value on mntns_install() failure
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
@@ -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]
Serge Hallyn
Acked-byQuoted 5 lines · Zhao Hongjiang
From: Zhao Hongjiang <[email protected]>
Change return value from
-EINVALto-EPERMwhen the permission check fails.Signed-off-by Zhao Hongjiang <[email protected]>
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@@ -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
Eric W. Biederman
AppliedQuoted 4 lines · Zhao Hongjiang
From: Zhao Hongjiang <[email protected]>
Change return value from
-EINVALto-EPERMwhen the permission check fails.
Thanks applied.
Eric