perf, x86: Restrict the ANY flag
The ANY flag can show SMT data of another task (like 'top'), so we want to disable it when system-wide profiling is disabled. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
bb1165d688
commit
320ebf09cb
@ -503,6 +503,9 @@ static int __hw_perf_event_init(struct perf_event *event)
|
||||
*/
|
||||
if (attr->type == PERF_TYPE_RAW) {
|
||||
hwc->config |= x86_pmu.raw_event(attr->config);
|
||||
if ((hwc->config & ARCH_PERFMON_EVENTSEL_ANY) &&
|
||||
perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN))
|
||||
return -EACCES;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user