Title: [256234] trunk
Revision
256234
Author
[email protected]
Date
2020-02-10 17:46:03 -0800 (Mon, 10 Feb 2020)

Log Message

[iOS] Crash when granting access to asset services
https://bugs.webkit.org/show_bug.cgi?id=207520
Source/WebKit:

<rdar://problem/59321848>

Reviewed by Brent Fulgham.

Pass correct handle when calling SandboxExtension::createHandleForMachLookup.

API test: WebKit.GrantAccessToMobileAssetsCrash

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::grantAccessToAssetServices):

Tools:

Reviewed by Brent Fulgham.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/GrantAccessToMobileAssets.mm: Added.
(TEST):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (256233 => 256234)


--- trunk/Source/WebKit/ChangeLog	2020-02-11 01:13:01 UTC (rev 256233)
+++ trunk/Source/WebKit/ChangeLog	2020-02-11 01:46:03 UTC (rev 256234)
@@ -1,3 +1,18 @@
+2020-02-10  Per Arne Vollan  <[email protected]>
+
+        [iOS] Crash when granting access to asset services
+        https://bugs.webkit.org/show_bug.cgi?id=207520
+        <rdar://problem/59321848>
+
+        Reviewed by Brent Fulgham.
+
+        Pass correct handle when calling SandboxExtension::createHandleForMachLookup.
+
+        API test: WebKit.GrantAccessToMobileAssetsCrash
+
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::grantAccessToAssetServices):
+
 2020-02-10  David Kilzer  <[email protected]>
 
         WebKit::WebProcessPool::initializeClassesForParameterCoding() should keep a copy of CString

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (256233 => 256234)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2020-02-11 01:13:01 UTC (rev 256233)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2020-02-11 01:46:03 UTC (rev 256234)
@@ -1519,7 +1519,7 @@
 {
     SandboxExtension::Handle mobileAssetHandle, mobileAssetHandleV2;
     SandboxExtension::createHandleForMachLookup("com.apple.mobileassetd", WTF::nullopt, mobileAssetHandle);
-    SandboxExtension::createHandleForMachLookup("com.apple.mobileassetd.v2", WTF::nullopt, mobileAssetHandle);
+    SandboxExtension::createHandleForMachLookup("com.apple.mobileassetd.v2", WTF::nullopt, mobileAssetHandleV2);
     process().send(Messages::WebProcess::GrantAccessToAssetServices(mobileAssetHandle, mobileAssetHandleV2), 0);
 }
 

Modified: trunk/Tools/ChangeLog (256233 => 256234)


--- trunk/Tools/ChangeLog	2020-02-11 01:13:01 UTC (rev 256233)
+++ trunk/Tools/ChangeLog	2020-02-11 01:46:03 UTC (rev 256234)
@@ -1,3 +1,14 @@
+2020-02-10  Per Arne Vollan  <[email protected]>
+
+        [iOS] Crash when granting access to asset services
+        https://bugs.webkit.org/show_bug.cgi?id=207520
+
+        Reviewed by Brent Fulgham.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit/GrantAccessToMobileAssets.mm: Added.
+        (TEST):
+
 2020-02-10  Chris Dumez  <[email protected]>
 
         [DRT] InternalSettingsGenerated::resetToConsistentState() may override TestOptions

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (256233 => 256234)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2020-02-11 01:13:01 UTC (rev 256233)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2020-02-11 01:46:03 UTC (rev 256234)
@@ -996,6 +996,7 @@
 		E38A0D351FD50CC300E98C8B /* Threading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38A0D341FD50CBC00E98C8B /* Threading.cpp */; };
 		E38D65CA23A45FAA0063D69A /* PackedRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38D65C823A45FA90063D69A /* PackedRef.cpp */; };
 		E38D65CB23A45FAA0063D69A /* PackedRefPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38D65C923A45FA90063D69A /* PackedRefPtr.cpp */; };
+		E394AE6F23F2303E005B4936 /* GrantAccessToMobileAssets.mm in Sources */ = {isa = PBXBuildFile; fileRef = E394AE6E23F2303E005B4936 /* GrantAccessToMobileAssets.mm */; };
 		E3A1E77F21B25B39008C6007 /* URLParserTextEncoding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3A1E77E21B25B39008C6007 /* URLParserTextEncoding.cpp */; };
 		E3A1E78221B25B7A008C6007 /* URL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3A1E78021B25B79008C6007 /* URL.cpp */; };
 		E3A1E78521B25B91008C6007 /* URLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3A1E78421B25B91008C6007 /* URLParser.cpp */; };
@@ -2569,6 +2570,7 @@
 		E38A0D341FD50CBC00E98C8B /* Threading.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Threading.cpp; sourceTree = "<group>"; };
 		E38D65C823A45FA90063D69A /* PackedRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PackedRef.cpp; sourceTree = "<group>"; };
 		E38D65C923A45FA90063D69A /* PackedRefPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PackedRefPtr.cpp; sourceTree = "<group>"; };
+		E394AE6E23F2303E005B4936 /* GrantAccessToMobileAssets.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GrantAccessToMobileAssets.mm; sourceTree = "<group>"; };
 		E3953F951F2CF32100A76A2E /* Signals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Signals.cpp; sourceTree = "<group>"; };
 		E398BC0F2041C76300387136 /* UniqueArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueArray.cpp; sourceTree = "<group>"; };
 		E3A1E77E21B25B39008C6007 /* URLParserTextEncoding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLParserTextEncoding.cpp; sourceTree = "<group>"; };
@@ -2867,6 +2869,7 @@
 			children = (
 				C15CBB2F23F1FF1A00300CC7 /* BacklightLevelNotification.mm */,
 				C1692DC923D10DAE006E88F7 /* Battery.mm */,
+				E394AE6E23F2303E005B4936 /* GrantAccessToMobileAssets.mm */,
 				C145CC0B23DA5A0F003A5EEB /* MimeTypes.mm */,
 				0F139E751A423A5300F590F5 /* WeakObjCPtr.mm */,
 			);
@@ -4787,6 +4790,7 @@
 				41157237234B240C0050A1D1 /* GetUserMedia.mm in Sources */,
 				07CE1CF31F06A7E000BF89F5 /* GetUserMediaNavigation.mm in Sources */,
 				07E499911F9E56DF002F1EF3 /* GetUserMediaReprompt.mm in Sources */,
+				E394AE6F23F2303E005B4936 /* GrantAccessToMobileAssets.mm in Sources */,
 				8E4A85371E1D1AB200F53B0F /* GridPosition.cpp in Sources */,
 				7CCE7EFA1A411AE600447C4C /* HitTestResultNodeHandle.cpp in Sources */,
 				7CCE7EC11A411A7E00447C4C /* HTMLCollectionNamedItem.mm in Sources */,

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit/GrantAccessToMobileAssets.mm (0 => 256234)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/GrantAccessToMobileAssets.mm	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/GrantAccessToMobileAssets.mm	2020-02-11 01:46:03 UTC (rev 256234)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if PLATFORM(IOS)
+
+#import "PlatformUtilities.h"
+#import "TestWKWebView.h"
+#import <WebKit/WKWebViewPrivate.h>
+
+TEST(WebKit, GrantAccessToMobileAssetsCrash)
+{
+    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300)]);
+
+    [webView _grantAccessToAssetServices];
+    [webView _revokeAccessToAssetServices];
+}
+
+#endif // PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to