perf: fix stack data leak
authorArjan van de Ven <arjan@linux.intel.com>
Tue, 21 Jul 2009 07:55:05 +0000 (00:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Jul 2009 16:29:52 +0000 (09:29 -0700)
the "reserved" field was not initialized to zero, resulting in 4 bytes
of stack data leaking to userspace....

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/perf_counter.c

index a641eb7..7bc888d 100644 (file)
@@ -2665,6 +2665,7 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
                header.size += sizeof(cpu_entry);
 
                cpu_entry.cpu = raw_smp_processor_id();
+               cpu_entry.reserved = 0;
        }
 
        if (sample_type & PERF_SAMPLE_PERIOD)