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 5F3EBA04B5 for ; Fri, 6 Nov 2020 16:56:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DE5B0AA31; Fri, 6 Nov 2020 16:56:39 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 008BEAA31 for ; Fri, 6 Nov 2020 16:56:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604678195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=luMTxyYnocVQkyKn2HYaG1aWEIdI0ALifpOYDEdCSM4=; b=Bq1ouHzCn+u2H2Jci+EPlQqBQ8aFAQDrIPqXcPsW2d8ykveCf5VasPrkyYA5K8MRxpzyGu q6mY39Y7Hs5CLF5RQROqMolGbkIZQX1TrS3I1pz0edz6/bOOONsQV8hgxCqIFFSzHEVjQn 0jpMkvmkFMFzA76mudpTNevQFn/NaoE= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-bqOlAaRFPTmvjRc7CNCWYg-1; Fri, 06 Nov 2020 10:56:33 -0500 X-MC-Unique: bqOlAaRFPTmvjRc7CNCWYg-1 Received: by mail-vs1-f70.google.com with SMTP id z9so676278vsl.3 for ; Fri, 06 Nov 2020 07:56:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=luMTxyYnocVQkyKn2HYaG1aWEIdI0ALifpOYDEdCSM4=; b=VG+hCiF3QQcrry7GNep+qfnuGfKYc4LnRpJmO301RAhY2c6HYoqRv305JNitrONjs1 xy5044U6VYzlIPYzEvXLBwzThI6peqBaRd4jtttqqc8h8wby7jN+sQvbKiu6z2cJjHlh NVvAEpOX+KeJt+qZdXlz47eSC9OUKu2f6EuGx8v2SbvYPu27KSeVHKj9NtRO/t63x6QS XMtJ8EkbTeU4hrBLoI+2ZYgkElgTjwdz7rnNAFtys/upHuIDmqyFareXNOwoDNQtGaAc 2XF7KpKUKH6PhLJPP6BzKPe30K7UwBepFXoIoyp+oh0EA4Ou3W0w0OKXvrSGhO4nwzPZ +eXQ== X-Gm-Message-State: AOAM532GI6Go8UGL5EVsKcAXZyCUndnEwAXui37C8BM6PQQ95nkS1qFS 95wb6rJ28KYr4xiBkp7iid9+7WNIb2B3aYZBC7CFtk3D0u4VLwRqe1sNZbOcvvKrO/eG+wm4h5b yhSm4hAhkYne87Dp8JVCX5ek= X-Received: by 2002:a67:fd46:: with SMTP id g6mr1567296vsr.27.1604678193229; Fri, 06 Nov 2020 07:56:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRvG/imc3uzwr1Henj0ow8anawEc3Rcu+NPDvh9D50cKocKHo86kj8wjqYHNpeBLYZYroJsXZZxAoQGYd4X4k= X-Received: by 2002:a67:fd46:: with SMTP id g6mr1567278vsr.27.1604678193048; Fri, 06 Nov 2020 07:56:33 -0800 (PST) MIME-Version: 1.0 References: <20201106144744.176463-1-maxime.coquelin@redhat.com> In-Reply-To: <20201106144744.176463-1-maxime.coquelin@redhat.com> From: David Marchand Date: Fri, 6 Nov 2020 16:56:21 +0100 Message-ID: To: Maxime Coquelin Cc: dev , "Xia, Chenbo" , Adrian Moreno Zapata , dpdk stable , Yu Jiang Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Fri, Nov 6, 2020 at 3:48 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 > > 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; > -- > 2.26.2 > Reviewed-by: David Marchand -- David Marchand