From: Li Qiang <liq3ea@gmail.com>
To: kraxel@redhat.com, qemu-devel@nongnu.org
Cc: liqiang6-s@360.cn
Subject: [Qemu-devel] [PATCH] cirrus: fix oob access issue
Date: Tue, 24 Jan 2017 01:58:34 -0800 [thread overview]
Message-ID: <5887254f.863a240a.2c122.5500@mx.google.com> (raw)
From: Li Qiang <liqiang6-s@360.cn>
When doing bitblt copy in backward mode, we should minus the
blt width first just like the adding in the forward mode. This
can avoid the oob access of the front of vga's vram.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
---
hw/display/cirrus_vga.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 379910d..fa56730 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -277,7 +277,8 @@ static bool blit_region_is_unsafe(struct CirrusVGAState *s,
}
if (pitch < 0) {
int64_t min = addr
- + ((int64_t)s->cirrus_blt_height-1) * pitch;
+ + ((int64_t)s->cirrus_blt_height - 1) * pitch
+ - s->cirrus_blt_width;
int32_t max = addr
+ s->cirrus_blt_width;
if (min < 0 || max > s->vga.vram_size) {
--
1.8.3.1
next reply other threads:[~2017-01-24 9:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 9:58 Li Qiang [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-01-24 9:34 [Qemu-devel] [PATCH] cirrus: fix oob access issue Li Qiang
2017-01-24 9:50 ` no-reply
2017-01-24 10:23 ` Laszlo Ersek
2017-01-24 10:48 ` Gerd Hoffmann
2017-01-24 11:17 ` Laszlo Ersek
2017-01-24 11:24 ` Laszlo Ersek
2017-01-24 12:29 ` Gerd Hoffmann
2017-01-24 15:31 ` Wolfgang Bumiller
2017-01-24 16:12 ` Laszlo Ersek
2017-01-25 1:18 ` Li Qiang
2017-01-25 3:31 ` Laszlo Ersek
2017-01-25 7:26 ` Gerd Hoffmann
2017-01-25 7:18 ` Gerd Hoffmann
2017-01-25 10:13 ` Laszlo Ersek
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=5887254f.863a240a.2c122.5500@mx.google.com \
--to=liq3ea@gmail.com \
--cc=kraxel@redhat.com \
--cc=liqiang6-s@360.cn \
--cc=qemu-devel@nongnu.org \
/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).