summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2020-13253_1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2020-13253_1.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2020-13253_1.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-13253_1.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-13253_1.patch
new file mode 100644
index 0000000000..7f8383987c
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-13253_1.patch
@@ -0,0 +1,50 @@
1From 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d Mon Sep 17 00:00:00 2001
2From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org>
3Date: Tue, 5 Jun 2018 22:28:51 -0300
4Subject: [PATCH 1/1] hw/sd/sdcard: Simplify realize() a bit
5MIME-Version: 1.0
6Content-Type: text/plain; charset=utf8
7Content-Transfer-Encoding: 8bit
8
9We don't need to check if sd->blk is set twice.
10
11Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
13Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
14Message-Id: <20200630133912.9428-18-f4bug@amsat.org>
15
16Upstram-Status: Backport:
17https://git.qemu.org/?p=qemu.git;a=commit;f=hw/sd/sd.c;h=6dd3a164f5b31c703c7d8372841ad3bd6a57de6d
18
19CVE: CVE-2020-13253
20
21Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com>
22---
23 hw/sd/sd.c | 10 +++++-----
24 1 file changed, 5 insertions(+), 5 deletions(-)
25
26diff --git a/hw/sd/sd.c b/hw/sd/sd.c
27index 1cc16bf..edd60a0 100644
28--- a/hw/sd/sd.c
29+++ b/hw/sd/sd.c
30@@ -2105,12 +2105,12 @@ static void sd_realize(DeviceState *dev, Error **errp)
31 return;
32 }
33
34- if (sd->blk && blk_is_read_only(sd->blk)) {
35- error_setg(errp, "Cannot use read-only drive as SD card");
36- return;
37- }
38-
39 if (sd->blk) {
40+ if (blk_is_read_only(sd->blk)) {
41+ error_setg(errp, "Cannot use read-only drive as SD card");
42+ return;
43+ }
44+
45 ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
46 BLK_PERM_ALL, errp);
47 if (ret < 0) {
48--
491.8.3.1
50