提交 a4e95fc2 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

perf_counter: Require CAP_SYS_ADMIN for raw tracepoint data

Raw tracepoint data contains various kernel internals and
data from other users, so restrict this to CAP_SYS_ADMIN.
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1249896452.17467.75.camel@twins>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 a044560c
...@@ -3787,6 +3787,14 @@ static void tp_perf_counter_destroy(struct perf_counter *counter) ...@@ -3787,6 +3787,14 @@ static void tp_perf_counter_destroy(struct perf_counter *counter)
static const struct pmu *tp_perf_counter_init(struct perf_counter *counter) static const struct pmu *tp_perf_counter_init(struct perf_counter *counter)
{ {
/*
* Raw tracepoint data is a severe data leak, only allow root to
* have these.
*/
if ((counter->attr.sample_type & PERF_SAMPLE_RAW) &&
!capable(CAP_SYS_ADMIN))
return ERR_PTR(-EPERM);
if (ftrace_profile_enable(counter->attr.config)) if (ftrace_profile_enable(counter->attr.config))
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册