VirtualBox

Changeset 101279 in vbox for trunk


Ignore:
Timestamp:
Sep 27, 2023 7:22:13 AM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159262
Message:

Installer/darwin: Use the automatically generated entitlements files to have it in one place and split the entitlements into a VM process and main bundle entitlements file

Location:
trunk
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r101229 r101279  
    17001700ifeq ($(KBUILD_TARGET),darwin)
    17011701 #
     1702 # Common entitlements for the main and VM process bundle.
     1703 #
     1704 # The following two are required in the main bundle even though they apply only to the VM
     1705 # process. The issue is that TCC is looking up the primary bundle for these entitlements
     1706 # and crashes the VM process if the entitlements are not here even though they are used
     1707 # in the VM process only. This is not documented anywhere by Apple.
     1708 # From Console.app when these are missing:
     1709 #   tccd: [com.apple.TCC:access] Prompting policy for hardened runtime; service:
     1710 #       kTCCServiceMicrophone requires entitlement com.apple.security.device.audio-input but it is missing for
     1711 #           RESP:{
     1712 #               ID: org.virtualbox.app.VirtualBox,
     1713 #               PID[17253],
     1714 #               auid: 501,
     1715 #               euid: 501,
     1716 #               responsible path: '/Applications/VirtualBox.app/Contents/MacOS/VirtualBox',
     1717 #               binary path: '/Applications/VirtualBox.app/Contents/MacOS/VirtualBox'
     1718 #           },
     1719 #           REQ:{
     1720 #               ID: org.virtualbox.app.VirtualBoxVM,
     1721 #               PID[17331],
     1722 #               auid: 501,
     1723 #               euid: 501,
     1724 #               binary path: '/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM'
     1725 #           }
     1726 VBOX_DARWIN_ENTITLEMENTS_LIST_COMMON := \
     1727        com.apple.security.device.audio-input \
     1728        com.apple.security.device.camera
     1729
     1730 #
    17021731 # The first two entitlements are required to get everything working
    1703  # on Catalina which we want to keep supported for now.
     1732 # on Catalina which we want to keep supported for now:
     1733 #
     1734 #     The first entitlement allows us to have unsigned executable memory in the guests
     1735 #     address space like the BIOS code (and essentially all the guests address space which
     1736 #     is mapped as RWX).
     1737 #     The second entitlement is required in order to map guest memory as RWX into the
     1738 #     guests address space.
     1739 #     These entitlements are not required starting with BigSur+ where Apple has clearly
     1740 #     changed something in their entitlement scheme without properly documenting it.
    17041741 #
    17051742 # allow-jit   - for the recompiler in order to be able to generate and execute native code.
     
    17071744 # camera      - accessing the webcam from a guest.
    17081745 # usb         - USB passthrough.
     1746 # hypervisor  - Hypervisor entitlement in order to be able to use Hypervisor.framework
    17091747 #
    1710  VBOX_DARWIN_ENTITLEMENTS_LIST := \
     1748 VBOX_DARWIN_ENTITLEMENTS_LIST_VM := \
     1749        $(VBOX_DARWIN_ENTITLEMENTS_LIST_COMMON) \
    17111750        com.apple.security.cs.allow-unsigned-executable-memory \
    17121751        com.apple.security.cs.disable-executable-page-protection \
    17131752        com.apple.security.cs.allow-jit \
    1714         com.apple.security.device.audio-input \
    1715         com.apple.security.device.camera \
    1716         com.apple.security.device.usb
     1753        com.apple.security.device.usb \
     1754        com.apple.security.hypervisor
    17171755
    17181756 #
    1719  # The hypervisor entitlement is required in adhoc signing mode
    1720  # to get access to the Hypervisor framework. For release signing
    1721  # the entitlement is included in our developer certificate.
    1722  #
    1723  # The device-access and networking entitlemnents are reserved for
     1757 # The device-access and networking entitlements are reserved for
    17241758 # only specific vendors and are only available in release mode signing
    17251759 # (binaries signed with these entitlements in adhoc mode will just crash
    17261760 # with a code signing error).
    17271761 #
    1728  ifeq ($(VBOX_SIGNING_MODE),adhoc)
    1729   VBOX_DARWIN_ENTITLEMENTS_LIST += \
    1730         com.apple.security.hypervisor
    1731  else
    1732   VBOX_DARWIN_ENTITLEMENTS_LIST += \
     1762 ifeq ($(VBOX_SIGNING_MODE),release)
     1763  VBOX_DARWIN_ENTITLEMENTS_LIST_VM += \
    17331764        com.apple.vm.device-access \
    17341765        com.apple.vm.networking
     
    17361767
    17371768 # Where the dynamic generated entitlements can be found.
    1738  VBOX_DARWIN_ENTITLEMENTS_FILE := $(PATH_OUT)/Entitlements.plist
     1769 VBOX_DARWIN_ENTITLEMENTS_FILE    := $(PATH_OUT)/Entitlements.plist
     1770 VBOX_DARWIN_ENTITLEMENTS_FILE_VM := $(PATH_OUT)/EntitlementsVM.plist
    17391771endif
    17401772
     
    44534485        $(if-expr defined(VBOX_TSA_URL),--timestamp="$(VBOX_TSA_URL)") \
    44544486        $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \
    4455         --entitlements="$(VBOX_DARWIN_ENTITLEMENTS_FILE)" \
     4487        --entitlements="$(VBOX_DARWIN_ENTITLEMENTS_FILE_VM)" \
    44564488        "$(1)" \
    44574489        $(if $(2),--identifier "$(2)",)
     
    90869118        $(QUIET)$(APPEND) [email protected] '</plist>'
    90879119        $(QUIET)$(MV) -f [email protected] $@
     9120
     9121 $(VBOX_DARWIN_ENTITLEMENTS_FILE_VM):
     9122        $(call MSG_GENERATE,,$@)
     9123        $(QUIET)$(MKDIR) -p $(@D)
     9124        $(QUIET)$(RM) -f $@ [email protected]
     9125        $(QUIET)$(APPEND) [email protected] '<?xml version="1.0" encoding="UTF-8"?>'
     9126        $(QUIET)$(APPEND) [email protected] '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">'
     9127        $(QUIET)$(APPEND) [email protected] '<plist version="1.0">'
     9128        $(QUIET)$(APPEND) [email protected] '<dict>'
     9129        $(QUIET)$(APPEND) -n [email protected] $(foreach entitlement,$(VBOX_DARWIN_ENTITLEMENTS_LIST_VM), '        <key>$(entitlement)</key><true/>')
     9130        $(QUIET)$(APPEND) [email protected] '</dict>'
     9131        $(QUIET)$(APPEND) [email protected] '</plist>'
     9132        $(QUIET)$(MV) -f [email protected] $@
    90889133endif
    90899134
     
    90949139 Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK) $(VBOX_PRODUCT_HEADER) $(VBOX_PACKAGE_HEADER)
    90959140 ifeq ($(KBUILD_TARGET),darwin)
    9096   Makefile.kmk: | $(VBOX_DARWIN_ENTITLEMENTS_FILE)
     9141  Makefile.kmk: | $(VBOX_DARWIN_ENTITLEMENTS_FILE) $(VBOX_DARWIN_ENTITLEMENTS_FILE_VM)
    90979142 endif
    90989143endif
  • trunk/src/VBox/Installer/darwin/Makefile.kmk

    r100459 r101279  
    614614endif
    615615
    616 VBOX_VIRTUALBOX_APP_ENTITLEMENTS := $(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlements.plist
    617 VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS := $(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlementsVM.plist
     616VBOX_VIRTUALBOX_APP_ENTITLEMENTS := $(VBOX_DARWIN_ENTITLEMENTS_FILE)
     617VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS := $(VBOX_DARWIN_ENTITLEMENTS_FILE)
    618618
    619619##
     
    634634 ifdef VBOX_VIRTUALBOX_APP_ID
    635635  VBOX_VIRTUALBOX_APP_ENTITLEMENTS := $(VBOX_PATH_PACK_TMP)/SUPR3HardenedEntitlements.plist
    636   $(evalcall2 def_vbox_entitlement_add_app_and_team_id,$(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlements.plist,$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS),$(VBOX_VIRTUALBOX_APP_ID),$(VBOX_PROVISIONPROFILE_TEAM_ID))
     636  $(evalcall2 def_vbox_entitlement_add_app_and_team_id,$(VBOX_DARWIN_ENTITLEMENTS_FILE),$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS),$(VBOX_VIRTUALBOX_APP_ID),$(VBOX_PROVISIONPROFILE_TEAM_ID))
    637637 endif
    638638
    639639 ifdef VBOX_VIRTUALBOXVM_APP_ID
    640640  VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS := $(VBOX_PATH_PACK_TMP)/SUPR3HardenedEntitlementsVM.plist
    641   $(evalcall2 def_vbox_entitlement_add_app_and_team_id,$(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlementsVM.plist,$(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS),$(VBOX_VIRTUALBOXVM_APP_ID),$(VBOX_PROVISIONPROFILE_TEAM_ID))
     641  $(evalcall2 def_vbox_entitlement_add_app_and_team_id,$(VBOX_DARWIN_ENTITLEMENTS_FILE),$(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS),$(VBOX_VIRTUALBOXVM_APP_ID),$(VBOX_PROVISIONPROFILE_TEAM_ID))
    642642 endif
    643643endif
Note: See TracChangeset for help on using the changeset viewer.

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