Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262712
b: refs/heads/master
c: b59a1bf
h: refs/heads/master
v: v3
  • Loading branch information
David Ahern authored and Benjamin Herrenschmidt committed Aug 5, 2011
1 parent 03cd5da commit b8b3be7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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: 501d238633a3f9869f4e777b3b281ca7660b7156
refs/heads/master: b59a1bfcc2406ea75346977ad016cfe909a762ac
20 changes: 17 additions & 3 deletions trunk/arch/powerpc/kernel/perf_callchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ static int read_user_stack_64(unsigned long __user *ptr, unsigned long *ret)
((unsigned long)ptr & 7))
return -EFAULT;

if (!__get_user_inatomic(*ret, ptr))
pagefault_disable();
if (!__get_user_inatomic(*ret, ptr)) {
pagefault_enable();
return 0;
}
pagefault_enable();

return read_user_stack_slow(ptr, ret, 8);
}
Expand All @@ -166,8 +170,12 @@ static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret)
((unsigned long)ptr & 3))
return -EFAULT;

if (!__get_user_inatomic(*ret, ptr))
pagefault_disable();
if (!__get_user_inatomic(*ret, ptr)) {
pagefault_enable();
return 0;
}
pagefault_enable();

return read_user_stack_slow(ptr, ret, 4);
}
Expand Down Expand Up @@ -294,11 +302,17 @@ static inline int current_is_64bit(void)
*/
static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret)
{
int rc;

if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned int) ||
((unsigned long)ptr & 3))
return -EFAULT;

return __get_user_inatomic(*ret, ptr);
pagefault_disable();
rc = __get_user_inatomic(*ret, ptr);
pagefault_enable();

return rc;
}

static inline void perf_callchain_user_64(struct perf_callchain_entry *entry,
Expand Down

0 comments on commit b8b3be7

Please sign in to comment.