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

Issue 2534873005: Sandbox the component updater's patcher utility process. (Closed)

Created:
4 years ago by waffles
Modified:
4 years ago
CC:
chromium-reviews, wfh+watch_chromium.org, huangs+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Sandbox the component updater's patcher utility process. The code will now open files in the browser process before passing the handles across IPC to the utility process. The utility process in turn invokes courgette/bsdiff, which memory maps the files and operates on them as before. There is a behavioral difference when using the courgette or courgette_mini tools: the output file will now be created/overwritten at the start of the operation, and in the case of a failure, will be deleted. Previously, the output file was created late in the operation operation and several failure modes would leave it unmodified. BUG=660325 Committed: https://crrev.com/53796c72e2ec50eec77f0bd79ec0c8426cee4d58 Cr-Commit-Position: refs/heads/master@{#437669}

Patch Set 1 #

Total comments: 13

Patch Set 2 : Through #14 #

Total comments: 2

Patch Set 3 : Through #18 #

Total comments: 2

Patch Set 4 : Through #29 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -68 lines) Patch
M chrome/browser/component_updater/component_patcher_operation_out_of_process.cc View 3 chunks +15 lines, -3 lines 0 comments Download
M chrome/common/chrome_utility_messages.h View 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/utility/chrome_content_utility_client.h View 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/utility/chrome_content_utility_client.cc View 1 chunk +16 lines, -23 lines 2 comments Download
M courgette/courgette.h View 1 2 chunks +10 lines, -0 lines 0 comments Download
M courgette/ensemble_apply.cc View 1 2 3 4 chunks +36 lines, -19 lines 0 comments Download
M courgette/third_party/bsdiff/bsdiff.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M courgette/third_party/bsdiff/bsdiff_apply.cc View 1 2 3 3 chunks +33 lines, -11 lines 0 comments Download

Messages

