From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko Date: Fri, 28 Jun 2013 21:32:25 -0700 (PDT) Message-ID: <20130628.213225.150653146873611065.davem__11835.6697181754$1372480362$gmane$org@davemloft.net> References: <1372320004-20502-1-git-send-email-asias@redhat.com> <1372320004-20502-3-git-send-email-asias@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1372320004-20502-3-git-send-email-asias@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: asias@redhat.com Cc: acking@vmware.com, kvm@vger.kernel.org, dtor@vmware.com, netdev@vger.kernel.org, grantr@vmware.com, virtualization@lists.linux-foundation.org, penberg@kernel.org, mst@redhat.com, sasha.levin@oracle.com List-Id: virtualization@lists.linuxfoundation.org From: Asias He Date: Thu, 27 Jun 2013 16:00:01 +0800 > +static void > +virtio_transport_recv_dgram(struct sock *sk, > + struct virtio_vsock_pkt *pkt) ... > + memcpy(skb->data, pkt, sizeof(*pkt)); > + memcpy(skb->data + sizeof(*pkt), pkt->buf, pkt->len); Are you sure this is right? Shouldn't you be using "sizeof(struct virtio_vsock_hdr)" instead of "sizeof(*pkt)". 'pkt' is "struct virtio_vsock_pkt" and has all kinds of meta-data you probably don't mean to include in the SKB.