|
|
9ae3a8 |
From f9b9adc4b66f991e655f51f2ef67dac46f6bd7d4 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 27 Mar 2017 10:01:16 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 1/7] fix :cirrus_vga fix OOB read case qemu Segmentation fault
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1490608882-10242-2-git-send-email-kraxel@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 74553
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.4 qemu-kvm PATCH v2 1/7] fix :cirrus_vga fix OOB read case qemu Segmentation fault
|
|
|
9ae3a8 |
Bugzilla: 1430060
|
|
|
9ae3a8 |
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: hangaohuai <hangaohuai@huawei.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
check the validity of parameters in cirrus_bitblt_rop_fwd_transp_xxx
|
|
|
9ae3a8 |
and cirrus_bitblt_rop_fwd_xxx to avoid the OOB read which causes qemu Segmentation fault.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
After the fix, we will touch the assert in
|
|
|
9ae3a8 |
cirrus_invalidate_region:
|
|
|
9ae3a8 |
assert(off_cur_end >= off_cur);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: fangying <fangying1@huawei.com>
|
|
|
9ae3a8 |
Signed-off-by: hangaohuai <hangaohuai@huawei.com>
|
|
|
9ae3a8 |
Message-id: 20170314063919.16200-1-hangaohuai@huawei.com
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 215902d7b6fb50c6fc216fc74f770858278ed904)
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/display/cirrus_vga_rop.h | 10 ++++++++++
|
|
|
9ae3a8 |
1 file changed, 10 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/display/cirrus_vga_rop.h b/hw/display/cirrus_vga_rop.h
|
|
|
9ae3a8 |
index 9c7bb09..a4f96c6 100644
|
|
|
9ae3a8 |
--- a/hw/display/cirrus_vga_rop.h
|
|
|
9ae3a8 |
+++ b/hw/display/cirrus_vga_rop.h
|
|
|
9ae3a8 |
@@ -98,6 +98,11 @@ glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_8)(CirrusVGAState *s,
|
|
|
9ae3a8 |
uint8_t p;
|
|
|
9ae3a8 |
dstpitch -= bltwidth;
|
|
|
9ae3a8 |
srcpitch -= bltwidth;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ if (bltheight > 1 && (dstpitch < 0 || srcpitch < 0)) {
|
|
|
9ae3a8 |
+ return;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
for (y = 0; y < bltheight; y++) {
|
|
|
9ae3a8 |
for (x = 0; x < bltwidth; x++) {
|
|
|
9ae3a8 |
p = *dst;
|
|
|
9ae3a8 |
@@ -144,6 +149,11 @@ glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
|
|
|
9ae3a8 |
uint8_t p1, p2;
|
|
|
9ae3a8 |
dstpitch -= bltwidth;
|
|
|
9ae3a8 |
srcpitch -= bltwidth;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ if (bltheight > 1 && (dstpitch < 0 || srcpitch < 0)) {
|
|
|
9ae3a8 |
+ return;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
for (y = 0; y < bltheight; y++) {
|
|
|
9ae3a8 |
for (x = 0; x < bltwidth; x+=2) {
|
|
|
9ae3a8 |
p1 = *dst;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|