Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38165
b: refs/heads/master
c: 62034f0
h: refs/heads/master
i:
  38163: 0d5b547
v: v3
  • Loading branch information
Al Viro authored and Paul Mackerras committed Sep 26, 2006
1 parent a96e5b1 commit 0875f8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed2bfcd2deeb0970654d06231f254c5d33140062
refs/heads/master: 62034f03380a64c0144b6721f4a2aa55d65346c1
11 changes: 6 additions & 5 deletions trunk/arch/powerpc/oprofile/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -26,17 +27,17 @@
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;

/*
* The most likely reason for this is that we returned -EFAULT,
* 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)
Expand All @@ -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;

Expand Down

0 comments on commit 0875f8b

Please sign in to comment.