- Timestamp:
- Oct 10, 2014 1:44:08 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/err.h
r52962 r53017 2525 2525 * opened by the VM process. */ 2526 2526 #define VERR_SUP_VP_STUB_THREAD_OPEN_ERROR (-5672) 2527 /** Process Purification Failure: NtAllocateVirtualMemory failed to get us 2528 * suitable replacement memory for a chunk of executable memory that 2529 * shouldn't be present in our process. (You will only see this message if you 2530 * got potentially fatally buggy anti-virus software installed.) */ 2531 #define VERR_SUP_VP_REPLACE_VIRTUAL_MEMORY_FAILED (-5673) 2527 2532 2528 2533 /** @} */ -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r53016 r53017 4063 4063 if (RT_SUCCESS(rc)) 4064 4064 { 4065 rc = supHardenedWinVerifyProcess(NtCurrentProcess(), NtCurrentThread(), SUPHARDNTVPKIND_VERIFY_ONLY, 4065 rc = supHardenedWinVerifyProcess(NtCurrentProcess(), NtCurrentThread(), SUPHARDNTVPKIND_VERIFY_ONLY, 0 /*fFlags*/, 4066 4066 NULL /*pcFixes*/, &ErrInfo); 4067 4067 if (RT_SUCCESS(rc) && pNtProtect->enmProcessKind >= kSupDrvNtProtectKind_VmProcessUnconfirmed) -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
r52954 r53017 54 54 SUPHARDNTVPKIND_32BIT_HACK = 0x7fffffff 55 55 } SUPHARDNTVPKIND; 56 DECLHIDDEN(int) supHardenedWinVerifyProcess(HANDLE hProcess, HANDLE hThread, SUPHARDNTVPKIND enmKind, 56 /** @name SUPHARDNTVP_F_XXX - Flags for supHardenedWinVerifyProcess 57 * @{ */ 58 /** Replace unwanted executable memory allocations with a new one that's filled 59 * with zeros (default is just to free it). 60 * 61 * This is one way we attempt to work around buggy protection software that 62 * either result in host BSOD or VBox application malfunction. Here the current 63 * shit list: 64 * - Trend Micro's data protection software includes a buggy driver called 65 * sakfile.sys that has been observed crashing accessing user memory that we 66 * probably freed. I'd love to report this to Trend Micro, but unfortunately 67 * they doesn't advertise (or have?) an email address for reporting security 68 * vulnerabilities in the their software. Having wasted time looking and not 69 * very sorry for having to disclosing the bug here. 70 * - Maybe one more. 71 */ 72 #define SUPHARDNTVP_F_EXEC_ALLOC_REPLACE_WITH_ZERO RT_BIT_32(0) 73 /** @} */ 74 DECLHIDDEN(int) supHardenedWinVerifyProcess(HANDLE hProcess, HANDLE hThread, SUPHARDNTVPKIND enmKind, uint32_t fFlags, 57 75 uint32_t *pcFixes, PRTERRINFO pErrInfo); 58 76 DECLHIDDEN(int) supHardNtVpThread(HANDLE hProcess, HANDLE hThread, PRTERRINFO pErrInfo); -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
r52973 r53017 129 129 /** Type of verification to perform. */ 130 130 SUPHARDNTVPKIND enmKind; 131 /** Combination of SUPHARDNTVP_F_XXX. */ 132 uint32_t fFlags; 131 133 /** The result. */ 132 134 int rcResult; … … 1500 1502 "NtFreeVirtualMemory (%p LB %#zx) failed: %#x", 1501 1503 MemInfo.BaseAddress, MemInfo.RegionSize, rcNt); 1504 /* The Trend Micro sakfile.sys BSOD kludge. */ 1505 if (pThis->fFlags & SUPHARDNTVP_F_EXEC_ALLOC_REPLACE_WITH_ZERO) 1506 { 1507 pvFree = MemInfo.BaseAddress; 1508 cbFree = MemInfo.RegionSize; 1509 rcNt = NtAllocateVirtualMemory(pThis->hProcess, &pvFree, 0, &cbFree, MEM_COMMIT, PAGE_READWRITE); 1510 if (!NT_SUCCESS(rcNt)) 1511 supHardNtVpSetInfo2(pThis, VERR_SUP_VP_REPLACE_VIRTUAL_MEMORY_FAILED, 1512 "NtAllocateVirtualMemory (%p LB %#zx) failed with rcNt=%#x allocating " 1513 "replacement memory for working around buggy protection software. " 1514 "See VBoxStartup.log for more details", 1515 MemInfo.BaseAddress, MemInfo.RegionSize, rcNt); 1516 if (pvFree != MemInfo.BaseAddress) 1517 supHardNtVpSetInfo2(pThis, VERR_SUP_VP_REPLACE_VIRTUAL_MEMORY_FAILED, 1518 "We wanted NtAllocateVirtualMemory to get us %p LB %#zx, but it returned %p LB %#zx.", 1519 MemInfo.BaseAddress, MemInfo.RegionSize, pvFree, cbFree, rcNt); 1520 } 1502 1521 } 1503 1522 /* … … 2124 2143 * @param hThread A thread in the process (the caller). 2125 2144 * @param enmKind The kind of process verification to perform. 2145 * @param fFlags Valid combination of SUPHARDNTVP_F_XXX flags. 2126 2146 * @param pErrInfo Pointer to error info structure. Optional. 2127 2147 * @param pcFixes Where to return the number of fixes made during 2128 2148 * purification. Optional. 2129 2149 */ 2130 DECLHIDDEN(int) supHardenedWinVerifyProcess(HANDLE hProcess, HANDLE hThread, SUPHARDNTVPKIND enmKind, 2150 DECLHIDDEN(int) supHardenedWinVerifyProcess(HANDLE hProcess, HANDLE hThread, SUPHARDNTVPKIND enmKind, uint32_t fFlags, 2131 2151 uint32_t *pcFixes, PRTERRINFO pErrInfo) 2132 2152 { … … 2152 2172 { 2153 2173 pThis->enmKind = enmKind; 2174 pThis->fFlags = fFlags; 2154 2175 pThis->rcResult = VINF_SUCCESS; 2155 2176 pThis->hProcess = hProcess; -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r53003 r53017 340 340 /** TrendMicro OfficeScan and probably others. */ 341 341 #define SUPHARDNT_ADVERSARY_TRENDMICRO RT_BIT_32(3) 342 /** TrendMicro potentially buggy sakfile.sys. */ 343 #define SUPHARDNT_ADVERSARY_TRENDMICRO_SAKFILE RT_BIT_32(4) 342 344 /** McAfee. */ 343 #define SUPHARDNT_ADVERSARY_MCAFEE RT_BIT_32( 4)345 #define SUPHARDNT_ADVERSARY_MCAFEE RT_BIT_32(5) 344 346 /** Kaspersky or OEMs of it. */ 345 #define SUPHARDNT_ADVERSARY_KASPERSKY RT_BIT_32( 5)347 #define SUPHARDNT_ADVERSARY_KASPERSKY RT_BIT_32(6) 346 348 /** Malwarebytes Anti-Malware (MBAM). */ 347 #define SUPHARDNT_ADVERSARY_MBAM RT_BIT_32( 6)349 #define SUPHARDNT_ADVERSARY_MBAM RT_BIT_32(7) 348 350 /** AVG Internet Security. */ 349 #define SUPHARDNT_ADVERSARY_AVG RT_BIT_32( 7)351 #define SUPHARDNT_ADVERSARY_AVG RT_BIT_32(8) 350 352 /** Panda Security. */ 351 #define SUPHARDNT_ADVERSARY_PANDA RT_BIT_32( 8)353 #define SUPHARDNT_ADVERSARY_PANDA RT_BIT_32(9) 352 354 /** Microsoft Security Essentials. */ 353 #define SUPHARDNT_ADVERSARY_MSE RT_BIT_32( 9)355 #define SUPHARDNT_ADVERSARY_MSE RT_BIT_32(10) 354 356 /** Comodo. */ 355 #define SUPHARDNT_ADVERSARY_COMODO RT_BIT_32(1 0)357 #define SUPHARDNT_ADVERSARY_COMODO RT_BIT_32(11) 356 358 /** Check Point's Zone Alarm (may include Kaspersky). */ 357 #define SUPHARDNT_ADVERSARY_ZONE_ALARM RT_BIT_32(11) 359 #define SUPHARDNT_ADVERSARY_ZONE_ALARM RT_BIT_32(12) 360 /** Digital guardian. */ 361 #define SUPHARDNT_ADVERSARY_DIGITAL_GUARDIAN RT_BIT_32(13) 358 362 /** Unknown adversary detected while waiting on child. */ 359 363 #define SUPHARDNT_ADVERSARY_UNKNOWN RT_BIT_32(31) … … 3517 3521 cFixes = 0; 3518 3522 int rc = supHardenedWinVerifyProcess(pThis->hProcess, pThis->hThread, SUPHARDNTVPKIND_CHILD_PURIFICATION, 3523 g_fSupAdversaries & ( SUPHARDNT_ADVERSARY_TRENDMICRO_SAKFILE 3524 | SUPHARDNT_ADVERSARY_DIGITAL_GUARDIAN) 3525 ? SUPHARDNTVP_F_EXEC_ALLOC_REPLACE_WITH_ZERO : 0, 3519 3526 &cFixes, RTErrInfoInitStatic(&g_ErrInfoStatic)); 3520 3527 if (RT_FAILURE(rc)) … … 4675 4682 cFixes = 0; 4676 4683 rc = supHardenedWinVerifyProcess(NtCurrentProcess(), NtCurrentThread(), SUPHARDNTVPKIND_SELF_PURIFICATION, 4677 &cFixes, NULL /*pErrInfo*/);4684 0 /*fFlags*/, &cFixes, NULL /*pErrInfo*/); 4678 4685 if (RT_FAILURE(rc) || cFixes == 0) 4679 4686 break; … … 5102 5109 { SUPHARDNT_ADVERSARY_COMODO, "cmdHlp" }, 5103 5110 5111 { SUPHARDNT_ADVERSARY_DIGITAL_GUARDIAN, "dgmaster" }, /* Not verified. */ 5104 5112 }; 5105 5113 … … 5140 5148 { SUPHARDNT_ADVERSARY_TRENDMICRO, L"\\SystemRoot\\System32\\drivers\\tmeevw.sys" }, 5141 5149 { SUPHARDNT_ADVERSARY_TRENDMICRO, L"\\SystemRoot\\System32\\drivers\\tmciesc.sys" }, 5150 { SUPHARDNT_ADVERSARY_TRENDMICRO_SAKFILE, L"\\SystemRoot\\System32\\drivers\\sakfile.sys" }, /* Data Loss Prevention, not officescan. */ 5151 { SUPHARDNT_ADVERSARY_TRENDMICRO, L"\\SystemRoot\\System32\\drivers\\sakcd.sys" }, /* Data Loss Prevention, not officescan. */ 5152 5142 5153 5143 5154 { SUPHARDNT_ADVERSARY_MCAFEE, L"\\SystemRoot\\System32\\drivers\\cfwids.sys" }, … … 5211 5222 { SUPHARDNT_ADVERSARY_ZONE_ALARM, L"\\SystemRoot\\System32\\drivers\\vsdatant.sys" }, 5212 5223 { SUPHARDNT_ADVERSARY_ZONE_ALARM, L"\\SystemRoot\\System32\\AntiTheftCredentialProvider.dll" }, 5224 5225 { SUPHARDNT_ADVERSARY_DIGITAL_GUARDIAN, L"\\SystemRoot\\System32\\drivers\\dgmaster.sys" }, 5213 5226 }; 5214 5227
Note:
See TracChangeset
for help on using the changeset viewer.