Title: [219924] branches/safari-604-branch/Source/WebKit
Revision
219924
Author
[email protected]
Date
2017-07-26 02:51:50 -0700 (Wed, 26 Jul 2017)

Log Message

Cherry-pick r219754. rdar://problem/33523873

Modified Paths

Diff

Modified: branches/safari-604-branch/Source/WebKit/ChangeLog (219923 => 219924)


--- branches/safari-604-branch/Source/WebKit/ChangeLog	2017-07-26 09:51:48 UTC (rev 219923)
+++ branches/safari-604-branch/Source/WebKit/ChangeLog	2017-07-26 09:51:50 UTC (rev 219924)
@@ -1,5 +1,32 @@
 2017-07-26  Jason Marcell  <[email protected]>
 
+        Cherry-pick r219754. rdar://problem/33523873
+
+    2017-07-21  Brady Eidson  <[email protected]>
+
+            Crash in many WebKit apps marking a connection invalid under Messages::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace.
+            <rdar://problem/28822272> and https://bugs.webkit.org/show_bug.cgi?id=174729
+
+            Reviewed by Tim Horton.
+
+            Previously, when a NetworkLoad generated a "CanAuthenticateAgainstProtectionSpace" event, the message went from
+            Network process -> Web process -> UI process.
+
+            In that case, MESSAGE_CHECKing the validity of the frame in WebPageProxy made sense.
+
+            In r202511 we cut the WebProcess out of this and had Networking go straight to UI process.
+
+            As a result, the message check became invalid. The Networking process cannot possible know the validity of
+            particular WebPage or WebFrame identifiers.
+
+            We simply need to validate the input in NetworkProcessProxy.
+
+            * UIProcess/Network/NetworkProcessProxy.cpp:
+            (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Validate both the page and frame ids before
+              passing the call along to the WebPageProxy. Also, if either of those validations fail, respond to the network process.
+
+2017-07-26  Jason Marcell  <[email protected]>
+
         Cherry-pick r219750. rdar://problem/33523870
 
     2017-07-21  Andy Estes  <[email protected]>

Modified: branches/safari-604-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (219923 => 219924)


--- branches/safari-604-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2017-07-26 09:51:48 UTC (rev 219923)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2017-07-26 09:51:50 UTC (rev 219924)
@@ -367,11 +367,20 @@
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
 void NetworkProcessProxy::canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, const WebCore::ProtectionSpace& protectionSpace)
 {
-    WebPageProxy* page = WebProcessProxy::webPage(pageID);
-    if (!page)
-        return;
+    // NetworkProcess state cannot asynchronously be kept in sync with these objects
+    // like we expect WebProcess <-> UIProcess state to be kept in sync.
+    // So there's no guarantee the messaged WebPageProxy or WebFrameProxy exist here in the UIProcess.
+    // We need to validate both the page and the frame up front.
+    if (auto* page = WebProcessProxy::webPage(pageID)) {
+        if (page->process().webFrame(frameID)) {
+            page->canAuthenticateAgainstProtectionSpace(loaderID, frameID, protectionSpace);
+            return;
+        }
+    }
     
-    page->canAuthenticateAgainstProtectionSpace(loaderID, frameID, protectionSpace);
+    // In the case where we will not be able to reply to this message with a client reply,
+    // we should message back a default to the Networking process.
+    send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpace(loaderID, false), 0);
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to