diff options
-rw-r--r-- | include/linux/ptrace.h | 1 | ||||
-rw-r--r-- | kernel/ptrace.c | 16 |
2 files changed, 3 insertions, 14 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 59e133d39d50..7456d7d87a19 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -81,7 +81,6 @@ | |||
81 | 81 | ||
82 | 82 | ||
83 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); | 83 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); |
84 | extern struct task_struct *ptrace_get_task_struct(pid_t pid); | ||
85 | extern int ptrace_traceme(void); | 84 | extern int ptrace_traceme(void); |
86 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); | 85 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); |
87 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 86 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 38fdfea1a15a..a64fe75a48ba 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -581,26 +581,16 @@ int ptrace_request(struct task_struct *child, long request, | |||
581 | return ret; | 581 | return ret; |
582 | } | 582 | } |
583 | 583 | ||
584 | /** | 584 | static struct task_struct *ptrace_get_task_struct(pid_t pid) |
585 | * ptrace_get_task_struct -- grab a task struct reference for ptrace | ||
586 | * @pid: process id to grab a task_struct reference of | ||
587 | * | ||
588 | * This function is a helper for ptrace implementations. It checks | ||
589 | * permissions and then grabs a task struct for use of the actual | ||
590 | * ptrace implementation. | ||
591 | * | ||
592 | * Returns the task_struct for @pid or an ERR_PTR() on failure. | ||
593 | */ | ||
594 | struct task_struct *ptrace_get_task_struct(pid_t pid) | ||
595 | { | 585 | { |
596 | struct task_struct *child; | 586 | struct task_struct *child; |
597 | 587 | ||
598 | read_lock(&tasklist_lock); | 588 | rcu_read_lock(); |
599 | child = find_task_by_vpid(pid); | 589 | child = find_task_by_vpid(pid); |
600 | if (child) | 590 | if (child) |
601 | get_task_struct(child); | 591 | get_task_struct(child); |
592 | rcu_read_unlock(); | ||
602 | 593 | ||
603 | read_unlock(&tasklist_lock); | ||
604 | if (!child) | 594 | if (!child) |
605 | return ERR_PTR(-ESRCH); | 595 | return ERR_PTR(-ESRCH); |
606 | return child; | 596 | return child; |