aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-01-20 14:25:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-01-20 15:26:05 -0500
commitedea0d03ee5f0ae0051b6adb6681ebdf976b1ca4 (patch)
tree5a2a5f44fcfc1d0246e48fd93d91c61fe157a987
parent5da1f88b8b727dc3a66c52d4513e871be6d43d19 (diff)
ia64: kill thread_matches(), unexport ptrace_check_attach()
The ia64 function "thread_matches()" has no users since commit e868a55c2a8c ("[IA64] remove find_thread_for_addr()"). Remove it. This allows us to make ptrace_check_attach() static to kernel/ptrace.c, which is good since we'll need to change the semantics of it and fix up all the callers. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/ia64/kernel/ptrace.c27
-rw-r--r--include/linux/ptrace.h1
-rw-r--r--kernel/ptrace.c2
3 files changed, 1 insertions, 29 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 4265ff64219b..b7a5fffe0924 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -672,33 +672,6 @@ ptrace_attach_sync_user_rbs (struct task_struct *child)
672 read_unlock(&tasklist_lock); 672 read_unlock(&tasklist_lock);
673} 673}
674 674
675static inline int
676thread_matches (struct task_struct *thread, unsigned long addr)
677{
678 unsigned long thread_rbs_end;
679 struct pt_regs *thread_regs;
680
681 if (ptrace_check_attach(thread, 0) < 0)
682 /*
683 * If the thread is not in an attachable state, we'll
684 * ignore it. The net effect is that if ADDR happens
685 * to overlap with the portion of the thread's
686 * register backing store that is currently residing
687 * on the thread's kernel stack, then ptrace() may end
688 * up accessing a stale value. But if the thread
689 * isn't stopped, that's a problem anyhow, so we're
690 * doing as well as we can...
691 */
692 return 0;
693
694 thread_regs = task_pt_regs(thread);
695 thread_rbs_end = ia64_get_user_rbs_end(thread, thread_regs, NULL);
696 if (!on_kernel_rbs(addr, thread_regs->ar_bspstore, thread_rbs_end))
697 return 0;
698
699 return 1; /* looks like we've got a winner */
700}
701
702/* 675/*
703 * Write f32-f127 back to task->thread.fph if it has been modified. 676 * Write f32-f127 back to task->thread.fph if it has been modified.
704 */ 677 */
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 1693775ecfe8..89573a33ab3c 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -45,7 +45,6 @@ extern long arch_ptrace(struct task_struct *child, long request,
45extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 45extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
46extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 46extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
47extern void ptrace_disable(struct task_struct *); 47extern void ptrace_disable(struct task_struct *);
48extern int ptrace_check_attach(struct task_struct *task, bool ignore_state);
49extern int ptrace_request(struct task_struct *child, long request, 48extern int ptrace_request(struct task_struct *child, long request,
50 unsigned long addr, unsigned long data); 49 unsigned long addr, unsigned long data);
51extern void ptrace_notify(int exit_code); 50extern void ptrace_notify(int exit_code);
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 1599157336a6..612a56126851 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -139,7 +139,7 @@ void __ptrace_unlink(struct task_struct *child)
139 * RETURNS: 139 * RETURNS:
140 * 0 on success, -ESRCH if %child is not ready. 140 * 0 on success, -ESRCH if %child is not ready.
141 */ 141 */
142int ptrace_check_attach(struct task_struct *child, bool ignore_state) 142static int ptrace_check_attach(struct task_struct *child, bool ignore_state)
143{ 143{
144 int ret = -ESRCH; 144 int ret = -ESRCH;
145 145