From: Miklos Szeredi Date: Tue, 8 May 2007 07:30:40 +0000 (-0700) Subject: check privileges before setting mount propagation X-Git-Tag: v2.6.22-rc1~634 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee6f958291e2a768fd727e7a67badfff0b67711a;p=linux-2.6 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 72bb1062bf..b696e3a0d1 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;