From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C53FBA04B7;
	Wed, 14 Oct 2020 11:33:59 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 8DFF81DD84;
	Wed, 14 Oct 2020 11:33:58 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [216.205.24.124])
 by dpdk.org (Postfix) with ESMTP id E75A81D734
 for <dev@dpdk.org>; Wed, 14 Oct 2020 11:33:55 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1602668034;
 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:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=w5FXYowevNBl8bZk1t6FE7vy3DZFcZ0NIUYPbqnOUeg=;
 b=iM1XfdgFGZeX86Jic+r1tr0mfckTFguhOgBF5BHt5O0XKdzpXdgfwgVcPkl6Pv3FjPL3NA
 2coRok5k68OkC7pDC8pbX96jobZSMfZtG6eQmHbosMdUspNL6hMLLI9JFI2S1Uo53XrvP4
 /yB9Sq4nMHpYqoE+Tg8NaJJDmtsw+kY=
Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com
 [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-83-Fn7KTBKgMV200h2qj2Y8rw-1; Wed, 14 Oct 2020 05:33:52 -0400
X-MC-Unique: Fn7KTBKgMV200h2qj2Y8rw-1
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com
 [10.5.11.16])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 293FC1084CA9;
 Wed, 14 Oct 2020 09:33:51 +0000 (UTC)
Received: from [10.36.110.38] (unknown [10.36.110.38])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id E81E75C1BD;
 Wed, 14 Oct 2020 09:33:49 +0000 (UTC)
To: Patrick Fu <patrick.fu@intel.com>, dev@dpdk.org, chenbo.xia@intel.com
Cc: zhihong.wang@intel.com, cheng1.jiang@intel.com
References: <20200911015316.1903181-1-patrick.fu@intel.com>
 <20201013014546.2896162-1-patrick.fu@intel.com>
 <20201013014546.2896162-4-patrick.fu@intel.com>
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Message-ID: <ddc192e0-703d-254d-c1ca-5a9c9cc30f6e@redhat.com>
Date: Wed, 14 Oct 2020 11:33:48 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.3.1
MIME-Version: 1.0
In-Reply-To: <20201013014546.2896162-4-patrick.fu@intel.com>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH v4 3/4] vhost: fix async vector buffer overrun
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>



On 10/13/20 3:45 AM, Patrick Fu wrote:
> Add check on the async vector buffer usage to prevent the buf overrun.
> If the unused vector buffer is not sufficient to prepare for next
> packet's iov creation, an async transfer will be triggered immediately
> to free the vector buffer.
> 
> Fixes: 78639d54563a ("vhost: introduce async enqueue registration API")
> 
> Signed-off-by: Patrick Fu <patrick.fu@intel.com>
> ---
>  lib/librte_vhost/vhost.h      |  2 +-
>  lib/librte_vhost/virtio_net.c | 13 ++++++++++++-
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime