summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-02-10 08:12:59 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-21 09:37:33 +0000
commit50700a7da68489e6d3bc8a3336875d8274302ea9 (patch)
tree0f20ce5298fab765a2dd52751e83b09f2de25305 /meta
parent1f0e615becfd0137e1ce13f79a2b81276b385b85 (diff)
downloadpoky-50700a7da68489e6d3bc8a3336875d8274302ea9.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: ca7cbcf22558349f0b43ed7dc84ad38d7c178c55) 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.patch59
-rw-r--r--meta/recipes-devtools/qemu/qemu_2.4.0.bb1
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 @@
1From: Prasad J Pandit <address@hidden>
2
3When IDE AHCI emulation uses Frame Information Structures(FIS)
4engine for data transfer, the mapped FIS buffer address is stored
5in a static 'bounce.buffer'. When a request is made to map another
6memory region, address_space_map() returns NULL because
7'bounce.buffer' is in_use. It leads to a null pointer dereference
8error while doing 'dma_memory_unmap'. Add a check to avoid it.
9
10Reported-by: Zuozhi fzz <address@hidden>
11Signed-off-by: Prasad J Pandit <address@hidden>
12
13Upstream-Status: Backport
14https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05740.html
15
16CVE: CVE-2016-2197
17Signed-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
26Index: 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.4.0.bb b/meta/recipes-devtools/qemu/qemu_2.4.0.bb
index 994ddff8a5..e6f2cf3fd3 100644
--- a/meta/recipes-devtools/qemu/qemu_2.4.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_2.4.0.bb
@@ -18,6 +18,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
18 file://CVE-2015-7295_1.patch \ 18 file://CVE-2015-7295_1.patch \
19 file://CVE-2015-7295_2.patch \ 19 file://CVE-2015-7295_2.patch \
20 file://CVE-2015-7295_3.patch \ 20 file://CVE-2015-7295_3.patch \
21 file://CVE-2016-2197.patch \
21 " 22 "
22SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2" 23SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
23SRC_URI[md5sum] = "186ee8194140a484a455f8e3c74589f4" 24SRC_URI[md5sum] = "186ee8194140a484a455f8e3c74589f4"