From: Cornelia Huck <cohuck@redhat.com>
To: P J P <ppandit@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
Qemu Developers <qemu-devel@nongnu.org>,
zhangboxian <zhangboxian@huawei.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] virtio: check VirtQueue Vring object is set
Date: Tue, 28 Nov 2017 13:00:12 +0100 [thread overview]
Message-ID: <20171128130012.1466d231.cohuck@redhat.com> (raw)
In-Reply-To: <nycvar.YSQ.7.76.1711281653440.1581@wniryva>
On Tue, 28 Nov 2017 16:57:34 +0530 (IST)
P J P <ppandit@redhat.com> wrote:
> +-- On Tue, 28 Nov 2017, Stefan Hajnoczi wrote --+
> | > This is conflating different things:
> | > - vq does not exist (num == 0)
> | > - vq is not setup by the guest (desc == 0)
> | > - vq has no valid alignment (which is only relevant for legacy)
> |
> | I agree.
>
> Either case, vq would be unfit for use, no?
What is "unfit for use"?
I'm not quite sure what you want to achieve with this patch. I assume
you want to fix the issue that a guest may provide invalid values for
align etc. which can cause qemu to crash or behave badly.
If so, you need to do different things for the different points above.
- The guest should not muck around with a non-existing queue (num == 0)
in any case, so this should be fenced for any manipulation triggered
by the guest.
- Processing a non-setup queue (desc == 0; also applies to the other
buffers for virtio-1) should be skipped. However, _setting_ desc etc.
to 0 from the guest is fine (as long as it follows the other
constraints of the spec).
- Setting alignment to 0 only applies to legacy + virtio-mmio. I would
not overengineer fencing this. A simple check in update_rings should
be enough.
next prev parent reply other threads:[~2017-11-28 12:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-24 18:34 [Qemu-devel] [PATCH v3 0/2] check VirtiQueue Vring objects P J P
2017-11-24 18:34 ` [Qemu-devel] [PATCH v3 1/2] virtio: check VirtQueue Vring object is set P J P
2017-11-27 10:03 ` Cornelia Huck
2017-11-27 11:15 ` Stefan Hajnoczi
2017-11-27 17:55 ` P J P
2017-11-28 9:11 ` Cornelia Huck
2017-11-28 10:37 ` Stefan Hajnoczi
2017-11-28 11:27 ` P J P
2017-11-28 12:00 ` Cornelia Huck [this message]
2017-11-29 10:11 ` P J P
2017-11-29 11:16 ` Cornelia Huck
2017-11-30 9:16 ` P J P
2017-11-24 18:34 ` [Qemu-devel] [PATCH v3 2/2] tests: add test to check VirtQueue object P J P
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=20171128130012.1466d231.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=pbonzini@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=zhangboxian@huawei.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).