TARDIS icon indicating copy to clipboard operation
TARDIS copied to clipboard

Revert original rqtp in after_clock_nanosleep insted of scaling rmtp

Open bigb4ng opened this issue 1 year ago • 0 comments

In after_clock_nanosleep you try to downscale rmtp (the time remaining). This doesn't make sense to me since you modify the value the next clock_nanosleep call and downscale it by the same factor (again) if tracee retries sleeping after interrupt (ex: sleep command).

I believe the correct implementation would be to revert rqtp to original value before call and upscale rmtp so the rmtp/rqtp ratio remains relative to the time passed.

Sometimes &rmtp == &rqtp (the second portion of if). In this case we only need to upscale once.

Also you messed up user-mode and kernel-mode ABIs. The kernel one has 4th param in r10 instead of rcx.

bigb4ng avatar Apr 20 '24 09:04 bigb4ng