On 07.12.2016 04:27, Rin Okuyama wrote:
However, before proceeding further, we need to discuss undocumented
details related to PT_STEP; What should we do when a process steps into
a RAS? How about the case where PT_STEP is used against a process which
is already in single stepping? And so on...
According to my understanding RAS is intended to be atomic sequence of
operations and tracer mustn't interrupt or preempt it.
There might exist only single tracer attached to a process.
I don't think PT_STEP called twice for the same process makes sense in
real life, it might be undefined behavior on port-specific basis and/or
return error (in other words just prevent panic(9) and vulnerabilities).
If I remember correctly process sets MD-style PSL_T variable to indicate
trap after at least single instruction - if so, we cannot set this bit
twice.