Re: [PATCH 1/1] ptrace: Get tracer PID without reliance on the proc FS

From: Roman Kisel
Date: Mon Sep 09 2024 - 13:06:49 EST


On 09/09, Oleg Nesterov wrote:

> On 09/09, Roman Kisel wrote:
> >
> > On 9/8/2024, Oleg Nesterov wrote:
> >
> > > But you can safely ignore me, I do not pretend I understand the userspace's
> > > needs.
> > >
> > > And I guess people will use it anyway, so I won't argue with, say, a trivial
> > > patch which just adds
> > >
> > > case PR_GET_PTRACED:
> > > error = !!current->ptrace;
> > > break;
> > >
> > > into sys_prctl(), even if I agree that this probably just makes bad behavior
> > > easier.
> >
> > Very kind of you trying to build a longer table rather than a taller fence,
> > I appreciate that very much! Your aproach looks very neat indeed,
>
> Well, you didn't answer my question in
> https://lore.kernel.org/all/20240906114819.GA20831@xxxxxxxxxx/
> so I decided that a simpler change which returns !!current->ptrace instead
> of the tracer's pid might work as well.
>

Apologies for that! After Linus had been added, I braced for the impact as
obviously I was not fixing anything urgent or making some breakthrough
deserving such attention. I guess I got my 101 on adding code to "./kernel" :D

> Sorry for annoying you.
>
Sorry if my response carried that connotation. I indeed learned a lot from
your suggestions. I'll make sure to write better.

> Oleg.

Roman