From 30116e9079e3f395ef186960d986c7d073d7eb8a Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Tue, 30 Apr 2024 11:56:44 +0300 Subject: migration: process_incoming_migration_co(): fix reporting s->error It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 1 + 1 file changed, 1 insertion(+) (limited to 'migration') diff --git a/migration/migration.c b/migration/migration.c index 0d26db4..b307a4b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -784,6 +784,7 @@ process_incoming_migration_co(void *opaque) if (migrate_has_error(s)) { WITH_QEMU_LOCK_GUARD(&s->error_mutex) { error_report_err(s->error); + s->error = NULL; } } error_report("load of migration failed: %s", strerror(-ret)); -- cgit v1.1