All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] user_ns: Add support for unprivileged remount
@ 2012-09-13  8:43 Zhao Hongjiang
       [not found] ` <50519CB2.7040801-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Zhao Hongjiang @ 2012-09-13  8:43 UTC (permalink / raw)
  To: ebiederm-aS9lmoZGLiVWk0Htik3J/w
  Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

From: Zhao Hongjiang <zhaohongjiang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Relax the permission checks to allow unprivileged users that have
CAP_SYS_ADMIN permissions in the user namespace referred to by the
current mount namespace to be allowed to remount filesystems.

Signed-off-by: Zhao Hongjiang <zhaohongjiang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 fs/namespace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index af238d0..72be266 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1748,7 +1748,7 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
 	struct super_block *sb = path->mnt->mnt_sb;
 	struct mount *mnt = real_mount(path->mnt);

-	if (!capable(CAP_SYS_ADMIN))
+	if (!ns_capable(mnt->mnt_ns->user_ns, CAP_SYS_ADMIN))
 		return -EPERM;

 	if (!check_mnt(mnt))
-- 1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-21  7:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13  8:43 [PATCH] user_ns: Add support for unprivileged remount Zhao Hongjiang
     [not found] ` <50519CB2.7040801-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-09-13 21:26   ` Eric W. Biederman
     [not found]     ` <87fw6lfwc3.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-14  9:23       ` Zhao Hongjiang
     [not found]         ` <5052F783.3040904-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-09-14  9:33           ` Eric W. Biederman
     [not found]             ` <877grxdk48.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2013-01-17  7:17               ` Gao feng
     [not found]                 ` <50F7A59A.1080601-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-01-17 10:06                   ` Eric W. Biederman
     [not found]                     ` <87vcawf7jr.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2013-01-21  2:09                       ` Gao feng
     [not found]                         ` <50FCA340.1020404-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-01-21  7:26                           ` Eric W. Biederman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.