lkml.org 
[lkml]   [2014]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2014-12-24 19:41    [W:0.148 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site