summaryrefslogtreecommitdiff
path: root/drivers/vhost
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2020-07-10 06:36:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-05 09:59:42 +0200
commit96f105943cff8816436fc814b3e150b2bfc5a991 (patch)
treeb427b9c40b45a5d5c2d48013239020eabe060f05 /drivers/vhost
parent951117a2079bf0f725e0f297d4bfb5a9a1371864 (diff)
vhost/scsi: fix up req type endian-ness
commit 295c1b9852d000580786375304a9800bd9634d15 upstream. vhost/scsi doesn't handle type conversion correctly for request type when using virtio 1.0 and up for BE, or cross-endian platforms. Fix it up using vhost_32_to_cpu. Cc: stable@vger.kernel.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 88ce114790d7..f63f84a25725 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1215,7 +1215,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
continue;
}
- switch (v_req.type) {
+ switch (vhost32_to_cpu(vq, v_req.type)) {
case VIRTIO_SCSI_T_TMF:
vc.req = &v_req.tmf;
vc.req_size = sizeof(struct virtio_scsi_ctrl_tmf_req);