lkml.org 
[lkml]   [2021]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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

    \
     
     \ /
      Last update: 2021-06-26 05:25    [W:7.831 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site