Total messages: 49 (25 generated)
waffles
Hi all, please take a look at this change to sandbox the component updater's patcher ...
4 years ago (2016-11-29 02:35:02 UTC) #4
Sorin Jianu
lgtm Thank you! component_updater lgtm
4 years ago (2016-11-29 18:42:05 UTC) #7
dcheng
ipc lgtm
4 years ago (2016-11-29 21:30:19 UTC) #8
waffles
I know a few of you were OOO last week; pinging this in case you ...
4 years ago (2016-12-06 18:01:07 UTC) #9
huangs
Acknowledge. Sorry for not seeing this earlier!
4 years ago (2016-12-06 18:10:16 UTC) #10
huangs
https://codereview.chromium.org/2534873005/diff/1/courgette/third_party/bsdiff/bsdiff.h File courgette/third_party/bsdiff/bsdiff.h (right): https://codereview.chromium.org/2534873005/diff/1/courgette/third_party/bsdiff/bsdiff.h#newcode88 courgette/third_party/bsdiff/bsdiff.h:88: // As above, but simply takes base::Files. Please move ...
4 years ago (2016-12-06 18:10:40 UTC) #11
Greg K
On 2016/12/06 18:10:40, huangs wrote: > https://codereview.chromium.org/2534873005/diff/1/courgette/third_party/bsdiff/bsdiff.h > File courgette/third_party/bsdiff/bsdiff.h (right): > > https://codereview.chromium.org/2534873005/diff/1/courgette/third_party/bsdiff/bsdiff.h#newcode88 > ...
4 years ago (2016-12-06 18:16:41 UTC) #12
huangs
More comments. https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h File courgette/courgette.h (right): https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h#newcode13 courgette/courgette.h:13: class File; Same comment as in bsdiff.h: ...
4 years ago (2016-12-06 18:23:22 UTC) #13
huangs
https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h File courgette/courgette.h (right): https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h#newcode90 courgette/courgette.h:90: // Applies the patch in |patch_file| to the bytes ...
4 years ago (2016-12-06 18:30:32 UTC) #14
waffles
https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h File courgette/courgette.h (right): https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h#newcode13 courgette/courgette.h:13: class File; On 2016/12/06 18:23:22, huangs wrote: > Same ...
4 years ago (2016-12-06 19:18:46 UTC) #16
huangs
https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h File courgette/courgette.h (right): https://codereview.chromium.org/2534873005/diff/1/courgette/courgette.h#newcode90 courgette/courgette.h:90: // Applies the patch in |patch_file| to the bytes ...
4 years ago (2016-12-06 19:40:07 UTC) #18
waffles
https://codereview.chromium.org/2534873005/diff/1/courgette/third_party/bsdiff/bsdiff_apply.cc File courgette/third_party/bsdiff/bsdiff_apply.cc (right): https://codereview.chromium.org/2534873005/diff/1/courgette/third_party/bsdiff/bsdiff_apply.cc#newcode237 courgette/third_party/bsdiff/bsdiff_apply.cc:237: // Write the stream to disk. On 2016/12/06 19:40:07, ...
4 years ago (2016-12-06 19:46:22 UTC) #20
huangs
Thanks! LGTM re. Courgette code.
4 years ago (2016-12-06 19:59:10 UTC) #24
jam
which files do you want me to review? if chrome/utility, lgtm
4 years ago (2016-12-07 00:06:16 UTC) #28
grt (UTC plus 2)
https://codereview.chromium.org/2534873005/diff/40001/courgette/ensemble_apply.cc File courgette/ensemble_apply.cc (right): https://codereview.chromium.org/2534873005/diff/40001/courgette/ensemble_apply.cc#newcode433 courgette/ensemble_apply.cc:433: } is there a reason not to delete the ...
4 years ago (2016-12-07 10:14:42 UTC) #29
waffles
jam: Yes, just utility, thank you very much! https://codereview.chromium.org/2534873005/diff/40001/courgette/ensemble_apply.cc File courgette/ensemble_apply.cc (right): https://codereview.chromium.org/2534873005/diff/40001/courgette/ensemble_apply.cc#newcode433 courgette/ensemble_apply.cc:433: } ...
4 years ago (2016-12-09 18:27:46 UTC) #30
huangs
Please also update CL description to reflect this. Now Courgette-apply would always overwrite file, and ...
4 years ago (2016-12-09 19:12:57 UTC) #33
waffles
On 2016/12/09 19:12:57, huangs wrote: > Please also update CL description to reflect this. Now ...
4 years ago (2016-12-09 19:15:19 UTC) #35
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/2534873005/60001
4 years ago (2016-12-09 21:38:34 UTC) #40
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-12-09 22:10:06 UTC) #43
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/53796c72e2ec50eec77f0bd79ec0c8426cee4d58 Cr-Commit-Position: refs/heads/master@{#437669}
4 years ago (2016-12-12 14:56:56 UTC) #45
Noel Gordon
https://codereview.chromium.org/2534873005/diff/60001/chrome/utility/chrome_content_utility_client.cc File chrome/utility/chrome_content_utility_client.cc (left): https://codereview.chromium.org/2534873005/diff/60001/chrome/utility/chrome_content_utility_client.cc#oldcode274 chrome/utility/chrome_content_utility_client.cc:274: if (input_file.empty() || patch_file.empty() || output_file.empty()) { The empty ...
4 years ago (2016-12-13 05:42:08 UTC) #47
waffles
https://codereview.chromium.org/2534873005/diff/60001/chrome/utility/chrome_content_utility_client.cc File chrome/utility/chrome_content_utility_client.cc (left): https://codereview.chromium.org/2534873005/diff/60001/chrome/utility/chrome_content_utility_client.cc#oldcode274 chrome/utility/chrome_content_utility_client.cc:274: if (input_file.empty() || patch_file.empty() || output_file.empty()) { On 2016/12/13 ...
4 years ago (2016-12-13 17:38:28 UTC) #48
Noel Gordon
4 years ago (2016-12-21 09:46:40 UTC) #49
Message was sent while issue was closed.
On 2016/12/13 17:38:28, waffles (ooo Jan10 use sorin) wrote:
>
https://codereview.chromium.org/2534873005/diff/60001/chrome/utility/chrome_c...
> File chrome/utility/chrome_content_utility_client.cc (left):
> 
>
https://codereview.chromium.org/2534873005/diff/60001/chrome/utility/chrome_c...
> chrome/utility/chrome_content_utility_client.cc:274: if (input_file.empty() ||
> patch_file.empty() || output_file.empty()) {
> On 2016/12/13 05:42:08, noel gordon wrote:
> > The empty file path detection code was removed here, and I do not see it in
> > component_patcher_operation_out_of_process.cc. 
> > 
> > So it seems we completely removed the empty path check.  How come? (The
change
> > description for this patch doesn't say).
> 
> It doesn't make sense to check it here, because we're receiving a file handle,
> not a path. We could do some defensive code in
> component_patcher_operation_out_of_process to verify it isn't called with
empty
> paths.

Right, or DCHECK they are not empty or something.

> Is this causing a problem?

Maybe.  No tests failed, but that's because there are no tests [1], which seems
potentially problematic to me.

[1] https://codereview.chromium.org/2597513003

Powered by Google App Engine
This is Rietveld 408576698