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

Issue 670603002: Linux sandbox: Tighten up the NaCl sandbox policy. (Closed)

Created:
6 years, 2 months ago by rickyz (no longer on Chrome)
Modified:
6 years, 1 month ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Linux sandbox: Tighten up the NaCl sandbox policy. Previously, we allowed socket syscalls which were only needed by the NaCl gdb stub. Now, we only allow these syscalls when the --enable-nacl-debug flag is present. Also restricts cross-process interaction for sched_* syscalls now that non-crashing SIGSYS handlers are allowed under NaCl. BUG=270914, 413855 Committed: https://crrev.com/3638a21d79c71ed0b18c1591ce2caea86cfb1aba Cr-Commit-Position: refs/heads/master@{#301982}

Patch Set 1 #

Patch Set 2 : Also restrict sched_* #

Patch Set 3 : Disable the sandbox for debug stub tests. #

Patch Set 4 : Add missing include. #

Total comments: 6

Patch Set 5 : Allow syscalls when nacl debug stub is enabled. #

Patch Set 6 : Forward the enable-nacl-debug flag through. #

Total comments: 5

Patch Set 7 : Make NaClBPFSandboxPolicy subclass sandbox::BaselinePolicy. #

Patch Set 8 : Have a pid member instead. #

Total comments: 3

Patch Set 9 : Respond to comments #

Patch Set 10 : Rebase #

Total comments: 10

Patch Set 11 : Respond to more comments. #

Patch Set 12 : Add check on policy_pid #

Total comments: 1

Patch Set 13 : Switch to DCHECK #

Patch Set 14 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -15 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M components/nacl/loader/DEPS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +46 lines, -15 lines 0 comments Download
M components/nacl/zygote/nacl_fork_delegate_linux.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 28 (5 generated)
rickyz (no longer on Chrome)
Here's a change to block syscalls that were previously only enabled for testing the gdb ...
6 years, 2 months ago (2014-10-21 21:17:09 UTC) #2
Mark Seaborn
https://codereview.chromium.org/670603002/diff/60001/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc File chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc (right): https://codereview.chromium.org/670603002/diff/60001/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc#newcode34 chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc:34: // The debug stub requires --no-sandbox. Well, we don't ...
6 years, 2 months ago (2014-10-21 22:08:40 UTC) #3
rickyz (no longer on Chrome)
https://codereview.chromium.org/670603002/diff/60001/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc File chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc (right): https://codereview.chromium.org/670603002/diff/60001/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc#newcode34 chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc:34: // The debug stub requires --no-sandbox. On 2014/10/21 22:08:40, ...
6 years, 2 months ago (2014-10-22 03:25:06 UTC) #4
jln (very slow on Chromium)
Excellent Ricky, thanks! Just a couple of nits. https://chromiumcodereview.appspot.com/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://chromiumcodereview.appspot.com/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode61 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:61: if ...
6 years, 2 months ago (2014-10-23 17:51:55 UTC) #5
rickyz (no longer on Chrome)
https://codereview.chromium.org/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://codereview.chromium.org/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode61 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:61: if (command_line->HasSwitch(switches::kEnableNaClDebug)) { On 2014/10/23 17:51:55, jln wrote: > ...
6 years, 2 months ago (2014-10-23 20:05:31 UTC) #6
jln (very slow on Chromium)
https://codereview.chromium.org/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://codereview.chromium.org/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode42 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:42: : baseline_policy_(content::GetBPFSandboxBaselinePolicy()) {} NaCl's sandbox policy was based on ...
6 years, 2 months ago (2014-10-23 22:37:20 UTC) #7
rickyz (no longer on Chrome)
On 2014/10/23 22:37:20, jln wrote: > https://codereview.chromium.org/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc > File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): > > https://codereview.chromium.org/670603002/diff/100001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode42 > ...
6 years, 2 months ago (2014-10-24 20:17:40 UTC) #8
jln (very slow on Chromium)
lgtm (please make sure Mark approves it as well). https://codereview.chromium.org/670603002/diff/140001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://codereview.chromium.org/670603002/diff/140001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode48 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:48: ...
6 years, 2 months ago (2014-10-24 20:38:35 UTC) #9
jln (very slow on Chromium)
https://codereview.chromium.org/670603002/diff/140001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://codereview.chromium.org/670603002/diff/140001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode80 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:80: #endif style: add "default:" with a // Fallthrough comment.
6 years, 2 months ago (2014-10-24 20:48:11 UTC) #10
rickyz (no longer on Chrome)
On 2014/10/24 20:48:11, jln wrote: > https://codereview.chromium.org/670603002/diff/140001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc > File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): > > https://codereview.chromium.org/670603002/diff/140001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode80 > ...
6 years, 2 months ago (2014-10-24 21:58:23 UTC) #11
jln (very slow on Chromium)
> Responded to the rest of your comments, but wasn't quite sure what you mean ...
6 years, 2 months ago (2014-10-24 22:00:19 UTC) #12
Mark Seaborn
LGTM. Will Bugdroid recognise "BUG=270914, 413855", BTW, or do these need to be on two ...
6 years, 1 month ago (2014-10-28 00:30:14 UTC) #13
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/670603002/diff/180001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://chromiumcodereview.appspot.com/670603002/diff/180001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode127 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:127: return sandbox::RestrictSchedTarget(policy_pid_, sysno); On 2014/10/28 00:30:14, Mark Seaborn wrote: ...
6 years, 1 month ago (2014-10-29 18:40:17 UTC) #14
jln (very slow on Chromium)
On 2014/10/28 00:30:14, Mark Seaborn wrote: > LGTM. Will Bugdroid recognise "BUG=270914, 413855", BTW, or ...
6 years, 1 month ago (2014-10-29 18:40:51 UTC) #15
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/670603002/diff/180001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://chromiumcodereview.appspot.com/670603002/diff/180001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode61 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:61: pid_t policy_pid_; const
6 years, 1 month ago (2014-10-29 18:44:45 UTC) #16
rickyz (no longer on Chrome)
Thanks for the comments - will CQ once try bots pass https://codereview.chromium.org/670603002/diff/180001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (left): ...
6 years, 1 month ago (2014-10-29 21:07:36 UTC) #17
jln (very slow on Chromium)
https://codereview.chromium.org/670603002/diff/220001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): https://codereview.chromium.org/670603002/diff/220001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc#newcode74 components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc:74: CHECK_EQ(policy_pid_, syscall(__NR_getpid)); If you would rather keep this, could ...
6 years, 1 month ago (2014-10-29 21:40:07 UTC) #18
rickyz (no longer on Chrome)
On 2014/10/29 21:40:07, jln (OOO til 29th) wrote: > https://codereview.chromium.org/670603002/diff/220001/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc > File components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc (right): > ...
6 years, 1 month ago (2014-10-29 22:04:04 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/670603002/240001
6 years, 1 month ago (2014-10-29 22:07:26 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu/builds/85891) mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/75479) win_gpu ...
6 years, 1 month ago (2014-10-29 22:14:59 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/670603002/260001
6 years, 1 month ago (2014-10-29 22:26:49 UTC) #26
commit-bot: I haz the power
Committed patchset #14 (id:260001)
6 years, 1 month ago (2014-10-29 23:50:34 UTC) #27
commit-bot: I haz the power
6 years, 1 month ago (2014-10-29 23:51:16 UTC) #28
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/3638a21d79c71ed0b18c1591ce2caea86cfb1aba
Cr-Commit-Position: refs/heads/master@{#301982}

Powered by Google App Engine
This is Rietveld 408576698