[webkit-changes] [WebKit/WebKit] da8b5e: SHOULD NEVER BE REACHED in IPC::StreamClientConnec...

Kimmo Kinnunen noreply at github.com
Thu Jan 19 00:02:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: da8b5ed3e46e77b73d5eea1506ca091774d6c580
      https://github.com/WebKit/WebKit/commit/da8b5ed3e46e77b73d5eea1506ca091774d6c580
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-01-19 (Thu, 19 Jan 2023)

  Changed paths:
    M LayoutTests/ipc/stream-buffer-read-write.html
    M Source/WebKit/Platform/IPC/StreamClientConnectionBuffer.h
    M Source/WebKit/Platform/IPC/StreamConnectionEncoder.h
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/IPC/StreamConnectionBufferTests.cpp
    A Tools/TestWebKitAPI/Tests/IPC/StreamConnectionEncoderTests.cpp
    M Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp

  Log Message:
  -----------
  SHOULD NEVER BE REACHED in IPC::StreamClientConnection::trySendDestinationIDIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=250318
rdar://104027243

Reviewed by Matt Woodrow and Simon Fraser.

The stream IPC write and read both select the next offset
based on if minimumMessageSize can fit to the allocation. If it
does not fit between current position and buffer end, the index
is wrapped to 0.

The minimumMessageSize is currently expected to match the
SetStreamDestinationID message. The message size can vary between
10 and 16 bytes, since the uint64_t in it is encoded with uint64_t
alignment, 8 bytes.

If the SetStreamDestinationID did not fit to the allocation,
the send was returned as failed. The expectation was that callers
would mark the context lost. This doesn't happen for normal rendering.
Thus if this would happen for example at DisplayListRecorder creation
message, the client would continue sending messages to destinations
that did not exist at the server. In these cases the server does not
know how to parse the messages, and the expectation is that these
cases happen when the connection is being closed.

Adjust the minimumMessageSize to 16 for now. Add tests testing that
the encoding succeeds at any expected offset.

* Source/WebKit/Platform/IPC/StreamClientConnectionBuffer.h:
(IPC::StreamClientConnectionBuffer::StreamClientConnectionBuffer):
* Source/WebKit/Platform/IPC/StreamConnectionEncoder.h:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionBufferTests.cpp:
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp:
(TestWebKitAPI::TEST_P):

Canonical link: https://commits.webkit.org/259069@main




More information about the webkit-changes mailing list