-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide elapsed time of VM-exit from a guest #11
Comments
Looked into details of timer. A fix I thought, which was disabling timer at the entry point of VM-exit did not seem to be straightfoward at all. I will find some time to investigate more, but I am going to treat this issue as lower priority. Here is my findings on the timer interrupt. An interrupt handler for the timer is 0xd1 on my tested system. This was identified by looking at IP when this issue was seen.
I initially thought it was triggered by Local APIC, but below output shows interrupt vector for the timer is 0xff and the Initial Count and Current Count Registers are both 0 indicating the time was disabled accodring to the "APIC Timer" section in the Intel SDM.
Later, I found that the interrupt 0xd1 was registered by IO APIC. I guess this is because timer is managed by HPET, which is a dedicated device located outside a processor.
It may be still possible to disable the HPET timer, but I would need to understand HPET well to do it. Moreover, time keeping is not only done by HPET. ACPI Power Management Timer (PM Clock), Local APIC timer or any other timers may be used, and I need to investigate all those posibilities to decide what to cover in this project. Those are resources could be useful for further investigation.
|
I was trying aswell to bypass timing attacks made by apllications running on the Guest OS. My first thought was changing Did you made some progress on bypassing timing checks in the mean time? |
This is off topic for this thread, but it should be relatively straightforward to modify results of RDTSC. Just change a guest's registers used by RDTSC in VMM. Also, The "Time-Stamp Counter Offset and Multiplier" section might be interesting for your purpose. |
hi @tandasat, IA32_TSC_ADJUST And amd has an extra one for them Modifying IA32_TIME_STAMP_COUNTER directly accomplishes my end goal which is hiding cpu cycles from rdtsc but the issue is after awhile process windows start blacking out, or refusing to start and the computer is unusable. This happens even if I filter by process
Or if I filter by driver. Either way eventually(within 5 minutes) the system starts going haywire and isn't usable anymore. Do you have any idea how I can fix this? |
Found this description
and reada comment on stackoverflow that a number of things in your system expect the IA32_TIME_STAMP_COUNTER to be constantly increasing so haven't found a way to keep it stable by decreasing yet. |
The VMM does not virtualize the time stamp counter (TSC) or any other timers. This can lead timer interrupt (IDT d1: hal!HalpTimerClockInterrupt, on my test system) immediately after VM-enter when the VMM runs an VM-exit handler overly long time. While this is not an issue by itself, it could cause an infinite between a VM-exit and a timer interrupt handler under certain scenarios. A situation I have seen is as followings:
A quick fix would be streamlining the long run VM-exit handler, but the VMM should not limit what a developer can do on VM-exit in that manner. A more correct way to address this issue is hiding an elapsed time of VM-exit handler from a guest and protect guest context from triggering timer interrupt.
The text was updated successfully, but these errors were encountered: