diff options
author | Preetham Chandru R <pchandru@nvidia.com> | 2013-05-15 17:01:46 +0530 |
---|---|---|
committer | Matthew Pedro <mapedro@nvidia.com> | 2013-05-22 09:18:11 -0700 |
commit | c75951a17ef41e0cc108f1ced0213bc2620f6534 (patch) | |
tree | 0b37ac55ad4d00ad205aded00a8db331bb9687d5 /kernel | |
parent | 32ef1c46e812807ff555b9a8bcf362fc814e14fc (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 <tt.rantala@gmail.com>
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
(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 <kadduri@nvidia.com>
Reviewed-by: Bo Yan <byan@nvidia.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/events/core.c | 2 |
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; |