Skip to content

Commit

Permalink
perf_events: Fix bogus copy_to_user() in perf_event_read_group()
Browse files Browse the repository at this point in the history
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 <eranian@google.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: paulus@samba.org
Cc: perfmon2-devel@lists.sourceforge.net
LKML-Reference: <4b0b71e1.0508d00a.075e.ffff84a3@mx.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Stephane Eranian authored and Ingo Molnar committed Nov 24, 2009
1 parent b23d576 commit 184d3da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 184d3da

Please sign in to comment.