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

Issue 721553002: sandbox: Extend BrokerPolicy to support file creation (Closed)

Created:
6 years, 1 month ago by leecam
Modified:
6 years ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

sandbox: Extend Broker to support improved file permissions Added BrokerFilePermission class which is used to specify whitelists for the Broker BUG=432369 TEST=sandbox_linux_unittest, chrome on Ubuntu 14.04 and 14.10 Committed: https://crrev.com/ad78f42ca0a83d590ff9f32050adfcb277fb34d6 Cr-Commit-Position: refs/heads/master@{#305894}

Patch Set 1 #

Patch Set 2 : Added unlink #

Patch Set 3 : minor fix #

Total comments: 1

Patch Set 4 : Added new FilePermissionClass #

Patch Set 5 : rebase #

Patch Set 6 : Remove DRI3 fixes #

Patch Set 7 : Adding comments #

Total comments: 22

Patch Set 8 : refactor the class #

Patch Set 9 : make constructor private #

Total comments: 5

Patch Set 10 : Remove serialization #

Total comments: 32

Patch Set 11 : review fixups #

Total comments: 17

Patch Set 12 : jorge's comments #

Total comments: 5

Patch Set 13 : lame #

Total comments: 7

Patch Set 14 : rebase #

Total comments: 13

Patch Set 15 : jln review changes #

Total comments: 12

Patch Set 16 : fixing androids lack of string.back #

Patch Set 17 : nit #

Patch Set 18 : fix component build #

Total comments: 26

Patch Set 19 : codereview2 #

Total comments: 5

Patch Set 20 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+930 lines, -241 lines) Patch
M content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +17 lines, -25 lines 0 comments Download
M content/common/sandbox_linux/bpf_gpu_policy_linux.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -4 lines 0 comments Download
M content/common/sandbox_linux/bpf_gpu_policy_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +16 lines, -24 lines 0 comments Download
M sandbox/linux/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -0 lines 0 comments Download
M sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +9 lines, -6 lines 0 comments Download
M sandbox/linux/sandbox_linux.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M sandbox/linux/sandbox_linux_test_sources.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M sandbox/linux/syscall_broker/broker_client.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
A sandbox/linux/syscall_broker/broker_file_permission.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +119 lines, -0 lines 0 comments Download
A sandbox/linux/syscall_broker/broker_file_permission.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +243 lines, -0 lines 0 comments Download
A sandbox/linux/syscall_broker/broker_file_permission_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +262 lines, -0 lines 0 comments Download
M sandbox/linux/syscall_broker/broker_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +12 lines, -3 lines 0 comments Download
M sandbox/linux/syscall_broker/broker_policy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +26 lines, -12 lines 0 comments Download
M sandbox/linux/syscall_broker/broker_policy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +33 lines, -109 lines 0 comments Download
M sandbox/linux/syscall_broker/broker_process.h View 1 2 3 4 2 chunks +8 lines, -5 lines 0 comments Download
M sandbox/linux/syscall_broker/broker_process.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +6 lines, -6 lines 0 comments Download
M sandbox/linux/syscall_broker/broker_process_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 11 chunks +165 lines, -46 lines 0 comments Download

Messages

