Commit bdb8c828 authored by Linus Torvalds's avatar Linus Torvalds

Wake up a stopped task _after_ having marked the SIGCONT pending,

so that there isn't any window for running before the signal
handler has been invoced.
parent 655ed59f
...@@ -620,7 +620,6 @@ static void handle_stop_signal(int sig, struct task_struct *p) ...@@ -620,7 +620,6 @@ static void handle_stop_signal(int sig, struct task_struct *p)
t = p; t = p;
do { do {
rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending); rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending);
wake_up_state(t, TASK_STOPPED);
/* /*
* If there is a handler for SIGCONT, we must make * If there is a handler for SIGCONT, we must make
...@@ -632,9 +631,13 @@ static void handle_stop_signal(int sig, struct task_struct *p) ...@@ -632,9 +631,13 @@ static void handle_stop_signal(int sig, struct task_struct *p)
* flag set, the thread will pause and acquire the * flag set, the thread will pause and acquire the
* siglock that we hold now and until we've queued * siglock that we hold now and until we've queued
* the pending signal. * the pending signal.
*
* Wake up the stopped thread _after_ setting
* TIF_SIGPENDING
*/ */
if (!sigismember(&t->blocked, SIGCONT)) if (!sigismember(&t->blocked, SIGCONT))
set_tsk_thread_flag(t, TIF_SIGPENDING); set_tsk_thread_flag(t, TIF_SIGPENDING);
wake_up_state(t, TASK_STOPPED);
t = next_thread(t); t = next_thread(t);
} while (t != p); } while (t != p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment