aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-02-28 20:33:12 +0900
committerMichael S. Tsirkin <mst@redhat.com>2024-03-12 17:56:55 -0400
commit91bb64a8d2014fda33a81fcf0fce37340f0d3b0c (patch)
tree8faee6c9031349a521b04b5033607f67d519c91a /net
parent04f143d828845d0fd52dd4a52664d81a4f5431f7 (diff)
downloadqemu-91bb64a8d2014fda33a81fcf0fce37340f0d3b0c.zip
qemu-91bb64a8d2014fda33a81fcf0fce37340f0d3b0c.tar.gz
qemu-91bb64a8d2014fda33a81fcf0fce37340f0d3b0c.tar.bz2
hw/nvme: Use pcie_sriov_num_vfs()
nvme_sriov_pre_write_ctrl() used to directly inspect SR-IOV configurations to know the number of VFs being disabled due to SR-IOV configuration writes, but the logic was flawed and resulted in out-of-bound memory access. It assumed PCI_SRIOV_NUM_VF always has the number of currently enabled VFs, but it actually doesn't in the following cases: - PCI_SRIOV_NUM_VF has been set but PCI_SRIOV_CTRL_VFE has never been. - PCI_SRIOV_NUM_VF was written after PCI_SRIOV_CTRL_VFE was set. - VFs were only partially enabled because of realization failure. It is a responsibility of pcie_sriov to interpret SR-IOV configurations and pcie_sriov does it correctly, so use pcie_sriov_num_vfs(), which it provides, to get the number of enabled VFs before and after SR-IOV configuration writes. Cc: qemu-stable@nongnu.org Fixes: CVE-2024-26328 Fixes: 11871f53ef8e ("hw/nvme: Add support for the Virtualization Management command") Suggested-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20240228-reuse-v8-1-282660281e60@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions