X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fexit.c;h=ceb258782835a1073774e0337e0bc4d85f7a160f;hb=d18bb9a548e550f3ced57618e75085fb3f173133;hp=d3ad54677f9c0257fa0a373f8ce1b4774e947722;hpb=08acd4f8af42affd8cbed81cc1b69fa12ddb213f;p=linux-2.6 diff --git a/kernel/exit.c b/kernel/exit.c index d3ad54677f..ceb2587828 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -13,12 +13,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -125,6 +127,12 @@ 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); @@ -132,7 +140,6 @@ static void __exit_signal(struct task_struct *tsk) __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);