aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c3
1 files changed, 3 insertions, 0 deletions
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)
886 int recurse = flag & MS_REC; 886 int recurse = flag & MS_REC;
887 int type = flag & ~MS_REC; 887 int type = flag & ~MS_REC;
888 888
889 if (!capable(CAP_SYS_ADMIN))
890 return -EPERM;
891
889 if (nd->dentry != nd->mnt->mnt_root) 892 if (nd->dentry != nd->mnt->mnt_root)
890 return -EINVAL; 893 return -EINVAL;
891 894