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

Issue 7246021: Prevent DOS attack on UDP echo servers by distinguishing between an echo request (Closed)

Created:
9 years, 6 months ago by ramant (doing other things)
Modified:
9 years, 4 months ago
CC:
chromium-reviews, darin-cc_chromium.org, cbentzel+watch_chromium.org, pam+watch_chromium.org, Mike Belshe, willchan no longer on Chromium
Visibility:
Public.

Description

Prevent DOS attack on UDP echo servers by distinguishing between an echo request and the echo response. Client sends <version><checksum><size><payload> data to TCP/UDP echo servers. <checksum> is the checksum of the <payload>. For the first cut, we will sum up the characters in <payload>. If checksum of the <payload> is verified, echo servers encrypt the data and send back the data as <version><checksum><size><key><encrypted_payload>. <key> is is used to decrypt the <encrypted_payload>. <encrypted_payload> is the encrypted <payload>. BUG=87297 R=jar TEST=network_stats unit tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=96890

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Total comments: 14

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Patch Set 19 : '' #

Patch Set 20 : '' #

Patch Set 21 : '' #

Patch Set 22 : '' #

Patch Set 23 : '' #

Total comments: 8

Patch Set 24 : '' #

Patch Set 25 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+669 lines, -44 lines) Patch
M chrome/browser/net/network_stats.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 12 chunks +55 lines, -9 lines 0 comments Download
M chrome/browser/net/network_stats.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 11 chunks +196 lines, -29 lines 0 comments Download
A net/tools/testserver/echo_message.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +386 lines, -0 lines 0 comments Download
M net/tools/testserver/testserver.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 6 chunks +32 lines, -6 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
ramant (doing other things)
Hi Jim, Changed the network_stats code and testserver for TCP/UDP echo servers to support "echo ...
9 years, 6 months ago (2011-06-25 02:32:13 UTC) #1
ramant (doing other things)
Hi Jim, Synch'ed the code from server into echo_message.py (server CL id is 22093408). thanks ...
9 years, 5 months ago (2011-06-29 23:04:08 UTC) #2
ramant (doing other things)
Hi willchan, Would appreciate if you could look at these changes when you have sometime. ...
9 years, 5 months ago (2011-07-05 19:21:08 UTC) #3
ramant (doing other things)
Hi Jim and Willchan, I have integrated all the changes from python readability into echo_message.py ...
9 years, 5 months ago (2011-07-21 22:02:16 UTC) #4
jar (doing other things)
http://codereview.chromium.org/7246021/diff/29001/chrome/browser/net/network_stats.cc File chrome/browser/net/network_stats.cc (right): http://codereview.chromium.org/7246021/diff/29001/chrome/browser/net/network_stats.cc#newcode44 chrome/browser/net/network_stats.cc:44: static const uint32 kVersionEnd = 2; // kVersionStart + ...
9 years, 4 months ago (2011-08-05 19:37:31 UTC) #5
ramant (doing other things)
Hi Jim, Made the changes you had suggested. Would appreciate if you could take a ...
9 years, 4 months ago (2011-08-12 01:05:08 UTC) #6
ramant (doing other things)
Hi Jim, Added the timer tasks to timeout if we don't get a response from ...
9 years, 4 months ago (2011-08-12 22:25:30 UTC) #7
jar (doing other things)
LGTM Comments below. The code was nice... as I thought of changing it with a ...
9 years, 4 months ago (2011-08-15 19:33:50 UTC) #8
ramant (doing other things)
9 years, 4 months ago (2011-08-16 00:00:02 UTC) #9
Hi Jim,
  Made all the changes you had suggested.

thanks,
raman

http://codereview.chromium.org/7246021/diff/47001/chrome/browser/net/network_...
File chrome/browser/net/network_stats.cc (right):

http://codereview.chromium.org/7246021/diff/47001/chrome/browser/net/network_...
chrome/browser/net/network_stats.cc:102: kVersionLength + kChecksumLength +
kPayloadSizeLength + kKeyLength +
On 2011/08/15 19:33:50, jar wrote:
> style nit: (personal?): suggest not wrapping until you hit the  "+" and were
> about to go past 80.  It is just "ok" if you wrap at the "=", and don't create
> extra lines.  Better to have fewer lines if possible.

Done.

http://codereview.chromium.org/7246021/diff/47001/chrome/browser/net/network_...
chrome/browser/net/network_stats.cc:176: MessageLoop::current()->PostTask(
On 2011/08/15 19:33:50, jar wrote:
> This deserves some comment.  You mentioned that you wanted to avoid the chance
> of an infinite loop, growing the stack with each recursion.  If there is a
> chance at an infinite loop, perhaps we should also add a delay, like 1ms
> (10ms?), so that the time-out will fire before we have time to really hog the
> CPU too extensively (waiting for the time-out).
> 
> If we are timing this, perhaps we can't afford a 10ms delay... I'm not sure.

Done.

http://codereview.chromium.org/7246021/diff/47001/chrome/browser/net/network_...
chrome/browser/net/network_stats.cc:258: Finish(READ_FAILED,
net::ERR_INVALID_ARGUMENT);
On 2011/08/15 19:33:50, jar wrote:
> Is there any better error code to supply here?

Done.

http://codereview.chromium.org/7246021/diff/47001/net/tools/testserver/testse...
File net/tools/testserver/testserver.py (right):

http://codereview.chromium.org/7246021/diff/47001/net/tools/testserver/testse...
net/tools/testserver/testserver.py:1511: """Handles the request from the client
and responds back with a response."""
On 2011/08/15 19:33:50, jar wrote:
> nit: Avoid two forms of respond (responds + response) in one sentence. 
Suggest:
> 
> Handles the request from the client and constructs a response.
> 
> Same in line 1534.

Done.

Powered by Google App Engine
This is Rietveld 408576698