linux-stable/drivers/oprofile
Robert Richter c9b5dd12ec oprofile: Fix uninitialized memory access when writing to writing to oprofilefs
commit 913050b91e upstream.

If oprofilefs_ulong_from_user() is called with count equals
zero, *val remains unchanged. Depending on the implementation it
might be uninitialized.

Change oprofilefs_ulong_from_user()'s interface to return count
on success. Thus, we are able to return early if count equals
zero which avoids using *val uninitialized. Fixing all users of
oprofilefs_ulong_ from_user().

This follows write syscall implementation when count is zero:
"If count is zero ... [and if] no errors are detected, 0 will be
returned without causing any other effect." (man 2 write)

Reported-By: Mike Waychison <mikew@google.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: oprofile-list <oprofile-list@lists.sourceforge.net>
Link: http://lkml.kernel.org/r/20111219153830.GH16765@erda.amd.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-06 14:17:04 -08:00
..
buffer_sync.c oprofile: Fix locking dependency in sync_start() 2011-05-31 16:33:34 +02:00
buffer_sync.h cpumask: modifiy oprofile initialization 2009-01-22 14:37:06 +01:00
cpu_buffer.c oprofile: Introduce new oprofile sample add function (oprofile_add_ext_hw_sample) 2011-02-15 11:07:07 +01:00
cpu_buffer.h oprofile: Remove deprecated use of flush_scheduled_work() 2010-10-29 11:54:18 +02:00
event_buffer.c oprofile: make event buffer nonseekable 2010-07-26 10:58:24 +02:00
event_buffer.h oprofile: Use linux/mutex.h 2011-05-24 12:45:59 +02:00
oprof.c oprofile: Fix crash when unloading module (hr timer mode) 2011-12-09 08:55:55 -08:00
oprof.h oprofile, s390: Rework hwsampler implementation 2011-02-15 11:10:20 +01:00
oprofile_files.c oprofile: Fix uninitialized memory access when writing to writing to oprofilefs 2012-01-06 14:17:04 -08:00
oprofile_perf.c perf: Remove the nmi parameter from the oprofile_perf backend 2011-07-21 20:41:58 +02:00
oprofile_stats.c percpu: make percpu symbols in oprofile unique 2009-10-29 22:34:13 +09:00
oprofile_stats.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
oprofilefs.c oprofile: Fix uninitialized memory access when writing to writing to oprofilefs 2012-01-06 14:17:04 -08:00
timer_int.c oprofile: Fix crash when unloading module (hr timer mode) 2011-12-09 08:55:55 -08:00