qemu-e2k/linux-user
Alexander Graf aecc88616a linux-user: Fix up timer id handling
When creating a timer handle, we give the timer id a special magic offset
of 0xcafe0000. However, we never mask that offset out of the timer id before
we start using it to dereference our timer array. So we always end up aborting
timer operations because the timer id is out of bounds.

This was not an issue before my patch e52a99f756 ("linux-user: Simplify
timerid checks on g_posix_timers range") because before we would blindly mask
anything above the first 16 bits.

This patch simplifies the code around timer id creation by introducing a proper
target_timer_id typedef that is s32, just like Linux has it. It also changes the
magic offset to a value that makes all timer ids be positive.

Reported-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Tom Musta <tommusta@gmail.com>
Tested-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-11-11 08:13:09 +02:00
..
aarch64
alpha
arm
cris
i386
m68k
microblaze
mips
mips64
openrisc
ppc
s390x
sh4
sparc
sparc64
unicore32
x86_64
elfload.c
errno_defs.h
flat.h
flatload.c
ioctls.h
linux_loop.h
linuxload.c
m68k-sim.c
main.c
Makefile.objs
mmap.c
qemu.h
signal.c
socket.h
strace.c
strace.list
syscall_defs.h linux-user: Fix up timer id handling 2014-11-11 08:13:09 +02:00
syscall_types.h
syscall.c linux-user: Fix up timer id handling 2014-11-11 08:13:09 +02:00
target_flat.h
uaccess.c
uname.c
uname.h
vm86.c