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

Issue 406043003: Adding the VerifyModule function (and helpers) to safe browsing. (Closed)

Created:
6 years, 5 months ago by krstnmnlsn
Modified:
6 years, 4 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Adding the VerifyModule function (and helpers) to safe browsing. This function allows us to compare a module in memory with its original on disk, and identify any differences (after accounting for relocations). The state of the module (MODULE_UNKNOWN, MODULE_UNMODIFIED or MODULE_MODIFIED) is returned along with a list of the possibly modified exported functions of the module. BUG=401854 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288319

Patch Set 1 : #

Total comments: 26

Patch Set 2 : #

Total comments: 14

Patch Set 3 : Responding to csharp's comments. See patch set 2 for additional files that have been changed, but not in patch 3. #

Patch Set 4 : fixed branch issues! #

Total comments: 26

Patch Set 5 : greg's fixes #

Total comments: 18

Patch Set 6 : chris' fixes #

Total comments: 4

Patch Set 7 : #

Total comments: 40

Patch Set 8 : Copying over changes so that modified exported functions are returned by VerifyModule #

Total comments: 40

Patch Set 9 : #

Total comments: 8

Patch Set 10 : #

Patch Set 11 : rebasing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+563 lines, -22 lines) Patch
A chrome/browser/safe_browsing/module_integrity_verifier_win.h View 1 2 3 4 5 6 7 8 1 chunk +46 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/module_integrity_verifier_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +298 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/module_integrity_verifier_win_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +157 lines, -0 lines 0 comments Download
A + chrome/browser/safe_browsing/verifier_test/verifier_test_dll.cc View 1 2 3 4 5 6 7 1 chunk +15 lines, -14 lines 0 comments Download
A + chrome/browser/safe_browsing/verifier_test/verifier_test_dll.def View 1 2 3 4 5 6 7 1 chunk +8 lines, -8 lines 0 comments Download
A chrome/browser/safe_browsing/verifier_test/verifier_unittest.gyp View 1 3 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 2 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
krstnmnlsn
Hey all, Here is the first piece of code to start verifying modules loaded into ...
6 years, 5 months ago (2014-07-21 20:27:21 UTC) #1
grt (UTC plus 2)
https://codereview.chromium.org/406043003/diff/40001/chrome/browser/safe_browsing/verifier.h File chrome/browser/safe_browsing/verifier.h (right): https://codereview.chromium.org/406043003/diff/40001/chrome/browser/safe_browsing/verifier.h#newcode12 chrome/browser/safe_browsing/verifier.h:12: MODULE_STATE_UNKNOWN = 0, nit: no need for " = ...
6 years, 5 months ago (2014-07-21 20:41:59 UTC) #2
grt (UTC plus 2)
some comments. let's chat about using PeImageReader instead of PEImageAsData. https://codereview.chromium.org/406043003/diff/40001/chrome/browser/safe_browsing/verifier.cc File chrome/browser/safe_browsing/verifier.cc (right): https://codereview.chromium.org/406043003/diff/40001/chrome/browser/safe_browsing/verifier.cc#newcode30 ...
6 years, 5 months ago (2014-07-22 17:39:50 UTC) #3
krstnmnlsn
Feedback much appreciated! In thanks, I have doubled the code length (unittests, sorry). The unittests ...
6 years, 5 months ago (2014-07-25 00:15:43 UTC) #4
krstnmnlsn
VerifyModuleModified fixed (lets pretend this never happened). See previous message for a few questions I ...
6 years, 4 months ago (2014-07-29 00:09:34 UTC) #5
csharp
https://codereview.chromium.org/406043003/diff/180001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/180001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode21 chrome/browser/safe_browsing/module_integrity_verifier.cc:21: int bytes_corrected_by_reloc = 0; This seems to be only ...
6 years, 4 months ago (2014-07-29 14:28:15 UTC) #6
krstnmnlsn
@mattm, could you owners review the changes to safe browsing? https://codereview.chromium.org/406043003/diff/180001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/180001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode21 ...
6 years, 4 months ago (2014-07-29 17:30:25 UTC) #7
grt (UTC plus 2)
I think something strange may have happened with your git branches. The latest patchset doesn't ...
6 years, 4 months ago (2014-07-29 17:48:12 UTC) #8
krstnmnlsn
now with all files in the latest patch.
6 years, 4 months ago (2014-07-29 18:27:19 UTC) #9
grt (UTC plus 2)
a few suggestions. more to come. https://codereview.chromium.org/406043003/diff/220001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/220001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode21 chrome/browser/safe_browsing/module_integrity_verifier.cc:21: int bytes_corrected_by_reloc = ...
6 years, 4 months ago (2014-07-29 19:32:23 UTC) #10
krstnmnlsn
Some fixes, thanks! https://codereview.chromium.org/406043003/diff/220001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/220001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode21 chrome/browser/safe_browsing/module_integrity_verifier.cc:21: int bytes_corrected_by_reloc = 0; On 2014/07/29 ...
6 years, 4 months ago (2014-07-30 14:34:36 UTC) #11
csharp
https://codereview.chromium.org/406043003/diff/240001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/240001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode21 chrome/browser/safe_browsing/module_integrity_verifier.cc:21: // The number of bytes made to agree (between ...
6 years, 4 months ago (2014-07-30 15:22:09 UTC) #12
krstnmnlsn
https://codereview.chromium.org/406043003/diff/240001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/240001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode21 chrome/browser/safe_browsing/module_integrity_verifier.cc:21: // The number of bytes made to agree (between ...
6 years, 4 months ago (2014-07-30 18:36:07 UTC) #13
csharp
lgtm with minor comments. Greg is a lot more familiar with Windows code than me, ...
6 years, 4 months ago (2014-07-30 19:29:42 UTC) #14
krstnmnlsn
https://codereview.chromium.org/406043003/diff/240001/chrome/browser/safe_browsing/module_integrity_verifier.h File chrome/browser/safe_browsing/module_integrity_verifier.h (right): https://codereview.chromium.org/406043003/diff/240001/chrome/browser/safe_browsing/module_integrity_verifier.h#newcode10 chrome/browser/safe_browsing/module_integrity_verifier.h:10: namespace base { namespace win { On 2014/07/30 19:29:42, ...
6 years, 4 months ago (2014-07-30 21:03:58 UTC) #15
grt (UTC plus 2)
moar https://codereview.chromium.org/406043003/diff/220001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/220001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode109 chrome/browser/safe_browsing/module_integrity_verifier.cc:109: // Section size will be the same as ...
6 years, 4 months ago (2014-07-31 17:03:34 UTC) #16
krstnmnlsn
Greg pointed out it would make more sense to add the modified-export-handling code here (https://codereview.chromium.org/434163002/). ...
6 years, 4 months ago (2014-08-04 15:18:15 UTC) #17
krstnmnlsn
Greg pointed out it would make more sense to add the modified-export-handling code here (https://codereview.chromium.org/434163002/). ...
6 years, 4 months ago (2014-08-04 15:18:16 UTC) #18
krstnmnlsn
asvitkine@chromium.org: Please review histograms.xml Thanks again!
6 years, 4 months ago (2014-08-05 14:43:51 UTC) #19
Alexei Svitkine (slow)
https://codereview.chromium.org/406043003/diff/380001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc File chrome/browser/safe_browsing/module_integrity_verifier_win.cc (right): https://codereview.chromium.org/406043003/diff/380001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc#newcode175 chrome/browser/safe_browsing/module_integrity_verifier_win.cc:175: "SafeBrowsing.ModuleBaseRelocation", type, IMAGE_REL_BASED_DIR64 + 1); How do you know ...
6 years, 4 months ago (2014-08-05 14:51:21 UTC) #20
grt (UTC plus 2)
I'm uncomfortably excited. https://codereview.chromium.org/406043003/diff/280001/chrome/browser/safe_browsing/module_integrity_verifier.cc File chrome/browser/safe_browsing/module_integrity_verifier.cc (right): https://codereview.chromium.org/406043003/diff/280001/chrome/browser/safe_browsing/module_integrity_verifier.cc#newcode74 chrome/browser/safe_browsing/module_integrity_verifier.cc:74: &code_size)) On 2014/08/04 15:18:15, krstnmnlsn wrote: ...
6 years, 4 months ago (2014-08-05 15:51:56 UTC) #21
krstnmnlsn
Thanks for the feedback guys! Perhaps you should take a short lie down greg... https://codereview.chromium.org/406043003/diff/280001/chrome/browser/safe_browsing/module_integrity_verifier.cc ...
6 years, 4 months ago (2014-08-05 19:17:49 UTC) #22
Alexei Svitkine (slow)
https://codereview.chromium.org/406043003/diff/380001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc File chrome/browser/safe_browsing/module_integrity_verifier_win.cc (right): https://codereview.chromium.org/406043003/diff/380001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc#newcode175 chrome/browser/safe_browsing/module_integrity_verifier_win.cc:175: "SafeBrowsing.ModuleBaseRelocation", type, IMAGE_REL_BASED_DIR64 + 1); On 2014/08/05 19:17:48, krstnmnlsn ...
6 years, 4 months ago (2014-08-05 19:27:07 UTC) #23
grt (UTC plus 2)
On 2014/08/05 19:27:07, Alexei Svitkine wrote: > https://codereview.chromium.org/406043003/diff/380001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc > File chrome/browser/safe_browsing/module_integrity_verifier_win.cc (right): > > https://codereview.chromium.org/406043003/diff/380001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc#newcode175 ...
6 years, 4 months ago (2014-08-06 01:37:04 UTC) #24
grt (UTC plus 2)
responding to comments. will have another look at the code a bit later. https://codereview.chromium.org/406043003/diff/280001/chrome/browser/safe_browsing/module_integrity_verifier.cc File ...
6 years, 4 months ago (2014-08-06 01:52:50 UTC) #25
grt (UTC plus 2)
looks great. just some final nits. https://codereview.chromium.org/406043003/diff/420001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc File chrome/browser/safe_browsing/module_integrity_verifier_win.cc (right): https://codereview.chromium.org/406043003/diff/420001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc#newcode81 chrome/browser/safe_browsing/module_integrity_verifier_win.cc:81: // disk. The ...
6 years, 4 months ago (2014-08-06 15:07:08 UTC) #26
Alexei Svitkine (slow)
On Tue, Aug 5, 2014 at 9:37 PM, <grt@chromium.org> wrote: > > The Microsoft PE ...
6 years, 4 months ago (2014-08-06 15:15:12 UTC) #27
grt (UTC plus 2)
On 2014/08/06 15:15:12, Alexei Svitkine wrote: > On Tue, Aug 5, 2014 at 9:37 PM, ...
6 years, 4 months ago (2014-08-06 15:18:33 UTC) #28
krstnmnlsn
After much discussion now going with the SPARSE_SLOWLY histogram. Thanks all! https://codereview.chromium.org/406043003/diff/420001/chrome/browser/safe_browsing/module_integrity_verifier_win.cc File chrome/browser/safe_browsing/module_integrity_verifier_win.cc (right): ...
6 years, 4 months ago (2014-08-06 18:19:07 UTC) #29
Alexei Svitkine (slow)
lgtm, thanks By the way, since this CL is fairly large, you probably want to ...
6 years, 4 months ago (2014-08-06 18:29:45 UTC) #30
noelutz
lgtm
6 years, 4 months ago (2014-08-06 22:38:44 UTC) #31
grt (UTC plus 2)
lgtm. please follow asvitkine's advice about filing a bug with a summary along the lines ...
6 years, 4 months ago (2014-08-08 00:59:49 UTC) #32
krstnmnlsn
The CQ bit was checked by krstnmnlsn@chromium.org
6 years, 4 months ago (2014-08-08 05:12:45 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/krstnmnlsn@chromium.org/406043003/460001
6 years, 4 months ago (2014-08-08 05:13:59 UTC) #34
commit-bot: I haz the power
Change committed as 288319
6 years, 4 months ago (2014-08-08 10:46:47 UTC) #35
jam
6 years, 4 months ago (2014-08-08 15:02:07 UTC) #36
Message was sent while issue was closed.
this got reverted because the buildbots (and soon win trybots) were using
isolate. you will want to list the dll (verifier_test_dll.dll?) in
chrome\unit_tests.isolate

Powered by Google App Engine
This is Rietveld 408576698