From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 767157CF9; Fri, 2 Jun 2017 16:24:18 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2017 07:24:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,285,1493708400"; d="scan'208";a="863932675" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by FMSMGA003.fm.intel.com with ESMTP; 02 Jun 2017 07:24:16 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.236]) by irsmsx105.ger.corp.intel.com ([169.254.7.168]) with mapi id 14.03.0319.002; Fri, 2 Jun 2017 15:24:16 +0100 From: "Loftus, Ciara" To: Yuanhan Liu , "dev@dpdk.org" CC: Maxime Coquelin , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vhost: fix crash on NUMA Thread-Index: AQHS2zUtF2lgGH01T0O5k4yQFcLyEKIRoRIg Date: Fri, 2 Jun 2017 14:24:15 +0000 Message-ID: <74F120C019F4A64C9B78E802F6AD4CC278DA66DD@IRSMSX106.ger.corp.intel.com> References: <1496362486-1741-1-git-send-email-yuanhan.liu@linux.intel.com> In-Reply-To: <1496362486-1741-1-git-send-email-yuanhan.liu@linux.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODJmMTI1MTQtMzBkYy00NGQ3LWIwM2UtY2NiMDU4ZTU4NDUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImpaRnJJZHFOQk1KZFwvSmNJY3kxS1pcL1NEaUxJQ2RraTdFTUpBYzh4VFJGUT0ifQ== x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost: fix crash on NUMA X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 14:24:20 -0000 > The queue allocation was changed, from allocating one queue-pair at a > time to one queue at a time. Most of the changes have been done, but > just with one being missed: the size of coping the old queue is still > based on queue-pair at numa_realloc(), which leads to overwritten issue. > As a result, crash may happen. >=20 > Fix it by specifying the right copy size. Also, the net queue macros > are not used any more. Remove them. >=20 > Fixes: ab4d7b9f1afc ("vhost: turn queue pair to vring") >=20 > Cc: stable@dpdk.org > Reported-by: Ciara Loftus > Signed-off-by: Yuanhan Liu Tested-by: Ciara Loftus > --- > lib/librte_vhost/vhost_user.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.= c > index 5c8058b..e486b78 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -238,8 +238,6 @@ numa_realloc(struct virtio_net *dev, int index) > struct vhost_virtqueue *old_vq, *vq; > int ret; >=20 > - enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM}; > - > old_dev =3D dev; > vq =3D old_vq =3D dev->virtqueue[index]; >=20 > @@ -261,7 +259,7 @@ numa_realloc(struct virtio_net *dev, int index) > if (!vq) > return dev; >=20 > - memcpy(vq, old_vq, sizeof(*vq) * VIRTIO_QNUM); > + memcpy(vq, old_vq, sizeof(*vq)); > rte_free(old_vq); > } >=20 > -- > 2.8.1