summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorinferno <inferno@chromium.org>2015-01-29 12:37:12 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-29 20:39:10 +0000
commit726621f93d2802dfc2c90732c7133145c9854e38 (patch)
tree8c742d5b1134147ccf6be9a845a18e8e216dfdf7 /ipc
parent4f4fd12fc21c1ec0956f9a2b64689e8e6a764ed2 (diff)
downloadchromium_src-726621f93d2802dfc2c90732c7133145c9854e38.zip
chromium_src-726621f93d2802dfc2c90732c7133145c9854e38.tar.gz
chromium_src-726621f93d2802dfc2c90732c7133145c9854e38.tar.bz2
Revert of IPC::ChannelMojo: Make IPC handling robust against bad messages. (patchset #3 id:40001 of https://codereview.chromium.org/725733002/)
Reason for revert: Broke ipc fuzzer Original issue's description: > IPC::ChannelMojo: Make IPC handling robust against bad messages. > > This change replaces some DCHECK()s with real error handling. > They happen when it receives broken messages. > > BUG=428800 > R=viettrungluu@chromium.org > > Committed: https://crrev.com/185ffdf58f85e47db9666d2ad9b80ff9bd7fa54b > Cr-Commit-Position: refs/heads/master@{#304102} TBR=viettrungluu@chromium.org,morrita@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=428800 Review URL: https://codereview.chromium.org/883373002 Cr-Commit-Position: refs/heads/master@{#313778}
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mojo/ipc_mojo_bootstrap.cc15
-rw-r--r--ipc/mojo/ipc_mojo_bootstrap.h3
2 files changed, 2 insertions, 16 deletions
diff --git a/ipc/mojo/ipc_mojo_bootstrap.cc b/ipc/mojo/ipc_mojo_bootstrap.cc
index 591ced0..b34648b 100644
--- a/ipc/mojo/ipc_mojo_bootstrap.cc
+++ b/ipc/mojo/ipc_mojo_bootstrap.cc
@@ -100,14 +100,9 @@ void MojoServerBootstrap::OnChannelConnected(int32 peer_pid) {
}
bool MojoServerBootstrap::OnMessageReceived(const Message&) {
- if (state() != STATE_WAITING_ACK) {
- set_state(STATE_ERROR);
- LOG(ERROR) << "Got inconsistent message from client.";
- return false;
- }
-
+ DCHECK_EQ(state(), STATE_WAITING_ACK);
set_state(STATE_READY);
- CHECK(server_pipe_.is_valid());
+
delegate()->OnPipeAvailable(
mojo::embedder::ScopedPlatformHandle(server_pipe_.release()));
@@ -134,12 +129,6 @@ MojoClientBootstrap::MojoClientBootstrap() {
}
bool MojoClientBootstrap::OnMessageReceived(const Message& message) {
- if (state() != STATE_INITIALIZED) {
- set_state(STATE_ERROR);
- LOG(ERROR) << "Got inconsistent message from server.";
- return false;
- }
-
PlatformFileForTransit pipe;
PickleIterator iter(message);
if (!ParamTraits<PlatformFileForTransit>::Read(&message, &iter, &pipe)) {
diff --git a/ipc/mojo/ipc_mojo_bootstrap.h b/ipc/mojo/ipc_mojo_bootstrap.h
index eb1a987..c720904c 100644
--- a/ipc/mojo/ipc_mojo_bootstrap.h
+++ b/ipc/mojo/ipc_mojo_bootstrap.h
@@ -55,9 +55,6 @@ class IPC_MOJO_EXPORT MojoBootstrap : public Listener {
#endif // defined(OS_POSIX) && !defined(OS_NACL)
protected:
- // On MojoServerBootstrap: INITIALIZED -> WAITING_ACK -> READY
- // On MojoClientBootstrap: INITIALIZED -> READY
- // STATE_ERROR is a catch-all state that captures any observed error.
enum State { STATE_INITIALIZED, STATE_WAITING_ACK, STATE_READY, STATE_ERROR };
Delegate* delegate() const { return delegate_; }