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

Changeset 232451 in webkit


Ignore:
Timestamp:
Jun 3, 2018, 11:28:07 AM (8 years ago)
Author:
Brent Fulgham
Message:

Make sure that the fencePort received over IPC has the expected disposition (SEND)
https://bugs.webkit.org/show_bug.cgi?id=186211
<rdar://problem/37814171>

Reviewed by Geoffrey Garen.

It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
are not checking this value.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::setTopContentInsetFenced):

  • WebProcess/cocoa/VideoFullscreenManager.mm:

(WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r232447 r232451  
     12018-06-03  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Make sure that the fencePort received over IPC has the expected disposition (SEND)
     4        https://bugs.webkit.org/show_bug.cgi?id=186211
     5        <rdar://problem/37814171>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
     10        If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
     11        drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
     12        are not checking this value.
     13
     14        * WebProcess/WebPage/WebPage.cpp:
     15        (WebKit::WebPage::setTopContentInsetFenced):
     16        * WebProcess/cocoa/VideoFullscreenManager.mm:
     17        (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
     18
    1192018-06-02  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r232427 r232451  
    26662666void WebPage::setTopContentInsetFenced(float contentInset, IPC::Attachment fencePort)
    26672667{
     2668    if (fencePort.disposition() != MACH_MSG_TYPE_MOVE_SEND) {
     2669        LOG(Layers, "WebPage::setTopContentInsetFenced(%g, fencePort) Received an invalid fence port: %d, disposition: %d", contentInset, fencePort.port(), fencePort.disposition());
     2670        return;
     2671    }
     2672
    26682673    m_drawingArea->addFence(MachSendRight::create(fencePort.port()));
    26692674
  • trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm

    r230269 r232451  
    565565    LOG(Fullscreen, "VideoFullscreenManager::setVideoLayerFrameFenced(%p, %x)", this, contextId);
    566566
     567    if (fencePort.disposition() != MACH_MSG_TYPE_MOVE_SEND) {
     568        LOG(Fullscreen, "VideoFullscreenManager::setVideoLayerFrameFenced(%p, %x) Received an invalid fence port: %d, disposition: %d", this, contextId, fencePort.port(), fencePort.disposition());
     569        return;
     570    }
     571
    567572    RefPtr<VideoFullscreenModelVideoElement> model;
    568573    RefPtr<VideoFullscreenInterfaceContext> interface;
     
    574579    }
    575580   
    576     if (interface->layerHostingContext())
    577         interface->layerHostingContext()->setFencePort(fencePort.port());
     581    if (auto* context = interface->layerHostingContext())
     582        context->setFencePort(fencePort.port());
    578583    model->setVideoLayerFrame(bounds);
    579584    deallocateSendRightSafely(fencePort.port());
Note: See TracChangeset for help on using the changeset viewer.