All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] ia64: ptrace_attach_sync_user_rbs: avoid "task->signal != NULL" checks
@ 2010-03-18 18:53 Oleg Nesterov
  2010-04-08  1:54 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2010-03-18 18:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Fenghua Yu, Roland McGrath, Stanislaw Gruszka, Tony Luck, linux-kernel

No functional changes.

It doesn't matter which pointer we check under tasklist to ensure
the task was not released, ->signal or ->sighand. But we are going
to make ->signal refcountable, change the code to use ->sighand.

Note: this code doesn't need this check and tasklist_lock at all,
it should be converted to use lock_task_sighand(). And, the code
under SIGNAL_STOP_STOPPED check looks wrong.

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

 arch/ia64/kernel/ptrace.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 34-rc1/arch/ia64/kernel/ptrace.c~6_IA64_DONT_CHECK_SIGNAL	2010-03-11 13:11:48.000000000 +0100
+++ 34-rc1/arch/ia64/kernel/ptrace.c	2010-03-18 19:12:45.000000000 +0100
@@ -639,7 +639,7 @@ ptrace_attach_sync_user_rbs (struct task
 	 */
 
 	read_lock(&tasklist_lock);
-	if (child->signal) {
+	if (child->sighand) {
 		spin_lock_irq(&child->sighand->siglock);
 		if (child->state == TASK_STOPPED &&
 		    !test_and_set_tsk_thread_flag(child, TIF_RESTORE_RSE)) {
@@ -663,7 +663,7 @@ ptrace_attach_sync_user_rbs (struct task
 	 * job control stop, so that SIGCONT can be used to wake it up.
 	 */
 	read_lock(&tasklist_lock);
-	if (child->signal) {
+	if (child->sighand) {
 		spin_lock_irq(&child->sighand->siglock);
 		if (child->state == TASK_TRACED &&
 		    (child->signal->flags & SIGNAL_STOP_STOPPED)) {


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

* Re: [PATCH 2/2] ia64: ptrace_attach_sync_user_rbs: avoid "task->signal != NULL" checks
  2010-03-18 18:53 [PATCH 2/2] ia64: ptrace_attach_sync_user_rbs: avoid "task->signal != NULL" checks Oleg Nesterov
@ 2010-04-08  1:54 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2010-04-08  1:54 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: Andrew Morton, Fenghua Yu, Stanislaw Gruszka, Tony Luck, linux-kernel

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

> Note: this code doesn't need this check and tasklist_lock at all,
> it should be converted to use lock_task_sighand(). And, the code
> under SIGNAL_STOP_STOPPED check looks wrong.

Agreed.  It should match that part of ptrace_untrace().


Thanks,
Roland

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

end of thread, other threads:[~2010-04-08  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-18 18:53 [PATCH 2/2] ia64: ptrace_attach_sync_user_rbs: avoid "task->signal != NULL" checks Oleg Nesterov
2010-04-08  1:54 ` 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.