diff options
author | David Mosberger-Tang <davidm@hpl.hp.com> | 2005-05-10 14:35:00 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-05-17 15:33:15 -0400 |
commit | 02a017a9f37ae6842e065da919b5952eb847e869 (patch) | |
tree | 570c84abb8d8a23747a4ed51af3d9f574df0b93b /arch/ia64/kernel/ptrace.c | |
parent | d0dac8082cbc2b234917ec53eb591b1ddbec80bb (diff) |
[IA64] Correct convert_to_non_syscall()
convert_to_non_syscall() has the same problem that unwind_to_user()
used to have. Fix it likewise.
Signed-off-by: David Mosberger-Tang <davidm@hpl.hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/ptrace.c')
-rw-r--r-- | arch/ia64/kernel/ptrace.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index 907464ee7273..08c8a5eb25ab 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c | |||
@@ -692,16 +692,30 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, | |||
692 | unsigned long cfm) | 692 | unsigned long cfm) |
693 | { | 693 | { |
694 | struct unw_frame_info info, prev_info; | 694 | struct unw_frame_info info, prev_info; |
695 | unsigned long ip, pr; | 695 | unsigned long ip, sp, pr; |
696 | 696 | ||
697 | unw_init_from_blocked_task(&info, child); | 697 | unw_init_from_blocked_task(&info, child); |
698 | while (1) { | 698 | while (1) { |
699 | prev_info = info; | 699 | prev_info = info; |
700 | if (unw_unwind(&info) < 0) | 700 | if (unw_unwind(&info) < 0) |
701 | return; | 701 | return; |
702 | if (unw_get_rp(&info, &ip) < 0) | 702 | |
703 | unw_get_sp(&info, &sp); | ||
704 | if ((long)((unsigned long)child + IA64_STK_OFFSET - sp) | ||
705 | < IA64_PT_REGS_SIZE) { | ||
706 | dprintk("ptrace.%s: ran off the top of the kernel " | ||
707 | "stack\n", __FUNCTION__); | ||
708 | return; | ||
709 | } | ||
710 | if (unw_get_pr (&prev_info, &pr) < 0) { | ||
711 | unw_get_rp(&prev_info, &ip); | ||
712 | dprintk("ptrace.%s: failed to read " | ||
713 | "predicate register (ip=0x%lx)\n", | ||
714 | __FUNCTION__, ip); | ||
703 | return; | 715 | return; |
704 | if (ip < FIXADDR_USER_END) | 716 | } |
717 | if (unw_is_intr_frame(&info) | ||
718 | && (pr & (1UL << PRED_USER_STACK))) | ||
705 | break; | 719 | break; |
706 | } | 720 | } |
707 | 721 | ||