vga: minor cirrus/qxl bugfixes.
Hi,
Yet another small bugfix pull request, this time for vga.
please pull,
Gerd
The following changes since commit 071608b519adf62bc29c914343a21c5407ab1ac9:
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160229-1' into staging (2016-02-29 12:24:26 +0000)
are available in the git repository at:
git://git.kraxel.org/qemu tags/pull-vga-20160301-1
for you to fetch changes up to 05fa1c742fd6f66978b989ded0dd981ef11c4a0c:
qxl: lock current_async update in qxl_soft_reset (2016-03-01 07:51:32 +0100)
----------------------------------------------------------------
vga: minor cirrus/qxl bugfixes.
----------------------------------------------------------------
Gerd Hoffmann (1):
qxl: lock current_async update in qxl_soft_reset
Paolo Bonzini (1):
cirrus_vga: fix off-by-one in blit_region_is_unsafe
hw/display/cirrus_vga.c | 4 ++-- hw/display/qxl.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
[Qemu-devel] [PULL 1/2] cirrus_vga: fix off-by-one in blit_region_is_unsafe
From: Paolo Bonzini <[email protected]>
The "max" value is being compared with >=, but addr + width points to the first byte that will _not_ be copied. Laszlo suggested using a "greater than" comparison, instead of subtracting one like it is already done above for the height, so that max remains always positive.
The mistake is "safe"---it will reject some blits, but will never cause out-of-bounds writes.
Message-id: [email protected]
--- hw/display/cirrus_vga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/display/cirrus_vga.c +2 -2
@@ -276,14 +276,14 @@ static bool blit_region_is_unsafe(struct CirrusVGAState *s, + ((int64_t )s->cirrus_blt_height-1 ) * pitch;int32_t max = addr + s->cirrus_blt_width; -if (min <0 || max >= s->vga.vram_size) { +if (min <0 || max > s->vga.vram_size) {return true; } }else {int64_t max = addr + ((int64_t )s->cirrus_blt_height-1 ) * pitch + s->cirrus_blt_width; -if (max >= s->vga.vram_size) { +if (max > s->vga.vram_size) {return true; } }
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 2/2] qxl: lock current_async update in qxl_soft_reset
In reply to Gerd HoffmannThis should fix a defect report from Coverity.
--- hw/display/qxl.c | 2 ++ 1 file changed, 2 insertions(+)
hw/display/qxl.c +2 -0
@@ -1156,7 +1156,9 @@ static void qxl_soft_reset(PCIQXLDevice *d)trace_qxl_soft_reset (d->id);qxl_check_state (d);qxl_clear_guest_bug (d); +qemu_mutex_lock (&d->async_lock); d->current_async =QXL_UNDEFINED_IO ; +qemu_mutex_unlock (&d->async_lock);if (d->id ==0 ) {qxl_enter_vga_mode (d);
Signature · 1 line
1.8.3.1
Peter Maydell
AppliedQuoted 14 lines · Gerd Hoffmann
Hi,
Yet another small bugfix pull request, this time for vga.
please pull,
GerdThe following changes since commit
071608b519adf62bc29c914343a21c5407ab1ac9:Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160229-1' into staging (2016-02-29 12:24:26 +0000)
are available in the git repository at:
Quoted 8 lines
git://git.kraxel.org/qemutags/pull-vga-20160301-1for you to fetch changes up to
05fa1c742fd6f66978b989ded0dd981ef11c4a0c:qxl: lock
current_asyncupdate inqxl_soft_reset(2016-03-01 07:51:32 +0100)----------------------------------------------------------------
vga: minor cirrus/qxl bugfixes.
Applied, thanks.
-- PMM