linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@elte.hu, paulus@samba.org,
	perfmon2-devel@lists.sourceforge.net, eranian@google.com,
	eranian@gmail.com
Subject: [PATCH] perf_events: fix bogus copy_to_user() in perf_event_read_group()
Date: Mon, 23 Nov 2009 21:40:49 -0800 (PST)	[thread overview]
Message-ID: <4b0b71e1.0508d00a.075e.ffff84a3@mx.google.com> (raw)
In-Reply-To: <bd4cb8900911230836na261658udd82f5c20630ffba@mail.gmail.com>

	[This is a repost due to a formatting problem with Gmail]

	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>

---
 perf_event.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 0b0d5f7..8306127 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -1826,7 +1826,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;
 		}

  parent reply	other threads:[~2009-11-24  5:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4b0ab8b1.1c07d00a.4859.5f71@mx.google.com>
2009-11-23 16:36 ` [PATCH] perf_events: fix bogus copy_to_user() in perf_event_read_group() Stephane Eranian
2009-11-23 16:46   ` Peter Zijlstra
2009-11-23 16:47     ` Stephane Eranian
2009-11-23 17:07   ` Ingo Molnar
2009-11-24  5:40   ` Stephane Eranian [this message]
2009-11-24 16:56     ` [tip:perf/core] perf_events: Fix " tip-bot for Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b0b71e1.0508d00a.075e.ffff84a3@mx.google.com \
    --to=eranian@google.com \
    --cc=eranian@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=perfmon2-devel@lists.sourceforge.net \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).