diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-09 14:18:33 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-09 14:18:33 -0500 |
commit | 0a3a98f6dd4e8f4d928a09302c0d1c56f2192ac3 (patch) | |
tree | 92f55e374a84d06ce8213a4540454760fdecf137 /arch/sparc64/kernel/ptrace.c | |
parent | 8ef12c9f01afba47c2d33bb939085111ca0d0f7d (diff) | |
parent | 5367f2d67c7d0bf1faae90e6e7b4e2ac3c9b5e0f (diff) |
Merge Linus' tree.
Diffstat (limited to 'arch/sparc64/kernel/ptrace.c')
-rw-r--r-- | arch/sparc64/kernel/ptrace.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c index 774ecbb8a031..84d3df2264cb 100644 --- a/arch/sparc64/kernel/ptrace.c +++ b/arch/sparc64/kernel/ptrace.c | |||
@@ -198,39 +198,15 @@ asmlinkage void do_ptrace(struct pt_regs *regs) | |||
198 | } | 198 | } |
199 | #endif | 199 | #endif |
200 | if (request == PTRACE_TRACEME) { | 200 | if (request == PTRACE_TRACEME) { |
201 | int ret; | 201 | ret = ptrace_traceme(); |
202 | |||
203 | /* are we already being traced? */ | ||
204 | if (current->ptrace & PT_PTRACED) { | ||
205 | pt_error_return(regs, EPERM); | ||
206 | goto out; | ||
207 | } | ||
208 | ret = security_ptrace(current->parent, current); | ||
209 | if (ret) { | ||
210 | pt_error_return(regs, -ret); | ||
211 | goto out; | ||
212 | } | ||
213 | |||
214 | /* set the ptrace bit in the process flags. */ | ||
215 | current->ptrace |= PT_PTRACED; | ||
216 | pt_succ_return(regs, 0); | 202 | pt_succ_return(regs, 0); |
217 | goto out; | 203 | goto out; |
218 | } | 204 | } |
219 | #ifndef ALLOW_INIT_TRACING | ||
220 | if (pid == 1) { | ||
221 | /* Can't dork with init. */ | ||
222 | pt_error_return(regs, EPERM); | ||
223 | goto out; | ||
224 | } | ||
225 | #endif | ||
226 | read_lock(&tasklist_lock); | ||
227 | child = find_task_by_pid(pid); | ||
228 | if (child) | ||
229 | get_task_struct(child); | ||
230 | read_unlock(&tasklist_lock); | ||
231 | 205 | ||
232 | if (!child) { | 206 | child = ptrace_get_task_struct(pid); |
233 | pt_error_return(regs, ESRCH); | 207 | if (IS_ERR(child)) { |
208 | ret = PTR_ERR(child); | ||
209 | pt_error_return(regs, -ret); | ||
234 | goto out; | 210 | goto out; |
235 | } | 211 | } |
236 | 212 | ||