]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/namespace.c
check privileges before setting mount propagation
[karo-tx-linux.git] / fs / namespace.c
index 72bb1062bfe77886394a79c0822ec141aad55045..b696e3a0d18fcf2d4bb017dcaa36dacb39c565e6 100644 (file)
@@ -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;