From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 97FF3567A for ; Wed, 13 Jan 2016 10:25:15 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 13 Jan 2016 01:25:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,288,1449561600"; d="scan'208";a="889527471" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 13 Jan 2016 01:25:14 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 13 Jan 2016 01:25:13 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 13 Jan 2016 01:25:13 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.111]) by shsmsx102.ccr.corp.intel.com ([169.254.2.133]) with mapi id 14.03.0248.002; Wed, 13 Jan 2016 17:24:18 +0800 From: "Xie, Huawei" To: Pavel Fedin , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation Thread-Index: AdFN5C2FcQQ+0NIpQtu+e7/JrHFEcQ== Date: Wed, 13 Jan 2016 09:24:18 +0000 Message-ID: References: <005a01d14dd4$a02c5340$e084f9c0$@samsung.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.4.160] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 09:25:16 -0000 On 1/13/2016 3:33 PM, Pavel Fedin wrote:=0A= > Malfunctioning virtio clients may not send VHOST_USER_SET_MEM_TABLE for= =0A= > some reason. This causes NULL dereference in qva_to_vva().=0A= =0A= Do you have examples for the malfunctioning clients? If so, could you=0A= list them in the commit message?=0A= =0A= >=0A= > Signed-off-by: Pavel Fedin =0A= > Acked-by: Yuanhan Liu =0A= > ---=0A= > lib/librte_vhost/virtio-net.c | 2 +-=0A= > 1 file changed, 1 insertion(+), 1 deletion(-)=0A= >=0A= > diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.= c=0A= > index 0ba5045..3e7cec0 100644=0A= > --- a/lib/librte_vhost/virtio-net.c=0A= > +++ b/lib/librte_vhost/virtio-net.c=0A= > @@ -630,7 +630,7 @@ set_vring_addr(struct vhost_device_ctx ctx, struct vh= ost_vring_addr *addr)=0A= > struct vhost_virtqueue *vq;=0A= > =0A= > dev =3D get_device(ctx);=0A= > - if (dev =3D=3D NULL)=0A= > + if ((dev =3D=3D NULL) || (dev->mem =3D=3D NULL))=0A= > return -1;=0A= > =0A= > /* addr->index refers to the queue index. The txq 1, rxq is 0. */=0A= =0A=