Bug 2265499 (CVE-2024-24474)

Summary: CVE-2024-24474 QEMU: esp: integer underflow leads to heap buffer overflow in esp_do_nodma()
Product: [Other] Security Response Reporter: Mauro Matteo Cascella <mcascell>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ailan, ddepaula, jen, jferlan, jmaloy, kkiwi, knoel, mrezanin, mst, nilal, pbonzini, ymankad
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm 8.2.0 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the am53c974 SCSI controller emulation of QEMU. When an SCSI layer transfer is incorrectly terminated, it is possible for a TI command to cause an SCSI buffer overflow due to the expected transfer data length being less than the available data in the FIFO. When this occurs, the unsigned async_len variable underflows and becomes a large offset, which writes past the end of the allocated SCSI buffer. This flaw could allow a malicious guest to crash QEMU and cause a denial of service condition.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2265500    
Bug Blocks:    

Description Mauro Matteo Cascella 2024-02-22 12:04:06 UTC
QEMU before 8.2.0 has an integer underflow, and resultant buffer overflow, via a TI command when an expected non-DMA transfer length is less than the length of the available FIFO data. This occurs in esp_do_nodma in hw/scsi/esp.c because of an underflow of async_len.

Upstream issue & fix:
https://gitlab.com/qemu-project/qemu/-/issues/1810
https://github.com/qemu/qemu/commit/77668e4b9bca03a856c27ba899a2513ddf52bb52

Comment 1 Mauro Matteo Cascella 2024-02-22 12:07:29 UTC
Created qemu tracking bugs for this issue:

Affects: fedora-all [bug 2265500]