Skip to content
Browse files

perf: Treat attr.config as u64 in perf_swevent_init()

Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in

Introduced in commit b0a873e ("perf: Register PMU

Signed-off-by: Tommi Rantala <>
Cc: Peter Zijlstra <>
Cc: Paul Mackerras <>
Cc: Arnaldo Carvalho de Melo <>
Signed-off-by: Ingo Molnar <>
  • Loading branch information...
1 parent 41ef2d5 commit 8176cced706b5e5d15887584150764894e94e02f @rantala rantala committed with Ingo Molnar Apr 13, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 kernel/events/core.c
2 kernel/events/core.c
@@ -5331,7 +5331,7 @@ static void sw_perf_event_destroy(struct perf_event *event)
static int perf_swevent_init(struct perf_event *event)
- int event_id = event->attr.config;
+ u64 event_id = event->attr.config;
if (event->attr.type != PERF_TYPE_SOFTWARE)
return -ENOENT;

0 comments on commit 8176cce

Please sign in to comment.
Something went wrong with that request. Please try again.