diff options
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/ptrace32.c | 26 | ||||
-rw-r--r-- | arch/mips/sgi-ip27/ip27-berr.c | 1 |
2 files changed, 7 insertions, 20 deletions
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index 9a9b049721..7e55457a49 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c | |||
@@ -57,30 +57,16 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) | |||
57 | (unsigned long) data); | 57 | (unsigned long) data); |
58 | #endif | 58 | #endif |
59 | lock_kernel(); | 59 | lock_kernel(); |
60 | ret = -EPERM; | ||
61 | if (request == PTRACE_TRACEME) { | 60 | if (request == PTRACE_TRACEME) { |
62 | /* are we already being traced? */ | 61 | ret = ptrace_traceme(); |
63 | if (current->ptrace & PT_PTRACED) | ||
64 | goto out; | ||
65 | if ((ret = security_ptrace(current->parent, current))) | ||
66 | goto out; | ||
67 | /* set the ptrace bit in the process flags. */ | ||
68 | current->ptrace |= PT_PTRACED; | ||
69 | ret = 0; | ||
70 | goto out; | 62 | goto out; |
71 | } | 63 | } |
72 | ret = -ESRCH; | ||
73 | read_lock(&tasklist_lock); | ||
74 | child = find_task_by_pid(pid); | ||
75 | if (child) | ||
76 | get_task_struct(child); | ||
77 | read_unlock(&tasklist_lock); | ||
78 | if (!child) | ||
79 | goto out; | ||
80 | 64 | ||
81 | ret = -EPERM; | 65 | child = ptrace_get_task_struct(pid); |
82 | if (pid == 1) /* you may not mess with init */ | 66 | if (IS_ERR(child)) { |
83 | goto out_tsk; | 67 | ret = PTR_ERR(child); |
68 | goto out; | ||
69 | } | ||
84 | 70 | ||
85 | if (request == PTRACE_ATTACH) { | 71 | if (request == PTRACE_ATTACH) { |
86 | ret = ptrace_attach(child); | 72 | ret = ptrace_attach(child); |
diff --git a/arch/mips/sgi-ip27/ip27-berr.c b/arch/mips/sgi-ip27/ip27-berr.c index 07631a9767..ce907eda22 100644 --- a/arch/mips/sgi-ip27/ip27-berr.c +++ b/arch/mips/sgi-ip27/ip27-berr.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/signal.h> /* for SIGBUS */ | 13 | #include <linux/signal.h> /* for SIGBUS */ |
14 | #include <linux/sched.h> /* schow_regs(), force_sig() */ | ||
14 | 15 | ||
15 | #include <asm/module.h> | 16 | #include <asm/module.h> |
16 | #include <asm/sn/addrs.h> | 17 | #include <asm/sn/addrs.h> |