diff options
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.patch | 50 |
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 @@ | |||
1 | From 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d Mon Sep 17 00:00:00 2001 | ||
2 | From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org> | ||
3 | Date: Tue, 5 Jun 2018 22:28:51 -0300 | ||
4 | Subject: [PATCH 1/1] hw/sd/sdcard: Simplify realize() a bit | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=utf8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | We don't need to check if sd->blk is set twice. | ||
10 | |||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
13 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
14 | Message-Id: <20200630133912.9428-18-f4bug@amsat.org> | ||
15 | |||
16 | Upstram-Status: Backport: | ||
17 | https://git.qemu.org/?p=qemu.git;a=commit;f=hw/sd/sd.c;h=6dd3a164f5b31c703c7d8372841ad3bd6a57de6d | ||
18 | |||
19 | CVE: CVE-2020-13253 | ||
20 | |||
21 | Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com> | ||
22 | --- | ||
23 | hw/sd/sd.c | 10 +++++----- | ||
24 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
25 | |||
26 | diff --git a/hw/sd/sd.c b/hw/sd/sd.c | ||
27 | index 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 | -- | ||
49 | 1.8.3.1 | ||
50 | |||