Skip to content

Commit

Permalink
freezer: use lock_task_sighand() in fake_signal_wake_up()
Browse files Browse the repository at this point in the history
cgroup_freezer calls freeze_task() without holding tasklist_lock and,
if the task is exiting, its ->sighand may be gone by the time
fake_signal_wake_up() is called.  Use lock_task_sighand() instead of
accessing ->sighand directly.

Signed-off-by: Tejun Heo <[email protected]>
Reported-by: Oleg Nesterov <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Paul Menage <[email protected]>
  • Loading branch information
htejun committed Nov 21, 2011
1 parent 5ece3ea commit 37ad8ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kernel/freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ static void fake_signal_wake_up(struct task_struct *p)
{
unsigned long flags;

spin_lock_irqsave(&p->sighand->siglock, flags);
signal_wake_up(p, 0);
spin_unlock_irqrestore(&p->sighand->siglock, flags);
if (lock_task_sighand(p, &flags)) {
signal_wake_up(p, 0);
unlock_task_sighand(p, &flags);
}
}

/**
Expand Down

0 comments on commit 37ad8ac

Please sign in to comment.