From 014f56ab46379c924cc1d49fd616c3d5a4e76010 Mon Sep 17 00:00:00 2001 From: lzq11122 Date: Tue, 8 Jul 2025 04:00:34 -0400 Subject: [PATCH] test Signed-off-by: lzq11122 --- 1000-fix-patch-CVE-2024-26327.patch | 27 +++++++++++++++++++++++++++ qemu.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 1000-fix-patch-CVE-2024-26327.patch diff --git a/1000-fix-patch-CVE-2024-26327.patch b/1000-fix-patch-CVE-2024-26327.patch new file mode 100644 index 0000000..79062ce --- /dev/null +++ b/1000-fix-patch-CVE-2024-26327.patch @@ -0,0 +1,27 @@ +From 4ea47e8ff642a79001bb70de50ee38c96a9ab326 Mon Sep 17 00:00:00 2001 +From: lzq11122 +Date: Tue, 8 Jul 2025 02:13:14 -0400 +Subject: [PATCH 1/1] fix patch CVE-2024-26327 + +--- + hw/pci/pcie_sriov.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c +index a1fe65f5d..fe0e5ea2c 100644 +--- a/hw/pci/pcie_sriov.c ++++ b/hw/pci/pcie_sriov.c +@@ -176,7 +176,9 @@ static void register_vfs(PCIDevice *dev) + + assert(sriov_cap > 0); + num_vfs = pci_get_word(dev->config + sriov_cap + PCI_SRIOV_NUM_VF); +- ++ if (num_vfs > pci_get_word(dev->config + sriov_cap + PCI_SRIOV_TOTAL_VF)) { ++ return; ++ } + dev->exp.sriov_pf.vf = g_new(PCIDevice *, num_vfs); + + trace_sriov_register_vfs(dev->name, PCI_SLOT(dev->devfn), +-- +2.41.0 + diff --git a/qemu.spec b/qemu.spec index 034d6c7..df37e50 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1,4 +1,4 @@ -%define anolis_release 30 +%define anolis_release 31 %bcond_with check %global all_system_emu_support 0 @@ -640,6 +640,8 @@ Patch0351: 0351-smbios-function-to-set-default-processor-family.patch Patch0352: 0352-target-riscv-smbios-support-for-risc-v-virt-machine.patch Patch0353: 0353-qemu-options-enable-smbios-option-on-risc-v.patch Patch0354: 0354-kvm-use-configs-definition-to-conditionalize-debug-s.patch +#From https://gitlab.com/qemu-project/qemu/-/commit/313e746958967a4b941ad4bbb80726727318edfa +Patch0355: 1000-fix-patch-CVE-2024-26327.patch ExclusiveArch: x86_64 aarch64 loongarch64 riscv64 @@ -2204,6 +2206,9 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %endif %changelog +* Tue Jul 8 2025 lzq11122 - 2:8.2.0-31 +- add patch to fix CVE-2024-26327 + * Sat Jun 14 2025 Chang Gao - 2:8.2.0-30 - add patch to fix riscv build failure -- Gitee