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

Issue 183833004: Make chrome_elf use thunks instead of function pointers. (Closed)

Created:
6 years, 9 months ago by Cait (Slow)
Modified:
6 years, 9 months ago
CC:
chromium-reviews, caitkp+watch_chromium.org
Visibility:
Public.

Description

Make chrome_elf use thunks instead of function pointers. 1. Add functionality to ServiceResolverThunk to copy a thunk without patching. 2. Move chrome_elf thunk-handling code to a common location. 3. Use a thunk instead of a f'n ptr for redirects. BUG=334379 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255151 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257749

Patch Set 1 #

Total comments: 24

Patch Set 2 : Move all memory mgmt out of CopyThunk #

Total comments: 12

Patch Set 3 : Add size checks when copying thunk #

Patch Set 4 : No bad thunks in the lookup table #

Total comments: 4

Patch Set 5 : Clean up documentation #

Patch Set 6 : #

Patch Set 7 : Use thunk instead of lookup table #

Total comments: 6

Patch Set 8 : Address comments, add scoped ptr #

Unified diffs Side-by-side diffs Delta from patch set Stats (+323 lines, -139 lines) Patch
M chrome_elf/blacklist/blacklist.cc View 1 2 3 4 5 6 4 chunks +8 lines, -128 lines 0 comments Download
M chrome_elf/chrome_elf.gyp View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M chrome_elf/create_file/chrome_create_file.cc View 1 2 3 4 5 6 7 2 chunks +15 lines, -5 lines 0 comments Download
M chrome_elf/create_file/chrome_create_file_unittest.cc View 1 2 3 4 5 6 3 chunks +22 lines, -5 lines 0 comments Download
M chrome_elf/ntdll_cache.h View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome_elf/ntdll_cache.cc View 1 2 3 4 5 6 7 2 chunks +52 lines, -1 line 0 comments Download
A chrome_elf/thunk_getter.h View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
A chrome_elf/thunk_getter.cc View 1 2 1 chunk +142 lines, -0 lines 0 comments Download
M sandbox/win/src/service_resolver.h View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M sandbox/win/src/service_resolver_32.cc View 1 2 1 chunk +26 lines, -0 lines 0 comments Download
sandbox/win/src/service_resolver_64.cc View 1 2 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
Cait (Slow)
rvargas: PTAL at sandbox/ changes. I added a new public method to ServiceResolverThunk as we ...
6 years, 9 months ago (2014-02-27 22:31:03 UTC) #1
rvargas (doing something else)
https://codereview.chromium.org/183833004/diff/1/sandbox/win/src/service_resolver_32.cc File sandbox/win/src/service_resolver_32.cc (right): https://codereview.chromium.org/183833004/diff/1/sandbox/win/src/service_resolver_32.cc#newcode191 sandbox/win/src/service_resolver_32.cc:191: size_t thunk_bytes = GetThunkSize(); I'm fine with this code ...
6 years, 9 months ago (2014-02-28 19:40:09 UTC) #2
robertshield
https://codereview.chromium.org/183833004/diff/1/chrome_elf/ntdll_cache.cc File chrome_elf/ntdll_cache.cc (right): https://codereview.chromium.org/183833004/diff/1/chrome_elf/ntdll_cache.cc#newcode71 chrome_elf/ntdll_cache.cc:71: size_t storage_used; = 0 https://codereview.chromium.org/183833004/diff/1/chrome_elf/thunk_getter.cc File chrome_elf/thunk_getter.cc (right): https://codereview.chromium.org/183833004/diff/1/chrome_elf/thunk_getter.cc#newcode44 ...
6 years, 9 months ago (2014-02-28 21:02:22 UTC) #3
Cait (Slow)
PTAL. CopyThunk now just verifies that the target f'n is a service, and copies the ...
6 years, 9 months ago (2014-03-03 20:55:10 UTC) #4
rvargas (doing something else)
https://codereview.chromium.org/183833004/diff/40001/sandbox/win/src/service_resolver_32.cc File sandbox/win/src/service_resolver_32.cc (right): https://codereview.chromium.org/183833004/diff/40001/sandbox/win/src/service_resolver_32.cc#newcode191 sandbox/win/src/service_resolver_32.cc:191: size_t thunk_bytes = GetThunkSize(); Did you mean to compare ...
6 years, 9 months ago (2014-03-03 22:36:45 UTC) #5
robertshield
https://codereview.chromium.org/183833004/diff/40001/chrome_elf/ntdll_cache.cc File chrome_elf/ntdll_cache.cc (right): https://codereview.chromium.org/183833004/diff/40001/chrome_elf/ntdll_cache.cc#newcode68 chrome_elf/ntdll_cache.cc:68: if (!thunk) This implies that the rest of the ...
6 years, 9 months ago (2014-03-04 01:47:07 UTC) #6
Cait (Slow)
thanks! https://codereview.chromium.org/183833004/diff/40001/chrome_elf/ntdll_cache.cc File chrome_elf/ntdll_cache.cc (right): https://codereview.chromium.org/183833004/diff/40001/chrome_elf/ntdll_cache.cc#newcode68 chrome_elf/ntdll_cache.cc:68: if (!thunk) On 2014/03/04 01:47:07, robertshield wrote: > ...
6 years, 9 months ago (2014-03-04 15:43:56 UTC) #7
robertshield
lgtm https://codereview.chromium.org/183833004/diff/100001/chrome_elf/thunk_getter.h File chrome_elf/thunk_getter.h (right): https://codereview.chromium.org/183833004/diff/100001/chrome_elf/thunk_getter.h#newcode12 chrome_elf/thunk_getter.h:12: sandbox::ServiceResolverThunk* GetThunk(bool relaxed); Mention that ownership is passed ...
6 years, 9 months ago (2014-03-04 15:57:42 UTC) #8
rvargas (doing something else)
lgtm https://codereview.chromium.org/183833004/diff/100001/sandbox/win/src/service_resolver.h File sandbox/win/src/service_resolver.h (right): https://codereview.chromium.org/183833004/diff/100001/sandbox/win/src/service_resolver.h#newcode50 sandbox/win/src/service_resolver.h:50: // service and copy the first |storage_bytes| of ...
6 years, 9 months ago (2014-03-04 19:11:35 UTC) #9
Cait (Slow)
The CQ bit was checked by caitkp@chromium.org
6 years, 9 months ago (2014-03-04 20:35:52 UTC) #10
Cait (Slow)
Thanks for the reviews! https://codereview.chromium.org/183833004/diff/100001/chrome_elf/thunk_getter.h File chrome_elf/thunk_getter.h (right): https://codereview.chromium.org/183833004/diff/100001/chrome_elf/thunk_getter.h#newcode12 chrome_elf/thunk_getter.h:12: sandbox::ServiceResolverThunk* GetThunk(bool relaxed); On 2014/03/04 ...
6 years, 9 months ago (2014-03-04 20:36:04 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/caitkp@chromium.org/183833004/120001
6 years, 9 months ago (2014-03-04 20:37:39 UTC) #12
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 20:37:43 UTC) #13
commit-bot: I haz the power
Failed to apply patch for chrome_elf/blacklist/blacklist.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 9 months ago (2014-03-04 20:37:44 UTC) #14
Cait (Slow)
The CQ bit was checked by caitkp@chromium.org
6 years, 9 months ago (2014-03-04 21:01:25 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/caitkp@chromium.org/183833004/140001
6 years, 9 months ago (2014-03-04 21:02:14 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 22:00:29 UTC) #17
commit-bot: I haz the power
Retried try job too often on win_x64_rel for step(s) base_unittests, chrome_elf_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_x64_rel&number=81389
6 years, 9 months ago (2014-03-04 22:00:30 UTC) #18
Cait (Slow)
The CQ bit was checked by caitkp@chromium.org
6 years, 9 months ago (2014-03-05 20:01:57 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/caitkp@chromium.org/183833004/140001
6 years, 9 months ago (2014-03-05 20:02:30 UTC) #20
commit-bot: I haz the power
Change committed as 255151
6 years, 9 months ago (2014-03-05 21:32:23 UTC) #21
Cait (Slow)
Robert: PTAL -- here is a first pass at the changes we discussed. Thanks!
6 years, 9 months ago (2014-03-10 23:04:32 UTC) #22
robertshield
https://codereview.chromium.org/183833004/diff/160001/chrome_elf/create_file/chrome_create_file.cc File chrome_elf/create_file/chrome_create_file.cc (right): https://codereview.chromium.org/183833004/diff/160001/chrome_elf/create_file/chrome_create_file.cc#newcode192 chrome_elf/create_file/chrome_create_file.cc:192: char thunk_buffer[sizeof(sandbox::ThunkData)] = {}; Please add a comment that ...
6 years, 9 months ago (2014-03-17 22:21:26 UTC) #23
Cait (Slow)
https://codereview.chromium.org/183833004/diff/160001/chrome_elf/create_file/chrome_create_file.cc File chrome_elf/create_file/chrome_create_file.cc (right): https://codereview.chromium.org/183833004/diff/160001/chrome_elf/create_file/chrome_create_file.cc#newcode192 chrome_elf/create_file/chrome_create_file.cc:192: char thunk_buffer[sizeof(sandbox::ThunkData)] = {}; On 2014/03/17 22:21:27, robertshield wrote: ...
6 years, 9 months ago (2014-03-18 00:23:08 UTC) #24
robertshield
lgtm
6 years, 9 months ago (2014-03-18 00:40:06 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/caitkp@chromium.org/183833004/200001
6 years, 9 months ago (2014-03-18 00:40:41 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-18 03:25:02 UTC) #27
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) app_list_unittests, ash_unittests, aura_unittests, browser_tests, cacheinvalidation_unittests, cc_unittests, ...
6 years, 9 months ago (2014-03-18 03:25:03 UTC) #28
Cait (Slow)
The CQ bit was checked by caitkp@chromium.org
6 years, 9 months ago (2014-03-18 04:44:22 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/caitkp@chromium.org/183833004/200001
6 years, 9 months ago (2014-03-18 04:44:41 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-18 10:09:15 UTC) #31
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=283486
6 years, 9 months ago (2014-03-18 10:09:16 UTC) #32
Cait (Slow)
The CQ bit was checked by caitkp@chromium.org
6 years, 9 months ago (2014-03-18 16:35:00 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/caitkp@chromium.org/183833004/200001
6 years, 9 months ago (2014-03-18 16:39:47 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-18 18:43:58 UTC) #35
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
6 years, 9 months ago (2014-03-18 18:44:01 UTC) #36
Cait (Slow)
The CQ bit was checked by caitkp@chromium.org
6 years, 9 months ago (2014-03-18 18:47:30 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/caitkp@chromium.org/183833004/200001
6 years, 9 months ago (2014-03-18 19:18:02 UTC) #38
commit-bot: I haz the power
6 years, 9 months ago (2014-03-18 21:01:18 UTC) #39
Message was sent while issue was closed.
Change committed as 257749

Powered by Google App Engine
This is Rietveld 408576698