From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 1CE7D7E7F for ; Fri, 27 Apr 2018 16:19:19 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 59AD820D871; Fri, 27 Apr 2018 14:19:18 +0000 (UTC) Received: from [10.36.112.44] (ovpn-112-44.ams2.redhat.com [10.36.112.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F3E810B2B41; Fri, 27 Apr 2018 14:19:17 +0000 (UTC) To: Fan Zhang , dev@dpdk.org Cc: ferruh.yigit@intel.com References: <20180427135233.56019-1-roy.fan.zhang@intel.com> From: Maxime Coquelin Message-ID: Date: Fri, 27 Apr 2018 16:19:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180427135233.56019-1-roy.fan.zhang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 27 Apr 2018 14:19:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 27 Apr 2018 14:19:18 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH] vhost/crypto: fix missing head correction 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, 27 Apr 2018 14:19:19 -0000 Hi Fan, On 04/27/2018 03:52 PM, Fan Zhang wrote: > Fixes: 473387aaae4a ("vhost/crypto: move to safe GPA translation API") > > This patch fixes the missing head descriptor correction for > indirect descriptors. > > Signed-off-by: Fan Zhang > --- > lib/librte_vhost/vhost_crypto.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c > index c38eb3bb5..81fab7e94 100644 > --- a/lib/librte_vhost/vhost_crypto.c > +++ b/lib/librte_vhost/vhost_crypto.c > @@ -919,6 +919,7 @@ vhost_crypto_process_one_req(struct vhost_crypto *vcrypto, > if (unlikely(!desc || dlen != head->len)) > return -1; > desc_idx = 0; > + head = desc; Thanks for fixing this, and sorry for having introduced the regression. BTW, my patch is half-complete. Indeed, it ensures no out-of-bound accesses will be done, but it does not handle legit buffers that are contiguous in guest physical address space, but discontiguous in the host VA space. Such case can for example happen when having buffers larger than the huge page size. I have implemented the handling of such buffers in virtio-net.c, for example: fb3815cc6 vhost: handle virtually non-contiguous buffers in Rx-mrg 6727f5a73 vhost: handle virtually non-contiguous buffers in Rx 91b7b4080 vhost: handle virtually non-contiguous buffers in Tx d0c24508e vhost: add support for non-contiguous indirect descs tables Can you try to work on such handling for next -rc release? For this patch: Reviewed-by: Maxime Coquelin Thanks, Maxime > } else { > desc = head; > } >