VirtualBox

Changeset 87030 in vbox


Ignore:
Timestamp:
Dec 2, 2020 10:46:49 AM (4 years ago)
Author:
vboxsync
Message:

Forward port r141521, r141567, r141568, r141588, r141589, r141590, r141592, r141593, r141594, r141595 and r141652 from 6.1 (Fixes for BigSur with SIP disabled, bugref:9836)

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        1010/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
        1111/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
        1313/branches/aeichner/vbox-chromium-cleanup:129816,129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130036,130094-130095
        1414/branches/andy/draganddrop:90781-91268
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        1010/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
        1111/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
        1213/branches/aeichner/vbox-chromium-cleanup/src/VBox:129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130094-130095
        1314/branches/andy/draganddrop/src/VBox:90781-91268
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r85617 r87030  
    414414endif
    415415
    416 # Things specific to the posix crowd.
    417 if1of ($(KBUILD_TARGET), linux darwin solaris)
     416# macOS specifics.
     417ifeq ($(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
     431endif
     432
     433# Things specific to the rest of the posix crowd.
     434if1of ($(KBUILD_TARGET), linux solaris)
    418435 SUPR3HardenedStatic_DEFS += \
    419436        IN_DIS \
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r85129 r87030  
    495495                                                        const char *pszFormat, va_list va);
    496496#else   /* !RT_OS_WINDOWS */
     497# if !defined(RT_OS_DARWIN)
    497498DECLHIDDEN(void)    supR3HardenedPosixInit(void);
     499# else  /* !RT_OS_DARWIN */
     500DECLHIDDEN(void)    supR3HardenedDarwinInit(void);
     501#endif  /* !RT_OS_DARWIN */
    498502#endif  /* !RT_OS_WINDOWS */
    499503
  • trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp

    r85127 r87030  
    26352635    g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_VERIFY_TRUST_READY;
    26362636#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. */
    26382640    /*
    26392641     * Posix: Hook the load library interface interface.
  • trunk/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp

    r86224 r87030  
    3939#include <dlfcn.h>
    4040#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)
    4942# include <link.h>
    5043#endif
     
    5851*   Defined Constants And Macros                                                                                                 *
    5952*********************************************************************************************************************************/
    60 
    61 /** For OS X. */
    62 #ifndef MAP_ANONYMOUS
    63 # define MAP_ANONYMOUS MAP_ANON
    64 #endif
    6553
    6654/**
     
    192180        && strchr(pszFilename, '/') != NULL)
    193181    {
    194 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)
     182#if defined(RT_OS_LINUX)
    195183        int rc = supR3HardenedVerifyFileFollowSymlinks(pszFilename, RTHCUINTPTR_MAX, true /* fMaybe3rdParty */,
    196184                                                       NULL /* pErrInfo */);
     
    642630DECLHIDDEN(void) supR3HardenedPosixInit(void)
    643631{
    644     int  rc;
    645     bool fIgnoreFailure = false;
    646 
    647 #ifdef RT_OS_DARWIN
    648     /*
    649      * Try figure out / guess if we've got hardened runtime here.  For now we'll
    650      * 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 0
    661     char szMsg[128];
    662     write(2, szMsg, sprintf(szMsg,"DEBUG: p_csflags=%#x rc=%d\n", fFlags, rc));
    663 # endif
    664     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 #endif
    669 
    670632    for (unsigned i = 0; i < RT_ELEMENTS(g_aHooks); i++)
    671633    {
    672634        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))
    675637            supR3HardenedFatalMsg("supR3HardenedPosixInit", kSupInitOp_Integrity, rc,
    676638                                  "Failed to hook the %s interface", pHook->pszSymbol);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette