A flaw was found in the USB redirection support (usb-redir) of QEMU. More specifically, usb-host and usb-redirect try to batch bulk transfers by combining many small USB packets into a single, large transfer request, to reduce the overhead and improve performance. The combined size of the bulk sending is used in usbredir_handle_bulk_data() to dynamically allocate a variable length array (VLA) on the stack. Since the total size is not bounded, a malicious guest could be able to influence the array length and cause the QEMU process to perform an excessive allocation on the stack, resulting in a denial of service.
Created qemu tracking bugs for this issue: Affects: fedora-all [bug 1956201]
Statement: This issue affects the version of `qemu-kvm` as shipped with Red Hat Enterprise Linux 8 and Red Hat Enterprise Linux 8 Advanced Virtualization. A future update may address this flaw.
Upstream patch series: https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg00564.html
External References: https://www.openwall.com/lists/oss-security/2021/05/05/5
Acknowledgments: Name: Remy Noel (Blade Group)
In reply to comment #5: > Upstream patch series: > https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg00564.html Note that the xhci patch was dropped [1] and a new USB patchset has been proposed without it [2]. As discussed upstream, this could leave room for unbound allocation on the heap, although more difficult to exploit by the guest to crash the QEMU process on the host. [1] https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg01372.html [2] https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg01373.html
Upstream commits: https://gitlab.com/qemu-project/qemu/-/commit/7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986 https://gitlab.com/qemu-project/qemu/-/commit/05a40b172e4d691371534828078be47e7fff524c