All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ia64: ptrace: kill thread_matches()
@ 2010-02-23 18:16 Oleg Nesterov
  2010-02-23 20:23 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2010-02-23 18:16 UTC (permalink / raw)
  To: Fenghua Yu, Tony Luck; +Cc: Roland McGrath, linux-kernel

Trivial. thread_matches() has no callers since
e868a55c2a8cb72b66d7137fbcc54b82016e98eb, remove it.

Ironically, this helper is the only user of ptrace_check_attach()
outside of kernel/ptrace.c, and it was always wrong because it must
not use "might_sleep" ptrace_check_attach() under tasklist.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>

--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -674,33 +674,6 @@ ptrace_attach_sync_user_rbs (struct task
 	read_unlock(&tasklist_lock);
 }
 
-static inline int
-thread_matches (struct task_struct *thread, unsigned long addr)
-{
-	unsigned long thread_rbs_end;
-	struct pt_regs *thread_regs;
-
-	if (ptrace_check_attach(thread, 0) < 0)
-		/*
-		 * If the thread is not in an attachable state, we'll
-		 * ignore it.  The net effect is that if ADDR happens
-		 * to overlap with the portion of the thread's
-		 * register backing store that is currently residing
-		 * on the thread's kernel stack, then ptrace() may end
-		 * up accessing a stale value.  But if the thread
-		 * isn't stopped, that's a problem anyhow, so we're
-		 * doing as well as we can...
-		 */
-		return 0;
-
-	thread_regs = task_pt_regs(thread);
-	thread_rbs_end = ia64_get_user_rbs_end(thread, thread_regs, NULL);
-	if (!on_kernel_rbs(addr, thread_regs->ar_bspstore, thread_rbs_end))
-		return 0;
-
-	return 1;	/* looks like we've got a winner */
-}
-
 /*
  * Write f32-f127 back to task->thread.fph if it has been modified.
  */


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ia64: ptrace: kill thread_matches()
  2010-02-23 18:16 [PATCH] ia64: ptrace: kill thread_matches() Oleg Nesterov
@ 2010-02-23 20:23 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2010-02-23 20:23 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Fenghua Yu, Tony Luck, linux-kernel

Acked-by: Roland McGrath <roland@redhat.com>

ia64 folks, please excise the cruft so that it does not hold us back
in making later arch-neutral ptrace changes.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-23 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23 18:16 [PATCH] ia64: ptrace: kill thread_matches() Oleg Nesterov
2010-02-23 20:23 ` Roland McGrath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.