Title: [276440] branches/safari-612.1.11-branch/Source
Revision
276440
Author
[email protected]
Date
2021-04-22 09:35:13 -0700 (Thu, 22 Apr 2021)

Log Message

Cherry-pick r275899. rdar://problem/76986496

    Revert r275172
    https://bugs.webkit.org/show_bug.cgi?id=224499
    <rdar://76396241>

    Patch by Alex Christensen <[email protected]> on 2021-04-13
    Reviewed by Tim Horton.

    Source/WebKit:

    It turns out that terminate_with_reason uses a different syscall than xpc_connection_kill in its implementation,
    and the former is not allowed by Messages's sandbox yet.  Revert for Messages until they add it.

    * Platform/IPC/cocoa/ConnectionCocoa.mm:
    (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
    (IPC::Connection::kill):
    * Platform/spi/Cocoa/ReasonSPI.h:
    * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
    (WebKit::ProcessLauncher::platformInvalidate):
    (WebKit::terminateWithReason):

    Source/WTF:

    * wtf/spi/darwin/XPCSPI.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275899 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-612.1.11-branch/Source/WTF/ChangeLog (276439 => 276440)


--- branches/safari-612.1.11-branch/Source/WTF/ChangeLog	2021-04-22 16:34:35 UTC (rev 276439)
+++ branches/safari-612.1.11-branch/Source/WTF/ChangeLog	2021-04-22 16:35:13 UTC (rev 276440)
@@ -1,3 +1,43 @@
+2021-04-22  Ruben Turcios  <[email protected]>
+
+        Cherry-pick r275899. rdar://problem/76986496
+
+    Revert r275172
+    https://bugs.webkit.org/show_bug.cgi?id=224499
+    <rdar://76396241>
+    
+    Patch by Alex Christensen <[email protected]> on 2021-04-13
+    Reviewed by Tim Horton.
+    
+    Source/WebKit:
+    
+    It turns out that terminate_with_reason uses a different syscall than xpc_connection_kill in its implementation,
+    and the former is not allowed by Messages's sandbox yet.  Revert for Messages until they add it.
+    
+    * Platform/IPC/cocoa/ConnectionCocoa.mm:
+    (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
+    (IPC::Connection::kill):
+    * Platform/spi/Cocoa/ReasonSPI.h:
+    * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+    (WebKit::ProcessLauncher::platformInvalidate):
+    (WebKit::terminateWithReason):
+    
+    Source/WTF:
+    
+    * wtf/spi/darwin/XPCSPI.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-13  Alex Christensen  <[email protected]>
+
+            Revert r275172
+            https://bugs.webkit.org/show_bug.cgi?id=224499
+            <rdar://76396241>
+
+            Reviewed by Tim Horton.
+
+            * wtf/spi/darwin/XPCSPI.h:
+
 2021-04-11  Sam Weinig  <[email protected]>
 
         Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior

Modified: branches/safari-612.1.11-branch/Source/WTF/wtf/spi/darwin/XPCSPI.h (276439 => 276440)


--- branches/safari-612.1.11-branch/Source/WTF/wtf/spi/darwin/XPCSPI.h	2021-04-22 16:34:35 UTC (rev 276439)
+++ branches/safari-612.1.11-branch/Source/WTF/wtf/spi/darwin/XPCSPI.h	2021-04-22 16:35:13 UTC (rev 276440)
@@ -162,6 +162,7 @@
 
 xpc_object_t xpc_connection_copy_entitlement_value(xpc_connection_t, const char* entitlement);
 void xpc_connection_get_audit_token(xpc_connection_t, audit_token_t*);
+void xpc_connection_kill(xpc_connection_t, int);
 void xpc_connection_set_instance(xpc_connection_t, uuid_t);
 mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char*);
 void xpc_dictionary_set_mach_send(xpc_object_t, const char*, mach_port_t);

Modified: branches/safari-612.1.11-branch/Source/WebKit/ChangeLog (276439 => 276440)


--- branches/safari-612.1.11-branch/Source/WebKit/ChangeLog	2021-04-22 16:34:35 UTC (rev 276439)
+++ branches/safari-612.1.11-branch/Source/WebKit/ChangeLog	2021-04-22 16:35:13 UTC (rev 276440)
@@ -1,3 +1,52 @@
+2021-04-22  Ruben Turcios  <[email protected]>
+
+        Cherry-pick r275899. rdar://problem/76986496
+
+    Revert r275172
+    https://bugs.webkit.org/show_bug.cgi?id=224499
+    <rdar://76396241>
+    
+    Patch by Alex Christensen <[email protected]> on 2021-04-13
+    Reviewed by Tim Horton.
+    
+    Source/WebKit:
+    
+    It turns out that terminate_with_reason uses a different syscall than xpc_connection_kill in its implementation,
+    and the former is not allowed by Messages's sandbox yet.  Revert for Messages until they add it.
+    
+    * Platform/IPC/cocoa/ConnectionCocoa.mm:
+    (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
+    (IPC::Connection::kill):
+    * Platform/spi/Cocoa/ReasonSPI.h:
+    * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+    (WebKit::ProcessLauncher::platformInvalidate):
+    (WebKit::terminateWithReason):
+    
+    Source/WTF:
+    
+    * wtf/spi/darwin/XPCSPI.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-13  Alex Christensen  <[email protected]>
+
+            Revert r275172
+            https://bugs.webkit.org/show_bug.cgi?id=224499
+            <rdar://76396241>
+
+            Reviewed by Tim Horton.
+
+            It turns out that terminate_with_reason uses a different syscall than xpc_connection_kill in its implementation,
+            and the former is not allowed by Messages's sandbox yet.  Revert for Messages until they add it.
+
+            * Platform/IPC/cocoa/ConnectionCocoa.mm:
+            (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
+            (IPC::Connection::kill):
+            * Platform/spi/Cocoa/ReasonSPI.h:
+            * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+            (WebKit::ProcessLauncher::platformInvalidate):
+            (WebKit::terminateWithReason):
+
 2021-04-21  Ruben Turcios  <[email protected]>
 
         Cherry-pick r276347. rdar://problem/76986456

Modified: branches/safari-612.1.11-branch/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm (276439 => 276440)


--- branches/safari-612.1.11-branch/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm	2021-04-22 16:34:35 UTC (rev 276439)
+++ branches/safari-612.1.11-branch/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm	2021-04-22 16:35:13 UTC (rev 276440)
@@ -97,7 +97,7 @@
     
     void watchdogTimerFired()
     {
-        terminate_with_reason(xpc_connection_get_pid(m_xpcConnection.get()), OS_REASON_WEBKIT, static_cast<uint64_t>(WebKit::ReasonCode::WatchdogTimerFired), "ConnectionTerminationWatchdog::watchdogTimerFired", OS_REASON_FLAG_NO_CRASH_REPORT);
+        terminateWithReason(m_xpcConnection.get(), WebKit::ReasonCode::WatchdogTimerFired, "ConnectionTerminationWatchdog::watchdogTimerFired");
         delete this;
     }
 
@@ -608,7 +608,7 @@
 bool Connection::kill()
 {
     if (m_xpcConnection) {
-        terminate_with_reason(xpc_connection_get_pid(m_xpcConnection.get()), OS_REASON_WEBKIT, static_cast<uint64_t>(WebKit::ReasonCode::ConnectionKilled), "Connection::kill", OS_REASON_FLAG_NO_CRASH_REPORT);
+        terminateWithReason(m_xpcConnection.get(), WebKit::ReasonCode::ConnectionKilled, "Connection::kill");
         m_wasKilled = true;
         return true;
     }

Modified: branches/safari-612.1.11-branch/Source/WebKit/Platform/spi/Cocoa/ReasonSPI.h (276439 => 276440)


--- branches/safari-612.1.11-branch/Source/WebKit/Platform/spi/Cocoa/ReasonSPI.h	2021-04-22 16:34:35 UTC (rev 276439)
+++ branches/safari-612.1.11-branch/Source/WebKit/Platform/spi/Cocoa/ReasonSPI.h	2021-04-22 16:35:13 UTC (rev 276440)
@@ -60,4 +60,6 @@
     ConnectionKilled,
 };
 
+void terminateWithReason(xpc_connection_t, ReasonCode, const char* reason);
+
 }

Modified: branches/safari-612.1.11-branch/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm (276439 => 276440)


--- branches/safari-612.1.11-branch/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2021-04-22 16:34:35 UTC (rev 276439)
+++ branches/safari-612.1.11-branch/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2021-04-22 16:35:13 UTC (rev 276440)
@@ -337,8 +337,22 @@
         return;
 
     xpc_connection_cancel(m_xpcConnection.get());
-    terminate_with_reason(xpc_connection_get_pid(m_xpcConnection.get()), OS_REASON_WEBKIT, static_cast<uint64_t>(WebKit::ReasonCode::Invalidation), "ProcessLauncher::platformInvalidate", OS_REASON_FLAG_NO_CRASH_REPORT);
+    terminateWithReason(m_xpcConnection.get(), WebKit::ReasonCode::Invalidation, "ProcessLauncher::platformInvalidate");
     m_xpcConnection = nullptr;
 }
 
+void terminateWithReason(xpc_connection_t connection, ReasonCode reasonCode, const char* reason)
+{
+#if PLATFORM(MACCATALYST)
+    // FIXME: Remove this once rdar://76601307 is fixed.
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
+    xpc_connection_kill(connection, SIGKILL);
+    ALLOW_DEPRECATED_DECLARATIONS_END
+    UNUSED_PARAM(reasonCode);
+    UNUSED_PARAM(reason);
+#else
+    terminate_with_reason(xpc_connection_get_pid(connection), OS_REASON_WEBKIT, static_cast<uint64_t>(reasonCode), reason, OS_REASON_FLAG_NO_CRASH_REPORT);
+#endif
+}
+
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to