Title: [262802] trunk/Source
Revision
262802
Author
[email protected]
Date
2020-06-09 12:08:20 -0700 (Tue, 09 Jun 2020)

Log Message

REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file
https://bugs.webkit.org/show_bug.cgi?id=212976
<rdar://problem/64033186>

Reviewed by Tim Horton.

Source/WebKit:

On Mac Catalyst, we attempt to take a sandbox extension for `com.apple.frontboard.systemappservices` when
uploading a file; this service does not exist in Catalyst, and we consequently encounter a release assertion
under `WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon`.

Fix this by introducing `HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)`, and using it to guard codepaths that attempt to
grab a mach extension to this service. (As a followup, we should consider adopting this in other places that
currently reference `com.apple.frontboard.systemappservices`).

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):

Source/WTF:

Add `HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)`.

* wtf/PlatformHave.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (262801 => 262802)


--- trunk/Source/WTF/ChangeLog	2020-06-09 18:53:29 UTC (rev 262801)
+++ trunk/Source/WTF/ChangeLog	2020-06-09 19:08:20 UTC (rev 262802)
@@ -1,3 +1,15 @@
+2020-06-09  Wenson Hsieh  <[email protected]>
+
+        REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file
+        https://bugs.webkit.org/show_bug.cgi?id=212976
+        <rdar://problem/64033186>
+
+        Reviewed by Tim Horton.
+
+        Add `HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)`.
+
+        * wtf/PlatformHave.h:
+
 2020-06-08  Chris Fleizach  <[email protected]>
 
         HAVE(ACCESSIBILITY_BUNDLES_PATH) is defined in terms of PLATFORM(IOS_FAMILY) but only checks the version of __IPHONE_OS_VERSION_MIN_REQUIRED

Modified: trunk/Source/WTF/wtf/PlatformHave.h (262801 => 262802)


--- trunk/Source/WTF/wtf/PlatformHave.h	2020-06-09 18:53:29 UTC (rev 262801)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2020-06-09 19:08:20 UTC (rev 262802)
@@ -651,3 +651,7 @@
     || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
 #define HAVE_CF_PREFS_SET_READ_ONLY 1
 #endif
+
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
+#define HAVE_FRONTBOARD_SYSTEM_APP_SERVICES 1
+#endif

Modified: trunk/Source/WebKit/ChangeLog (262801 => 262802)


--- trunk/Source/WebKit/ChangeLog	2020-06-09 18:53:29 UTC (rev 262801)
+++ trunk/Source/WebKit/ChangeLog	2020-06-09 19:08:20 UTC (rev 262802)
@@ -1,3 +1,24 @@
+2020-06-09  Wenson Hsieh  <[email protected]>
+
+        REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file
+        https://bugs.webkit.org/show_bug.cgi?id=212976
+        <rdar://problem/64033186>
+
+        Reviewed by Tim Horton.
+
+        On Mac Catalyst, we attempt to take a sandbox extension for `com.apple.frontboard.systemappservices` when
+        uploading a file; this service does not exist in Catalyst, and we consequently encounter a release assertion
+        under `WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon`.
+
+        Fix this by introducing `HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)`, and using it to guard codepaths that attempt to
+        grab a mach extension to this service. (As a followup, we should consider adopting this in other places that
+        currently reference `com.apple.frontboard.systemappservices`).
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
+
 2020-06-09  Jonathan Bedard  <[email protected]>
 
         WebKit: Support watchOS and tvOS in xcconfigs

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (262801 => 262802)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-06-09 18:53:29 UTC (rev 262801)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-06-09 19:08:20 UTC (rev 262802)
@@ -6661,7 +6661,9 @@
 #endif
 
     SandboxExtension::Handle frontboardServicesSandboxExtension, iconServicesSandboxExtension;
+#if HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)
     SandboxExtension::createHandleForMachLookup("com.apple.frontboard.systemappservices", WTF::nullopt, frontboardServicesSandboxExtension);
+#endif
     SandboxExtension::createHandleForMachLookup("com.apple.iconservices", WTF::nullopt, iconServicesSandboxExtension);
 
     send(Messages::WebPage::DidChooseFilesForOpenPanelWithDisplayStringAndIcon(fileURLs, displayString, iconData ? iconData->dataReference() : IPC::DataReference(), frontboardServicesSandboxExtension, iconServicesSandboxExtension));

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (262801 => 262802)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-06-09 18:53:29 UTC (rev 262801)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-06-09 19:08:20 UTC (rev 262802)
@@ -4240,11 +4240,14 @@
     if (!m_activeOpenPanelResultListener)
         return;
 
+#if HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)
     auto frontboardServicesSandboxExtension = SandboxExtension::create(WTFMove(frontboardServicesSandboxExtensionHandle));
     if (frontboardServicesSandboxExtension) {
         bool consumed = frontboardServicesSandboxExtension->consume();
         ASSERT_UNUSED(consumed, consumed);
     }
+    RELEASE_ASSERT(!sandbox_check(getpid(), "mach-lookup", static_cast<enum sandbox_filter_type>(SANDBOX_FILTER_GLOBAL_NAME | SANDBOX_CHECK_NO_REPORT), "com.apple.frontboard.systemappservices"));
+#endif
 
     auto iconServicesSandboxExtension = SandboxExtension::create(WTFMove(iconServicesSandboxExtensionHandle));
     if (iconServicesSandboxExtension) {
@@ -4251,8 +4254,6 @@
         bool consumed = iconServicesSandboxExtension->consume();
         ASSERT_UNUSED(consumed, consumed);
     }
-
-    RELEASE_ASSERT(!sandbox_check(getpid(), "mach-lookup", static_cast<enum sandbox_filter_type>(SANDBOX_FILTER_GLOBAL_NAME | SANDBOX_CHECK_NO_REPORT), "com.apple.frontboard.systemappservices"));
     RELEASE_ASSERT(!sandbox_check(getpid(), "mach-lookup", static_cast<enum sandbox_filter_type>(SANDBOX_FILTER_GLOBAL_NAME | SANDBOX_CHECK_NO_REPORT), "com.apple.iconservices"));
 
     RefPtr<Icon> icon;
@@ -4266,10 +4267,12 @@
     m_activeOpenPanelResultListener->didChooseFilesWithDisplayStringAndIcon(files, displayString, icon.get());
     m_activeOpenPanelResultListener = nullptr;
 
+#if HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)
     if (frontboardServicesSandboxExtension) {
         bool revoked = frontboardServicesSandboxExtension->revoke();
         ASSERT_UNUSED(revoked, revoked);
     }
+#endif
 
     if (iconServicesSandboxExtension) {
         bool revoked = iconServicesSandboxExtension->revoke();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to