diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-09-23 01:37:41 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-09-26 15:25:33 +1000 |
commit | 62034f03380a64c0144b6721f4a2aa55d65346c1 (patch) | |
tree | 9f2827b5c69a538e19e5baa41ccc63b46dae40ac | |
parent | ed2bfcd2deeb0970654d06231f254c5d33140062 (diff) |
[POWERPC] powerpc oprofile __user annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/oprofile/backtrace.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/powerpc/oprofile/backtrace.c b/arch/powerpc/oprofile/backtrace.c index 75f57bc96b4..b4278cfd1f8 100644 --- a/arch/powerpc/oprofile/backtrace.c +++ b/arch/powerpc/oprofile/backtrace.c @@ -11,6 +11,7 @@ #include <linux/sched.h> #include <asm/processor.h> #include <asm/uaccess.h> +#include <asm/compat.h> #define STACK_SP(STACK) *(STACK) @@ -26,8 +27,9 @@ static unsigned int user_getsp32(unsigned int sp, int is_first) { unsigned int stack_frame[2]; + void __user *p = compat_ptr(sp); - if (!access_ok(VERIFY_READ, sp, sizeof(stack_frame))) + if (!access_ok(VERIFY_READ, p, sizeof(stack_frame))) return 0; /* @@ -35,8 +37,7 @@ static unsigned int user_getsp32(unsigned int sp, int is_first) * which means that we've done all that we can do from * interrupt context. */ - if (__copy_from_user_inatomic(stack_frame, (void *)(long)sp, - sizeof(stack_frame))) + if (__copy_from_user_inatomic(stack_frame, p, sizeof(stack_frame))) return 0; if (!is_first) @@ -54,10 +55,10 @@ static unsigned long user_getsp64(unsigned long sp, int is_first) { unsigned long stack_frame[3]; - if (!access_ok(VERIFY_READ, sp, sizeof(stack_frame))) + if (!access_ok(VERIFY_READ, (void __user *)sp, sizeof(stack_frame))) return 0; - if (__copy_from_user_inatomic(stack_frame, (void *)sp, + if (__copy_from_user_inatomic(stack_frame, (void __user *)sp, sizeof(stack_frame))) return 0; |