Messages in this thread | | | Date | Wed, 24 Dec 2014 19:06:54 +0100 | From | Oleg Nesterov <> | Subject | Re: [PATCH RFC] Allow introspection to already attached ptracer in __ptrace_may_access |
| |
On 12/24, Stijn Volckaert wrote: > > The question now is whether or not it's the security module's > responsibility to check whether a tracee relationship is already in > place or if ptrace itself should do it.
Honestly, I have no idea
> --- a/kernel/ptrace.c 2014-12-24 13:53:23.055346526 +0100 > +++ b/kernel/ptrace.c 2014-12-24 14:17:20.617824840 +0100 > @@ -232,6 +232,9 @@ static int __ptrace_may_access(struct ta > /* Don't let security modules deny introspection */ > if (same_thread_group(task, current)) > return 0; > + /* Don't deny introspection to already attached ptracer */ > + if (!ptrace_check_attach(task, true)) > + return 0;
Perhaps this makes sense, probably security checks do not make sense if the target is traced.
But in this case I'd suggest to simply
if (ptrace_parent(task) == current) return 0;
Oleg.
| |