diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-02-08 07:19:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:27 -0500 |
commit | d12619b5ff5664623524aef796514d1946ea3b4a (patch) | |
tree | 23140ca0148f9154440d3056e2040d8df468a24b /include/linux/signal.h | |
parent | 430c623121ea88ca80595c99fdc63b7f8a803ae5 (diff) |
fix group stop with exit race
do_signal_stop() counts all sub-thread and sets ->group_stop_count
accordingly. Every thread should decrement ->group_stop_count and stop,
the last one should notify the parent.
However a sub-thread can exit before it notices the signal_pending(), or it
may be somewhere in do_exit() already. In that case the group stop never
finishes properly.
Note: this is a minimal fix, we can add some optimizations later. Say we
can return quickly if thread_group_empty(). Also, we can move some signal
related code from exit_notify() to exit_signals().
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/signal.h')
-rw-r--r-- | include/linux/signal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/signal.h b/include/linux/signal.h index 7e095147656c..42d2e0a948f4 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -241,6 +241,7 @@ extern int show_unhandled_signals; | |||
241 | 241 | ||
242 | struct pt_regs; | 242 | struct pt_regs; |
243 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 243 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
244 | extern void exit_signals(struct task_struct *tsk); | ||
244 | 245 | ||
245 | extern struct kmem_cache *sighand_cachep; | 246 | extern struct kmem_cache *sighand_cachep; |
246 | 247 | ||