From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29381A0527 for ; Mon, 9 Nov 2020 06:10:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F01ED592C; Mon, 9 Nov 2020 06:09:59 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 1EDF12BF1; Mon, 9 Nov 2020 06:09:54 +0100 (CET) IronPort-SDR: Jl+F6u3nLJr8KdiMSpepxuxrbJ4Lt/S5of4UDVQK92Qy0LxmPk2sYBfkjRD4qz9zkFSLJDvFhx mNCtRvHPGtqA== X-IronPort-AV: E=McAfee;i="6000,8403,9799"; a="231382986" X-IronPort-AV: E=Sophos;i="5.77,462,1596524400"; d="scan'208";a="231382986" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2020 21:09:52 -0800 IronPort-SDR: HdsAO/IV9zJKKrXXKEmaMJtTA0X1LyGCHE4hbyBI/K01R8KTDOQmP+yahYr2rHhGYB7onPwLOv rucNgDp4nc+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,462,1596524400"; d="scan'208";a="354008187" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga008.jf.intel.com with ESMTP; 08 Nov 2020 21:09:52 -0800 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 8 Nov 2020 21:09:51 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 9 Nov 2020 13:09:49 +0800 Received: from shsmsx605.ccr.corp.intel.com ([10.109.6.215]) by SHSMSX605.ccr.corp.intel.com ([10.109.6.215]) with mapi id 15.01.1713.004; Mon, 9 Nov 2020 13:09:49 +0800 From: "Jiang, YuX" To: Maxime Coquelin , "dev@dpdk.org" , "Xia, Chenbo" , "amorenoz@redhat.com" CC: "stable@dpdk.org" , "Wang, Yinan" , "Jiang, YuX" Thread-Topic: [PATCH] vhost: fix virtqueue initialization Thread-Index: AQHWtEvVO8tpnrlOuEK7daFRjsJ4K6m/RF/g Date: Mon, 9 Nov 2020 05:09:49 +0000 Message-ID: <3d29ed679e83421c9c3d637664f84184@intel.com> References: <20201106144744.176463-1-maxime.coquelin@redhat.com> In-Reply-To: <20201106144744.176463-1-maxime.coquelin@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH] vhost: fix virtqueue initialization X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Tested-by: JiangYuX Best Regards Jiang yu > -----Original Message----- > From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com] > Sent: Friday, November 6, 2020 10:48 PM > To: dev@dpdk.org; Xia, Chenbo ; > amorenoz@redhat.com > Cc: stable@dpdk.org; Maxime Coquelin ; > Jiang, YuX > Subject: [PATCH] vhost: fix virtqueue initialization >=20 > This patches fixes virtqueue initialization issue causing segfault or fil= e > descriptor being closed unexpectedly. >=20 > The wrong index was passed to init_vring_queue() by > alloc_vring_queue() when a hole in the virtqueue array was met. >=20 > Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation") > Cc: stable@dpdk.org >=20 > Reported-by: Yu Jiang > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/vhost.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index > 8a151a9c1d..b83cf639eb 100644 > --- a/lib/librte_vhost/vhost.c > +++ b/lib/librte_vhost/vhost.c > @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t > vring_idx) > } >=20 > dev->virtqueue[i] =3D vq; > - init_vring_queue(dev, vring_idx); > + init_vring_queue(dev, i); > rte_spinlock_init(&vq->access_lock); > vq->avail_wrap_counter =3D 1; > vq->used_wrap_counter =3D 1; > -- > 2.26.2