]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user: Hold the fd-trans lock across fork
authorGeoffrey Thomas <geofft@ldpreload.com>
Fri, 14 Mar 2025 12:47:42 +0000 (08:47 -0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 13 Jul 2025 08:26:57 +0000 (11:26 +0300)
commit5e1f406424b3a67e8d540e99d9d657c2d32cda47
treea1cc7b994791fed3943c6ba9fa4fd62e52b43398
parent1aa8057181bacab7a499a8ffd04c2de519e2171c
linux-user: Hold the fd-trans lock across fork

If another thread is holding target_fd_trans_lock during a fork,
then the lock becomes permanently locked in the child and the
emulator deadlocks at the next interaction with the fd-trans table.
As with other locks, acquire the lock in fork_start() and release
it in fork_end().

Cc: qemu-stable@nongnu.org
Signed-off-by: Geoffrey Thomas <geofft@ldpreload.com>
Fixes: c093364f4d91 "fd-trans: Fix race condition on reallocation of the translation table."
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2846
Buglink: https://github.com/astral-sh/uv/issues/6105
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250314124742.4965-1-geofft@ldpreload.com>
(cherry picked from commit e4e839b2eeea5745c48ce47144c7842eb7cd455f)
(Mjt: adjust context in linux/main.c for 7.2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/fd-trans.h
linux-user/main.c