提交 184d3da8 编写于 作者: S Stephane Eranian 提交者: Ingo Molnar

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: NStephane Eranian <eranian@google.com>
Acked-by: NPeter 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: NIngo Molnar <mingo@elte.hu>
上级 b23d5767
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册