lkml.org 
[lkml]   [2009]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] perf_events: fix bogus copy_to_user() in perf_event_read_group()
From
       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;
               }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-23 17:39    [W:0.046 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site