VirtualBox

Ignore:
Timestamp:
May 11, 2016 12:59:37 PM (9 years ago)
Author:
vboxsync
Message:

SUPNtHard: Fixed VERR_SUP_VP_THREAD_NOT_ALONE problem with Avecto Defendpoint related products.

File:
1 edited

Legend:

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

    r60767 r60936  
    16941694        RtlRestoreLastWin32Error(dwSavedLastError);
    16951695        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        }
    16961727    }
    16971728
     
    52305261        { SUPHARDNT_ADVERSARY_BEYONDTRUST,          "privman" }, /* Not verified. */
    52315262
    5232         { SUPHARDNT_ADVERSARY_AVECTO,               "pgdriver" }, /* Not verified. */
     5263        { SUPHARDNT_ADVERSARY_AVECTO,               "PGDriver" },
    52335264    };
    52345265
     
    57865817        SUP_DPRINTF(("supR3HardenedVmProcessInit: Opening vboxdrv stub...\n"));
    57875818        supR3HardenedWinOpenStubDevice();
     5819        g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_EARLY_STUB_DEVICE_OPENED;
    57885820    }
    57895821    else if (cArgs >= 1 && suplibHardenedStrCmp(papszArgs[0], SUPR3_RESPAWN_2_ARG0) == 0)
     
    57915823        SUP_DPRINTF(("supR3HardenedVmProcessInit: Opening vboxdrv...\n"));
    57925824        supR3HardenedMainOpenDevice();
     5825        g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_EARLY_REAL_DEVICE_OPENED;
    57935826    }
    57945827    else
    57955828        supR3HardenedFatal("Unexpected first argument '%s'!\n", papszArgs[0]);
    5796     g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_EARLY_DEVICE_OPENED;
    57975829
    57985830    /*
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