Chromium Code Reviews
DescriptionFix 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 #
Messages
Total messages: 8 (2 generated)
|
|||||||||||||||||||