|
@@ -1194,6 +1194,12 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
|
if (!capable(CAP_SYS_ADMIN))
|
|
if (!capable(CAP_SYS_ADMIN))
|
|
return -EPERM;
|
|
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);
|
|
mutex_lock(&nbd->config_lock);
|
|
|
|
|
|
/* Don't allow ioctl operations on a nbd device that was created with
|
|
/* Don't allow ioctl operations on a nbd device that was created with
|