Commit 7ff4b9cc authored by Hugh Dickins's avatar Hugh Dickins Committed by Greg Kroah-Hartman

profile: fix stats and data leakage

commit 16a2164b upstream.

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: default avatarHugh Dickins <hughd@google.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d8ca15af
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment