Update qemu package to mitigate CVE-2015-3456
[packages/centos6/qemu.git] / 0019-vmstate-s-VMSTATE_INT32_LE-VMSTATE_INT32_POSITIVE_LE.patch
1 From 83bb87c00e9970a1771ddcad3fd99091f5b2719c Mon Sep 17 00:00:00 2001
2 From: "Michael S. Tsirkin" <mst@redhat.com>
3 Date: Thu, 3 Apr 2014 19:52:21 +0300
4 Subject: [PATCH] vmstate: s/VMSTATE_INT32_LE/VMSTATE_INT32_POSITIVE_LE/
5
6 As the macro verifies the value is positive, rename it
7 to make the function clearer.
8
9 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 Signed-off-by: Juan Quintela <quintela@redhat.com>
11 (cherry picked from commit 3476436a44c29725efef0cabf5b3ea4e70054d57)
12 ---
13  hw/pci/pci.c                | 4 ++--
14  include/migration/vmstate.h | 2 +-
15  target-arm/machine.c        | 2 +-
16  3 files changed, 4 insertions(+), 4 deletions(-)
17
18 diff --git a/hw/pci/pci.c b/hw/pci/pci.c
19 index 2a9f08e..517ff2a 100644
20 --- a/hw/pci/pci.c
21 +++ b/hw/pci/pci.c
22 @@ -475,7 +475,7 @@ const VMStateDescription vmstate_pci_device = {
23      .minimum_version_id = 1,
24      .minimum_version_id_old = 1,
25      .fields      = (VMStateField []) {
26 -        VMSTATE_INT32_LE(version_id, PCIDevice),
27 +        VMSTATE_INT32_POSITIVE_LE(version_id, PCIDevice),
28          VMSTATE_BUFFER_UNSAFE_INFO(config, PCIDevice, 0,
29                                     vmstate_info_pci_config,
30                                     PCI_CONFIG_SPACE_SIZE),
31 @@ -492,7 +492,7 @@ const VMStateDescription vmstate_pcie_device = {
32      .minimum_version_id = 1,
33      .minimum_version_id_old = 1,
34      .fields      = (VMStateField []) {
35 -        VMSTATE_INT32_LE(version_id, PCIDevice),
36 +        VMSTATE_INT32_POSITIVE_LE(version_id, PCIDevice),
37          VMSTATE_BUFFER_UNSAFE_INFO(config, PCIDevice, 0,
38                                     vmstate_info_pci_config,
39                                     PCIE_CONFIG_SPACE_SIZE),
40 diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
41 index 5b71370..7e45048 100644
42 --- a/include/migration/vmstate.h
43 +++ b/include/migration/vmstate.h
44 @@ -601,7 +601,7 @@ extern const VMStateInfo vmstate_info_bitmap;
45  #define VMSTATE_UINT64_EQUAL(_f, _s)                                  \
46      VMSTATE_UINT64_EQUAL_V(_f, _s, 0)
47  
48 -#define VMSTATE_INT32_LE(_f, _s)                                   \
49 +#define VMSTATE_INT32_POSITIVE_LE(_f, _s)                             \
50      VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t)
51  
52  #define VMSTATE_UINT8_TEST(_f, _s, _t)                               \
53 diff --git a/target-arm/machine.c b/target-arm/machine.c
54 index 7ced87a..5746ffd 100644
55 --- a/target-arm/machine.c
56 +++ b/target-arm/machine.c
57 @@ -246,7 +246,7 @@ const VMStateDescription vmstate_arm_cpu = {
58          /* The length-check must come before the arrays to avoid
59           * incoming data possibly overflowing the array.
60           */
61 -        VMSTATE_INT32_LE(cpreg_vmstate_array_len, ARMCPU),
62 +        VMSTATE_INT32_POSITIVE_LE(cpreg_vmstate_array_len, ARMCPU),
63          VMSTATE_VARRAY_INT32(cpreg_vmstate_indexes, ARMCPU,
64                               cpreg_vmstate_array_len,
65                               0, vmstate_info_uint64, uint64_t),