Changeset 241352 in webkit


Ignore:
Timestamp:
Feb 13, 2019 1:01:49 AM (5 years ago)
Author:
rniwa@webkit.org
Message:

Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=194582

Reviewed by Antti Koivisto.

Source/WebCore:

Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
from the non-generated identifier being sent to us as it was the case in this failure.

  • loader/PolicyChecker.cpp:

(WebCore::PolicyCheckIdentifier::isValidFor):

Source/WebKit:

The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback
with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier
is invalid in that case, and we should be using requestIdentifier instead.

Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r241350 r241352  
     12019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
     4        https://bugs.webkit.org/show_bug.cgi?id=194582
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
     9        from the non-generated identifier being sent to us as it was the case in this failure.
     10
     11        * loader/PolicyChecker.cpp:
     12        (WebCore::PolicyCheckIdentifier::isValidFor):
     13
    1142019-02-13  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/WebCore/loader/PolicyChecker.cpp

    r240909 r241352  
    8181bool PolicyCheckIdentifier::isValidFor(PolicyCheckIdentifier expectedIdentifier)
    8282{
     83    RELEASE_ASSERT_WITH_MESSAGE(m_policyCheck, "Received 0 as the policy check identifier");
    8384    RELEASE_ASSERT_WITH_MESSAGE(m_process == expectedIdentifier.m_process, "Received a policy check response for a wrong process");
    84     RELEASE_ASSERT_WITH_MESSAGE(m_policyCheck, "Received 0 as the policy check identifier");
    8585    RELEASE_ASSERT_WITH_MESSAGE(m_policyCheck <= expectedIdentifier.m_policyCheck, "Received a policy check response from the future");
    8686    return m_policyCheck == expectedIdentifier.m_policyCheck;
  • trunk/Source/WebKit/ChangeLog

    r241351 r241352  
     12019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
     4        https://bugs.webkit.org/show_bug.cgi?id=194582
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback
     9        with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier
     10        is invalid in that case, and we should be using requestIdentifier instead.
     11
     12        Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case.
     13
     14        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     15        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
     16
    1172019-02-13  Benjamin Poulain  <benjamin@webkit.org>
    218
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r240909 r241352  
    912912            IPC::FormDataReference { request.httpBody() }, redirectResponse, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())),
    913913            Messages::WebPageProxy::DecidePolicyForNavigationActionSync::Reply(responseIdentifier, policyAction, newNavigationID, downloadID, websitePolicies))) {
    914             m_frame->didReceivePolicyDecision(listenerID, responseIdentifier, PolicyAction::Ignore, 0, { }, { });
     914            m_frame->didReceivePolicyDecision(listenerID, requestIdentifier, PolicyAction::Ignore, 0, { }, { });
    915915            return;
    916916        }
Note: See TracChangeset for help on using the changeset viewer.