[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202106252022.79A9A1A@keescook>
Date: Fri, 25 Jun 2021 20:24:04 -0700
From: Kees Cook <keescook@...omium.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Michael Schmitz <schmitzmic@...il.com>,
linux-arch <linux-arch@...r.kernel.org>,
Jens Axboe <axboe@...nel.dk>, Oleg Nesterov <oleg@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Richard Henderson <rth@...ddle.net>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
alpha <linux-alpha@...r.kernel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
Arnd Bergmann <arnd@...nel.org>,
Ley Foon Tan <ley.foon.tan@...el.com>,
Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH 4/9] signal: Factor start_group_exit out of
complete_signal
On Thu, Jun 24, 2021 at 02:01:20PM -0500, Eric W. Biederman wrote:
> +static void start_group_exit_locked(struct signal_struct *signal, int exit_code)
> +{
> + /*
> + * Start a group exit and wake everybody up.
> + * This way we don't have other threads
> + * running and doing things after a slower
> + * thread has the fatal signal pending.
> + */
> + struct task_struct *t;
> +
> + signal->flags = SIGNAL_GROUP_EXIT;
> + signal->group_exit_code = exit_code;
> + signal->group_stop_count = 0;
> + __for_each_thread(signal, t) {
> + task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK);
> +
> + /* Don't bother with already dead threads */
> + if (t->exit_state)
> + continue;
> + sigaddset(&t->pending.signal, SIGKILL);
> + signal_wake_up(t, 1);
> + }
This both extracts it and changes it. For ease-of-review, maybe split
this patch into the move and then the logic changes?
--
Kees Cook
Powered by blists - more mailing lists