Re: [PATCH] uprobes: don't enable/disable signle step if the userdid it

From: Oleg Nesterov
Date: Tue Jul 31 2012 - 14:23:12 EST


On 07/31, Srikar Dronamraju wrote:
>
> * Oleg Nesterov <oleg@xxxxxxxxxx> [2012-07-30 16:16:38]:
>
> > So I think we need arch_uprobe_*able_step(struct uprobe_task *utask).
> > Ignoring all problems except the one this patch tries to fix, x86
> > can simply do:
> >
> > arch_uprobe_enble_step(utask, struct arch_uprobe *auprobe)
> > {
> > utask->clear_tf =
> > !(regs->flags & X86_EFLAGS_TF) &&
> > (auprobe->insn != "popf");
> > regs->flags |= X86_EFLAGS_TF;
> > }
> >
> > arch_uprobe_disable_step(utask)
> > {
> > if (utask->clear_tf)
> > regs->flags &= ~X86_EFLAGS_TF;
> > }
> >
>
> We were using something similar to this approach. [though we were still
> using TIF_SINGLESTEP flag].

(and afaics the code was wrong)

> However this was all changed based on
> feedback from Roland and Peter.
>
> Here is the pointer to the discussion.
>
> https://lkml.org/lkml/2011/1/27/283

Looking at this discussion now, I am not sure that Roland was against
the per-arch uprobe_enable_step() implementation.

And when I read you message I do not understand your opinion ;)

And just in case, the pseudo code above is only for illustration,
note also "Ignoring all problems except the one".

In any case I agree, this needs more discussion. Personally I think
it doesn't make sense to try to teach user_enable_single_step() to
work correctly with ptrace and uprobes at the same time, I can be
wrong of-course.

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/