Changeset 246369 in webkit


Ignore:
Timestamp:
Jun 12, 2019 12:06:16 PM (5 years ago)
Author:
jiewen_tan@apple.com
Message:

REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transports.size() <= maxTransportNumber seen with two http/wpt/webauthn/public-key-credential-* tests
https://bugs.webkit.org/show_bug.cgi?id=197917
<rdar://problem/51524958>

Reviewed by Brent Fulgham.

Source/WebKit:

This is a race condition that when a new request comes in the middle between the previous one finishes and the clearStateAsync is queued in the main thread.
Therefore, when the new request starts discovery, it will still see previous request's state.

To fix this issue, clearState() will be called unconditionally for every request. And a guard is added to clearState() to prevent double clearance.

  • UIProcess/WebAuthentication/AuthenticatorManager.cpp:

(WebKit::AuthenticatorManager::makeCredential):
(WebKit::AuthenticatorManager::getAssertion):
(WebKit::AuthenticatorManager::clearState):

LayoutTests:

  • platform/mac-wk2/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246367 r246369  
     12019-06-12  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transports.size() <= maxTransportNumber seen with two http/wpt/webauthn/public-key-credential-* tests
     4        https://bugs.webkit.org/show_bug.cgi?id=197917
     5        <rdar://problem/51524958>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * platform/mac-wk2/TestExpectations:
     10
    1112019-06-12  Antti Koivisto  <antti@apple.com>
    212
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r246323 r246369  
    921921webkit.org/b/196376 storage/domstorage/localstorage/private-browsing-affects-storage.html [ Pass Failure ]
    922922
    923 webkit.org/b/197917 [ Debug ] http/wpt/webauthn/public-key-credential-create-success-hid.https.html [ Skip ]
    924 webkit.org/b/197917 [ Debug ] http/wpt/webauthn/public-key-credential-get-success-hid.https.html [ Skip ]
    925 
    926 webkit.org/b/194780 http/wpt/webauthn/public-key-credential-create-success-hid.https.html [ Pass Failure ]
    927 webkit.org/b/196377 http/wpt/webauthn/public-key-credential-get-success-hid.https.html [ Pass Failure ]
    928 
    929923webkit.org/b/196400 fast/mediastream/MediaStreamTrack-getSettings.html [ Pass Failure ]
    930924
  • trunk/Source/WebKit/ChangeLog

    r246360 r246369  
     12019-06-12  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transports.size() <= maxTransportNumber seen with two http/wpt/webauthn/public-key-credential-* tests
     4        https://bugs.webkit.org/show_bug.cgi?id=197917
     5        <rdar://problem/51524958>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        This is a race condition that when a new request comes in the middle between the previous one finishes and the clearStateAsync is queued in the main thread.
     10        Therefore, when the new request starts discovery, it will still see previous request's state.
     11
     12        To fix this issue, clearState() will be called unconditionally for every request. And a guard is added to clearState() to prevent double clearance.
     13
     14        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
     15        (WebKit::AuthenticatorManager::makeCredential):
     16        (WebKit::AuthenticatorManager::getAssertion):
     17        (WebKit::AuthenticatorManager::clearState):
     18
    1192019-06-12  Brent Fulgham  <bfulgham@apple.com>
    220
  • trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp

    r245500 r246369  
    131131    if (m_pendingCompletionHandler) {
    132132        m_pendingCompletionHandler(ExceptionData { NotAllowedError, "This request has been cancelled by a new request."_s });
    133         clearState();
    134133        m_requestTimeOutTimer.stop();
    135134    }
     135    clearState();
    136136
    137137    // 1. Save request for async operations.
     
    150150    if (m_pendingCompletionHandler) {
    151151        m_pendingCompletionHandler(ExceptionData { NotAllowedError, "This request has been cancelled by a new request."_s });
    152         clearState();
    153152        m_requestTimeOutTimer.stop();
    154153    }
     154    clearState();
    155155
    156156    // 1. Save request for async operations.
     
    175175void AuthenticatorManager::clearState()
    176176{
     177    if (m_pendingCompletionHandler)
     178        return;
    177179    m_pendingRequestData = { };
    178     ASSERT(!m_pendingCompletionHandler);
    179180    m_services.clear();
    180181    m_authenticators.clear();
Note: See TracChangeset for help on using the changeset viewer.