]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/btrfs/super.c
Btrfs: add permission checks to the ioctls
[linux-2.6-omap-h63xx.git] / fs / btrfs / super.c
index 84c3b66564d0f16a34712fc4c0803771904ac362..3814238d6eba473199bc5d597b6c51edaa9a4861 100644 (file)
@@ -589,6 +589,9 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
        int ret = 0;
        int len;
 
+       if (!capable(CAP_SYS_ADMIN))
+               return -EPERM;
+
        vol = kmalloc(sizeof(*vol), GFP_KERNEL);
        if (copy_from_user(vol, (void __user *)arg, sizeof(*vol))) {
                ret = -EFAULT;