|
Linux sandbox: change API to start the sandbox
This CL makes SupportsSandbox() more straightforward by returning the
level of support in the kernel.
One major advantage is that being single threaded is now checked right before engaging
the sandbox.
Now, StartSandbox() is required to be able to check the number of threads
in the current process. For this the LinuxSandbox class in content/ and
in nacl/ are modified to always pass a file descriptor to /proc/self/tasks/
to SandboxBPF::StartSandbox().
In content::LinuxSandbox, such a descriptor was only available in DEBUG builds
for security reasons. We make sure to always close it, as long as InitializeSandbox()
is called. However, a few fringe processes, such as the init process or the ASAN
coverage helper need to close it manually.
BUG= 434820
Committed: https://crrev.com/bd4df41c57cbfa415675602e0befc8ca128a009a
Cr-Commit-Position: refs/heads/master@{#305569}
Total comments: 4
Total comments: 4
Total comments: 8
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+198 lines, -176 lines) |
Patch |
 |
M |
components/nacl/loader/nonsfi/nonsfi_sandbox.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
components/nacl/loader/nonsfi/nonsfi_sandbox.cc
|
View
|
|
1 chunk |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.h
|
View
|
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc
|
View
|
|
6 chunks |
+20 lines, -5 lines |
0 comments
|
Download
|
 |
M |
content/common/sandbox_linux/bpf_gpu_policy_linux.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
content/common/sandbox_linux/sandbox_init_linux.cc
|
View
|
|
1 chunk |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/common/sandbox_linux/sandbox_linux.h
|
View
|
1
2
3
4
5
6
7
8
9
|
3 chunks |
+13 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/common/sandbox_linux/sandbox_linux.cc
|
View
|
1
2
3
4
5
6
7
|
8 chunks |
+31 lines, -23 lines |
0 comments
|
Download
|
 |
M |
content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h
|
View
|
|
2 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc
|
View
|
1
2
|
9 chunks |
+20 lines, -16 lines |
0 comments
|
Download
|
 |
M |
content/public/common/sandbox_init.h
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/zygote/zygote_main_linux.cc
|
View
|
1
2
3
4
5
|
7 chunks |
+32 lines, -12 lines |
0 comments
|
Download
|
 |
M |
sandbox/linux/BUILD.gn
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
|
View
|
1
2
3
4
5
6
|
4 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
sandbox/linux/seccomp-bpf/sandbox_bpf.h
|
View
|
1
2
3
4
5
6
7
8
9
|
3 chunks |
+11 lines, -12 lines |
0 comments
|
Download
|
 |
M |
sandbox/linux/seccomp-bpf/sandbox_bpf.cc
|
View
|
1
2
3
4
5
6
|
7 chunks |
+31 lines, -79 lines |
0 comments
|
Download
|
 |
M |
sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc
|
View
|
|
1 chunk |
+1 line, -8 lines |
0 comments
|
Download
|
 |
M |
sandbox/linux/services/thread_helpers.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 18 (5 generated)
|