VirtualBox

Changeset 104160 in vbox


Ignore:
Timestamp:
Apr 4, 2024 3:43:32 PM (6 months ago)
Author:
vboxsync
Message:

SUPR3HardenedMain: Prevent hardened binaries from starting in unknown location, bugref:10626.

File:
1 edited

Legend:

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

    r99739 r104160  
    13441344    suplibHardenedStrCopy(g_szSupLibHardenedAppBinPath, g_szSupLibHardenedExePath);
    13451345    suplibHardenedPathStripFilename(g_szSupLibHardenedAppBinPath);
     1346
     1347    /* Make sure binary is located in known location (unix-like hosts only). */
     1348#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) || defined(RT_OS_DARWIN)
     1349    if (strncmp(RTPATH_APP_PRIVATE, g_szSupLibHardenedAppBinPath, sizeof(RTPATH_APP_PRIVATE)) != 0)
     1350        supR3HardenedFatal("supR3HardenedExecDir: refusing to start binary from unknown location %s\n",
     1351                           g_szSupLibHardenedAppBinPath);
     1352#endif
    13461353
    13471354    g_offSupLibHardenedExecName = suplibHardenedStrLen(g_szSupLibHardenedAppBinPath);
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