Re: [PATCH] Don't apply for write lock on tasklist_lock if parentdoesn't ptrace other processes

From: Roland McGrath
Date: Wed Jul 21 2010 - 18:25:45 EST


> > @@ -331,6 +331,9 @@ void exit_ptrace(struct task_struct *tra
> > struct task_struct *p, *n;
> > LIST_HEAD(ptrace_dead);
> >
> > + if (list_empty(&tracer->ptraced))
> > + return;
> > +
> > write_lock_irq(&tasklist_lock);
> > list_for_each_entry_safe(p, n, &tracer->ptraced, ptrace_entry) {
> > if (__ptrace_detach(tracer, p))

I think we may have tried that before. Oleg can tell us if it's really
safe vs a race with PTRACE_TRACEME or something like that.


Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/