From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Stefan Hajnoczi <stefanha@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org
Subject: Re: [PATCH 09/10] vsock/virtio: fix src/dst cid format
Date: Sun, 11 Dec 2016 04:54:46 +0200 [thread overview]
Message-ID: <20161211045205-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <a0dcb733-ab1c-ac66-2300-fcb90fbacea2@redhat.com>
On Wed, Dec 07, 2016 at 12:31:56PM +0800, Jason Wang wrote:
>
>
> On 2016年12月06日 23:41, Michael S. Tsirkin wrote:
> > These fields are 64 bit, using le32_to_cpu and friends
> > on these will not do the right thing.
> > Fix this up.
> >
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > net/vmw_vsock/virtio_transport_common.c | 14 +++++++-------
> > 1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
> > index 6120384..22e99c4 100644
> > --- a/net/vmw_vsock/virtio_transport_common.c
> > +++ b/net/vmw_vsock/virtio_transport_common.c
> > @@ -606,9 +606,9 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt)
> > return 0;
> > pkt = virtio_transport_alloc_pkt(&info, 0,
> > - le32_to_cpu(pkt->hdr.dst_cid),
> > + le64_to_cpu(pkt->hdr.dst_cid),
> > le32_to_cpu(pkt->hdr.dst_port),
> > - le32_to_cpu(pkt->hdr.src_cid),
> > + le64_to_cpu(pkt->hdr.src_cid),
> > le32_to_cpu(pkt->hdr.src_port));
>
> Looking at sockaddr_vm, svm_cid is "unsigned int", do we really want 64 bit
> here?
Can't change the protocol at this point.
> > if (!pkt)
> > return -ENOMEM;
> > @@ -823,7 +823,7 @@ virtio_transport_send_response(struct vsock_sock *vsk,
> > struct virtio_vsock_pkt_info info = {
> > .op = VIRTIO_VSOCK_OP_RESPONSE,
> > .type = VIRTIO_VSOCK_TYPE_STREAM,
> > - .remote_cid = le32_to_cpu(pkt->hdr.src_cid),
> > + .remote_cid = le64_to_cpu(pkt->hdr.src_cid),
> > .remote_port = le32_to_cpu(pkt->hdr.src_port),
> > .reply = true,
> > };
> > @@ -863,9 +863,9 @@ virtio_transport_recv_listen(struct sock *sk, struct virtio_vsock_pkt *pkt)
> > child->sk_state = SS_CONNECTED;
> > vchild = vsock_sk(child);
> > - vsock_addr_init(&vchild->local_addr, le32_to_cpu(pkt->hdr.dst_cid),
> > + vsock_addr_init(&vchild->local_addr, le64_to_cpu(pkt->hdr.dst_cid),
> > le32_to_cpu(pkt->hdr.dst_port));
> > - vsock_addr_init(&vchild->remote_addr, le32_to_cpu(pkt->hdr.src_cid),
> > + vsock_addr_init(&vchild->remote_addr, le64_to_cpu(pkt->hdr.src_cid),
> > le32_to_cpu(pkt->hdr.src_port));
> > vsock_insert_connected(vchild);
> > @@ -904,9 +904,9 @@ void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt)
> > struct sock *sk;
> > bool space_available;
> > - vsock_addr_init(&src, le32_to_cpu(pkt->hdr.src_cid),
> > + vsock_addr_init(&src, le64_to_cpu(pkt->hdr.src_cid),
> > le32_to_cpu(pkt->hdr.src_port));
> > - vsock_addr_init(&dst, le32_to_cpu(pkt->hdr.dst_cid),
> > + vsock_addr_init(&dst, le64_to_cpu(pkt->hdr.dst_cid),
> > le32_to_cpu(pkt->hdr.dst_port));
> > trace_virtio_transport_recv_pkt(src.svm_cid, src.svm_port,
next prev parent reply other threads:[~2016-12-11 2:54 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 15:40 [PATCH 00/10] virtio: sparse fixes Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-06 15:40 ` [PATCH 01/10] virtio_console: drop unused config fields Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-07 4:12 ` Jason Wang
2016-12-07 4:12 ` Jason Wang
2016-12-06 15:40 ` [PATCH 02/10] drm/virtio: fix endianness in primary_plane_update Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-07 4:13 ` Jason Wang
2016-12-07 4:13 ` Jason Wang
2016-12-06 15:40 ` [PATCH 03/10] drm/virtio: fix lock context imbalance Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-07 4:13 ` Jason Wang
2016-12-07 4:13 ` Jason Wang
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-06 15:40 ` [PATCH 04/10] drm/virtio: annotate virtio_gpu_queue_ctrl_buffer_locked Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-07 4:15 ` Jason Wang
2016-12-07 4:15 ` Jason Wang
2016-12-06 15:40 ` [PATCH 05/10] vhost: make interval tree static inline Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-07 4:16 ` Jason Wang
2016-12-07 4:16 ` Jason Wang
2016-12-06 15:40 ` [PATCH 06/10] vhost: add missing __user annotations Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-07 4:17 ` Jason Wang
2016-12-07 4:17 ` Jason Wang
2016-12-06 15:40 ` [PATCH 07/10] vsock/virtio: add a missing __le annotation Michael S. Tsirkin
2016-12-06 15:40 ` Michael S. Tsirkin
2016-12-07 4:19 ` Jason Wang
2016-12-07 4:19 ` Jason Wang
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-06 15:41 ` [PATCH 08/10] vsock/virtio: mark an internal function static Michael S. Tsirkin
2016-12-06 15:41 ` Michael S. Tsirkin
2016-12-07 4:21 ` Jason Wang
2016-12-07 4:21 ` Jason Wang
2016-12-08 14:25 ` Michael S. Tsirkin
2016-12-08 14:25 ` Michael S. Tsirkin
2016-12-12 1:56 ` Jason Wang
2016-12-12 1:56 ` Jason Wang
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-06 15:41 ` [PATCH 09/10] vsock/virtio: fix src/dst cid format Michael S. Tsirkin
2016-12-06 15:41 ` Michael S. Tsirkin
2016-12-07 4:31 ` Jason Wang
2016-12-07 4:31 ` Jason Wang
2016-12-11 2:54 ` Michael S. Tsirkin [this message]
2016-12-11 2:54 ` Michael S. Tsirkin
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-06 15:41 ` [PATCH 10/10] virtio: enable endian checks for sparse builds Michael S. Tsirkin
2016-12-06 15:41 ` Michael S. Tsirkin
2016-12-06 15:41 ` Michael S. Tsirkin
2016-12-07 5:27 ` Jason Wang
2016-12-07 5:27 ` Jason Wang
2016-12-07 6:25 ` Johannes Berg
2016-12-07 6:25 ` Johannes Berg
2016-12-07 13:22 ` Michael S. Tsirkin
2016-12-07 13:22 ` Michael S. Tsirkin
2016-12-07 13:22 ` Michael S. Tsirkin
2016-12-07 7:30 ` Christoph Hellwig
2016-12-07 7:30 ` Christoph Hellwig
2016-12-07 7:30 ` Christoph Hellwig
2016-12-07 7:30 ` Christoph Hellwig
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-07 14:09 ` Stefan Hajnoczi
2016-12-06 15:41 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161211045205-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.