aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2014-03-02 10:56:39 -0500
committerIngo Molnar <mingo@kernel.org>2014-03-11 06:57:58 -0400
commit63c45f4ba533e9749da16298db53e491c25d805b (patch)
treeb3fce35edf1f68221b7487ea729df4e2ef5c3145
parentcfa77bc4af2c75c0781ee76cde2dd104c6c8e2b7 (diff)
perf: Disallow user-space stack dumps for function trace events
Recent issues with user space callchains processing within page fault handler tracing showed as Peter said 'there's just too much fail surface'. The user space stack dump is just another source of the this issue. Related list discussions: http://marc.info/?t=139302086500001&r=1&w=2 http://marc.info/?t=139301437300003&r=1&w=2 Suggested-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Paul Mackerras <paulus@samba.org> Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1393775800-13524-3-git-send-email-jolsa@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/trace/trace_event_perf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index d5e01c3f4e69..c894614de14d 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -42,6 +42,13 @@ static int perf_trace_event_perm(struct ftrace_event_call *tp_event,
42 */ 42 */
43 if (!p_event->attr.exclude_callchain_user) 43 if (!p_event->attr.exclude_callchain_user)
44 return -EINVAL; 44 return -EINVAL;
45
46 /*
47 * Same reason to disable user stack dump as for user space
48 * callchains above.
49 */
50 if (p_event->attr.sample_type & PERF_SAMPLE_STACK_USER)
51 return -EINVAL;
45 } 52 }
46 53
47 /* No tracing, just counting, so no obvious leak */ 54 /* No tracing, just counting, so no obvious leak */