aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 5341e2141904..06214b55dc5e 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2203,10 +2203,15 @@ relock:
2203 * group-wide signal. Another thread should be notified now to take 2203 * group-wide signal. Another thread should be notified now to take
2204 * the signal since we will not. 2204 * the signal since we will not.
2205 */ 2205 */
2206static void retarget_shared_pending(struct task_struct *tsk) 2206static void retarget_shared_pending(struct task_struct *tsk, sigset_t *which)
2207{ 2207{
2208 sigset_t retarget;
2208 struct task_struct *t; 2209 struct task_struct *t;
2209 2210
2211 sigandsets(&retarget, &tsk->signal->shared_pending.signal, which);
2212 if (sigisemptyset(&retarget))
2213 return;
2214
2210 t = tsk; 2215 t = tsk;
2211 while_each_thread(tsk, t) { 2216 while_each_thread(tsk, t) {
2212 if (!signal_pending(t) && !(t->flags & PF_EXITING)) 2217 if (!signal_pending(t) && !(t->flags & PF_EXITING))
@@ -2217,6 +2222,7 @@ static void retarget_shared_pending(struct task_struct *tsk)
2217void exit_signals(struct task_struct *tsk) 2222void exit_signals(struct task_struct *tsk)
2218{ 2223{
2219 int group_stop = 0; 2224 int group_stop = 0;
2225 sigset_t unblocked;
2220 2226
2221 if (thread_group_empty(tsk) || signal_group_exit(tsk->signal)) { 2227 if (thread_group_empty(tsk) || signal_group_exit(tsk->signal)) {
2222 tsk->flags |= PF_EXITING; 2228 tsk->flags |= PF_EXITING;
@@ -2232,7 +2238,9 @@ void exit_signals(struct task_struct *tsk)
2232 if (!signal_pending(tsk)) 2238 if (!signal_pending(tsk))
2233 goto out; 2239 goto out;
2234 2240
2235 retarget_shared_pending(tsk); 2241 unblocked = tsk->blocked;
2242 signotset(&unblocked);
2243 retarget_shared_pending(tsk, &unblocked);
2236 2244
2237 if (unlikely(tsk->group_stop & GROUP_STOP_PENDING) && 2245 if (unlikely(tsk->group_stop & GROUP_STOP_PENDING) &&
2238 task_participate_group_stop(tsk)) 2246 task_participate_group_stop(tsk))