lkml.org 
[lkml]   [2021]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND] ptrace: make ptrace() fail if the tracee changed its pid unexpectedly
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.

\
 
 \ /
  Last update: 2021-04-27 08:29    [W:0.101 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site