summary refs log tree commit diff stats
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-08-22 11:50:43 +0200
committerRichard Henderson <richard.henderson@linaro.org>2024-10-08 06:28:46 -0700
commita9ee641bd46f5462eeed183ac3c3760bddfc2600 (patch)
treef42a5ba3d79f1022a4bb3bd91ec667b8bec46d74 /linux-user/elfload.c
parent2af37e791906cfda42cb9604a16d218e56994bb1 (diff)
downloadfocaccia-qemu-a9ee641bd46f5462eeed183ac3c3760bddfc2600.tar.gz
focaccia-qemu-a9ee641bd46f5462eeed183ac3c3760bddfc2600.zip
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>
Diffstat (limited to 'linux-user/elfload.c')
0 files changed, 0 insertions, 0 deletions