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

Issue 1937733002: Fix lock-order-inversion in ChannelMojo (Closed)

Created:
4 years, 7 months ago by Ken Rockot(use gerrit already)
Modified:
4 years, 7 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix lock-order-inversion in ChannelMojo The following lock sequences are possible: 1. ChannelMojo lock (A) is held for Connect when calling bootstrap_->Connect(), which in turn binds the Binding, starting a MojoWatch which locks the internal lock (B) for the watcher. So A => B. 2. An incoming IPC wakes the watcher (B) and calls SyncMessageFilter::OnMessageReceived which locks SMF's lock (C). So B => C. 3. Sending an IPC locks SMF's lock (C) and then locks ChannelMojo's lock (A) while holding C. So C => A. This CL eliminates the A => B => C => A cycle by avoiding case 1. There's no need to hold ChannelMojo's lock while connecting the Bootstrap. BUG=606701 R=amistry@chromium.org Committed: https://crrev.com/6897439afeea04f28bb3bc2f9573d47b1e232eeb Cr-Commit-Position: refs/heads/master@{#390880}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -4 lines) Patch
M ipc/mojo/ipc_channel_mojo.cc View 1 chunk +6 lines, -4 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Ken Rockot(use gerrit already)
4 years, 7 months ago (2016-05-01 04:18:40 UTC) #1
Anand Mistry (off Chromium)
lgtm
4 years, 7 months ago (2016-05-01 23:57:50 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1937733002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1937733002/1
4 years, 7 months ago (2016-05-01 23:57:58 UTC) #4
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 7 months ago (2016-05-02 00:02:30 UTC) #5
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/6897439afeea04f28bb3bc2f9573d47b1e232eeb Cr-Commit-Position: refs/heads/master@{#390880}
4 years, 7 months ago (2016-05-02 00:03:40 UTC) #7
Ken Rockot(use gerrit already)
4 years, 7 months ago (2016-05-02 00:51:46 UTC) #8
Message was sent while issue was closed.
Thanks for CQ

Powered by Google App Engine
This is Rietveld 408576698