summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch
new file mode 100644
index 0000000000..8b1ad0423b
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch
@@ -0,0 +1,54 @@
1From e907ff3d4cb7fd20d402f45355059e67d0dc93e7 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com>
3Date: Wed, 24 Nov 2021 17:15:34 +0100
4Subject: [PATCH 11/12] hw/block/fdc: Extract blk_create_empty_drive()
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9We are going to re-use this code in the next commit,
10so extract it as a new blk_create_empty_drive() function.
11
12Inspired-by: Hanna Reitz <hreitz@redhat.com>
13Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
14Message-id: 20211124161536.631563-2-philmd@redhat.com
15Signed-off-by: John Snow <jsnow@redhat.com>
16
17Upstream-Status: Backport [b154791e7b6d4ca5cdcd54443484d97360bd7ad2]
18CVE: CVE-2021-20196
19
20Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
21---
22 hw/block/fdc.c | 9 +++++++--
23 1 file changed, 7 insertions(+), 2 deletions(-)
24
25diff --git a/hw/block/fdc.c b/hw/block/fdc.c
26index 4c2c35e22..854b4f172 100644
27--- a/hw/block/fdc.c
28+++ b/hw/block/fdc.c
29@@ -61,6 +61,12 @@
30 } while (0)
31
32
33+/* Anonymous BlockBackend for empty drive */
34+static BlockBackend *blk_create_empty_drive(void)
35+{
36+ return blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL);
37+}
38+
39 /********************************************************/
40 /* qdev floppy bus */
41
42@@ -543,8 +549,7 @@ static void floppy_drive_realize(DeviceState *qdev, Error **errp)
43 }
44
45 if (!dev->conf.blk) {
46- /* Anonymous BlockBackend for an empty drive */
47- dev->conf.blk = blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL);
48+ dev->conf.blk = blk_create_empty_drive();
49 ret = blk_attach_dev(dev->conf.blk, qdev);
50 assert(ret == 0);
51
52--
532.31.1
54