qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pmu: fix pmu vmstate subsection list
@ 2021-11-16 15:08 Laurent Vivier
  2021-11-16 15:20 ` Greg Kurz
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Laurent Vivier @ 2021-11-16 15:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, Mark Cave-Ayland

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
     }
 };
 
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-17 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16 15:08 [PATCH] pmu: fix pmu vmstate subsection list Laurent Vivier
2021-11-16 15:20 ` Greg Kurz
2021-11-17 11:03   ` Cédric Le Goater
2021-11-16 15:44 ` Philippe Mathieu-Daudé
2021-11-16 19:50 ` Mark Cave-Ayland
2021-11-17 18:13 ` Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).