Changeset 60936 in vbox for trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
- Timestamp:
- May 11, 2016 12:59:37 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r60767 r60936 1694 1694 RtlRestoreLastWin32Error(dwSavedLastError); 1695 1695 return STATUS_NAME_TOO_LONG; 1696 } 1697 1698 /* 1699 * Reject PGHook.dll as it creates a thread from its DllMain that breaks 1700 * our preconditions respawning the 2nd process, resulting in 1701 * VERR_SUP_VP_THREAD_NOT_ALONE. The DLL is being loaded by a user APC 1702 * scheduled during kernel32.dll load notification from a kernel driver, 1703 * so failing the load attempt should not upset anyone. 1704 */ 1705 if (g_enmSupR3HardenedMainState == SUPR3HARDENEDMAINSTATE_WIN_EARLY_STUB_DEVICE_OPENED) 1706 { 1707 static const struct { const char *psz; size_t cch; } s_aUnwantedEarlyDlls[] = 1708 { 1709 { RT_STR_TUPLE("PGHook.dll") }, 1710 }; 1711 1712 for (unsigned i = 0; i < RT_ELEMENTS(s_aUnwantedEarlyDlls); i++) 1713 { 1714 if (pName->Length < s_aUnwantedEarlyDlls[i].cch * 2) 1715 continue; 1716 PCRTUTF16 pwszTmp = &pName->Buffer[pName->Length / sizeof(RTUTF16) - s_aUnwantedEarlyDlls[i].cch]; 1717 if ( pName->Length != s_aUnwantedEarlyDlls[i].cch * 2 1718 && pwszTmp[-1] != '\\' 1719 && pwszTmp[-1] != '/') 1720 continue; 1721 if (RTUtf16ICmpAscii(pwszTmp, s_aUnwantedEarlyDlls[i].psz) != 0) 1722 continue; 1723 SUP_DPRINTF(("supR3HardenedMonitor_LdrLoadDll: Refusing to load '%.*ls' as it is expected to create undesirable threads that will upset our respawn checks (returning STATUS_TOO_MANY_THREADS)\n", 1724 pName->Length / sizeof(RTUTF16), pName->Buffer)); 1725 return STATUS_TOO_MANY_THREADS; 1726 } 1696 1727 } 1697 1728 … … 5230 5261 { SUPHARDNT_ADVERSARY_BEYONDTRUST, "privman" }, /* Not verified. */ 5231 5262 5232 { SUPHARDNT_ADVERSARY_AVECTO, " pgdriver" }, /* Not verified. */5263 { SUPHARDNT_ADVERSARY_AVECTO, "PGDriver" }, 5233 5264 }; 5234 5265 … … 5786 5817 SUP_DPRINTF(("supR3HardenedVmProcessInit: Opening vboxdrv stub...\n")); 5787 5818 supR3HardenedWinOpenStubDevice(); 5819 g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_EARLY_STUB_DEVICE_OPENED; 5788 5820 } 5789 5821 else if (cArgs >= 1 && suplibHardenedStrCmp(papszArgs[0], SUPR3_RESPAWN_2_ARG0) == 0) … … 5791 5823 SUP_DPRINTF(("supR3HardenedVmProcessInit: Opening vboxdrv...\n")); 5792 5824 supR3HardenedMainOpenDevice(); 5825 g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_EARLY_REAL_DEVICE_OPENED; 5793 5826 } 5794 5827 else 5795 5828 supR3HardenedFatal("Unexpected first argument '%s'!\n", papszArgs[0]); 5796 g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_EARLY_DEVICE_OPENED;5797 5829 5798 5830 /*
Note:
See TracChangeset
for help on using the changeset viewer.