Skip to content

Commit

Permalink
perf/ftrace: Fix paranoid level for enabling function tracer
Browse files Browse the repository at this point in the history
commit 12ae030d54ef250706da5642fc7697cc60ad0df7 upstream.

The current default perf paranoid level is "1" which has
"perf_paranoid_kernel()" return false, and giving any operations that
use it, access to normal users. Unfortunately, this includes function
tracing and normal users should not be allowed to enable function
tracing by default.

The proper level is defined at "-1" (full perf access), which
"perf_paranoid_tracepoint_raw()" will only give access to. Use that
check instead for enabling function tracing.

Reported-by: Dave Jones <[email protected]>
Reported-by: Vince Weaver <[email protected]>
Tested-by: Vince Weaver <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
CVE: CVE-2013-2930
Fixes: ced3900 ("ftrace, perf: Add support to use function tracepoint in perf")
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
rostedt authored and gregkh committed Nov 29, 2013
1 parent f22ff9d commit d134082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_event_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static int perf_trace_event_perm(struct ftrace_event_call *tp_event,
{
/* The ftrace function trace is allowed only for root. */
if (ftrace_event_is_function(tp_event) &&
perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN))
perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN))
return -EPERM;

/* No tracing, just counting, so no obvious leak */
Expand Down

0 comments on commit d134082

Please sign in to comment.