OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SIGSYS_HANDLERS_H_ | 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SIGSYS_HANDLERS_H_ |
6 #define SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SIGSYS_HANDLERS_H_ | 6 #define SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SIGSYS_HANDLERS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" | 10 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 SANDBOX_EXPORT intptr_t | 40 SANDBOX_EXPORT intptr_t |
41 SIGSYSIoctlFailure(const struct arch_seccomp_data& args, void* aux); | 41 SIGSYSIoctlFailure(const struct arch_seccomp_data& args, void* aux); |
42 // The crashing address will be (pid & 0xFFF), where pid is the first | 42 // The crashing address will be (pid & 0xFFF), where pid is the first |
43 // argument (and can be a tid). | 43 // argument (and can be a tid). |
44 SANDBOX_EXPORT intptr_t | 44 SANDBOX_EXPORT intptr_t |
45 SIGSYSKillFailure(const struct arch_seccomp_data& args, void* aux); | 45 SIGSYSKillFailure(const struct arch_seccomp_data& args, void* aux); |
46 // The crashing address will be (op & 0xFFF), where op is the second | 46 // The crashing address will be (op & 0xFFF), where op is the second |
47 // argument. | 47 // argument. |
48 SANDBOX_EXPORT intptr_t | 48 SANDBOX_EXPORT intptr_t |
49 SIGSYSFutexFailure(const struct arch_seccomp_data& args, void* aux); | 49 SIGSYSFutexFailure(const struct arch_seccomp_data& args, void* aux); |
50 // If the syscall is not being called on the current tid, crashes in the same | |
51 // way as CrashSIGSYS_Handler. Otherwise, returns the result of calling the | |
52 // syscall with the pid argument set to 0 (which for these calls means the | |
53 // current thread). | |
jln (very slow on Chromium)
2014/09/26 20:21:51
Could you list the syscalls supported?
| |
54 SANDBOX_EXPORT intptr_t | |
55 SIGSYSSchedHandler(const struct arch_seccomp_data& args, void* aux); | |
50 | 56 |
51 // Variants of the above functions for use with bpf_dsl. | 57 // Variants of the above functions for use with bpf_dsl. |
52 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS(); | 58 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS(); |
53 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSClone(); | 59 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSClone(); |
54 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPrctl(); | 60 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPrctl(); |
55 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSIoctl(); | 61 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSIoctl(); |
56 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSKill(); | 62 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSKill(); |
57 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex(); | 63 SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex(); |
64 SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS(); | |
58 | 65 |
59 // Following four functions return substrings of error messages used | 66 // Following four functions return substrings of error messages used |
60 // in the above four functions. They are useful in death tests. | 67 // in the above four functions. They are useful in death tests. |
61 SANDBOX_EXPORT const char* GetErrorMessageContentForTests(); | 68 SANDBOX_EXPORT const char* GetErrorMessageContentForTests(); |
62 SANDBOX_EXPORT const char* GetCloneErrorMessageContentForTests(); | 69 SANDBOX_EXPORT const char* GetCloneErrorMessageContentForTests(); |
63 SANDBOX_EXPORT const char* GetPrctlErrorMessageContentForTests(); | 70 SANDBOX_EXPORT const char* GetPrctlErrorMessageContentForTests(); |
64 SANDBOX_EXPORT const char* GetIoctlErrorMessageContentForTests(); | 71 SANDBOX_EXPORT const char* GetIoctlErrorMessageContentForTests(); |
65 SANDBOX_EXPORT const char* GetKillErrorMessageContentForTests(); | 72 SANDBOX_EXPORT const char* GetKillErrorMessageContentForTests(); |
66 SANDBOX_EXPORT const char* GetFutexErrorMessageContentForTests(); | 73 SANDBOX_EXPORT const char* GetFutexErrorMessageContentForTests(); |
67 | 74 |
68 } // namespace sandbox. | 75 } // namespace sandbox. |
69 | 76 |
70 #endif // SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SIGSYS_HANDLERS_H_ | 77 #endif // SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SIGSYS_HANDLERS_H_ |
OLD | NEW |