Title: [273400] branches/safari-611-branch/Source/WebKit
Revision
273400
Author
repst...@apple.com
Date
2021-02-24 09:10:43 -0800 (Wed, 24 Feb 2021)

Log Message

Cherry-pick r273286. rdar://problem/74622950

    [Cocoa] Send sandbox extensions for Network Extension services in load parameters
    https://bugs.webkit.org/show_bug.cgi?id=222284
    <rdar://problem/74402532>

    Reviewed by Brent Fulgham.

    Currently, sandbox extensions for Network Extension services are sent from the UI process to the WebContent process when the
    policy decision is made, but that is not soon enough in all cases. They should also be sent as part of the load parameters.

    * Shared/Cocoa/LoadParametersCocoa.mm:
    (WebKit::LoadParameters::platformEncode const):
    (WebKit::LoadParameters::platformDecode):
    * Shared/LoadParameters.h:
    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
    (WebKit::WebPageProxy::addPlatformLoadParameters):
    * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
    (WebKit::WebPage::platformDidReceiveLoadParameters):

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

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebKit/ChangeLog (273399 => 273400)


--- branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-24 17:10:40 UTC (rev 273399)
+++ branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-24 17:10:43 UTC (rev 273400)
@@ -1,5 +1,50 @@
 2021-02-23  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r273286. rdar://problem/74622950
+
+    [Cocoa] Send sandbox extensions for Network Extension services in load parameters
+    https://bugs.webkit.org/show_bug.cgi?id=222284
+    <rdar://problem/74402532>
+    
+    Reviewed by Brent Fulgham.
+    
+    Currently, sandbox extensions for Network Extension services are sent from the UI process to the WebContent process when the
+    policy decision is made, but that is not soon enough in all cases. They should also be sent as part of the load parameters.
+    
+    * Shared/Cocoa/LoadParametersCocoa.mm:
+    (WebKit::LoadParameters::platformEncode const):
+    (WebKit::LoadParameters::platformDecode):
+    * Shared/LoadParameters.h:
+    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+    (WebKit::WebPageProxy::addPlatformLoadParameters):
+    * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+    (WebKit::WebPage::platformDidReceiveLoadParameters):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-22  Per Arne Vollan  <pvol...@apple.com>
+
+            [Cocoa] Send sandbox extensions for Network Extension services in load parameters
+            https://bugs.webkit.org/show_bug.cgi?id=222284
+            <rdar://problem/74402532>
+
+            Reviewed by Brent Fulgham.
+
+            Currently, sandbox extensions for Network Extension services are sent from the UI process to the WebContent process when the
+            policy decision is made, but that is not soon enough in all cases. They should also be sent as part of the load parameters.
+
+            * Shared/Cocoa/LoadParametersCocoa.mm:
+            (WebKit::LoadParameters::platformEncode const):
+            (WebKit::LoadParameters::platformDecode):
+            * Shared/LoadParameters.h:
+            * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+            (WebKit::WebPageProxy::addPlatformLoadParameters):
+            * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+            (WebKit::WebPage::platformDidReceiveLoadParameters):
+
+2021-02-23  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r273271. rdar://problem/74622914
 
     [macOS] Crash under AuxiliaryProcess::initializeSandbox

Modified: branches/safari-611-branch/Source/WebKit/Shared/Cocoa/LoadParametersCocoa.mm (273399 => 273400)


--- branches/safari-611-branch/Source/WebKit/Shared/Cocoa/LoadParametersCocoa.mm	2021-02-24 17:10:40 UTC (rev 273399)
+++ branches/safari-611-branch/Source/WebKit/Shared/Cocoa/LoadParametersCocoa.mm	2021-02-24 17:10:43 UTC (rev 273400)
@@ -37,6 +37,7 @@
 {
     IPC::encode(encoder, dataDetectionContext.get());
 
+    encoder << networkExtensionSandboxExtensionHandles;
 #if PLATFORM(IOS)
     encoder << contentFilterExtensionHandle;
     encoder << frontboardServiceExtensionHandle;
@@ -48,6 +49,12 @@
     if (!IPC::decode(decoder, parameters.dataDetectionContext))
         return false;
 
+    Optional<SandboxExtension::HandleArray> networkExtensionSandboxExtensionHandles;
+    decoder >> networkExtensionSandboxExtensionHandles;
+    if (!networkExtensionSandboxExtensionHandles)
+        return false;
+    parameters.networkExtensionSandboxExtensionHandles = WTFMove(*networkExtensionSandboxExtensionHandles);
+    
 #if PLATFORM(IOS)
     Optional<Optional<SandboxExtension::Handle>> contentFilterExtensionHandle;
     decoder >> contentFilterExtensionHandle;

Modified: branches/safari-611-branch/Source/WebKit/Shared/LoadParameters.h (273399 => 273400)


--- branches/safari-611-branch/Source/WebKit/Shared/LoadParameters.h	2021-02-24 17:10:40 UTC (rev 273399)
+++ branches/safari-611-branch/Source/WebKit/Shared/LoadParameters.h	2021-02-24 17:10:43 UTC (rev 273400)
@@ -74,6 +74,7 @@
 
 #if PLATFORM(COCOA)
     RetainPtr<NSDictionary> dataDetectionContext;
+    SandboxExtension::HandleArray networkExtensionSandboxExtensionHandles;
 #endif
 #if PLATFORM(IOS)
     Optional<SandboxExtension::Handle> contentFilterExtensionHandle;

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (273399 => 273400)


--- branches/safari-611-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2021-02-24 17:10:40 UTC (rev 273399)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2021-02-24 17:10:43 UTC (rev 273400)
@@ -154,6 +154,8 @@
 {
     loadParameters.dataDetectionContext = m_uiClient->dataDetectionContext();
 
+    loadParameters.networkExtensionSandboxExtensionHandles = createNetworkExtensionsSandboxExtensions(process);
+    
 #if PLATFORM(IOS)
     if (!process.hasManagedSessionSandboxAccess() && [getWebFilterEvaluatorClass() isManagedSession]) {
         SandboxExtension::Handle handle;

Modified: branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (273399 => 273400)


--- branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm	2021-02-24 17:10:40 UTC (rev 273399)
+++ branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm	2021-02-24 17:10:43 UTC (rev 273400)
@@ -81,6 +81,8 @@
 
     m_dataDetectionContext = parameters.dataDetectionContext;
 
+    consumeNetworkExtensionSandboxExtensions(parameters.networkExtensionSandboxExtensionHandles);
+
 #if PLATFORM(IOS)
     if (parameters.contentFilterExtensionHandle)
         SandboxExtension::consumePermanently(*parameters.contentFilterExtensionHandle);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to