Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / nacl / loader / nonsfi / nonsfi_sandbox_sigsys_unittest.cc
blobacc98b733f0046a84da5524193a81974970c6ab2
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Sanitizers internally use some syscalls which non-SFI NaCl disallows.
6 #if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER) && \
7 !defined(MEMORY_SANITIZER) && !defined(LEAK_SANITIZER)
9 #include "components/nacl/loader/nonsfi/nonsfi_sandbox.h"
11 #include <sys/syscall.h>
12 #include <unistd.h>
14 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
15 #include "sandbox/linux/seccomp-bpf/bpf_tests.h"
16 #include "sandbox/linux/system_headers/linux_syscalls.h"
18 namespace {
20 // Test cases in this file just make sure not-whitelisted syscalls
21 // are appropriately disallowed. They should raise SIGSYS regardless
22 // of arguments. We always pass five zeros not to pass uninitialized
23 // values to syscalls.
24 #define RESTRICT_SYSCALL_DEATH_TEST_IMPL(name, sysno) \
25 BPF_DEATH_TEST_C(NaClNonSfiSandboxSIGSYSTest, \
26 name, \
27 DEATH_SEGV_MESSAGE( \
28 sandbox::GetErrorMessageContentForTests()), \
29 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy) { \
30 syscall(sysno, 0, 0, 0, 0, 0, 0); \
33 #define RESTRICT_SYSCALL_DEATH_TEST(name) \
34 RESTRICT_SYSCALL_DEATH_TEST_IMPL(name, __NR_ ## name)
36 #define RESTRICT_ARM_SYSCALL_DEATH_TEST(name) \
37 RESTRICT_SYSCALL_DEATH_TEST_IMPL(ARM_ ## name, __ARM_NR_ ## name)
39 #if defined(__i386__) || defined(__arm__)
40 RESTRICT_SYSCALL_DEATH_TEST(_newselect);
41 #endif
42 RESTRICT_SYSCALL_DEATH_TEST(_sysctl);
43 #if defined(__x86_64__) || defined(__arm__)
44 RESTRICT_SYSCALL_DEATH_TEST(accept);
45 #endif
46 #if defined(__x86_64__) || defined(__arm__)
47 RESTRICT_SYSCALL_DEATH_TEST(accept4);
48 #endif
49 RESTRICT_SYSCALL_DEATH_TEST(access);
50 RESTRICT_SYSCALL_DEATH_TEST(acct);
51 RESTRICT_SYSCALL_DEATH_TEST(add_key);
52 RESTRICT_SYSCALL_DEATH_TEST(adjtimex);
53 #if defined(__i386__) || defined(__x86_64__)
54 RESTRICT_SYSCALL_DEATH_TEST(afs_syscall);
55 #endif
56 #if defined(__i386__) || defined(__x86_64__)
57 RESTRICT_SYSCALL_DEATH_TEST(alarm);
58 #endif
59 #if defined(__x86_64__)
60 RESTRICT_SYSCALL_DEATH_TEST(arch_prctl);
61 #endif
62 #if defined(__arm__)
63 RESTRICT_SYSCALL_DEATH_TEST(arm_fadvise64_64);
64 #endif
65 #if defined(__i386__) || defined(__arm__)
66 RESTRICT_SYSCALL_DEATH_TEST(bdflush);
67 #endif
68 #if defined(__x86_64__) || defined(__arm__)
69 RESTRICT_SYSCALL_DEATH_TEST(bind);
70 #endif
71 #if defined(__i386__)
72 RESTRICT_SYSCALL_DEATH_TEST(break);
73 #endif
74 RESTRICT_SYSCALL_DEATH_TEST(capget);
75 RESTRICT_SYSCALL_DEATH_TEST(capset);
76 RESTRICT_SYSCALL_DEATH_TEST(chdir);
77 RESTRICT_SYSCALL_DEATH_TEST(chmod);
78 RESTRICT_SYSCALL_DEATH_TEST(chown);
79 #if defined(__i386__) || defined(__arm__)
80 RESTRICT_SYSCALL_DEATH_TEST(chown32);
81 #endif
82 RESTRICT_SYSCALL_DEATH_TEST(chroot);
83 RESTRICT_SYSCALL_DEATH_TEST(clock_adjtime);
84 RESTRICT_SYSCALL_DEATH_TEST(clock_nanosleep);
85 RESTRICT_SYSCALL_DEATH_TEST(clock_settime);
86 #if defined(__x86_64__) || defined(__arm__)
87 RESTRICT_SYSCALL_DEATH_TEST(connect);
88 #endif
89 RESTRICT_SYSCALL_DEATH_TEST(creat);
90 #if defined(__i386__) || defined(__x86_64__)
91 RESTRICT_SYSCALL_DEATH_TEST(create_module);
92 #endif
93 RESTRICT_SYSCALL_DEATH_TEST(delete_module);
94 RESTRICT_SYSCALL_DEATH_TEST(dup3);
95 RESTRICT_SYSCALL_DEATH_TEST(epoll_create1);
96 RESTRICT_SYSCALL_DEATH_TEST(epoll_ctl);
97 #if defined(__x86_64__)
98 RESTRICT_SYSCALL_DEATH_TEST(epoll_ctl_old);
99 #endif
100 RESTRICT_SYSCALL_DEATH_TEST(epoll_pwait);
101 RESTRICT_SYSCALL_DEATH_TEST(epoll_wait);
102 #if defined(__x86_64__)
103 RESTRICT_SYSCALL_DEATH_TEST(epoll_wait_old);
104 #endif
105 RESTRICT_SYSCALL_DEATH_TEST(eventfd);
106 RESTRICT_SYSCALL_DEATH_TEST(eventfd2);
107 RESTRICT_SYSCALL_DEATH_TEST(execve);
108 RESTRICT_SYSCALL_DEATH_TEST(faccessat);
109 #if defined(__i386__) || defined(__x86_64__)
110 RESTRICT_SYSCALL_DEATH_TEST(fadvise64);
111 #endif
112 #if defined(__i386__)
113 RESTRICT_SYSCALL_DEATH_TEST(fadvise64_64);
114 #endif
115 RESTRICT_SYSCALL_DEATH_TEST(fallocate);
116 RESTRICT_SYSCALL_DEATH_TEST(fanotify_init);
117 RESTRICT_SYSCALL_DEATH_TEST(fanotify_mark);
118 RESTRICT_SYSCALL_DEATH_TEST(fchdir);
119 RESTRICT_SYSCALL_DEATH_TEST(fchmod);
120 RESTRICT_SYSCALL_DEATH_TEST(fchmodat);
121 RESTRICT_SYSCALL_DEATH_TEST(fchown);
122 #if defined(__i386__) || defined(__arm__)
123 RESTRICT_SYSCALL_DEATH_TEST(fchown32);
124 #endif
125 RESTRICT_SYSCALL_DEATH_TEST(fchownat);
126 #if defined(__i386__) || defined(__arm__)
127 RESTRICT_SYSCALL_DEATH_TEST(fcntl);
128 #endif
129 RESTRICT_SYSCALL_DEATH_TEST(fdatasync);
130 RESTRICT_SYSCALL_DEATH_TEST(fgetxattr);
131 RESTRICT_SYSCALL_DEATH_TEST(flistxattr);
132 RESTRICT_SYSCALL_DEATH_TEST(flock);
133 RESTRICT_SYSCALL_DEATH_TEST(fork);
134 RESTRICT_SYSCALL_DEATH_TEST(fremovexattr);
135 RESTRICT_SYSCALL_DEATH_TEST(fsetxattr);
136 #if defined(__i386__) || defined(__arm__)
137 RESTRICT_SYSCALL_DEATH_TEST(fstat);
138 #endif
139 #if defined(__i386__) || defined(__arm__)
140 RESTRICT_SYSCALL_DEATH_TEST(fstatat64);
141 #endif
142 RESTRICT_SYSCALL_DEATH_TEST(fstatfs);
143 #if defined(__i386__) || defined(__arm__)
144 RESTRICT_SYSCALL_DEATH_TEST(fstatfs64);
145 #endif
146 RESTRICT_SYSCALL_DEATH_TEST(fsync);
147 #if defined(__i386__)
148 RESTRICT_SYSCALL_DEATH_TEST(ftime);
149 #endif
150 RESTRICT_SYSCALL_DEATH_TEST(ftruncate);
151 #if defined(__i386__) || defined(__arm__)
152 RESTRICT_SYSCALL_DEATH_TEST(ftruncate64);
153 #endif
154 RESTRICT_SYSCALL_DEATH_TEST(futimesat);
155 #if defined(__i386__) || defined(__x86_64__)
156 RESTRICT_SYSCALL_DEATH_TEST(get_kernel_syms);
157 #endif
158 RESTRICT_SYSCALL_DEATH_TEST(get_mempolicy);
159 RESTRICT_SYSCALL_DEATH_TEST(get_robust_list);
160 #if defined(__i386__) || defined(__x86_64__)
161 RESTRICT_SYSCALL_DEATH_TEST(get_thread_area);
162 #endif
163 RESTRICT_SYSCALL_DEATH_TEST(getcpu);
164 RESTRICT_SYSCALL_DEATH_TEST(getcwd);
165 RESTRICT_SYSCALL_DEATH_TEST(getdents);
166 RESTRICT_SYSCALL_DEATH_TEST(getdents64);
167 RESTRICT_SYSCALL_DEATH_TEST(getgroups);
168 #if defined(__i386__) || defined(__arm__)
169 RESTRICT_SYSCALL_DEATH_TEST(getgroups32);
170 #endif
171 RESTRICT_SYSCALL_DEATH_TEST(getitimer);
172 #if defined(__x86_64__) || defined(__arm__)
173 RESTRICT_SYSCALL_DEATH_TEST(getpeername);
174 #endif
175 RESTRICT_SYSCALL_DEATH_TEST(getpgid);
176 RESTRICT_SYSCALL_DEATH_TEST(getpgrp);
177 RESTRICT_SYSCALL_DEATH_TEST(getpid);
178 #if defined(__i386__) || defined(__x86_64__)
179 RESTRICT_SYSCALL_DEATH_TEST(getpmsg);
180 #endif
181 RESTRICT_SYSCALL_DEATH_TEST(getppid);
182 RESTRICT_SYSCALL_DEATH_TEST(getpriority);
183 RESTRICT_SYSCALL_DEATH_TEST(getresgid);
184 #if defined(__i386__) || defined(__arm__)
185 RESTRICT_SYSCALL_DEATH_TEST(getresgid32);
186 #endif
187 RESTRICT_SYSCALL_DEATH_TEST(getresuid);
188 #if defined(__i386__) || defined(__arm__)
189 RESTRICT_SYSCALL_DEATH_TEST(getresuid32);
190 #endif
191 #if defined(__i386__) || defined(__x86_64__)
192 RESTRICT_SYSCALL_DEATH_TEST(getrlimit);
193 #endif
194 RESTRICT_SYSCALL_DEATH_TEST(getrusage);
195 RESTRICT_SYSCALL_DEATH_TEST(getsid);
196 #if defined(__x86_64__) || defined(__arm__)
197 RESTRICT_SYSCALL_DEATH_TEST(getsockname);
198 #endif
199 #if defined(__x86_64__) || defined(__arm__)
200 RESTRICT_SYSCALL_DEATH_TEST(getsockopt);
201 #endif
202 RESTRICT_SYSCALL_DEATH_TEST(getxattr);
203 #if defined(__i386__)
204 RESTRICT_SYSCALL_DEATH_TEST(gtty);
205 #endif
206 #if defined(__i386__)
207 RESTRICT_SYSCALL_DEATH_TEST(idle);
208 #endif
209 RESTRICT_SYSCALL_DEATH_TEST(init_module);
210 RESTRICT_SYSCALL_DEATH_TEST(inotify_add_watch);
211 RESTRICT_SYSCALL_DEATH_TEST(inotify_init);
212 RESTRICT_SYSCALL_DEATH_TEST(inotify_init1);
213 RESTRICT_SYSCALL_DEATH_TEST(inotify_rm_watch);
214 RESTRICT_SYSCALL_DEATH_TEST(io_cancel);
215 RESTRICT_SYSCALL_DEATH_TEST(io_destroy);
216 RESTRICT_SYSCALL_DEATH_TEST(io_getevents);
217 RESTRICT_SYSCALL_DEATH_TEST(io_setup);
218 RESTRICT_SYSCALL_DEATH_TEST(io_submit);
219 RESTRICT_SYSCALL_DEATH_TEST(ioctl);
220 #if defined(__i386__) || defined(__x86_64__)
221 RESTRICT_SYSCALL_DEATH_TEST(ioperm);
222 #endif
223 #if defined(__i386__) || defined(__x86_64__)
224 RESTRICT_SYSCALL_DEATH_TEST(iopl);
225 #endif
226 RESTRICT_SYSCALL_DEATH_TEST(ioprio_get);
227 RESTRICT_SYSCALL_DEATH_TEST(ioprio_set);
228 #if defined(__i386__)
229 RESTRICT_SYSCALL_DEATH_TEST(ipc);
230 #endif
231 RESTRICT_SYSCALL_DEATH_TEST(kexec_load);
232 RESTRICT_SYSCALL_DEATH_TEST(keyctl);
233 RESTRICT_SYSCALL_DEATH_TEST(kill);
234 RESTRICT_SYSCALL_DEATH_TEST(lchown);
235 #if defined(__i386__) || defined(__arm__)
236 RESTRICT_SYSCALL_DEATH_TEST(lchown32);
237 #endif
238 RESTRICT_SYSCALL_DEATH_TEST(lgetxattr);
239 RESTRICT_SYSCALL_DEATH_TEST(link);
240 RESTRICT_SYSCALL_DEATH_TEST(linkat);
241 #if defined(__x86_64__) || defined(__arm__)
242 RESTRICT_SYSCALL_DEATH_TEST(listen);
243 #endif
244 RESTRICT_SYSCALL_DEATH_TEST(listxattr);
245 RESTRICT_SYSCALL_DEATH_TEST(llistxattr);
246 #if defined(__i386__)
247 RESTRICT_SYSCALL_DEATH_TEST(lock);
248 #endif
249 RESTRICT_SYSCALL_DEATH_TEST(lookup_dcookie);
250 RESTRICT_SYSCALL_DEATH_TEST(lremovexattr);
251 #if defined(__i386__) || defined(__arm__)
252 RESTRICT_SYSCALL_DEATH_TEST(lseek);
253 #endif
254 RESTRICT_SYSCALL_DEATH_TEST(lsetxattr);
255 RESTRICT_SYSCALL_DEATH_TEST(lstat);
256 #if defined(__i386__) || defined(__arm__)
257 RESTRICT_SYSCALL_DEATH_TEST(lstat64);
258 #endif
259 RESTRICT_SYSCALL_DEATH_TEST(mbind);
260 #if defined(__i386__) || defined(__x86_64__)
261 RESTRICT_SYSCALL_DEATH_TEST(migrate_pages);
262 #endif
263 RESTRICT_SYSCALL_DEATH_TEST(mincore);
264 RESTRICT_SYSCALL_DEATH_TEST(mkdir);
265 RESTRICT_SYSCALL_DEATH_TEST(mkdirat);
266 RESTRICT_SYSCALL_DEATH_TEST(mknod);
267 RESTRICT_SYSCALL_DEATH_TEST(mknodat);
268 RESTRICT_SYSCALL_DEATH_TEST(mlock);
269 RESTRICT_SYSCALL_DEATH_TEST(mlockall);
270 #if defined(__i386__)
271 RESTRICT_SYSCALL_DEATH_TEST(mmap);
272 #endif
273 #if defined(__i386__) || defined(__x86_64__)
274 RESTRICT_SYSCALL_DEATH_TEST(modify_ldt);
275 #endif
276 RESTRICT_SYSCALL_DEATH_TEST(mount);
277 RESTRICT_SYSCALL_DEATH_TEST(move_pages);
278 #if defined(__i386__)
279 RESTRICT_SYSCALL_DEATH_TEST(mpx);
280 #endif
281 RESTRICT_SYSCALL_DEATH_TEST(mq_getsetattr);
282 RESTRICT_SYSCALL_DEATH_TEST(mq_notify);
283 RESTRICT_SYSCALL_DEATH_TEST(mq_open);
284 RESTRICT_SYSCALL_DEATH_TEST(mq_timedreceive);
285 RESTRICT_SYSCALL_DEATH_TEST(mq_timedsend);
286 RESTRICT_SYSCALL_DEATH_TEST(mq_unlink);
287 RESTRICT_SYSCALL_DEATH_TEST(mremap);
288 #if defined(__x86_64__) || defined(__arm__)
289 RESTRICT_SYSCALL_DEATH_TEST(msgctl);
290 #endif
291 #if defined(__x86_64__) || defined(__arm__)
292 RESTRICT_SYSCALL_DEATH_TEST(msgget);
293 #endif
294 #if defined(__x86_64__) || defined(__arm__)
295 RESTRICT_SYSCALL_DEATH_TEST(msgrcv);
296 #endif
297 #if defined(__x86_64__) || defined(__arm__)
298 RESTRICT_SYSCALL_DEATH_TEST(msgsnd);
299 #endif
300 RESTRICT_SYSCALL_DEATH_TEST(msync);
301 RESTRICT_SYSCALL_DEATH_TEST(munlock);
302 RESTRICT_SYSCALL_DEATH_TEST(munlockall);
303 RESTRICT_SYSCALL_DEATH_TEST(name_to_handle_at);
304 #if defined(__x86_64__)
305 RESTRICT_SYSCALL_DEATH_TEST(newfstatat);
306 #endif
307 RESTRICT_SYSCALL_DEATH_TEST(nfsservctl);
308 #if defined(__i386__) || defined(__arm__)
309 RESTRICT_SYSCALL_DEATH_TEST(nice);
310 #endif
311 #if defined(__i386__)
312 RESTRICT_SYSCALL_DEATH_TEST(oldfstat);
313 #endif
314 #if defined(__i386__)
315 RESTRICT_SYSCALL_DEATH_TEST(oldlstat);
316 #endif
317 #if defined(__i386__)
318 RESTRICT_SYSCALL_DEATH_TEST(oldolduname);
319 #endif
320 #if defined(__i386__)
321 RESTRICT_SYSCALL_DEATH_TEST(oldstat);
322 #endif
323 #if defined(__i386__)
324 RESTRICT_SYSCALL_DEATH_TEST(olduname);
325 #endif
326 RESTRICT_SYSCALL_DEATH_TEST(open_by_handle_at);
327 RESTRICT_SYSCALL_DEATH_TEST(pause);
328 #if defined(__arm__)
329 RESTRICT_SYSCALL_DEATH_TEST(pciconfig_iobase);
330 #endif
331 #if defined(__arm__)
332 RESTRICT_SYSCALL_DEATH_TEST(pciconfig_read);
333 #endif
334 #if defined(__arm__)
335 RESTRICT_SYSCALL_DEATH_TEST(pciconfig_write);
336 #endif
337 RESTRICT_SYSCALL_DEATH_TEST(perf_event_open);
338 RESTRICT_SYSCALL_DEATH_TEST(personality);
339 RESTRICT_SYSCALL_DEATH_TEST(pipe2);
340 RESTRICT_SYSCALL_DEATH_TEST(pivot_root);
341 RESTRICT_SYSCALL_DEATH_TEST(ppoll);
342 RESTRICT_SYSCALL_DEATH_TEST(preadv);
343 RESTRICT_SYSCALL_DEATH_TEST(prlimit64);
344 RESTRICT_SYSCALL_DEATH_TEST(process_vm_readv);
345 RESTRICT_SYSCALL_DEATH_TEST(process_vm_writev);
346 #if defined(__i386__)
347 RESTRICT_SYSCALL_DEATH_TEST(prof);
348 #endif
349 #if defined(__i386__)
350 RESTRICT_SYSCALL_DEATH_TEST(profil);
351 #endif
352 RESTRICT_SYSCALL_DEATH_TEST(pselect6);
353 #if defined(__i386__) || defined(__x86_64__)
354 RESTRICT_SYSCALL_DEATH_TEST(putpmsg);
355 #endif
356 RESTRICT_SYSCALL_DEATH_TEST(pwritev);
357 #if defined(__i386__) || defined(__x86_64__)
358 RESTRICT_SYSCALL_DEATH_TEST(query_module);
359 #endif
360 RESTRICT_SYSCALL_DEATH_TEST(quotactl);
361 RESTRICT_SYSCALL_DEATH_TEST(readahead);
362 #if defined(__i386__)
363 RESTRICT_SYSCALL_DEATH_TEST(readdir);
364 #endif
365 RESTRICT_SYSCALL_DEATH_TEST(readlink);
366 RESTRICT_SYSCALL_DEATH_TEST(readlinkat);
367 RESTRICT_SYSCALL_DEATH_TEST(readv);
368 RESTRICT_SYSCALL_DEATH_TEST(reboot);
369 #if defined(__arm__)
370 RESTRICT_SYSCALL_DEATH_TEST(recv);
371 #endif
372 #if defined(__x86_64__) || defined(__arm__)
373 RESTRICT_SYSCALL_DEATH_TEST(recvfrom);
374 #endif
375 RESTRICT_SYSCALL_DEATH_TEST(recvmmsg);
376 RESTRICT_SYSCALL_DEATH_TEST(remap_file_pages);
377 RESTRICT_SYSCALL_DEATH_TEST(removexattr);
378 RESTRICT_SYSCALL_DEATH_TEST(rename);
379 RESTRICT_SYSCALL_DEATH_TEST(renameat);
380 RESTRICT_SYSCALL_DEATH_TEST(request_key);
381 RESTRICT_SYSCALL_DEATH_TEST(rmdir);
382 RESTRICT_SYSCALL_DEATH_TEST(rt_sigaction);
383 RESTRICT_SYSCALL_DEATH_TEST(rt_sigpending);
384 RESTRICT_SYSCALL_DEATH_TEST(rt_sigprocmask);
385 RESTRICT_SYSCALL_DEATH_TEST(rt_sigqueueinfo);
386 RESTRICT_SYSCALL_DEATH_TEST(rt_sigreturn);
387 RESTRICT_SYSCALL_DEATH_TEST(rt_sigsuspend);
388 RESTRICT_SYSCALL_DEATH_TEST(rt_sigtimedwait);
389 RESTRICT_SYSCALL_DEATH_TEST(rt_tgsigqueueinfo);
390 RESTRICT_SYSCALL_DEATH_TEST(sched_get_priority_max);
391 RESTRICT_SYSCALL_DEATH_TEST(sched_get_priority_min);
392 RESTRICT_SYSCALL_DEATH_TEST(sched_getaffinity);
393 RESTRICT_SYSCALL_DEATH_TEST(sched_getparam);
394 RESTRICT_SYSCALL_DEATH_TEST(sched_getscheduler);
395 RESTRICT_SYSCALL_DEATH_TEST(sched_rr_get_interval);
396 RESTRICT_SYSCALL_DEATH_TEST(sched_setaffinity);
397 RESTRICT_SYSCALL_DEATH_TEST(sched_setparam);
398 RESTRICT_SYSCALL_DEATH_TEST(sched_setscheduler);
399 #if defined(__x86_64__)
400 RESTRICT_SYSCALL_DEATH_TEST(security);
401 #endif
402 #if defined(__i386__) || defined(__x86_64__)
403 RESTRICT_SYSCALL_DEATH_TEST(select);
404 #endif
405 #if defined(__x86_64__) || defined(__arm__)
406 RESTRICT_SYSCALL_DEATH_TEST(semctl);
407 #endif
408 #if defined(__x86_64__) || defined(__arm__)
409 RESTRICT_SYSCALL_DEATH_TEST(semget);
410 #endif
411 #if defined(__x86_64__) || defined(__arm__)
412 RESTRICT_SYSCALL_DEATH_TEST(semop);
413 #endif
414 #if defined(__x86_64__) || defined(__arm__)
415 RESTRICT_SYSCALL_DEATH_TEST(semtimedop);
416 #endif
417 #if defined(__arm__)
418 RESTRICT_SYSCALL_DEATH_TEST(send);
419 #endif
420 RESTRICT_SYSCALL_DEATH_TEST(sendfile);
421 #if defined(__i386__) || defined(__arm__)
422 RESTRICT_SYSCALL_DEATH_TEST(sendfile64);
423 #endif
424 RESTRICT_SYSCALL_DEATH_TEST(sendmmsg);
425 #if defined(__x86_64__) || defined(__arm__)
426 RESTRICT_SYSCALL_DEATH_TEST(sendto);
427 #endif
428 RESTRICT_SYSCALL_DEATH_TEST(set_mempolicy);
429 #if defined(__i386__) || defined(__x86_64__)
430 RESTRICT_SYSCALL_DEATH_TEST(set_thread_area);
431 #endif
432 RESTRICT_SYSCALL_DEATH_TEST(set_tid_address);
433 RESTRICT_SYSCALL_DEATH_TEST(setdomainname);
434 RESTRICT_SYSCALL_DEATH_TEST(setfsgid);
435 #if defined(__i386__) || defined(__arm__)
436 RESTRICT_SYSCALL_DEATH_TEST(setfsgid32);
437 #endif
438 RESTRICT_SYSCALL_DEATH_TEST(setfsuid);
439 #if defined(__i386__) || defined(__arm__)
440 RESTRICT_SYSCALL_DEATH_TEST(setfsuid32);
441 #endif
442 RESTRICT_SYSCALL_DEATH_TEST(setgid);
443 #if defined(__i386__) || defined(__arm__)
444 RESTRICT_SYSCALL_DEATH_TEST(setgid32);
445 #endif
446 RESTRICT_SYSCALL_DEATH_TEST(setgroups);
447 #if defined(__i386__) || defined(__arm__)
448 RESTRICT_SYSCALL_DEATH_TEST(setgroups32);
449 #endif
450 RESTRICT_SYSCALL_DEATH_TEST(sethostname);
451 RESTRICT_SYSCALL_DEATH_TEST(setitimer);
452 RESTRICT_SYSCALL_DEATH_TEST(setns);
453 RESTRICT_SYSCALL_DEATH_TEST(setpgid);
454 RESTRICT_SYSCALL_DEATH_TEST(setpriority);
455 RESTRICT_SYSCALL_DEATH_TEST(setregid);
456 #if defined(__i386__) || defined(__arm__)
457 RESTRICT_SYSCALL_DEATH_TEST(setregid32);
458 #endif
459 RESTRICT_SYSCALL_DEATH_TEST(setresgid);
460 #if defined(__i386__) || defined(__arm__)
461 RESTRICT_SYSCALL_DEATH_TEST(setresgid32);
462 #endif
463 RESTRICT_SYSCALL_DEATH_TEST(setresuid);
464 #if defined(__i386__) || defined(__arm__)
465 RESTRICT_SYSCALL_DEATH_TEST(setresuid32);
466 #endif
467 RESTRICT_SYSCALL_DEATH_TEST(setreuid);
468 #if defined(__i386__) || defined(__arm__)
469 RESTRICT_SYSCALL_DEATH_TEST(setreuid32);
470 #endif
471 RESTRICT_SYSCALL_DEATH_TEST(setrlimit);
472 RESTRICT_SYSCALL_DEATH_TEST(setsid);
473 #if defined(__x86_64__) || defined(__arm__)
474 RESTRICT_SYSCALL_DEATH_TEST(setsockopt);
475 #endif
476 RESTRICT_SYSCALL_DEATH_TEST(settimeofday);
477 RESTRICT_SYSCALL_DEATH_TEST(setuid);
478 #if defined(__i386__) || defined(__arm__)
479 RESTRICT_SYSCALL_DEATH_TEST(setuid32);
480 #endif
481 RESTRICT_SYSCALL_DEATH_TEST(setxattr);
482 #if defined(__i386__)
483 RESTRICT_SYSCALL_DEATH_TEST(sgetmask);
484 #endif
485 #if defined(__x86_64__) || defined(__arm__)
486 RESTRICT_SYSCALL_DEATH_TEST(shmat);
487 #endif
488 #if defined(__x86_64__) || defined(__arm__)
489 RESTRICT_SYSCALL_DEATH_TEST(shmctl);
490 #endif
491 #if defined(__x86_64__) || defined(__arm__)
492 RESTRICT_SYSCALL_DEATH_TEST(shmdt);
493 #endif
494 #if defined(__x86_64__) || defined(__arm__)
495 RESTRICT_SYSCALL_DEATH_TEST(shmget);
496 #endif
497 #if defined(__i386__) || defined(__arm__)
498 RESTRICT_SYSCALL_DEATH_TEST(sigaction);
499 #endif
500 #if defined(__i386__)
501 RESTRICT_SYSCALL_DEATH_TEST(signal);
502 #endif
503 RESTRICT_SYSCALL_DEATH_TEST(signalfd);
504 RESTRICT_SYSCALL_DEATH_TEST(signalfd4);
505 #if defined(__i386__) || defined(__arm__)
506 RESTRICT_SYSCALL_DEATH_TEST(sigpending);
507 #endif
508 #if defined(__i386__) || defined(__arm__)
509 RESTRICT_SYSCALL_DEATH_TEST(sigprocmask);
510 #endif
511 #if defined(__i386__) || defined(__arm__)
512 RESTRICT_SYSCALL_DEATH_TEST(sigreturn);
513 #endif
514 #if defined(__i386__) || defined(__arm__)
515 RESTRICT_SYSCALL_DEATH_TEST(sigsuspend);
516 #endif
517 #if defined(__x86_64__) || defined(__arm__)
518 RESTRICT_SYSCALL_DEATH_TEST(socket);
519 #endif
520 RESTRICT_SYSCALL_DEATH_TEST(splice);
521 #if defined(__i386__)
522 RESTRICT_SYSCALL_DEATH_TEST(ssetmask);
523 #endif
524 RESTRICT_SYSCALL_DEATH_TEST(stat);
525 #if defined(__i386__) || defined(__arm__)
526 RESTRICT_SYSCALL_DEATH_TEST(stat64);
527 #endif
528 RESTRICT_SYSCALL_DEATH_TEST(statfs);
529 #if defined(__i386__) || defined(__arm__)
530 RESTRICT_SYSCALL_DEATH_TEST(statfs64);
531 #endif
532 #if defined(__i386__)
533 RESTRICT_SYSCALL_DEATH_TEST(stime);
534 #endif
535 #if defined(__i386__)
536 RESTRICT_SYSCALL_DEATH_TEST(stty);
537 #endif
538 RESTRICT_SYSCALL_DEATH_TEST(swapoff);
539 RESTRICT_SYSCALL_DEATH_TEST(swapon);
540 RESTRICT_SYSCALL_DEATH_TEST(symlink);
541 RESTRICT_SYSCALL_DEATH_TEST(symlinkat);
542 RESTRICT_SYSCALL_DEATH_TEST(sync);
543 #if defined(__i386__) || defined(__x86_64__)
544 RESTRICT_SYSCALL_DEATH_TEST(sync_file_range);
545 #endif
546 #if defined(__arm__)
547 RESTRICT_SYSCALL_DEATH_TEST(sync_file_range2);
548 #endif
549 RESTRICT_SYSCALL_DEATH_TEST(syncfs);
550 RESTRICT_SYSCALL_DEATH_TEST(sysfs);
551 RESTRICT_SYSCALL_DEATH_TEST(sysinfo);
552 RESTRICT_SYSCALL_DEATH_TEST(syslog);
553 RESTRICT_SYSCALL_DEATH_TEST(tee);
554 RESTRICT_SYSCALL_DEATH_TEST(tgkill);
555 RESTRICT_SYSCALL_DEATH_TEST(timer_create);
556 RESTRICT_SYSCALL_DEATH_TEST(timer_delete);
557 RESTRICT_SYSCALL_DEATH_TEST(timer_getoverrun);
558 RESTRICT_SYSCALL_DEATH_TEST(timer_gettime);
559 RESTRICT_SYSCALL_DEATH_TEST(timer_settime);
560 RESTRICT_SYSCALL_DEATH_TEST(timerfd_create);
561 RESTRICT_SYSCALL_DEATH_TEST(timerfd_gettime);
562 RESTRICT_SYSCALL_DEATH_TEST(timerfd_settime);
563 RESTRICT_SYSCALL_DEATH_TEST(tkill);
564 RESTRICT_SYSCALL_DEATH_TEST(truncate);
565 #if defined(__i386__) || defined(__arm__)
566 RESTRICT_SYSCALL_DEATH_TEST(truncate64);
567 #endif
568 #if defined(__x86_64__)
569 RESTRICT_SYSCALL_DEATH_TEST(tuxcall);
570 #endif
571 #if defined(__i386__) || defined(__arm__)
572 RESTRICT_SYSCALL_DEATH_TEST(ugetrlimit);
573 #endif
574 #if defined(__i386__)
575 RESTRICT_SYSCALL_DEATH_TEST(ulimit);
576 #endif
577 RESTRICT_SYSCALL_DEATH_TEST(umask);
578 #if defined(__i386__)
579 RESTRICT_SYSCALL_DEATH_TEST(umount);
580 #endif
581 RESTRICT_SYSCALL_DEATH_TEST(umount2);
582 RESTRICT_SYSCALL_DEATH_TEST(uname);
583 RESTRICT_SYSCALL_DEATH_TEST(unlink);
584 RESTRICT_SYSCALL_DEATH_TEST(unlinkat);
585 RESTRICT_SYSCALL_DEATH_TEST(unshare);
586 RESTRICT_SYSCALL_DEATH_TEST(uselib);
587 RESTRICT_SYSCALL_DEATH_TEST(ustat);
588 #if defined(__i386__) || defined(__x86_64__)
589 RESTRICT_SYSCALL_DEATH_TEST(utime);
590 #endif
591 RESTRICT_SYSCALL_DEATH_TEST(utimensat);
592 RESTRICT_SYSCALL_DEATH_TEST(utimes);
593 RESTRICT_SYSCALL_DEATH_TEST(vfork);
594 RESTRICT_SYSCALL_DEATH_TEST(vhangup);
595 #if defined(__i386__)
596 RESTRICT_SYSCALL_DEATH_TEST(vm86);
597 #endif
598 #if defined(__i386__)
599 RESTRICT_SYSCALL_DEATH_TEST(vm86old);
600 #endif
601 RESTRICT_SYSCALL_DEATH_TEST(vmsplice);
602 RESTRICT_SYSCALL_DEATH_TEST(vserver);
603 RESTRICT_SYSCALL_DEATH_TEST(wait4);
604 RESTRICT_SYSCALL_DEATH_TEST(waitid);
605 #if defined(__i386__)
606 RESTRICT_SYSCALL_DEATH_TEST(waitpid);
607 #endif
608 RESTRICT_SYSCALL_DEATH_TEST(writev);
610 // ARM specific syscalls.
611 #if defined(__arm__)
612 RESTRICT_ARM_SYSCALL_DEATH_TEST(breakpoint);
613 RESTRICT_ARM_SYSCALL_DEATH_TEST(usr26);
614 RESTRICT_ARM_SYSCALL_DEATH_TEST(usr32);
615 RESTRICT_ARM_SYSCALL_DEATH_TEST(set_tls);
616 #endif
618 } // namespace
620 #endif // !ADDRESS_SANITIZER && !THREAD_SANITIZER &&
621 // !MEMORY_SANITIZER && !LEAK_SANITIZER