Changeset 209995 in webkit


Ignore:
Timestamp:
Dec 19, 2016 1:27:15 PM (7 years ago)
Author:
andersca@apple.com
Message:

REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
https://bugs.webkit.org/show_bug.cgi?id=165817
rdar://problem/29626731

Reviewed by Dan Bernstein.

If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.

Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.

  • WebProcess/WebPage/WebInspector.cpp:

(WebKit::WebInspector::openFrontendConnection):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r209975 r209995  
     12016-12-19  Anders Carlsson  <andersca@apple.com>
     2
     3        REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
     4        https://bugs.webkit.org/show_bug.cgi?id=165817
     5        rdar://problem/29626731
     6
     7        Reviewed by Dan Bernstein.
     8
     9        If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
     10        and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.
     11       
     12        Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.
     13
     14        * WebProcess/WebPage/WebInspector.cpp:
     15        (WebKit::WebInspector::openFrontendConnection):
     16
    1172016-12-18  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp

    r207928 r209995  
    8080    mach_port_t listeningPort;
    8181    mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
     82    mach_port_insert_right(mach_task_self(), listeningPort, listeningPort, MACH_MSG_TYPE_MAKE_SEND);
    8283
    8384    IPC::Connection::Identifier connectionIdentifier(listeningPort);
    84     IPC::Attachment connectionClientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
     85    IPC::Attachment connectionClientPort(listeningPort, MACH_MSG_TYPE_MOVE_SEND);
     86
    8587#else
    8688    notImplemented();
Note: See TracChangeset for help on using the changeset viewer.