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

Changeset 248959 in webkit


Ignore:
Timestamp:
Aug 21, 2019, 1:02:35 PM (7 years ago)
Author:
Chris Dumez
Message:

Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
https://bugs.webkit.org/show_bug.cgi?id=200986
<rdar://problem/32850192>

Reviewed by Brent Fulgham.

Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
does not take care of this for you, despite its name (the createCrossThreadTask() function does though).

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r248957 r248959  
     12019-08-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
     4        https://bugs.webkit.org/show_bug.cgi?id=200986
     5        <rdar://problem/32850192>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
     10        The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
     11        does not take care of this for you, despite its name (the createCrossThreadTask() function does though).
     12
     13        * NetworkProcess/NetworkProcess.cpp:
     14        (WebKit::NetworkProcess::fetchWebsiteData):
     15        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
     16        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
     17
    1182019-08-21  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r248956 r248959  
    13611361    if (!path.isEmpty() && websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases)) {
    13621362        // FIXME: Pick the right database store based on the session ID.
    1363         postStorageTask(CrossThreadTask([this, callbackAggregator = callbackAggregator.copyRef(), path = WTFMove(path)]() mutable {
     1363        postStorageTask(CrossThreadTask([this, callbackAggregator = callbackAggregator.copyRef(), path = crossThreadCopy(path)]() mutable {
    13641364            RunLoop::main().dispatch([callbackAggregator = WTFMove(callbackAggregator), securityOrigins = indexedDatabaseOrigins(path)] {
    13651365                for (const auto& securityOrigin : securityOrigins)
     
    17331733    if (!path.isEmpty() && websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases)) {
    17341734        // FIXME: Pick the right database store based on the session ID.
    1735         postStorageTask(CrossThreadTask([this, sessionID, callbackAggregator = callbackAggregator.copyRef(), path = WTFMove(path), domainsToDeleteAllButCookiesFor]() mutable {
    1736             RunLoop::main().dispatch([this, sessionID, domainsToDeleteAllButCookiesFor = crossThreadCopy(domainsToDeleteAllButCookiesFor), callbackAggregator = callbackAggregator.copyRef(), securityOrigins = indexedDatabaseOrigins(path)] {
     1735        postStorageTask(CrossThreadTask([this, sessionID, callbackAggregator = callbackAggregator.copyRef(), path = crossThreadCopy(path), domainsToDeleteAllButCookiesFor = crossThreadCopy(domainsToDeleteAllButCookiesFor)]() mutable {
     1736            RunLoop::main().dispatch([this, sessionID, domainsToDeleteAllButCookiesFor = WTFMove(domainsToDeleteAllButCookiesFor), callbackAggregator = callbackAggregator.copyRef(), securityOrigins = indexedDatabaseOrigins(path)] {
    17371737                Vector<SecurityOriginData> entriesToDelete;
    17381738                for (const auto& securityOrigin : securityOrigins) {
     
    18791879    if (!path.isEmpty() && websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases)) {
    18801880        // FIXME: Pick the right database store based on the session ID.
    1881         postStorageTask(CrossThreadTask([this, callbackAggregator = callbackAggregator.copyRef(), path = WTFMove(path)]() mutable {
     1881        postStorageTask(CrossThreadTask([this, callbackAggregator = callbackAggregator.copyRef(), path = crossThreadCopy(path)]() mutable {
    18821882            RunLoop::main().dispatch([callbackAggregator = callbackAggregator.copyRef(), securityOrigins = indexedDatabaseOrigins(path)] {
    18831883                for (const auto& securityOrigin : securityOrigins)
Note: See TracChangeset for help on using the changeset viewer.