* [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems
@ 2018-06-20 13:51 Claudio Imbrenda
2018-06-21 16:07 ` Stefan Hajnoczi
2018-06-22 0:34 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Claudio Imbrenda @ 2018-06-20 13:51 UTC (permalink / raw)
To: stefanha
Cc: davem, jhansen, cavery, borntraeger, fiuczy, linux-kernel, netdev
The dst_cid and src_cid are 64 bits, therefore 64 bit accessors should be
used, and in fact in virtio_transport_common.c only 64 bit accessors are
used. Using 32 bit accessors for 64 bit values breaks big endian systems.
This patch fixes a wrong use of le32_to_cpu in virtio_transport_send_pkt.
Fixes: b9116823189e85ccf384 ("VSOCK: add loopback to virtio_transport")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
---
net/vmw_vsock/virtio_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 8e03bd3..5d3cce9 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -201,7 +201,7 @@ virtio_transport_send_pkt(struct virtio_vsock_pkt *pkt)
return -ENODEV;
}
- if (le32_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid)
+ if (le64_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid)
return virtio_transport_send_pkt_loopback(vsock, pkt);
if (pkt->reply)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems
2018-06-20 13:51 [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems Claudio Imbrenda
@ 2018-06-21 16:07 ` Stefan Hajnoczi
2018-06-22 0:34 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-06-21 16:07 UTC (permalink / raw)
To: Claudio Imbrenda
Cc: davem, jhansen, cavery, borntraeger, fiuczy, linux-kernel, netdev
[-- Attachment #1: Type: text/plain, Size: 681 bytes --]
On Wed, Jun 20, 2018 at 03:51:51PM +0200, Claudio Imbrenda wrote:
> The dst_cid and src_cid are 64 bits, therefore 64 bit accessors should be
> used, and in fact in virtio_transport_common.c only 64 bit accessors are
> used. Using 32 bit accessors for 64 bit values breaks big endian systems.
>
> This patch fixes a wrong use of le32_to_cpu in virtio_transport_send_pkt.
>
> Fixes: b9116823189e85ccf384 ("VSOCK: add loopback to virtio_transport")
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
> ---
> net/vmw_vsock/virtio_transport.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: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems
2018-06-20 13:51 [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems Claudio Imbrenda
2018-06-21 16:07 ` Stefan Hajnoczi
@ 2018-06-22 0:34 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-06-22 0:34 UTC (permalink / raw)
To: imbrenda
Cc: stefanha, jhansen, cavery, borntraeger, fiuczy, linux-kernel, netdev
From: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Date: Wed, 20 Jun 2018 15:51:51 +0200
> The dst_cid and src_cid are 64 bits, therefore 64 bit accessors should be
> used, and in fact in virtio_transport_common.c only 64 bit accessors are
> used. Using 32 bit accessors for 64 bit values breaks big endian systems.
>
> This patch fixes a wrong use of le32_to_cpu in virtio_transport_send_pkt.
>
> Fixes: b9116823189e85ccf384 ("VSOCK: add loopback to virtio_transport")
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Applied and queued up for -stable, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-22 0:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 13:51 [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems Claudio Imbrenda
2018-06-21 16:07 ` Stefan Hajnoczi
2018-06-22 0:34 ` David Miller
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).