Re: [PATCH v2] kernel: release ptraced tasks before zap_pid_ns_processes

From: Andrew Morton
Date: Thu Jan 10 2019 - 18:37:52 EST


On Thu, 10 Jan 2019 09:52:00 -0800 Andrei Vagin <avagin@xxxxxxxxx> wrote:

> Currently, exit_ptrace() adds all ptraced tasks in a dead list, than
> zap_pid_ns_processes() waits all tasks in a current pidns, and only
> then tasks from the dead list are released.
>
> zap_pid_ns_processes() can stuck on waiting tasks from the dead list. In
> this case, we will have one unkillable process with one or more dead
> children.
>
> Thanks to Oleg for the advice to release tasks in find_child_reaper().
>
> Fixes: 7c8bd2322c7f ("exit: ptrace: shift "reap dead" code from exit_ptrace() to forget_original_parent()")
>
> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> Signed-off-by: Andrei Vagin <avagin@xxxxxxxxx>

Does this warrant a -stable backport? 7c8bd2322c7f was 4+ years ago...