diff options
Diffstat (limited to 'arch/powerpc/kernel/perf_callchain.c')
-rw-r--r-- | arch/powerpc/kernel/perf_callchain.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/perf_callchain.c b/arch/powerpc/kernel/perf_callchain.c index d05ae4204bbf..564c1d8bdb5c 100644 --- a/arch/powerpc/kernel/perf_callchain.c +++ b/arch/powerpc/kernel/perf_callchain.c | |||
@@ -154,8 +154,12 @@ static int read_user_stack_64(unsigned long __user *ptr, unsigned long *ret) | |||
154 | ((unsigned long)ptr & 7)) | 154 | ((unsigned long)ptr & 7)) |
155 | return -EFAULT; | 155 | return -EFAULT; |
156 | 156 | ||
157 | if (!__get_user_inatomic(*ret, ptr)) | 157 | pagefault_disable(); |
158 | if (!__get_user_inatomic(*ret, ptr)) { | ||
159 | pagefault_enable(); | ||
158 | return 0; | 160 | return 0; |
161 | } | ||
162 | pagefault_enable(); | ||
159 | 163 | ||
160 | return read_user_stack_slow(ptr, ret, 8); | 164 | return read_user_stack_slow(ptr, ret, 8); |
161 | } | 165 | } |
@@ -166,8 +170,12 @@ static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) | |||
166 | ((unsigned long)ptr & 3)) | 170 | ((unsigned long)ptr & 3)) |
167 | return -EFAULT; | 171 | return -EFAULT; |
168 | 172 | ||
169 | if (!__get_user_inatomic(*ret, ptr)) | 173 | pagefault_disable(); |
174 | if (!__get_user_inatomic(*ret, ptr)) { | ||
175 | pagefault_enable(); | ||
170 | return 0; | 176 | return 0; |
177 | } | ||
178 | pagefault_enable(); | ||
171 | 179 | ||
172 | return read_user_stack_slow(ptr, ret, 4); | 180 | return read_user_stack_slow(ptr, ret, 4); |
173 | } | 181 | } |
@@ -294,11 +302,17 @@ static inline int current_is_64bit(void) | |||
294 | */ | 302 | */ |
295 | static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) | 303 | static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) |
296 | { | 304 | { |
305 | int rc; | ||
306 | |||
297 | if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned int) || | 307 | if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned int) || |
298 | ((unsigned long)ptr & 3)) | 308 | ((unsigned long)ptr & 3)) |
299 | return -EFAULT; | 309 | return -EFAULT; |
300 | 310 | ||
301 | return __get_user_inatomic(*ret, ptr); | 311 | pagefault_disable(); |
312 | rc = __get_user_inatomic(*ret, ptr); | ||
313 | pagefault_enable(); | ||
314 | |||
315 | return rc; | ||
302 | } | 316 | } |
303 | 317 | ||
304 | static inline void perf_callchain_user_64(struct perf_callchain_entry *entry, | 318 | static inline void perf_callchain_user_64(struct perf_callchain_entry *entry, |