Changeset 35152 in vbox
- Timestamp:
- Dec 15, 2010 4:45:42 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r34959 r35152 1038 1038 * @param pszFilename Image filename. This must have a path. 1039 1039 * @param phLdrMod Where to store the handle to the loaded module. 1040 * @param fFlags See RTLDRFLAGS_. 1040 1041 * @param pszError Where to return error message on failure. 1041 1042 * @param cbError The size of the error buffer. 1042 1043 */ 1043 SUPR3DECL(int) SUPR3HardenedLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszError, size_t cbError);1044 SUPR3DECL(int) SUPR3HardenedLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, char *pszError, size_t cbError); 1044 1045 1045 1046 /** … … 1051 1052 * 1052 1053 * @returns iprt status code. 1053 * @param pszFilename Image filename. 1054 * @param phLdrMod Where to store the handle to the loaded module. 1054 * @param pszFilename Image filename. 1055 * @param phLdrMod Where to store the handle to the loaded module. 1056 * @param fFlags See RTLDRFLAGS_*. 1055 1057 * @param pszError Where to return error message on failure. 1056 1058 * @param cbError The size of the error buffer. 1057 1059 */ 1058 SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszError, size_t cbError);1060 SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, char *pszError, size_t cbError); 1059 1061 1060 1062 /** -
trunk/include/iprt/ldr.h
r34959 r35152 36 36 */ 37 37 38 /** Symbols defined in this library are not made available to resolve 39 * references in subsequently loaded libraries (default). */ 40 #define RTLDRFLAGS_LOCAL 0 41 /** Symbols defined in this library will be made available for symbol 42 * resolution of subsequently loaded libraries. */ 43 #define RTLDRFLAGS_GLOBAL RT_BIT(0) 44 45 38 46 RT_C_DECLS_BEGIN 39 47 … … 89 97 * @param pszFilename Image filename. 90 98 * @param phLdrMod Where to store the handle to the loader module. 99 * @param fFlags See RTLDFLAGS_. 91 100 * @param pszError Where to store an error message on failure. Optional. 92 101 * @param cbError The size of the buffer pointed to by @a pszError. 93 102 */ 94 RTDECL(int) RTLdrLoadEx(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszError, size_t cbError);103 RTDECL(int) RTLdrLoadEx(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, char *pszError, size_t cbError); 95 104 96 105 /** -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r34959 r35152 836 836 837 837 Log2(("VBoxHeadless: loading VBoxFFmpegFB shared library\n")); 838 rrc = SUPR3HardenedLdrLoadAppPriv("VBoxFFmpegFB", &hLdrFFmpegFB, szErr, sizeof(szErr));838 rrc = SUPR3HardenedLdrLoadAppPriv("VBoxFFmpegFB", &hLdrFFmpegFB, 0 /*=fFlags*/, szErr, sizeof(szErr)); 839 839 840 840 if (RT_SUCCESS(rrc)) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r35114 r35152 5115 5115 char szErr[8192]; 5116 5116 szErr[0] = '\0'; 5117 int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &mhVBoxDbg, szErr, sizeof(szErr));5117 int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &mhVBoxDbg, 0 /*=fFlags*/, szErr, sizeof(szErr)); 5118 5118 if (RT_FAILURE(vrc)) 5119 5119 { -
trunk/src/VBox/GuestHost/OpenGL/Makefile.kmk
r33676 r35152 400 400 $(VBOX_PATH_CROGL_GENFILES)/state_isenabled.c \ 401 401 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h 402 ifneq ($(KBUILD_TARGET),win) 403 state_tracker/state_lists.c_CFLAGS += $(VBOX_GCC_Wno-pointer-sign) 404 VBoxOGLcrstate_CFLAGS += 405 endif 402 406 403 407 # -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r34972 r35152 2083 2083 * @param pszFilename The full file name. 2084 2084 * @param phLdrMod Where to store the handle to the loaded module. 2085 * @param fFlags See RTLDFLAGS_. 2085 2086 * @param pszError Where to return the loader error. Optional. 2086 2087 * @param cbError The size of the buffer pointed to by @a pszError. 2087 2088 */ 2088 static int supR3HardenedLdrLoadIt(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszError, size_t cbError)2089 static int supR3HardenedLdrLoadIt(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, char *pszError, size_t cbError) 2089 2090 { 2090 2091 #ifdef VBOX_WITH_HARDENING … … 2103 2104 * Try load it. 2104 2105 */ 2105 return RTLdrLoadEx(pszFilename, phLdrMod, pszError, cbError);2106 } 2107 2108 2109 SUPR3DECL(int) SUPR3HardenedLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszError, size_t cbError)2106 return RTLdrLoadEx(pszFilename, phLdrMod, fFlags, pszError, cbError); 2107 } 2108 2109 2110 SUPR3DECL(int) SUPR3HardenedLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, char *pszError, size_t cbError) 2110 2111 { 2111 2112 /* … … 2145 2146 * Pass it on to the common library loader. 2146 2147 */ 2147 return supR3HardenedLdrLoadIt(pszFilename, phLdrMod, pszError, cbError);2148 } 2149 2150 2151 SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszError, size_t cbError)2152 { 2153 LogFlow(("SUPR3HardenedLdrLoadAppPriv: pszFilename=%p:{%s} phLdrMod=%p pszError=%p cbError=%zu\n", pszFilename, pszFilename, phLdrMod, pszError, cbError));2148 return supR3HardenedLdrLoadIt(pszFilename, phLdrMod, fFlags, pszError, cbError); 2149 } 2150 2151 2152 SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, char *pszError, size_t cbError) 2153 { 2154 LogFlow(("SUPR3HardenedLdrLoadAppPriv: pszFilename=%p:{%s} phLdrMod=%p fFlags=%08x pszError=%p cbError=%zu\n", pszFilename, pszFilename, phLdrMod, fFlags, pszError, cbError)); 2154 2155 2155 2156 /* … … 2207 2208 * Pass it on to SUPR3HardenedLdrLoad. 2208 2209 */ 2209 rc = SUPR3HardenedLdrLoad(szPath, phLdrMod, pszError, cbError);2210 rc = SUPR3HardenedLdrLoad(szPath, phLdrMod, fFlags, pszError, cbError); 2210 2211 2211 2212 LogFlow(("SUPR3HardenedLdrLoadAppPriv: returns %Rrc\n", rc)); … … 2244 2245 * Try load it. 2245 2246 */ 2246 return RTLdrLoadEx(pszFilename, phLdrMod, pszErr, cbErr);2247 return RTLdrLoadEx(pszFilename, phLdrMod, 0 /*=fFlags*/, pszErr, cbErr); 2247 2248 } 2248 2249 -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r35146 r35152 2340 2340 rc = SUPR3HardenedLdrLoadPlugIn(pszLibraryName, &mVRDPLibrary, szErr, sizeof(szErr)); 2341 2341 else 2342 rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &mVRDPLibrary, szErr, sizeof(szErr));2342 rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &mVRDPLibrary, 0 /*=fFlags*/, szErr, sizeof(szErr)); 2343 2343 if (RT_SUCCESS(rc)) 2344 2344 { -
trunk/src/VBox/Main/ExtPackManagerImpl.cpp
r35100 r35152 149 149 /** The current context. */ 150 150 VBOXEXTPACKCTX enmContext; 151 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_DARWIN) 152 /** File handle for the VBoxVMM libary which we slurp because ExtPacks depend on it. */ 153 RTLDRMOD hVBoxVMM; 154 #endif 151 155 152 156 RTMEMEF_NEW_AND_DELETE_OPERATORS(); … … 1171 1175 { 1172 1176 char szError[8192]; 1173 vrc = RTLdrLoadEx(m->strMainModPath.c_str(), &m->hMainMod, szError, sizeof(szError));1177 vrc = RTLdrLoadEx(m->strMainModPath.c_str(), &m->hMainMod, 0 /*=fFlags*/, szError, sizeof(szError)); 1174 1178 if (RT_FAILURE(vrc)) 1175 1179 { … … 1761 1765 m->pVirtualBox = a_pVirtualBox; 1762 1766 m->enmContext = a_enmContext; 1767 1768 /* 1769 * Slurp in VBoxVMM which is used by VBoxPuelMain. 1770 */ 1771 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_DARWIN) 1772 if (a_enmContext == VBOXEXTPACKCTX_PER_USER_DAEMON) 1773 { 1774 char szError[8192]; 1775 int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &m->hVBoxVMM, RTLDRFLAGS_GLOBAL, szError, sizeof(szError)); 1776 if (RT_FAILURE(vrc)) 1777 m->hVBoxVMM = NIL_RTLDRMOD; 1778 /* cleanup in ::uninit()? */ 1779 } 1780 #endif 1763 1781 1764 1782 /* -
trunk/src/VBox/Main/VRDEServerImpl.cpp
r35146 r35152 494 494 rc = SUPR3HardenedLdrLoadPlugIn(pszLibraryName, &hmod, szErr, sizeof(szErr)); 495 495 else 496 rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &hmod, szErr, sizeof(szErr));496 rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &hmod, 0 /*=fFlags*/, szErr, sizeof(szErr)); 497 497 if (RT_SUCCESS(rc)) 498 498 { -
trunk/src/VBox/Main/hgcm/HGCM.cpp
r34959 r35152 264 264 char szErr[8192]; 265 265 szErr[0] = '\0'; 266 int rc = SUPR3HardenedLdrLoadAppPriv (m_pszSvcLibrary, &m_hLdrMod, szErr, sizeof(szErr));266 int rc = SUPR3HardenedLdrLoadAppPriv (m_pszSvcLibrary, &m_hLdrMod, 0 /*=fFlags*/, szErr, sizeof(szErr)); 267 267 268 268 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Main/webservice/vboxweb.cpp
r34563 r35152 1155 1155 do 1156 1156 { 1157 rc = RTLdrLoad(filename.c_str(), &hlibAuth );1157 rc = RTLdrLoad(filename.c_str(), &hlibAuth, RTLDRFLAGS_LOCAL); 1158 1158 if (RT_FAILURE(rc)) 1159 1159 { -
trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp
r34959 r35152 96 96 RTDECL(int) RTLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod) 97 97 { 98 return RTLdrLoadEx(pszFilename, phLdrMod, NULL, 0);98 return RTLdrLoadEx(pszFilename, phLdrMod, 0 /*=fFlags*/, NULL, 0); 99 99 } 100 100 RT_EXPORT_SYMBOL(RTLdrLoad); 101 101 102 102 103 RTDECL(int) RTLdrLoadEx(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszError, size_t cbError)104 { 105 LogFlow(("RTLdrLoadEx: pszFilename=%p:{%s} phLdrMod=%p pszError=%p cbError=%zu\n", pszFilename, pszFilename, phLdrMod, pszError, cbError));103 RTDECL(int) RTLdrLoadEx(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, char *pszError, size_t cbError) 104 { 105 LogFlow(("RTLdrLoadEx: pszFilename=%p:{%s} phLdrMod=%p fFlags=%08x pszError=%p cbError=%zu\n", pszFilename, pszFilename, phLdrMod, fFlags, pszError, cbError)); 106 106 107 107 /* … … 136 136 * Attempt to open the module. 137 137 */ 138 rc = rtldrNativeLoad(pszFilename, &pMod->hNative, pszError, cbError);138 rc = rtldrNativeLoad(pszFilename, &pMod->hNative, fFlags, pszError, cbError); 139 139 if (RT_SUCCESS(rc)) 140 140 { -
trunk/src/VBox/Runtime/include/internal/ldr.h
r34959 r35152 365 365 * @param pszFilename The image filename. 366 366 * @param phHandle Where to store the module handle on success. 367 * @param fFlags See RTLDRFLAGS_. 367 368 * @param pszError Where to store the error message. Optional. 368 369 * @param cbError The size of the error message buffer. 369 370 */ 370 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, char *pszError, size_t cbError);371 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, char *pszError, size_t cbError); 371 372 372 373 int rtldrPEOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, RTFOFF offNtHdrs, PRTLDRMOD phLdrMod); -
trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
r34959 r35152 41 41 42 42 43 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, char *pszError, size_t cbError)43 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, char *pszError, size_t cbError) 44 44 { 45 45 /* … … 69 69 * Attempt load. 70 70 */ 71 void *pvMod = dlopen(pszFilename, RTLD_NOW | RTLD_LOCAL); 71 int fFlagsNative = RTLD_NOW; 72 if (fFlags & RTLDRFLAGS_GLOBAL) 73 fFlagsNative |= RTLD_GLOBAL; 74 else 75 fFlagsNative |= RTLD_LOCAL; 76 void *pvMod = dlopen(pszFilename, fFlagsNative); 72 77 if (pvMod) 73 78 { -
trunk/src/VBox/Runtime/r3/win/ldrNative-win.cpp
r34962 r35152 40 40 41 41 42 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, char *pszError, size_t cbError)42 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, char *pszError, size_t cbError) 43 43 { 44 44 Assert(sizeof(*phHandle) >= sizeof(HMODULE)); 45 AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER); 45 46 46 47 /* -
trunk/src/VBox/Storage/VD.cpp
r34959 r35152 2129 2129 } 2130 2130 2131 rc = SUPR3HardenedLdrLoad(pszPluginPath, &hPlugin, NULL, 0);2131 rc = SUPR3HardenedLdrLoad(pszPluginPath, &hPlugin, 0 /*=fFlags*/, NULL, 0); 2132 2132 if (RT_SUCCESS(rc)) 2133 2133 { … … 2253 2253 } 2254 2254 2255 rc = SUPR3HardenedLdrLoad(pszPluginPath, &hPlugin, NULL, 0);2255 rc = SUPR3HardenedLdrLoad(pszPluginPath, &hPlugin, 0 /*=fFlags*/, NULL, 0); 2256 2256 if (RT_SUCCESS(rc)) 2257 2257 { -
trunk/src/recompiler/VBoxREMWrapper.cpp
r34959 r35152 2133 2133 */ 2134 2134 const char *pszModule = remIs64bitEnabled(pVM) ? "VBoxREM64" : "VBoxREM32"; 2135 int rc = SUPR3HardenedLdrLoadAppPriv(pszModule, &g_ModREM2, NULL, 0);2135 int rc = SUPR3HardenedLdrLoadAppPriv(pszModule, &g_ModREM2, 0 /*=fFlags*/, NULL, 0); 2136 2136 if (RT_SUCCESS(rc)) 2137 2137 {
Note:
See TracChangeset
for help on using the changeset viewer.