diff options
Diffstat (limited to 'arch/arm26')
-rw-r--r-- | arch/arm26/kernel/ptrace.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/arch/arm26/kernel/ptrace.c b/arch/arm26/kernel/ptrace.c index cf7e977d18c8..4e6b7356a722 100644 --- a/arch/arm26/kernel/ptrace.c +++ b/arch/arm26/kernel/ptrace.c | |||
@@ -546,7 +546,7 @@ static int ptrace_setfpregs(struct task_struct *tsk, void *ufp) | |||
546 | sizeof(struct user_fp)) ? -EFAULT : 0; | 546 | sizeof(struct user_fp)) ? -EFAULT : 0; |
547 | } | 547 | } |
548 | 548 | ||
549 | static int do_ptrace(int request, struct task_struct *child, long addr, long data) | 549 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
550 | { | 550 | { |
551 | unsigned long tmp; | 551 | unsigned long tmp; |
552 | int ret; | 552 | int ret; |
@@ -665,53 +665,6 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat | |||
665 | return ret; | 665 | return ret; |
666 | } | 666 | } |
667 | 667 | ||
668 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | ||
669 | { | ||
670 | struct task_struct *child; | ||
671 | int ret; | ||
672 | |||
673 | lock_kernel(); | ||
674 | ret = -EPERM; | ||
675 | if (request == PTRACE_TRACEME) { | ||
676 | /* are we already being traced? */ | ||
677 | if (current->ptrace & PT_PTRACED) | ||
678 | goto out; | ||
679 | ret = security_ptrace(current->parent, current); | ||
680 | if (ret) | ||
681 | goto out; | ||
682 | /* set the ptrace bit in the process flags. */ | ||
683 | current->ptrace |= PT_PTRACED; | ||
684 | ret = 0; | ||
685 | goto out; | ||
686 | } | ||
687 | ret = -ESRCH; | ||
688 | read_lock(&tasklist_lock); | ||
689 | child = find_task_by_pid(pid); | ||
690 | if (child) | ||
691 | get_task_struct(child); | ||
692 | read_unlock(&tasklist_lock); | ||
693 | if (!child) | ||
694 | goto out; | ||
695 | |||
696 | ret = -EPERM; | ||
697 | if (pid == 1) /* you may not mess with init */ | ||
698 | goto out_tsk; | ||
699 | |||
700 | if (request == PTRACE_ATTACH) { | ||
701 | ret = ptrace_attach(child); | ||
702 | goto out_tsk; | ||
703 | } | ||
704 | ret = ptrace_check_attach(child, request == PTRACE_KILL); | ||
705 | if (ret == 0) | ||
706 | ret = do_ptrace(request, child, addr, data); | ||
707 | |||
708 | out_tsk: | ||
709 | put_task_struct(child); | ||
710 | out: | ||
711 | unlock_kernel(); | ||
712 | return ret; | ||
713 | } | ||
714 | |||
715 | asmlinkage void syscall_trace(int why, struct pt_regs *regs) | 668 | asmlinkage void syscall_trace(int why, struct pt_regs *regs) |
716 | { | 669 | { |
717 | unsigned long ip; | 670 | unsigned long ip; |