Skip to content

Commit

Permalink
[PATCH] Fix task state testing properly in do_signal_stop()
Browse files Browse the repository at this point in the history
Any tests using < TASK_STOPPED or the like are left over from the time
when the TASK_ZOMBIE and TASK_DEAD bits were in the same word, and it
served to check for "stopped or dead".  I think this one in
do_signal_stop is the only such case.  It has been buggy ever since
exit_state was separated, and isn't testing the exit_state value.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Roland McGrath authored and Linus Torvalds committed Sep 29, 2005
1 parent 4a8342d commit 5acbc5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,8 @@ do_signal_stop(int signr)
* stop is always done with the siglock held,
* so this check has no races.
*/
if (t->state < TASK_STOPPED) {
if (!t->exit_state &&
!(t->state & (TASK_STOPPED|TASK_TRACED))) {
stop_count++;
signal_wake_up(t, 0);
}
Expand Down

0 comments on commit 5acbc5c

Please sign in to comment.