VirtualBox

Changeset 58730 in vbox


Ignore:
Timestamp:
Nov 18, 2015 1:32:53 AM (9 years ago)
Author:
vboxsync
Message:

supR3HardenedMonitor_LdrLoadDll: Return STATUS_INVALID_IMAGE_FORMAT for VERR_LDR_ARCH_MISMATCH. That my shut up stupid attempts to load 32-bit hook DLLs into our process.

File:
1 edited

Legend:

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

    r58405 r58730  
    11551155
    11561156/**
     1157 * Translates VBox status code (from supHardenedWinVerifyImageTrust) to an NT
     1158 * status.
     1159 *
     1160 * @returns NT status.
     1161 * @param   rc                      VBox status code.
     1162 */
     1163static NTSTATUS supR3HardenedScreenImageCalcStatus(int rc)
     1164{
     1165    /* This seems to be what LdrLoadDll returns when loading a 32-bit DLL into
     1166       a 64-bit process.  At least here on windows 10 (2015-11-xx).
     1167
     1168       NtCreateSection probably returns something different, possibly a warning,
     1169       we currently don't distinguish between the too, so we stick with the
     1170       LdrLoadDll one as it's definitely an error.*/
     1171    if (rc == VERR_LDR_ARCH_MISMATCH)
     1172        return STATUS_INVALID_IMAGE_FORMAT;
     1173
     1174    return STATUS_TRUST_FAILURE;
     1175}
     1176
     1177
     1178/**
    11571179 * Screens an image file or file mapped with execute access.
    11581180 *
     
    12641286                               "supR3HardenedScreenImage/%s: cached rc=%Rrc fImage=%d fProtect=%#x fAccess=%#x cHits=%u %ls\n",
    12651287                               pszCaller, pCacheHit->rc, fImage, *pfProtect, *pfAccess, cHits, uBuf.UniStr.Buffer);
    1266         return STATUS_TRUST_FAILURE;
     1288        return supR3HardenedScreenImageCalcStatus(pCacheHit->rc);
    12671289    }
    12681290
     
    14501472        if (hMyFile != hFile)
    14511473            supR3HardenedWinVerifyCacheInsert(&uBuf.UniStr, hMyFile, rc, fWinVerifyTrust, fFlags);
    1452         return STATUS_TRUST_FAILURE;
     1474        return supR3HardenedScreenImageCalcStatus(rc);
    14531475    }
    14541476
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