Bug 2232677 (CVE-2023-40360)

Summary: CVE-2023-40360 QEMU: NVMe: NULL pointer dereference in nvme_directive_receive()
Product: [Other] Security Response Reporter: Zack Miele <zmiele>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ddepaula, jen, jferlan, jmaloy, knoel, mkenneth, mrezanin, mst, pbonzini, virt-maint, ymankad
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm 8.1.0-rc3 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the virtual nvme device in QEMU. The nvme_directive_receive() function does not check if an endurance group has been configured (set) prior to testing if flexible data placement is enabled, potentially leading to a NULL pointer dereference issue.
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: 2232678, 2232679, 2232680, 2233910    
Bug Blocks: 2232676    

Description Zack Miele 2023-08-17 21:03:41 UTC
QEMU through 8.0.4 accesses a NULL pointer in nvme_directive_receive in hw/nvme/ctrl.c because there is no check for whether an endurance group is configured before checking whether Flexible Data Placement is enabled.

https://gitlab.com/birkelund/qemu/-/commit/6c8f8456cb0b239812dee5211881426496da7b98
https://gitlab.com/qemu-project/qemu/-/issues/1815
https://www.qemu.org/docs/master/system/security.html

Comment 2 Mauro Matteo Cascella 2023-08-23 17:13:55 UTC
Upstream commit:
https://gitlab.com/qemu-project/qemu/-/commit/6c8f8456cb0b239812dee5211881426496da7b98

Comment 3 Mauro Matteo Cascella 2023-08-23 17:19:20 UTC
Created qemu tracking bugs for this issue:

Affects: fedora-all [bug 2233910]