OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Sanitizers internally use some syscalls which non-SFI NaCl disallows. | 5 // Sanitizers internally use some syscalls which non-SFI NaCl disallows. |
6 #if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER) && \ | 6 #if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER) && \ |
7 !defined(MEMORY_SANITIZER) && !defined(LEAK_SANITIZER) | 7 !defined(MEMORY_SANITIZER) && !defined(LEAK_SANITIZER) |
8 | 8 |
9 #include "components/nacl/loader/nonsfi/nonsfi_sandbox.h" | 9 #include "components/nacl/loader/nonsfi/nonsfi_sandbox.h" |
10 | 10 |
| 11 #include <sys/syscall.h> |
| 12 #include <unistd.h> |
| 13 |
11 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" | 14 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" |
12 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" | 15 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" |
13 | 16 |
14 namespace { | 17 namespace { |
15 | 18 |
16 // Test cases in this file just make sure not-whitelisted syscalls | 19 // Test cases in this file just make sure not-whitelisted syscalls |
17 // are appropriately disallowed. They should raise SIGSYS regardless | 20 // are appropriately disallowed. They should raise SIGSYS regardless |
18 // of arguments. We always pass five zeros not to pass uninitialized | 21 // of arguments. We always pass five zeros not to pass uninitialized |
19 // values to syscalls. | 22 // values to syscalls. |
20 #define RESTRICT_SYSCALL_DEATH_TEST_IMPL(name, sysno) \ | 23 #define RESTRICT_SYSCALL_DEATH_TEST_IMPL(name, sysno) \ |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 RESTRICT_ARM_SYSCALL_DEATH_TEST(breakpoint); | 610 RESTRICT_ARM_SYSCALL_DEATH_TEST(breakpoint); |
608 RESTRICT_ARM_SYSCALL_DEATH_TEST(usr26); | 611 RESTRICT_ARM_SYSCALL_DEATH_TEST(usr26); |
609 RESTRICT_ARM_SYSCALL_DEATH_TEST(usr32); | 612 RESTRICT_ARM_SYSCALL_DEATH_TEST(usr32); |
610 RESTRICT_ARM_SYSCALL_DEATH_TEST(set_tls); | 613 RESTRICT_ARM_SYSCALL_DEATH_TEST(set_tls); |
611 #endif | 614 #endif |
612 | 615 |
613 } // namespace | 616 } // namespace |
614 | 617 |
615 #endif // !ADDRESS_SANITIZER && !THREAD_SANITIZER && | 618 #endif // !ADDRESS_SANITIZER && !THREAD_SANITIZER && |
616 // !MEMORY_SANITIZER && !LEAK_SANITIZER | 619 // !MEMORY_SANITIZER && !LEAK_SANITIZER |
OLD | NEW |