Skip to content

Commit

Permalink
Cherry-pick 569a5bc. rdar://125261792
Browse files Browse the repository at this point in the history
    Adopt Fatal Exceptions Entitlement (2)
    https://bugs.webkit.org/show_bug.cgi?id=271663
    rdar://125261792

    Reviewed by Mark Lam.

    Adopt Fatal Exceptions Entitlement. This entitlement should be safe to adopt
    on all Apple platforms.

    The first version of this patch broke EWS, so we remove the simulator changes.

    * Source/JavaScriptCore/Scripts/process-entitlements.sh:
    * Source/JavaScriptCore/entitlements.plist:
    * Source/WebKit/Scripts/process-entitlements.sh:
    * Source/WebKit/Shared/AuxiliaryProcessExtensions/WebContentProcessExtension.entitlements:

    Canonical link: https://commits.webkit.org/276691@main

Canonical link: https://commits.webkit.org/272448.814@safari-7618-branch
  • Loading branch information
justinmichaud authored and Dan Robson committed Mar 27, 2024
1 parent fa7d728 commit 34d2dd8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/JavaScriptCore/Scripts/process-entitlements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ function plistbuddy()
function mac_process_jsc_entitlements()
{
plistbuddy Add :com.apple.security.cs.allow-jit bool YES
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
then
if (( "${TARGET_MAC_OS_X_VERSION_MAJOR}" >= 110000 ))
Expand All @@ -30,6 +32,8 @@ function mac_process_jsc_entitlements()

function mac_process_testapi_entitlements()
{
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
then
plistbuddy Add :com.apple.security.cs.allow-jit bool YES
Expand All @@ -56,6 +60,8 @@ function mac_process_testapi_entitlements()
function maccatalyst_process_jsc_entitlements()
{
plistbuddy Add :com.apple.security.cs.allow-jit bool YES
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
then
Expand All @@ -77,6 +83,8 @@ function maccatalyst_process_testapi_entitlements()
{
plistbuddy Add :com.apple.rootless.storage.JavaScriptCore bool YES
plistbuddy Add :com.apple.security.cs.allow-jit bool YES
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

if (( "${TARGET_MAC_OS_X_VERSION_MAJOR}" >= 110000 ))
then
Expand Down Expand Up @@ -111,6 +119,8 @@ function ios_family_process_jsc_entitlements()
fi
fi
plistbuddy Add :com.apple.developer.kernel.extended-virtual-addressing bool YES
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
}

rm -f "${WK_PROCESSED_XCENT_FILE}"
Expand Down
27 changes: 27 additions & 0 deletions Source/WebKit/Scripts/process-entitlements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ function plistbuddy()
function mac_process_webcontent_entitlements()
{
plistbuddy Add :com.apple.security.cs.allow-jit bool YES
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
then
Expand Down Expand Up @@ -40,6 +42,8 @@ function mac_process_webcontent_entitlements()

function mac_process_webcontent_captiveportal_entitlements()
{
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
then
plistbuddy Add :com.apple.private.webkit.use-xpc-endpoint bool YES
Expand Down Expand Up @@ -73,6 +77,8 @@ function mac_process_webcontent_captiveportal_entitlements()

function mac_process_gpu_entitlements()
{
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
then
if (( "${TARGET_MAC_OS_X_VERSION_MAJOR}" >= 101400 ))
Expand Down Expand Up @@ -127,6 +133,8 @@ function mac_process_gpu_entitlements()

function mac_process_network_entitlements()
{
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
then
if (( "${TARGET_MAC_OS_X_VERSION_MAJOR}" >= 101500 ))
Expand Down Expand Up @@ -236,6 +244,8 @@ function maccatalyst_process_webcontent_entitlements()
plistbuddy Add :com.apple.runningboard.assertions.webkit bool YES
plistbuddy Add :com.apple.private.webkit.use-xpc-endpoint bool YES
plistbuddy Add :com.apple.QuartzCore.webkit-end-points bool YES
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

if (( "${TARGET_MAC_OS_X_VERSION_MAJOR}" >= 110000 ))
then
Expand Down Expand Up @@ -274,6 +284,9 @@ function maccatalyst_process_webcontent_captiveportal_entitlements()
plistbuddy Add :com.apple.imageio.allowabletypes:2 string public.png
plistbuddy Add :com.apple.imageio.allowabletypes:3 string com.compuserve.gif

plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

if (( "${TARGET_MAC_OS_X_VERSION_MAJOR}" >= 110000 ))
then
plistbuddy Add :com.apple.developer.kernel.extended-virtual-addressing bool YES
Expand Down Expand Up @@ -301,6 +314,8 @@ function maccatalyst_process_webcontent_captiveportal_entitlements()

function maccatalyst_process_gpu_entitlements()
{
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
plistbuddy Add :com.apple.security.network.client bool YES
plistbuddy Add :com.apple.runningboard.assertions.webkit bool YES
plistbuddy Add :com.apple.QuartzCore.webkit-end-points bool YES
Expand All @@ -321,6 +336,8 @@ function maccatalyst_process_gpu_entitlements()

function maccatalyst_process_network_entitlements()
{
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit
plistbuddy Add :com.apple.private.network.socket-delegate bool YES
plistbuddy Add :com.apple.security.network.client bool YES
plistbuddy Add :com.apple.runningboard.assertions.webkit bool YES
Expand Down Expand Up @@ -361,6 +378,10 @@ function ios_family_process_webcontent_shared_entitlements()
plistbuddy Add :com.apple.private.webinspector.proxy-application bool YES
plistbuddy Add :com.apple.private.webkit.use-xpc-endpoint bool YES
plistbuddy Add :com.apple.runningboard.assertions.webkit bool YES

plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

if [[ "${PRODUCT_NAME}" != WebContentExtension && "${PRODUCT_NAME}" != WebContentCaptivePortalExtension ]]; then
plistbuddy Add :com.apple.private.gpu-restricted bool YES
plistbuddy Add :com.apple.private.pac.exception bool YES
Expand Down Expand Up @@ -406,6 +427,9 @@ function ios_family_process_webcontent_captiveportal_entitlements()

function ios_family_process_gpu_entitlements()
{
plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

plistbuddy Add :com.apple.QuartzCore.secure-mode bool YES
plistbuddy Add :com.apple.QuartzCore.webkit-end-points bool YES
plistbuddy add :com.apple.QuartzCore.webkit-limited-types bool YES
Expand Down Expand Up @@ -482,6 +506,9 @@ function ios_family_process_network_entitlements()
plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token:0 string kTCCServiceWebKitIntelligentTrackingPrevention
plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token:1 string kTCCServiceUserTracking

plistbuddy Add :com.apple.security.fatal-exceptions array
plistbuddy Add :com.apple.security.fatal-exceptions:0 string jit

plistbuddy Add :com.apple.private.appstored array
plistbuddy Add :com.apple.private.appstored:0 string InstallWebAttribution

Expand Down

0 comments on commit 34d2dd8

Please sign in to comment.