summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2007-05-08 09:30:40 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 20:15:12 +0200
commitee6f958291e2a768fd727e7a67badfff0b67711a (patch)
tree1313cb3a5d50a296b1801022f904f3a5e9601de2 /fs
parentconsole UTF-8 fixes (diff)
downloadlinux-ee6f958291e2a768fd727e7a67badfff0b67711a.tar.xz
linux-ee6f958291e2a768fd727e7a67badfff0b67711a.zip
check privileges before setting mount propagation
There's a missing check for CAP_SYS_ADMIN in do_change_type(). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 72bb1062bfe7..b696e3a0d18f 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -886,6 +886,9 @@ static int do_change_type(struct nameidata *nd, int flag)
int recurse = flag & MS_REC;
int type = flag & ~MS_REC;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
if (nd->dentry != nd->mnt->mnt_root)
return -EINVAL;