qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] migration: Fix multifd qemu_mutex_destroy race
@ 2023-11-09 16:58 Fabiano Rosas
  2023-11-09 16:58 ` [RFC PATCH 1/2] migration: Report error in incoming migration Fabiano Rosas
  2023-11-09 16:58 ` [RFC PATCH 2/2] migration/multifd: Move semaphore release into main thread Fabiano Rosas
  0 siblings, 2 replies; 17+ messages in thread
From: Fabiano Rosas @ 2023-11-09 16:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Juan Quintela, Peter Xu, Leonardo Bras,
	Philippe Mathieu-Daudé

We're calling qemu_sem_post() in threads other than the multifd
channel and the migration thread. This is vulnerable to a race with
multifd_save_cleanup() which calls qemu_sem_destroy(). If we attempt
to destroy the semaphore mutex with the lock taken, the code asserts.

We're hitting this in the current master and we've had reports of this
in the past already:

[PATCH] migrate/multifd: fix coredump when the multifd thread cleanup
https://lore.kernel.org/r/20230621081826.3203053-1-zhangjianguo18@huawei.com

Fabiano Rosas (2):
  migration: Report error in incoming migration
  migration/multifd: Move semaphore release into main thread

 migration/migration.c | 11 ++++++++++-
 migration/multifd.c   | 29 +++++++++++------------------
 2 files changed, 21 insertions(+), 19 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-11-16 18:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 16:58 [RFC PATCH 0/2] migration: Fix multifd qemu_mutex_destroy race Fabiano Rosas
2023-11-09 16:58 ` [RFC PATCH 1/2] migration: Report error in incoming migration Fabiano Rosas
2023-11-09 18:57   ` Peter Xu
2023-11-10 10:58     ` Fabiano Rosas
2023-11-13 16:51       ` Peter Xu
2023-11-14  1:54         ` Fabiano Rosas
2023-11-09 16:58 ` [RFC PATCH 2/2] migration/multifd: Move semaphore release into main thread Fabiano Rosas
2023-11-09 18:56   ` Peter Xu
2023-11-10 12:05     ` Fabiano Rosas
2023-11-10 12:37       ` Fabiano Rosas
2023-11-16 15:51         ` Juan Quintela
2023-11-13 16:45       ` Peter Xu
2023-11-14  1:50         ` Fabiano Rosas
2023-11-14 17:28           ` Peter Xu
2023-11-16 15:44       ` Juan Quintela
2023-11-16 14:56     ` Juan Quintela
2023-11-16 18:13       ` Fabiano Rosas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).