acpi: fix buffer overrun on migration
commitd9a3b33d2c9f996537b7f1d0246dee2d0120cefb
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 19 Nov 2015 13:14:07 +0000 (19 15:14 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 19 Nov 2015 13:26:00 +0000 (19 15:26 +0200)
treebb329b309036a52dda07e4aa184c0564cc7fb1d6
parent48854f57ce3e6aa4bd13368559e5c292e1c44e49
acpi: fix buffer overrun on migration

ich calls acpi_gpe_init with length ICH9_PMIO_GPE0_LEN so
ICH9_PMIO_GPE0_LEN/2 bytes are allocated, but then the full
ICH9_PMIO_GPE0_LEN bytes are migrated.

As a quick work-around, allocate twice the memory.
We'll probably want to tweak code to avoid
migrating the extra ICH9_PMIO_GPE0_LEN/2 bytes,
but that is a bit trickier to do without breaking
migration compatibility.

Tested-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/acpi/core.c