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 94930A0527 for ; Mon, 9 Nov 2020 19:37:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 639D56C96; Mon, 9 Nov 2020 19:37:49 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 272A26883; Mon, 9 Nov 2020 19:37:36 +0100 (CET) IronPort-SDR: f8iwpGHOMHf9azx+39lLrgVubSCRm23fhDz+PN4qSQmhVzIkVTXERRPSuRbsqSCsa7/AP3y6Hn fh52fXKxPx9Q== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="231480579" X-IronPort-AV: E=Sophos;i="5.77,464,1596524400"; d="scan'208";a="231480579" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2020 10:37:34 -0800 IronPort-SDR: 9486Cf7u0SjjSJ8lDAN43pvuvxC12ZO2elLe8Z5GnxIcT9hjJhWC/V0pVtDiMOWpERDFY5bpz6 ZIodiL4Zv7CA== X-IronPort-AV: E=Sophos;i="5.77,464,1596524400"; d="scan'208";a="530866979" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.193.177]) ([10.213.193.177]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2020 10:37:32 -0800 To: Maxime Coquelin , dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com Cc: stable@dpdk.org, Yu Jiang References: <20201106144744.176463-1-maxime.coquelin@redhat.com> From: Ferruh Yigit Message-ID: Date: Mon, 9 Nov 2020 18:37:28 +0000 MIME-Version: 1.0 In-Reply-To: <20201106144744.176463-1-maxime.coquelin@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [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" On 11/6/2020 2:47 PM, Maxime Coquelin wrote: > This patches fixes virtqueue initialization issue causing > segfault or file descriptor being closed unexpectedly. > > The wrong index was passed to init_vring_queue() by > alloc_vring_queue() when a hole in the virtqueue array was > met. > > Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation") > Cc: stable@dpdk.org > Since the issue is introduced in this release, there is nothing to backport and stable tag is not required, removing it in next-net. > Reported-by: Yu Jiang > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/vhost.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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) > } > > dev->virtqueue[i] = vq; > - init_vring_queue(dev, vring_idx); > + init_vring_queue(dev, i); > rte_spinlock_init(&vq->access_lock); > vq->avail_wrap_counter = 1; > vq->used_wrap_counter = 1; >