diff options
author | Fabiano Rosas <farosas@suse.de> | 2024-01-19 20:39:18 -0300 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2024-01-29 23:06:53 +0300 |
commit | 106aa13c5bbb10d1742d9f2be1ac73a4918f6a27 (patch) | |
tree | ce90978330e5046d3c2a360e5b3389cff36810a7 /hw/vfio/pci.c | |
parent | e589e5ade7e7dc1f14eacc1670646439e4c07284 (diff) | |
download | qemu-106aa13c5bbb10d1742d9f2be1ac73a4918f6a27.zip qemu-106aa13c5bbb10d1742d9f2be1ac73a4918f6a27.tar.gz qemu-106aa13c5bbb10d1742d9f2be1ac73a4918f6a27.tar.bz2 |
migration: Fix use-after-free of migration state object
We're currently allowing the process_incoming_migration_bh bottom-half
to run without holding a reference to the 'current_migration' object,
which leads to a segmentation fault if the BH is still live after
migration_shutdown() has dropped the last reference to
current_migration.
In my system the bug manifests as migrate_multifd() returning true
when it shouldn't and multifd_load_shutdown() calling
multifd_recv_terminate_threads() which crashes due to an uninitialized
multifd_recv_state.
Fix the issue by holding a reference to the object when scheduling the
BH and dropping it before returning from the BH. The same is already
done for the cleanup_bh at migrate_fd_cleanup_schedule().
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1969
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240119233922.32588-2-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
(cherry picked from commit 27eb8499edb2bc952c29ddae0bdac9fc959bf7b1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/vfio/pci.c')
0 files changed, 0 insertions, 0 deletions