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

Issue 8898008: No longer preconnect to unsafe ports. (Closed)

Created:
9 years ago by mmenke
Modified:
8 years, 11 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

No longer preconnect to unsafe ports. As UrlRequests were never allowed to use these ports anyways, this wasn't a security issue, but just doesn't seem like a good idea. BUG=93326 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114261

Patch Set 1 : '' #

Patch Set 2 : Add missing file #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -37 lines) Patch
M net/base/net_util.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/http_stream_factory_impl_job.h View 2 chunks +2 lines, -0 lines 0 comments Download
M net/http/http_stream_factory_impl_job.cc View 2 chunks +19 lines, -7 lines 12 comments Download
M net/http/http_stream_factory_impl_unittest.cc View 9 chunks +49 lines, -24 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
mmenke
9 years ago (2011-12-12 17:34:46 UTC) #1
willchan no longer on Chromium
http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc File net/http/http_stream_factory_impl_job.cc (right): http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc#newcode550 net/http/http_stream_factory_impl_job.cc:550: int HttpStreamFactoryImpl::Job::DoStart() { Almost all the rest of our ...
9 years ago (2011-12-12 18:24:16 UTC) #2
mmenke
http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc File net/http/http_stream_factory_impl_job.cc (right): http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc#newcode550 net/http/http_stream_factory_impl_job.cc:550: int HttpStreamFactoryImpl::Job::DoStart() { On 2011/12/12 18:24:16, willchan wrote: > ...
9 years ago (2011-12-12 18:43:21 UTC) #3
willchan no longer on Chromium
http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc File net/http/http_stream_factory_impl_job.cc (right): http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc#newcode550 net/http/http_stream_factory_impl_job.cc:550: int HttpStreamFactoryImpl::Job::DoStart() { On 2011/12/12 18:43:21, Matt Menke wrote: ...
9 years ago (2011-12-12 19:04:55 UTC) #4
mmenke
http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc File net/http/http_stream_factory_impl_job.cc (right): http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc#newcode550 net/http/http_stream_factory_impl_job.cc:550: int HttpStreamFactoryImpl::Job::DoStart() { On 2011/12/12 19:04:58, willchan wrote: > ...
9 years ago (2011-12-12 19:10:02 UTC) #5
mmenke
http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc File net/http/http_stream_factory_impl_job.cc (right): http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc#newcode550 net/http/http_stream_factory_impl_job.cc:550: int HttpStreamFactoryImpl::Job::DoStart() { Making this able to fail synchronously ...
9 years ago (2011-12-13 16:34:59 UTC) #6
mmenke
http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc File net/http/http_stream_factory_impl_job.cc (right): http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factory_impl_job.cc#newcode550 net/http/http_stream_factory_impl_job.cc:550: int HttpStreamFactoryImpl::Job::DoStart() { On 2011/12/13 16:35:00, Matt Menke wrote: ...
9 years ago (2011-12-13 16:44:32 UTC) #7
willchan no longer on Chromium
Sorry if my suggestion was too much of a yak shave. I'm happy with your ...
9 years ago (2011-12-13 16:59:50 UTC) #8
mmenke
On 2011/12/13 16:59:50, willchan wrote: > Sorry if my suggestion was too much of a ...
9 years ago (2011-12-13 17:04:00 UTC) #9
willchan no longer on Chromium
OK, lgtm Sent from my iNexus. On Dec 13, 2011 9:04 AM, <mmenke@chromium.org> wrote: > ...
9 years ago (2011-12-13 18:21:14 UTC) #10
mmenke
Great, thanks so much for the review. May be reasonable to add a sync failure ...
9 years ago (2011-12-13 18:24:06 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mmenke@chromium.org/8898008/14005
9 years ago (2011-12-13 18:24:19 UTC) #12
commit-bot: I haz the power
Change committed as 114261
9 years ago (2011-12-13 20:34:25 UTC) #13
wtc
mmenke: while investigating bug 109876, I came across this CL of yours. I have some ...
8 years, 11 months ago (2012-01-14 01:34:45 UTC) #14
mmenke
8 years, 11 months ago (2012-01-14 02:19:21 UTC) #15
Thanks so much for catching these.  I have a CL that should fix the issues, but
I want to look into writing a unit test.

It's not exactly a common or big issue, but it could theoretically lead to a
socket request hanging indefinitely, and is sufficiently obscure that
regressions could easily occur and not be noticed.

http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factor...
File net/http/http_stream_factory_impl_job.cc (left):

http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factor...
net/http/http_stream_factory_impl_job.cc:545: origin_url_));
On 2012/01/14 01:34:46, wtc wrote:
> 
> In the original code, we have already initialized origin_url_
> at this point.  In the new code, origin_url_ is initialized
> in DoStart().  It seems that we should also move this
> net_log_.BeginEvent statement (which uses origin_url_) to
> DoStart().  Do you agree?

Definitely a bug.  Thanks for spotting this.

http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factor...
File net/http/http_stream_factory_impl_job.cc (right):

http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factor...
net/http/http_stream_factory_impl_job.cc:554: return ERR_UNSAFE_PORT;
On 2012/01/14 01:34:46, wtc wrote:
> 
> Before DoResolveProxyComplete() returns an error code, it
> calls dependent_job_->Resume(this) if there is a dependent
> job.  See lines 596-600 below.
> 
> I think we should do the same here.

I agree.  There's no fall through to automatically call it on error.

http://codereview.chromium.org/8898008/diff/14005/net/http/http_stream_factor...
net/http/http_stream_factory_impl_job.cc:598: dependent_job_->Resume(this);
On 2012/01/14 01:34:46, wtc wrote:
> 
> Should we set dependent_job_ to NULL after calling
> dependent_job_->Resume(this)?  We do this elsewhere
> in this file.  (Search for "dependent_job_->Resume".)
> 
> By the way, I find dependent_job_ very confusing.  (It
> comes from the original code by willchan.)  I suggest
> renaming it waiting_job_ (the job that is waiting for |this|).

It shouldn't really be needed, since if we fail, the Request will end up
deleting |this|.  Since the other job can't fail (Or succeed) synchronously, we
also don't have to worry about what it will do, once started.

That having been said, it does seem like something we should do, just to protect
against future changes in behavior.

I've also renamed the job and updated the description in the header.

Powered by Google App Engine
This is Rietveld 408576698