Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@google.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
16a2164b bfcc6e2e

+3 -1
+3 -1
kernel/profile.c
··· 127 127 return 0; 128 128 129 129 prof_buffer = vmalloc(buffer_bytes); 130 - if (prof_buffer) 130 + if (prof_buffer) { 131 + memset(prof_buffer, 0, buffer_bytes); 131 132 return 0; 133 + } 132 134 133 135 free_cpumask_var(prof_cpu_mask); 134 136 return -ENOMEM;