[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pmu: fix pmu vmstate subsection list
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH] pmu: fix pmu vmstate subsection list |
Date: |
Tue, 16 Nov 2021 16:44:33 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 11/16/21 16:08, Laurent Vivier wrote:
> The subsection is not closed by a NULL marker so this can trigger
> a segfault when the pmu vmstate is saved.
>
> This can be easily shown with:
>
> $ ./qemu-system-ppc64 -dump-vmstate vmstate.json
> Segmentation fault (core dumped)
>
> Fixes: d811d61fbc6c ("mac_newworld: add PMU device")
> Cc: mark.cave-ayland@ilande.co.uk
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> hw/misc/macio/pmu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c
> index 4ad4f50e08c3..eb39c64694aa 100644
> --- a/hw/misc/macio/pmu.c
> +++ b/hw/misc/macio/pmu.c
> @@ -718,6 +718,7 @@ static const VMStateDescription vmstate_pmu = {
> },
> .subsections = (const VMStateDescription * []) {
> &vmstate_pmu_adb,
> + NULL
> }
> };
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
BTW I ran 'git grep -W -F .subsections' and couldn't find other
occurrence.