]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
migration/ram: fix use after free of local_err
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 24 Mar 2020 15:36:29 +0000 (18:36 +0300)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 25 Mar 2020 12:31:38 +0000 (12:31 +0000)
local_err is used again in migration_bitmap_sync_precopy() after
precopy_notify(), so we must zero it. Otherwise try to set
non-NULL local_err will crash.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200324153630.11882-6-vsementsov@virtuozzo.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/ram.c

index c12cfdbe26d0e59934472198014fcecd91313204..04f13feb2e77341c1b37324bb95ec690e907fe72 100644 (file)
@@ -980,6 +980,7 @@ static void migration_bitmap_sync_precopy(RAMState *rs)
      */
     if (precopy_notify(PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC, &local_err)) {
         error_report_err(local_err);
+        local_err = NULL;
     }
 
     migration_bitmap_sync(rs);