⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284697 in webkit


Ignore:
Timestamp:
Oct 22, 2021, 11:11:31 AM (5 years ago)
Author:
Alan Coon
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

Location:
branches/safari-612.3.2.0-branch
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.3.2.0-branch/LayoutTests/ChangeLog

    r284482 r284697  
     12021-10-22  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r283952. rdar://problem/84533339
     4
     5    [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
     6    https://bugs.webkit.org/show_bug.cgi?id=231537
     7    <rdar://83530643>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/WebCore:
     12   
     13    Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
     14    contains more than one endpoint URL for a given group.
     15   
     16    The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
     17    endpoint URL (since we don't currently support having several URLs for a given group).
     18    The crash was due to a use-after-move of the |group|.
     19   
     20    Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html
     21   
     22    * loader/ReportingEndpointsCache.cpp:
     23    (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):
     24   
     25    LayoutTests:
     26   
     27    Add layout test coverage.
     28   
     29    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
     30    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
     31    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
     32   
     33   
     34    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     35
     36    2021-10-11  Chris Dumez  <cdumez@apple.com>
     37
     38            [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
     39            https://bugs.webkit.org/show_bug.cgi?id=231537
     40            <rdar://83530643>
     41
     42            Reviewed by Geoffrey Garen.
     43
     44            Add layout test coverage.
     45
     46            * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
     47            * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
     48            * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
     49
    1502021-10-19  Russell Epstein  <repstein@apple.com>
    251
  • branches/safari-612.3.2.0-branch/Source/WebCore/ChangeLog

    r284620 r284697  
     12021-10-22  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r283952. rdar://problem/84533339
     4
     5    [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
     6    https://bugs.webkit.org/show_bug.cgi?id=231537
     7    <rdar://83530643>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/WebCore:
     12   
     13    Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
     14    contains more than one endpoint URL for a given group.
     15   
     16    The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
     17    endpoint URL (since we don't currently support having several URLs for a given group).
     18    The crash was due to a use-after-move of the |group|.
     19   
     20    Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html
     21   
     22    * loader/ReportingEndpointsCache.cpp:
     23    (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):
     24   
     25    LayoutTests:
     26   
     27    Add layout test coverage.
     28   
     29    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
     30    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
     31    * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
     32   
     33   
     34    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     35
     36    2021-10-11  Chris Dumez  <cdumez@apple.com>
     37
     38            [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
     39            https://bugs.webkit.org/show_bug.cgi?id=231537
     40            <rdar://83530643>
     41
     42            Reviewed by Geoffrey Garen.
     43
     44            Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
     45            contains more than one endpoint URL for a given group.
     46
     47            The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
     48            endpoint URL (since we don't currently support having several URLs for a given group).
     49            The crash was due to a use-after-move of the |group|.
     50
     51            Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html
     52
     53            * loader/ReportingEndpointsCache.cpp:
     54            (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):
     55
    1562021-10-21  Alan Coon  <alancoon@apple.com>
    257
  • branches/safari-612.3.2.0-branch/Source/WebCore/loader/ReportingEndpointsCache.cpp

    r283929 r284697  
    158158        }).iterator->value;
    159159        endpointsForOrigin.add(WTFMove(group), Endpoint(WTFMove(endpointURL), Seconds { static_cast<double>(*maxAge) }));
     160        return;
    160161    }
    161162}
Note: See TracChangeset for help on using the changeset viewer.