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>
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"
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, \
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
);
42 RESTRICT_SYSCALL_DEATH_TEST(_sysctl
);
43 #if defined(__x86_64__) || defined(__arm__)
44 RESTRICT_SYSCALL_DEATH_TEST(accept
);
46 #if defined(__x86_64__) || defined(__arm__)
47 RESTRICT_SYSCALL_DEATH_TEST(accept4
);
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
);
56 #if defined(__i386__) || defined(__x86_64__)
57 RESTRICT_SYSCALL_DEATH_TEST(alarm
);
59 #if defined(__x86_64__)
60 RESTRICT_SYSCALL_DEATH_TEST(arch_prctl
);
63 RESTRICT_SYSCALL_DEATH_TEST(arm_fadvise64_64
);
65 #if defined(__i386__) || defined(__arm__)
66 RESTRICT_SYSCALL_DEATH_TEST(bdflush
);
68 #if defined(__x86_64__) || defined(__arm__)
69 RESTRICT_SYSCALL_DEATH_TEST(bind
);
72 RESTRICT_SYSCALL_DEATH_TEST(break);
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
);
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
);
89 RESTRICT_SYSCALL_DEATH_TEST(creat
);
90 #if defined(__i386__) || defined(__x86_64__)
91 RESTRICT_SYSCALL_DEATH_TEST(create_module
);
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
);
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
);
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
);
112 #if defined(__i386__)
113 RESTRICT_SYSCALL_DEATH_TEST(fadvise64_64
);
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
);
125 RESTRICT_SYSCALL_DEATH_TEST(fchownat
);
126 #if defined(__i386__) || defined(__arm__)
127 RESTRICT_SYSCALL_DEATH_TEST(fcntl
);
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
);
139 #if defined(__i386__) || defined(__arm__)
140 RESTRICT_SYSCALL_DEATH_TEST(fstatat64
);
142 RESTRICT_SYSCALL_DEATH_TEST(fstatfs
);
143 #if defined(__i386__) || defined(__arm__)
144 RESTRICT_SYSCALL_DEATH_TEST(fstatfs64
);
146 RESTRICT_SYSCALL_DEATH_TEST(fsync
);
147 #if defined(__i386__)
148 RESTRICT_SYSCALL_DEATH_TEST(ftime
);
150 RESTRICT_SYSCALL_DEATH_TEST(ftruncate
);
151 #if defined(__i386__) || defined(__arm__)
152 RESTRICT_SYSCALL_DEATH_TEST(ftruncate64
);
154 RESTRICT_SYSCALL_DEATH_TEST(futimesat
);
155 #if defined(__i386__) || defined(__x86_64__)
156 RESTRICT_SYSCALL_DEATH_TEST(get_kernel_syms
);
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
);
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
);
171 RESTRICT_SYSCALL_DEATH_TEST(getitimer
);
172 #if defined(__x86_64__) || defined(__arm__)
173 RESTRICT_SYSCALL_DEATH_TEST(getpeername
);
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
);
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
);
187 RESTRICT_SYSCALL_DEATH_TEST(getresuid
);
188 #if defined(__i386__) || defined(__arm__)
189 RESTRICT_SYSCALL_DEATH_TEST(getresuid32
);
191 #if defined(__i386__) || defined(__x86_64__)
192 RESTRICT_SYSCALL_DEATH_TEST(getrlimit
);
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
);
199 #if defined(__x86_64__) || defined(__arm__)
200 RESTRICT_SYSCALL_DEATH_TEST(getsockopt
);
202 RESTRICT_SYSCALL_DEATH_TEST(getxattr
);
203 #if defined(__i386__)
204 RESTRICT_SYSCALL_DEATH_TEST(gtty
);
206 #if defined(__i386__)
207 RESTRICT_SYSCALL_DEATH_TEST(idle
);
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
);
223 #if defined(__i386__) || defined(__x86_64__)
224 RESTRICT_SYSCALL_DEATH_TEST(iopl
);
226 RESTRICT_SYSCALL_DEATH_TEST(ioprio_get
);
227 RESTRICT_SYSCALL_DEATH_TEST(ioprio_set
);
228 #if defined(__i386__)
229 RESTRICT_SYSCALL_DEATH_TEST(ipc
);
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
);
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
);
244 RESTRICT_SYSCALL_DEATH_TEST(listxattr
);
245 RESTRICT_SYSCALL_DEATH_TEST(llistxattr
);
246 #if defined(__i386__)
247 RESTRICT_SYSCALL_DEATH_TEST(lock
);
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
);
254 RESTRICT_SYSCALL_DEATH_TEST(lsetxattr
);
255 RESTRICT_SYSCALL_DEATH_TEST(lstat
);
256 #if defined(__i386__) || defined(__arm__)
257 RESTRICT_SYSCALL_DEATH_TEST(lstat64
);
259 RESTRICT_SYSCALL_DEATH_TEST(mbind
);
260 #if defined(__i386__) || defined(__x86_64__)
261 RESTRICT_SYSCALL_DEATH_TEST(migrate_pages
);
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
);
273 #if defined(__i386__) || defined(__x86_64__)
274 RESTRICT_SYSCALL_DEATH_TEST(modify_ldt
);
276 RESTRICT_SYSCALL_DEATH_TEST(mount
);
277 RESTRICT_SYSCALL_DEATH_TEST(move_pages
);
278 #if defined(__i386__)
279 RESTRICT_SYSCALL_DEATH_TEST(mpx
);
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
);
291 #if defined(__x86_64__) || defined(__arm__)
292 RESTRICT_SYSCALL_DEATH_TEST(msgget
);
294 #if defined(__x86_64__) || defined(__arm__)
295 RESTRICT_SYSCALL_DEATH_TEST(msgrcv
);
297 #if defined(__x86_64__) || defined(__arm__)
298 RESTRICT_SYSCALL_DEATH_TEST(msgsnd
);
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
);
307 RESTRICT_SYSCALL_DEATH_TEST(nfsservctl
);
308 #if defined(__i386__) || defined(__arm__)
309 RESTRICT_SYSCALL_DEATH_TEST(nice
);
311 #if defined(__i386__)
312 RESTRICT_SYSCALL_DEATH_TEST(oldfstat
);
314 #if defined(__i386__)
315 RESTRICT_SYSCALL_DEATH_TEST(oldlstat
);
317 #if defined(__i386__)
318 RESTRICT_SYSCALL_DEATH_TEST(oldolduname
);
320 #if defined(__i386__)
321 RESTRICT_SYSCALL_DEATH_TEST(oldstat
);
323 #if defined(__i386__)
324 RESTRICT_SYSCALL_DEATH_TEST(olduname
);
326 RESTRICT_SYSCALL_DEATH_TEST(open_by_handle_at
);
327 RESTRICT_SYSCALL_DEATH_TEST(pause
);
329 RESTRICT_SYSCALL_DEATH_TEST(pciconfig_iobase
);
332 RESTRICT_SYSCALL_DEATH_TEST(pciconfig_read
);
335 RESTRICT_SYSCALL_DEATH_TEST(pciconfig_write
);
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
);
349 #if defined(__i386__)
350 RESTRICT_SYSCALL_DEATH_TEST(profil
);
352 RESTRICT_SYSCALL_DEATH_TEST(pselect6
);
353 #if defined(__i386__) || defined(__x86_64__)
354 RESTRICT_SYSCALL_DEATH_TEST(putpmsg
);
356 RESTRICT_SYSCALL_DEATH_TEST(pwritev
);
357 #if defined(__i386__) || defined(__x86_64__)
358 RESTRICT_SYSCALL_DEATH_TEST(query_module
);
360 RESTRICT_SYSCALL_DEATH_TEST(quotactl
);
361 RESTRICT_SYSCALL_DEATH_TEST(readahead
);
362 #if defined(__i386__)
363 RESTRICT_SYSCALL_DEATH_TEST(readdir
);
365 RESTRICT_SYSCALL_DEATH_TEST(readlink
);
366 RESTRICT_SYSCALL_DEATH_TEST(readlinkat
);
367 RESTRICT_SYSCALL_DEATH_TEST(readv
);
368 RESTRICT_SYSCALL_DEATH_TEST(reboot
);
370 RESTRICT_SYSCALL_DEATH_TEST(recv
);
372 #if defined(__x86_64__) || defined(__arm__)
373 RESTRICT_SYSCALL_DEATH_TEST(recvfrom
);
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
);
402 #if defined(__i386__) || defined(__x86_64__)
403 RESTRICT_SYSCALL_DEATH_TEST(select
);
405 #if defined(__x86_64__) || defined(__arm__)
406 RESTRICT_SYSCALL_DEATH_TEST(semctl
);
408 #if defined(__x86_64__) || defined(__arm__)
409 RESTRICT_SYSCALL_DEATH_TEST(semget
);
411 #if defined(__x86_64__) || defined(__arm__)
412 RESTRICT_SYSCALL_DEATH_TEST(semop
);
414 #if defined(__x86_64__) || defined(__arm__)
415 RESTRICT_SYSCALL_DEATH_TEST(semtimedop
);
418 RESTRICT_SYSCALL_DEATH_TEST(send
);
420 RESTRICT_SYSCALL_DEATH_TEST(sendfile
);
421 #if defined(__i386__) || defined(__arm__)
422 RESTRICT_SYSCALL_DEATH_TEST(sendfile64
);
424 RESTRICT_SYSCALL_DEATH_TEST(sendmmsg
);
425 #if defined(__x86_64__) || defined(__arm__)
426 RESTRICT_SYSCALL_DEATH_TEST(sendto
);
428 RESTRICT_SYSCALL_DEATH_TEST(set_mempolicy
);
429 #if defined(__i386__) || defined(__x86_64__)
430 RESTRICT_SYSCALL_DEATH_TEST(set_thread_area
);
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
);
438 RESTRICT_SYSCALL_DEATH_TEST(setfsuid
);
439 #if defined(__i386__) || defined(__arm__)
440 RESTRICT_SYSCALL_DEATH_TEST(setfsuid32
);
442 RESTRICT_SYSCALL_DEATH_TEST(setgid
);
443 #if defined(__i386__) || defined(__arm__)
444 RESTRICT_SYSCALL_DEATH_TEST(setgid32
);
446 RESTRICT_SYSCALL_DEATH_TEST(setgroups
);
447 #if defined(__i386__) || defined(__arm__)
448 RESTRICT_SYSCALL_DEATH_TEST(setgroups32
);
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
);
459 RESTRICT_SYSCALL_DEATH_TEST(setresgid
);
460 #if defined(__i386__) || defined(__arm__)
461 RESTRICT_SYSCALL_DEATH_TEST(setresgid32
);
463 RESTRICT_SYSCALL_DEATH_TEST(setresuid
);
464 #if defined(__i386__) || defined(__arm__)
465 RESTRICT_SYSCALL_DEATH_TEST(setresuid32
);
467 RESTRICT_SYSCALL_DEATH_TEST(setreuid
);
468 #if defined(__i386__) || defined(__arm__)
469 RESTRICT_SYSCALL_DEATH_TEST(setreuid32
);
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
);
476 RESTRICT_SYSCALL_DEATH_TEST(settimeofday
);
477 RESTRICT_SYSCALL_DEATH_TEST(setuid
);
478 #if defined(__i386__) || defined(__arm__)
479 RESTRICT_SYSCALL_DEATH_TEST(setuid32
);
481 RESTRICT_SYSCALL_DEATH_TEST(setxattr
);
482 #if defined(__i386__)
483 RESTRICT_SYSCALL_DEATH_TEST(sgetmask
);
485 #if defined(__x86_64__) || defined(__arm__)
486 RESTRICT_SYSCALL_DEATH_TEST(shmat
);
488 #if defined(__x86_64__) || defined(__arm__)
489 RESTRICT_SYSCALL_DEATH_TEST(shmctl
);
491 #if defined(__x86_64__) || defined(__arm__)
492 RESTRICT_SYSCALL_DEATH_TEST(shmdt
);
494 #if defined(__x86_64__) || defined(__arm__)
495 RESTRICT_SYSCALL_DEATH_TEST(shmget
);
497 #if defined(__i386__) || defined(__arm__)
498 RESTRICT_SYSCALL_DEATH_TEST(sigaction
);
500 #if defined(__i386__)
501 RESTRICT_SYSCALL_DEATH_TEST(signal
);
503 RESTRICT_SYSCALL_DEATH_TEST(signalfd
);
504 RESTRICT_SYSCALL_DEATH_TEST(signalfd4
);
505 #if defined(__i386__) || defined(__arm__)
506 RESTRICT_SYSCALL_DEATH_TEST(sigpending
);
508 #if defined(__i386__) || defined(__arm__)
509 RESTRICT_SYSCALL_DEATH_TEST(sigprocmask
);
511 #if defined(__i386__) || defined(__arm__)
512 RESTRICT_SYSCALL_DEATH_TEST(sigreturn
);
514 #if defined(__i386__) || defined(__arm__)
515 RESTRICT_SYSCALL_DEATH_TEST(sigsuspend
);
517 #if defined(__x86_64__) || defined(__arm__)
518 RESTRICT_SYSCALL_DEATH_TEST(socket
);
520 RESTRICT_SYSCALL_DEATH_TEST(splice
);
521 #if defined(__i386__)
522 RESTRICT_SYSCALL_DEATH_TEST(ssetmask
);
524 RESTRICT_SYSCALL_DEATH_TEST(stat
);
525 #if defined(__i386__) || defined(__arm__)
526 RESTRICT_SYSCALL_DEATH_TEST(stat64
);
528 RESTRICT_SYSCALL_DEATH_TEST(statfs
);
529 #if defined(__i386__) || defined(__arm__)
530 RESTRICT_SYSCALL_DEATH_TEST(statfs64
);
532 #if defined(__i386__)
533 RESTRICT_SYSCALL_DEATH_TEST(stime
);
535 #if defined(__i386__)
536 RESTRICT_SYSCALL_DEATH_TEST(stty
);
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
);
547 RESTRICT_SYSCALL_DEATH_TEST(sync_file_range2
);
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
);
568 #if defined(__x86_64__)
569 RESTRICT_SYSCALL_DEATH_TEST(tuxcall
);
571 #if defined(__i386__) || defined(__arm__)
572 RESTRICT_SYSCALL_DEATH_TEST(ugetrlimit
);
574 #if defined(__i386__)
575 RESTRICT_SYSCALL_DEATH_TEST(ulimit
);
577 RESTRICT_SYSCALL_DEATH_TEST(umask
);
578 #if defined(__i386__)
579 RESTRICT_SYSCALL_DEATH_TEST(umount
);
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
);
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
);
598 #if defined(__i386__)
599 RESTRICT_SYSCALL_DEATH_TEST(vm86old
);
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
);
608 RESTRICT_SYSCALL_DEATH_TEST(writev
);
610 // ARM specific syscalls.
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
);
620 #endif // !ADDRESS_SANITIZER && !THREAD_SANITIZER &&
621 // !MEMORY_SANITIZER && !LEAK_SANITIZER