Bug 1809955 (CVE-2020-11869) - CVE-2020-11869 qemu: integer overflow in ati_2d_blt() in hw/display/ati-2d.c could lead to DoS
Summary: CVE-2020-11869 qemu: integer overflow in ati_2d_blt() in hw/display/ati-2d.c ...
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2020-11869
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1819709 1847474 1910687
Blocks: 1786592
TreeView+ depends on / blocked
 
Reported: 2020-03-04 10:02 UTC by Mauro Matteo Cascella
Modified: 2022-04-17 20:55 UTC (History)
37 users (show)

Fixed In Version: qemu 5.0.0
Doc Type: If docs needed, set a value
Doc Text:
An integer overflow flaw was found in QEMU in the way it implemented the ATI VGA emulation. This flaw occurs in the ati_2d_blt() routine while handling MMIO write operations through ati_mm_write() callback. A malicious guest could abuse this flaw to crash the QEMU process, resulting in a denial of service.
Clone Of:
Environment:
Last Closed: 2020-04-24 16:31:47 UTC
Embargoed:


Attachments (Terms of Use)

Description Mauro Matteo Cascella 2020-03-04 10:02:05 UTC
Function ati_2d_blt() in hw/display/ati-2d.c is affected by an integer overflow
vulnerability leading to potential out-of-bounds read/write operations. 

Specifically, variables `s->regs.dst_x` and `s->regs.dst_y` are set to less than
0x3fff in function ati_mm_write() in ati.c. However, it turns out they can
infinitely increase the size to exceed 0x3fff in the switch case ROP3_SRCCOPY
in function ati_2d_blt(): 

1) when looping, first set `dst_stride` to 0 to pass the check 
   `dst_bits + dst_x + (dst_y + s-> regs.dst_height) * dst_stride> = end`

2) after `dst_x` and `dst_y` assume a large value, `dst_stride` can be set

3) expression `dst_x + (dst_y + s-> regs.dst_height) * dst_stride` can be set
   to a large value (like 0xffffffff). When using a 32-bit operating system,
   the pointer plus 0xffffffff can pass the check.

This will cause wrong memory access leading to out-of-bounds read/write in
function pixman_blt().

Upstream fix:
https://git.qemu.org/?p=qemu.git;a=commit;h=ac2071c3791b67fc7af78b8ceb320c01ca1b5df7

Comment 2 Joshua Padman 2020-03-16 01:13:19 UTC
Statement:

This flaw did not affect the following versions of QEMU as they did not include support for ATI VGA emulation:
* `qemu-kvm-ma` as shipped with Red Hat Enterprise Linux 7.
* `qemu-kvm-rhev` as shipped with Red Hat Virtualization and Red Hat OpenStack.
* `qemu-kvm` as shipped with Red Hat Enterprise Linux 6, 7 and 8.

ATI VGA emulation feature was introduced in QEMU upstream version v4.0.0.

Comment 4 Mauro Matteo Cascella 2020-04-01 11:18:00 UTC
Acknowledgments:

Name: Ziming Zhang

Comment 5 Mauro Matteo Cascella 2020-04-14 09:09:11 UTC
Upstream fix:
https://git.qemu.org/?p=qemu.git;a=commit;h=ac2071c3791b67fc7af78b8ceb320c01ca1b5df7

Comment 7 Product Security DevOps Team 2020-04-24 16:31:47 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2020-11869

Comment 8 Mauro Matteo Cascella 2020-06-16 13:01:06 UTC
Created qemu tracking bugs for this issue:

Affects: fedora-all [bug 1847474]


Note You need to log in before you can comment on or make changes to this bug.