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: CLOSED ERRATA
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 1904394 1910660
Blocks: 1900717
TreeView+ depends on / blocked
 
Reported: 2020-11-30 09:43 UTC by Mauro Matteo Cascella
Modified: 2022-04-17 21:04 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: 2021-05-18 14:37:12 UTC
Embargoed:


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

Comment 12 Product Security DevOps Team 2021-05-18 14:37:12 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-27821

Comment 13 errata-xmlrpc 2021-05-18 14:51:35 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:1762 https://access.redhat.com/errata/RHSA-2021:1762


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