From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: "Juan Quintela" <quintela@redhat.com>,
"Peter Xu" <peterx@redhat.com>,
"Leonardo Bras" <leobras@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [RFC PATCH v2 0/4] migration: Fix multifd qemu_mutex_destroy race
Date: Fri, 10 Nov 2023 17:02:37 -0300 [thread overview]
Message-ID: <20231110200241.20679-1-farosas@suse.de> (raw)
changes:
- dropped the Error patch
- removed p->running
- joined the TLS thread
v1:
https://lore.kernel.org/r/20231109165856.15224-1-farosas@suse.de
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 (4):
migration/multifd: Stop setting p->ioc before connecting
migration/multifd: Join the TLS thread
migration/multifd: Remove p->running
migration/multifd: Move semaphore release into main thread
migration/migration.c | 4 +-
migration/multifd.c | 87 +++++++++++++++++++++++--------------------
migration/multifd.h | 9 ++---
3 files changed, 53 insertions(+), 47 deletions(-)
--
2.35.3
next reply other threads:[~2023-11-10 20:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 20:02 Fabiano Rosas [this message]
2023-11-10 20:02 ` [RFC PATCH v2 1/4] migration/multifd: Stop setting p->ioc before connecting Fabiano Rosas
2023-11-13 22:15 ` Peter Xu
2023-11-16 15:54 ` Juan Quintela
2023-11-10 20:02 ` [RFC PATCH v2 2/4] migration/multifd: Join the TLS thread Fabiano Rosas
2023-11-13 17:33 ` Peter Xu
2023-11-10 20:02 ` [RFC PATCH v2 3/4] migration/multifd: Remove p->running Fabiano Rosas
2023-11-10 20:02 ` [RFC PATCH v2 4/4] migration/multifd: Move semaphore release into main thread Fabiano Rosas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231110200241.20679-1-farosas@suse.de \
--to=farosas@suse.de \
--cc=leobras@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).