mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
qemu_migration: Avoid writing to freed memory
When a domain is killed on the source host while it is being migrated and libvirtd is waiting for the migration to finish (waiting for the domain condition in qemuMigrationSrcWaitForCompletion), the run-time state including priv->job.current may already be freed once virDomainObjWait returns with -1. Thus the priv->job.current pointer cached in jobInfo is no longer valid and setting jobInfo->status may crash the daemon. https://bugzilla.redhat.com/show_bug.cgi?id=1593137 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e41bfae562
commit
dddcb601eb
@ -1584,7 +1584,8 @@ qemuMigrationSrcWaitForCompletion(virQEMUDriverPtr driver,
|
||||
|
||||
if (events) {
|
||||
if (virDomainObjWait(vm) < 0) {
|
||||
jobInfo->status = QEMU_DOMAIN_JOB_STATUS_FAILED;
|
||||
if (virDomainObjIsActive(vm))
|
||||
jobInfo->status = QEMU_DOMAIN_JOB_STATUS_FAILED;
|
||||
return -2;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user