|
@@ -1103,21 +1103,6 @@ int ptrace_request(struct task_struct *child, long request,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-static struct task_struct *ptrace_get_task_struct(pid_t pid)
|
|
|
-{
|
|
|
- struct task_struct *child;
|
|
|
-
|
|
|
- rcu_read_lock();
|
|
|
- child = find_task_by_vpid(pid);
|
|
|
- if (child)
|
|
|
- get_task_struct(child);
|
|
|
- rcu_read_unlock();
|
|
|
-
|
|
|
- if (!child)
|
|
|
- return ERR_PTR(-ESRCH);
|
|
|
- return child;
|
|
|
-}
|
|
|
-
|
|
|
#ifndef arch_ptrace_attach
|
|
|
#define arch_ptrace_attach(child) do { } while (0)
|
|
|
#endif
|
|
@@ -1135,9 +1120,9 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
- child = ptrace_get_task_struct(pid);
|
|
|
- if (IS_ERR(child)) {
|
|
|
- ret = PTR_ERR(child);
|
|
|
+ child = find_get_task_by_vpid(pid);
|
|
|
+ if (!child) {
|
|
|
+ ret = -ESRCH;
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
@@ -1281,9 +1266,9 @@ COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
- child = ptrace_get_task_struct(pid);
|
|
|
- if (IS_ERR(child)) {
|
|
|
- ret = PTR_ERR(child);
|
|
|
+ child = find_get_task_by_vpid(pid);
|
|
|
+ if (!child) {
|
|
|
+ ret = -ESRCH;
|
|
|
goto out;
|
|
|
}
|
|
|
|