qemu-cr16/linux-user
Richard Purdie ccc5ccc17f linux-user/mmap: Avoid asserts for out of range mremap calls
If mremap() is called without the MREMAP_MAYMOVE flag with a start address
just before the end of memory (reserved_va) where new_size would exceed
it (and GUEST_ADDR_MAX), the assert(end - 1 <= GUEST_ADDR_MAX) in 
page_set_flags() would trigger.

Add an extra guard to the guest_range_valid() checks to prevent this and
avoid asserting binaries when reserved_va is set.

This meant a bug I was seeing locally now gives the same behaviour 
regardless of whether reserved_va is set or not.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org
Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Message-Id: <70c46e7b999bafbb01d54bfafd44b420d0b782e9.camel@linuxfoundation.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2021-02-13 22:50:50 +01:00
..
aarch64 semihosting: Change common-semi API to be architecture-independent 2021-01-18 10:05:06 +00:00
alpha linux-user: Add missing TARGET___O_TMPFILE for hppa and alpha 2021-02-13 22:50:49 +01:00
arm semihosting: Change common-semi API to be architecture-independent 2021-01-18 10:05:06 +00:00
cris
generic linux-user: Remove obsolete F_SHLCK and F_EXLCK translation 2021-01-21 13:27:34 +01:00
host
hppa linux-user: fix O_NONBLOCK in signalfd4() and eventfd2() syscalls 2021-02-13 22:50:49 +01:00
i386
m68k
microblaze
mips
mips64 linux-user/mips64: Support o32 ABI syscalls 2021-02-13 22:50:49 +01:00
nios2
openrisc
ppc
riscv riscv: Add semihosting support for user mode 2021-01-18 10:05:06 +00:00
s390x
sh4
sparc
sparc64
tilegx
x86_64
xtensa
cpu_loop-common.h
elfload.c linux-user: Fix loading of BSS segments 2021-02-13 22:50:49 +01:00
errno_defs.h
exit.c
fd-trans.c
fd-trans.h
flat.h
flatload.c
ioctls.h
linux_loop.h
linuxload.c
main.c accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
meson.build semihosting: Move ARM semihosting code to shared directories 2021-01-18 10:05:06 +00:00
mmap.c linux-user/mmap: Avoid asserts for out of range mremap calls 2021-02-13 22:50:50 +01:00
qemu.h riscv: Add semihosting support 2021-01-18 10:05:06 +00:00
safe-syscall.S
semihost.c riscv: Add semihosting support 2021-01-18 10:05:06 +00:00
signal-common.h
signal.c linux-user/signal: Decode waitid si_code 2021-02-13 22:50:49 +01:00
socket.h
strace.c linux-user: Add IPv6 options to do_print_sockopt() 2021-01-21 13:27:08 +01:00
strace.list
syscall.c linux-user: fix O_NONBLOCK in signalfd4() and eventfd2() syscalls 2021-02-13 22:50:49 +01:00
syscall_defs.h linux-user: Support F_ADD_SEALS and F_GET_SEALS fcntls 2021-01-20 18:21:03 +01:00
syscall_types.h
target_flat.h
trace-events
trace.h
uaccess.c
uname.c
uname.h
vm86.c