aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/compat.h
diff options
context:
space:
mode:
authorH. Peter Anvin <[email protected]>2010-09-07 16:16:18 -0700
committerH. Peter Anvin <[email protected]>2010-09-14 16:08:45 -0700
commitc41d68a513c71e35a14f66d71782d27a79a81ea6 (patch)
tree2729377678b4f0fa516404eec6c3a87a4fd7c823 /arch/powerpc/include/asm/compat.h
parentbfa88ea7ee9e6b4fd673e45a8cc0a8e0b7ef4761 (diff)
compat: Make compat_alloc_user_space() incorporate the access_ok()
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 <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Chris Metcalf <[email protected]> Acked-by: David S. Miller <[email protected]> Acked-by: Ingo Molnar <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Tony Luck <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Helge Deller <[email protected]> Cc: James Bottomley <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: <[email protected]>
Diffstat (limited to 'arch/powerpc/include/asm/compat.h')
-rw-r--r--arch/powerpc/include/asm/compat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index 396d21a80058..a11d4eac4f97 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -134,7 +134,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
-static inline void __user *compat_alloc_user_space(long len)
+static inline void __user *arch_compat_alloc_user_space(long len)
{
struct pt_regs *regs = current->thread.regs;
unsigned long usp = regs->gpr[1];