qemu/linux-user
Philippe Mathieu-Daudé a9ee641bd4 linux-user/flatload: Take mmap_lock in load_flt_binary()
load_flt_binary() calls load_flat_file() -> page_set_flags().

page_set_flags() must be called with the mmap_lock held,
otherwise it aborts:

  $ qemu-arm -L stm32/lib/ stm32/bin/busybox
  qemu-arm: ../accel/tcg/user-exec.c:505: page_set_flags: Assertion `have_mmap_lock()' failed.
  Aborted (core dumped)

Fix by taking the lock in load_flt_binary().

Fixes: fbd3c4cff6 ("linux-user/arm: Mark the commpage executable")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2525
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240822095045.72643-3-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2024-10-08 06:28:46 -07:00
..
aarch64 linux-user,aarch64: move to syscalltbl file 2024-09-22 09:30:18 +02:00
alpha target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
arm target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
generic
hexagon linux-user,hexagon: move to syscalltbl file 2024-09-22 09:30:18 +02:00
hppa linux-user/hppa: fix -Werror=maybe-uninitialized false-positive 2024-10-02 16:14:29 +04:00
i386 target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
include
loongarch64 linux-user,loongarch: move to syscalltbl file 2024-09-22 09:30:18 +02:00
m68k target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
microblaze target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
mips target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
mips64 target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
openrisc linux-user,openrisc: move to syscalltbl file 2024-09-22 09:30:18 +02:00
ppc target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
riscv linux-user,riscv: move to syscalltbl file 2024-09-22 09:30:18 +02:00
s390x target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
sh4 target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
sparc target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
x86_64 target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
xtensa target/ppc: Fix lxvx/stxvx facility check 2024-09-27 10:32:29 +01:00
cpu_loop-common.h
elfload.c linux-user: Remove support for CRIS target 2024-09-13 20:10:50 +02:00
errnos.c.inc
exit.c
fd-trans.c
fd-trans.h
flat.h linux-user/flatload.c: Remove unused bFLT shared-library and ZFLAT code 2024-04-25 10:21:06 +01:00
flatload.c linux-user/flatload: Take mmap_lock in load_flt_binary() 2024-10-08 06:28:46 -07:00
gen-vdso-elfn.c.inc
gen-vdso.c
ioctls.h linux-user: Add ioctl for BLKBSZSET 2024-06-05 09:04:30 -07:00
linux_loop.h
linuxload.c {linux,bsd}-user: Introduce get_task_state() 2024-03-06 12:35:19 +00:00
loader.h
main.c linux-user/main: Check errno when getting AT_EXECFD 2024-07-30 07:59:23 +10:00
meson.build linux-user,hexagon: move to syscalltbl file 2024-09-22 09:30:18 +02:00
mmap.c linux-user: Handle short reads in mmap_h_gt_g 2024-08-21 09:09:46 +10:00
qemu.h user: Declare get_task_state() once in 'accel/tcg/vcpu-state.h' 2024-05-06 14:13:45 +02:00
semihost.c
signal-common.h linux-user: Move tswap_siginfo out of target code 2024-03-13 11:43:52 +00:00
signal.c exec/cpu: Extract page-protection definitions to page-protection.h 2024-05-06 11:17:15 +02:00
socket.h
strace.c linux-user: Fix shmat() strace 2024-03-26 18:20:36 -10:00
strace.h
strace.list linux-user: Add strace for shmat 2024-03-01 08:05:59 -10:00
syscall_defs.h linux-user,loongarch: move to syscalltbl file 2024-09-22 09:30:18 +02:00
syscall_types.h linux-user: Add FITRIM ioctl 2024-04-24 15:46:00 -07:00
syscall.c linux-user/syscall.c: eliminate other explicit LFS usages 2024-09-20 08:06:56 +03:00
thunk.c user: Move 'thunk.h' from 'exec/user' to 'user' 2024-05-03 17:21:20 +02:00
trace-events
trace.h
uaccess.c meson: Make DEBUG_REMAP a meson option 2024-04-24 15:46:00 -07:00
uname.c
uname.h
user-internals.h linux-user: Remove unused handle_vm86_fault 2024-10-03 17:26:06 +03:00
user-mmap.h
vm86.c linux-user: Remove unused handle_vm86_fault 2024-10-03 17:26:06 +03:00