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

Issue 183553004: Eliminate a potential race in IPC::ChannelProxy (Closed)

Created:
6 years, 9 months ago by dmichael (off chromium)
Modified:
6 years, 9 months ago
Reviewers:
Sergey Berezin, jam
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Eliminate a potential race in IPC::ChannelProxy Doing the following steps with ChannelProxy leads to a data race: 1) Create the ChannelProxy, but don't initialize it. 2) Add a filter. 3) Init the ChannelProxy. The problem is, AddFilter() posts a task from the Listener thread to the IPC task runner to do OnAddFilter. Prior to this patch, OnAddFilter will try to read channel_ even though channel_ may not have been initialized, and it's accessed without any synchronization. This patch only really adds the filter if peer_pid_ has been set on the IPC::Channel thread; otherwise, it waits until the connection has been established to really add filters. See the bug for more detail. BUG=244383 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256188 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=258406

Patch Set 1 #

Total comments: 1

Patch Set 2 : Review comments, fix OnRemoveFilter #

Patch Set 3 : Call OnChannelConnected only once. #

Patch Set 4 : Remove unrelated appcache change #

Patch Set 5 : Clarify comment. #

Total comments: 3

Patch Set 6 : Make ipc_channel_nacl call OnChannelConnected #

Patch Set 7 : PostTask OnChannelConnected; put back in call to OnChannelClosed for SyncChannel #

Patch Set 8 : merge and try CQ again #

Patch Set 9 : Merge #

Patch Set 10 : Clear pending_filters_ on the IO thread if the channel is closed. #

Patch Set 11 : merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -20 lines) Patch
M ipc/ipc_channel_nacl.h View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M ipc/ipc_channel_nacl.cc View 1 2 3 4 5 6 5 chunks +17 lines, -4 lines 0 comments Download
M ipc/ipc_channel_proxy.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ipc/ipc_channel_proxy.cc View 1 2 3 4 5 6 7 8 9 6 chunks +34 lines, -16 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
dmichael (off chromium)
jam: Please punt to the right person if it's not you. See this comment on ...
6 years, 9 months ago (2014-02-27 20:19:50 UTC) #1
dmichael (off chromium)
(Note, RemoveFilter is still broken in this patch; I can work on trying to fix ...
6 years, 9 months ago (2014-02-27 20:42:31 UTC) #2
jam
lgtm with nit please add more information to the cl description describing the bug https://codereview.chromium.org/183553004/diff/1/ipc/ipc_channel_proxy.cc ...
6 years, 9 months ago (2014-02-28 00:41:41 UTC) #3
dmichael (off chromium)
PTAL... I had to make a few other changes, and made some minor style changes. ...
6 years, 9 months ago (2014-02-28 23:25:46 UTC) #4
jam
https://codereview.chromium.org/183553004/diff/80001/ipc/ipc_channel_proxy.cc File ipc/ipc_channel_proxy.cc (right): https://codereview.chromium.org/183553004/diff/80001/ipc/ipc_channel_proxy.cc#newcode291 ipc/ipc_channel_proxy.cc:291: return; // The channel has been closed, so don't ...
6 years, 9 months ago (2014-03-03 16:27:03 UTC) #5
dmichael (off chromium)
It looks like I broke most/all the PPAPINaCl browser tests on the trybots with this ...
6 years, 9 months ago (2014-03-03 16:37:02 UTC) #6
dmichael (off chromium)
Okay, sorry for the delay. This change uncovered an old bug in ipc_channel_nacl.cc that took ...
6 years, 9 months ago (2014-03-07 16:19:03 UTC) #7
jam
lgtm
6 years, 9 months ago (2014-03-10 20:32:37 UTC) #8
dmichael (off chromium)
The CQ bit was checked by dmichael@chromium.org
6 years, 9 months ago (2014-03-10 20:35:00 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/183553004/120001
6 years, 9 months ago (2014-03-10 20:44:21 UTC) #10
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-10 20:58:13 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg
6 years, 9 months ago (2014-03-10 20:58:14 UTC) #12
dmichael (off chromium)
The CQ bit was checked by dmichael@chromium.org
6 years, 9 months ago (2014-03-10 21:20:19 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/183553004/140001
6 years, 9 months ago (2014-03-10 21:50:48 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/183553004/140001
6 years, 9 months ago (2014-03-10 22:36:17 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/183553004/140001
6 years, 9 months ago (2014-03-10 23:49:26 UTC) #16
commit-bot: I haz the power
Change committed as 256188
6 years, 9 months ago (2014-03-11 10:59:09 UTC) #17
johnme
A revert of this CL has been created in https://codereview.chromium.org/194923004/ by johnme@chromium.org. The reason for ...
6 years, 9 months ago (2014-03-11 13:53:41 UTC) #18
dmichael (off chromium)
The CQ bit was checked by dmichael@chromium.org
6 years, 9 months ago (2014-03-19 19:15:01 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/183553004/170001
6 years, 9 months ago (2014-03-19 19:16:16 UTC) #20
dmichael (off chromium)
The CQ bit was unchecked by dmichael@chromium.org
6 years, 9 months ago (2014-03-19 22:36:48 UTC) #21
dmichael (off chromium)
The CQ bit was checked by dmichael@chromium.org
6 years, 9 months ago (2014-03-19 22:36:49 UTC) #22
dmichael (off chromium)
The CQ bit was unchecked by dmichael@chromium.org
6 years, 9 months ago (2014-03-20 16:16:46 UTC) #23
dmichael (off chromium)
The CQ bit was checked by dmichael@chromium.org
6 years, 9 months ago (2014-03-20 16:17:01 UTC) #24
dmichael (off chromium)
The CQ bit was checked by dmichael@chromium.org
6 years, 9 months ago (2014-03-20 17:34:16 UTC) #25
Sergey Berezin
The CQ bit was unchecked by sergeyberezin@chromium.org
6 years, 9 months ago (2014-03-20 17:59:51 UTC) #26
Sergey Berezin
The CQ bit was checked by sergeyberezin@chromium.org
6 years, 9 months ago (2014-03-20 18:01:11 UTC) #27
Sergey Berezin
On 2014/03/20 17:59:51, Sergey Berezin wrote: > The CQ bit was unchecked by mailto:sergeyberezin@chromium.org CQ ...
6 years, 9 months ago (2014-03-20 18:03:11 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/183553004/190001
6 years, 9 months ago (2014-03-20 18:03:44 UTC) #29
commit-bot: I haz the power
6 years, 9 months ago (2014-03-20 21:00:54 UTC) #30
Message was sent while issue was closed.
Change committed as 258406

Powered by Google App Engine
This is Rietveld 408576698