Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc

Issue 2512073003: Aarch64 buildfix. (Closed)
Patch Set: Aarch64 buildfix. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <sched.h> 8 #include <sched.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 #endif 1870 #endif
1871 1871
1872 #if defined(__arm__) 1872 #if defined(__arm__)
1873 #ifndef PTRACE_SET_SYSCALL 1873 #ifndef PTRACE_SET_SYSCALL
1874 #define PTRACE_SET_SYSCALL 23 1874 #define PTRACE_SET_SYSCALL 23
1875 #endif 1875 #endif
1876 #endif 1876 #endif
1877 1877
1878 #if defined(__aarch64__) 1878 #if defined(__aarch64__)
1879 #ifndef PTRACE_GETREGS 1879 #ifndef PTRACE_GETREGS
1880 #if defined(__GLIBC__)
1881 #define PTRACE_GETREGS static_cast<enum __ptrace_request>(12)
1882 #else
1880 #define PTRACE_GETREGS 12 1883 #define PTRACE_GETREGS 12
1881 #endif 1884 #endif // defined(__GLIBC__)
1882 #endif 1885 #endif // !defined(PTRACE_GETREGS)
1886 #endif // defined(__aarch64__)
1883 1887
1884 #if defined(__aarch64__) 1888 #if defined(__aarch64__)
1885 #ifndef PTRACE_SETREGS 1889 #ifndef PTRACE_SETREGS
1890 #if defined(__GLIBC__)
1891 #define PTRACE_SETREGS static_cast<enum __ptrace_request>(13)
1892 #else
1886 #define PTRACE_SETREGS 13 1893 #define PTRACE_SETREGS 13
1887 #endif 1894 #endif // defined(__GLIBC__)
1888 #endif 1895 #endif // !defined(PTRACE_SETREGS)
1896 #endif // defined(__aarch64__)
1889 1897
1890 // Changes the syscall to run for a child being sandboxed using seccomp-bpf with 1898 // Changes the syscall to run for a child being sandboxed using seccomp-bpf with
1891 // PTRACE_O_TRACESECCOMP. Should only be called when the child is stopped on 1899 // PTRACE_O_TRACESECCOMP. Should only be called when the child is stopped on
1892 // PTRACE_EVENT_SECCOMP. 1900 // PTRACE_EVENT_SECCOMP.
1893 // 1901 //
1894 // regs should contain the current set of registers of the child, obtained using 1902 // regs should contain the current set of registers of the child, obtained using
1895 // PTRACE_GETREGS. 1903 // PTRACE_GETREGS.
1896 // 1904 //
1897 // Depending on the architecture, this may modify regs, so the caller is 1905 // Depending on the architecture, this may modify regs, so the caller is
1898 // responsible for committing these changes using PTRACE_SETREGS. 1906 // responsible for committing these changes using PTRACE_SETREGS.
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2256 BPF_ASSERT_EQ(ENOSYS, errno); 2264 BPF_ASSERT_EQ(ENOSYS, errno);
2257 2265
2258 BPF_ASSERT_EQ(-1, syscall(__NR_setgid, 300)); 2266 BPF_ASSERT_EQ(-1, syscall(__NR_setgid, 300));
2259 BPF_ASSERT_EQ(EPERM, errno); 2267 BPF_ASSERT_EQ(EPERM, errno);
2260 } 2268 }
2261 2269
2262 } // namespace 2270 } // namespace
2263 2271
2264 } // namespace bpf_dsl 2272 } // namespace bpf_dsl
2265 } // namespace sandbox 2273 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698