linux-uconsole/arch/powerpc
H. Peter Anvin 337b16213b compat: Make compat_alloc_user_space() incorporate the access_ok()
commit c41d68a513 upstream.

compat_alloc_user_space() expects the caller to independently call
access_ok() to verify the returned area.  A missing call could
introduce problems on some architectures.

This patch incorporates the access_ok() check into
compat_alloc_user_space() and also adds a sanity check on the length.
The existing compat_alloc_user_space() implementations are renamed
arch_compat_alloc_user_space() and are used as part of the
implementation of the new global function.

This patch assumes NULL will cause __get_user()/__put_user() to either
fail or access userspace on all architectures.  This should be
followed by checking the return value of compat_access_user_space()
for NULL in the callers, at which time the access_ok() in the callers
can also be removed.

Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <jejb@parisc-linux.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 13:17:57 -07:00
..
boot Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc 2009-11-17 09:14:49 -08:00
configs powerpc: pasemi_defconfig update 2009-11-11 15:44:02 +11:00
include/asm compat: Make compat_alloc_user_space() incorporate the access_ok() 2010-09-20 13:17:57 -07:00
kernel timekeeping: Fix clock_gettime vsyscall time warp 2010-08-13 13:20:13 -07:00
kvm KVM: PPC: Do not create debugfs if fail to create vcpu 2010-07-05 11:11:17 -07:00
lib powerpc: Fix handling of strncmp with zero len 2010-07-05 11:10:44 -07:00
math-emu powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00
mm kgdb: don't needlessly skip PAGE_USER test for Fsl booke 2010-05-12 14:57:12 -07:00
oprofile powerpc/oprofile: fix potential buffer overrun in op_model_cell.c 2010-07-05 11:10:44 -07:00
platforms powerpc/eeh: Fix a bug when pci structure is null 2010-08-13 13:20:17 -07:00
sysdev powerpc/fsl: Add PCI device ids for new QoirQ chips 2010-01-28 15:00:40 -08:00
xmon powerpc/booke: Fix xmon single step on PowerPC Book-E 2009-10-27 16:42:40 +11:00
Kconfig powerpc: Cleanup Kconfig selection of hugetlbfs support 2009-10-30 15:03:54 +11:00
Kconfig.debug powerpc: Add configurable -Werror for arch/powerpc 2009-06-16 14:15:45 +10:00
Makefile powerpc: Fix typo in uImage target 2010-08-26 16:41:56 -07:00
relocs_check.pl powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00