From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D3A535688 for ; Fri, 23 Sep 2016 09:28:49 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 23 Sep 2016 00:28:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,381,1470726000"; d="scan'208";a="1055218336" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 23 Sep 2016 00:28:47 -0700 Date: Fri, 23 Sep 2016 15:29:15 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: huawei.xie@intel.com, dev@dpdk.org, vkaplans@redhat.com, mst@redhat.com, stephen@networkplumber.org Message-ID: <20160923072915.GW23158@yliu-dev.sh.intel.com> References: <1474615009-26626-1-git-send-email-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1474615009-26626-1-git-send-email-maxime.coquelin@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v2] vhost: Add indirect descriptors support to the TX path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 07:28:50 -0000 On Fri, Sep 23, 2016 at 09:16:49AM +0200, Maxime Coquelin wrote: > + if (vq->desc[desc_indexes[i]].flags & VRING_DESC_F_INDIRECT) { > + if (unlikely(!(dev->features & > + (1ULL << VIRTIO_RING_F_INDIRECT_DESC)))) { > + RTE_LOG(ERR, VHOST_DATA, > + "Indirect desc but feature not negotiated.\n"); > + break; > + } I thought the alignment we got before was to follow linux kernel: check nested indirect only? > + > + desc = (struct vring_desc *)gpa_to_vva(dev, > + vq->desc[desc_indexes[i]].addr); I think we should check the desc addr here. Otherwise we may crash here if a malicious guest fills some bad addresses. --yliu