OSDN Git Service

linux-user: Adjust initial brk when interpreter is close to executable
authorHelge Deller <deller@gmx.de>
Wed, 2 Aug 2023 23:14:01 +0000 (16:14 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 8 Aug 2023 20:27:17 +0000 (13:27 -0700)
commit1f356e8c013f254b6471985bc929c8db1d08c44c
tree8e7242c7963ba432bffb328d91979489290a0b74
parent1ea06ded0de5adcd40a0122ea73c9761f488bfba
linux-user: Adjust initial brk when interpreter is close to executable

While we attempt to load a ET_DYN executable far away from
TASK_UNMAPPED_BASE, we are not completely in control of the
address space layout.  If the interpreter lands close to
the executable, leaving insufficient heap space, move brk.

Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
[rth: Re-order after ELF_ET_DYN_BASE patch so that we do not
 "temporarily break" tsan, and also to minimize the changes required.
 Remove image_info.reserve_brk as unused.]
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/elfload.c
linux-user/qemu.h