-
Notifications
You must be signed in to change notification settings - Fork 413
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
Activate VM-Exit I/O port 0x5658 crash vmtoolsd.exe #30
Comments
Impact of this issue seems relatively low, so it may take some time until I find time to take a look at it, but still good to be aware of. Thanks for detailed report! |
The issue here is that VMWare's backdoor (operating at port 0x5658, both via in/out instructions) has somewhat its own "calling convention". in/out instructions usually operate with rdi/rsi/rax/rdx registers only - but VMWare's backdoor expects parameters in RAX, RBX, RCX, RDX and uses the same set of registers for the output. Unfortunatelly, the only option here is either:
I'm making this dead thread alive because I'm dealing with the exact same problem right now, and at the same time I want to give a hint to others who happen to stuck here :) |
I've researched this bit more and... boy, does it behave weirdly! First of all, setting up custom I/O VM-exit instruction handler doesn't solve it. Why? Because VMWare Tools execute I/O instructions in user mode. And what does Intel Manual say about exception priorities? Thats right, #GP due to I/O executed in CPL > 0 has priority over VM-exit, even if unconditional I/O exiting is enabled. So in the moment when you start intercepting 0x5658 and 0x5659 I/O ports, you won't actually catch them in your handler at all, because #GPs will be suddenly raised (no matter if you catching GP via exception bitmap or not). BUT when you write a custom handler for #GP and check if the guest RIP points to any I/O instruction (which can be done via really simple function - no complex disassembler is needed), you can emulate the I/O instruction yourself (note that this I/O must be emulated with [ RAX, RBX, RCX, RDX, RSI, RDI, RFLAGS.DF ] set according to the guest - When you do this, VMWare Tools continue to work. |
Description
I test I/O interception for vmware backdoor instruction in 0x5658, however when I activate VM-Exit I/O port 0x5658 crash vmtoolsd.exe on VMWare workstation 12
Expected behavior
no crash and log instruction IN 0x5658
Actual behavior
always crash vmtools when load driver
Steps to reproduce the problem
modify code in VmpBuildIoBitmaps, add one line RtlSetBits(&bitmap_a_header, 0x5658, 0x1);
build and load HyperPlatform dirver
crash...
Specifications
host Windows 7 x64
guest Windows 7 x64
VMware 12
some log found vmware-vmsvc.log
when decompile vmtools.dll crash in address 0x7fef8fdaf42
The text was updated successfully, but these errors were encountered: