New issue
Advanced search Search tips

Issue 814742 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Calling mojo::ReportBadMessage fails in Android WebView

Project Member Reported by dtapu...@chromium.org, Feb 22 2018

Issue description

As part of review:
https://chromium-review.googlesource.com/c/chromium/src/+/830928/

I tried to use mojo::ReportBadMessage but if fails to terminate the render process when used with Android WebView.

It fails because it goes into the InvalidNodeName branch in

https://chromium.googlesource.com/chromium/src/+/779a24a040bcbdeca45eb6de93b1d69eda7bb47b/mojo/edk/system/core.cc#775

and the default process error callback is null.

So no action is taken for calling bad message.
 
Cc: roc...@chromium.org
Add

Comment 2 by boliu@chromium.org, Feb 22 2018

This comment says ReportBadMessage is only ok to call when in the message handler:
https://cs.chromium.org/chromium/src/mojo/public/cpp/bindings/message.h?rcl=3327cfed3f0a3d7dca70057cafa0d271e20daeff&l=355

Was that the case when you called it?

Comment 3 by roc...@chromium.org, Feb 22 2018

Looks like it is indeed called from within a message dispatch, so this is somewhat surprising.

Note that hitting the InvalidNodeName path *very strongly* implies that the message did not come from out-of-process.

All messages from out-of-process are processed by this code[1] which explicitly attaches a node name (i.e., effectively a process identifier) [2]

I was initially concerned that it could be bug in how messages with handles are brokered in that they may lose source node information, but we don't broker messages on Android.

[1] https://cs.chromium.org/chromium/src/mojo/edk/system/node_controller.cc?rcl=ea1cbe27ced63d2d6aa72cc95db460fb06a9f554&l=970
[2] https://cs.chromium.org/chromium/src/mojo/edk/system/node_controller.cc?rcl=ea1cbe27ced63d2d6aa72cc95db460fb06a9f554&l=98

Comment 4 by boliu@chromium.org, Feb 22 2018

> Note that hitting the InvalidNodeName path *very strongly* implies that the message did not come from out-of-process.

Single process android webview is very much a thing...

I made the IPC bad message thing just crash if it's in process:
https://codereview.chromium.org/2640083002

maybe we can do the same thing here

Comment 5 by roc...@chromium.org, Feb 22 2018

Cc: -roc...@chromium.org
Owner: roc...@chromium.org
Status: Started (was: Untriaged)
Makes sense to mirror that logic. I'll send out a CL.
Owner: rockot@google.com

Sign in to add a comment