diff options
author | Armin Kuster <akuster@mvista.com> | 2016-02-10 12:28:21 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-11 22:33:39 +0000 |
commit | 093835335ee54634b1ae2a8d9c16ef132cbeacb4 (patch) | |
tree | 0a24b17f913affcafb9e541f63235d242d6f11fd /meta | |
parent | 1f3e1d1e3fbcc2a9319f1c4c9bfffafaf1154d06 (diff) | |
download | poky-093835335ee54634b1ae2a8d9c16ef132cbeacb4.tar.gz |
qemu: Security fix CVE-2016-2197
CVE-2016-2197 Qemu: ide: ahci null pointer dereference when using FIS CLB engines
(From OE-Core rev: bbc41337d28cc54d115378d4cad32f7b1c6f6cd5)
Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch | 59 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu_2.5.0.bb | 1 |
2 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch b/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch new file mode 100644 index 0000000000..946435c430 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From: Prasad J Pandit <address@hidden> | ||
2 | |||
3 | When IDE AHCI emulation uses Frame Information Structures(FIS) | ||
4 | engine for data transfer, the mapped FIS buffer address is stored | ||
5 | in a static 'bounce.buffer'. When a request is made to map another | ||
6 | memory region, address_space_map() returns NULL because | ||
7 | 'bounce.buffer' is in_use. It leads to a null pointer dereference | ||
8 | error while doing 'dma_memory_unmap'. Add a check to avoid it. | ||
9 | |||
10 | Reported-by: Zuozhi fzz <address@hidden> | ||
11 | Signed-off-by: Prasad J Pandit <address@hidden> | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05740.html | ||
15 | |||
16 | CVE: CVE-2016-2197 | ||
17 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
18 | |||
19 | --- | ||
20 | hw/ide/ahci.c | 16 ++++++++++------ | ||
21 | 1 file changed, 10 insertions(+), 6 deletions(-) | ||
22 | |||
23 | Update as per review | ||
24 | -> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05715.html | ||
25 | |||
26 | Index: qemu-2.5.0/hw/ide/ahci.c | ||
27 | =================================================================== | ||
28 | --- qemu-2.5.0.orig/hw/ide/ahci.c | ||
29 | +++ qemu-2.5.0/hw/ide/ahci.c | ||
30 | @@ -661,9 +661,11 @@ static bool ahci_map_fis_address(AHCIDev | ||
31 | |||
32 | static void ahci_unmap_fis_address(AHCIDevice *ad) | ||
33 | { | ||
34 | - dma_memory_unmap(ad->hba->as, ad->res_fis, 256, | ||
35 | - DMA_DIRECTION_FROM_DEVICE, 256); | ||
36 | - ad->res_fis = NULL; | ||
37 | + if (ad->res_fis) { | ||
38 | + dma_memory_unmap(ad->hba->as, ad->res_fis, 256, | ||
39 | + DMA_DIRECTION_FROM_DEVICE, 256); | ||
40 | + ad->res_fis = NULL; | ||
41 | + } | ||
42 | } | ||
43 | |||
44 | static bool ahci_map_clb_address(AHCIDevice *ad) | ||
45 | @@ -677,9 +679,11 @@ static bool ahci_map_clb_address(AHCIDev | ||
46 | |||
47 | static void ahci_unmap_clb_address(AHCIDevice *ad) | ||
48 | { | ||
49 | - dma_memory_unmap(ad->hba->as, ad->lst, 1024, | ||
50 | - DMA_DIRECTION_FROM_DEVICE, 1024); | ||
51 | - ad->lst = NULL; | ||
52 | + if (ad->lst) { | ||
53 | + dma_memory_unmap(ad->hba->as, ad->lst, 1024, | ||
54 | + DMA_DIRECTION_FROM_DEVICE, 1024); | ||
55 | + ad->lst = NULL; | ||
56 | + } | ||
57 | } | ||
58 | |||
59 | static void ahci_write_fis_sdb(AHCIState *s, NCQTransferState *ncq_tfs) | ||
diff --git a/meta/recipes-devtools/qemu/qemu_2.5.0.bb b/meta/recipes-devtools/qemu/qemu_2.5.0.bb index e51ec16882..3e7df2f836 100644 --- a/meta/recipes-devtools/qemu/qemu_2.5.0.bb +++ b/meta/recipes-devtools/qemu/qemu_2.5.0.bb | |||
@@ -8,6 +8,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \ | |||
8 | file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \ | 8 | file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \ |
9 | file://no-valgrind.patch \ | 9 | file://no-valgrind.patch \ |
10 | file://CVE-2016-1568.patch \ | 10 | file://CVE-2016-1568.patch \ |
11 | file://CVE-2016-2197.patch \ | ||
11 | " | 12 | " |
12 | SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2" | 13 | SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2" |
13 | SRC_URI[md5sum] = "f469f2330bbe76e3e39db10e9ac4f8db" | 14 | SRC_URI[md5sum] = "f469f2330bbe76e3e39db10e9ac4f8db" |