diff options
authorPreetham Chandru R <>2013-05-15 17:01:46 +0530
committerMatthew Pedro <>2013-05-22 09:18:11 -0700
commitc75951a17ef41e0cc108f1ced0213bc2620f6534 (patch)
parent32ef1c46e812807ff555b9a8bcf362fc814e14fc (diff)
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 sw_perf_event_destroy(). Introduced in commit b0a873ebb ("perf: Register PMU implementations"). Bug 1289245 Signed-off-by: Tommi Rantala <> Signed-off-by: Preetham Chandru R <> (cherry picked from commit 8176cced706b5e5d15887584150764894e94e02f) Change-Id: Idde0330d7430f2ba1645f4dfed063c5df9bbb44a Reviewed-on: http://git-master/r/228851 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Kiran Adduri <> Reviewed-by: Bo Yan <>
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0f857782d06f..25a977abe7dd 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5072,7 +5072,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;