[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.00.1005141942280.19908@tigran.mtv.corp.google.com>
Date: Fri, 14 May 2010 19:44:10 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
cc: linux-kernel@...r.kernel.org
Subject: [PATCH] profile: fix stats and data leakage
If the kernel is large or the profiling step small, /proc/profile
leaks data and readprofile shows silly stats, until readprofile -r
has reset the buffer: clear the prof_buffer when it is vmalloc()ed.
Signed-off-by: Hugh Dickins <hughd@...gle.com>
Cc: stable@...nel.org
---
kernel/profile.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- 2.6.34-rc7/kernel/profile.c 2009-12-02 19:51:21.000000000 -0800
+++ linux/kernel/profile.c 2010-05-13 14:57:37.000000000 -0700
@@ -127,8 +127,10 @@ int __ref profile_init(void)
return 0;
prof_buffer = vmalloc(buffer_bytes);
- if (prof_buffer)
+ if (prof_buffer) {
+ memset(prof_buffer, 0, buffer_bytes);
return 0;
+ }
free_cpumask_var(prof_cpu_mask);
return -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists