[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] acpi: fix assert failure caused by commit 35c5a
From: |
Dan Williams |
Subject: |
Re: [Qemu-devel] [PATCH] acpi: fix assert failure caused by commit 35c5a52d |
Date: |
Wed, 19 Oct 2016 08:50:57 -0700 |
On Wed, Oct 19, 2016 at 2:19 AM, Haozhong Zhang
<address@hidden> wrote:
> 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 <address@hidden>
> Reported-by: Dan Williams <address@hidden>
Thanks!
Tested-by: Dan Williams <address@hidden>