OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/nacl/loader/nonsfi/nonsfi_sandbox.h" | |
6 | |
7 #include <errno.h> | |
8 #include <fcntl.h> | |
9 #include <pthread.h> | |
10 #include <sched.h> | |
11 #include <signal.h> | |
12 #include <stdlib.h> | |
13 #include <string.h> | |
14 #include <sys/mman.h> | |
15 #include <sys/prctl.h> | |
16 #include <sys/ptrace.h> | |
17 #include <sys/socket.h> | |
18 #include <sys/syscall.h> | |
19 #include <sys/types.h> | |
20 #include <sys/wait.h> | |
21 #include <unistd.h> | |
22 | |
23 #include "base/bind.h" | |
24 #include "base/callback.h" | |
25 #include "base/compiler_specific.h" | |
26 #include "base/files/scoped_file.h" | |
27 #include "base/logging.h" | |
28 #include "base/posix/eintr_wrapper.h" | |
29 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" | |
30 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" | |
31 #include "testing/gtest/include/gtest/gtest.h" | |
32 | |
33 namespace { | |
34 | |
35 int GetPageSize() { | |
Mark Seaborn
2014/04/15 23:03:14
Just use the standard getpagesize() from unistd.h?
hamaji
2014/04/16 02:10:48
I created this because the man page of getpagesize
| |
36 return sysconf(_SC_PAGESIZE); | |
37 } | |
38 | |
39 void DoPipe(base::ScopedFD* fds) { | |
40 int tmp_fds[2]; | |
41 BPF_ASSERT_EQ(0, pipe(tmp_fds)); | |
42 fds[0].reset(tmp_fds[0]); | |
43 fds[1].reset(tmp_fds[1]); | |
44 } | |
45 | |
46 void DoSocketpair(base::ScopedFD* fds) { | |
47 int tmp_fds[2]; | |
48 BPF_ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, tmp_fds)); | |
49 fds[0].reset(tmp_fds[0]); | |
50 fds[1].reset(tmp_fds[1]); | |
51 } | |
52 | |
53 TEST(NaClNonSfiSandboxTest, BPFIsSupported) { | |
54 bool seccomp_bpf_supported = false; | |
55 #if !defined(THREAD_SANITIZER) | |
Mark Seaborn
2014/04/15 23:03:14
Can you add a comment saying why this is disabled
jln (very slow on Chromium)
2014/04/16 01:36:11
It's because TSAN got smarter at detecting fork()
hamaji
2014/04/16 02:18:00
Thanks. Added a comment.
| |
56 seccomp_bpf_supported = ( | |
jln (very slow on Chromium)
2014/04/16 01:39:38
Do you mind also adding ASSERT_TRUE(ThreadHelpers:
hamaji
2014/04/16 02:18:00
I'm happy to add this, but I guess this will fail
| |
57 sandbox::SandboxBPF::SupportsSeccompSandbox(-1) == | |
58 sandbox::SandboxBPF::STATUS_AVAILABLE); | |
59 #endif | |
60 | |
61 if (!seccomp_bpf_supported) { | |
62 LOG(ERROR) << "Seccomp BPF is not supported, these tests " | |
63 << "will pass without running"; | |
64 } | |
65 } | |
66 | |
67 BPF_DEATH_TEST(NaClNonSfiSandboxTest, invalid_sysno, | |
68 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
69 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
70 syscall(999); | |
71 } | |
72 | |
73 void* SetZeroInThread(void* test_val_ptr) { | |
74 *reinterpret_cast<int*>(test_val_ptr) = 0; | |
Mark Seaborn
2014/04/15 23:03:14
Nit: use a non-zero value to make it more obvious
jln (very slow on Chromium)
2014/04/16 01:36:11
You might be the first person to not suggest 42 :)
hamaji
2014/04/16 02:10:48
Done.
hamaji
2014/04/16 02:18:00
Hehe, 42 has been already used as its initial valu
| |
75 return NULL; | |
76 } | |
77 | |
78 BPF_TEST(NaClNonSfiSandboxTest, clone_by_pthread_create, | |
79 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
80 // clone call for thread creation is allowed. | |
81 pthread_t th; | |
82 int test_val = 42; | |
83 BPF_ASSERT_EQ(0, pthread_create(&th, NULL, &SetZeroInThread, &test_val)); | |
84 BPF_ASSERT_EQ(0, pthread_join(th, NULL)); | |
85 BPF_ASSERT_EQ(0, test_val); | |
Mark Seaborn
2014/04/15 23:03:14
...then 123 here.
hamaji
2014/04/16 02:10:48
Done.
| |
86 } | |
87 | |
88 int DoClone() { | |
Mark Seaborn
2014/04/15 23:03:14
How about calling this DoFork()?
You're using clo
hamaji
2014/04/16 02:10:48
Done.
| |
89 const int pid = syscall(__NR_clone, | |
90 CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, | |
91 NULL); | |
92 if (pid == 0) | |
93 _exit(0); | |
94 return pid; | |
95 } | |
96 | |
97 // The sanity check for DoClone without the sandbox. | |
98 TEST(NaClNonSfiSandboxTest, DoClone) { | |
99 const int pid = DoClone(); | |
100 ASSERT_LT(0, pid); | |
101 int status; | |
102 ASSERT_EQ(pid, HANDLE_EINTR(waitpid(pid, &status, 0))); | |
103 ASSERT_TRUE(WIFEXITED(status)); | |
104 ASSERT_EQ(0, WEXITSTATUS(status)); | |
105 } | |
106 | |
107 // Then, try this in the sandbox. | |
108 BPF_DEATH_TEST(NaClNonSfiSandboxTest, clone, | |
109 DEATH_MESSAGE(sandbox::GetCloneErrorMessageContentForTests()), | |
110 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
111 DoClone(); | |
112 } | |
113 | |
114 BPF_TEST(NaClNonSfiSandboxTest, prctl_SET_NAME, | |
115 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
116 errno = 0; | |
117 BPF_ASSERT_EQ(-1, syscall(__NR_prctl, PR_SET_NAME, "foo")); | |
118 BPF_ASSERT_EQ(EPERM, errno); | |
119 } | |
120 | |
121 BPF_DEATH_TEST(NaClNonSfiSandboxTest, prctl_SET_DUMPABLE, | |
122 DEATH_MESSAGE(sandbox::GetPrctlErrorMessageContentForTests()), | |
123 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
124 syscall(__NR_prctl, PR_SET_DUMPABLE, 1UL); | |
125 } | |
126 | |
127 BPF_TEST(NaClNonSfiSandboxTest, socketcall_allowed, | |
128 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
129 base::ScopedFD fds[2]; | |
130 struct msghdr msg = {}; | |
131 struct iovec iov; | |
132 std::string payload("foo"); | |
133 iov.iov_base = &payload[0]; | |
134 iov.iov_len = payload.size(); | |
135 msg.msg_iov = &iov; | |
136 msg.msg_iovlen = 1; | |
137 DoSocketpair(fds); | |
138 BPF_ASSERT_EQ(static_cast<int>(payload.size()), | |
139 HANDLE_EINTR(sendmsg(fds[1].get(), &msg, 0))); | |
140 BPF_ASSERT_EQ(static_cast<int>(payload.size()), | |
141 HANDLE_EINTR(recvmsg(fds[0].get(), &msg, 0))); | |
142 BPF_ASSERT_EQ(0, shutdown(fds[0].get(), SHUT_RDWR)); | |
143 } | |
144 | |
145 BPF_DEATH_TEST(NaClNonSfiSandboxTest, accept, | |
146 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
147 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
148 accept(0, NULL, NULL); | |
149 } | |
150 | |
151 BPF_DEATH_TEST(NaClNonSfiSandboxTest, bind, | |
152 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
153 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
154 bind(0, NULL, 0); | |
155 } | |
156 | |
157 BPF_DEATH_TEST(NaClNonSfiSandboxTest, connect, | |
158 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
159 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
160 connect(0, NULL, 0); | |
161 } | |
162 | |
163 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getpeername, | |
164 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
165 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
166 getpeername(0, NULL, NULL); | |
167 } | |
168 | |
169 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getsockname, | |
170 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
171 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
172 getsockname(0, NULL, NULL); | |
173 } | |
174 | |
175 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getsockopt, | |
176 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
177 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
178 getsockopt(0, 0, 0, NULL, NULL); | |
179 } | |
180 | |
181 BPF_DEATH_TEST(NaClNonSfiSandboxTest, listen, | |
182 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
183 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
184 listen(0, 0); | |
185 } | |
186 | |
187 BPF_DEATH_TEST(NaClNonSfiSandboxTest, recv, | |
188 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
189 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
190 recv(0, NULL, 0, 0); | |
191 } | |
192 | |
193 BPF_DEATH_TEST(NaClNonSfiSandboxTest, recvfrom, | |
194 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
195 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
196 recvfrom(0, NULL, 0, 0, NULL, NULL); | |
197 } | |
198 | |
199 BPF_DEATH_TEST(NaClNonSfiSandboxTest, send, | |
200 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
201 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
202 send(0, NULL, 0, 0); | |
203 } | |
204 | |
205 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sendto, | |
206 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
207 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
208 sendto(0, NULL, 0, 0, NULL, 0); | |
209 } | |
210 | |
211 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setsockopt, | |
212 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
213 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
214 setsockopt(0, 0, 0, NULL, 0); | |
215 } | |
216 | |
217 BPF_DEATH_TEST(NaClNonSfiSandboxTest, socket, | |
218 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
219 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
220 socket(0, 0, 0); | |
221 } | |
222 | |
223 #if defined(__x86_64__) || defined(__arm__) | |
224 BPF_DEATH_TEST(NaClNonSfiSandboxTest, socketpair, | |
225 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
226 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
227 int fds[2]; | |
228 socketpair(AF_INET, SOCK_STREAM, 0, fds); | |
229 } | |
230 #endif | |
231 | |
232 BPF_TEST(NaClNonSfiSandboxTest, fcntl_SETFD_allowed, | |
233 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
234 base::ScopedFD fds[2]; | |
235 DoSocketpair(fds); | |
236 BPF_ASSERT_EQ(0, fcntl(fds[0].get(), F_SETFD, FD_CLOEXEC)); | |
237 } | |
238 | |
239 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fcntl_SETFD, | |
240 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
241 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
242 base::ScopedFD fds[2]; | |
243 DoSocketpair(fds); | |
244 fcntl(fds[0].get(), F_SETFD, 99); | |
245 } | |
246 | |
247 BPF_TEST(NaClNonSfiSandboxTest, fcntl_GETFL_SETFL_allowed, | |
248 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
249 base::ScopedFD fds[2]; | |
250 DoPipe(fds); | |
251 const int fd = fds[0].get(); | |
252 BPF_ASSERT_EQ(0, fcntl(fd, F_GETFL)); | |
253 BPF_ASSERT_EQ(0, fcntl(fd, F_SETFL, O_RDWR | O_NONBLOCK)); | |
254 BPF_ASSERT_EQ(O_NONBLOCK, fcntl(fd, F_GETFL)); | |
255 } | |
256 | |
257 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fcntl_GETFL_SETFL, | |
258 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
259 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
260 base::ScopedFD fds[2]; | |
261 DoSocketpair(fds); | |
262 fcntl(fds[0].get(), F_SETFL, O_APPEND); | |
263 } | |
264 | |
265 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fcntl_DUPFD, | |
266 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
267 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
268 fcntl(0, F_DUPFD); | |
269 } | |
270 | |
271 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fcntl_DUPFD_CLOEXEC, | |
272 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
273 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
274 fcntl(0, F_DUPFD_CLOEXEC); | |
275 } | |
276 | |
277 void* DoAllowedAnonymousMmap() { | |
278 return mmap(NULL, GetPageSize(), PROT_READ | PROT_WRITE, | |
279 MAP_ANONYMOUS | MAP_SHARED, -1, 0); | |
280 } | |
281 | |
282 BPF_TEST(NaClNonSfiSandboxTest, mmap_allowed, | |
283 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
284 void* ptr = DoAllowedAnonymousMmap(); | |
285 BPF_ASSERT_NE(MAP_FAILED, ptr); | |
286 BPF_ASSERT_EQ(0, munmap(ptr, GetPageSize())); | |
287 } | |
288 | |
289 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mmap_unallowed_flag, | |
290 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
291 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
292 mmap(NULL, GetPageSize(), PROT_READ | PROT_WRITE, | |
293 MAP_ANONYMOUS | MAP_POPULATE, -1, 0); | |
294 } | |
295 | |
296 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mmap_unallowed_prot, | |
297 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
298 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
299 mmap(NULL, GetPageSize(), PROT_READ | PROT_GROWSDOWN, | |
300 MAP_ANONYMOUS, -1, 0); | |
301 } | |
302 | |
303 // TODO(hamaji): Disallow RWX mmap. | |
304 #if 0 | |
305 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mmap_rwx, | |
306 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
307 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
308 mmap(NULL, GetPageSize(), PROT_READ | PROT_WRITE | PROT_EXEC, | |
309 MAP_ANONYMOUS, -1, 0); | |
310 } | |
311 #endif | |
312 | |
313 BPF_TEST(NaClNonSfiSandboxTest, mprotect_allowed, | |
314 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
315 void* ptr = DoAllowedAnonymousMmap(); | |
316 BPF_ASSERT_NE(MAP_FAILED, ptr); | |
317 BPF_ASSERT_EQ(0, mprotect(ptr, GetPageSize(), PROT_READ)); | |
318 BPF_ASSERT_EQ(0, munmap(ptr, GetPageSize())); | |
319 } | |
320 | |
321 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mprotect_unallowed_prot, | |
322 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
323 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
324 // We have tested DoAllowedAnonymousMmap is allowed in | |
325 // mmap_allowed, so we can make sure the following mprotect call | |
326 // kills the process. | |
327 void* ptr = DoAllowedAnonymousMmap(); | |
328 BPF_ASSERT_NE(MAP_FAILED, ptr); | |
329 mprotect(ptr, GetPageSize(), PROT_READ | PROT_GROWSDOWN); | |
330 } | |
331 | |
332 BPF_TEST(NaClNonSfiSandboxTest, brk, | |
333 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
334 char* next_brk = static_cast<char*>(sbrk(0)) + GetPageSize(); | |
335 // The kernel interface must return zero for brk. | |
336 BPF_ASSERT_EQ(0, syscall(__NR_brk, next_brk)); | |
337 // The libc wrapper translates it to ENOMEM. | |
338 errno = 0; | |
339 BPF_ASSERT_EQ(-1, brk(next_brk)); | |
340 BPF_ASSERT_EQ(ENOMEM, errno); | |
341 } | |
342 | |
343 #if defined(__i386__) || defined(__arm__) | |
344 BPF_TEST(NaClNonSfiSandboxTest, getegid32_EPERM, | |
345 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
346 errno = 0; | |
347 BPF_ASSERT_EQ(-1, syscall(__NR_getegid32)); | |
348 BPF_ASSERT_EQ(EPERM, errno); | |
349 } | |
350 | |
351 BPF_TEST(NaClNonSfiSandboxTest, geteuid32_EPERM, | |
352 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
353 errno = 0; | |
354 BPF_ASSERT_EQ(-1, syscall(__NR_geteuid32)); | |
355 BPF_ASSERT_EQ(EPERM, errno); | |
356 } | |
357 | |
358 BPF_TEST(NaClNonSfiSandboxTest, getgid32_EPERM, | |
359 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
360 errno = 0; | |
361 BPF_ASSERT_EQ(-1, syscall(__NR_getgid32)); | |
362 BPF_ASSERT_EQ(EPERM, errno); | |
363 } | |
364 | |
365 BPF_TEST(NaClNonSfiSandboxTest, getuid32_EPERM, | |
366 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
367 errno = 0; | |
368 BPF_ASSERT_EQ(-1, syscall(__NR_getuid32)); | |
369 BPF_ASSERT_EQ(EPERM, errno); | |
370 } | |
371 | |
372 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getegid_SIGSYS, | |
373 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
374 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
375 syscall(__NR_getegid); | |
376 } | |
377 | |
378 BPF_DEATH_TEST(NaClNonSfiSandboxTest, geteuid_SIGSYS, | |
379 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
380 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
381 syscall(__NR_geteuid); | |
382 } | |
383 | |
384 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getgid_SIGSYS, | |
385 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
386 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
387 syscall(__NR_getgid); | |
388 } | |
389 | |
390 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getuid_SIGSYS, | |
391 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
392 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
393 syscall(__NR_getuid); | |
394 } | |
395 #endif | |
396 | |
397 #if defined(__x86_64__) | |
398 BPF_TEST(NaClNonSfiSandboxTest, getegid_EPERM, | |
399 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
400 errno = 0; | |
401 BPF_ASSERT_EQ(-1, syscall(__NR_getegid)); | |
402 BPF_ASSERT_EQ(EPERM, errno); | |
403 } | |
404 | |
405 BPF_TEST(NaClNonSfiSandboxTest, geteuid_EPERM, | |
406 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
407 errno = 0; | |
408 BPF_ASSERT_EQ(-1, syscall(__NR_geteuid)); | |
409 BPF_ASSERT_EQ(EPERM, errno); | |
410 } | |
411 | |
412 BPF_TEST(NaClNonSfiSandboxTest, getgid_EPERM, | |
413 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
414 errno = 0; | |
415 BPF_ASSERT_EQ(-1, syscall(__NR_getgid)); | |
416 BPF_ASSERT_EQ(EPERM, errno); | |
417 } | |
418 | |
419 BPF_TEST(NaClNonSfiSandboxTest, getuid_EPERM, | |
420 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
421 errno = 0; | |
422 BPF_ASSERT_EQ(-1, syscall(__NR_getuid)); | |
423 BPF_ASSERT_EQ(EPERM, errno); | |
424 } | |
425 #endif | |
426 | |
427 BPF_TEST(NaClNonSfiSandboxTest, madvise_EPERM, | |
428 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
429 errno = 0; | |
430 BPF_ASSERT_EQ(-1, syscall(__NR_madvise)); | |
431 BPF_ASSERT_EQ(EPERM, errno); | |
432 } | |
433 | |
434 BPF_TEST(NaClNonSfiSandboxTest, open_EPERM, | |
435 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
436 errno = 0; | |
437 BPF_ASSERT_EQ(-1, syscall(__NR_open)); | |
438 BPF_ASSERT_EQ(EPERM, errno); | |
439 } | |
440 | |
441 BPF_TEST(NaClNonSfiSandboxTest, ptrace_EPERM, | |
442 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
443 errno = 0; | |
444 BPF_ASSERT_EQ(-1, syscall(__NR_ptrace)); | |
445 BPF_ASSERT_EQ(EPERM, errno); | |
446 } | |
447 | |
448 BPF_TEST(NaClNonSfiSandboxTest, set_robust_list_EPERM, | |
449 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
450 errno = 0; | |
451 BPF_ASSERT_EQ(-1, syscall(__NR_set_robust_list)); | |
452 BPF_ASSERT_EQ(EPERM, errno); | |
453 } | |
454 | |
455 #if defined(__i386__) || defined(__x86_64__) | |
456 BPF_TEST(NaClNonSfiSandboxTest, time_EPERM, | |
457 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
458 errno = 0; | |
459 BPF_ASSERT_EQ(-1, syscall(__NR_time)); | |
460 BPF_ASSERT_EQ(EPERM, errno); | |
461 } | |
462 #endif | |
463 | |
464 // The rest of syscalls should just raise SIGSYS regardless of | |
465 // arguments. We always pass five zeros not to pass uninitialized | |
466 // values to syscalls. | |
467 | |
468 #if defined(__i386__) || defined(__arm__) | |
469 BPF_DEATH_TEST(NaClNonSfiSandboxTest, _newselect_SIGSYS, | |
470 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
471 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
472 syscall(__NR__newselect, 0, 0, 0, 0, 0); | |
473 } | |
474 #endif | |
475 | |
476 BPF_DEATH_TEST(NaClNonSfiSandboxTest, _sysctl_SIGSYS, | |
477 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
478 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
479 syscall(__NR__sysctl, 0, 0, 0, 0, 0); | |
480 } | |
481 | |
482 #if defined(__x86_64__) || defined(__arm__) | |
483 BPF_DEATH_TEST(NaClNonSfiSandboxTest, accept_SIGSYS, | |
484 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
485 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
486 syscall(__NR_accept, 0, 0, 0, 0, 0); | |
487 } | |
488 #endif | |
489 | |
490 #if defined(__x86_64__) || defined(__arm__) | |
491 BPF_DEATH_TEST(NaClNonSfiSandboxTest, accept4_SIGSYS, | |
492 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
493 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
494 syscall(__NR_accept4, 0, 0, 0, 0, 0); | |
495 } | |
496 #endif | |
497 | |
498 BPF_DEATH_TEST(NaClNonSfiSandboxTest, access_SIGSYS, | |
499 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
500 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
501 syscall(__NR_access, 0, 0, 0, 0, 0); | |
502 } | |
503 | |
504 BPF_DEATH_TEST(NaClNonSfiSandboxTest, acct_SIGSYS, | |
505 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
506 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
507 syscall(__NR_acct, 0, 0, 0, 0, 0); | |
508 } | |
509 | |
510 BPF_DEATH_TEST(NaClNonSfiSandboxTest, add_key_SIGSYS, | |
511 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
512 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
513 syscall(__NR_add_key, 0, 0, 0, 0, 0); | |
514 } | |
515 | |
516 BPF_DEATH_TEST(NaClNonSfiSandboxTest, adjtimex_SIGSYS, | |
517 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
518 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
519 syscall(__NR_adjtimex, 0, 0, 0, 0, 0); | |
520 } | |
521 | |
522 #if defined(__i386__) || defined(__x86_64__) | |
523 BPF_DEATH_TEST(NaClNonSfiSandboxTest, afs_syscall_SIGSYS, | |
524 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
525 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
526 syscall(__NR_afs_syscall, 0, 0, 0, 0, 0); | |
527 } | |
528 #endif | |
529 | |
530 #if defined(__i386__) || defined(__x86_64__) | |
531 BPF_DEATH_TEST(NaClNonSfiSandboxTest, alarm_SIGSYS, | |
532 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
533 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
534 syscall(__NR_alarm, 0, 0, 0, 0, 0); | |
535 } | |
536 #endif | |
537 | |
538 #if defined(__x86_64__) | |
539 BPF_DEATH_TEST(NaClNonSfiSandboxTest, arch_prctl_SIGSYS, | |
540 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
541 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
542 syscall(__NR_arch_prctl, 0, 0, 0, 0, 0); | |
543 } | |
544 #endif | |
545 | |
546 #if defined(__arm__) | |
547 BPF_DEATH_TEST(NaClNonSfiSandboxTest, arm_fadvise64_64_SIGSYS, | |
548 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
549 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
550 syscall(__NR_arm_fadvise64_64, 0, 0, 0, 0, 0); | |
551 } | |
552 #endif | |
553 | |
554 #if defined(__i386__) || defined(__arm__) | |
555 BPF_DEATH_TEST(NaClNonSfiSandboxTest, bdflush_SIGSYS, | |
556 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
557 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
558 syscall(__NR_bdflush, 0, 0, 0, 0, 0); | |
559 } | |
560 #endif | |
561 | |
562 #if defined(__x86_64__) || defined(__arm__) | |
563 BPF_DEATH_TEST(NaClNonSfiSandboxTest, bind_SIGSYS, | |
564 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
565 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
566 syscall(__NR_bind, 0, 0, 0, 0, 0); | |
567 } | |
568 #endif | |
569 | |
570 #if defined(__i386__) | |
571 BPF_DEATH_TEST(NaClNonSfiSandboxTest, break_SIGSYS, | |
572 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
573 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
574 syscall(__NR_break, 0, 0, 0, 0, 0); | |
575 } | |
576 #endif | |
577 | |
578 BPF_DEATH_TEST(NaClNonSfiSandboxTest, capget_SIGSYS, | |
579 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
580 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
581 syscall(__NR_capget, 0, 0, 0, 0, 0); | |
582 } | |
583 | |
584 BPF_DEATH_TEST(NaClNonSfiSandboxTest, capset_SIGSYS, | |
585 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
586 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
587 syscall(__NR_capset, 0, 0, 0, 0, 0); | |
588 } | |
589 | |
590 BPF_DEATH_TEST(NaClNonSfiSandboxTest, chdir_SIGSYS, | |
591 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
592 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
593 syscall(__NR_chdir, 0, 0, 0, 0, 0); | |
594 } | |
595 | |
596 BPF_DEATH_TEST(NaClNonSfiSandboxTest, chmod_SIGSYS, | |
597 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
598 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
599 syscall(__NR_chmod, 0, 0, 0, 0, 0); | |
600 } | |
601 | |
602 BPF_DEATH_TEST(NaClNonSfiSandboxTest, chown_SIGSYS, | |
603 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
604 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
605 syscall(__NR_chown, 0, 0, 0, 0, 0); | |
606 } | |
607 | |
608 #if defined(__i386__) || defined(__arm__) | |
609 BPF_DEATH_TEST(NaClNonSfiSandboxTest, chown32_SIGSYS, | |
610 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
611 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
612 syscall(__NR_chown32, 0, 0, 0, 0, 0); | |
613 } | |
614 #endif | |
615 | |
616 BPF_DEATH_TEST(NaClNonSfiSandboxTest, chroot_SIGSYS, | |
617 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
618 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
619 syscall(__NR_chroot, 0, 0, 0, 0, 0); | |
620 } | |
621 | |
622 BPF_DEATH_TEST(NaClNonSfiSandboxTest, clock_adjtime_SIGSYS, | |
623 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
624 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
625 syscall(__NR_clock_adjtime, 0, 0, 0, 0, 0); | |
626 } | |
627 | |
628 BPF_DEATH_TEST(NaClNonSfiSandboxTest, clock_nanosleep_SIGSYS, | |
629 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
630 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
631 syscall(__NR_clock_nanosleep, 0, 0, 0, 0, 0); | |
632 } | |
633 | |
634 BPF_DEATH_TEST(NaClNonSfiSandboxTest, clock_settime_SIGSYS, | |
635 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
636 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
637 syscall(__NR_clock_settime, 0, 0, 0, 0, 0); | |
638 } | |
639 | |
640 #if defined(__x86_64__) || defined(__arm__) | |
641 BPF_DEATH_TEST(NaClNonSfiSandboxTest, connect_SIGSYS, | |
642 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
643 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
644 syscall(__NR_connect, 0, 0, 0, 0, 0); | |
645 } | |
646 #endif | |
647 | |
648 BPF_DEATH_TEST(NaClNonSfiSandboxTest, creat_SIGSYS, | |
649 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
650 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
651 syscall(__NR_creat, 0, 0, 0, 0, 0); | |
652 } | |
653 | |
654 #if defined(__i386__) || defined(__x86_64__) | |
655 BPF_DEATH_TEST(NaClNonSfiSandboxTest, create_module_SIGSYS, | |
656 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
657 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
658 syscall(__NR_create_module, 0, 0, 0, 0, 0); | |
659 } | |
660 #endif | |
661 | |
662 BPF_DEATH_TEST(NaClNonSfiSandboxTest, delete_module_SIGSYS, | |
663 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
664 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
665 syscall(__NR_delete_module, 0, 0, 0, 0, 0); | |
666 } | |
667 | |
668 BPF_DEATH_TEST(NaClNonSfiSandboxTest, dup3_SIGSYS, | |
669 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
670 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
671 syscall(__NR_dup3, 0, 0, 0, 0, 0); | |
672 } | |
673 | |
674 BPF_DEATH_TEST(NaClNonSfiSandboxTest, epoll_create1_SIGSYS, | |
675 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
676 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
677 syscall(__NR_epoll_create1, 0, 0, 0, 0, 0); | |
678 } | |
679 | |
680 #if defined(__x86_64__) | |
681 BPF_DEATH_TEST(NaClNonSfiSandboxTest, epoll_ctl_old_SIGSYS, | |
682 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
683 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
684 syscall(__NR_epoll_ctl_old, 0, 0, 0, 0, 0); | |
685 } | |
686 #endif | |
687 | |
688 BPF_DEATH_TEST(NaClNonSfiSandboxTest, epoll_pwait_SIGSYS, | |
689 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
690 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
691 syscall(__NR_epoll_pwait, 0, 0, 0, 0, 0); | |
692 } | |
693 | |
694 #if defined(__x86_64__) | |
695 BPF_DEATH_TEST(NaClNonSfiSandboxTest, epoll_wait_old_SIGSYS, | |
696 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
697 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
698 syscall(__NR_epoll_wait_old, 0, 0, 0, 0, 0); | |
699 } | |
700 #endif | |
701 | |
702 BPF_DEATH_TEST(NaClNonSfiSandboxTest, eventfd_SIGSYS, | |
703 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
704 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
705 syscall(__NR_eventfd, 0, 0, 0, 0, 0); | |
706 } | |
707 | |
708 BPF_DEATH_TEST(NaClNonSfiSandboxTest, eventfd2_SIGSYS, | |
709 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
710 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
711 syscall(__NR_eventfd2, 0, 0, 0, 0, 0); | |
712 } | |
713 | |
714 BPF_DEATH_TEST(NaClNonSfiSandboxTest, execve_SIGSYS, | |
715 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
716 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
717 syscall(__NR_execve, 0, 0, 0, 0, 0); | |
718 } | |
719 | |
720 BPF_DEATH_TEST(NaClNonSfiSandboxTest, faccessat_SIGSYS, | |
721 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
722 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
723 syscall(__NR_faccessat, 0, 0, 0, 0, 0); | |
724 } | |
725 | |
726 #if defined(__i386__) || defined(__x86_64__) | |
727 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fadvise64_SIGSYS, | |
728 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
729 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
730 syscall(__NR_fadvise64, 0, 0, 0, 0, 0); | |
731 } | |
732 #endif | |
733 | |
734 #if defined(__i386__) | |
735 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fadvise64_64_SIGSYS, | |
736 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
737 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
738 syscall(__NR_fadvise64_64, 0, 0, 0, 0, 0); | |
739 } | |
740 #endif | |
741 | |
742 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fallocate_SIGSYS, | |
743 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
744 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
745 syscall(__NR_fallocate, 0, 0, 0, 0, 0); | |
746 } | |
747 | |
748 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fanotify_init_SIGSYS, | |
749 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
750 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
751 syscall(__NR_fanotify_init, 0, 0, 0, 0, 0); | |
752 } | |
753 | |
754 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fanotify_mark_SIGSYS, | |
755 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
756 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
757 syscall(__NR_fanotify_mark, 0, 0, 0, 0, 0); | |
758 } | |
759 | |
760 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fchdir_SIGSYS, | |
761 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
762 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
763 syscall(__NR_fchdir, 0, 0, 0, 0, 0); | |
764 } | |
765 | |
766 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fchmod_SIGSYS, | |
767 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
768 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
769 syscall(__NR_fchmod, 0, 0, 0, 0, 0); | |
770 } | |
771 | |
772 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fchmodat_SIGSYS, | |
773 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
774 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
775 syscall(__NR_fchmodat, 0, 0, 0, 0, 0); | |
776 } | |
777 | |
778 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fchown_SIGSYS, | |
779 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
780 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
781 syscall(__NR_fchown, 0, 0, 0, 0, 0); | |
782 } | |
783 | |
784 #if defined(__i386__) || defined(__arm__) | |
785 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fchown32_SIGSYS, | |
786 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
787 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
788 syscall(__NR_fchown32, 0, 0, 0, 0, 0); | |
789 } | |
790 #endif | |
791 | |
792 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fchownat_SIGSYS, | |
793 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
794 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
795 syscall(__NR_fchownat, 0, 0, 0, 0, 0); | |
796 } | |
797 | |
798 #if defined(__i386__) || defined(__arm__) | |
799 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fcntl_SIGSYS, | |
800 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
801 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
802 syscall(__NR_fcntl, 0, 0, 0, 0, 0); | |
803 } | |
804 #endif | |
805 | |
806 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fdatasync_SIGSYS, | |
807 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
808 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
809 syscall(__NR_fdatasync, 0, 0, 0, 0, 0); | |
810 } | |
811 | |
812 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fgetxattr_SIGSYS, | |
813 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
814 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
815 syscall(__NR_fgetxattr, 0, 0, 0, 0, 0); | |
816 } | |
817 | |
818 BPF_DEATH_TEST(NaClNonSfiSandboxTest, flistxattr_SIGSYS, | |
819 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
820 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
821 syscall(__NR_flistxattr, 0, 0, 0, 0, 0); | |
822 } | |
823 | |
824 BPF_DEATH_TEST(NaClNonSfiSandboxTest, flock_SIGSYS, | |
825 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
826 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
827 syscall(__NR_flock, 0, 0, 0, 0, 0); | |
828 } | |
829 | |
830 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fork_SIGSYS, | |
831 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
832 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
833 syscall(__NR_fork, 0, 0, 0, 0, 0); | |
834 } | |
835 | |
836 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fremovexattr_SIGSYS, | |
837 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
838 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
839 syscall(__NR_fremovexattr, 0, 0, 0, 0, 0); | |
840 } | |
841 | |
842 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fsetxattr_SIGSYS, | |
843 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
844 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
845 syscall(__NR_fsetxattr, 0, 0, 0, 0, 0); | |
846 } | |
847 | |
848 #if defined(__i386__) || defined(__arm__) | |
849 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fstat_SIGSYS, | |
850 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
851 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
852 syscall(__NR_fstat, 0, 0, 0, 0, 0); | |
853 } | |
854 #endif | |
855 | |
856 #if defined(__i386__) || defined(__arm__) | |
857 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fstatat64_SIGSYS, | |
858 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
859 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
860 syscall(__NR_fstatat64, 0, 0, 0, 0, 0); | |
861 } | |
862 #endif | |
863 | |
864 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fstatfs_SIGSYS, | |
865 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
866 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
867 syscall(__NR_fstatfs, 0, 0, 0, 0, 0); | |
868 } | |
869 | |
870 #if defined(__i386__) || defined(__arm__) | |
871 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fstatfs64_SIGSYS, | |
872 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
873 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
874 syscall(__NR_fstatfs64, 0, 0, 0, 0, 0); | |
875 } | |
876 #endif | |
877 | |
878 BPF_DEATH_TEST(NaClNonSfiSandboxTest, fsync_SIGSYS, | |
879 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
880 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
881 syscall(__NR_fsync, 0, 0, 0, 0, 0); | |
882 } | |
883 | |
884 #if defined(__i386__) | |
885 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ftime_SIGSYS, | |
886 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
887 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
888 syscall(__NR_ftime, 0, 0, 0, 0, 0); | |
889 } | |
890 #endif | |
891 | |
892 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ftruncate_SIGSYS, | |
893 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
894 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
895 syscall(__NR_ftruncate, 0, 0, 0, 0, 0); | |
896 } | |
897 | |
898 #if defined(__i386__) || defined(__arm__) | |
899 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ftruncate64_SIGSYS, | |
900 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
901 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
902 syscall(__NR_ftruncate64, 0, 0, 0, 0, 0); | |
903 } | |
904 #endif | |
905 | |
906 BPF_DEATH_TEST(NaClNonSfiSandboxTest, futimesat_SIGSYS, | |
907 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
908 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
909 syscall(__NR_futimesat, 0, 0, 0, 0, 0); | |
910 } | |
911 | |
912 #if defined(__i386__) || defined(__x86_64__) | |
913 BPF_DEATH_TEST(NaClNonSfiSandboxTest, get_kernel_syms_SIGSYS, | |
914 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
915 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
916 syscall(__NR_get_kernel_syms, 0, 0, 0, 0, 0); | |
917 } | |
918 #endif | |
919 | |
920 BPF_DEATH_TEST(NaClNonSfiSandboxTest, get_mempolicy_SIGSYS, | |
921 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
922 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
923 syscall(__NR_get_mempolicy, 0, 0, 0, 0, 0); | |
924 } | |
925 | |
926 BPF_DEATH_TEST(NaClNonSfiSandboxTest, get_robust_list_SIGSYS, | |
927 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
928 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
929 syscall(__NR_get_robust_list, 0, 0, 0, 0, 0); | |
930 } | |
931 | |
932 #if defined(__i386__) || defined(__x86_64__) | |
933 BPF_DEATH_TEST(NaClNonSfiSandboxTest, get_thread_area_SIGSYS, | |
934 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
935 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
936 syscall(__NR_get_thread_area, 0, 0, 0, 0, 0); | |
937 } | |
938 #endif | |
939 | |
940 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getcpu_SIGSYS, | |
941 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
942 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
943 syscall(__NR_getcpu, 0, 0, 0, 0, 0); | |
944 } | |
945 | |
946 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getcwd_SIGSYS, | |
947 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
948 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
949 syscall(__NR_getcwd, 0, 0, 0, 0, 0); | |
950 } | |
951 | |
952 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getdents_SIGSYS, | |
953 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
954 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
955 syscall(__NR_getdents, 0, 0, 0, 0, 0); | |
956 } | |
957 | |
958 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getdents64_SIGSYS, | |
959 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
960 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
961 syscall(__NR_getdents64, 0, 0, 0, 0, 0); | |
962 } | |
963 | |
964 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getgroups_SIGSYS, | |
965 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
966 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
967 syscall(__NR_getgroups, 0, 0, 0, 0, 0); | |
968 } | |
969 | |
970 #if defined(__i386__) || defined(__arm__) | |
971 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getgroups32_SIGSYS, | |
972 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
973 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
974 syscall(__NR_getgroups32, 0, 0, 0, 0, 0); | |
975 } | |
976 #endif | |
977 | |
978 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getitimer_SIGSYS, | |
979 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
980 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
981 syscall(__NR_getitimer, 0, 0, 0, 0, 0); | |
982 } | |
983 | |
984 #if defined(__x86_64__) || defined(__arm__) | |
985 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getpeername_SIGSYS, | |
986 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
987 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
988 syscall(__NR_getpeername, 0, 0, 0, 0, 0); | |
989 } | |
990 #endif | |
991 | |
992 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getpgid_SIGSYS, | |
993 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
994 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
995 syscall(__NR_getpgid, 0, 0, 0, 0, 0); | |
996 } | |
997 | |
998 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getpgrp_SIGSYS, | |
999 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1000 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1001 syscall(__NR_getpgrp, 0, 0, 0, 0, 0); | |
1002 } | |
1003 | |
1004 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getpid_SIGSYS, | |
1005 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1006 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1007 syscall(__NR_getpid, 0, 0, 0, 0, 0); | |
1008 } | |
1009 | |
1010 #if defined(__i386__) || defined(__x86_64__) | |
1011 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getpmsg_SIGSYS, | |
1012 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1013 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1014 syscall(__NR_getpmsg, 0, 0, 0, 0, 0); | |
1015 } | |
1016 #endif | |
1017 | |
1018 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getppid_SIGSYS, | |
1019 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1020 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1021 syscall(__NR_getppid, 0, 0, 0, 0, 0); | |
1022 } | |
1023 | |
1024 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getpriority_SIGSYS, | |
1025 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1026 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1027 syscall(__NR_getpriority, 0, 0, 0, 0, 0); | |
1028 } | |
1029 | |
1030 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getresgid_SIGSYS, | |
1031 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1032 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1033 syscall(__NR_getresgid, 0, 0, 0, 0, 0); | |
1034 } | |
1035 | |
1036 #if defined(__i386__) || defined(__arm__) | |
1037 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getresgid32_SIGSYS, | |
1038 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1039 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1040 syscall(__NR_getresgid32, 0, 0, 0, 0, 0); | |
1041 } | |
1042 #endif | |
1043 | |
1044 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getresuid_SIGSYS, | |
1045 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1046 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1047 syscall(__NR_getresuid, 0, 0, 0, 0, 0); | |
1048 } | |
1049 | |
1050 #if defined(__i386__) || defined(__arm__) | |
1051 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getresuid32_SIGSYS, | |
1052 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1053 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1054 syscall(__NR_getresuid32, 0, 0, 0, 0, 0); | |
1055 } | |
1056 #endif | |
1057 | |
1058 #if defined(__i386__) || defined(__x86_64__) | |
1059 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getrlimit_SIGSYS, | |
1060 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1061 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1062 syscall(__NR_getrlimit, 0, 0, 0, 0, 0); | |
1063 } | |
1064 #endif | |
1065 | |
1066 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getrusage_SIGSYS, | |
1067 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1068 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1069 syscall(__NR_getrusage, 0, 0, 0, 0, 0); | |
1070 } | |
1071 | |
1072 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getsid_SIGSYS, | |
1073 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1074 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1075 syscall(__NR_getsid, 0, 0, 0, 0, 0); | |
1076 } | |
1077 | |
1078 #if defined(__x86_64__) || defined(__arm__) | |
1079 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getsockname_SIGSYS, | |
1080 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1081 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1082 syscall(__NR_getsockname, 0, 0, 0, 0, 0); | |
1083 } | |
1084 #endif | |
1085 | |
1086 #if defined(__x86_64__) || defined(__arm__) | |
1087 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getsockopt_SIGSYS, | |
1088 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1089 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1090 syscall(__NR_getsockopt, 0, 0, 0, 0, 0); | |
1091 } | |
1092 #endif | |
1093 | |
1094 BPF_DEATH_TEST(NaClNonSfiSandboxTest, getxattr_SIGSYS, | |
1095 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1096 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1097 syscall(__NR_getxattr, 0, 0, 0, 0, 0); | |
1098 } | |
1099 | |
1100 #if defined(__i386__) | |
1101 BPF_DEATH_TEST(NaClNonSfiSandboxTest, gtty_SIGSYS, | |
1102 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1103 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1104 syscall(__NR_gtty, 0, 0, 0, 0, 0); | |
1105 } | |
1106 #endif | |
1107 | |
1108 #if defined(__i386__) | |
1109 BPF_DEATH_TEST(NaClNonSfiSandboxTest, idle_SIGSYS, | |
1110 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1111 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1112 syscall(__NR_idle, 0, 0, 0, 0, 0); | |
1113 } | |
1114 #endif | |
1115 | |
1116 BPF_DEATH_TEST(NaClNonSfiSandboxTest, init_module_SIGSYS, | |
1117 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1118 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1119 syscall(__NR_init_module, 0, 0, 0, 0, 0); | |
1120 } | |
1121 | |
1122 BPF_DEATH_TEST(NaClNonSfiSandboxTest, inotify_add_watch_SIGSYS, | |
1123 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1124 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1125 syscall(__NR_inotify_add_watch, 0, 0, 0, 0, 0); | |
1126 } | |
1127 | |
1128 BPF_DEATH_TEST(NaClNonSfiSandboxTest, inotify_init_SIGSYS, | |
1129 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1130 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1131 syscall(__NR_inotify_init, 0, 0, 0, 0, 0); | |
1132 } | |
1133 | |
1134 BPF_DEATH_TEST(NaClNonSfiSandboxTest, inotify_init1_SIGSYS, | |
1135 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1136 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1137 syscall(__NR_inotify_init1, 0, 0, 0, 0, 0); | |
1138 } | |
1139 | |
1140 BPF_DEATH_TEST(NaClNonSfiSandboxTest, inotify_rm_watch_SIGSYS, | |
1141 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1142 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1143 syscall(__NR_inotify_rm_watch, 0, 0, 0, 0, 0); | |
1144 } | |
1145 | |
1146 BPF_DEATH_TEST(NaClNonSfiSandboxTest, io_cancel_SIGSYS, | |
1147 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1148 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1149 syscall(__NR_io_cancel, 0, 0, 0, 0, 0); | |
1150 } | |
1151 | |
1152 BPF_DEATH_TEST(NaClNonSfiSandboxTest, io_destroy_SIGSYS, | |
1153 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1154 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1155 syscall(__NR_io_destroy, 0, 0, 0, 0, 0); | |
1156 } | |
1157 | |
1158 BPF_DEATH_TEST(NaClNonSfiSandboxTest, io_getevents_SIGSYS, | |
1159 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1160 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1161 syscall(__NR_io_getevents, 0, 0, 0, 0, 0); | |
1162 } | |
1163 | |
1164 BPF_DEATH_TEST(NaClNonSfiSandboxTest, io_setup_SIGSYS, | |
1165 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1166 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1167 syscall(__NR_io_setup, 0, 0, 0, 0, 0); | |
1168 } | |
1169 | |
1170 BPF_DEATH_TEST(NaClNonSfiSandboxTest, io_submit_SIGSYS, | |
1171 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1172 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1173 syscall(__NR_io_submit, 0, 0, 0, 0, 0); | |
1174 } | |
1175 | |
1176 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ioctl_SIGSYS, | |
1177 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1178 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1179 syscall(__NR_ioctl, 0, 0, 0, 0, 0); | |
1180 } | |
1181 | |
1182 #if defined(__i386__) || defined(__x86_64__) | |
1183 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ioperm_SIGSYS, | |
1184 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1185 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1186 syscall(__NR_ioperm, 0, 0, 0, 0, 0); | |
1187 } | |
1188 #endif | |
1189 | |
1190 #if defined(__i386__) || defined(__x86_64__) | |
1191 BPF_DEATH_TEST(NaClNonSfiSandboxTest, iopl_SIGSYS, | |
1192 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1193 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1194 syscall(__NR_iopl, 0, 0, 0, 0, 0); | |
1195 } | |
1196 #endif | |
1197 | |
1198 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ioprio_get_SIGSYS, | |
1199 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1200 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1201 syscall(__NR_ioprio_get, 0, 0, 0, 0, 0); | |
1202 } | |
1203 | |
1204 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ioprio_set_SIGSYS, | |
1205 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1206 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1207 syscall(__NR_ioprio_set, 0, 0, 0, 0, 0); | |
1208 } | |
1209 | |
1210 #if defined(__i386__) | |
1211 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ipc_SIGSYS, | |
1212 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1213 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1214 syscall(__NR_ipc, 0, 0, 0, 0, 0); | |
1215 } | |
1216 #endif | |
1217 | |
1218 BPF_DEATH_TEST(NaClNonSfiSandboxTest, kexec_load_SIGSYS, | |
1219 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1220 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1221 syscall(__NR_kexec_load, 0, 0, 0, 0, 0); | |
1222 } | |
1223 | |
1224 BPF_DEATH_TEST(NaClNonSfiSandboxTest, keyctl_SIGSYS, | |
1225 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1226 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1227 syscall(__NR_keyctl, 0, 0, 0, 0, 0); | |
1228 } | |
1229 | |
1230 BPF_DEATH_TEST(NaClNonSfiSandboxTest, kill_SIGSYS, | |
1231 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1232 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1233 syscall(__NR_kill, 0, 0, 0, 0, 0); | |
1234 } | |
1235 | |
1236 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lchown_SIGSYS, | |
1237 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1238 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1239 syscall(__NR_lchown, 0, 0, 0, 0, 0); | |
1240 } | |
1241 | |
1242 #if defined(__i386__) || defined(__arm__) | |
1243 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lchown32_SIGSYS, | |
1244 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1245 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1246 syscall(__NR_lchown32, 0, 0, 0, 0, 0); | |
1247 } | |
1248 #endif | |
1249 | |
1250 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lgetxattr_SIGSYS, | |
1251 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1252 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1253 syscall(__NR_lgetxattr, 0, 0, 0, 0, 0); | |
1254 } | |
1255 | |
1256 BPF_DEATH_TEST(NaClNonSfiSandboxTest, link_SIGSYS, | |
1257 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1258 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1259 syscall(__NR_link, 0, 0, 0, 0, 0); | |
1260 } | |
1261 | |
1262 BPF_DEATH_TEST(NaClNonSfiSandboxTest, linkat_SIGSYS, | |
1263 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1264 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1265 syscall(__NR_linkat, 0, 0, 0, 0, 0); | |
1266 } | |
1267 | |
1268 #if defined(__x86_64__) || defined(__arm__) | |
1269 BPF_DEATH_TEST(NaClNonSfiSandboxTest, listen_SIGSYS, | |
1270 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1271 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1272 syscall(__NR_listen, 0, 0, 0, 0, 0); | |
1273 } | |
1274 #endif | |
1275 | |
1276 BPF_DEATH_TEST(NaClNonSfiSandboxTest, listxattr_SIGSYS, | |
1277 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1278 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1279 syscall(__NR_listxattr, 0, 0, 0, 0, 0); | |
1280 } | |
1281 | |
1282 BPF_DEATH_TEST(NaClNonSfiSandboxTest, llistxattr_SIGSYS, | |
1283 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1284 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1285 syscall(__NR_llistxattr, 0, 0, 0, 0, 0); | |
1286 } | |
1287 | |
1288 #if defined(__i386__) | |
1289 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lock_SIGSYS, | |
1290 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1291 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1292 syscall(__NR_lock, 0, 0, 0, 0, 0); | |
1293 } | |
1294 #endif | |
1295 | |
1296 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lookup_dcookie_SIGSYS, | |
1297 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1298 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1299 syscall(__NR_lookup_dcookie, 0, 0, 0, 0, 0); | |
1300 } | |
1301 | |
1302 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lremovexattr_SIGSYS, | |
1303 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1304 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1305 syscall(__NR_lremovexattr, 0, 0, 0, 0, 0); | |
1306 } | |
1307 | |
1308 #if defined(__i386__) || defined(__arm__) | |
1309 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lseek_SIGSYS, | |
1310 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1311 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1312 syscall(__NR_lseek, 0, 0, 0, 0, 0); | |
1313 } | |
1314 #endif | |
1315 | |
1316 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lsetxattr_SIGSYS, | |
1317 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1318 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1319 syscall(__NR_lsetxattr, 0, 0, 0, 0, 0); | |
1320 } | |
1321 | |
1322 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lstat_SIGSYS, | |
1323 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1324 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1325 syscall(__NR_lstat, 0, 0, 0, 0, 0); | |
1326 } | |
1327 | |
1328 #if defined(__i386__) || defined(__arm__) | |
1329 BPF_DEATH_TEST(NaClNonSfiSandboxTest, lstat64_SIGSYS, | |
1330 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1331 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1332 syscall(__NR_lstat64, 0, 0, 0, 0, 0); | |
1333 } | |
1334 #endif | |
1335 | |
1336 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mbind_SIGSYS, | |
1337 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1338 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1339 syscall(__NR_mbind, 0, 0, 0, 0, 0); | |
1340 } | |
1341 | |
1342 #if defined(__i386__) || defined(__x86_64__) | |
1343 BPF_DEATH_TEST(NaClNonSfiSandboxTest, migrate_pages_SIGSYS, | |
1344 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1345 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1346 syscall(__NR_migrate_pages, 0, 0, 0, 0, 0); | |
1347 } | |
1348 #endif | |
1349 | |
1350 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mincore_SIGSYS, | |
1351 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1352 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1353 syscall(__NR_mincore, 0, 0, 0, 0, 0); | |
1354 } | |
1355 | |
1356 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mkdir_SIGSYS, | |
1357 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1358 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1359 syscall(__NR_mkdir, 0, 0, 0, 0, 0); | |
1360 } | |
1361 | |
1362 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mkdirat_SIGSYS, | |
1363 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1364 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1365 syscall(__NR_mkdirat, 0, 0, 0, 0, 0); | |
1366 } | |
1367 | |
1368 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mknod_SIGSYS, | |
1369 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1370 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1371 syscall(__NR_mknod, 0, 0, 0, 0, 0); | |
1372 } | |
1373 | |
1374 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mknodat_SIGSYS, | |
1375 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1376 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1377 syscall(__NR_mknodat, 0, 0, 0, 0, 0); | |
1378 } | |
1379 | |
1380 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mlock_SIGSYS, | |
1381 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1382 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1383 syscall(__NR_mlock, 0, 0, 0, 0, 0); | |
1384 } | |
1385 | |
1386 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mlockall_SIGSYS, | |
1387 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1388 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1389 syscall(__NR_mlockall, 0, 0, 0, 0, 0); | |
1390 } | |
1391 | |
1392 #if defined(__i386__) | |
1393 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mmap_SIGSYS, | |
1394 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1395 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1396 syscall(__NR_mmap, 0, 0, 0, 0, 0); | |
1397 } | |
1398 #endif | |
1399 | |
1400 #if defined(__i386__) || defined(__x86_64__) | |
1401 BPF_DEATH_TEST(NaClNonSfiSandboxTest, modify_ldt_SIGSYS, | |
1402 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1403 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1404 syscall(__NR_modify_ldt, 0, 0, 0, 0, 0); | |
1405 } | |
1406 #endif | |
1407 | |
1408 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mount_SIGSYS, | |
1409 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1410 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1411 syscall(__NR_mount, 0, 0, 0, 0, 0); | |
1412 } | |
1413 | |
1414 BPF_DEATH_TEST(NaClNonSfiSandboxTest, move_pages_SIGSYS, | |
1415 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1416 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1417 syscall(__NR_move_pages, 0, 0, 0, 0, 0); | |
1418 } | |
1419 | |
1420 #if defined(__i386__) | |
1421 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mpx_SIGSYS, | |
1422 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1423 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1424 syscall(__NR_mpx, 0, 0, 0, 0, 0); | |
1425 } | |
1426 #endif | |
1427 | |
1428 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mq_getsetattr_SIGSYS, | |
1429 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1430 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1431 syscall(__NR_mq_getsetattr, 0, 0, 0, 0, 0); | |
1432 } | |
1433 | |
1434 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mq_notify_SIGSYS, | |
1435 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1436 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1437 syscall(__NR_mq_notify, 0, 0, 0, 0, 0); | |
1438 } | |
1439 | |
1440 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mq_open_SIGSYS, | |
1441 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1442 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1443 syscall(__NR_mq_open, 0, 0, 0, 0, 0); | |
1444 } | |
1445 | |
1446 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mq_timedreceive_SIGSYS, | |
1447 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1448 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1449 syscall(__NR_mq_timedreceive, 0, 0, 0, 0, 0); | |
1450 } | |
1451 | |
1452 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mq_timedsend_SIGSYS, | |
1453 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1454 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1455 syscall(__NR_mq_timedsend, 0, 0, 0, 0, 0); | |
1456 } | |
1457 | |
1458 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mq_unlink_SIGSYS, | |
1459 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1460 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1461 syscall(__NR_mq_unlink, 0, 0, 0, 0, 0); | |
1462 } | |
1463 | |
1464 BPF_DEATH_TEST(NaClNonSfiSandboxTest, mremap_SIGSYS, | |
1465 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1466 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1467 syscall(__NR_mremap, 0, 0, 0, 0, 0); | |
1468 } | |
1469 | |
1470 #if defined(__x86_64__) || defined(__arm__) | |
1471 BPF_DEATH_TEST(NaClNonSfiSandboxTest, msgctl_SIGSYS, | |
1472 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1473 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1474 syscall(__NR_msgctl, 0, 0, 0, 0, 0); | |
1475 } | |
1476 #endif | |
1477 | |
1478 #if defined(__x86_64__) || defined(__arm__) | |
1479 BPF_DEATH_TEST(NaClNonSfiSandboxTest, msgget_SIGSYS, | |
1480 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1481 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1482 syscall(__NR_msgget, 0, 0, 0, 0, 0); | |
1483 } | |
1484 #endif | |
1485 | |
1486 #if defined(__x86_64__) || defined(__arm__) | |
1487 BPF_DEATH_TEST(NaClNonSfiSandboxTest, msgrcv_SIGSYS, | |
1488 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1489 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1490 syscall(__NR_msgrcv, 0, 0, 0, 0, 0); | |
1491 } | |
1492 #endif | |
1493 | |
1494 #if defined(__x86_64__) || defined(__arm__) | |
1495 BPF_DEATH_TEST(NaClNonSfiSandboxTest, msgsnd_SIGSYS, | |
1496 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1497 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1498 syscall(__NR_msgsnd, 0, 0, 0, 0, 0); | |
1499 } | |
1500 #endif | |
1501 | |
1502 BPF_DEATH_TEST(NaClNonSfiSandboxTest, msync_SIGSYS, | |
1503 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1504 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1505 syscall(__NR_msync, 0, 0, 0, 0, 0); | |
1506 } | |
1507 | |
1508 BPF_DEATH_TEST(NaClNonSfiSandboxTest, munlock_SIGSYS, | |
1509 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1510 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1511 syscall(__NR_munlock, 0, 0, 0, 0, 0); | |
1512 } | |
1513 | |
1514 BPF_DEATH_TEST(NaClNonSfiSandboxTest, munlockall_SIGSYS, | |
1515 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1516 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1517 syscall(__NR_munlockall, 0, 0, 0, 0, 0); | |
1518 } | |
1519 | |
1520 BPF_DEATH_TEST(NaClNonSfiSandboxTest, name_to_handle_at_SIGSYS, | |
1521 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1522 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1523 syscall(__NR_name_to_handle_at, 0, 0, 0, 0, 0); | |
1524 } | |
1525 | |
1526 #if defined(__x86_64__) | |
1527 BPF_DEATH_TEST(NaClNonSfiSandboxTest, newfstatat_SIGSYS, | |
1528 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1529 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1530 syscall(__NR_newfstatat, 0, 0, 0, 0, 0); | |
1531 } | |
1532 #endif | |
1533 | |
1534 BPF_DEATH_TEST(NaClNonSfiSandboxTest, nfsservctl_SIGSYS, | |
1535 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1536 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1537 syscall(__NR_nfsservctl, 0, 0, 0, 0, 0); | |
1538 } | |
1539 | |
1540 #if defined(__i386__) || defined(__arm__) | |
1541 BPF_DEATH_TEST(NaClNonSfiSandboxTest, nice_SIGSYS, | |
1542 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1543 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1544 syscall(__NR_nice, 0, 0, 0, 0, 0); | |
1545 } | |
1546 #endif | |
1547 | |
1548 #if defined(__i386__) | |
1549 BPF_DEATH_TEST(NaClNonSfiSandboxTest, oldfstat_SIGSYS, | |
1550 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1551 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1552 syscall(__NR_oldfstat, 0, 0, 0, 0, 0); | |
1553 } | |
1554 #endif | |
1555 | |
1556 #if defined(__i386__) | |
1557 BPF_DEATH_TEST(NaClNonSfiSandboxTest, oldlstat_SIGSYS, | |
1558 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1559 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1560 syscall(__NR_oldlstat, 0, 0, 0, 0, 0); | |
1561 } | |
1562 #endif | |
1563 | |
1564 #if defined(__i386__) | |
1565 BPF_DEATH_TEST(NaClNonSfiSandboxTest, oldolduname_SIGSYS, | |
1566 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1567 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1568 syscall(__NR_oldolduname, 0, 0, 0, 0, 0); | |
1569 } | |
1570 #endif | |
1571 | |
1572 #if defined(__i386__) | |
1573 BPF_DEATH_TEST(NaClNonSfiSandboxTest, oldstat_SIGSYS, | |
1574 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1575 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1576 syscall(__NR_oldstat, 0, 0, 0, 0, 0); | |
1577 } | |
1578 #endif | |
1579 | |
1580 #if defined(__i386__) | |
1581 BPF_DEATH_TEST(NaClNonSfiSandboxTest, olduname_SIGSYS, | |
1582 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1583 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1584 syscall(__NR_olduname, 0, 0, 0, 0, 0); | |
1585 } | |
1586 #endif | |
1587 | |
1588 BPF_DEATH_TEST(NaClNonSfiSandboxTest, open_by_handle_at_SIGSYS, | |
1589 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1590 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1591 syscall(__NR_open_by_handle_at, 0, 0, 0, 0, 0); | |
1592 } | |
1593 | |
1594 BPF_DEATH_TEST(NaClNonSfiSandboxTest, openat_SIGSYS, | |
1595 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1596 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1597 syscall(__NR_openat, 0, 0, 0, 0, 0); | |
1598 } | |
1599 | |
1600 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pause_SIGSYS, | |
1601 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1602 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1603 syscall(__NR_pause, 0, 0, 0, 0, 0); | |
1604 } | |
1605 | |
1606 #if defined(__arm__) | |
1607 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pciconfig_iobase_SIGSYS, | |
1608 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1609 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1610 syscall(__NR_pciconfig_iobase, 0, 0, 0, 0, 0); | |
1611 } | |
1612 #endif | |
1613 | |
1614 #if defined(__arm__) | |
1615 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pciconfig_read_SIGSYS, | |
1616 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1617 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1618 syscall(__NR_pciconfig_read, 0, 0, 0, 0, 0); | |
1619 } | |
1620 #endif | |
1621 | |
1622 #if defined(__arm__) | |
1623 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pciconfig_write_SIGSYS, | |
1624 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1625 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1626 syscall(__NR_pciconfig_write, 0, 0, 0, 0, 0); | |
1627 } | |
1628 #endif | |
1629 | |
1630 BPF_DEATH_TEST(NaClNonSfiSandboxTest, perf_event_open_SIGSYS, | |
1631 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1632 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1633 syscall(__NR_perf_event_open, 0, 0, 0, 0, 0); | |
1634 } | |
1635 | |
1636 BPF_DEATH_TEST(NaClNonSfiSandboxTest, personality_SIGSYS, | |
1637 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1638 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1639 syscall(__NR_personality, 0, 0, 0, 0, 0); | |
1640 } | |
1641 | |
1642 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pipe2_SIGSYS, | |
1643 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1644 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1645 syscall(__NR_pipe2, 0, 0, 0, 0, 0); | |
1646 } | |
1647 | |
1648 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pivot_root_SIGSYS, | |
1649 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1650 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1651 syscall(__NR_pivot_root, 0, 0, 0, 0, 0); | |
1652 } | |
1653 | |
1654 BPF_DEATH_TEST(NaClNonSfiSandboxTest, poll_SIGSYS, | |
1655 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1656 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1657 syscall(__NR_poll, 0, 0, 0, 0, 0); | |
1658 } | |
1659 | |
1660 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ppoll_SIGSYS, | |
1661 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1662 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1663 syscall(__NR_ppoll, 0, 0, 0, 0, 0); | |
1664 } | |
1665 | |
1666 BPF_DEATH_TEST(NaClNonSfiSandboxTest, preadv_SIGSYS, | |
1667 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1668 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1669 syscall(__NR_preadv, 0, 0, 0, 0, 0); | |
1670 } | |
1671 | |
1672 BPF_DEATH_TEST(NaClNonSfiSandboxTest, prlimit64_SIGSYS, | |
1673 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1674 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1675 syscall(__NR_prlimit64, 0, 0, 0, 0, 0); | |
1676 } | |
1677 | |
1678 BPF_DEATH_TEST(NaClNonSfiSandboxTest, process_vm_readv_SIGSYS, | |
1679 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1680 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1681 syscall(__NR_process_vm_readv, 0, 0, 0, 0, 0); | |
1682 } | |
1683 | |
1684 BPF_DEATH_TEST(NaClNonSfiSandboxTest, process_vm_writev_SIGSYS, | |
1685 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1686 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1687 syscall(__NR_process_vm_writev, 0, 0, 0, 0, 0); | |
1688 } | |
1689 | |
1690 #if defined(__i386__) | |
1691 BPF_DEATH_TEST(NaClNonSfiSandboxTest, prof_SIGSYS, | |
1692 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1693 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1694 syscall(__NR_prof, 0, 0, 0, 0, 0); | |
1695 } | |
1696 #endif | |
1697 | |
1698 #if defined(__i386__) | |
1699 BPF_DEATH_TEST(NaClNonSfiSandboxTest, profil_SIGSYS, | |
1700 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1701 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1702 syscall(__NR_profil, 0, 0, 0, 0, 0); | |
1703 } | |
1704 #endif | |
1705 | |
1706 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pselect6_SIGSYS, | |
1707 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1708 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1709 syscall(__NR_pselect6, 0, 0, 0, 0, 0); | |
1710 } | |
1711 | |
1712 #if defined(__i386__) || defined(__x86_64__) | |
1713 BPF_DEATH_TEST(NaClNonSfiSandboxTest, putpmsg_SIGSYS, | |
1714 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1715 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1716 syscall(__NR_putpmsg, 0, 0, 0, 0, 0); | |
1717 } | |
1718 #endif | |
1719 | |
1720 BPF_DEATH_TEST(NaClNonSfiSandboxTest, pwritev_SIGSYS, | |
1721 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1722 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1723 syscall(__NR_pwritev, 0, 0, 0, 0, 0); | |
1724 } | |
1725 | |
1726 #if defined(__i386__) || defined(__x86_64__) | |
1727 BPF_DEATH_TEST(NaClNonSfiSandboxTest, query_module_SIGSYS, | |
1728 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1729 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1730 syscall(__NR_query_module, 0, 0, 0, 0, 0); | |
1731 } | |
1732 #endif | |
1733 | |
1734 BPF_DEATH_TEST(NaClNonSfiSandboxTest, quotactl_SIGSYS, | |
1735 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1736 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1737 syscall(__NR_quotactl, 0, 0, 0, 0, 0); | |
1738 } | |
1739 | |
1740 BPF_DEATH_TEST(NaClNonSfiSandboxTest, readahead_SIGSYS, | |
1741 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1742 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1743 syscall(__NR_readahead, 0, 0, 0, 0, 0); | |
1744 } | |
1745 | |
1746 #if defined(__i386__) | |
1747 BPF_DEATH_TEST(NaClNonSfiSandboxTest, readdir_SIGSYS, | |
1748 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1749 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1750 syscall(__NR_readdir, 0, 0, 0, 0, 0); | |
1751 } | |
1752 #endif | |
1753 | |
1754 BPF_DEATH_TEST(NaClNonSfiSandboxTest, readlink_SIGSYS, | |
1755 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1756 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1757 syscall(__NR_readlink, 0, 0, 0, 0, 0); | |
1758 } | |
1759 | |
1760 BPF_DEATH_TEST(NaClNonSfiSandboxTest, readlinkat_SIGSYS, | |
1761 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1762 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1763 syscall(__NR_readlinkat, 0, 0, 0, 0, 0); | |
1764 } | |
1765 | |
1766 BPF_DEATH_TEST(NaClNonSfiSandboxTest, readv_SIGSYS, | |
1767 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1768 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1769 syscall(__NR_readv, 0, 0, 0, 0, 0); | |
1770 } | |
1771 | |
1772 BPF_DEATH_TEST(NaClNonSfiSandboxTest, reboot_SIGSYS, | |
1773 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1774 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1775 syscall(__NR_reboot, 0, 0, 0, 0, 0); | |
1776 } | |
1777 | |
1778 #if defined(__arm__) | |
1779 BPF_DEATH_TEST(NaClNonSfiSandboxTest, recv_SIGSYS, | |
1780 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1781 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1782 syscall(__NR_recv, 0, 0, 0, 0, 0); | |
1783 } | |
1784 #endif | |
1785 | |
1786 #if defined(__x86_64__) || defined(__arm__) | |
1787 BPF_DEATH_TEST(NaClNonSfiSandboxTest, recvfrom_SIGSYS, | |
1788 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1789 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1790 syscall(__NR_recvfrom, 0, 0, 0, 0, 0); | |
1791 } | |
1792 #endif | |
1793 | |
1794 BPF_DEATH_TEST(NaClNonSfiSandboxTest, recvmmsg_SIGSYS, | |
1795 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1796 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1797 syscall(__NR_recvmmsg, 0, 0, 0, 0, 0); | |
1798 } | |
1799 | |
1800 BPF_DEATH_TEST(NaClNonSfiSandboxTest, remap_file_pages_SIGSYS, | |
1801 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1802 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1803 syscall(__NR_remap_file_pages, 0, 0, 0, 0, 0); | |
1804 } | |
1805 | |
1806 BPF_DEATH_TEST(NaClNonSfiSandboxTest, removexattr_SIGSYS, | |
1807 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1808 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1809 syscall(__NR_removexattr, 0, 0, 0, 0, 0); | |
1810 } | |
1811 | |
1812 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rename_SIGSYS, | |
1813 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1814 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1815 syscall(__NR_rename, 0, 0, 0, 0, 0); | |
1816 } | |
1817 | |
1818 BPF_DEATH_TEST(NaClNonSfiSandboxTest, renameat_SIGSYS, | |
1819 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1820 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1821 syscall(__NR_renameat, 0, 0, 0, 0, 0); | |
1822 } | |
1823 | |
1824 BPF_DEATH_TEST(NaClNonSfiSandboxTest, request_key_SIGSYS, | |
1825 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1826 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1827 syscall(__NR_request_key, 0, 0, 0, 0, 0); | |
1828 } | |
1829 | |
1830 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rmdir_SIGSYS, | |
1831 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1832 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1833 syscall(__NR_rmdir, 0, 0, 0, 0, 0); | |
1834 } | |
1835 | |
1836 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_sigaction_SIGSYS, | |
1837 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1838 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1839 syscall(__NR_rt_sigaction, 0, 0, 0, 0, 0); | |
1840 } | |
1841 | |
1842 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_sigpending_SIGSYS, | |
1843 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1844 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1845 syscall(__NR_rt_sigpending, 0, 0, 0, 0, 0); | |
1846 } | |
1847 | |
1848 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_sigprocmask_SIGSYS, | |
1849 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1850 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1851 syscall(__NR_rt_sigprocmask, 0, 0, 0, 0, 0); | |
1852 } | |
1853 | |
1854 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_sigqueueinfo_SIGSYS, | |
1855 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1856 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1857 syscall(__NR_rt_sigqueueinfo, 0, 0, 0, 0, 0); | |
1858 } | |
1859 | |
1860 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_sigreturn_SIGSYS, | |
1861 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1862 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1863 syscall(__NR_rt_sigreturn, 0, 0, 0, 0, 0); | |
1864 } | |
1865 | |
1866 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_sigsuspend_SIGSYS, | |
1867 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1868 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1869 syscall(__NR_rt_sigsuspend, 0, 0, 0, 0, 0); | |
1870 } | |
1871 | |
1872 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_sigtimedwait_SIGSYS, | |
1873 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1874 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1875 syscall(__NR_rt_sigtimedwait, 0, 0, 0, 0, 0); | |
1876 } | |
1877 | |
1878 BPF_DEATH_TEST(NaClNonSfiSandboxTest, rt_tgsigqueueinfo_SIGSYS, | |
1879 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1880 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1881 syscall(__NR_rt_tgsigqueueinfo, 0, 0, 0, 0, 0); | |
1882 } | |
1883 | |
1884 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_get_priority_max_SIGSYS, | |
1885 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1886 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1887 syscall(__NR_sched_get_priority_max, 0, 0, 0, 0, 0); | |
1888 } | |
1889 | |
1890 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_get_priority_min_SIGSYS, | |
1891 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1892 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1893 syscall(__NR_sched_get_priority_min, 0, 0, 0, 0, 0); | |
1894 } | |
1895 | |
1896 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_getaffinity_SIGSYS, | |
1897 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1898 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1899 syscall(__NR_sched_getaffinity, 0, 0, 0, 0, 0); | |
1900 } | |
1901 | |
1902 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_getparam_SIGSYS, | |
1903 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1904 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1905 syscall(__NR_sched_getparam, 0, 0, 0, 0, 0); | |
1906 } | |
1907 | |
1908 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_getscheduler_SIGSYS, | |
1909 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1910 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1911 syscall(__NR_sched_getscheduler, 0, 0, 0, 0, 0); | |
1912 } | |
1913 | |
1914 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_rr_get_interval_SIGSYS, | |
1915 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1916 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1917 syscall(__NR_sched_rr_get_interval, 0, 0, 0, 0, 0); | |
1918 } | |
1919 | |
1920 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_setaffinity_SIGSYS, | |
1921 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1922 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1923 syscall(__NR_sched_setaffinity, 0, 0, 0, 0, 0); | |
1924 } | |
1925 | |
1926 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_setparam_SIGSYS, | |
1927 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1928 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1929 syscall(__NR_sched_setparam, 0, 0, 0, 0, 0); | |
1930 } | |
1931 | |
1932 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sched_setscheduler_SIGSYS, | |
1933 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1934 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1935 syscall(__NR_sched_setscheduler, 0, 0, 0, 0, 0); | |
1936 } | |
1937 | |
1938 #if defined(__x86_64__) | |
1939 BPF_DEATH_TEST(NaClNonSfiSandboxTest, security_SIGSYS, | |
1940 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1941 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1942 syscall(__NR_security, 0, 0, 0, 0, 0); | |
1943 } | |
1944 #endif | |
1945 | |
1946 #if defined(__i386__) || defined(__x86_64__) | |
1947 BPF_DEATH_TEST(NaClNonSfiSandboxTest, select_SIGSYS, | |
1948 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1949 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1950 syscall(__NR_select, 0, 0, 0, 0, 0); | |
1951 } | |
1952 #endif | |
1953 | |
1954 #if defined(__x86_64__) || defined(__arm__) | |
1955 BPF_DEATH_TEST(NaClNonSfiSandboxTest, semctl_SIGSYS, | |
1956 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1957 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1958 syscall(__NR_semctl, 0, 0, 0, 0, 0); | |
1959 } | |
1960 #endif | |
1961 | |
1962 #if defined(__x86_64__) || defined(__arm__) | |
1963 BPF_DEATH_TEST(NaClNonSfiSandboxTest, semget_SIGSYS, | |
1964 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1965 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1966 syscall(__NR_semget, 0, 0, 0, 0, 0); | |
1967 } | |
1968 #endif | |
1969 | |
1970 #if defined(__x86_64__) || defined(__arm__) | |
1971 BPF_DEATH_TEST(NaClNonSfiSandboxTest, semop_SIGSYS, | |
1972 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1973 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1974 syscall(__NR_semop, 0, 0, 0, 0, 0); | |
1975 } | |
1976 #endif | |
1977 | |
1978 #if defined(__x86_64__) || defined(__arm__) | |
1979 BPF_DEATH_TEST(NaClNonSfiSandboxTest, semtimedop_SIGSYS, | |
1980 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1981 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1982 syscall(__NR_semtimedop, 0, 0, 0, 0, 0); | |
1983 } | |
1984 #endif | |
1985 | |
1986 #if defined(__arm__) | |
1987 BPF_DEATH_TEST(NaClNonSfiSandboxTest, send_SIGSYS, | |
1988 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1989 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1990 syscall(__NR_send, 0, 0, 0, 0, 0); | |
1991 } | |
1992 #endif | |
1993 | |
1994 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sendfile_SIGSYS, | |
1995 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
1996 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
1997 syscall(__NR_sendfile, 0, 0, 0, 0, 0); | |
1998 } | |
1999 | |
2000 #if defined(__i386__) || defined(__arm__) | |
2001 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sendfile64_SIGSYS, | |
2002 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2003 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2004 syscall(__NR_sendfile64, 0, 0, 0, 0, 0); | |
2005 } | |
2006 #endif | |
2007 | |
2008 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sendmmsg_SIGSYS, | |
2009 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2010 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2011 syscall(__NR_sendmmsg, 0, 0, 0, 0, 0); | |
2012 } | |
2013 | |
2014 #if defined(__x86_64__) || defined(__arm__) | |
2015 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sendto_SIGSYS, | |
2016 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2017 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2018 syscall(__NR_sendto, 0, 0, 0, 0, 0); | |
2019 } | |
2020 #endif | |
2021 | |
2022 BPF_DEATH_TEST(NaClNonSfiSandboxTest, set_mempolicy_SIGSYS, | |
2023 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2024 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2025 syscall(__NR_set_mempolicy, 0, 0, 0, 0, 0); | |
2026 } | |
2027 | |
2028 #if defined(__i386__) || defined(__x86_64__) | |
2029 BPF_DEATH_TEST(NaClNonSfiSandboxTest, set_thread_area_SIGSYS, | |
2030 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2031 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2032 syscall(__NR_set_thread_area, 0, 0, 0, 0, 0); | |
2033 } | |
2034 #endif | |
2035 | |
2036 BPF_DEATH_TEST(NaClNonSfiSandboxTest, set_tid_address_SIGSYS, | |
2037 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2038 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2039 syscall(__NR_set_tid_address, 0, 0, 0, 0, 0); | |
2040 } | |
2041 | |
2042 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setdomainname_SIGSYS, | |
2043 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2044 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2045 syscall(__NR_setdomainname, 0, 0, 0, 0, 0); | |
2046 } | |
2047 | |
2048 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setfsgid_SIGSYS, | |
2049 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2050 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2051 syscall(__NR_setfsgid, 0, 0, 0, 0, 0); | |
2052 } | |
2053 | |
2054 #if defined(__i386__) || defined(__arm__) | |
2055 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setfsgid32_SIGSYS, | |
2056 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2057 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2058 syscall(__NR_setfsgid32, 0, 0, 0, 0, 0); | |
2059 } | |
2060 #endif | |
2061 | |
2062 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setfsuid_SIGSYS, | |
2063 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2064 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2065 syscall(__NR_setfsuid, 0, 0, 0, 0, 0); | |
2066 } | |
2067 | |
2068 #if defined(__i386__) || defined(__arm__) | |
2069 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setfsuid32_SIGSYS, | |
2070 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2071 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2072 syscall(__NR_setfsuid32, 0, 0, 0, 0, 0); | |
2073 } | |
2074 #endif | |
2075 | |
2076 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setgid_SIGSYS, | |
2077 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2078 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2079 syscall(__NR_setgid, 0, 0, 0, 0, 0); | |
2080 } | |
2081 | |
2082 #if defined(__i386__) || defined(__arm__) | |
2083 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setgid32_SIGSYS, | |
2084 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2085 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2086 syscall(__NR_setgid32, 0, 0, 0, 0, 0); | |
2087 } | |
2088 #endif | |
2089 | |
2090 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setgroups_SIGSYS, | |
2091 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2092 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2093 syscall(__NR_setgroups, 0, 0, 0, 0, 0); | |
2094 } | |
2095 | |
2096 #if defined(__i386__) || defined(__arm__) | |
2097 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setgroups32_SIGSYS, | |
2098 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2099 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2100 syscall(__NR_setgroups32, 0, 0, 0, 0, 0); | |
2101 } | |
2102 #endif | |
2103 | |
2104 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sethostname_SIGSYS, | |
2105 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2106 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2107 syscall(__NR_sethostname, 0, 0, 0, 0, 0); | |
2108 } | |
2109 | |
2110 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setitimer_SIGSYS, | |
2111 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2112 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2113 syscall(__NR_setitimer, 0, 0, 0, 0, 0); | |
2114 } | |
2115 | |
2116 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setns_SIGSYS, | |
2117 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2118 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2119 syscall(__NR_setns, 0, 0, 0, 0, 0); | |
2120 } | |
2121 | |
2122 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setpgid_SIGSYS, | |
2123 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2124 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2125 syscall(__NR_setpgid, 0, 0, 0, 0, 0); | |
2126 } | |
2127 | |
2128 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setpriority_SIGSYS, | |
2129 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2130 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2131 syscall(__NR_setpriority, 0, 0, 0, 0, 0); | |
2132 } | |
2133 | |
2134 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setregid_SIGSYS, | |
2135 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2136 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2137 syscall(__NR_setregid, 0, 0, 0, 0, 0); | |
2138 } | |
2139 | |
2140 #if defined(__i386__) || defined(__arm__) | |
2141 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setregid32_SIGSYS, | |
2142 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2143 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2144 syscall(__NR_setregid32, 0, 0, 0, 0, 0); | |
2145 } | |
2146 #endif | |
2147 | |
2148 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setresgid_SIGSYS, | |
2149 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2150 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2151 syscall(__NR_setresgid, 0, 0, 0, 0, 0); | |
2152 } | |
2153 | |
2154 #if defined(__i386__) || defined(__arm__) | |
2155 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setresgid32_SIGSYS, | |
2156 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2157 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2158 syscall(__NR_setresgid32, 0, 0, 0, 0, 0); | |
2159 } | |
2160 #endif | |
2161 | |
2162 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setresuid_SIGSYS, | |
2163 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2164 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2165 syscall(__NR_setresuid, 0, 0, 0, 0, 0); | |
2166 } | |
2167 | |
2168 #if defined(__i386__) || defined(__arm__) | |
2169 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setresuid32_SIGSYS, | |
2170 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2171 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2172 syscall(__NR_setresuid32, 0, 0, 0, 0, 0); | |
2173 } | |
2174 #endif | |
2175 | |
2176 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setreuid_SIGSYS, | |
2177 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2178 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2179 syscall(__NR_setreuid, 0, 0, 0, 0, 0); | |
2180 } | |
2181 | |
2182 #if defined(__i386__) || defined(__arm__) | |
2183 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setreuid32_SIGSYS, | |
2184 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2185 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2186 syscall(__NR_setreuid32, 0, 0, 0, 0, 0); | |
2187 } | |
2188 #endif | |
2189 | |
2190 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setrlimit_SIGSYS, | |
2191 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2192 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2193 syscall(__NR_setrlimit, 0, 0, 0, 0, 0); | |
2194 } | |
2195 | |
2196 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setsid_SIGSYS, | |
2197 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2198 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2199 syscall(__NR_setsid, 0, 0, 0, 0, 0); | |
2200 } | |
2201 | |
2202 #if defined(__x86_64__) || defined(__arm__) | |
2203 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setsockopt_SIGSYS, | |
2204 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2205 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2206 syscall(__NR_setsockopt, 0, 0, 0, 0, 0); | |
2207 } | |
2208 #endif | |
2209 | |
2210 BPF_DEATH_TEST(NaClNonSfiSandboxTest, settimeofday_SIGSYS, | |
2211 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2212 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2213 syscall(__NR_settimeofday, 0, 0, 0, 0, 0); | |
2214 } | |
2215 | |
2216 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setuid_SIGSYS, | |
2217 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2218 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2219 syscall(__NR_setuid, 0, 0, 0, 0, 0); | |
2220 } | |
2221 | |
2222 #if defined(__i386__) || defined(__arm__) | |
2223 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setuid32_SIGSYS, | |
2224 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2225 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2226 syscall(__NR_setuid32, 0, 0, 0, 0, 0); | |
2227 } | |
2228 #endif | |
2229 | |
2230 BPF_DEATH_TEST(NaClNonSfiSandboxTest, setxattr_SIGSYS, | |
2231 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2232 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2233 syscall(__NR_setxattr, 0, 0, 0, 0, 0); | |
2234 } | |
2235 | |
2236 #if defined(__i386__) | |
2237 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sgetmask_SIGSYS, | |
2238 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2239 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2240 syscall(__NR_sgetmask, 0, 0, 0, 0, 0); | |
2241 } | |
2242 #endif | |
2243 | |
2244 #if defined(__x86_64__) || defined(__arm__) | |
2245 BPF_DEATH_TEST(NaClNonSfiSandboxTest, shmat_SIGSYS, | |
2246 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2247 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2248 syscall(__NR_shmat, 0, 0, 0, 0, 0); | |
2249 } | |
2250 #endif | |
2251 | |
2252 #if defined(__x86_64__) || defined(__arm__) | |
2253 BPF_DEATH_TEST(NaClNonSfiSandboxTest, shmctl_SIGSYS, | |
2254 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2255 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2256 syscall(__NR_shmctl, 0, 0, 0, 0, 0); | |
2257 } | |
2258 #endif | |
2259 | |
2260 #if defined(__x86_64__) || defined(__arm__) | |
2261 BPF_DEATH_TEST(NaClNonSfiSandboxTest, shmdt_SIGSYS, | |
2262 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2263 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2264 syscall(__NR_shmdt, 0, 0, 0, 0, 0); | |
2265 } | |
2266 #endif | |
2267 | |
2268 #if defined(__x86_64__) || defined(__arm__) | |
2269 BPF_DEATH_TEST(NaClNonSfiSandboxTest, shmget_SIGSYS, | |
2270 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2271 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2272 syscall(__NR_shmget, 0, 0, 0, 0, 0); | |
2273 } | |
2274 #endif | |
2275 | |
2276 #if defined(__i386__) || defined(__arm__) | |
2277 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sigaction_SIGSYS, | |
2278 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2279 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2280 syscall(__NR_sigaction, 0, 0, 0, 0, 0); | |
2281 } | |
2282 #endif | |
2283 | |
2284 #if defined(__i386__) | |
2285 BPF_DEATH_TEST(NaClNonSfiSandboxTest, signal_SIGSYS, | |
2286 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2287 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2288 syscall(__NR_signal, 0, 0, 0, 0, 0); | |
2289 } | |
2290 #endif | |
2291 | |
2292 BPF_DEATH_TEST(NaClNonSfiSandboxTest, signalfd_SIGSYS, | |
2293 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2294 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2295 syscall(__NR_signalfd, 0, 0, 0, 0, 0); | |
2296 } | |
2297 | |
2298 BPF_DEATH_TEST(NaClNonSfiSandboxTest, signalfd4_SIGSYS, | |
2299 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2300 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2301 syscall(__NR_signalfd4, 0, 0, 0, 0, 0); | |
2302 } | |
2303 | |
2304 #if defined(__i386__) || defined(__arm__) | |
2305 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sigpending_SIGSYS, | |
2306 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2307 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2308 syscall(__NR_sigpending, 0, 0, 0, 0, 0); | |
2309 } | |
2310 #endif | |
2311 | |
2312 #if defined(__i386__) || defined(__arm__) | |
2313 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sigprocmask_SIGSYS, | |
2314 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2315 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2316 syscall(__NR_sigprocmask, 0, 0, 0, 0, 0); | |
2317 } | |
2318 #endif | |
2319 | |
2320 #if defined(__i386__) || defined(__arm__) | |
2321 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sigreturn_SIGSYS, | |
2322 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2323 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2324 syscall(__NR_sigreturn, 0, 0, 0, 0, 0); | |
2325 } | |
2326 #endif | |
2327 | |
2328 #if defined(__i386__) || defined(__arm__) | |
2329 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sigsuspend_SIGSYS, | |
2330 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2331 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2332 syscall(__NR_sigsuspend, 0, 0, 0, 0, 0); | |
2333 } | |
2334 #endif | |
2335 | |
2336 #if defined(__x86_64__) || defined(__arm__) | |
2337 BPF_DEATH_TEST(NaClNonSfiSandboxTest, socket_SIGSYS, | |
2338 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2339 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2340 syscall(__NR_socket, 0, 0, 0, 0, 0); | |
2341 } | |
2342 #endif | |
2343 | |
2344 BPF_DEATH_TEST(NaClNonSfiSandboxTest, splice_SIGSYS, | |
2345 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2346 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2347 syscall(__NR_splice, 0, 0, 0, 0, 0); | |
2348 } | |
2349 | |
2350 #if defined(__i386__) | |
2351 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ssetmask_SIGSYS, | |
2352 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2353 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2354 syscall(__NR_ssetmask, 0, 0, 0, 0, 0); | |
2355 } | |
2356 #endif | |
2357 | |
2358 BPF_DEATH_TEST(NaClNonSfiSandboxTest, stat_SIGSYS, | |
2359 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2360 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2361 syscall(__NR_stat, 0, 0, 0, 0, 0); | |
2362 } | |
2363 | |
2364 #if defined(__i386__) || defined(__arm__) | |
2365 BPF_DEATH_TEST(NaClNonSfiSandboxTest, stat64_SIGSYS, | |
2366 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2367 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2368 syscall(__NR_stat64, 0, 0, 0, 0, 0); | |
2369 } | |
2370 #endif | |
2371 | |
2372 BPF_DEATH_TEST(NaClNonSfiSandboxTest, statfs_SIGSYS, | |
2373 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2374 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2375 syscall(__NR_statfs, 0, 0, 0, 0, 0); | |
2376 } | |
2377 | |
2378 #if defined(__i386__) || defined(__arm__) | |
2379 BPF_DEATH_TEST(NaClNonSfiSandboxTest, statfs64_SIGSYS, | |
2380 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2381 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2382 syscall(__NR_statfs64, 0, 0, 0, 0, 0); | |
2383 } | |
2384 #endif | |
2385 | |
2386 #if defined(__i386__) | |
2387 BPF_DEATH_TEST(NaClNonSfiSandboxTest, stime_SIGSYS, | |
2388 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2389 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2390 syscall(__NR_stime, 0, 0, 0, 0, 0); | |
2391 } | |
2392 #endif | |
2393 | |
2394 #if defined(__i386__) | |
2395 BPF_DEATH_TEST(NaClNonSfiSandboxTest, stty_SIGSYS, | |
2396 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2397 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2398 syscall(__NR_stty, 0, 0, 0, 0, 0); | |
2399 } | |
2400 #endif | |
2401 | |
2402 BPF_DEATH_TEST(NaClNonSfiSandboxTest, swapoff_SIGSYS, | |
2403 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2404 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2405 syscall(__NR_swapoff, 0, 0, 0, 0, 0); | |
Mark Seaborn
2014/04/15 23:03:14
Crikey, this file is huge.
Does it really make se
jln (very slow on Chromium)
2014/04/16 01:36:11
I think it's useful to really test for all of this
hamaji
2014/04/16 02:10:48
I'm not sure if they are actually useful. I imagin
| |
2406 } | |
2407 | |
2408 BPF_DEATH_TEST(NaClNonSfiSandboxTest, swapon_SIGSYS, | |
2409 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2410 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2411 syscall(__NR_swapon, 0, 0, 0, 0, 0); | |
2412 } | |
2413 | |
2414 BPF_DEATH_TEST(NaClNonSfiSandboxTest, symlink_SIGSYS, | |
2415 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2416 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2417 syscall(__NR_symlink, 0, 0, 0, 0, 0); | |
2418 } | |
2419 | |
2420 BPF_DEATH_TEST(NaClNonSfiSandboxTest, symlinkat_SIGSYS, | |
2421 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2422 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2423 syscall(__NR_symlinkat, 0, 0, 0, 0, 0); | |
2424 } | |
2425 | |
2426 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sync_SIGSYS, | |
2427 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2428 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2429 syscall(__NR_sync, 0, 0, 0, 0, 0); | |
2430 } | |
2431 | |
2432 #if defined(__i386__) || defined(__x86_64__) | |
2433 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sync_file_range_SIGSYS, | |
2434 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2435 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2436 syscall(__NR_sync_file_range, 0, 0, 0, 0, 0); | |
2437 } | |
2438 #endif | |
2439 | |
2440 #if defined(__arm__) | |
2441 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sync_file_range2_SIGSYS, | |
2442 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2443 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2444 syscall(__NR_sync_file_range2, 0, 0, 0, 0, 0); | |
2445 } | |
2446 #endif | |
2447 | |
2448 BPF_DEATH_TEST(NaClNonSfiSandboxTest, syncfs_SIGSYS, | |
2449 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2450 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2451 syscall(__NR_syncfs, 0, 0, 0, 0, 0); | |
2452 } | |
2453 | |
2454 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sysfs_SIGSYS, | |
2455 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2456 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2457 syscall(__NR_sysfs, 0, 0, 0, 0, 0); | |
2458 } | |
2459 | |
2460 BPF_DEATH_TEST(NaClNonSfiSandboxTest, sysinfo_SIGSYS, | |
2461 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2462 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2463 syscall(__NR_sysinfo, 0, 0, 0, 0, 0); | |
2464 } | |
2465 | |
2466 BPF_DEATH_TEST(NaClNonSfiSandboxTest, syslog_SIGSYS, | |
2467 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2468 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2469 syscall(__NR_syslog, 0, 0, 0, 0, 0); | |
2470 } | |
2471 | |
2472 BPF_DEATH_TEST(NaClNonSfiSandboxTest, tee_SIGSYS, | |
2473 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2474 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2475 syscall(__NR_tee, 0, 0, 0, 0, 0); | |
2476 } | |
2477 | |
2478 BPF_DEATH_TEST(NaClNonSfiSandboxTest, tgkill_SIGSYS, | |
2479 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2480 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2481 syscall(__NR_tgkill, 0, 0, 0, 0, 0); | |
2482 } | |
2483 | |
2484 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timer_create_SIGSYS, | |
2485 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2486 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2487 syscall(__NR_timer_create, 0, 0, 0, 0, 0); | |
2488 } | |
2489 | |
2490 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timer_delete_SIGSYS, | |
2491 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2492 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2493 syscall(__NR_timer_delete, 0, 0, 0, 0, 0); | |
2494 } | |
2495 | |
2496 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timer_getoverrun_SIGSYS, | |
2497 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2498 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2499 syscall(__NR_timer_getoverrun, 0, 0, 0, 0, 0); | |
2500 } | |
2501 | |
2502 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timer_gettime_SIGSYS, | |
2503 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2504 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2505 syscall(__NR_timer_gettime, 0, 0, 0, 0, 0); | |
2506 } | |
2507 | |
2508 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timer_settime_SIGSYS, | |
2509 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2510 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2511 syscall(__NR_timer_settime, 0, 0, 0, 0, 0); | |
2512 } | |
2513 | |
2514 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timerfd_create_SIGSYS, | |
2515 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2516 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2517 syscall(__NR_timerfd_create, 0, 0, 0, 0, 0); | |
2518 } | |
2519 | |
2520 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timerfd_gettime_SIGSYS, | |
2521 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2522 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2523 syscall(__NR_timerfd_gettime, 0, 0, 0, 0, 0); | |
2524 } | |
2525 | |
2526 BPF_DEATH_TEST(NaClNonSfiSandboxTest, timerfd_settime_SIGSYS, | |
2527 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2528 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2529 syscall(__NR_timerfd_settime, 0, 0, 0, 0, 0); | |
2530 } | |
2531 | |
2532 BPF_DEATH_TEST(NaClNonSfiSandboxTest, tkill_SIGSYS, | |
2533 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2534 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2535 syscall(__NR_tkill, 0, 0, 0, 0, 0); | |
2536 } | |
2537 | |
2538 BPF_DEATH_TEST(NaClNonSfiSandboxTest, truncate_SIGSYS, | |
2539 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2540 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2541 syscall(__NR_truncate, 0, 0, 0, 0, 0); | |
2542 } | |
2543 | |
2544 #if defined(__i386__) || defined(__arm__) | |
2545 BPF_DEATH_TEST(NaClNonSfiSandboxTest, truncate64_SIGSYS, | |
2546 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2547 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2548 syscall(__NR_truncate64, 0, 0, 0, 0, 0); | |
2549 } | |
2550 #endif | |
2551 | |
2552 #if defined(__x86_64__) | |
2553 BPF_DEATH_TEST(NaClNonSfiSandboxTest, tuxcall_SIGSYS, | |
2554 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2555 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2556 syscall(__NR_tuxcall, 0, 0, 0, 0, 0); | |
2557 } | |
2558 #endif | |
2559 | |
2560 #if defined(__i386__) || defined(__arm__) | |
2561 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ugetrlimit_SIGSYS, | |
2562 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2563 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2564 syscall(__NR_ugetrlimit, 0, 0, 0, 0, 0); | |
2565 } | |
2566 #endif | |
2567 | |
2568 #if defined(__i386__) | |
2569 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ulimit_SIGSYS, | |
2570 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2571 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2572 syscall(__NR_ulimit, 0, 0, 0, 0, 0); | |
2573 } | |
2574 #endif | |
2575 | |
2576 BPF_DEATH_TEST(NaClNonSfiSandboxTest, umask_SIGSYS, | |
2577 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2578 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2579 syscall(__NR_umask, 0, 0, 0, 0, 0); | |
2580 } | |
2581 | |
2582 #if defined(__i386__) | |
2583 BPF_DEATH_TEST(NaClNonSfiSandboxTest, umount_SIGSYS, | |
2584 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2585 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2586 syscall(__NR_umount, 0, 0, 0, 0, 0); | |
2587 } | |
2588 #endif | |
2589 | |
2590 BPF_DEATH_TEST(NaClNonSfiSandboxTest, umount2_SIGSYS, | |
2591 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2592 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2593 syscall(__NR_umount2, 0, 0, 0, 0, 0); | |
2594 } | |
2595 | |
2596 BPF_DEATH_TEST(NaClNonSfiSandboxTest, uname_SIGSYS, | |
2597 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2598 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2599 syscall(__NR_uname, 0, 0, 0, 0, 0); | |
2600 } | |
2601 | |
2602 BPF_DEATH_TEST(NaClNonSfiSandboxTest, unlink_SIGSYS, | |
2603 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2604 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2605 syscall(__NR_unlink, 0, 0, 0, 0, 0); | |
2606 } | |
2607 | |
2608 BPF_DEATH_TEST(NaClNonSfiSandboxTest, unlinkat_SIGSYS, | |
2609 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2610 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2611 syscall(__NR_unlinkat, 0, 0, 0, 0, 0); | |
2612 } | |
2613 | |
2614 BPF_DEATH_TEST(NaClNonSfiSandboxTest, unshare_SIGSYS, | |
2615 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2616 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2617 syscall(__NR_unshare, 0, 0, 0, 0, 0); | |
2618 } | |
2619 | |
2620 BPF_DEATH_TEST(NaClNonSfiSandboxTest, uselib_SIGSYS, | |
2621 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2622 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2623 syscall(__NR_uselib, 0, 0, 0, 0, 0); | |
2624 } | |
2625 | |
2626 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ustat_SIGSYS, | |
2627 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2628 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2629 syscall(__NR_ustat, 0, 0, 0, 0, 0); | |
2630 } | |
2631 | |
2632 #if defined(__i386__) || defined(__x86_64__) | |
2633 BPF_DEATH_TEST(NaClNonSfiSandboxTest, utime_SIGSYS, | |
2634 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2635 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2636 syscall(__NR_utime, 0, 0, 0, 0, 0); | |
2637 } | |
2638 #endif | |
2639 | |
2640 BPF_DEATH_TEST(NaClNonSfiSandboxTest, utimensat_SIGSYS, | |
2641 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2642 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2643 syscall(__NR_utimensat, 0, 0, 0, 0, 0); | |
2644 } | |
2645 | |
2646 BPF_DEATH_TEST(NaClNonSfiSandboxTest, utimes_SIGSYS, | |
2647 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2648 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2649 syscall(__NR_utimes, 0, 0, 0, 0, 0); | |
2650 } | |
2651 | |
2652 BPF_DEATH_TEST(NaClNonSfiSandboxTest, vfork_SIGSYS, | |
2653 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2654 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2655 syscall(__NR_vfork, 0, 0, 0, 0, 0); | |
2656 } | |
2657 | |
2658 BPF_DEATH_TEST(NaClNonSfiSandboxTest, vhangup_SIGSYS, | |
2659 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2660 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2661 syscall(__NR_vhangup, 0, 0, 0, 0, 0); | |
2662 } | |
2663 | |
2664 #if defined(__i386__) | |
2665 BPF_DEATH_TEST(NaClNonSfiSandboxTest, vm86_SIGSYS, | |
2666 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2667 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2668 syscall(__NR_vm86, 0, 0, 0, 0, 0); | |
2669 } | |
2670 #endif | |
2671 | |
2672 #if defined(__i386__) | |
2673 BPF_DEATH_TEST(NaClNonSfiSandboxTest, vm86old_SIGSYS, | |
2674 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2675 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2676 syscall(__NR_vm86old, 0, 0, 0, 0, 0); | |
2677 } | |
2678 #endif | |
2679 | |
2680 BPF_DEATH_TEST(NaClNonSfiSandboxTest, vmsplice_SIGSYS, | |
2681 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2682 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2683 syscall(__NR_vmsplice, 0, 0, 0, 0, 0); | |
2684 } | |
2685 | |
2686 BPF_DEATH_TEST(NaClNonSfiSandboxTest, vserver_SIGSYS, | |
2687 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2688 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2689 syscall(__NR_vserver, 0, 0, 0, 0, 0); | |
2690 } | |
2691 | |
2692 BPF_DEATH_TEST(NaClNonSfiSandboxTest, wait4_SIGSYS, | |
2693 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2694 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2695 syscall(__NR_wait4, 0, 0, 0, 0, 0); | |
2696 } | |
2697 | |
2698 BPF_DEATH_TEST(NaClNonSfiSandboxTest, waitid_SIGSYS, | |
2699 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2700 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2701 syscall(__NR_waitid, 0, 0, 0, 0, 0); | |
2702 } | |
2703 | |
2704 #if defined(__i386__) | |
2705 BPF_DEATH_TEST(NaClNonSfiSandboxTest, waitpid_SIGSYS, | |
2706 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2707 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2708 syscall(__NR_waitpid, 0, 0, 0, 0, 0); | |
2709 } | |
2710 #endif | |
2711 | |
2712 BPF_DEATH_TEST(NaClNonSfiSandboxTest, writev_SIGSYS, | |
2713 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2714 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2715 syscall(__NR_writev, 0, 0, 0, 0, 0); | |
2716 } | |
2717 | |
2718 // ARM specific syscalls. | |
2719 #if defined(__arm__) | |
2720 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ARM_breakpoint_SIGSYS, | |
2721 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2722 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2723 syscall(__ARM_NR_breakpoint, 0, 0, 0, 0, 0); | |
2724 } | |
2725 | |
2726 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ARM_usr26_SIGSYS, | |
2727 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2728 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2729 syscall(__ARM_NR_usr26, 0, 0, 0, 0, 0); | |
2730 } | |
2731 | |
2732 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ARM_usr32_SIGSYS, | |
2733 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2734 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2735 syscall(__ARM_NR_usr32, 0, 0, 0, 0, 0); | |
2736 } | |
2737 | |
2738 BPF_DEATH_TEST(NaClNonSfiSandboxTest, ARM_set_tls_SIGSYS, | |
2739 DEATH_MESSAGE(sandbox::GetErrorMessageContentForTests()), | |
2740 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { | |
2741 syscall(__ARM_NR_set_tls, 0, 0, 0, 0, 0); | |
2742 } | |
2743 #endif | |
2744 | |
2745 } // namespace | |
OLD | NEW |