diff options
author | Thomas Gleixner <[email protected]> | 2010-02-02 11:40:27 +0100 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2010-02-03 15:13:22 +0100 |
commit | 51246bfd189064079c54421507236fd2723b18f3 (patch) | |
tree | 060060ee3fe1cfe7c3ab510e4aff8a9dc3a7c64f /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | |
parent | 5ecb01cfdf96c5f465192bdb2a4fd4a61a24c6cc (diff) |
futex: Handle user space corruption gracefully
If the owner of a PI futex dies we fix up the pi_state and set
pi_state->owner to NULL. When a malicious or just sloppy programmed
user space application sets the futex value to 0 e.g. by calling
pthread_mutex_init(), then the futex can be acquired again. A new
waiter manages to enqueue itself on the pi_state w/o damage, but on
unlock the kernel dereferences pi_state->owner and oopses.
Prevent this by checking pi_state->owner in the unlock path. If
pi_state->owner is not current we know that user space manipulated the
futex value. Ignore the mess and return -EINVAL.
This catches the above case and also the case where a task hijacks the
futex by setting the tid value and then tries to unlock it.
Reported-by: Jermome Marchand <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Darren Hart <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py')
0 files changed, 0 insertions, 0 deletions