diff options
Diffstat (limited to 'arch/arm/kernel/ptrace.c')
-rw-r--r-- | arch/arm/kernel/ptrace.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 9254ba2f46fc..13af4006a40f 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -457,13 +457,10 @@ void ptrace_cancel_bpt(struct task_struct *child) | |||
457 | 457 | ||
458 | /* | 458 | /* |
459 | * Called by kernel/ptrace.c when detaching.. | 459 | * Called by kernel/ptrace.c when detaching.. |
460 | * | ||
461 | * Make sure the single step bit is not set. | ||
462 | */ | 460 | */ |
463 | void ptrace_disable(struct task_struct *child) | 461 | void ptrace_disable(struct task_struct *child) |
464 | { | 462 | { |
465 | child->ptrace &= ~PT_SINGLESTEP; | 463 | single_step_disable(child); |
466 | ptrace_cancel_bpt(child); | ||
467 | } | 464 | } |
468 | 465 | ||
469 | /* | 466 | /* |
@@ -712,9 +709,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
712 | else | 709 | else |
713 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 710 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
714 | child->exit_code = data; | 711 | child->exit_code = data; |
715 | /* make sure single-step breakpoint is gone. */ | 712 | single_step_disable(child); |
716 | child->ptrace &= ~PT_SINGLESTEP; | ||
717 | ptrace_cancel_bpt(child); | ||
718 | wake_up_process(child); | 713 | wake_up_process(child); |
719 | ret = 0; | 714 | ret = 0; |
720 | break; | 715 | break; |
@@ -725,9 +720,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
725 | * exit. | 720 | * exit. |
726 | */ | 721 | */ |
727 | case PTRACE_KILL: | 722 | case PTRACE_KILL: |
728 | /* make sure single-step breakpoint is gone. */ | 723 | single_step_disable(child); |
729 | child->ptrace &= ~PT_SINGLESTEP; | ||
730 | ptrace_cancel_bpt(child); | ||
731 | if (child->exit_state != EXIT_ZOMBIE) { | 724 | if (child->exit_state != EXIT_ZOMBIE) { |
732 | child->exit_code = SIGKILL; | 725 | child->exit_code = SIGKILL; |
733 | wake_up_process(child); | 726 | wake_up_process(child); |
@@ -742,7 +735,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
742 | ret = -EIO; | 735 | ret = -EIO; |
743 | if (!valid_signal(data)) | 736 | if (!valid_signal(data)) |
744 | break; | 737 | break; |
745 | child->ptrace |= PT_SINGLESTEP; | 738 | single_step_enable(child); |
746 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 739 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
747 | child->exit_code = data; | 740 | child->exit_code = data; |
748 | /* give it a chance to run. */ | 741 | /* give it a chance to run. */ |
@@ -786,8 +779,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
786 | break; | 779 | break; |
787 | 780 | ||
788 | case PTRACE_SET_SYSCALL: | 781 | case PTRACE_SET_SYSCALL: |
782 | task_thread_info(child)->syscall = data; | ||
789 | ret = 0; | 783 | ret = 0; |
790 | child->ptrace_message = data; | ||
791 | break; | 784 | break; |
792 | 785 | ||
793 | #ifdef CONFIG_CRUNCH | 786 | #ifdef CONFIG_CRUNCH |
@@ -824,7 +817,7 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) | |||
824 | ip = regs->ARM_ip; | 817 | ip = regs->ARM_ip; |
825 | regs->ARM_ip = why; | 818 | regs->ARM_ip = why; |
826 | 819 | ||
827 | current->ptrace_message = scno; | 820 | current_thread_info()->syscall = scno; |
828 | 821 | ||
829 | /* the 0x80 provides a way for the tracing parent to distinguish | 822 | /* the 0x80 provides a way for the tracing parent to distinguish |
830 | between a syscall stop and SIGTRAP delivery */ | 823 | between a syscall stop and SIGTRAP delivery */ |
@@ -841,5 +834,5 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) | |||
841 | } | 834 | } |
842 | regs->ARM_ip = ip; | 835 | regs->ARM_ip = ip; |
843 | 836 | ||
844 | return current->ptrace_message; | 837 | return current_thread_info()->syscall; |
845 | } | 838 | } |