aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTommi Rantala <tt.rantala@gmail.com>2013-06-12 17:12:04 +0200
committerDaniel Hillenbrand <codeworkx@cyanogenmod.org>2013-06-12 17:12:04 +0200
commite25020d0b5430c86778e3c2bf3e5050e96db0d77 (patch)
treecc6184a5a19a3cb476e6677d55877bd1cda1e095 /kernel
parent55bb2048feb59f2190f704c2a4df81b557b55c7a (diff)
downloadkernel_samsung_smdk4412-e25020d0b5430c86778e3c2bf3e5050e96db0d77.tar.gz
kernel_samsung_smdk4412-e25020d0b5430c86778e3c2bf3e5050e96db0d77.tar.bz2
kernel_samsung_smdk4412-e25020d0b5430c86778e3c2bf3e5050e96db0d77.zip
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"). Change-Id: I1c88a37754c4ab7044f2df96916d874f807a5068 Signed-off-by: Tommi Rantala <tt.rantala@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: davej@redhat.com Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Link: http://lkml.kernel.org/r/1365882554-30259-1-git-send-email-tt.rantala@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7b344be8863..b5826507d1e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5440,7 +5440,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;