Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97258
b: refs/heads/master
c: da7978b
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed May 24, 2008
1 parent 363b2b4 commit a1c46de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dfc7064500061677720fa26352963c772d3ebe6b
refs/heads/master: da7978b0348d497688541e2d2f5739aa2a2c334f
7 changes: 6 additions & 1 deletion trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,19 @@ static void __exit_signal(struct task_struct *tsk)

__unhash_process(tsk);

/*
* Do this under ->siglock, we can race with another thread
* doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals.
*/
flush_sigqueue(&tsk->pending);

tsk->signal = NULL;
tsk->sighand = NULL;
spin_unlock(&sighand->siglock);
rcu_read_unlock();

__cleanup_sighand(sighand);
clear_tsk_thread_flag(tsk,TIF_SIGPENDING);
flush_sigqueue(&tsk->pending);
if (sig) {
flush_sigqueue(&sig->shared_pending);
taskstats_tgid_free(sig);
Expand Down
3 changes: 2 additions & 1 deletion trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,8 @@ void sigqueue_free(struct sigqueue *q)
/*
* If the signal is still pending remove it from the
* pending queue. We must hold ->siglock while testing
* q->list to serialize with collect_signal().
* q->list to serialize with collect_signal() or with
* __exit_signal()->flush_sigqueue().
*/
spin_lock_irqsave(lock, flags);
if (!list_empty(&q->list))
Expand Down

0 comments on commit a1c46de

Please sign in to comment.