> I was worried about the case when the TIF_SINGLESTEP tracee detaches
> itself and escapes finish_resume_report()->user_disable_single_step(),
> say, utrace_report_exec(). But probably we can ignore this.

No, I think that is indeed a problem.  If no engine is still attached
whose last callback returned UTRACE_SINGLESTEP, we should never return
to user mode with single-step enabled.

> Another concern was implicit detach, but thinking more I do not see
> why utrace_resume() is better.
> 
> OK, I'll do some testing and resend right now. In UTRACE_DETACH case
> reset can be true but the tracee is running. But I don't think it
> makes sense to check target->exit_state == 0, correct?

I think it's OK if it's running with ->exit_state set (or even with just
PF_EXITING set), i.e. already in kernel mode and never going back to
user mode.  (Then it's essentially equivalent to calling user_*_step
while racing with a SIGKILL death, which has to be OK.)  Any other kind
of running would not be OK.


Thanks,
Roland

Reply via email to