[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8acbce23-275a-141a-0bfb-1535c6edcbb4@redhat.com>
Date: Mon, 13 Jul 2020 11:31:42 +0800
From: Jason Wang <jasowang@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>, linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Stefan Hajnoczi <stefanha@...hat.com>,
virtualization@...ts.linux-foundation.org, kvm@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] vhost/scsi: fix up req type endian-ness
On 2020/7/10 下午6:48, Michael S. Tsirkin wrote:
> 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@...r.kernel.org
> Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> ---
> drivers/vhost/scsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 6fb4d7ecfa19..b22adf03f584 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);
Acked-by: Jason Wang <jasowang@...hat.com>
Powered by blists - more mailing lists