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

Issue 2843823002: Fix P2PSocketHostUdp to handle SetOptions() in error state (Closed)

Created:
3 years, 8 months ago by Sergey Ulanov
Modified:
3 years, 7 months ago
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix P2PSocketHostUdp to handle SetOptions() in error state Previously P2PSocketHostUdp was crashing when SetOptions is called in error state. BUG=714951 Review-Url: https://codereview.chromium.org/2843823002 Cr-Commit-Position: refs/heads/master@{#467395} Committed: https://chromium.googlesource.com/chromium/src/+/2523efeb9a9d25f67c6d4799d0ca6687b674517f

Patch Set 1 #

Patch Set 2 : dcheck #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -2 lines) Patch
M content/browser/renderer_host/p2p/socket_host_tcp.cc View 1 1 chunk +5 lines, -1 line 0 comments Download
M content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_udp.cc View 1 1 chunk +5 lines, -1 line 0 comments Download
M content/browser/renderer_host/p2p/socket_host_udp_unittest.cc View 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (8 generated)
Sergey Ulanov
3 years, 8 months ago (2017-04-25 21:17:00 UTC) #2
pthatcher2
lgtm
3 years, 8 months ago (2017-04-25 22:13:07 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2843823002/1
3 years, 8 months ago (2017-04-25 22:49:32 UTC) #5
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started once the ...
3 years, 8 months ago (2017-04-25 22:49:34 UTC) #7
Sergey Ulanov
+grunell
3 years, 8 months ago (2017-04-25 22:58:25 UTC) #9
Henrik Grunell
I'm not familiar enough with the code and usage to say if the assertion was ...
3 years, 8 months ago (2017-04-26 03:12:53 UTC) #10
Henrik Grunell
On 2017/04/26 03:12:53, Henrik Grunell wrote: > I'm not familiar enough with the code and ...
3 years, 8 months ago (2017-04-26 03:18:07 UTC) #11
Sergey Ulanov
On 2017/04/26 03:18:07, Henrik Grunell wrote: > On 2017/04/26 03:12:53, Henrik Grunell wrote: > > ...
3 years, 8 months ago (2017-04-26 17:43:06 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2843823002/20001
3 years, 8 months ago (2017-04-26 17:45:01 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/2523efeb9a9d25f67c6d4799d0ca6687b674517f
3 years, 8 months ago (2017-04-26 18:49:48 UTC) #18
Henrik Grunell
3 years, 7 months ago (2017-04-27 15:29:33 UTC) #19
Message was sent while issue was closed.
On 2017/04/26 17:43:06, Sergey Ulanov wrote:
> On 2017/04/26 03:18:07, Henrik Grunell wrote:
> > On 2017/04/26 03:12:53, Henrik Grunell wrote:
> > > I'm not familiar enough with the code and usage to say if the assertion
was
> > > indeed incorrect, and that this is not an error elsewhere. I'm relying on
> that
> > > you're sure about that Sergey.
> > > 
> > > Code change in itself looks fine.
> > > 
> > > lgtm
> > 
> > Actually, the description mentions handling the case of error state, but the
> > code handles all states. Is this function expected to be called in any state
> or
> > just open and error?
> 
> The renderer doesn't get the socket ID until the socket is in OPEN state, so
it
> can only send 
> P2PHostMsg_SetOption message when the socket is either in OPEN or ERROR state.
> I've added a DCHECK to verify that it's in ERROR state when it isn't OPEN. We
> still want to handle the case when state_ is not OPEN or ERROR in release
builds
> because the browser shouldn't trust the renderer to send only valid messages
> (e.g. in case the renderer process is compromised and the attacker can guess
> socket_id).

Ack.

Powered by Google App Engine
This is Rietveld 408576698