perf: Fix racy group access
authorPeter Zijlstra <peterz@infradead.org>
Wed, 25 Feb 2015 14:56:04 +0000 (15:56 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 27 Mar 2015 08:49:45 +0000 (09:49 +0100)
commitccd41c86ad4d464d0ed4e48d80759ff85c2115b0
treeb53b1e7507761a9144f900eff6f97cd4bb6d15c5
parent9332d250b4b4f67c633894b311e022e3cf943bd5
perf: Fix racy group access

While looking at some fuzzer output I noticed that we do not hold any
locks on leader->ctx and therefore the sibling_list iteration is
unsafe.

Acquire the relevant ctx->mutex before calling into the pmu specific
code.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Link: http://lkml.kernel.org/r/20150225151639.GL5029@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c