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

From: Oleg Nesterov
Date: Mon May 09 2011 - 13:00:14 EST


On 05/08, Tejun Heo wrote:
>
> Currently, there's no way to trap a running ptracee short of sending a
> signal which has various side effects. This patch implements
> PTRACE_INTERRUPT which traps ptracee without any signal or job control
> related side effect.
>
> The implementation is almost trivial. It uses the same trap site and
> event as PTRACE_SEIZE. A new trap flag JOBCTL_TRAP_INTERRUPT is
> added, which is set on PTRACE_INTERRUPT and cleared when tracee
> commits to INTERRUPT trap. As INTERRUPT should be useable regardless
> of the current state of tracee, task_is_traced() test in
> ptrace_check_attach() is skipped for INTERRUPT.

Heh. As usual, I can never review the patches in time. Will continue
tomorrow.

Right now I am a bit puzzled why do we have 2 bits, JOBCTL_TRAP_INTERRUPT
and JOBCTL_TRAP_SEIZE... But I didn't read this + other patches yet.

At first glance, JOBCTL_TRAP_INTERRUPT has the same problem with the
killed tracee. I think this is easy to fix.

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/