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

Issue 759473002: Linux sandbox: change seccomp detection and initialization. (Closed)

Created:
6 years ago by jln (very slow on Chromium)
Modified:
6 years ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jln+watch_chromium.org, Robert Sesek, hidehiko, Mark Seaborn
Base URL:
https://chromium.googlesource.com/chromium/src.git@refactor_startsandbox
Project:
chromium
Visibility:
Public.

Description

Linux sandbox: change seccomp detection and initialization. Change how we detect seccomp kernel support and its initialization. Before, detecting seccomp kernel supports would involve starting probe processes that would enable seccomp. A crash would mean that seccomp was not supported. This was necessary with old kernel version and old glibc versions that were problematic. Now that these shouldn't exist in the field, we move the checks to unit tests instead. Following the refactor in https://chromiumcodereview.appspot.com/733303004/ we can greatly simplify both detection and starting of the sandbox to make the API more sane. BUG=434820 TBR=piman Committed: https://crrev.com/bd576720e621951616af892bcf03ffaac49f1881 Cr-Commit-Position: refs/heads/master@{#305706}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Nits. #

Patch Set 3 : Rebase #

Total comments: 2

Patch Set 4 : Fix Android + NonSFI NaCl #

Total comments: 6

Patch Set 5 : Switch SeccompLevel to an enum class. #

Total comments: 3

Patch Set 6 : Appease dumb compilers. #

Total comments: 2

Patch Set 7 : Rebase #

Patch Set 8 : Get rid of SeccompLevel::INVALID #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -337 lines) Patch
M components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc View 1 2 3 4 2 chunks +3 lines, -6 lines 0 comments Download
M content/renderer/renderer_main_platform_delegate_android.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc View 1 2 3 4 10 chunks +42 lines, -20 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.h View 1 2 3 4 5 6 7 6 chunks +21 lines, -48 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.cc View 1 2 3 4 5 6 7 5 chunks +42 lines, -252 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers.h View 2 chunks +8 lines, -0 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers.cc View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (8 generated)
jln (very slow on Chromium)
mdempsky: PTAL! keescook: could you please sanity check KernelSupportsSeccompBPF() and KernelSupportsSeccompTsync() in sandbox/linux/seccomp-bpf/sandbox_bpf.cc ? rsesek: ...
6 years ago (2014-11-25 01:24:29 UTC) #2
mdempsky
lgtm https://codereview.chromium.org/759473002/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.h File sandbox/linux/seccomp-bpf/sandbox_bpf.h (right): https://codereview.chromium.org/759473002/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.h#newcode24 sandbox/linux/seccomp-bpf/sandbox_bpf.h:24: enum SeccompLevel { On 2014/11/25 01:24:29, jln wrote: ...
6 years ago (2014-11-25 03:14:06 UTC) #3
jln (very slow on Chromium)
https://codereview.chromium.org/759473002/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.h File sandbox/linux/seccomp-bpf/sandbox_bpf.h (right): https://codereview.chromium.org/759473002/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.h#newcode24 sandbox/linux/seccomp-bpf/sandbox_bpf.h:24: enum SeccompLevel { On 2014/11/25 03:14:06, mdempsky wrote: > ...
6 years ago (2014-11-25 03:36:01 UTC) #4
mdempsky_google
On 2014/11/25 03:36:01, jln wrote: > I considered that, but in practice in content:: the ...
6 years ago (2014-11-25 03:44:54 UTC) #5
jln (very slow on Chromium)
On 2014/11/25 03:44:54, mdempsky_google wrote: > On 2014/11/25 03:36:01, jln wrote: > > I considered ...
6 years ago (2014-11-25 05:47:58 UTC) #6
hidehiko
Thank you for working on this, and CC'ing to me. https://codereview.chromium.org/759473002/diff/40001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://codereview.chromium.org/759473002/diff/40001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode63 ...
6 years ago (2014-11-25 11:47:36 UTC) #8
hidehiko
One more stuff. linux_chromium_rel_ng failure looks a real failure. Could you look into it? Also, ...
6 years ago (2014-11-25 11:51:53 UTC) #9
jln (very slow on Chromium)
Thanks for the comments. We should probably discuss Newlib in another thread. Is there a ...
6 years ago (2014-11-25 18:16:08 UTC) #10
Robert Sesek
https://codereview.chromium.org/759473002/diff/60001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://codereview.chromium.org/759473002/diff/60001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode65 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:65: if (-1 == rv && EFAULT == errno) { ...
6 years ago (2014-11-25 18:44:51 UTC) #12
jln (very slow on Chromium)
Matthew: I switched to an enum class and your API suggestion. Would you mind taking ...
6 years ago (2014-11-25 20:00:05 UTC) #13
Kees Cook
https://codereview.chromium.org/759473002/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://codereview.chromium.org/759473002/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode139 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:139: if (IsSingleThreaded(proc_task_fd_)) { Isn't it valid to start a ...
6 years ago (2014-11-25 20:09:44 UTC) #14
Robert Sesek
https://codereview.chromium.org/759473002/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://codereview.chromium.org/759473002/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode139 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:139: if (IsSingleThreaded(proc_task_fd_)) { On 2014/11/25 20:09:44, Kees Cook wrote: ...
6 years ago (2014-11-25 20:11:36 UTC) #15
jln (very slow on Chromium)
https://codereview.chromium.org/759473002/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://codereview.chromium.org/759473002/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode139 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:139: if (IsSingleThreaded(proc_task_fd_)) { On 2014/11/25 20:09:44, Kees Cook wrote: ...
6 years ago (2014-11-25 20:15:20 UTC) #16
Kees Cook
lgtm
6 years ago (2014-11-25 20:23:04 UTC) #17
mdempsky
lgtm https://codereview.chromium.org/759473002/diff/100001/sandbox/linux/seccomp-bpf/sandbox_bpf.h File sandbox/linux/seccomp-bpf/sandbox_bpf.h (right): https://codereview.chromium.org/759473002/diff/100001/sandbox/linux/seccomp-bpf/sandbox_bpf.h#newcode25 sandbox/linux/seccomp-bpf/sandbox_bpf.h:25: INVALID = 0, Currently the only use of ...
6 years ago (2014-11-25 20:39:07 UTC) #18
jln (very slow on Chromium)
https://codereview.chromium.org/759473002/diff/100001/sandbox/linux/seccomp-bpf/sandbox_bpf.h File sandbox/linux/seccomp-bpf/sandbox_bpf.h (right): https://codereview.chromium.org/759473002/diff/100001/sandbox/linux/seccomp-bpf/sandbox_bpf.h#newcode25 sandbox/linux/seccomp-bpf/sandbox_bpf.h:25: INVALID = 0, On 2014/11/25 20:39:06, mdempsky wrote: > ...
6 years ago (2014-11-25 20:58:13 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/759473002/140001
6 years ago (2014-11-25 20:58:50 UTC) #21
jln (very slow on Chromium)
Piman: TBR for the trivial change in content/renderer/renderer_main_platform_delegate_android.cc
6 years ago (2014-11-25 20:59:43 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/759473002/140001
6 years ago (2014-11-25 21:00:51 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/759473002/140001
6 years ago (2014-11-25 22:13:33 UTC) #28
commit-bot: I haz the power
Committed patchset #8 (id:140001)
6 years ago (2014-11-25 22:14:39 UTC) #29
commit-bot: I haz the power
6 years ago (2014-11-25 22:15:59 UTC) #30
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/bd576720e621951616af892bcf03ffaac49f1881
Cr-Commit-Position: refs/heads/master@{#305706}

Powered by Google App Engine
This is Rietveld 408576698