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

2019-01-10 Thread Andrei Vagin
On Wed, Jan 09, 2019 at 06:08:30PM +0100, Oleg Nesterov wrote: > On 01/08, Andrei Vagin wrote: > > > > No, you don't. The patch looks really nice. Thanks! > > > > BTW: We probably need to add the "Fixes:" tag, but I am not sure to which > > commit, it looks like the issue is here for years. > > I

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

2019-01-09 Thread Oleg Nesterov
On 01/08, Andrei Vagin wrote: > > No, you don't. The patch looks really nice. Thanks! > > BTW: We probably need to add the "Fixes:" tag, but I am not sure to which > commit, it looks like the issue is here for years. I hate you ;) Ok, OK, this was broken by me in 7c8bd2322c7fd973d089b27de55e29c92

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

2019-01-08 Thread Andrei Vagin
On Tue, Jan 08, 2019 at 05:50:43PM +0100, Oleg Nesterov wrote: > Sorry for delay, vacation, > > On 01/02, Andrei Vagin wrote: > > > > 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. > >

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

2019-01-08 Thread Oleg Nesterov
Sorry for delay, vacation, On 01/02, Andrei Vagin wrote: > > 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! > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -664,9 +664,6 @@ stati

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

2019-01-02 Thread Andrei Vagin
Oops, Al is here by mistake. Sorry about that. On Wed, Jan 02, 2019 at 12:59:39PM -0800, Andrei Vagin wrote: > Currently, exit_ptrace() adds all ptraced tasks in a dead list, than > zap_pid_ns_processes() waits all tasks in a current pid ns, and only > then tasks from the dead list are released. >

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

2019-01-02 Thread Andrei Vagin
Hello, The reproducer for this problem is attached to this message. Below you can find its effect without this fix: We have one alive process which stucks in zap_pid_ns_processes: $ ps axf ... 11831 pts/0S 0:00 [ptrace_pidns] 11833 pts/0Zl 0:00 \_ [ptrace_pidns] $ cat /

[PATCH] kernel: release ptraced tasks before zap_pid_ns_processes

2019-01-02 Thread Andrei Vagin
Currently, exit_ptrace() adds all ptraced tasks in a dead list, than zap_pid_ns_processes() waits all tasks in a current pid ns, 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 proc