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
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.
Acknowledgments: Name: Ziming Zhang
Upstream fix: https://git.qemu.org/?p=qemu.git;a=commit;h=ac2071c3791b67fc7af78b8ceb320c01ca1b5df7
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
Created qemu tracking bugs for this issue: Affects: fedora-all [bug 1847474]