summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 22:46:38 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 22:46:38 +0000
commitf5f0f40b89818e77a00a430c671f00465f71c87d (patch)
tree861f0bf191cc53891bccc9b306fe0972f31cd48c
parentd664bc3c11093e0eb5c7c4b4fe0d47d86baed958 (diff)
downloadchromium_src-f5f0f40b89818e77a00a430c671f00465f71c87d.zip
chromium_src-f5f0f40b89818e77a00a430c671f00465f71c87d.tar.gz
chromium_src-f5f0f40b89818e77a00a430c671f00465f71c87d.tar.bz2
Crash the network or desktop process when an unknown IPC message is received.
When an unknown IPC message is received by the daemon, the sender process is asked to terminate itself to generate a crash dump. When such a message is received by either network or desktop process the receiver CHECK(). The crashed process will be automatically restarted by the daemon (applying exponential backoff as needed). BUG=179215 Review URL: https://codereview.chromium.org/12390027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186274 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/host/daemon_process.cc6
-rw-r--r--remoting/host/desktop_process.cc2
-rw-r--r--remoting/host/desktop_session_agent.cc7
-rw-r--r--remoting/host/desktop_session_proxy.cc1
-rw-r--r--remoting/host/desktop_session_win.cc6
-rw-r--r--remoting/host/remoting_me2me_host.cc3
6 files changed, 19 insertions, 6 deletions
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc
index 98c94bb..c82c96e 100644
--- a/remoting/host/daemon_process.cc
+++ b/remoting/host/daemon_process.cc
@@ -98,6 +98,12 @@ bool DaemonProcess::OnMessageReceived(const IPC::Message& message) {
OnHostShutdown)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
+ if (!handled) {
+ LOG(ERROR) << "Received unexpected IPC type: " << message.type();
+ CrashNetworkProcess(FROM_HERE);
+ }
+
return handled;
}
diff --git a/remoting/host/desktop_process.cc b/remoting/host/desktop_process.cc
index a994e22..f740a2b 100644
--- a/remoting/host/desktop_process.cc
+++ b/remoting/host/desktop_process.cc
@@ -61,6 +61,8 @@ bool DesktopProcess::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ChromotingDaemonDesktopMsg_Crash, OnCrash)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
+ CHECK(handled) << "Received unexpected IPC type: " << message.type();
return handled;
}
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc
index 297bc87..5abb0d6 100644
--- a/remoting/host/desktop_session_agent.cc
+++ b/remoting/host/desktop_session_agent.cc
@@ -103,12 +103,7 @@ bool DesktopSessionAgent::OnMessageReceived(const IPC::Message& message) {
IPC_END_MESSAGE_MAP()
}
- // Close the channel if the received message wasn't expected.
- if (!handled) {
- LOG(ERROR) << "An unexpected IPC message received: type=" << message.type();
- OnChannelError();
- }
-
+ CHECK(handled) << "Received unexpected IPC type: " << message.type();
return handled;
}
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index 55f7fc5..1cb3fd6 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -94,6 +94,7 @@ bool DesktopSessionProxy::OnMessageReceived(const IPC::Message& message) {
DisconnectSession);
IPC_END_MESSAGE_MAP()
+ CHECK(handled) << "Received unexpected IPC type: " << message.type();
return handled;
}
diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc
index 453de2b..50d41c8 100644
--- a/remoting/host/desktop_session_win.cc
+++ b/remoting/host/desktop_session_win.cc
@@ -82,6 +82,12 @@ bool DesktopSessionWin::OnMessageReceived(const IPC::Message& message) {
OnInjectSas)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
+ if (!handled) {
+ LOG(ERROR) << "Received unexpected IPC type: " << message.type();
+ RestartDesktopProcess(FROM_HERE);
+ }
+
return handled;
}
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index dcdce59..f5089b2 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -548,7 +548,10 @@ bool HostProcess::OnMessageReceived(const IPC::Message& message) {
DesktopSessionConnector::OnTerminalDisconnected)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
+ CHECK(handled) << "Received unexpected IPC type: " << message.type();
return handled;
+
#else // !defined(REMOTING_MULTI_PROCESS)
return false;
#endif // !defined(REMOTING_MULTI_PROCESS)