diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-16 22:55:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-16 22:55:45 +0000 |
commit | 04aecf1372d30eb709d8de65152535ab66dcb74a (patch) | |
tree | d1e4d8c453a76465e8b63119314a28d39b474479 /src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp | |
parent | Adding upstream version 7.0.14-dfsg. (diff) | |
download | virtualbox-04aecf1372d30eb709d8de65152535ab66dcb74a.tar.xz virtualbox-04aecf1372d30eb709d8de65152535ab66dcb74a.zip |
Adding upstream version 7.0.16-dfsg.upstream/7.0.16-dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp')
-rw-r--r-- | src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp index 99b4278a..25c6b4c5 100644 --- a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp +++ b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp @@ -1398,6 +1398,21 @@ static void supR3HardenedGetFullExePath(void) default: supR3HardenedFatal("supR3HardenedExecDir: Unknown program binary location: %#x\n", g_fSupHardenedMain); } + +#ifdef RTPATH_APP_PRIVATE_ARCH + /* + * If the location is fixed, do not continue if it is not correct. Binaries + * must not be allowed to be started from anywhere else. (@bugref{10626}) + */ + if (suplibHardenedStrCmp(g_szSupLibHardenedAppBinPath, RTPATH_APP_PRIVATE_ARCH) != 0) + supR3HardenedFatal("supR3HardenedExecDir: Invalid program binary location: %s (expected %s)\n", + g_szSupLibHardenedAppBinPath, RTPATH_APP_PRIVATE_ARCH); +# ifdef RT_OS_WINDOWS +# error "Didn't expect RTPATH_APP_PRIVATE_ARCH to be defined on Windows." +# endif +#elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) || defined(RT_OS_DARWIN) +# error "Expected RTPATH_APP_PRIVATE_ARCH to be define on this host." +#endif } |