Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: remoting/host/daemon_process.cc

Issue 12390027: Crash the network or desktop process when an unknown IPC message is received. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/desktop_process.cc » ('j') | remoting/host/desktop_process.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/daemon_process.cc
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc
index f76838dda20beed857b86d025086b66ef5ee9a46..9ea4c6affe6ac9b3c913ad39ec9b30af511ff0c9 100644
--- a/remoting/host/daemon_process.cc
+++ b/remoting/host/daemon_process.cc
@@ -65,6 +65,12 @@ bool DaemonProcess::OnMessageReceived(const IPC::Message& message) {
CloseDesktopSession)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
+ if (!handled) {
+ LOG(ERROR) << "An unexpected IPC message received: type=" << message.type();
+ CrashNetworkProcess(FROM_HERE);
+ }
+
return handled;
Wez 2013/03/04 23:17:09 Do you know what IpcChannel itself does with the |
alexeypa (please no reviews) 2013/03/05 00:01:44 It ignores the returned value.
}
@@ -82,7 +88,6 @@ void DaemonProcess::CloseDesktopSession(int terminal_id) {
if (!IsTerminalIdKnown(terminal_id)) {
LOG(ERROR) << "An invalid terminal ID. terminal_id=" << terminal_id;
CrashNetworkProcess(FROM_HERE);
- DeleteAllDesktopSessions();
return;
}
@@ -131,7 +136,6 @@ void DaemonProcess::CreateDesktopSession(int terminal_id) {
if (IsTerminalIdKnown(terminal_id)) {
LOG(ERROR) << "An invalid terminal ID. terminal_id=" << terminal_id;
CrashNetworkProcess(FROM_HERE);
- DeleteAllDesktopSessions();
return;
}
@@ -145,6 +149,8 @@ void DaemonProcess::CrashNetworkProcess(
const tracked_objects::Location& location) {
SendToNetwork(new ChromotingDaemonNetworkMsg_Crash(
location.function_name(), location.file_name(), location.line_number()));
Wez 2013/03/04 23:17:09 nit: You're not closing the IPC channel here, so D
alexeypa (please no reviews) 2013/03/05 00:01:44 Agree. The current implementation does not enforce
+
+ DeleteAllDesktopSessions();
Wez 2013/02/28 23:53:14 nit: We should really tear-down the IPC channel to
alexeypa (please no reviews) 2013/03/05 00:01:44 Agree, but let's do it as a separate CL. I imagine
Wez 2013/03/05 02:12:31 SGTM.
}
void DaemonProcess::Initialize() {
« no previous file with comments | « no previous file | remoting/host/desktop_process.cc » ('j') | remoting/host/desktop_process.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698