OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <signal.h> | 5 #include <signal.h> |
6 #include <sys/prctl.h> | 6 #include <sys/prctl.h> |
7 #include <sys/syscall.h> | 7 #include <sys/syscall.h> |
8 | 8 |
9 #ifndef SECCOMP_BPF_STANDALONE | 9 #ifndef SECCOMP_BPF_STANDALONE |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/posix/eintr_wrapper.h" | 11 #include "base/posix/eintr_wrapper.h" |
12 #endif | 12 #endif |
13 | 13 |
14 #include "sandbox/linux/seccomp-bpf/codegen.h" | 14 #include "sandbox/linux/seccomp-bpf/codegen.h" |
15 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 15 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
16 #include "sandbox/linux/seccomp-bpf/syscall.h" | 16 #include "sandbox/linux/seccomp-bpf/syscall.h" |
17 #include "sandbox/linux/seccomp-bpf/syscall_iterator.h" | 17 #include "sandbox/linux/seccomp-bpf/syscall_iterator.h" |
18 #include "sandbox/linux/seccomp-bpf/verifier.h" | 18 #include "sandbox/linux/seccomp-bpf/verifier.h" |
19 | 19 |
20 // Android's signal.h doesn't define ucontext etc. | 20 // Android's signal.h doesn't define ucontext etc. |
21 #if defined(OS_ANDROID) && defined(__arm__) | 21 #if defined(OS_ANDROID) |
jln (very slow on Chromium)
2013/01/08 22:26:09
Can you move most of what's below into a global se
| |
22 #if defined(__arm__) | |
22 #include "sandbox/linux/services/android_arm_ucontext.h" | 23 #include "sandbox/linux/services/android_arm_ucontext.h" |
24 #elif defined(__i386__) | |
25 #include "sandbox/linux/services/android_x86_ucontext.h" | |
26 #elif defined(__mips__) | |
27 #error "Lack ucontext_t definition for mips on Android" | |
digit1
2013/01/09 09:47:18
If you need a MIPS version, please see https://and
| |
28 #else | |
29 #error "Unsupported CPU ABI for Android" | |
30 #endif | |
23 #endif | 31 #endif |
24 | 32 |
25 namespace { | 33 namespace { |
26 | 34 |
27 void WriteFailedStderrSetupMessage(int out_fd) { | 35 void WriteFailedStderrSetupMessage(int out_fd) { |
28 const char* error_string = strerror(errno); | 36 const char* error_string = strerror(errno); |
29 static const char msg[] = "You have reproduced a puzzling issue.\n" | 37 static const char msg[] = "You have reproduced a puzzling issue.\n" |
30 "Please, report to crbug.com/152530!\n" | 38 "Please, report to crbug.com/152530!\n" |
31 "Failed to set up stderr: "; | 39 "Failed to set up stderr: "; |
32 if (HANDLE_EINTR(write(out_fd, msg, sizeof(msg)-1)) > 0 && error_string && | 40 if (HANDLE_EINTR(write(out_fd, msg, sizeof(msg)-1)) > 0 && error_string && |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
983 int Sandbox::proc_fd_ = -1; | 991 int Sandbox::proc_fd_ = -1; |
984 Sandbox::Evaluators Sandbox::evaluators_; | 992 Sandbox::Evaluators Sandbox::evaluators_; |
985 Sandbox::Traps *Sandbox::traps_ = NULL; | 993 Sandbox::Traps *Sandbox::traps_ = NULL; |
986 Sandbox::TrapIds Sandbox::trap_ids_; | 994 Sandbox::TrapIds Sandbox::trap_ids_; |
987 ErrorCode *Sandbox::trap_array_ = NULL; | 995 ErrorCode *Sandbox::trap_array_ = NULL; |
988 size_t Sandbox::trap_array_size_ = 0; | 996 size_t Sandbox::trap_array_size_ = 0; |
989 bool Sandbox::has_unsafe_traps_ = false; | 997 bool Sandbox::has_unsafe_traps_ = false; |
990 Sandbox::Conds Sandbox::conds_; | 998 Sandbox::Conds Sandbox::conds_; |
991 | 999 |
992 } // namespace | 1000 } // namespace |
OLD | NEW |