]> Pileus Git - ~andy/linux/blobdiff - drivers/vhost/tcm_vhost.c
tcm_vhost: Fix vhost_scsi_target structure alignment
[~andy/linux] / drivers / vhost / tcm_vhost.c
index 74b2edaaf1f6e748efc9bd93eccb3161ea258754..ed8e2e6c8df28715455c7ac09423ef447115e976 100644 (file)
@@ -995,11 +995,15 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,
        case VHOST_SCSI_SET_ENDPOINT:
                if (copy_from_user(&backend, argp, sizeof backend))
                        return -EFAULT;
+               if (backend.reserved != 0)
+                       return -EOPNOTSUPP;
 
                return vhost_scsi_set_endpoint(vs, &backend);
        case VHOST_SCSI_CLEAR_ENDPOINT:
                if (copy_from_user(&backend, argp, sizeof backend))
                        return -EFAULT;
+               if (backend.reserved != 0)
+                       return -EOPNOTSUPP;
 
                return vhost_scsi_clear_endpoint(vs, &backend);
        case VHOST_SCSI_GET_ABI_VERSION: