lkml.org 
[lkml]   [2020]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.7 012/120] vhost/scsi: fix up req type endian-ness
    Date
    From: Michael S. Tsirkin <mst@redhat.com>

    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>

    ---
    drivers/vhost/scsi.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/vhost/scsi.c
    +++ b/drivers/vhost/scsi.c
    @@ -1215,7 +1215,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_sc
    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);

    \
     
     \ /
      Last update: 2020-08-03 14:57    [W:3.862 / U:0.736 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site