Skip to content
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

Remove VM_EXIT_ACK_INTR_ON_EXIT flag and fix BSOD #32

Merged
merged 2 commits into from
Aug 13, 2018

Conversation

wbenny
Copy link
Contributor

@wbenny wbenny commented Aug 4, 2018

Hi,
These two separate commits fix two unrelated issues:

  • Removal of VM_EXIT_ACK_INTR_ON_EXIT flag, which is not needed, because PIN_BASED_EXT_INTR is not set (as discussed in Question about VM_EXIT_ACK_INTR_ON_EXIT  #31) and its setting may create just confusion for newcomers.
  • Fixing BSOD in situation where DriverEntry->ShvLoad fails. Code before patch forgets to unregister PowerCallback (note that DriverUnload is not called when DriverEntry fails), which leaves PowerCallback leaked. When Windows is about to do shutdown or reboot, it tries to call this unregistered callback, but because the driver is already unloaded, it results in critical page-fault and BSOD.

Patches has been tested in VMWare.

Setting VM_EXIT_ACK_INTR_ON_EXIT makes sense only when PIN_BASED_EXT_INTR is set (see Intel Manual Vol3C[24.7.1(VM-Exit Controls)]).
@rianquinn
Copy link

+1

The registered power callback needs to be unregistered when ShvLoad happens to fail, as DriverUnload is not called when DriverEntry does not succeed.
Code before patch allowed to create a situation, where ShvLoad in DriverEntry failed, which resulted in the leak of PowerCallback, which - on machine shutdown/reboot - resulted in critical pagefault in the area of the unloaded driver and the system went blue.
@ionescu007 ionescu007 merged commit 0275e1e into ionescu007:master Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants