qemu-e2k/hw/acpi
Haozhong Zhang 53000638f2 acpi: fix assert failure caused by commit 35c5a52d
Commit 35c5a52d "acpi: do not use TARGET_PAGE_SIZE" changed struct
NvdimmDsmIn from a variable-size structure to a fixed-size structure of
4096 bytes. It forgot to adjust an assert in
nvdimm_dsm_set_label_data(..., NvdimmDsmIn *in, ...):
    assert(sizeof(*in) + sizeof(*set_label_data) + set_label_data->length <=
           4096);
which could crash QEMU when guest writes NVDIMM labels.

Fix it by replacing sizeof(*in) by offsetof(NvdimmDsmIn, arg3).

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reported-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-11-01 19:21:09 +02:00
..
acpi_interface.c acpi: extend ACPI interface to provide send_event hook 2016-06-07 15:36:54 +03:00
aml-build.c hw/i386: AMD IOMMU IVRS table 2016-09-24 01:02:01 +03:00
bios-linker-loader.c acpi: make bios_linker_loader_add_checksum() API offset based 2016-06-07 15:39:27 +03:00
core.c opts-visitor: Favor new visit_free() function 2016-07-06 10:52:04 +02:00
cpu_hotplug.c pc: Leave max apic_id_limit only in legacy cpu hotplug code 2016-10-24 17:29:15 -02:00
cpu.c pc: acpi: x2APIC support for MADT table and _MAT method 2016-10-24 17:29:14 -02:00
ich9.c pc: use new CPU hotplug interface since 2.7 machine type 2016-06-24 05:21:38 +03:00
ipmi.c acpi/ipmi: Initialize the fwinfo before fetching it 2016-11-01 19:21:09 +02:00
Makefile.objs nvdimm acpi: compile nvdimm acpi code arch-independently 2016-11-01 19:21:08 +02:00
memory_hotplug_acpi_table.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
memory_hotplug.c pc: memhp: enable nvdimm device hotplug 2016-11-01 19:21:09 +02:00
nvdimm.c acpi: fix assert failure caused by commit 35c5a52d 2016-11-01 19:21:09 +02:00
pcihp.c pc: use AcpiDeviceIfClass.send_event to issue GPE events 2016-06-07 15:36:54 +03:00
piix4.c pc: use new CPU hotplug interface since 2.7 machine type 2016-06-24 05:21:38 +03:00
tco.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00