|
|
Created:
4 years, 2 months ago by Eran Messeri Modified:
4 years, 2 months ago Reviewers:
mmenke CC:
chromium-reviews, Rob Percival, Ryan Sleevi Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionAvoid dereferencing nullptr during ProfileIOData destruction
Do not de-reference the cert_transparency_verifier_ field during destruction
if it was not initialized, as that would lead to a crash.
The original assumption was that ProfileIOData::Init() is always called
so the cert_transparency_verifier_ is always initialized. However that
assumption proved to be wrong - ProfileIOData::Init is only called once
a ChromeURLRequestContextFactory is created with the ProfileIOData instance
and a URLRequestContext is created using the Create method (see:
https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_url_request_context_getter.cc?sq=package:chromium&dr=C&rcl=1474946434&l=55)
If that did not happen and ProfileIOData::Init was not called, de-referencing
cert_transparency_verifier_ during destruction would lead to a crash.
BUG=648507
Committed: https://crrev.com/13d5499a28455449c3a108a05d695ecae8d881e0
Cr-Commit-Position: refs/heads/master@{#421304}
Patch Set 1 #
Messages
Total messages: 16 (9 generated)
Description was changed from ========== Avoid dereferencing nullptr during ProfileIOData destruction Do not de-reference the cert_transparency_verifier_ field during destruction if it was not initialized, as that would lead to a crash. The original assumption was that ProfileIOData::Init() is always called so the cert_transparency_verifier_ is always initialized. However that assumption proved to be wrong - ProfileIOData::Init is only called once a ChromeURLRequestContextFactory is created with the ProfileIOData instance and a URLRequestContext is created using the Create method (see: https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_url_request_co...) If that did not happen and ProfileIOData::Init was not called, de-referencing cert_transparency_verifier_ during destruction would lead to a crash. BUG=648507 ========== to ========== Avoid dereferencing nullptr during ProfileIOData destruction Do not de-reference the cert_transparency_verifier_ field during destruction if it was not initialized, as that would lead to a crash. The original assumption was that ProfileIOData::Init() is always called so the cert_transparency_verifier_ is always initialized. However that assumption proved to be wrong - ProfileIOData::Init is only called once a ChromeURLRequestContextFactory is created with the ProfileIOData instance and a URLRequestContext is created using the Create method (see: https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_url_request_co...) If that did not happen and ProfileIOData::Init was not called, de-referencing cert_transparency_verifier_ during destruction would lead to a crash. BUG=648507 ==========
eranm@chromium.org changed reviewers: + mmenke@chromium.org
Matt, please review this small fix to a release-blocking crash bug.
The CQ bit was checked by eranm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
LGTM. I do wonder if this codepath is really worth keeping, it's caused similar issues before, and destroying a profile without making a single URLRequest is a bit of a niche use case.
On 2016/09/27 15:09:59, mmenke wrote: > LGTM. I do wonder if this codepath is really worth keeping, it's caused similar > issues before, and destroying a profile without making a single URLRequest is a > bit of a niche use case. Are you suggesting we don't need to worry about URLRequests being made during destruction? What about URLRequests that are in progress? What I'm aiming to prevent here is a URLRequest that ends up validating a certificate and notifying the observer set on the cert_transparency_verifier_ during destruction, which may not be valid anymore. IIRC this was a concern Ryan Sleevi raised - Ryan, do you see a reason to keep this code? For now I'll land the fix to un-block the issue, then we discuss it's necessity. WDYT?
The CQ bit was checked by eranm@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/09/27 19:42:41, Eran Messeri wrote: > On 2016/09/27 15:09:59, mmenke wrote: > > LGTM. I do wonder if this codepath is really worth keeping, it's caused > similar > > issues before, and destroying a profile without making a single URLRequest is > a > > bit of a niche use case. > > Are you suggesting we don't need to worry about URLRequests being made during > destruction? What about URLRequests that are in progress? > What I'm aiming to prevent here is a URLRequest that ends up validating a > certificate and notifying the observer set on the cert_transparency_verifier_ > during destruction, which may not be valid anymore. > IIRC this was a concern Ryan Sleevi raised - Ryan, do you see a reason to keep > this code? I'm not sure where you're getting that from? I mean the code path where we haven't created or initialized the URLRequestContext... i.e., the path that this CL fixes. > For now I'll land the fix to un-block the issue, then we discuss it's necessity. > WDYT?
Message was sent while issue was closed.
Description was changed from ========== Avoid dereferencing nullptr during ProfileIOData destruction Do not de-reference the cert_transparency_verifier_ field during destruction if it was not initialized, as that would lead to a crash. The original assumption was that ProfileIOData::Init() is always called so the cert_transparency_verifier_ is always initialized. However that assumption proved to be wrong - ProfileIOData::Init is only called once a ChromeURLRequestContextFactory is created with the ProfileIOData instance and a URLRequestContext is created using the Create method (see: https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_url_request_co...) If that did not happen and ProfileIOData::Init was not called, de-referencing cert_transparency_verifier_ during destruction would lead to a crash. BUG=648507 ========== to ========== Avoid dereferencing nullptr during ProfileIOData destruction Do not de-reference the cert_transparency_verifier_ field during destruction if it was not initialized, as that would lead to a crash. The original assumption was that ProfileIOData::Init() is always called so the cert_transparency_verifier_ is always initialized. However that assumption proved to be wrong - ProfileIOData::Init is only called once a ChromeURLRequestContextFactory is created with the ProfileIOData instance and a URLRequestContext is created using the Create method (see: https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_url_request_co...) If that did not happen and ProfileIOData::Init was not called, de-referencing cert_transparency_verifier_ during destruction would lead to a crash. BUG=648507 ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Description was changed from ========== Avoid dereferencing nullptr during ProfileIOData destruction Do not de-reference the cert_transparency_verifier_ field during destruction if it was not initialized, as that would lead to a crash. The original assumption was that ProfileIOData::Init() is always called so the cert_transparency_verifier_ is always initialized. However that assumption proved to be wrong - ProfileIOData::Init is only called once a ChromeURLRequestContextFactory is created with the ProfileIOData instance and a URLRequestContext is created using the Create method (see: https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_url_request_co...) If that did not happen and ProfileIOData::Init was not called, de-referencing cert_transparency_verifier_ during destruction would lead to a crash. BUG=648507 ========== to ========== Avoid dereferencing nullptr during ProfileIOData destruction Do not de-reference the cert_transparency_verifier_ field during destruction if it was not initialized, as that would lead to a crash. The original assumption was that ProfileIOData::Init() is always called so the cert_transparency_verifier_ is always initialized. However that assumption proved to be wrong - ProfileIOData::Init is only called once a ChromeURLRequestContextFactory is created with the ProfileIOData instance and a URLRequestContext is created using the Create method (see: https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_url_request_co...) If that did not happen and ProfileIOData::Init was not called, de-referencing cert_transparency_verifier_ during destruction would lead to a crash. BUG=648507 Committed: https://crrev.com/13d5499a28455449c3a108a05d695ecae8d881e0 Cr-Commit-Position: refs/heads/master@{#421304} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/13d5499a28455449c3a108a05d695ecae8d881e0 Cr-Commit-Position: refs/heads/master@{#421304} |