From 9f70b5af670348064292eeaa30c3de91a3d17fa0 Mon Sep 17 00:00:00 2001 From: yangcheng1203 Date: Thu, 22 May 2025 17:59:34 +0800 Subject: [PATCH] Fix CVE-2024-6505 --- 0285-Fix-CVE-2024-6505.patch | 39 ++++++++++++++++++++++++++++++++++++ qemu.spec | 8 ++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 0285-Fix-CVE-2024-6505.patch diff --git a/0285-Fix-CVE-2024-6505.patch b/0285-Fix-CVE-2024-6505.patch new file mode 100644 index 0000000..88b5933 --- /dev/null +++ b/0285-Fix-CVE-2024-6505.patch @@ -0,0 +1,39 @@ +From 44ef533498db5078c4432a3f1e160ed5539d7d29 Mon Sep 17 00:00:00 2001 +From: Akihiko Odaki +Date: Mon, 1 Jul 2024 20:58:04 +0900 +Subject: [PATCH] virtio-net: Ensure queue index fits with RSS + +Ensure the queue index points to a valid queue when software RSS +enabled. The new calculation matches with the behavior of Linux's TAP +device with the RSS eBPF program. + +Fixes: 4474e37a5b3a ("virtio-net: implement RX RSS processing") +Reported-by: Zhibin Hu +Cc: qemu-stable@nongnu.org +Signed-off-by: Akihiko Odaki +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Jason Wang +(cherry picked from commit f1595ceb9aad36a6c1da95bcb77ab9509b38822d) +Signed-off-by: Michael Tokarev +Fixes: CVE-2024-6505 +--- + hw/net/virtio-net.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index 0467b3bd8a5..f84cff43aa0 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -1909,7 +1909,8 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf, + if (!no_rss && n->rss_data.enabled && n->rss_data.enabled_software_rss) { + int index = virtio_net_process_rss(nc, buf, size); + if (index >= 0) { +- NetClientState *nc2 = qemu_get_subqueue(n->nic, index); ++ NetClientState *nc2 = ++ qemu_get_subqueue(n->nic, index % n->curr_queue_pairs); + return virtio_net_receive_rcu(nc2, buf, size, true); + } + } +-- +GitLab + diff --git a/qemu.spec b/qemu.spec index 13f07bf..b8cab38 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1,4 +1,4 @@ -%define anolis_release 25 +%define anolis_release 26 %bcond_with check %global all_system_emu_support 0 @@ -566,7 +566,8 @@ Patch0280: 0280-enable-the-irqchip-simulation-function.patch Patch0281: 0281-hw-i386-pc-add-mem2-option-for-qemu.patch Patch0282: 0282-hw-misc-psp-support-tkm-use-mem2-memory.patch Patch0283: 0283-hw-misc-psp-Pin-the-hugepage-memory-specified-by-mem.patch -Patch0284: 0284-fix-potential-use-after-free-with-dbus-shared-memory.patch +Patch0284: 0284-fix-potential-use-after-free-with-dbus-shared-memory.patch +Patch0285: 0285-Fix-CVE-2024-6505.patch ExclusiveArch: x86_64 aarch64 loongarch64 @@ -2111,6 +2112,9 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %endif %changelog +* Thu May 22 2025 Cheng Yang - 2:8.2.0-26 +- Fix CVE-2024-6505 + * Sat Nov 30 2024 Xianglai Li - 2:8.2.0-25 - Remove loongarch qemu's dependency on the seavgabios package. -- Gitee