From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
"Prasad J Pandit" <pjp@fedoraproject.org>,
"Yi Ren" <c4tren@gmail.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"P J P" <ppandit@redhat.com>, "Ren Ding" <rding@gatech.edu>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Hanqing Zhao" <hanqing@gatech.edu>
Subject: Re: [PATCH v2 2/2] pci: ensure configuration access is within bounds
Date: Thu, 4 Jun 2020 05:44:15 -0400 [thread overview]
Message-ID: <20200604054323-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200604051400.743ebtvj3qg2uoet@sirius.home.kraxel.org>
On Thu, Jun 04, 2020 at 07:14:00AM +0200, Gerd Hoffmann wrote:
> Hi,
>
> > > + assert(address + len <= pci_config_size(d));
> >
> > Does this allow guest now to crash QEMU?
>
> Looks like it does (didn't actually try though).
>
> > I think it was suggested that assert should only be used for cases
> > that can only arise from a programming error and not from values set
> > by the guest.
>
> Correct. We do have guest-triggerable asserts in the code base. They
> are not the end of the world as the guest will only hurt itself. But
> in general we try to get rid of them instead of adding new ones ...
>
> Often you can just ignore the illegal guest action (bonus points for
> logging GUEST_ERROR as debugging aid). Sometimes it is more difficult
> to deal with it (in case the hardware is expected to throw an error irq
> for example).
>
> take care,
> Gerd
In this case it's not supposed to be guest triggerable, so I'm inlined
to merge this, but as a separate patch from patch 1,
and commit log need to be clearer that it's defence in depth
not a bugfix.
next prev parent reply other threads:[~2020-06-04 9:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 20:22 [PATCH v2 0/2] Ensure PCI configuration access is within bounds P J P
2020-06-03 20:22 ` [PATCH v2 1/2] ait-vga: check address before reading configuration bytes P J P
2020-06-03 21:58 ` BALATON Zoltan
2020-06-04 8:43 ` Daniel P. Berrangé
2020-06-04 9:18 ` P J P
2020-06-04 9:40 ` Michael S. Tsirkin
2020-06-03 20:22 ` [PATCH v2 2/2] pci: ensure configuration access is within bounds P J P
2020-06-03 22:13 ` BALATON Zoltan
2020-06-04 5:14 ` Gerd Hoffmann
2020-06-04 9:44 ` Michael S. Tsirkin [this message]
2020-06-04 5:31 ` P J P
2020-06-04 6:07 ` Philippe Mathieu-Daudé
2020-06-04 9:41 ` Michael S. Tsirkin
2020-06-04 11:37 ` BALATON Zoltan
2020-06-04 11:40 ` Michael S. Tsirkin
2020-06-04 11:49 ` BALATON Zoltan
2020-06-04 11:58 ` Michael S. Tsirkin
2020-06-04 12:14 ` BALATON Zoltan
2020-06-04 14:11 ` Michael S. Tsirkin
2020-06-04 9:10 ` Peter Maydell
2020-06-04 9:35 ` Michael S. Tsirkin
2020-06-04 9:38 ` 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=20200604054323-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=berrange@redhat.com \
--cc=c4tren@gmail.com \
--cc=hanqing@gatech.edu \
--cc=kraxel@redhat.com \
--cc=philmd@redhat.com \
--cc=pjp@fedoraproject.org \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rding@gatech.edu \
/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).