All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Eugene Syromiatnikov <esyr@redhat.com>,
	Jan Kratochvil <jan.kratochvil@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	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 RESEND] ptrace: make ptrace() fail if the tracee changed its pid unexpectedly
Date: Tue, 27 Apr 2021 08:26:20 +0200	[thread overview]
Message-ID: <20210427062619.GB10986@redhat.com> (raw)
In-Reply-To: <626936290.15030.1619471040515.JavaMail.zimbra@efficios.com>

Hi Mathieu,

On 04/26, Mathieu Desnoyers wrote:
>
> > The patch doesn't add the new PTRACE_ option to not complicate the API,
> > and I _hope_ this won't cause any noticeable regression:
> >
> >	- If debugger uses PTRACE_O_TRACEEXEC and the thread did an exec
> >	  and the tracer does a ptrace request without having consumed
> >	  the exec event, it's 100% sure that the thread the ptracer
> >	  thinks it is targeting does not exist anymore, or isn't the
> >	  same as the one it thinks it is targeting.
> >
> >	- To some degree this patch adds nothing new. In the scenario
> >	  above ptrace(L) can fail with -ESRCH if it is called after the
> >	  execing sub-thread wakes the leader up and before it "steals"
> >	  the leader's pid.
>
> Hi Oleg,
>
> Is this something that should also target stable kernels ? AFAIU this change
> won't break debuggers more that they are already in this scenario. Or maybe
> it makes them fail in more obvious ways ?

Well, I am not sure this is stable material...

To me the problem is minor, and the patch adds the user-visible change.
I think it would be safer to not add stable tag.

Oleg.


  reply	other threads:[~2021-04-27  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 15:45 [PATCH RESEND] ptrace: make ptrace() fail if the tracee changed its pid unexpectedly Oleg Nesterov
2021-04-26 21:04 ` Mathieu Desnoyers
2021-04-27  6:26   ` Oleg Nesterov [this message]
2021-04-27 13:31     ` Mathieu Desnoyers

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=20210427062619.GB10986@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.