VirtualBox

Ignore:
Timestamp:
Aug 21, 2014 5:23:33 PM (10 years ago)
Author:
vboxsync
Message:

SUPHardenedVerifyProcess-win.cpp: When doing child purification, we can unmap DLLs we don't like... This should hopefully fix the sysferThunk.dll issue that I cannot reproduce.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp

    r52403 r52446  
    11101110 *
    11111111 * @returns VBox status code.
     1112 * @retval  VINF_OBJECT_DESTROYED if we've unmapped the image (child
     1113 *          purification only).
    11121114 * @param   pThis               The process scanning state structure.
    11131115 * @param   pImage              The new image structure.  Only the unicode name
     
    11901192    if (!pImage->pszName)
    11911193    {
     1194        /*
     1195         * Unknown image.
     1196         *
     1197         * If we're cleaning up a child process, we can unmap the offending
     1198         * DLL...  Might have interesting side effects, or at least interesting
     1199         * as in "may you live in interesting times".
     1200         */
     1201#ifdef IN_RING3
     1202        if (   pMemInfo->AllocationBase == pMemInfo->BaseAddress
     1203            && pThis->enmKind == SUPHARDNTVPKIND_CHILD_PURIFICATION)
     1204        {
     1205            SUP_DPRINTF(("supHardNtVpScanVirtualMemory: Unmapping image mem at %p (%p LB %#zx) - '%ls'\n",
     1206                         pMemInfo->AllocationBase, pMemInfo->BaseAddress, pMemInfo->RegionSize));
     1207            NTSTATUS rcNt = NtUnmapViewOfSection(pThis->hProcess, pMemInfo->AllocationBase);
     1208            if (NT_SUCCESS(rcNt))
     1209                return VINF_OBJECT_DESTROYED;
     1210            SUP_DPRINTF(("supHardNtVpScanVirtualMemory: NtUnmapViewOfSection(,%p) failed: %#x\n", pMemInfo->AllocationBase, rcNt));
     1211        }
     1212#endif
     1213        /*
     1214         * Special error message if we can.
     1215         */
    11921216        if (   pMemInfo->AllocationBase == pMemInfo->BaseAddress
    11931217            && (   supHardNtVpAreNamesEqual("sysfer.dll", pwszFilename)
    11941218                || supHardNtVpAreNamesEqual("sysfer32.dll", pwszFilename)
    1195                 || supHardNtVpAreNamesEqual("sysfer64.dll", pwszFilename)) )
     1219                || supHardNtVpAreNamesEqual("sysfer64.dll", pwszFilename)
     1220                || supHardNtVpAreNamesEqual("sysfrethunk.dll", pwszFilename)) )
    11961221        {
    11971222            supHardNtVpSetInfo2(pThis, VERR_SUP_VP_SYSFER_DLL,
     
    13881413                if (RT_SUCCESS(rc))
    13891414                {
    1390                     pThis->cImages++;
    1391                     if (pThis->cImages >= RT_ELEMENTS(pThis->aImages))
    1392                         return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_TOO_MANY_DLLS_LOADED,
    1393                                                    "Internal error: aImages is full.\n");
     1415                    if (rc != VINF_OBJECT_DESTROYED)
     1416                    {
     1417                        pThis->cImages++;
     1418                        if (pThis->cImages >= RT_ELEMENTS(pThis->aImages))
     1419                            return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_TOO_MANY_DLLS_LOADED,
     1420                                                       "Internal error: aImages is full.\n");
     1421                    }
    13941422                }
    13951423#ifdef IN_RING3 /* Continue and add more information if unknown DLLs are found. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette