Changeset 198387 in webkit


Ignore:
Timestamp:
Mar 18, 2016, 12:23:10 AM (9 years ago)
Author:
Antti Koivisto
Message:

Data URL DecodeTask may get deleted outside main thread
https://bugs.webkit.org/show_bug.cgi?id=155584
rdar://problem/24492104

Reviewed by Darin Adler.

This is unsafe as it owns strings and other types that are only safe to delete in the main thread.

There is a race between deref in dispatch() and deref in timerFired(). If the timer fires before dispatch()
exits the implicit deref will trigger deletion of DecodingResultDispatcher in the dispatching thread.

(WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):

Fix by clearing m_decodeTask when the timer fires.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r198383 r198387  
     12016-03-17  Antti Koivisto  <antti@apple.com>
     2
     3        Data URL DecodeTask may get deleted outside main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=155584
     5        rdar://problem/24492104
     6
     7        Reviewed by Darin Adler.
     8
     9        This is unsafe as it owns strings and other types that are only safe to delete in the main thread.
     10
     11        There is a race between deref in dispatch() and deref in timerFired(). If the timer fires before dispatch()
     12        exits the implicit deref will trigger deletion of DecodingResultDispatcher in the dispatching thread.
     13
     14        (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):
     15
     16            Fix by clearing m_decodeTask when the timer fires.
     17
    1182016-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebCore/platform/network/DataURLDecoder.cpp

    r198371 r198387  
    8686        else
    8787            m_decodeTask->completionHandler({ });
     88
     89        // Ensure DecodeTask gets deleted in the main thread.
     90        m_decodeTask = nullptr;
    8891
    8992        deref();
Note: See TracChangeset for help on using the changeset viewer.