Commit c2c962cc authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

[mojo-core] PCHECK for invalid process handles

Changes a DCHECK to a PCHECK in an attempt to help sort out some crashes
we see in the wild where the broker process apparently receives handles
but doesn't attempt to duplicate them to itself. This should only be
possible if it doesn't know a valid handle for the remote (sending)
process, which points to potential application raciness in ownership of
the process handles passed into Mojo.

Bug: 887576
Change-Id: I1f8786af8170b7db03804a98125365eeb44fc598
Reviewed-on: https://chromium-review.googlesource.com/1241197
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593733}
parent eeb7bfd6
......@@ -48,7 +48,10 @@ ScopedProcessHandle ScopedProcessHandle::CloneFrom(base::ProcessHandle handle) {
BOOL ok = ::DuplicateHandle(GetCurrentProcessHandle(), handle,
GetCurrentProcessHandle(), &handle, 0, FALSE,
DUPLICATE_SAME_ACCESS);
DCHECK(ok);
// TODO(https://crbug.com/887576): Revert this to a DCHECK once we have sorted
// out the cause of handle verifier failures.
PCHECK(ok);
#endif
return ScopedProcessHandle(handle);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment