Bug 1902651 (CVE-2020-27821) - CVE-2020-27821 QEMU: heap buffer overflow in msix_table_mmio_write() in hw/pci/msix.c
Summary: CVE-2020-27821 QEMU: heap buffer overflow in msix_table_mmio_write() in hw/pc...
Keywords:
Status: NEW
Alias: CVE-2020-27821
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1904126 1904392 1904393 1910660 1904394
Blocks: 1900717
TreeView+ depends on / blocked
 
Reported: 2020-11-30 09:43 UTC by Mauro Matteo Cascella
Modified: 2021-02-12 13:32 UTC (History)
29 users (show)

Fixed In Version: qemu 5.2.0
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the memory management API of QEMU during the initialization of a memory region cache. This issue could lead to an out-of-bounds write access to the MSI-X table while performing MMIO operations. A guest user may abuse this flaw to crash the QEMU process on the host, resulting in a denial of service.
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Mauro Matteo Cascella 2020-11-30 09:43:37 UTC
A heap buffer overflow was found in the Message Signaled Interrupt (MSI-X) device support of QEMU. The overflow could occur due to an out-of-bounds write of the MSIX table while performing MSI-X mmio operations in msix_table_mmio_write(). A guest user may exploit this flaw to crash the QEMU process on the host, resulting in a denial of service condition.

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

Comment 1 Mauro Matteo Cascella 2020-12-03 15:11:13 UTC
Acknowledgments:

Name: Alexander Bulekov

Comment 2 Mauro Matteo Cascella 2020-12-03 15:45:13 UTC
Created qemu tracking bugs for this issue:

Affects: fedora-all [bug 1904126]

Comment 4 Mauro Matteo Cascella 2020-12-04 08:51:28 UTC
In reply to comment #0:
> A heap buffer overflow was found in the Message Signaled Interrupt (MSI-X)
> device support of QEMU. The overflow could occur due to an out-of-bounds
> write of the MSIX table while performing MSI-X mmio operations in
> msix_table_mmio_write(). A guest user may exploit this flaw to crash the
> QEMU process on the host, resulting in a denial of service condition.

The root cause of this flaw is an error in the memory management API of QEMU during the initialization of a memory region cache. Specifically, the address_space_cache_init() function in softmmu/physmem.c did not properly compute the length field 'cache->len'. This could lead to subsequent out-of-bounds accesses to the cached memory region section (e.g., MSI-X table).

Comment 7 Mauro Matteo Cascella 2020-12-04 10:31:15 UTC
Statement:

This flaw did not affect the versions of `qemu-kvm` as shipped with Red Hat Enterprise Linux 6 and 7, as they did not include support for the MemoryRegionCache structure.

Comment 9 Mauro Matteo Cascella 2020-12-17 08:18:53 UTC
External References:

https://www.openwall.com/lists/oss-security/2020/12/16/6


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