From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 15B5447D2 for ; Fri, 23 Sep 2016 09:33:05 +0200 (CEST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 826E989C2C; Fri, 23 Sep 2016 07:33:04 +0000 (UTC) Received: from [10.36.7.3] (vpn1-7-3.ams2.redhat.com [10.36.7.3]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8N7X1Mk031728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Sep 2016 03:33:03 -0400 To: Yuanhan Liu References: <1474615009-26626-1-git-send-email-maxime.coquelin@redhat.com> <20160923072915.GW23158@yliu-dev.sh.intel.com> Cc: huawei.xie@intel.com, dev@dpdk.org, vkaplans@redhat.com, mst@redhat.com, stephen@networkplumber.org From: Maxime Coquelin Message-ID: <769e962c-75f2-a283-54eb-72410565151a@redhat.com> Date: Fri, 23 Sep 2016 09:33:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160923072915.GW23158@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 23 Sep 2016 07:33:04 +0000 (UTC) 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:33:05 -0000 On 09/23/2016 09:29 AM, Yuanhan Liu wrote: > 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? Right... I did the opposite.. Fixing this right now. > >> + >> + 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. Good point! Thanks, Maxime > > --yliu >