From: Miklos Szeredi 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 --- fs/namespace.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN fs/namespace.c~check-privileges-before-setting-mount-propagation fs/namespace.c --- a/fs/namespace.c~check-privileges-before-setting-mount-propagation +++ a/fs/namespace.c @@ -886,6 +886,9 @@ static int do_change_type(struct nameida 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; _