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

Issue 490043002: Improve the ScopedHandle verifier. (Closed)

Created:
6 years, 4 months ago by rvargas (doing something else)
Modified:
5 years, 4 months ago
Reviewers:
cpu_(ooo_6.6-7.5), sky
CC:
chromium-reviews, wfh+watch_chromium.org, erikwright+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Improve the ScopedHandle verifier. 1. Automate the selection of the proper channel to enable the verifier. Now the code is enabled at runtime. 2. Switch to a hash_map to track handles. 3. Intercept CloseHandle to detect the code that is closing handles owned by ScopedHandles. The initial implementation only covers chrome.exe/dll, but the plan is to extend that in the future to all modules loaded in the process. BUG=362176 R=cpu@chromium.org

Patch Set 1 : #

Total comments: 10

Patch Set 2 : Fix gcc #

Patch Set 3 : Remove cast #

Total comments: 5

Patch Set 4 : Common sources section #

Unified diffs Side-by-side diffs Delta from patch set Stats (+260 lines, -31 lines) Patch
M base/win/scoped_handle.h View 3 chunks +13 lines, -6 lines 0 comments Download
M base/win/scoped_handle.cc View 1 2 4 chunks +92 lines, -7 lines 0 comments Download
M chrome/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/chrome_main.cc View 3 chunks +4 lines, -0 lines 0 comments Download
A chrome/app/close_handle_hook_win.h View 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/app/close_handle_hook_win.cc View 1 chunk +118 lines, -0 lines 0 comments Download
M chrome/chrome_dll.gypi View 1 2 3 4 chunks +17 lines, -18 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
rvargas (doing something else)
PTAL
6 years, 4 months ago (2014-08-21 02:57:28 UTC) #1
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc File base/win/scoped_handle.cc (right): https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc#newcode63 base/win/scoped_handle.cc:63: template <> this branch is for nacl? https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc#newcode67 base/win/scoped_handle.cc:67: ...
6 years, 4 months ago (2014-08-22 01:52:05 UTC) #2
rvargas (doing something else)
Thanks https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc File base/win/scoped_handle.cc (right): https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc#newcode63 base/win/scoped_handle.cc:63: template <> On 2014/08/22 01:52:04, cpu (slow to ...
6 years, 4 months ago (2014-08-22 02:10:32 UTC) #3
cpu_(ooo_6.6-7.5)
lets have the hash be pretty and then lgtm. https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc File base/win/scoped_handle.cc (right): https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc#newcode63 base/win/scoped_handle.cc:63: ...
6 years, 4 months ago (2014-08-22 22:10:21 UTC) #4
rvargas (doing something else)
Thanks https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc File base/win/scoped_handle.cc (right): https://codereview.chromium.org/490043002/diff/40001/base/win/scoped_handle.cc#newcode67 base/win/scoped_handle.cc:67: return base::Hash(reinterpret_cast<char*>(&int_handle), sizeof(int_handle)); On 2014/08/22 22:10:20, cpu wrote: ...
6 years, 4 months ago (2014-08-23 02:22:07 UTC) #5
cpu_(ooo_6.6-7.5)
still lgtm
6 years, 3 months ago (2014-08-25 18:18:50 UTC) #6
rvargas (doing something else)
rvargas@chromium.org changed reviewers: + sky@chromium.org
6 years, 3 months ago (2014-08-25 19:36:24 UTC) #7
rvargas (doing something else)
sky: The only file that lacks owner's approval is chrome_dll.gypi. Do you mind taking a ...
6 years, 3 months ago (2014-08-25 19:36:24 UTC) #8
sky
https://codereview.chromium.org/490043002/diff/80001/chrome/chrome_dll.gypi File chrome/chrome_dll.gypi (right): https://codereview.chromium.org/490043002/diff/80001/chrome/chrome_dll.gypi#newcode74 chrome/chrome_dll.gypi:74: # GN version: //chrome:main_dll Do you need to update ...
6 years, 3 months ago (2014-08-25 19:58:49 UTC) #9
rvargas (doing something else)
Thanks https://codereview.chromium.org/490043002/diff/80001/chrome/chrome_dll.gypi File chrome/chrome_dll.gypi (right): https://codereview.chromium.org/490043002/diff/80001/chrome/chrome_dll.gypi#newcode74 chrome/chrome_dll.gypi:74: # GN version: //chrome:main_dll On 2014/08/25 19:58:49, sky ...
6 years, 3 months ago (2014-08-25 21:25:48 UTC) #10
sky
LGTM https://codereview.chromium.org/490043002/diff/80001/chrome/chrome_dll.gypi File chrome/chrome_dll.gypi (right): https://codereview.chromium.org/490043002/diff/80001/chrome/chrome_dll.gypi#newcode126 chrome/chrome_dll.gypi:126: 'app/close_handle_hook_win.cc', On 2014/08/25 21:25:48, rvargas wrote: > On ...
6 years, 3 months ago (2014-08-25 22:49:07 UTC) #11
rvargas (doing something else)
The CQ bit was checked by rvargas@chromium.org
6 years, 3 months ago (2014-08-25 23:07:52 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rvargas@chromium.org/490043002/100001
6 years, 3 months ago (2014-08-25 23:08:49 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 3 months ago (2014-08-26 01:17:20 UTC) #14
commit-bot: I haz the power
Failed to commit the patch.
6 years, 3 months ago (2014-08-26 01:17:22 UTC) #15
rvargas (doing something else)
The CQ bit was checked by rvargas@chromium.org
6 years, 3 months ago (2014-08-26 18:03:40 UTC) #16
rvargas (doing something else)
The CQ bit was unchecked by rvargas@chromium.org
6 years, 3 months ago (2014-08-26 18:03:46 UTC) #17
rvargas (doing something else)
Patchset #5 (id:120001) has been deleted
6 years, 3 months ago (2014-08-26 18:07:26 UTC) #18
Nico
On 2014/08/26 18:07:26, rvargas wrote: > Patchset #5 (id:120001) has been deleted Why did you ...
5 years, 4 months ago (2015-08-15 00:22:31 UTC) #19
rvargas (doing something else)
On 2015/08/15 00:22:31, Nico (hiding) wrote: > On 2014/08/26 18:07:26, rvargas wrote: > > Patchset ...
5 years, 4 months ago (2015-08-15 00:31:27 UTC) #20
rvargas (doing something else)
On 2015/08/15 00:31:27, rvargas wrote: > On 2015/08/15 00:22:31, Nico (hiding) wrote: > > On ...
5 years, 4 months ago (2015-08-15 00:31:59 UTC) #21
rvargas (doing something else)
On 2015/08/15 00:31:59, rvargas wrote: > On 2015/08/15 00:31:27, rvargas wrote: > > On 2015/08/15 ...
5 years, 4 months ago (2015-08-15 00:52:20 UTC) #22
rvargas (doing something else)
5 years, 4 months ago (2015-08-15 01:01:00 UTC) #23
Message was sent while issue was closed.
On 2015/08/15 00:52:20, rvargas wrote:
> On 2015/08/15 00:31:59, rvargas wrote:
> > On 2015/08/15 00:31:27, rvargas wrote:
> > > On 2015/08/15 00:22:31, Nico (hiding) wrote:
> > > > On 2014/08/26 18:07:26, rvargas wrote:
> > > > > Patchset #5 (id:120001) has been deleted
> > > > 
> > > > Why did you delete the patch set that was landed? :-)
> > > 
> > > This never landed. See https://codereview.chromium.org/490043002/ instead.
I
> > > have no idea why #18 says it landed (I think something was acting up and I
> > > started from scratch)
> > 
> > and by that I meant https://codereview.chromium.org/506013004/
> 
> What a mess... that was then reverted and landed as
> https://codereview.chromium.org/510633002
> 
> ... and at some point during that review it looks like for some reason I moved
> from where I was going (containers/hash_tables.h) to unordered_map.
> 
> :(
> 
> I'm guessing you care about compiling this with clang?
> 
> > 
> > > 
> > > 
> > > > 
> > > > Looks like this adds an include of unordered_map –&nbsp;please don't use
> > C++11
> > > > library features yet.
> > > 
> > > ah? where? who?

Some memories are starting to come back...

I believe
https://codereview.chromium.org/510633002/diff2/40001:60001/base/win/scoped_h...
is the result of PS3 failing on x64 because the hash function is never invoked
(something to do with HANDLE being a void* and some other hash being selected
before mine).

Do you mind opening a bug?

Powered by Google App Engine
This is Rietveld 408576698