mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
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>
This commit is contained in:
parent
2f1a2ccb9c
commit
ee6f958291
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user