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