From ee6f958291e2a768fd727e7a67badfff0b67711a Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 8 May 2007 00:30:40 -0700 Subject: [PATCH] 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 --- fs/namespace.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.5