Re: [PATCH RESEND2] ptrace: make ptrace() fail if the tracee changed its pid unexpectedly

From: Oleg Nesterov
Date: Wed May 12 2021 - 10:39:23 EST


Hi Mathieu,

On 05/12, Mathieu Desnoyers wrote:
>
> Out of curiosity: what makes it OK to use either the current task or its
> parent's pid namespace in this specific case ? What happens if they are
> in different pid namespaces ?

Because in this case current == task->parent == debugger.

Just in case... task->real_parent is, well, "real parent", the parent which
forked this task.

task->parent == task->real_parent unless this task is ptraced, in this case
task->parent == debugger.

Oleg.