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

From: Oleg Nesterov
Date: Mon Sep 09 2024 - 12:43:26 EST


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.

Sorry for annoying you.

Oleg.