diff options
author | Peter Zijlstra <[email protected]> | 2014-05-29 19:00:24 +0200 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2014-06-05 12:29:52 +0200 |
commit | ebf905fc7a6e7c99c53b5afc888d8f950da90aff (patch) | |
tree | 9b0c9289f1ac0f30fe14f9bb5a6a646023134f66 /net/lapb/lapb_iface.c | |
parent | 10b0256496fd6c162478547f7c6df1e052e87644 (diff) |
perf: Fix use after free in perf_remove_from_context()
While that mutex should guard the elements, it doesn't guard against the
use-after-free that's from list_for_each_entry_rcu().
__perf_event_exit_task() can actually free the event.
And because list addition/deletion is guarded by both ctx->mutex and
ctx->lock, holding ctx->mutex is sufficient for reading the list, so we
don't actually need the rcu list iteration.
Fixes: 3a497f48637e ("perf: Simplify perf_event_exit_task_context()")
Reported-by: Sasha Levin <[email protected]>
Tested-by: Sasha Levin <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Dave Jones <[email protected]>
Cc: [email protected]
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions