On 06/01, Mike Christie wrote:
>
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1368,7 +1368,9 @@ int zap_other_threads(struct task_struct *p)
>  
>       while_each_thread(p, t) {
>               task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK);
> -             count++;
> +             /* Don't require de_thread to wait for the vhost_worker */
> +             if ((t->flags & (PF_IO_WORKER | PF_USER_WORKER)) != 
> PF_USER_WORKER)
> +                     count++;

Well if you do this, then you should also change __exit_signal() to
not decrement sig->notify_count. Otherwise de_thread() can succeed
before the "normal" sub-threads exit.

But this can't be right anyway... If nothing else, suppose we have
a process with 3 threads:

        M       - the main thread, group leader
        T       - sub-thread
        V       - vhost worker

T does exec and calls de_thread().

M exits. T takes the leadership and does release_task()

V is still running but V->group_leader points to already freed M.

Or unshare_sighand() after that... If nothing else this means that
lock_task_sighand(T) and lock_task_sighand(V) will take different
locks.

Oleg.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to