aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace_event_perf.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index e854f420e033..d5e01c3f4e69 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -31,9 +31,18 @@ static int perf_trace_event_perm(struct ftrace_event_call *tp_event,
31 } 31 }
32 32
33 /* The ftrace function trace is allowed only for root. */ 33 /* The ftrace function trace is allowed only for root. */
34 if (ftrace_event_is_function(tp_event) && 34 if (ftrace_event_is_function(tp_event)) {
35 perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN)) 35 if (perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN))
36 return -EPERM; 36 return -EPERM;
37
38 /*
39 * We don't allow user space callchains for function trace
40 * event, due to issues with page faults while tracing page
41 * fault handler and its overall trickiness nature.
42 */
43 if (!p_event->attr.exclude_callchain_user)
44 return -EINVAL;
45 }
37 46
38 /* No tracing, just counting, so no obvious leak */ 47 /* No tracing, just counting, so no obvious leak */
39 if (!(p_event->attr.sample_type & PERF_SAMPLE_RAW)) 48 if (!(p_event->attr.sample_type & PERF_SAMPLE_RAW))