Total messages: 41 (2 generated)
leecam
This is still a work in progress but thought I'd put it up for see ...
6 years, 1 month ago (2014-11-12 01:47:39 UTC) #2
Jorge Lucangeli Obes
On 2014/11/12 01:47:39, leecam wrote: > This is still a work in progress but thought ...
6 years, 1 month ago (2014-11-12 17:29:29 UTC) #3
Jorge Lucangeli Obes
https://codereview.chromium.org/721553002/diff/40001/sandbox/linux/syscall_broker/broker_policy.h File sandbox/linux/syscall_broker/broker_policy.h (right): https://codereview.chromium.org/721553002/diff/40001/sandbox/linux/syscall_broker/broker_policy.h#newcode17 sandbox/linux/syscall_broker/broker_policy.h:17: struct BrokerPermission { I thought about this a little ...
6 years, 1 month ago (2014-11-12 17:29:42 UTC) #4
leecam
On 2014/11/12 17:29:42, Jorge Lucangeli Obes wrote: > https://codereview.chromium.org/721553002/diff/40001/sandbox/linux/syscall_broker/broker_policy.h > File sandbox/linux/syscall_broker/broker_policy.h (right): > > ...
6 years, 1 month ago (2014-11-12 18:36:14 UTC) #5
jln (DO NOT USE THIS)
On 2014/11/12 18:36:14, leecam wrote: > On 2014/11/12 17:29:42, Jorge Lucangeli Obes wrote: > > ...
6 years, 1 month ago (2014-11-13 14:07:55 UTC) #6
Jorge Lucangeli Obes
https://engdoc.corp.google.com/eng/doc/devguide/cpp/primer.shtml is a good document to read up in some of the conventions such as ...
6 years, 1 month ago (2014-11-14 18:48:07 UTC) #7
jln (very slow on Chromium)
Adding some high-level comments. I'm back and available if you want to discuss this in ...
6 years, 1 month ago (2014-11-18 01:24:46 UTC) #8
leecam
So Jorge wants a class and jln wants a struct...who wins? :) I'm easy but ...
6 years, 1 month ago (2014-11-18 21:40:54 UTC) #9
leecam
Oh also on a less semantic note, can someone review my validation logic (the ValidatePath ...
6 years, 1 month ago (2014-11-18 21:45:12 UTC) #10
jln (very slow on Chromium)
On 2014/11/18 21:45:12, leecam wrote: > Oh also on a less semantic note, can someone ...
6 years, 1 month ago (2014-11-18 21:48:50 UTC) #11
leecam
On 2014/11/18 21:48:50, jln wrote: > On 2014/11/18 21:45:12, leecam wrote: > > Oh also ...
6 years, 1 month ago (2014-11-18 21:50:34 UTC) #12
jln (very slow on Chromium)
On 2014/11/18 21:40:54, leecam wrote: > So Jorge wants a class and jln wants a ...
6 years, 1 month ago (2014-11-18 21:57:08 UTC) #13
leecam
On 2014/11/18 21:57:08, jln wrote: > On 2014/11/18 21:40:54, leecam wrote: > > So Jorge ...
6 years, 1 month ago (2014-11-18 22:07:32 UTC) #14
mdempsky
Looking good. https://codereview.chromium.org/721553002/diff/110001/content/common/sandbox_linux/bpf_gpu_policy_linux.cc File content/common/sandbox_linux/bpf_gpu_policy_linux.cc (right): https://codereview.chromium.org/721553002/diff/110001/content/common/sandbox_linux/bpf_gpu_policy_linux.cc#newcode35 content/common/sandbox_linux/bpf_gpu_policy_linux.cc:35: using sandbox::syscall_broker::BrokerFilePermission; Nit: Sort. (Technically I think ...
6 years, 1 month ago (2014-11-18 22:23:41 UTC) #15
leecam
So I refactored the class to mdempsky's suggestion. PTAL and let me know if we ...
6 years, 1 month ago (2014-11-19 00:27:23 UTC) #16
mdempsky
On 2014/11/19 00:27:23, leecam wrote: > So I refactored the class to mdempsky's suggestion. PTAL ...
6 years, 1 month ago (2014-11-19 00:30:16 UTC) #17
Jorge Lucangeli Obes
I think the API makes sense. https://codereview.chromium.org/721553002/diff/150001/sandbox/linux/syscall_broker/broker_file_permission.h File sandbox/linux/syscall_broker/broker_file_permission.h (right): https://codereview.chromium.org/721553002/diff/150001/sandbox/linux/syscall_broker/broker_file_permission.h#newcode52 sandbox/linux/syscall_broker/broker_file_permission.h:52: // Construct a ...
6 years, 1 month ago (2014-11-19 00:36:55 UTC) #18
jln (very slow on Chromium)
https://codereview.chromium.org/721553002/diff/150001/sandbox/linux/syscall_broker/broker_file_permission.h File sandbox/linux/syscall_broker/broker_file_permission.h (right): https://codereview.chromium.org/721553002/diff/150001/sandbox/linux/syscall_broker/broker_file_permission.h#newcode52 sandbox/linux/syscall_broker/broker_file_permission.h:52: // Construct a permission from a serilized pickle buffer. ...
6 years, 1 month ago (2014-11-19 00:44:24 UTC) #19
leecam
On 2014/11/19 00:44:24, jln wrote: > https://codereview.chromium.org/721553002/diff/150001/sandbox/linux/syscall_broker/broker_file_permission.h > File sandbox/linux/syscall_broker/broker_file_permission.h (right): > > https://codereview.chromium.org/721553002/diff/150001/sandbox/linux/syscall_broker/broker_file_permission.h#newcode52 > ...
6 years, 1 month ago (2014-11-19 00:50:50 UTC) #20
jln (very slow on Chromium)
I'm struggling with a massive headache, so only another small round of high level comments. ...
6 years, 1 month ago (2014-11-19 01:02:54 UTC) #21
jln (very slow on Chromium)
On 2014/11/19 00:50:50, leecam wrote: > On 2014/11/19 00:44:24, jln wrote: > > The current ...
6 years, 1 month ago (2014-11-19 01:08:10 UTC) #22
Jorge Lucangeli Obes
This looks good, let's try to get it in soon. https://codereview.chromium.org/721553002/diff/170001/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc File content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc (right): https://codereview.chromium.org/721553002/diff/170001/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc#newcode35 ...
6 years, 1 month ago (2014-11-20 00:13:20 UTC) #23
leecam
https://codereview.chromium.org/721553002/diff/170001/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc File content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc (right): https://codereview.chromium.org/721553002/diff/170001/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc#newcode35 content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc:35: using sandbox::syscall_broker::BrokerFilePermission; On 2014/11/20 00:13:20, Jorge Lucangeli Obes wrote: ...
6 years, 1 month ago (2014-11-20 00:56:39 UTC) #24
Jorge Lucangeli Obes
I think the logic here is sound, apart from the possible mix-up between trailing slashes. ...
6 years, 1 month ago (2014-11-20 21:03:00 UTC) #25
leecam
Thanks Jorge. I think my slash logic is correct as is...see comments. https://codereview.chromium.org/721553002/diff/190001/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc File content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc ...
6 years, 1 month ago (2014-11-20 21:46:20 UTC) #26
Jorge Lucangeli Obes
Two nits missing from the previous PS, I think the logic is sound. https://chromiumcodereview.appspot.com/721553002/diff/210001/sandbox/linux/syscall_broker/broker_file_permission.cc File ...
6 years, 1 month ago (2014-11-20 22:20:15 UTC) #27
leecam
https://chromiumcodereview.appspot.com/721553002/diff/210001/sandbox/linux/syscall_broker/broker_file_permission.cc File sandbox/linux/syscall_broker/broker_file_permission.cc (right): https://chromiumcodereview.appspot.com/721553002/diff/210001/sandbox/linux/syscall_broker/broker_file_permission.cc#newcode167 sandbox/linux/syscall_broker/broker_file_permission.cc:167: // If this file is to be unlinked, ensure ...
6 years, 1 month ago (2014-11-20 22:27:08 UTC) #28
Jorge Lucangeli Obes
This lgtm, don't know if Matthew or Julien have other comments.
6 years, 1 month ago (2014-11-20 23:25:12 UTC) #29
jln (very slow on Chromium)
On 2014/11/20 23:25:12, Jorge Lucangeli Obes wrote: > This lgtm, don't know if Matthew or ...
6 years, 1 month ago (2014-11-21 22:22:06 UTC) #30
jln (very slow on Chromium)
This is in good shape. Please, create a broker_file_permission_unittest.cc and add a few tests there. ...
6 years ago (2014-11-24 20:12:17 UTC) #31
jln (very slow on Chromium)
Also my apologies for straddling multiple patchsets. I miss-clicked in the review tool at some ...
6 years ago (2014-11-24 20:12:50 UTC) #32
leecam
Ok I think that's everything addressed. https://chromiumcodereview.appspot.com/721553002/diff/170001/sandbox/linux/syscall_broker/broker_file_permission.cc File sandbox/linux/syscall_broker/broker_file_permission.cc (right): https://chromiumcodereview.appspot.com/721553002/diff/170001/sandbox/linux/syscall_broker/broker_file_permission.cc#newcode21 sandbox/linux/syscall_broker/broker_file_permission.cc:21: bool ValidatePath(const char* ...
6 years ago (2014-11-25 02:06:50 UTC) #33
jln (very slow on Chromium)
Looking good. But a few more nits. In general: remember to add comments. They're especially ...
6 years ago (2014-11-26 01:02:32 UTC) #34
leecam
Done changes... https://chromiumcodereview.appspot.com/721553002/diff/270001/sandbox/linux/syscall_broker/broker_file_permission.h File sandbox/linux/syscall_broker/broker_file_permission.h (right): https://chromiumcodereview.appspot.com/721553002/diff/270001/sandbox/linux/syscall_broker/broker_file_permission.h#newcode62 sandbox/linux/syscall_broker/broker_file_permission.h:62: // |unlink_after_open| is set to point to ...
6 years ago (2014-11-26 18:35:34 UTC) #35
jln (very slow on Chromium)
lgtm, with a few more nits https://chromiumcodereview.appspot.com/721553002/diff/330001/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc File sandbox/linux/syscall_broker/broker_file_permission_unittest.cc (right): https://chromiumcodereview.appspot.com/721553002/diff/330001/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc#newcode90 sandbox/linux/syscall_broker/broker_file_permission_unittest.cc:90: for (int i ...
6 years ago (2014-11-26 19:49:06 UTC) #36
leecam
https://chromiumcodereview.appspot.com/721553002/diff/330001/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc File sandbox/linux/syscall_broker/broker_file_permission_unittest.cc (right): https://chromiumcodereview.appspot.com/721553002/diff/330001/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc#newcode90 sandbox/linux/syscall_broker/broker_file_permission_unittest.cc:90: for (int i = 2; i < 32; i++) ...
6 years ago (2014-11-26 20:55:47 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/721553002/370001
6 years ago (2014-11-26 20:57:18 UTC) #39
commit-bot: I haz the power
Committed patchset #20 (id:370001)
6 years ago (2014-11-26 22:08:53 UTC) #40
commit-bot: I haz the power
6 years ago (2014-11-26 22:09:58 UTC) #41
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/ad78f42ca0a83d590ff9f32050adfcb277fb34d6
Cr-Commit-Position: refs/heads/master@{#305894}

Powered by Google App Engine
This is Rietveld 408576698