Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions SPECS/qemu/CVE-2026-3195.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
From a18033a6d4569633a6dade3ef880cb377cd16f56 Mon Sep 17 00:00:00 2001
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: Fri, 20 Feb 2026 11:40:16 +0200
Subject: [PATCH 1/2] virtio-snd: tighten read amount in in_cb

The amount of bytes to read passed to AUD_read() should never surpass
the maximum available buffer length. Tighten the current amount by
MIN(<amount>, max_size - <existing size>).

Cc: qemu-stable@nongnu.org
Fixes: 98e77e3dd8dd6e7aa9a7dffa60f49c8c8a49d4e3 ("virtio-snd: add max size bounds check in input cb")
Reported-by: DARKNAVY <vr@darknavy.com>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260220-virtio-snd-series-v1-5-207c4f7200a2@linaro.org>
(cherry picked from commit 7994203bb1b83a6604f3ab00fe9598909bb66164)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/audio/virtio-snd.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c
index d1cf5eb..b73aad2 100644
--- a/hw/audio/virtio-snd.c
+++ b/hw/audio/virtio-snd.c
@@ -1263,7 +1263,7 @@ static void virtio_snd_pcm_in_cb(void *data, int available)
{
VirtIOSoundPCMStream *stream = data;
VirtIOSoundPCMBuffer *buffer;
- size_t size, max_size;
+ size_t size, max_size, to_read;

WITH_QEMU_LOCK_GUARD(&stream->queue_mutex) {
while (!QSIMPLEQ_EMPTY(&stream->queue)) {
@@ -1283,10 +1283,12 @@ static void virtio_snd_pcm_in_cb(void *data, int available)
return_rx_buffer(stream, buffer);
break;
}
+ to_read = stream->params.period_bytes - buffer->size;
+ to_read = MIN(to_read, available);
+ to_read = MIN(to_read, max_size - buffer->size);
size = AUD_read(stream->voice.in,
- buffer->data + buffer->size,
- MIN(available, (stream->params.period_bytes -
- buffer->size)));
+ buffer->data + buffer->size,
+ to_read);
if (!size) {
available = 0;
break;
--
2.45.4


From 41363e73db91417b84b4b4a9809363a39e2d5f89 Mon Sep 17 00:00:00 2001
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: Fri, 20 Feb 2026 11:40:15 +0200
Subject: [PATCH 2/2] virtio-snd: fix max_size bounds check in input cb

In 98e77e3d we calculated the max size and checked that each buffer is smaller than it.

We neglected to subtract the size of the virtio_snd_pcm_status header
from the max size, and max_size was thus larger than the correct value,
leading to potential OOB writes.

If the buffer cannot fit the header or can fit only the header, return
the buffer immediately.

Cc: qemu-stable@nongnu.org
Fixes: 98e77e3dd8dd6e7aa9a7dffa60f49c8c8a49d4e3 ("virtio-snd: add max size bounds check in input cb")
Reported-by: DARKNAVY <vr@darknavy.com>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260220-virtio-snd-series-v1-4-207c4f7200a2@linaro.org>
(cherry picked from commit bcb53328aa70023f1405fade4e253e7f77567261)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: rpm-build <rpm-build>
Upstream-reference: https://gitlab.com/qemu-project/qemu/-/commit/298986525140149bd749c236c17cfbb507c69e23.patch https://gitlab.com/qemu-project/qemu/-/commit/a730f98a7a199706c44dd86a39d961e80e2ad18f.patch
---
hw/audio/virtio-snd.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c
index b73aad2..4a4ad01 100644
--- a/hw/audio/virtio-snd.c
+++ b/hw/audio/virtio-snd.c
@@ -1278,6 +1278,12 @@ static void virtio_snd_pcm_in_cb(void *data, int available)
}

max_size = iov_size(buffer->elem->in_sg, buffer->elem->in_num);
+ if (max_size <= sizeof(virtio_snd_pcm_status)) {
+ return_rx_buffer(stream, buffer);
+ continue;
+ }
+ max_size -= sizeof(virtio_snd_pcm_status);
+
for (;;) {
if (buffer->size >= max_size) {
return_rx_buffer(stream, buffer);
--
2.45.4

10 changes: 6 additions & 4 deletions SPECS/qemu/qemu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Obsoletes: sgabios-bin <= 1:0.20180715git-10.fc38
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 9.1.0
Release: 8%{?dist}
Release: 9%{?dist}
License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND FSFAP AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND MIT AND LicenseRef-Fedora-Public-Domain AND CC-BY-3.0
URL: http://www.qemu.org/

Expand Down Expand Up @@ -470,7 +470,8 @@ Patch27: kvm-block-Drain-nodes-before-inactivating-them.patch
Patch28: kvm-block-export-Add-option-to-allow-export-of-inactive-.patch
Patch29: kvm-nbd-server-Support-inactive-nodes.patch
Patch30: kvm-migration-Fix-UAF-for-incoming-migration-on-Migratio.patch
Patch31: CVE-2026-48914.patch
Patch31: CVE-2026-3195.patch
Patch32: CVE-2026-48914.patch

Source10: qemu-guest-agent.service
Source11: 99-qemu-guest-agent.rules
Expand Down Expand Up @@ -3519,9 +3520,10 @@ fi
%endif
# endif !tools_only
%endif


%changelog
* Sat Jun 27 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 9.1.0-9
- Patch for CVE-2026-3195

* Wed Jun 17 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 9.1.0-8
- Patch for CVE-2026-48914

Expand Down
Loading