Changeset 104261 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Apr 10, 2024 12:26:37 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r104166 r104261 1344 1344 suplibHardenedStrCopy(g_szSupLibHardenedAppBinPath, g_szSupLibHardenedExePath); 1345 1345 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_ARCH, g_szSupLibHardenedAppBinPath, sizeof(RTPATH_APP_PRIVATE_ARCH)) != 0)1350 supR3HardenedFatal("supR3HardenedExecDir: refusing to start binary from unknown location %s\n",1351 g_szSupLibHardenedAppBinPath);1352 #endif1353 1346 1354 1347 g_offSupLibHardenedExecName = suplibHardenedStrLen(g_szSupLibHardenedAppBinPath); … … 1406 1399 supR3HardenedFatal("supR3HardenedExecDir: Unknown program binary location: %#x\n", g_fSupHardenedMain); 1407 1400 } 1401 1402 #ifdef RTPATH_APP_PRIVATE_ARCH 1403 /* 1404 * If the location is fixed, do not continue if it is not correct. Binaries 1405 * must not be allowed to be started from anywhere else. (@bugref{10626}) 1406 */ 1407 if (suplibHardenedStrCmp(g_szSupLibHardenedAppBinPath, RTPATH_APP_PRIVATE_ARCH) != 0) 1408 supR3HardenedFatal("supR3HardenedExecDir: Invalid program binary location: %s (expected %s)\n", 1409 g_szSupLibHardenedAppBinPath, RTPATH_APP_PRIVATE_ARCH); 1410 # ifdef RT_OS_WINDOWS 1411 # error "Didn't expect RTPATH_APP_PRIVATE_ARCH to be defined on Windows." 1412 # endif 1413 #elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) || defined(RT_OS_DARWIN) 1414 # error "Expected RTPATH_APP_PRIVATE_ARCH to be define on this host." 1415 #endif 1408 1416 } 1409 1417
Note:
See TracChangeset
for help on using the changeset viewer.