|
@@ -30,6 +30,18 @@ static int perf_trace_event_perm(struct ftrace_event_call *tp_event,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * We checked and allowed to create parent,
|
|
|
+ * allow children without checking.
|
|
|
+ */
|
|
|
+ if (p_event->parent)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * It's ok to check current process (owner) permissions in here,
|
|
|
+ * because code below is called only via perf_event_open syscall.
|
|
|
+ */
|
|
|
+
|
|
|
/* The ftrace function trace is allowed only for root. */
|
|
|
if (ftrace_event_is_function(tp_event)) {
|
|
|
if (perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN))
|