From: Miklos Szeredi Date: Tue, 8 May 2007 07:30:40 +0000 (-0700) Subject: check privileges before setting mount propagation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ee6f958291e2a768fd727e7a67badfff0b67711a;p=linux-beck.git check privileges before setting mount propagation There's a missing check for CAP_SYS_ADMIN in do_change_type(). Signed-off-by: Miklos Szeredi Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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;