forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app-emulation/qemu: apply fix for CVE-2016-7170, bug #593284
Package-Manager: portage-2.2.28
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From: Prasad J Pandit <address@hidden> | ||
|
||
When processing svga command DEFINE_CURSOR in vmsvga_fifo_run, | ||
the computed BITMAP and PIXMAP size are checked against the | ||
'cursor.mask[]' and 'cursor.image[]' array sizes in bytes. | ||
Correct these checks to avoid OOB memory access. | ||
|
||
Reported-by: Qinghao Tang <address@hidden> | ||
Reported-by: Li Qiang <address@hidden> | ||
Signed-off-by: Prasad J Pandit <address@hidden> | ||
--- | ||
hw/display/vmware_vga.c | 12 +++++++----- | ||
1 file changed, 7 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c | ||
index e51a05e..6599cf0 100644 | ||
--- a/hw/display/vmware_vga.c | ||
+++ b/hw/display/vmware_vga.c | ||
@@ -676,11 +676,13 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) | ||
cursor.bpp = vmsvga_fifo_read(s); | ||
|
||
args = SVGA_BITMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, cursor.bpp); | ||
- if (cursor.width > 256 || | ||
- cursor.height > 256 || | ||
- cursor.bpp > 32 || | ||
- SVGA_BITMAP_SIZE(x, y) > sizeof cursor.mask || | ||
- SVGA_PIXMAP_SIZE(x, y, cursor.bpp) > sizeof cursor.image) { | ||
+ if (cursor.width > 256 | ||
+ || cursor.height > 256 | ||
+ || cursor.bpp > 32 | ||
+ || SVGA_BITMAP_SIZE(x, y) | ||
+ > sizeof(cursor.mask) / sizeof(cursor.mask[0]) | ||
+ || SVGA_PIXMAP_SIZE(x, y, cursor.bpp) | ||
+ > sizeof(cursor.image) / sizeof(cursor.image[0])) { | ||
goto badcmd; | ||
} | ||
|
||
-- | ||
2.5.5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters