Skip to content

Commit edea0d0

Browse files
oleg-nesterovtorvalds
authored andcommitted
ia64: kill thread_matches(), unexport ptrace_check_attach()
The ia64 function "thread_matches()" has no users since commit e868a55 ("[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>
1 parent 5da1f88 commit edea0d0

3 files changed

Lines changed: 1 addition & 29 deletions

File tree

‎arch/ia64/kernel/ptrace.c‎

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -672,33 +672,6 @@ ptrace_attach_sync_user_rbs (struct task_struct *child)
672672
read_unlock(&tasklist_lock);
673673
}
674674

675-
static inline int
676-
thread_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-
702675
/*
703676
* Write f32-f127 back to task->thread.fph if it has been modified.
704677
*/

‎include/linux/ptrace.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ extern long arch_ptrace(struct task_struct *child, long request,
4545
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
4646
extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
4747
extern void ptrace_disable(struct task_struct *);
48-
extern int ptrace_check_attach(struct task_struct *task, bool ignore_state);
4948
extern int ptrace_request(struct task_struct *child, long request,
5049
unsigned long addr, unsigned long data);
5150
extern void ptrace_notify(int exit_code);

‎kernel/ptrace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void __ptrace_unlink(struct task_struct *child)
139139
* RETURNS:
140140
* 0 on success, -ESRCH if %child is not ready.
141141
*/
142-
int ptrace_check_attach(struct task_struct *child, bool ignore_state)
142+
static int ptrace_check_attach(struct task_struct *child, bool ignore_state)
143143
{
144144
int ret = -ESRCH;
145145

0 commit comments

Comments
 (0)