Commit fb81dc00 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Add a message size check to channel-associated interfaces

Adds a message size check to the case where
ChannelAssociatedGroupController must post a task to the IO thread
before sending a message. This will allow us to extract useful stack
information from such message size violations.

Bug: 840388
Change-Id: I6861252dcc3451d4551c84e7e389566e8c62dced
Reviewed-on: https://chromium-review.googlesource.com/1059587Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558849}
parent 3ae67cfc
......@@ -28,6 +28,7 @@
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/memory_dump_provider.h"
#include "ipc/ipc_channel.h"
#include "mojo/public/cpp/bindings/associated_group.h"
#include "mojo/public/cpp/bindings/associated_group_controller.h"
#include "mojo/public/cpp/bindings/connector.h"
......@@ -649,6 +650,10 @@ class ChannelAssociatedGroupController
}
return connector_->Accept(message);
} else {
// Do a message size check here so we don't lose valuable stack
// information to the task scheduler.
CHECK_LE(message->data_num_bytes(), Channel::kMaximumMessageSize);
// We always post tasks to the master endpoint thread when called from
// other threads in order to simulate IPC::ChannelProxy::Send behavior.
task_runner_->PostTask(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment