Changeset 66573 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Apr 14, 2017 1:24:58 PM (8 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r66548 r66573 1658 1658 { 1659 1659 #ifdef SUP_HARDENED_SUID 1660 /* Drop any root privileges we might be holding, this won't return 1661 if it fails but end up calling supR3HardenedFatal[V]. */ 1662 supR3HardenedMainDropPrivileges(); 1663 #endif 1664 /* Close the driver, if we succeeded opening it. Both because 1665 TrustedError may be untrustworthy and because the driver deosn't 1666 like us if we fork(). @bugref{8838} */ 1667 suplibOsTerm(&g_SupPreInitData.Data); 1668 1660 1669 /* 1661 * Drop any root privileges we might be holding, this won't return1662 * if it fails but end up calling supR3HardenedFatal[V].1670 * Now try resolve and call the TrustedError entry point if we can find it. 1671 * Note! Loader involved, so we must guard against loader hooks calling us. 1663 1672 */ 1664 supR3HardenedMainDropPrivileges(); 1665 #endif 1666 1667 /* 1668 * Now try resolve and call the TrustedError entry point if we can 1669 * find it. We'll fork before we attempt this because that way the 1670 * session management in main will see us exiting immediately (if 1671 * it's involved with us). 1672 */ 1673 static volatile bool s_fRecursive = false; 1674 if (!s_fRecursive) 1675 { 1676 s_fRecursive = true; 1677 1678 PFNSUPTRUSTEDERROR pfnTrustedError = supR3HardenedMainGetTrustedError(g_pszSupLibHardenedProgName); 1679 if (pfnTrustedError) 1680 { 1681 /* We'll fork before we make the call because that way the session management 1682 in main will see us exiting immediately (if it's involved with us) and possibly 1683 get an error back to the API / user. */ 1673 1684 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) 1674 int pid = fork(); 1675 if (pid <= 0) 1676 #endif 1677 { 1678 static volatile bool s_fRecursive = false; /* Loader hooks may cause recursion. */ 1679 if (!s_fRecursive) 1680 { 1681 s_fRecursive = true; 1682 1683 PFNSUPTRUSTEDERROR pfnTrustedError = supR3HardenedMainGetTrustedError(g_pszSupLibHardenedProgName); 1684 if (pfnTrustedError) 1685 int pid = fork(); 1686 if (pid <= 0) 1687 #endif 1688 { 1685 1689 pfnTrustedError(pszWhere, enmWhat, rc, pszMsgFmt, va); 1686 1687 s_fRecursive = false; 1690 } 1688 1691 } 1692 1693 s_fRecursive = false; 1689 1694 } 1690 1695 } -
trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
r66526 r66573 221 221 222 222 223 #ifndef IN_SUP_HARDENED_R3224 225 223 int suplibOsTerm(PSUPLIBDATA pThis) 226 224 { … … 254 252 255 253 254 #ifndef IN_SUP_HARDENED_R3 255 256 256 int suplibOsInstall(void) 257 257 { -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
r62490 r66573 120 120 121 121 122 #ifndef IN_SUP_HARDENED_R3123 124 122 int suplibOsTerm(PSUPLIBDATA pThis) 125 123 { … … 136 134 } 137 135 136 137 #ifndef IN_SUP_HARDENED_R3 138 138 139 139 int suplibOsInstall(void) -
trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
r66526 r66573 146 146 147 147 148 #ifndef IN_SUP_HARDENED_R3149 150 148 int suplibOsTerm(PSUPLIBDATA pThis) 151 149 { … … 163 161 } 164 162 163 164 #ifndef IN_SUP_HARDENED_R3 165 165 166 166 int suplibOsInstall(void) -
trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
r62490 r66573 105 105 106 106 107 #ifndef IN_SUP_HARDENED_R3108 109 107 int suplibOsTerm(PSUPLIBDATA pThis) 110 108 { … … 122 120 } 123 121 122 123 #ifndef IN_SUP_HARDENED_R3 124 124 125 125 int suplibOsInstall(void) -
trunk/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp
r66526 r66573 154 154 155 155 156 #ifndef IN_SUP_HARDENED_R3157 158 156 int suplibOsTerm(PSUPLIBDATA pThis) 159 157 { … … 183 181 } 184 182 183 184 #ifndef IN_SUP_HARDENED_R3 185 185 186 186 int suplibOsInstall(void) -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r62679 r66573 636 636 return rc; 637 637 } 638 #endif /* !IN_SUP_HARDENED_R3 */ 638 639 639 640 … … 653 654 } 654 655 656 657 #ifndef IN_SUP_HARDENED_R3 655 658 656 659 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
Note:
See TracChangeset
for help on using the changeset viewer.