Changeset 80216 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Aug 10, 2019 2:04:07 AM (5 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r77912 r80216 2518 2518 { 2519 2519 SUP_DPRINTF(("SUPR3HardenedMain: Respawn #1\n")); 2520 supR3HardenedWinInit(SUPSECMAIN_FLAGS_DONT_OPEN_DEV , false /*fAvastKludge*/);2520 supR3HardenedWinInit(SUPSECMAIN_FLAGS_DONT_OPEN_DEV | SUPSECMAIN_FLAGS_FIRST_PROCESS, false /*fAvastKludge*/); 2521 2521 supR3HardenedVerifyAll(true /* fFatal */, pszProgName, g_szSupLibHardenedExePath, fFlags); 2522 2522 return supR3HardenedWinReSpawn(1 /*iWhich*/); -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
r77972 r80216 55 55 SUPHARDNTVPKIND_CHILD_PURIFICATION, 56 56 SUPHARDNTVPKIND_SELF_PURIFICATION, 57 SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED, 57 58 SUPHARDNTVPKIND_32BIT_HACK = 0x7fffffff 58 59 } SUPHARDNTVPKIND; -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
r80212 r80216 492 492 #ifdef IN_RING3 493 493 if ( pThis->enmKind == SUPHARDNTVPKIND_CHILD_PURIFICATION 494 || pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION) 494 || pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION 495 || pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED) 495 496 { 496 497 PVOID pvRestoreAddr = (uint8_t *)pImage->uImageBase + uRva; … … 532 533 return VINF_SUCCESS; 533 534 if ( pThis->enmKind == SUPHARDNTVPKIND_CHILD_PURIFICATION 534 || pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION) 535 || pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION 536 || pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED) 535 537 return VINF_SUCCESS; 536 538 … … 1357 1359 pThis->cFixes++; 1358 1360 SUP_DPRINTF(("supHardNtVpScanVirtualMemory: NtUnmapViewOfSection(,%p) failed: %#x\n", pMemInfo->AllocationBase, rcNt)); 1361 } 1362 else if (pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED) 1363 { 1364 SUP_DPRINTF(("supHardNtVpScanVirtualMemory: Ignoring unknown mem at %p LB %#zx (base %p) - '%ls'\n", 1365 pMemInfo->BaseAddress, pMemInfo->RegionSize, pMemInfo->AllocationBase, pwszFilename)); 1366 return VINF_OBJECT_DESTROYED; 1359 1367 } 1360 1368 #endif … … 1877 1885 pThis->cFixes++; 1878 1886 } 1879 else 1887 else if (pThis->enmKind != SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED) 1880 1888 # endif /* IN_RING3 */ 1881 1889 supHardNtVpSetInfo2(pThis, VERR_SUP_VP_FOUND_EXEC_MEMORY, … … 2436 2444 return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_NO_NTDLL_MAPPING, 2437 2445 "The process has no NTDLL.DLL."); 2438 if (iKernel32 == UINT32_MAX && pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION) 2446 if (iKernel32 == UINT32_MAX && ( pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION 2447 || pThis->enmKind == SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED)) 2439 2448 return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_NO_KERNEL32_MAPPING, 2440 2449 "The process has no KERNEL32.DLL."); … … 2492 2501 */ 2493 2502 int rc = VINF_SUCCESS; 2494 if (enmKind != SUPHARDNTVPKIND_CHILD_PURIFICATION) 2503 if ( enmKind != SUPHARDNTVPKIND_CHILD_PURIFICATION 2504 && enmKind != SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED) 2495 2505 rc = supHardNtVpThread(hProcess, hThread, pErrInfo); 2496 2506 if (RT_SUCCESS(rc)) -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r80212 r80216 5157 5157 */ 5158 5158 supR3HardenedWinInstallHooks(); 5159 } 5160 else if (fFlags & SUPSECMAIN_FLAGS_FIRST_PROCESS) 5161 { 5162 /* 5163 * Try shake anyone (e.g. easyhook) patching process creation code in 5164 * kernelbase, kernel32 or ntdll so they won't so easily cause the child 5165 * to crash when we respawn and purify it. 5166 */ 5167 SUP_DPRINTF(("supR3HardenedWinInit: doing limited purification...\n")); 5168 uint32_t cFixes = 0; 5169 rc = supHardenedWinVerifyProcess(NtCurrentProcess(), NtCurrentThread(), SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED, 5170 0 /*fFlags*/, &cFixes, NULL /*pErrInfo*/); 5171 SUP_DPRINTF(("supR3HardenedWinInit: SUPHARDNTVPKIND_SELF_PURIFICATION_LIMITED -> %Rrc, cFixes=%d\n", rc, cFixes)); 5172 RT_NOREF(rc); /* ignored on purpose */ 5159 5173 } 5160 5174
Note:
See TracChangeset
for help on using the changeset viewer.