All of lore.kernel.org
 help / color / mirror / Atom feed
From: P J P <ppandit@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	Ross Lagerwall <ross.lagerwall@citrix.com>
Subject: Re: [Qemu-devel] [PATCH] vga: fix region calculation
Date: Thu, 8 Mar 2018 13:39:40 +0530 (IST)	[thread overview]
Message-ID: <nycvar.YSQ.7.76.1803081333420.30534@wniryva> (raw)
In-Reply-To: <20180308073159.1068-1-kraxel@redhat.com>

+-- On Thu, 8 Mar 2018, Gerd Hoffmann wrote --+
| Typically the scanline length and the line offset are identical.
| But case 

But in case ...

| Cc: Ross Lagerwall <ross.lagerwall@citrix.com>

s/Cc:/Reported-by: Ross Lagerwall ...

| Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| ---
|  hw/display/vga.c | 2 ++
|  1 file changed, 2 insertions(+)
| 
| diff --git a/hw/display/vga.c b/hw/display/vga.c
| index 28f298b342..72181330b8 100644
| --- a/hw/display/vga.c
| +++ b/hw/display/vga.c
| @@ -1483,6 +1483,8 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
|  
|      region_start = (s->start_addr * 4);
|      region_end = region_start + (ram_addr_t)s->line_offset * height;
| +    region_end += width * s->get_bpp(s) / 8; /* scanline length */
| +    region_end -= s->line_offset;
|      if (region_end > s->vbe_size) {
|          /* wraps around (can happen with cirrus vbe modes) */
|          region_start = 0;

It does help to fix a segmentation fault caused by OOB access.

Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org>

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

  reply	other threads:[~2018-03-08  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08  7:31 [Qemu-devel] [PATCH] vga: fix region calculation Gerd Hoffmann
2018-03-08  8:09 ` P J P [this message]
2018-03-08  9:24 ` Ross Lagerwall

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=nycvar.YSQ.7.76.1803081333420.30534@wniryva \
    --to=ppandit@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ross.lagerwall@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.