[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 1/2] utrace_wakeup: lock ->siglock directly



The comment above utrace_wakeup:

	* Called with @utrace->lock held and @utrace->stopped set.

Yes. This means the task can't go away, it should at least take
utrace->lock first. No need to use lock_task_sighand().

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

 kernel/utrace.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- __UTRACE/kernel/utrace.c~6_WAKEUP_SIGLOCK	2009-09-09 00:29:21.000000000 +0200
+++ __UTRACE/kernel/utrace.c	2009-09-09 01:29:02.000000000 +0200
@@ -657,13 +657,9 @@ static bool utrace_do_stop(struct task_s
  */
 static void utrace_wakeup(struct task_struct *target, struct utrace *utrace)
 {
-	unsigned long irqflags;
-
 	utrace->stopped = 0;
 
-	if (!lock_task_sighand(target, &irqflags))
-		return;
-
+	spin_lock_irq(&target->sighand->siglock);
 	if (likely(task_is_stopped_or_traced(target))) {
 		if (target->signal->flags & SIGNAL_STOP_STOPPED ||
 		    target->signal->group_stop_count)
@@ -671,8 +667,7 @@ static void utrace_wakeup(struct task_st
 		else
 			wake_up_state(target, __TASK_STOPPED | __TASK_TRACED);
 	}
-
-	unlock_task_sighand(target, &irqflags);
+	spin_unlock_irq(&target->sighand->siglock);
 }
 
 /*


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]