xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/qemu/qemu/CVE-2021-3611_2.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 79fa99831debc9782087e834382c577215f2f511 Mon Sep 17 00:00:00 2001
2From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com>
3Date: Sat, 18 Dec 2021 17:09:11 +0100
4Subject: [PATCH] hw/audio/intel-hda: Restrict DMA engine to memories (not MMIO
5 devices)
6MIME-Version: 1.0
7Content-Type: text/plain; charset=utf8
8Content-Transfer-Encoding: 8bit
9
10Issue #542 reports a reentrancy problem when the DMA engine accesses
11the HDA controller I/O registers. Fix by restricting the DMA engine
12to memories regions (forbidding MMIO devices such the HDA controller).
13
14Reported-by: OSS-Fuzz (Issue 28435)
15Reported-by: Alexander Bulekov <alxndr@bu.edu>
16Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
17Reviewed-by: Thomas Huth <thuth@redhat.com>
18Resolves: https://gitlab.com/qemu-project/qemu/-/issues/542
19CVE: CVE-2021-3611
20Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=patch;h=79fa99831debc9782087e834382c577215f2f511]
21
22Message-Id: <20211218160912.1591633-3-philmd@redhat.com>
23Signed-off-by: Thomas Huth <thuth@redhat.com>
24Signed-off-by: Bhabu Bindu <bhabu.bindu@kpit.com>
25---
26 hw/audio/intel-hda.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
30index 47a36ac..78a47bc 100644
31--- a/hw/audio/intel-hda.c
32+++ b/hw/audio/intel-hda.c
33@@ -345,7 +345,7 @@ static void intel_hda_corb_run(IntelHDAState *d)
34
35 static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t response)
36 {
37-    const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED;
38+    const MemTxAttrs attrs = { .memory = true };
39     HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus);
40     IntelHDAState *d = container_of(bus, IntelHDAState, codecs);
41     hwaddr addr;
42--
431.8.3.1
44