diff options
author | Alexander Graf <agraf@suse.de> | 2014-11-10 21:33:03 +0100 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2014-11-11 08:13:09 +0200 |
commit | aecc88616a64a4e0a1ae0d6986de0054ea9f37d2 (patch) | |
tree | ff3f27cb5e8e23ae7bc3e146f97f7ccbbd406e1c /target-openrisc/interrupt.c | |
parent | ccf661f827faf700b03a30076b5f944e8f787280 (diff) |
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 e52a99f756e ("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>
Diffstat (limited to 'target-openrisc/interrupt.c')
0 files changed, 0 insertions, 0 deletions