On Wed, Aug 16, 2023 at 11:25:04AM -0300, Fabiano Rosas wrote:
> We cannot call qemu_file_shutdown() on the return path file without
> taking the file lock. The return path thread could be running it's
> cleanup code and have just cleared the from_dst_file pointer.
> 
> Checking ms->to_dst_file for errors could also race with
> migrate_fd_cleanup() which clears the to_dst_file pointer.
> 
> Protect both accesses by taking the file lock.
> 
> This was caught by inspection, it should be rare, but the next patches
> will start calling this code from other places, so let's do the
> correct thing.
> 
> Signed-off-by: Fabiano Rosas <faro...@suse.de>

Reviewed-by: Peter Xu <pet...@redhat.com>

-- 
Peter Xu


Reply via email to