diff options
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/ptrace.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 9bd8609a2926..9a340e790da5 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -648,7 +648,7 @@ static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp) | |||
648 | 648 | ||
649 | #endif | 649 | #endif |
650 | 650 | ||
651 | static int do_ptrace(int request, struct task_struct *child, long addr, long data) | 651 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
652 | { | 652 | { |
653 | unsigned long tmp; | 653 | unsigned long tmp; |
654 | int ret; | 654 | int ret; |
@@ -782,53 +782,6 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat | |||
782 | return ret; | 782 | return ret; |
783 | } | 783 | } |
784 | 784 | ||
785 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | ||
786 | { | ||
787 | struct task_struct *child; | ||
788 | int ret; | ||
789 | |||
790 | lock_kernel(); | ||
791 | ret = -EPERM; | ||
792 | if (request == PTRACE_TRACEME) { | ||
793 | /* are we already being traced? */ | ||
794 | if (current->ptrace & PT_PTRACED) | ||
795 | goto out; | ||
796 | ret = security_ptrace(current->parent, current); | ||
797 | if (ret) | ||
798 | goto out; | ||
799 | /* set the ptrace bit in the process flags. */ | ||
800 | current->ptrace |= PT_PTRACED; | ||
801 | ret = 0; | ||
802 | goto out; | ||
803 | } | ||
804 | ret = -ESRCH; | ||
805 | read_lock(&tasklist_lock); | ||
806 | child = find_task_by_pid(pid); | ||
807 | if (child) | ||
808 | get_task_struct(child); | ||
809 | read_unlock(&tasklist_lock); | ||
810 | if (!child) | ||
811 | goto out; | ||
812 | |||
813 | ret = -EPERM; | ||
814 | if (pid == 1) /* you may not mess with init */ | ||
815 | goto out_tsk; | ||
816 | |||
817 | if (request == PTRACE_ATTACH) { | ||
818 | ret = ptrace_attach(child); | ||
819 | goto out_tsk; | ||
820 | } | ||
821 | ret = ptrace_check_attach(child, request == PTRACE_KILL); | ||
822 | if (ret == 0) | ||
823 | ret = do_ptrace(request, child, addr, data); | ||
824 | |||
825 | out_tsk: | ||
826 | put_task_struct(child); | ||
827 | out: | ||
828 | unlock_kernel(); | ||
829 | return ret; | ||
830 | } | ||
831 | |||
832 | asmlinkage void syscall_trace(int why, struct pt_regs *regs) | 785 | asmlinkage void syscall_trace(int why, struct pt_regs *regs) |
833 | { | 786 | { |
834 | unsigned long ip; | 787 | unsigned long ip; |