From: Stephane Eranian Date: Tue, 24 Nov 2009 05:40:49 +0000 (-0800) Subject: perf_events: Fix bogus copy_to_user() in perf_event_read_group() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=184d3da8ef0ca552dffa0fdd35c046e058a2cf9a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git perf_events: Fix bogus copy_to_user() in perf_event_read_group() When using an event group, the value and id for non leaders events were wrong due to invalid offset into the outgoing buffer. Signed-off-by: Stephane Eranian Acked-by: Peter Zijlstra Cc: paulus@samba.org Cc: perfmon2-devel@lists.sourceforge.net LKML-Reference: <4b0b71e1.0508d00a.075e.ffff84a3@mx.google.com> Signed-off-by: Ingo Molnar --- diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 9425c9600c89..accfd7bfe387 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -1831,7 +1831,7 @@ static int perf_event_read_group(struct perf_event *event, size = n * sizeof(u64); - if (copy_to_user(buf + size, values, size)) { + if (copy_to_user(buf + ret, values, size)) { ret = -EFAULT; goto unlock; }