diff options
Diffstat (limited to 'arch/parisc/kernel/unwind.c')
-rw-r--r-- | arch/parisc/kernel/unwind.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 48dc7d4d20bb..caab39dfa95d 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/kallsyms.h> | 15 | #include <linux/kallsyms.h> |
16 | #include <linux/sort.h> | 16 | #include <linux/sort.h> |
17 | #include <linux/sched.h> | ||
17 | 18 | ||
18 | #include <linux/uaccess.h> | 19 | #include <linux/uaccess.h> |
19 | #include <asm/assembly.h> | 20 | #include <asm/assembly.h> |
@@ -279,6 +280,17 @@ static void unwind_frame_regs(struct unwind_frame_info *info) | |||
279 | 280 | ||
280 | info->prev_sp = sp - 64; | 281 | info->prev_sp = sp - 64; |
281 | info->prev_ip = 0; | 282 | info->prev_ip = 0; |
283 | |||
284 | /* The stack is at the end inside the thread_union | ||
285 | * struct. If we reach data, we have reached the | ||
286 | * beginning of the stack and should stop unwinding. */ | ||
287 | if (info->prev_sp >= (unsigned long) task_thread_info(info->t) && | ||
288 | info->prev_sp < ((unsigned long) task_thread_info(info->t) | ||
289 | + THREAD_SZ_ALGN)) { | ||
290 | info->prev_sp = 0; | ||
291 | break; | ||
292 | } | ||
293 | |||
282 | if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET))) | 294 | if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET))) |
283 | break; | 295 | break; |
284 | info->prev_ip = tmp; | 296 | info->prev_ip = tmp; |