]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/ppc/spapr: free host_model and host_serial on finalization
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 27 Apr 2026 12:26:25 +0000 (16:26 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Sat, 6 Jun 2026 05:15:23 +0000 (09:15 +0400)
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>
hw/ppc/spapr.c

index 191f7431bdf59bd5f72fc16765ba04b4c79ece6f..f0e99bb5be77dfe1323766a4c9227532a6c3f89f 100644 (file)
@@ -3517,6 +3517,8 @@ static void spapr_machine_finalizefn(Object *obj)
     SpaprMachineState *spapr = SPAPR_MACHINE(obj);
 
     g_free(spapr->kvm_type);
+    g_free(spapr->host_model);
+    g_free(spapr->host_serial);
 }
 
 void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg)