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

Issue 2206733002: PVer4: Verify checksum for downloaded updates (Closed)

Created:
4 years, 4 months ago by vakh (use Gerrit instead)
Modified:
4 years, 4 months ago
Reviewers:
Nathan Parker, rkaplow, noé
CC:
chromium-reviews, palmer, Scott Hess - ex-Googler, francois_mozilla.com, woz, noé
Base URL:
https://chromium.googlesource.com/chromium/src.git@01_v4_rice_store
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Verify checksum for downloaded updates and discard the update if the checks fails to match. BUG=543161 Committed: https://crrev.com/0facbb7c1aea0831a5b0ce159844bdf674f10852 Cr-Commit-Position: refs/heads/master@{#411225}

Patch Set 1 : Ignore: TODO: Remove DVLOGs and remove the extra test #

Patch Set 2 : Review from here #

Patch Set 3 : XXS: Added a DCHECK for PARTIAL_UPDATE in ProcessPartialUpdate #

Total comments: 14

Patch Set 4 : nparker@ feedback: non-static methods, check removals before checksum, ... #

Patch Set 5 : git pull #

Total comments: 3

Patch Set 6 : Minor: nparker@'s CR feedback #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+274 lines, -80 lines) Patch
M components/safe_browsing_db/BUILD.gn View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M components/safe_browsing_db/v4_rice.cc View 1 2 3 2 chunks +9 lines, -3 lines 0 comments Download
M components/safe_browsing_db/v4_store.h View 1 2 3 4 3 chunks +37 lines, -13 lines 0 comments Download
M components/safe_browsing_db/v4_store.cc View 1 2 3 4 5 11 chunks +97 lines, -36 lines 5 comments Download
M components/safe_browsing_db/v4_store_unittest.cc View 1 2 3 4 5 16 chunks +128 lines, -28 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 90 (61 generated)
vakh (use Gerrit instead)
Tiny: Remove a temporary test that I added for debugging
4 years, 4 months ago (2016-08-04 00:28:13 UTC) #5
vakh (use Gerrit instead)
Tiny: Remove extra logging
4 years, 4 months ago (2016-08-04 00:36:55 UTC) #8
vakh (use Gerrit instead)
Tiny: Depend on //crypto
4 years, 4 months ago (2016-08-04 00:39:54 UTC) #12
vakh (use Gerrit instead)
a
4 years, 4 months ago (2016-08-04 23:50:02 UTC) #21
vakh (use Gerrit instead)
Tiny: Ensure that response_type is set. And set it in tests
4 years, 4 months ago (2016-08-05 02:00:17 UTC) #29
vakh (use Gerrit instead)
Tiny: Update enum in histograms.xml
4 years, 4 months ago (2016-08-05 02:02:21 UTC) #32
vakh (use Gerrit instead)
Review from here
4 years, 4 months ago (2016-08-05 17:30:04 UTC) #38
vakh (use Gerrit instead)
XXS: Added a DCHECK for PARTIAL_UPDATE in ProcessPartialUpdate
4 years, 4 months ago (2016-08-05 18:42:00 UTC) #46
Nathan Parker
https://codereview.chromium.org/2206733002/diff/190001/components/safe_browsing_db/v4_rice.cc File components/safe_browsing_db/v4_rice.cc (right): https://codereview.chromium.org/2206733002/diff/190001/components/safe_browsing_db/v4_rice.cc#newcode266 components/safe_browsing_db/v4_rice.cc:266: std::string V4RiceDecoder::DebugString() const { Are there constants describing what ...
4 years, 4 months ago (2016-08-08 21:17:20 UTC) #51
vakh (use Gerrit instead)
nparker@ feedback: non-static methods, check removals before checksum, ...
4 years, 4 months ago (2016-08-08 22:44:19 UTC) #52
vakh (use Gerrit instead)
https://codereview.chromium.org/2206733002/diff/190001/components/safe_browsing_db/v4_rice.cc File components/safe_browsing_db/v4_rice.cc (right): https://codereview.chromium.org/2206733002/diff/190001/components/safe_browsing_db/v4_rice.cc#newcode266 components/safe_browsing_db/v4_rice.cc:266: std::string V4RiceDecoder::DebugString() const { On 2016/08/08 21:17:19, Nathan Parker ...
4 years, 4 months ago (2016-08-08 22:46:47 UTC) #55
vakh (use Gerrit instead)
rkaplow@: Please review the minor changes in tools/metrics/histograms/histograms.xml
4 years, 4 months ago (2016-08-08 22:48:01 UTC) #56
vakh (use Gerrit instead)
git
4 years, 4 months ago (2016-08-08 23:58:49 UTC) #57
Nathan Parker
lgtm https://codereview.chromium.org/2206733002/diff/230001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2206733002/diff/230001/components/safe_browsing_db/v4_database.cc#newcode143 components/safe_browsing_db/v4_database.cc:143: DVLOG(1) << "Store update discarded: " << *(*store_map_)[identifier]; ...
4 years, 4 months ago (2016-08-09 00:10:19 UTC) #60
vakh (use Gerrit instead)
Minor: nparker@'s CR feedback
4 years, 4 months ago (2016-08-10 20:21:22 UTC) #63
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/2206733002/250001
4 years, 4 months ago (2016-08-10 20:22:18 UTC) #67
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/235267)
4 years, 4 months ago (2016-08-10 20:31:26 UTC) #69
vakh (use Gerrit instead)
rkaplow@chromium.org: Please review the change in histograms.xml
4 years, 4 months ago (2016-08-10 20:33:43 UTC) #71
rkaplow
lgtm
4 years, 4 months ago (2016-08-10 20:39:48 UTC) #72
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/2206733002/250001
4 years, 4 months ago (2016-08-10 20:41:30 UTC) #74
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/271205)
4 years, 4 months ago (2016-08-10 21:26:46 UTC) #76
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/2206733002/250001
4 years, 4 months ago (2016-08-10 21:30:56 UTC) #78
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/275476)
4 years, 4 months ago (2016-08-10 22:54:47 UTC) #80
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/2206733002/250001
4 years, 4 months ago (2016-08-11 00:26:14 UTC) #82
commit-bot: I haz the power
Committed patchset #6 (id:250001)
4 years, 4 months ago (2016-08-11 02:15:31 UTC) #84
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/0facbb7c1aea0831a5b0ce159844bdf674f10852 Cr-Commit-Position: refs/heads/master@{#411225}
4 years, 4 months ago (2016-08-11 02:16:49 UTC) #86
noé
https://codereview.chromium.org/2206733002/diff/250001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2206733002/diff/250001/components/safe_browsing_db/v4_store.cc#newcode147 components/safe_browsing_db/v4_store.cc:147: // lexographical order to store it, but we do ...
4 years, 4 months ago (2016-08-11 08:15:25 UTC) #88
vakh (use Gerrit instead)
Thanks for the review, Noe. Please see my comments below. https://codereview.chromium.org/2206733002/diff/250001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2206733002/diff/250001/components/safe_browsing_db/v4_store.cc#newcode147 ...
4 years, 4 months ago (2016-08-11 08:31:20 UTC) #89
vakh (use Gerrit instead)
4 years, 4 months ago (2016-08-11 17:05:59 UTC) #90
Message was sent while issue was closed.
https://codereview.chromium.org/2206733002/diff/250001/components/safe_browsi...
File components/safe_browsing_db/v4_store.cc (right):

https://codereview.chromium.org/2206733002/diff/250001/components/safe_browsi...
components/safe_browsing_db/v4_store.cc:393: while (old_has_unmerged ||
additions_has_unmerged) {
On 2016/08/11 08:31:20, vakh wrote:
> On 2016/08/11 08:15:25, noé wrote:
> > This is quite complicated code. Have you considered putting all the prefixes
> > into a set<string> and then applying additions and removals. At the end
> > converting it back to a HashPrefixMap?
> 
> Yes, it would simplify the code but at the cost of increasing time complexity.
> Using a set would cost O(N*log(N)) time, whereas the current implementation
> costs O(N).

Sorry, I take that back. I think the time complexity is probably the same.

However, creating a set means creating a 32 byte string object for each of the
hash prefixes, most of which are 4-bytes long. This would end up taking 8 times
more memory, even though it would be for a small duration. That's what I was
trying to avoid.

Powered by Google App Engine
This is Rietveld 408576698