Calling mojo::ReportBadMessage fails in Android WebView |
|||
Issue descriptionAs 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.
,
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?
,
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
,
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
,
Feb 22 2018
Makes sense to mirror that logic. I'll send out a CL.
,
Oct 17
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dtapu...@chromium.org
, Feb 22 2018