DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: huawei.xie@intel.com, dev@dpdk.org, vkaplans@redhat.com,
	mst@redhat.com, stephen@networkplumber.org
Subject: Re: [dpdk-dev] [PATCH v2] vhost: Add indirect descriptors support to the TX path
Date: Fri, 23 Sep 2016 15:29:15 +0800	[thread overview]
Message-ID: <20160923072915.GW23158@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <1474615009-26626-1-git-send-email-maxime.coquelin@redhat.com>

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

  reply	other threads:[~2016-09-23  7:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23  7:16 Maxime Coquelin
2016-09-23  7:29 ` Yuanhan Liu [this message]
2016-09-23  7:33   ` Maxime Coquelin
2016-09-23 18:24 ` Stephen Hemminger
2016-09-23 18:31   ` Michael S. Tsirkin
2016-09-23 20:28     ` Stephen Hemminger
2016-09-25  1:02       ` Michael S. Tsirkin
2016-09-25  1:50         ` Stephen Hemminger
2016-09-25  1:53           ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160923072915.GW23158@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=vkaplans@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).