public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Donald Dutile <ddutile@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH V2] device-assignment pci: correct pci config size default for cap version 2 endpoints
Date: Mon, 25 Jul 2011 14:14:28 -0600	[thread overview]
Message-ID: <1311624869.2653.154.camel@bling.home> (raw)
In-Reply-To: <20110724083637.GE24483@redhat.com>

On Sun, 2011-07-24 at 11:36 +0300, Michael S. Tsirkin wrote:
> On Thu, Jul 21, 2011 at 11:02:53AM -0600, Alex Williamson wrote:
> > This is crazy, why would we only test this for PCI_CAP_ID_EXP?  If the
> > test is going to go in device-assignment, we need to wrap
> > pci_add_capability and do it for all callers.  However, maybe we can get
> > MST to take it in pci_add_capability() if we make the test more
> > complete...  something like:
> > 
> > if ((pos < 256 && size > 256 - pos) ||
> >     (pci_config_size() > 256 && pos > 256 &&
> >      size > pci_config_size() - pos)) {
> >    ... badness
> > 
> > Thanks,
> > 
> > Alex
> 
> We expect device assignment to be able to corrupt
> guest memory but not qemu memory. So we must validate

Gee, thanks.

> whatever we get from the device, and I think this
> validation belongs in device-assignment.c:
> 
> IOW I think input should be validated where it's
> input, while we still know it's untrusted,
> instead of relying on core to validate parameters.
> 
> Makes sense?

No, not really.  Why should the core "trust" anything?  This is a basic,
simply sanity test, why push it out to the leaf driver when pushing it
into the core provides the sanity test for everyone?  Is it beneath an
emulated driver to pass such a test?  Thanks,

Alex


  reply	other threads:[~2011-07-25 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 16:39 [PATCH V2] device-assignment pci: correct pci config size default for cap version 2 endpoints Donald Dutile
2011-07-21 17:02 ` Alex Williamson
2011-07-21 17:52   ` Don Dutile
2011-07-24  8:36   ` Michael S. Tsirkin
2011-07-25 20:14     ` Alex Williamson [this message]
2011-07-26 11:42       ` Michael S. Tsirkin
2011-07-26 15:45         ` Alex Williamson

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=1311624869.2653.154.camel@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@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