Re: [PATCH 1/2] ptrace: make wait_on_bit(JOBCTL_TRAPPING_BIT) in ptrace_attach() killable

Tejun Heo
2015-11-23T23:05:58Z

On Thu, Nov 19, 2015 at 07:47:32PM +0100, Oleg Nesterov wrote:
> ptrace_attach() can hang waiting for STOPPED -> TRACED transition if the
> tracee gets frozen in between, change wait_on_bit() to use TASK_KILLABLE.
>
> This doesn't really solve the problem(s) and we probably need to fix the
> freezer. In particular, note that this means that pm freezer will fail if
> it races attach-to-stopped-task.
>
> And otoh perhaps we can just remove JOBCTL_TRAPPING_BIT altogether, it is
> not clear if we really need to hide this transition from debugger, WNOHANG
> after PTRACE_ATTACH can fail anyway if it races with SIGCONT.
>
> Reported-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

--
tejun