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

Issue 2643023003: Speed up sanitizing headers received from HTTP proxies. (Closed)

Created:
3 years, 11 months ago by mmenke
Modified:
3 years, 11 months ago
Reviewers:
Julia Tuttle
CC:
chromium-reviews, cbentzel+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Speed up sanitizing headers received from HTTP proxies. The old code repeatedly re-parsed headers for each header to be retained, which is a very CPU intensive operation. In practice, this shouldn't have mattered much. At worst, a malicious proxy or MitM could DoS the CPU. This code removes all the redundant parsing, and just removes all the old headers in a single pass, at the cost of a bit more code, and worse performance in the average case. In the extreme case the fuzzer detected, the new code is about 1,000 times faster. BUG=666878 Review-Url: https://codereview.chromium.org/2643023003 Cr-Commit-Position: refs/heads/master@{#445432} Committed: https://chromium.googlesource.com/chromium/src/+/69b49a8ebcb7b1efddf89262b0ca36a300d756a5

Patch Set 1 #

Patch Set 2 : Add missing header #

Total comments: 1

Patch Set 3 : Fix #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -30 lines) Patch
M net/http/http_response_headers.h View 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_response_headers.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M net/http/http_response_headers_unittest.cc View 1 2 chunks +65 lines, -0 lines 0 comments Download
M net/http/proxy_client_socket.cc View 1 2 3 chunks +30 lines, -30 lines 2 comments Download

Depends on Patchset:

Messages

Total messages: 25 (16 generated)
mmenke
This fixes a rather silly issue, but at least it should make the fuzzers happy. ...
3 years, 11 months ago (2017-01-19 18:51:55 UTC) #6
mmenke
Oops, looks like I broke something. :(
3 years, 11 months ago (2017-01-19 21:34:48 UTC) #9
mmenke
On 2017/01/19 21:34:48, mmenke wrote: > Oops, looks like I broke something. :( And fixed. ...
3 years, 11 months ago (2017-01-19 22:25:15 UTC) #12
Julia Tuttle
lgtm with a nit you can ignore if you want. https://codereview.chromium.org/2643023003/diff/40001/net/http/proxy_client_socket.cc File net/http/proxy_client_socket.cc (right): https://codereview.chromium.org/2643023003/diff/40001/net/http/proxy_client_socket.cc#newcode99 ...
3 years, 11 months ago (2017-01-19 22:26:40 UTC) #13
mmenke
Thanks! https://codereview.chromium.org/2643023003/diff/40001/net/http/proxy_client_socket.cc File net/http/proxy_client_socket.cc (right): https://codereview.chromium.org/2643023003/diff/40001/net/http/proxy_client_socket.cc#newcode99 net/http/proxy_client_socket.cc:99: for (const char* header : kHeadersToKeep) { On ...
3 years, 11 months ago (2017-01-23 17:28:15 UTC) #16
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/2643023003/40001
3 years, 11 months ago (2017-01-23 17:29:15 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/376071)
3 years, 11 months ago (2017-01-23 18:26:53 UTC) #20
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/2643023003/40001
3 years, 11 months ago (2017-01-23 18:29:07 UTC) #22
commit-bot: I haz the power
3 years, 11 months ago (2017-01-23 19:35:44 UTC) #25
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/69b49a8ebcb7b1efddf89262b0ca...

Powered by Google App Engine
This is Rietveld 408576698