| Date | Thu, 19 May 2011 18:32:33 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 09/10] ptrace: add JOBCTL_BLOCK_NOTIFY |
| |
On 05/16, Tejun Heo wrote: > > +static void ptrace_put_task_struct(struct task_struct *child) > +{ > + unsigned long flags; > + > + if (!(child->jobctl & JOBCTL_BLOCK_NOTIFY)) > + goto out_put; > + > + if (unlikely(!lock_task_sighand(child, &flags))) > + goto out_put; > + > + /* > + * Make sure @chlid is still ptraced by us and clear BLOCK_NOTIFY. > + */ > + if (likely((child->ptrace & PT_PTRACED) && child->parent == current))
This looks a bit confusing... It is either traced or not. If it is traced, nobody else can trace it. In fact even PT_PTRACED is not strictly needed but I agree this check makes the code cleaner.
Oleg.
|