summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_proxy.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-15 23:06:07 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-15 23:06:07 +0000
commitef2f6ba19e773ea58b8d6b26ea80bcf6c357ea7d (patch)
treef18f441d80b4b05ad3e6bcde476fd6461e00742e /ipc/ipc_channel_proxy.cc
parent5a05b1de6bb31e66f570b320b6b507e0e2d5798b (diff)
downloadchromium_src-ef2f6ba19e773ea58b8d6b26ea80bcf6c357ea7d.zip
chromium_src-ef2f6ba19e773ea58b8d6b26ea80bcf6c357ea7d.tar.gz
chromium_src-ef2f6ba19e773ea58b8d6b26ea80bcf6c357ea7d.tar.bz2
Ensure that any IPC sent from a child process that couldn't be deserialized causes that process to be killed.
Today we do this only for a subset of IPCs and not all process types. R=jar@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/283313002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_proxy.cc')
-rw-r--r--ipc/ipc_channel_proxy.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 5c4d743..7e32018 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -64,6 +64,10 @@ bool ChannelProxy::Context::TryFilters(const Message& message) {
#endif
if (message_filter_router_->TryFilters(message)) {
+ if (message.dispatch_error()) {
+ listener_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&Context::OnDispatchBadMessage, this, message));
+ }
#ifdef IPC_MESSAGE_LOG_ENABLED
if (logger->Enabled())
logger->OnPostDispatchMessage(message, channel_id_);
@@ -267,6 +271,8 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
#endif
listener_->OnMessageReceived(message);
+ if (message.dispatch_error())
+ listener_->OnBadMessageReceived(message);
#ifdef IPC_MESSAGE_LOG_ENABLED
if (logger->Enabled())
@@ -290,6 +296,12 @@ void ChannelProxy::Context::OnDispatchError() {
listener_->OnChannelError();
}
+// Called on the listener's thread
+void ChannelProxy::Context::OnDispatchBadMessage(const Message& message) {
+ if (listener_)
+ listener_->OnBadMessageReceived(message);
+}
+
//-----------------------------------------------------------------------------
ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,