summaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorPeter Zijlstra2014-05-29 19:00:24 +0200
committerIngo Molnar2014-06-05 12:29:52 +0200
commitebf905fc7a6e7c99c53b5afc888d8f950da90aff (patch)
tree9b0c9289f1ac0f30fe14f9bb5a6a646023134f66 /include/linux/perf_event.h
parentMerge branch 'perf/kprobes' into perf/core (diff)
downloadkernel-qcow2-linux-ebf905fc7a6e7c99c53b5afc888d8f950da90aff.tar.gz
kernel-qcow2-linux-ebf905fc7a6e7c99c53b5afc888d8f950da90aff.tar.xz
kernel-qcow2-linux-ebf905fc7a6e7c99c53b5afc888d8f950da90aff.zip
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 <sasha.levin@oracle.com> Tested-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Dave Jones <davej@redhat.com> Cc: acme@ghostprotocols.net Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/20140529170024.GA2315@laptop.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/perf_event.h')
0 files changed, 0 insertions, 0 deletions