lkml.org 
[lkml]   [2011]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [path][rfc] add PR_DETACH prctl command [2/2]
On 04/21, Stas Sergeev wrote:
>
> Attaching the fixed patch.
> Changes:
> - in wait_task_consider(), pr_detach hides the process
> only in !ptrace case
> ...
> @@ -1555,6 +1600,14 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
> if (p->exit_state == EXIT_ZOMBIE && !delay_group_leader(p))
> return wait_task_zombie(wo, p);
>
> + if (unlikely(p->pr_detached)) {
> + if (p->detaching)
> + return wait_task_detached(wo, p);
> + /* pr_detached tasks are hidden from parent */
> + if (!ptrace)
> + return 0;
> + }

Hmm... I guess this should fix ptrace? How? I dont understand this at all.

Stas, I bet you didn't test your patch. If the old parent traces the child
WEXITED should not succeed until the child really exits. Otherwise it is
easy to escape ptrace.

Oh. And I bet there are other problems. Say, exec can change the leader...
Easy to fix, but note that we need more and more stupid pr_detached special
cases.

Stas, sorry. I am not going to looks at the next versions. Until you
convince lkml we need this feature.

Oleg.



\
 
 \ /
  Last update: 2011-04-21 22:19    [W:0.120 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site