From c7ef86dd34501a939623e71d3fb370023fc1448f1ae52795d6c73d0a8db4a22a Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Fri, 18 Feb 2022 18:27:53 +0000 Subject: [PATCH] - libxl: Fix libvirtd crash on domain restore 454b927d-libxl-fix-dom-restore.patch bsc#1196115 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=924 --- 454b927d-libxl-fix-dom-restore.patch | 27 +++++++++++++++++++++++++++ libvirt.changes | 7 +++++++ libvirt.spec | 1 + 3 files changed, 35 insertions(+) create mode 100644 454b927d-libxl-fix-dom-restore.patch diff --git a/454b927d-libxl-fix-dom-restore.patch b/454b927d-libxl-fix-dom-restore.patch new file mode 100644 index 0000000..41adea7 --- /dev/null +++ b/454b927d-libxl-fix-dom-restore.patch @@ -0,0 +1,27 @@ +commit 454b927d1e33a1fe9dca535db2c97300fdae62cc +Author: Jim Fehlig +Date: Thu Feb 17 11:48:13 2022 -0700 + + libxl: Fix libvirtd crash on domain restore + + Commit cc2a3c2a94 missed one case in the libxl driver where virDomainDef + is returned from libxlDomainSaveImageOpen and a g_steal_pointer is needed. + Without it, the virDomainDef object is freed and the driver crashes later + in the restore process when accessing the object. + + Signed-off-by: Jim Fehlig + Reviewed-by: Ján Tomko + +Index: libvirt-8.0.0/src/libxl/libxl_domain.c +=================================================================== +--- libvirt-8.0.0.orig/src/libxl/libxl_domain.c ++++ libvirt-8.0.0/src/libxl/libxl_domain.c +@@ -811,7 +811,7 @@ libxlDomainSaveImageOpen(libxlDriverPriv + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) + goto error; + +- *ret_def = def; ++ *ret_def = g_steal_pointer(&def); + *ret_hdr = hdr; + + return fd; diff --git a/libvirt.changes b/libvirt.changes index 118ad43..d2d5ab8 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Feb 18 18:25:46 UTC 2022 - James Fehlig + +- libxl: Fix libvirtd crash on domain restore + 454b927d-libxl-fix-dom-restore.patch + bsc#1196115 + ------------------------------------------------------------------- Tue Feb 8 22:25:03 UTC 2022 - James Fehlig diff --git a/libvirt.spec b/libvirt.spec index 9610867..b4a1522 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -309,6 +309,7 @@ Patch4: 105dace2-revert-virProcessGetStatInfo.patch Patch5: e0241f33-libxl-mark-allocated-graphics-ports.patch Patch6: 18ec405a-libxl-release-graphics-ports.patch Patch7: 76deb656-qemu-fix-snapshot-revert.patch +Patch8: 454b927d-libxl-fix-dom-restore.patch # Patches pending upstream review Patch100: libxl-dom-reset.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch