Changeset 87030 in vbox
- Timestamp:
- Dec 2, 2020 10:46:49 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo
-
old new 10 10 /branches/VBox-5.2:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124260,124263,124271,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812 11 11 /branches/VBox-6.0:130474-130475,130477,130479,131352 12 /branches/VBox-6.1:139660,139797 12 /branches/VBox-6.1:139660,139797,141521,141567-141568,141588-141590,141592-141595,141652 13 13 /branches/aeichner/vbox-chromium-cleanup:129816,129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130036,130094-130095 14 14 /branches/andy/draganddrop:90781-91268
-
- Property svn:mergeinfo
-
trunk/src/VBox
- Property svn:mergeinfo
-
old new 10 10 /branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812,127158-127159,127162-127167,127180 11 11 /branches/VBox-6.0/src/VBox:130474-130475,130477,130479,131352 12 /branches/VBox-6.1/src/VBox:141521,141567-141568,141588-141590,141592-141595,141652 12 13 /branches/aeichner/vbox-chromium-cleanup/src/VBox:129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130094-130095 13 14 /branches/andy/draganddrop/src/VBox:90781-91268
-
- Property svn:mergeinfo
-
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r85617 r87030 414 414 endif 415 415 416 # Things specific to the posix crowd. 417 if1of ($(KBUILD_TARGET), linux darwin solaris) 416 # macOS specifics. 417 ifeq ($(KBUILD_TARGET),darwin) 418 SUPR3HardenedStatic_DEFS += \ 419 LOG_DISABLED 420 421 SUPR3HardenedStatic_INCS += $(VBOX_PATH_RUNTIME_SRC)/include 422 423 SUPR3HardenedStatic_SOURCES += \ 424 darwin/SUPR3HardenedMain-darwin.cpp \ 425 \ 426 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg1Weak.cpp \ 427 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2.cpp \ 428 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2Weak.cpp \ 429 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2WeakV.cpp \ 430 $(VBOX_PATH_RUNTIME_SRC)/generic/RTAssertShouldPanic-generic.cpp 431 endif 432 433 # Things specific to the rest of the posix crowd. 434 if1of ($(KBUILD_TARGET), linux solaris) 418 435 SUPR3HardenedStatic_DEFS += \ 419 436 IN_DIS \ -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r85129 r87030 495 495 const char *pszFormat, va_list va); 496 496 #else /* !RT_OS_WINDOWS */ 497 # if !defined(RT_OS_DARWIN) 497 498 DECLHIDDEN(void) supR3HardenedPosixInit(void); 499 # else /* !RT_OS_DARWIN */ 500 DECLHIDDEN(void) supR3HardenedDarwinInit(void); 501 #endif /* !RT_OS_DARWIN */ 498 502 #endif /* !RT_OS_WINDOWS */ 499 503 -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r85127 r87030 2635 2635 g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_VERIFY_TRUST_READY; 2636 2636 #else /* !RT_OS_WINDOWS */ 2637 # ifndef RT_OS_FREEBSD /** @todo portme */ 2637 # if defined(RT_OS_DARWIN) 2638 supR3HardenedDarwinInit(); 2639 # elif !defined(RT_OS_FREEBSD) /** @todo Portme. */ 2638 2640 /* 2639 2641 * Posix: Hook the load library interface interface. -
trunk/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp
r86224 r87030 39 39 #include <dlfcn.h> 40 40 #include <sys/mman.h> 41 #ifdef RT_OS_DARWIN 42 # include <errno.h> 43 # include <fcntl.h> 44 # include <sys/stat.h> /* fstat() */ 45 # include <unistd.h> /* readlink() */ 46 # include <stdlib.h> 47 # include <sys/sysctl.h> /* sysctlbyname() */ 48 #elif defined(RT_OS_SOLARIS) 41 #if defined(RT_OS_SOLARIS) 49 42 # include <link.h> 50 43 #endif … … 58 51 * Defined Constants And Macros * 59 52 *********************************************************************************************************************************/ 60 61 /** For OS X. */62 #ifndef MAP_ANONYMOUS63 # define MAP_ANONYMOUS MAP_ANON64 #endif65 53 66 54 /** … … 192 180 && strchr(pszFilename, '/') != NULL) 193 181 { 194 #if defined(RT_OS_ DARWIN) || defined(RT_OS_LINUX)182 #if defined(RT_OS_LINUX) 195 183 int rc = supR3HardenedVerifyFileFollowSymlinks(pszFilename, RTHCUINTPTR_MAX, true /* fMaybe3rdParty */, 196 184 NULL /* pErrInfo */); … … 642 630 DECLHIDDEN(void) supR3HardenedPosixInit(void) 643 631 { 644 int rc;645 bool fIgnoreFailure = false;646 647 #ifdef RT_OS_DARWIN648 /*649 * Try figure out / guess if we've got hardened runtime here. For now we'll650 * just ignore patching errors if when hardened runtime is active.651 */652 int (*pfnCsOps)(pid_t, unsigned int, void *, size_t);653 *(void **)&pfnCsOps = dlsym(RTLD_DEFAULT, "csops");654 if (!pfnCsOps)655 supR3HardenedFatalMsg("supR3HardenedPosixInit", kSupInitOp_Integrity, VERR_SYMBOL_NOT_FOUND,656 "Failed locate the 'csops' function");657 658 uint32_t fFlags = 0;659 rc = pfnCsOps(getpid(), 0 /*CS_OPS_STATUS*/, &fFlags, sizeof(fFlags));660 # if 0661 char szMsg[128];662 write(2, szMsg, sprintf(szMsg,"DEBUG: p_csflags=%#x rc=%d\n", fFlags, rc));663 # endif664 if (rc != 0)665 supR3HardenedFatalMsg("supR3HardenedPosixInit", kSupInitOp_Integrity, VERR_GENERAL_FAILURE,666 "csops/CS_OPS_STATUS failed (%d)", rc);667 fIgnoreFailure = RT_BOOL(fFlags & 0x00010000 /*CS_RUNTIME*/);668 #endif669 670 632 for (unsigned i = 0; i < RT_ELEMENTS(g_aHooks); i++) 671 633 { 672 634 PCSUPHARDENEDPOSIXHOOK pHook = &g_aHooks[i]; 673 rc = supR3HardenedMainPosixHookOne(pHook->pszSymbol, pHook->pfnHook, pHook->ppfnRealResume, pHook->pfnResolve);674 if (RT_FAILURE(rc) && !fIgnoreFailure)635 int rc = supR3HardenedMainPosixHookOne(pHook->pszSymbol, pHook->pfnHook, pHook->ppfnRealResume, pHook->pfnResolve); 636 if (RT_FAILURE(rc)) 675 637 supR3HardenedFatalMsg("supR3HardenedPosixInit", kSupInitOp_Integrity, rc, 676 638 "Failed to hook the %s interface", pHook->pszSymbol);
Note:
See TracChangeset
for help on using the changeset viewer.