diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | 2024-04-30 11:56:44 +0300 |
---|---|---|
committer | Fabiano Rosas <farosas@suse.de> | 2024-05-08 09:20:57 -0300 |
commit | 30116e9079e3f395ef186960d986c7d073d7eb8a (patch) | |
tree | 9a19e6982002a3ff1cfb2ef908065e0bd8e6d199 /migration | |
parent | 246f54e0ccc288239fae78ec9e401ba070667b0b (diff) | |
download | qemu-30116e9079e3f395ef186960d986c7d073d7eb8a.zip qemu-30116e9079e3f395ef186960d986c7d073d7eb8a.tar.gz qemu-30116e9079e3f395ef186960d986c7d073d7eb8a.tar.bz2 |
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 <vsementsov@yandex-team.ru>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/migration.c | 1 |
1 files changed, 1 insertions, 0 deletions
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)); |