Index: sandbox/linux/seccomp-bpf/syscall_unittest.cc |
diff --git a/sandbox/linux/seccomp-bpf/syscall_unittest.cc b/sandbox/linux/seccomp-bpf/syscall_unittest.cc |
index 38f31e0a58ed5073f0236ec36bd7acca6c1dd5ad..54e1dda254f55d37b2195fd17697ae867d60933f 100644 |
--- a/sandbox/linux/seccomp-bpf/syscall_unittest.cc |
+++ b/sandbox/linux/seccomp-bpf/syscall_unittest.cc |
@@ -41,7 +41,7 @@ TEST(Syscall, WellKnownEntryPoint) { |
// Test that Syscall::Call(-1) is handled specially. Don't do this on ARM, |
// where syscall(-1) crashes with SIGILL. Not running the test is fine, as we |
// are still testing ARM code in the next set of tests. |
-#if !defined(__arm__) |
+#if !defined(__arm__) && !defined(__aarch64__) |
EXPECT_NE(Syscall::Call(-1), syscall(-1)); |
#endif |
@@ -61,6 +61,8 @@ TEST(Syscall, WellKnownEntryPoint) { |
#elif defined(__mips__) |
// Opcode for MIPS sycall is in the lower 16-bits |
EXPECT_EQ(0x0cu, (((uint32_t*)Syscall::Call(-1))[-1]) & 0x0000FFFF); |
+#elif defined(__aarch64__) |
+ EXPECT_EQ(0xD4000001u, ((uint32_t*)Syscall::Call(-1))[-1]); // SVC 0 |
#else |
#warning Incomplete test case; need port for target platform |
#endif |
@@ -153,7 +155,8 @@ BPF_TEST(Syscall, |
TEST(Syscall, ComplexSyscallSixArgs) { |
int fd; |
- ASSERT_LE(0, fd = Syscall::Call(__NR_open, "/dev/null", O_RDWR, 0L)); |
+ ASSERT_LE(0, |
+ fd = Syscall::Call(__NR_openat, AT_FDCWD, "/dev/null", O_RDWR, 0L)); |
// Use mmap() to allocate some read-only memory |
char* addr0; |
@@ -186,7 +189,9 @@ TEST(Syscall, ComplexSyscallSixArgs) { |
// Check that the offset argument (i.e. the sixth argument) is processed |
// correctly. |
- ASSERT_GE(fd = Syscall::Call(__NR_open, "/proc/self/exe", O_RDONLY, 0L), 0); |
+ ASSERT_GE( |
+ fd = Syscall::Call(__NR_openat, AT_FDCWD, "/proc/self/exe", O_RDONLY, 0L), |
+ 0); |
char* addr2, *addr3; |
ASSERT_NE((char*)NULL, |
addr2 = reinterpret_cast<char*>(Syscall::Call( |