qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: P J P <ppandit@redhat.com>
Cc: "Prasad J Pandit" <pjp@fedoraproject.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"Yi Ren" <c4tren@gmail.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Ren Ding" <rding@gatech.edu>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Hanqing Zhao" <hanqing@gatech.edu>
Subject: Re: [PATCH v2 1/2] ait-vga: check address before reading configuration bytes
Date: Thu, 4 Jun 2020 09:43:18 +0100	[thread overview]
Message-ID: <20200604084318.GA3050580@redhat.com> (raw)
In-Reply-To: <20200603202251.1199170-2-ppandit@redhat.com>

Typo: s/ait/ati/

On Thu, Jun 04, 2020 at 01:52:50AM +0530, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
> 
> While reading PCI configuration bytes, a guest may send an
> address towards the end of the configuration space. It may lead
> to an OOB access issue. Add check to ensure 'address + size' is
> within PCI configuration space.

Please include a CVE number for this security flaw if there is
one.

> 
> Reported-by: Ren Ding <rding@gatech.edu>
> Reported-by: Hanqing Zhao <hanqing@gatech.edu>
> Reported-by: Yi Ren <c4tren@gmail.com>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
>  hw/display/ati.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> Update v2: add check to avoid OOB PCI configuration space access
>   -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00711.html
> 
> diff --git a/hw/display/ati.c b/hw/display/ati.c
> index bda4a2d816..6671959e5d 100644
> --- a/hw/display/ati.c
> +++ b/hw/display/ati.c
> @@ -384,7 +384,10 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
>          val = s->regs.crtc_pitch;
>          break;
>      case 0xf00 ... 0xfff:
> -        val = pci_default_read_config(&s->dev, addr - 0xf00, size);
> +        addr = addr - 0xf00;
> +        if (addr + size <= 0xff) {
> +            val = pci_default_read_config(&s->dev, addr, size);
> +        }
>          break;
>      case CUR_OFFSET:
>          val = s->regs.cur_offset;
> -- 
> 2.26.2
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  parent reply	other threads:[~2020-06-04  8:44 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é [this message]
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
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=20200604084318.GA3050580@redhat.com \
    --to=berrange@redhat.com \
    --cc=c4tren@gmail.com \
    --cc=hanqing@gatech.edu \
    --cc=kraxel@redhat.com \
    --cc=mst@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).