]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/block/nbd.c
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
[linux.git] / drivers / block / nbd.c
index 2aa87cbdede0ed19b77c8e4aaffea2c2d8146758..3684e21d543f23e95bda09fb895e8933b9bce186 100644 (file)
@@ -1194,6 +1194,12 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
 
+       /* The block layer will pass back some non-nbd ioctls in case we have
+        * special handling for them, but we don't so just return an error.
+        */
+       if (_IOC_TYPE(cmd) != 0xab)
+               return -EINVAL;
+
        mutex_lock(&nbd->config_lock);
 
        /* Don't allow ioctl operations on a nbd device that was created with