summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2016-6351_p2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2016-6351_p2.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2016-6351_p2.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2016-6351_p2.patch b/meta/recipes-devtools/qemu/qemu/CVE-2016-6351_p2.patch
new file mode 100644
index 0000000000..c4ed354e8e
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2016-6351_p2.patch
@@ -0,0 +1,60 @@
1From cc96677469388bad3d66479379735cf75db069e3 Mon Sep 17 00:00:00 2001
2From: Paolo Bonzini <pbonzini@redhat.com>
3Date: Mon, 20 Jun 2016 16:32:39 +0200
4Subject: [PATCH] scsi: esp: fix migration
5
6Commit 926cde5 ("scsi: esp: make cmdbuf big enough for maximum CDB size",
72016-06-16) changed the size of a migrated field. Split it in two
8parts, and only migrate the second part in a new vmstate version.
9
10Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11
12Upstream-Status: Backport
13CVE: CVE-2016-6351 patch1
14Signed-off-by: Armin Kuster <akuster@mvista.com>
15
16---
17 hw/scsi/esp.c | 5 +++--
18 include/migration/vmstate.h | 5 ++++-
19 2 files changed, 7 insertions(+), 3 deletions(-)
20
21Index: qemu-2.4.0/hw/scsi/esp.c
22===================================================================
23--- qemu-2.4.0.orig/hw/scsi/esp.c
24+++ qemu-2.4.0/hw/scsi/esp.c
25@@ -571,7 +571,7 @@ static bool esp_mem_accepts(void *opaque
26
27 const VMStateDescription vmstate_esp = {
28 .name ="esp",
29- .version_id = 3,
30+ .version_id = 4,
31 .minimum_version_id = 3,
32 .fields = (VMStateField[]) {
33 VMSTATE_BUFFER(rregs, ESPState),
34@@ -582,7 +582,8 @@ const VMStateDescription vmstate_esp = {
35 VMSTATE_BUFFER(ti_buf, ESPState),
36 VMSTATE_UINT32(status, ESPState),
37 VMSTATE_UINT32(dma, ESPState),
38- VMSTATE_BUFFER(cmdbuf, ESPState),
39+ VMSTATE_PARTIAL_BUFFER(cmdbuf, ESPState, 16),
40+ VMSTATE_BUFFER_START_MIDDLE_V(cmdbuf, ESPState, 16, 4),
41 VMSTATE_UINT32(cmdlen, ESPState),
42 VMSTATE_UINT32(do_cmd, ESPState),
43 VMSTATE_UINT32(dma_left, ESPState),
44Index: qemu-2.4.0/include/migration/vmstate.h
45===================================================================
46--- qemu-2.4.0.orig/include/migration/vmstate.h
47+++ qemu-2.4.0/include/migration/vmstate.h
48@@ -778,8 +778,11 @@ extern const VMStateInfo vmstate_info_bi
49 #define VMSTATE_PARTIAL_BUFFER(_f, _s, _size) \
50 VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, 0, _size)
51
52+#define VMSTATE_BUFFER_START_MIDDLE_V(_f, _s, _start, _v) \
53+ VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, _start, sizeof(typeof_field(_s, _f)))
54+
55 #define VMSTATE_BUFFER_START_MIDDLE(_f, _s, _start) \
56- VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, _start, sizeof(typeof_field(_s, _f)))
57+ VMSTATE_BUFFER_START_MIDDLE_V(_f, _s, _start, 0)
58
59 #define VMSTATE_PARTIAL_VBUFFER(_f, _s, _size) \
60 VMSTATE_VBUFFER(_f, _s, 0, NULL, 0, _size)