public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Eugene Syromiatnikov <esyr@redhat.com>,
	Jan Kratochvil <jan.kratochvil@redhat.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Pedro Alves <palves@redhat.com>,
	Simon Marchi <simon.marchi@efficios.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND2] ptrace: make ptrace() fail if the tracee changed its pid unexpectedly
Date: Wed, 12 May 2021 16:38:56 +0200	[thread overview]
Message-ID: <20210512143855.GB19594@redhat.com> (raw)
In-Reply-To: <1879292286.40455.1620827809948.JavaMail.zimbra@efficios.com>

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.


      reply	other threads:[~2021-05-12 14:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 16:56 [PATCH RESEND2] ptrace: make ptrace() fail if the tracee changed its pid unexpectedly Oleg Nesterov
2021-05-11 17:28 ` Linus Torvalds
2021-05-11 17:53   ` Oleg Nesterov
2021-05-11 18:06     ` Oleg Nesterov
2021-05-12 13:36       ` Oleg Nesterov
2021-05-12 13:56         ` Mathieu Desnoyers
2021-05-12 14:38           ` Oleg Nesterov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210512143855.GB19594@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=esyr@redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mtk.manpages@gmail.com \
    --cc=palves@redhat.com \
    --cc=simon.marchi@efficios.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox