Title: [284697] branches/safari-612.3.2.0-branch
Revision
284697
Author
[email protected]
Date
2021-10-22 11:11:31 -0700 (Fri, 22 Oct 2021)

Log Message

Cherry-pick r283952. rdar://problem/84533339

    [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
    https://bugs.webkit.org/show_bug.cgi?id=231537
    <rdar://83530643>

    Reviewed by Geoffrey Garen.

    Source/WebCore:

    Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
    contains more than one endpoint URL for a given group.

    The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
    endpoint URL (since we don't currently support having several URLs for a given group).
    The crash was due to a use-after-move of the |group|.

    Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html

    * loader/ReportingEndpointsCache.cpp:
    (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):

    LayoutTests:

    Add layout test coverage.

    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-612.3.2.0-branch/LayoutTests/ChangeLog (284696 => 284697)


--- branches/safari-612.3.2.0-branch/LayoutTests/ChangeLog	2021-10-22 18:09:23 UTC (rev 284696)
+++ branches/safari-612.3.2.0-branch/LayoutTests/ChangeLog	2021-10-22 18:11:31 UTC (rev 284697)
@@ -1,3 +1,52 @@
+2021-10-22  Alan Coon  <[email protected]>
+
+        Cherry-pick r283952. rdar://problem/84533339
+
+    [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
+    https://bugs.webkit.org/show_bug.cgi?id=231537
+    <rdar://83530643>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Source/WebCore:
+    
+    Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
+    contains more than one endpoint URL for a given group.
+    
+    The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
+    endpoint URL (since we don't currently support having several URLs for a given group).
+    The crash was due to a use-after-move of the |group|.
+    
+    Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html
+    
+    * loader/ReportingEndpointsCache.cpp:
+    (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):
+    
+    LayoutTests:
+    
+    Add layout test coverage.
+    
+    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
+    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
+    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-11  Chris Dumez  <[email protected]>
+
+            [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
+            https://bugs.webkit.org/show_bug.cgi?id=231537
+            <rdar://83530643>
+
+            Reviewed by Geoffrey Garen.
+
+            Add layout test coverage.
+
+            * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
+            * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
+            * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
+
 2021-10-19  Russell Epstein  <[email protected]>
 
         Revert r283931. rdar://problem/83953710

Added: branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt (0 => 284697)


--- branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt	                        (rev 0)
+++ branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt	2021-10-22 18:11:31 UTC (rev 284697)
@@ -0,0 +1,5 @@
+This test passes if it doesn't crash
+
+
+PASS report-to-multiple-endpoints
+

Added: branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html (0 => 284697)


--- branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html	                        (rev 0)
+++ branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html	2021-10-22 18:11:31 UTC (rev 284697)
@@ -0,0 +1,8 @@
+<script src=""
+<script src=""
+<p>This test passes if it doesn't crash</p>
+<script>
+async_test(t => {
+    t.done();
+});
+</script>

Added: branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers (0 => 284697)


--- branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers	                        (rev 0)
+++ branches/safari-612.3.2.0-branch/LayoutTests/http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers	2021-10-22 18:11:31 UTC (rev 284697)
@@ -0,0 +1,3 @@
+Cross-Origin-Opener-Policy: same-origin-allow-popups; report-to="coop-report-endpoint"
+Cross-Origin-Embedder-Policy: require-corp
+report-to: { "group": "coop-report-endpoint", "max_age": 10886400, "endpoints": [{ "url": "/reporting/resources/report.py?endpoint=coop-report-endpoint" }] }, { "group": "coop-report-only-endpoint", "max_age": 10886400, "endpoints": [{ "url": "/reporting/resources/report.py?endpoint=coop-report-only-endpoint" }, { "url": "/reporting/resources/report.py?endpoint=coop-report-only-endpoint2" }]}

Modified: branches/safari-612.3.2.0-branch/Source/WebCore/ChangeLog (284696 => 284697)


--- branches/safari-612.3.2.0-branch/Source/WebCore/ChangeLog	2021-10-22 18:09:23 UTC (rev 284696)
+++ branches/safari-612.3.2.0-branch/Source/WebCore/ChangeLog	2021-10-22 18:11:31 UTC (rev 284697)
@@ -1,3 +1,58 @@
+2021-10-22  Alan Coon  <[email protected]>
+
+        Cherry-pick r283952. rdar://problem/84533339
+
+    [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
+    https://bugs.webkit.org/show_bug.cgi?id=231537
+    <rdar://83530643>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Source/WebCore:
+    
+    Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
+    contains more than one endpoint URL for a given group.
+    
+    The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
+    endpoint URL (since we don't currently support having several URLs for a given group).
+    The crash was due to a use-after-move of the |group|.
+    
+    Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html
+    
+    * loader/ReportingEndpointsCache.cpp:
+    (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):
+    
+    LayoutTests:
+    
+    Add layout test coverage.
+    
+    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
+    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
+    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-11  Chris Dumez  <[email protected]>
+
+            [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
+            https://bugs.webkit.org/show_bug.cgi?id=231537
+            <rdar://83530643>
+
+            Reviewed by Geoffrey Garen.
+
+            Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
+            contains more than one endpoint URL for a given group.
+
+            The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
+            endpoint URL (since we don't currently support having several URLs for a given group).
+            The crash was due to a use-after-move of the |group|.
+
+            Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html
+
+            * loader/ReportingEndpointsCache.cpp:
+            (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):
+
 2021-10-21  Alan Coon  <[email protected]>
 
         Cherry-pick r284201. rdar://problem/83670287

Modified: branches/safari-612.3.2.0-branch/Source/WebCore/loader/ReportingEndpointsCache.cpp (284696 => 284697)


--- branches/safari-612.3.2.0-branch/Source/WebCore/loader/ReportingEndpointsCache.cpp	2021-10-22 18:09:23 UTC (rev 284696)
+++ branches/safari-612.3.2.0-branch/Source/WebCore/loader/ReportingEndpointsCache.cpp	2021-10-22 18:11:31 UTC (rev 284697)
@@ -157,6 +157,7 @@
             return HashMap<String, Endpoint> { };
         }).iterator->value;
         endpointsForOrigin.add(WTFMove(group), Endpoint(WTFMove(endpointURL), Seconds { static_cast<double>(*maxAge) }));
+        return;
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to