From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH] vhost/crypto: fix missing head correction Date: Fri, 27 Apr 2018 16:19:16 +0200 Message-ID: References: <20180427135233.56019-1-roy.fan.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: ferruh.yigit@intel.com To: Fan Zhang , dev@dpdk.org 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) In-Reply-To: <20180427135233.56019-1-roy.fan.zhang@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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; > } >