Re: [PATCH 04/10] ptrace: implement PTRACE_INTERRUPT

From: Oleg Nesterov
Date: Wed May 18 2011 - 14:40:12 EST


On 05/16, Tejun Heo wrote:
>
> + case PTRACE_INTERRUPT:
> + /*
> + * Stop tracee without any side-effect on signal or job
> + * control. At least one trap is guaranteed to happen
> + * after this request. If @child is already trapped, the
> + * current trap is not disturbed and another trap will
> + * happen after the current trap is ended with PTRACE_CONT.
> + *
> + * The actual trap might not be PTRACE_EVENT_STOP trap but
> + * the pending condition is cleared regardless.
> + */
> + if (likely(child->ptrace & PT_SEIZED) &&
> + lock_task_sighand(child, &flags)) {
> + child->jobctl |= JOBCTL_TRAP_STOP;

The same race with do_signal_stop() afaics.

Otherwise looks fine to me. Compared to V1, personally I like the new
behaviour more. PTRACE_INTERRUPT and PTRACE_SEIZE do the same.

Oleg.

--
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/