public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] perf/trace properly use u64 to hold event_id
@ 2013-11-15 17:39 Vince Weaver
  2013-11-18  8:53 ` Peter Zijlstra
  2013-11-19 19:19 ` [tip:perf/urgent] perf/trace: Properly " tip-bot for Vince Weaver
  0 siblings, 2 replies; 3+ messages in thread
From: Vince Weaver @ 2013-11-15 17:39 UTC (permalink / raw)
  To: LKML; +Cc: Steven Rostedt, Peter Zijlstra, Frederic Weisbecker, Ingo Molnar


The 64-bit attr.config value for perf trace events was being copied into
an "int" before doing a comparison, meaning the top 32 bits were
being truncated.

As far as I can tell this didn't cause any errors, but it did mean
it was possible to create valid aliases for all the tracepoint ids
which I don't think was intended.  (For example, 0xffffffff00000018
and 0x18 both enable the same tracepoint).

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>

diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 78e27e3..280c3db0 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -173,7 +173,7 @@ static int perf_trace_event_init(struct ftrace_event_call *tp_event,
 int perf_trace_init(struct perf_event *p_event)
 {
 	struct ftrace_event_call *tp_event;
-	int event_id = p_event->attr.config;
+	u64 event_id = p_event->attr.config;
 	int ret = -EINVAL;
 
 	mutex_lock(&event_mutex);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-19 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15 17:39 [patch] perf/trace properly use u64 to hold event_id Vince Weaver
2013-11-18  8:53 ` Peter Zijlstra
2013-11-19 19:19 ` [tip:perf/urgent] perf/trace: Properly " tip-bot for Vince Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox