linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vhost/scsi: fix up req type endian-ness
@ 2020-07-10 10:48 Michael S. Tsirkin
  2020-07-13  3:31 ` Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2020-07-10 10:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: stable, Jason Wang, Paolo Bonzini, Stefan Hajnoczi,
	virtualization, kvm, netdev

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>
---
 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);
-- 
MST


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] vhost/scsi: fix up req type endian-ness
  2020-07-10 10:48 [PATCH] vhost/scsi: fix up req type endian-ness Michael S. Tsirkin
@ 2020-07-13  3:31 ` Jason Wang
  2020-07-13  9:29 ` Stefan Hajnoczi
  2020-07-16  0:27 ` Sasha Levin
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2020-07-13  3:31 UTC (permalink / raw)
  To: Michael S. Tsirkin, linux-kernel
  Cc: stable, Paolo Bonzini, Stefan Hajnoczi, virtualization, kvm, netdev


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@vger.kernel.org
> Signed-off-by: Michael S. Tsirkin <mst@redhat.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@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vhost/scsi: fix up req type endian-ness
  2020-07-10 10:48 [PATCH] vhost/scsi: fix up req type endian-ness Michael S. Tsirkin
  2020-07-13  3:31 ` Jason Wang
@ 2020-07-13  9:29 ` Stefan Hajnoczi
  2020-07-16  0:27 ` Sasha Levin
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2020-07-13  9:29 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: linux-kernel, stable, Jason Wang, Paolo Bonzini, virtualization,
	kvm, netdev

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

On Fri, Jul 10, 2020 at 06:48:51AM -0400, 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@vger.kernel.org
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  drivers/vhost/scsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vhost/scsi: fix up req type endian-ness
  2020-07-10 10:48 [PATCH] vhost/scsi: fix up req type endian-ness Michael S. Tsirkin
  2020-07-13  3:31 ` Jason Wang
  2020-07-13  9:29 ` Stefan Hajnoczi
@ 2020-07-16  0:27 ` Sasha Levin
  2 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2020-07-16  0:27 UTC (permalink / raw)
  To: Sasha Levin, Michael S. Tsirkin, linux-kernel
  Cc: stable, Jason Wang, stable, stable

Hi

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.7.8, v5.4.51, v4.19.132, v4.14.188, v4.9.230, v4.4.230.

v5.7.8: Build OK!
v5.4.51: Build OK!
v4.19.132: Failed to apply! Possible dependencies:
    0d02dbd68c47b ("vhost/scsi: Respond to control queue operations")

v4.14.188: Failed to apply! Possible dependencies:
    0d02dbd68c47b ("vhost/scsi: Respond to control queue operations")

v4.9.230: Failed to apply! Possible dependencies:
    0d02dbd68c47b ("vhost/scsi: Respond to control queue operations")

v4.4.230: Failed to apply! Possible dependencies:
    0d02dbd68c47b ("vhost/scsi: Respond to control queue operations")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-16  0:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 10:48 [PATCH] vhost/scsi: fix up req type endian-ness Michael S. Tsirkin
2020-07-13  3:31 ` Jason Wang
2020-07-13  9:29 ` Stefan Hajnoczi
2020-07-16  0:27 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).