@samitouri / QOSamiQemu / commits / 8a2b57ad2a

hw/ppc/spapr: free host_model and host_serial on finalization

The host_model and host_serial strings are allocated via g_strdup in property setters but never freed when the machine is destroyed. Fixes: 27461d69a0f ("ppc: add host-serial and host-model machine attributes (CVE-2019-8934)") Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Marc-André Lureau committed Apr 27, 2026 at 16:26 UTC 8a2b57ad2ae2ab4fb3a7124f60ec74a51f41a5cc
1 file changed +2
hw/ppc/spapr.c
+2
@@ -3517,6 +3517,8 @@ static void spapr_machine_finalizefn(Object *obj)
3517 SpaprMachineState *spapr = SPAPR_MACHINE(obj);
3518
3519 g_free(spapr->kvm_type);
3520 + g_free(spapr->host_model);
3521 + g_free(spapr->host_serial);
3522 }
3523
3524 void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg)