[PATCH 0/2] qemu: Fix crash when resuming failed post-copy migration

Jiri Denemark (2): qemu: Fix crash when resuming failed post-copy migration NEWS: Fix virtqemud crash when resuming failed post-copy migration NEWS.rst | 7 +++++++ src/qemu/qemu_migration.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) -- 2.49.0

From: Jiri Denemark <jdenemar@redhat.com> Since commit 28a06215280 (released in 11.2.0) resuming a failed post-copy migration calls qemuProcessIncomingDefNew with fd == NULL rather than -1. The function does not expect to be called with NULL file descriptor and tries to dereference it causing virtqemud on the destination host to crash. Fixes: 28a06215280b99708ed8dc2d183f62ba7b34ccf8 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2a01ca58bd..1f91ad1117 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3642,6 +3642,7 @@ qemuMigrationDstPrepareResume(virQEMUDriver *driver, virDomainJobStatus status; virDomainObj *vm; int ret = -1; + int nofd = -1; VIR_DEBUG("name=%s, origname=%s, protocol=%s, port=%hu, " "listenAddress=%s, flags=0x%x", @@ -3684,7 +3685,7 @@ qemuMigrationDstPrepareResume(virQEMUDriver *driver, priv->origname = g_strdup(origname); if (!(incoming = qemuMigrationDstPrepare(driver, vm, false, protocol, - listenAddress, port, NULL))) + listenAddress, port, &nofd))) goto cleanup; if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_MIGRATION_IN) < 0) -- 2.49.0

On Tue, May 27, 2025 at 12:28:20 +0200, Jiri Denemark via Devel wrote:
From: Jiri Denemark <jdenemar@redhat.com>
Since commit 28a06215280 (released in 11.2.0) resuming a failed post-copy migration calls qemuProcessIncomingDefNew with fd == NULL rather than -1. The function does not expect to be called with NULL file descriptor and tries to dereference it causing virtqemud on the destination host to crash.
Fixes: 28a06215280b99708ed8dc2d183f62ba7b34ccf8 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

From: Jiri Denemark <jdenemar@redhat.com> Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 636fcbd573..a880524ca2 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -42,6 +42,13 @@ v11.4.0 (unreleased) The only workaround is to avoid the broken versions. + * qemu: Fix virtqemud crash when resuming failed post-copy migration + + A regression introduced in ``libvirt-11.2.0`` caused virtqemud on the + destination host to crash when trying to resume failed post-copy + migration. + + v11.3.0 (2025-05-02) ==================== -- 2.49.0

On Tue, May 27, 2025 at 12:28:21 +0200, Jiri Denemark via Devel wrote:
From: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst index 636fcbd573..a880524ca2 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -42,6 +42,13 @@ v11.4.0 (unreleased)
The only workaround is to avoid the broken versions.
+ * qemu: Fix virtqemud crash when resuming failed post-copy migration + + A regression introduced in ``libvirt-11.2.0`` caused virtqemud on the + destination host to crash when trying to resume failed post-copy + migration. + +
Thanks for fixing the newline I didn't add
v11.3.0 (2025-05-02) ====================
-- 2.49.0
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
participants (2)
-
Jiri Denemark
-
Peter Krempa