2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 12:14:01 +08:00
linux-next/arch/s390/oprofile
Robert Richter 913050b91e oprofile: Fix uninitialized memory access when writing to writing to oprofilefs
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: <stable@vger.kernel.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>
2011-12-19 17:18:43 +01:00
..
backtrace.c [PATCH] s390: add oprofile callgraph support 2006-01-06 08:33:50 -08:00
hwsampler.c [S390] sparse: fix sparse ANSI-C warnings 2011-10-30 15:16:46 +01:00
hwsampler.h [S390] oprofile: fix min/max interval query checks 2011-05-10 17:13:43 +02:00
init.c oprofile: Fix uninitialized memory access when writing to writing to oprofilefs 2011-12-19 17:18:43 +01:00
Makefile [S390] oprofile: disable hw sampling for CONFIG_32BIT 2011-03-23 10:15:14 +01:00