aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-10-12 10:16:57 +0200
committerDmitry Vyukov <dvyukov@google.com>2015-10-12 10:16:57 +0200
commit874c5754bb22dbf77d6b600ff91f0f4f1fc5073a (patch)
tree0075fbd088046ad5c86e6e972235701d68b3ce7c /executor
initial commit
Diffstat (limited to 'executor')
-rw-r--r--executor/Makefile9
-rw-r--r--executor/executor.cc478
-rw-r--r--executor/syscalls.h307
3 files changed, 794 insertions, 0 deletions
diff --git a/executor/Makefile b/executor/Makefile
new file mode 100644
index 000000000..a84d06880
--- /dev/null
+++ b/executor/Makefile
@@ -0,0 +1,9 @@
+# Copyright 2015 syzkaller project authors. All rights reserved.
+# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+executor: executor.cc syscalls.h
+ gcc executor.cc -o executor -lpthread -static -Wall -O1 -g
+
+format: executor.cc
+ clang-format --style=file -i executor.cc
+
diff --git a/executor/executor.cc b/executor/executor.cc
new file mode 100644
index 000000000..e49303101
--- /dev/null
+++ b/executor/executor.cc
@@ -0,0 +1,478 @@
+// Copyright 2015 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <pthread.h>
+#include "syscalls.h"
+
+const int kInFd = 3;
+const int kOutFd = 4;
+const int kMaxInput = 1 << 20;
+const int kMaxOutput = 16 << 20;
+const int kMaxArgs = 6;
+const int kMaxThreads = 16;
+const int kMaxCommands = 4 << 10;
+
+const uint64_t instr_eof = -1;
+const uint64_t instr_copyin = -2;
+const uint64_t instr_copyout = -3;
+
+const uint64_t arg_const = 0;
+const uint64_t arg_result = 1;
+const uint64_t arg_data = 2;
+
+// We use the default value instead of results of failed syscalls.
+// -1 is an invalid fd and an invalid address and deterministic,
+// so good enough for our purposes.
+const uint64_t default_value = -1;
+
+bool flag_debug;
+bool flag_cover;
+bool flag_threaded;
+
+__attribute__((aligned(64 << 10))) char input_data[kMaxInput];
+__attribute__((aligned(64 << 10))) char output_data[kMaxOutput];
+uint32_t* output_pos;
+int completed;
+
+struct res_t {
+ bool executed;
+ uint64_t val;
+};
+
+res_t results[kMaxCommands];
+
+struct thread_t {
+ bool created;
+ int id;
+ pthread_t th;
+ int cover_fd;
+ uint32_t cover_data[16 << 10];
+ uint64_t* copyout_pos;
+ bool ready;
+ bool done;
+ bool handled;
+ int call_n;
+ int call_index;
+ int call_num;
+ int num_args;
+ uint64_t args[kMaxArgs];
+ uint64_t res;
+ int cover_size;
+};
+
+thread_t threads[kMaxThreads];
+
+__attribute__((noreturn)) void fail(const char* msg, ...);
+__attribute__((noreturn)) void error(const char* msg, ...);
+void debug(const char* msg, ...);
+uint64_t read_input(uint64_t** input_posp);
+uint64_t read_arg(uint64_t** input_posp);
+uint64_t read_result(uint64_t** input_posp);
+void write_output(uint32_t v);
+void copyin(char* addr, uint64_t val, uint64_t size);
+uint64_t copyout(char* addr, uint64_t size);
+thread_t* schedule_call(int n, int call_index, int call_num, uint64_t num_args, uint64_t* args, uint64_t* pos);
+void execute_call(thread_t* th);
+void handle_completion(thread_t* th);
+void* worker_thread(void* arg);
+uint64_t current_time_ms();
+void cover_init(thread_t* th);
+void cover_reset(thread_t* th);
+int cover_read(thread_t* th);
+
+int main()
+{
+ if (mmap(&input_data[0], kMaxInput, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, kInFd, 0) != &input_data[0])
+ fail("mmap of input file failed");
+ if (mmap(&output_data[0], kMaxOutput, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, kOutFd, 0) != &output_data[0])
+ fail("mmap of output file failed");
+ uint64_t* input_pos = (uint64_t*)&input_data[0];
+ uint64_t flags = read_input(&input_pos);
+ flag_debug = flags & (1 << 0);
+ flag_cover = flags & (1 << 1);
+ flag_threaded = flags & (1 << 2);
+ output_pos = (uint32_t*)&output_data[0];
+ write_output(0); // Number of executed syscalls (updated later).
+
+ if (!flag_threaded)
+ cover_init(&threads[0]);
+
+ int call_index = 0;
+ for (int n = 0;; n++) {
+ uint64_t call_num = read_input(&input_pos);
+ if (call_num == instr_eof)
+ break;
+ if (call_num == instr_copyin) {
+ char* addr = (char*)read_input(&input_pos);
+ uint64_t typ = read_input(&input_pos);
+ uint64_t size = read_input(&input_pos);
+ debug("copyin to %p\n", addr);
+ switch (typ) {
+ case arg_const: {
+ uint64_t arg = read_input(&input_pos);
+ copyin(addr, arg, size);
+ break;
+ }
+ case arg_result: {
+ uint64_t val = read_result(&input_pos);
+ copyin(addr, val, size);
+ break;
+ }
+ case arg_data: {
+ memcpy(addr, input_pos, size);
+ // Read out the data.
+ for (uint64_t i = 0; i < (size + 7) / 8; i++)
+ read_input(&input_pos);
+ break;
+ }
+ default:
+ fail("bad argument type %lu", typ);
+ }
+ continue;
+ }
+ if (call_num == instr_copyout) {
+ read_input(&input_pos); // addr
+ read_input(&input_pos); // size
+ // The copyout will happen when/if the call completes.
+ continue;
+ }
+
+ // Normal syscall.
+ if (call_num >= sizeof(syscalls) / sizeof(syscalls[0]))
+ fail("invalid command number %lu", call_num);
+ uint64_t num_args = read_input(&input_pos);
+ if (num_args > kMaxArgs)
+ fail("command has bad number of arguments %lu", num_args);
+ uint64_t args[kMaxArgs] = {};
+ for (uint64_t i = 0; i < num_args; i++)
+ args[i] = read_arg(&input_pos);
+ for (uint64_t i = num_args; i < 6; i++)
+ args[i] = 0;
+ thread_t* th = schedule_call(n, call_index++, call_num, num_args, args, input_pos);
+
+ if (flag_threaded) {
+ // Wait for call completion.
+ uint64_t start = current_time_ms();
+ while (!__atomic_load_n(&th->done, __ATOMIC_ACQUIRE) && (current_time_ms() - start) < 100)
+ usleep(10);
+ if (__atomic_load_n(&th->done, __ATOMIC_ACQUIRE))
+ handle_completion(th);
+ // Check if any of previous calls have completed.
+ usleep(100);
+ for (int i = 0; i < kMaxThreads; i++) {
+ th = &threads[i];
+ if (__atomic_load_n(&th->done, __ATOMIC_ACQUIRE) && !th->handled)
+ handle_completion(th);
+ }
+ } else {
+ // Execute directly.
+ if (th != &threads[0])
+ fail("using non-main thread in non-thread mode");
+ execute_call(th);
+ handle_completion(th);
+ }
+ }
+
+ // TODO: handle hanged threads.
+ debug("exiting\n");
+ return 0;
+}
+
+thread_t* schedule_call(int n, int call_index, int call_num, uint64_t num_args, uint64_t* args, uint64_t* pos)
+{
+ // Find a spare thread to execute the call.
+ thread_t* th = 0;
+ for (int i = 0; i < kMaxThreads; i++) {
+ th = &threads[i];
+ if (!th->created) {
+ th->created = true;
+ th->id = i;
+ th->done = true;
+ th->handled = true;
+ if (flag_threaded) {
+ if (pthread_create(&th->th, 0, worker_thread, th))
+ fail("pthread_create failed");
+ }
+ }
+ if (__atomic_load_n(&th->done, __ATOMIC_ACQUIRE)) {
+ if (!th->handled)
+ handle_completion(th);
+ break;
+ }
+ }
+ if (th == &threads[kMaxThreads])
+ fail("out of threads");
+ debug("scheduling call %d [%s] on thread %d\n", call_index, syscalls[call_num].name, th->id);
+ if (th->ready || !th->done || !th->handled)
+ fail("bad thread state in schedule: ready=%d done=%d handled=%d",
+ th->ready, th->done, th->handled);
+ th->copyout_pos = pos;
+ th->done = false;
+ th->handled = false;
+ th->call_n = n;
+ th->call_index = call_index;
+ th->call_num = call_num;
+ th->num_args = num_args;
+ for (int i = 0; i < kMaxArgs; i++)
+ th->args[i] = args[i];
+ __atomic_store_n(&th->ready, true, __ATOMIC_RELEASE);
+ return th;
+}
+
+void handle_completion(thread_t* th)
+{
+ debug("completion of call %d [%s] on thread %d\n", th->call_index, syscalls[th->call_num].name, th->id);
+ if (th->ready || !th->done || th->handled)
+ fail("bad thread state in completion: ready=%d done=%d handled=%d",
+ th->ready, th->done, th->handled);
+ if (th->res != (uint64_t)-1) {
+ results[th->call_n].executed = true;
+ results[th->call_n].val = th->res;
+ for (;;) {
+ th->call_n++;
+ uint64_t call_num = read_input(&th->copyout_pos);
+ if (call_num != instr_copyout)
+ break;
+ char* addr = (char*)read_input(&th->copyout_pos);
+ uint64_t size = read_input(&th->copyout_pos);
+ uint64_t val = copyout(addr, size);
+ results[th->call_n].executed = true;
+ results[th->call_n].val = val;
+ debug("copyout from %p\n", addr);
+ }
+ }
+ write_output(th->call_index);
+ write_output(th->call_num);
+ write_output(th->cover_size);
+ for (int i = 0; i < th->cover_size; i++)
+ write_output(th->cover_data[i]);
+ completed++;
+ __atomic_store_n((uint32_t*)&output_data[0], completed, __ATOMIC_RELEASE);
+ th->handled = true;
+}
+
+void* worker_thread(void* arg)
+{
+ thread_t* th = (thread_t*)arg;
+
+ cover_init(th);
+ for (;;) {
+ while (!__atomic_load_n(&th->ready, __ATOMIC_ACQUIRE))
+ usleep(10);
+ execute_call(th);
+ }
+ return 0;
+}
+
+void execute_call(thread_t* th)
+{
+ th->ready = false;
+ call_t* call = &syscalls[th->call_num];
+ debug("#%d: %s(", th->id, call->name);
+ for (int i = 0; i < th->num_args; i++) {
+ if (i != 0)
+ debug(", ");
+ debug("0x%lx", th->args[i]);
+ }
+ debug(")\n");
+
+ if (kMaxArgs != 6)
+ fail("inconsistent number of arguments");
+
+ cover_reset(th);
+ th->res = syscall(call->sys_nr, th->args[0], th->args[1], th->args[2], th->args[3], th->args[4], th->args[5]);
+ int errno0 = errno;
+ th->cover_size = cover_read(th);
+
+ if (th->res == (uint64_t)-1)
+ debug("#%d: %s = errno(%d)\n", th->id, call->name, errno0);
+ else
+ debug("#%d: %s = %lx\n", th->id, call->name, th->res);
+ __atomic_store_n(&th->done, true, __ATOMIC_RELEASE);
+}
+
+void cover_init(thread_t* th)
+{
+ if (!flag_cover)
+ return;
+ debug("#%d: opening /proc/cover\n", th->id);
+ th->cover_fd = open("/proc/cover", O_RDWR);
+ if (th->cover_fd == -1)
+ fail("open of /proc/cover failed");
+ char cmd[128];
+ sprintf(cmd, "enable=%d", (int)(sizeof(th->cover_data) / sizeof(th->cover_data[0])));
+ int n = write(th->cover_fd, cmd, strlen(cmd));
+ if (n != (int)strlen(cmd))
+ fail("cover enable write failed");
+ debug("#%d: opened /proc/cover\n", th->id);
+}
+
+void cover_reset(thread_t* th)
+{
+ if (!flag_cover)
+ return;
+ debug("#%d: resetting /proc/cover\n", th->id);
+ int n = write(th->cover_fd, "reset", sizeof("reset") - 1);
+ if (n != sizeof("reset") - 1)
+ fail("cover reset write failed");
+}
+
+int cover_read(thread_t* th)
+{
+ if (!flag_cover)
+ return 0;
+ int n = read(th->cover_fd, th->cover_data, sizeof(th->cover_data));
+ if (n < 0 || n > (int)sizeof(th->cover_data) || (n % sizeof(th->cover_data[0])) != 0)
+ fail("cover read failed after %s (n=%d)", syscalls[th->call_num].name, n);
+ n /= sizeof(th->cover_data[0]);
+ debug("#%d: read /proc/cover = %d\n", th->id, n);
+ return n;
+}
+
+void copyin(char* addr, uint64_t val, uint64_t size)
+{
+ switch (size) {
+ case 1:
+ *(uint8_t*)addr = val;
+ break;
+ case 2:
+ *(uint16_t*)addr = val;
+ break;
+ case 4:
+ *(uint32_t*)addr = val;
+ break;
+ case 8:
+ *(uint64_t*)addr = val;
+ break;
+ default:
+ fail("copyin: bad argument size %lu", size);
+ }
+}
+
+uint64_t copyout(char* addr, uint64_t size)
+{
+ switch (size) {
+ case 1:
+ return *(uint8_t*)addr;
+ case 2:
+ return *(uint16_t*)addr;
+ case 4:
+ return *(uint32_t*)addr;
+ case 8:
+ return *(uint64_t*)addr;
+ default:
+ fail("copyout: bad argument size %lu", size);
+ }
+}
+
+uint64_t read_arg(uint64_t** input_posp)
+{
+ uint64_t typ = read_input(input_posp);
+ uint64_t size = read_input(input_posp);
+ (void)size;
+ uint64_t arg = 0;
+ switch (typ) {
+ case arg_const: {
+ arg = read_input(input_posp);
+ break;
+ }
+ case arg_result: {
+ arg = read_result(input_posp);
+ break;
+ }
+ default:
+ fail("bad argument type %lu", typ);
+ }
+ return arg;
+}
+
+uint64_t read_result(uint64_t** input_posp)
+{
+ uint64_t idx = read_input(input_posp);
+ uint64_t op_div = read_input(input_posp);
+ uint64_t op_add = read_input(input_posp);
+ if (idx >= kMaxCommands)
+ fail("command refers to bad result %ld", idx);
+ uint64_t arg = default_value;
+ if (results[idx].executed) {
+ arg = results[idx].val;
+ if (op_div != 0)
+ arg = arg / op_div;
+ arg += op_add;
+ }
+ return arg;
+}
+
+uint64_t read_input(uint64_t** input_posp)
+{
+ uint64_t* input_pos = *input_posp;
+ if ((char*)input_pos >= input_data + kMaxInput)
+ fail("input command overflows input");
+ *input_posp = input_pos + 1;
+ return *input_pos;
+}
+
+void write_output(uint32_t v)
+{
+ if ((char*)output_pos >= output_data + kMaxOutput)
+ fail("output overflow");
+ *output_pos++ = v;
+}
+
+uint64_t current_time_ms()
+{
+ timespec ts;
+ if (clock_gettime(CLOCK_MONOTONIC, &ts))
+ fail("clock_gettime failed");
+ return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
+}
+
+// logical error (e.g. invalid input program)
+void fail(const char* msg, ...)
+{
+ int e = errno;
+ fflush(stdout);
+ va_list args;
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+ fprintf(stderr, " (errno %d)\n", e);
+ exit(67);
+}
+
+// kernel error (e.g. wrong syscall return value)
+void error(const char* msg, ...)
+{
+ fflush(stdout);
+ va_list args;
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+ fprintf(stderr, "\n");
+ exit(68);
+}
+
+void debug(const char* msg, ...)
+{
+ if (!flag_debug)
+ return;
+ va_list args;
+ va_start(args, msg);
+ vfprintf(stdout, msg, args);
+ va_end(args);
+ fflush(stdout);
+}
diff --git a/executor/syscalls.h b/executor/syscalls.h
new file mode 100644
index 000000000..86dc26a4b
--- /dev/null
+++ b/executor/syscalls.h
@@ -0,0 +1,307 @@
+// AUTOGENERATED FILE
+
+struct call_t {
+ const char* name;
+ int sys_nr;
+};
+
+call_t syscalls[] = {
+ {"open", __NR_open},
+ {"openat", __NR_openat},
+ {"creat", __NR_creat},
+ {"close", __NR_close},
+ {"read", __NR_read},
+ {"pread64", __NR_pread64},
+ {"readv", __NR_readv},
+ {"preadv", __NR_preadv},
+ {"write", __NR_write},
+ {"pwrite64", __NR_pwrite64},
+ {"writev", __NR_writev},
+ {"pwritev", __NR_pwritev},
+ {"lseek", __NR_lseek},
+ {"dup", __NR_dup},
+ {"dup2", __NR_dup2},
+ {"dup3", __NR_dup3},
+ {"pipe", __NR_pipe},
+ {"pipe2", __NR_pipe2},
+ {"tee", __NR_tee},
+ {"splice", __NR_splice},
+ {"vmsplice", __NR_vmsplice},
+ {"sendfile", __NR_sendfile},
+ {"stat", __NR_stat},
+ {"lstat", __NR_lstat},
+ {"fstat", __NR_fstat},
+ {"poll", __NR_poll},
+ {"ppoll", __NR_ppoll},
+ {"select", __NR_select},
+ {"pselect6", __NR_pselect6},
+ {"epoll_create", __NR_epoll_create},
+ {"epoll_create1", __NR_epoll_create1},
+ {"epoll_ctl", __NR_epoll_ctl},
+ {"epoll_wait", __NR_epoll_wait},
+ {"epoll_pwait", __NR_epoll_pwait},
+ {"signalfd", __NR_signalfd},
+ {"signalfd4", __NR_signalfd4},
+ {"eventfd", __NR_eventfd},
+ {"eventfd2", __NR_eventfd2},
+ {"timerfd_create", __NR_timerfd_create},
+ {"timerfd_settime", __NR_timerfd_settime},
+ {"timerfd_gettime", __NR_timerfd_gettime},
+ {"mmap", __NR_mmap},
+ {"munmap", __NR_munmap},
+ {"mremap", __NR_mremap},
+ {"remap_file_pages", __NR_remap_file_pages},
+ {"mprotect", __NR_mprotect},
+ {"msync", __NR_msync},
+ {"madvise", __NR_madvise},
+ {"fadvise64", __NR_fadvise64},
+ {"readahead", __NR_readahead},
+ {"mbind", __NR_mbind},
+ {"move_pages", __NR_move_pages},
+ {"migrate_pages", __NR_migrate_pages},
+ {"set_mempolicy", __NR_set_mempolicy},
+ {"get_mempolicy", __NR_get_mempolicy},
+ {"mincore", __NR_mincore},
+ {"mlock", __NR_mlock},
+ {"munlock", __NR_munlock},
+ {"mlockall", __NR_mlockall},
+ {"munlockall", __NR_munlockall},
+ {"unshare", __NR_unshare},
+ {"kcmp", __NR_kcmp},
+ {"futex", __NR_futex},
+ {"set_robust_list", __NR_set_robust_list},
+ {"get_robust_list", __NR_get_robust_list},
+ {"restart_syscall", __NR_restart_syscall},
+ {"socket", __NR_socket},
+ {"socketpair", __NR_socketpair},
+ {"accept", __NR_accept},
+ {"accept4", __NR_accept4},
+ {"bind", __NR_bind},
+ {"listen", __NR_listen},
+ {"connect", __NR_connect},
+ {"shutdown", __NR_shutdown},
+ {"sendto", __NR_sendto},
+ {"sendmsg", __NR_sendmsg},
+ {"sendmmsg", __NR_sendmmsg},
+ {"recvfrom", __NR_recvfrom},
+ {"recvmsg", __NR_recvmsg},
+ {"recvmmsg", __NR_recvmmsg},
+ {"getsockname", __NR_getsockname},
+ {"getpeername", __NR_getpeername},
+ {"getsockopt", __NR_getsockopt},
+ {"setsockopt", __NR_setsockopt},
+ {"ioctl", __NR_ioctl},
+ {"fcntl$dupfd", __NR_fcntl},
+ {"fcntl$getflags", __NR_fcntl},
+ {"fcntl$setflags", __NR_fcntl},
+ {"fcntl$setstatus", __NR_fcntl},
+ {"fcntl$lock", __NR_fcntl},
+ {"fcntl$getown", __NR_fcntl},
+ {"fcntl$setown", __NR_fcntl},
+ {"fcntl$getownex", __NR_fcntl},
+ {"fcntl$setownex", __NR_fcntl},
+ {"fcntl$setsig", __NR_fcntl},
+ {"fcntl$setlease", __NR_fcntl},
+ {"fcntl$notify", __NR_fcntl},
+ {"fcntl$setpipe", __NR_fcntl},
+ {"ptrace", __NR_ptrace},
+ {"ptrace$peek", __NR_ptrace},
+ {"ptrace$poke", __NR_ptrace},
+ {"ptrace$peekuser", __NR_ptrace},
+ {"ptrace$pokeuser", __NR_ptrace},
+ {"ptrace$getregs", __NR_ptrace},
+ {"ptrace$getregset", __NR_ptrace},
+ {"ptrace$setregs", __NR_ptrace},
+ {"ptrace$setregset", __NR_ptrace},
+ {"ptrace$getsig", __NR_ptrace},
+ {"ptrace$setsig", __NR_ptrace},
+ {"ptrace$setopts", __NR_ptrace},
+ {"ptrace$getenv", __NR_ptrace},
+ {"ptrace$cont", __NR_ptrace},
+ {"io_setup", __NR_io_setup},
+ {"io_destroy", __NR_io_destroy},
+ {"io_getevents", __NR_io_getevents},
+ {"io_submit", __NR_io_submit},
+ {"io_cancel", __NR_io_cancel},
+ {"capget", __NR_capget},
+ {"capset", __NR_capset},
+ {"prctl", __NR_prctl},
+ {"arch_prctl", __NR_arch_prctl},
+ {"seccomp", __NR_seccomp},
+ {"add_key", __NR_add_key},
+ {"request_key", __NR_request_key},
+ {"keyctl", __NR_keyctl},
+ {"mq_open", __NR_mq_open},
+ {"mq_timedsend", __NR_mq_timedsend},
+ {"mq_timedreceive", __NR_mq_timedreceive},
+ {"mq_notify", __NR_mq_notify},
+ {"mq_getsetattr", __NR_mq_getsetattr},
+ {"mq_unlink", __NR_mq_unlink},
+ {"msgget", __NR_msgget},
+ {"msgsnd", __NR_msgsnd},
+ {"msgrcv", __NR_msgrcv},
+ {"msgctl", __NR_msgctl},
+ {"semget", __NR_semget},
+ {"semop", __NR_semop},
+ {"semtimedop", __NR_semtimedop},
+ {"semctl", __NR_semctl},
+ {"shmget", __NR_shmget},
+ {"shmat", __NR_shmat},
+ {"shmctl", __NR_shmctl},
+ {"shmdt", __NR_shmdt},
+ {"mknod", __NR_mknod},
+ {"mknodat", __NR_mknodat},
+ {"chmod", __NR_chmod},
+ {"fchmod", __NR_fchmod},
+ {"fchmodat", __NR_fchmodat},
+ {"chown", __NR_chown},
+ {"lchown", __NR_lchown},
+ {"fchown", __NR_fchown},
+ {"fchownat", __NR_fchownat},
+ {"fallocate", __NR_fallocate},
+ {"faccessat", __NR_faccessat},
+ {"utime", __NR_utime},
+ {"utimes", __NR_utimes},
+ {"futimesat", __NR_futimesat},
+ {"utimensat", __NR_utimensat},
+ {"getgid", __NR_getgid},
+ {"getegid", __NR_getegid},
+ {"setuid", __NR_setuid},
+ {"setgid", __NR_setgid},
+ {"getuid", __NR_getuid},
+ {"geteuid", __NR_geteuid},
+ {"setpgid", __NR_setpgid},
+ {"getpgid", __NR_getpgid},
+ {"getpgrp", __NR_getpgrp},
+ {"getpid", __NR_getpid},
+ {"gettid", __NR_gettid},
+ {"setreuid", __NR_setreuid},
+ {"setregid", __NR_setregid},
+ {"setresuid", __NR_setresuid},
+ {"setresgid", __NR_setresgid},
+ {"getresuid", __NR_getresuid},
+ {"getresgid", __NR_getresgid},
+ {"setfsuid", __NR_setfsuid},
+ {"setfsgid", __NR_setfsgid},
+ {"getgroups", __NR_getgroups},
+ {"setgroups", __NR_setgroups},
+ {"personality", __NR_personality},
+ {"inotify_init", __NR_inotify_init},
+ {"inotify_init1", __NR_inotify_init1},
+ {"inotify_add_watch", __NR_inotify_add_watch},
+ {"inotify_rm_watch", __NR_inotify_rm_watch},
+ {"fanotify_init", __NR_fanotify_init},
+ {"fanotify_mark", __NR_fanotify_mark},
+ {"link", __NR_link},
+ {"linkat", __NR_linkat},
+ {"symlinkat", __NR_symlinkat},
+ {"symlink", __NR_symlink},
+ {"unlink", __NR_unlink},
+ {"unlinkat", __NR_unlinkat},
+ {"readlink", __NR_readlink},
+ {"readlinkat", __NR_readlinkat},
+ {"rename", __NR_rename},
+ {"renameat", __NR_renameat},
+ {"renameat2", __NR_renameat2},
+ {"mkdir", __NR_mkdir},
+ {"mkdirat", __NR_mkdirat},
+ {"rmdir", __NR_rmdir},
+ {"truncate", __NR_truncate},
+ {"ftruncate", __NR_ftruncate},
+ {"flock", __NR_flock},
+ {"fsync", __NR_fsync},
+ {"fdatasync", __NR_fdatasync},
+ {"sync", __NR_sync},
+ {"syncfs", __NR_syncfs},
+ {"sync_file_range", __NR_sync_file_range},
+ {"lookup_dcookie", __NR_lookup_dcookie},
+ {"getdents", __NR_getdents},
+ {"getdents64", __NR_getdents64},
+ {"name_to_handle_at", __NR_name_to_handle_at},
+ {"open_by_handle_at", __NR_open_by_handle_at},
+ {"mount", __NR_mount},
+ {"umount2", __NR_umount2},
+ {"pivot_root", __NR_pivot_root},
+ {"sysfs", __NR_sysfs},
+ {"statfs", __NR_statfs},
+ {"fstatfs", __NR_fstatfs},
+ {"uselib", __NR_uselib},
+ {"init_module", __NR_init_module},
+ {"finit_module", __NR_finit_module},
+ {"delete_module", __NR_delete_module},
+ {"kexec_load", __NR_kexec_load},
+ {"get_kernel_syms", __NR_get_kernel_syms},
+ {"syslog", __NR_syslog},
+ {"uname", __NR_uname},
+ {"sysinfo", __NR_sysinfo},
+ {"ustat", __NR_ustat},
+ {"acct", __NR_acct},
+ {"getrusage", __NR_getrusage},
+ {"getrlimit", __NR_getrlimit},
+ {"setrlimit", __NR_setrlimit},
+ {"prlimit64", __NR_prlimit64},
+ {"iopl", __NR_iopl},
+ {"ioperm", __NR_ioperm},
+ {"ioprio_get", __NR_ioprio_get},
+ {"ioprio_set", __NR_ioprio_set},
+ {"setns", __NR_setns},
+ {"setxattr", __NR_setxattr},
+ {"lsetxattr", __NR_lsetxattr},
+ {"fsetxattr", __NR_fsetxattr},
+ {"getxattr", __NR_getxattr},
+ {"lgetxattr", __NR_lgetxattr},
+ {"fgetxattr", __NR_fgetxattr},
+ {"listxattr", __NR_listxattr},
+ {"llistxattr", __NR_llistxattr},
+ {"flistxattr", __NR_flistxattr},
+ {"removexattr", __NR_removexattr},
+ {"lremovexattr", __NR_lremovexattr},
+ {"fremovexattr", __NR_fremovexattr},
+ {"time", __NR_time},
+ {"clock_gettime", __NR_clock_gettime},
+ {"clock_settime", __NR_clock_settime},
+ {"clock_adjtime", __NR_clock_adjtime},
+ {"clock_getres", __NR_clock_getres},
+ {"clock_nanosleep", __NR_clock_nanosleep},
+ {"timer_create", __NR_timer_create},
+ {"timer_gettime", __NR_timer_gettime},
+ {"timer_getoverrun", __NR_timer_getoverrun},
+ {"timer_settime", __NR_timer_settime},
+ {"timer_delete", __NR_timer_delete},
+ {"rt_sigaction", __NR_rt_sigaction},
+ {"rt_sigprocmask", __NR_rt_sigprocmask},
+ {"rt_sigreturn", __NR_rt_sigreturn},
+ {"rt_sigpending", __NR_rt_sigpending},
+ {"rt_sigtimedwait", __NR_rt_sigtimedwait},
+ {"rt_sigsuspend", __NR_rt_sigsuspend},
+ {"rt_sigqueueinfo", __NR_rt_sigqueueinfo},
+ {"rt_tgsigqueueinfo", __NR_rt_tgsigqueueinfo},
+ {"sigaltstack", __NR_sigaltstack},
+ {"tgkill", __NR_tgkill},
+ {"tkill", __NR_tkill},
+ {"pause", __NR_pause},
+ {"alarm", __NR_alarm},
+ {"nanosleep", __NR_nanosleep},
+ {"getitimer", __NR_getitimer},
+ {"setitimer", __NR_setitimer},
+ {"exit", __NR_exit},
+ {"exit_group", __NR_exit_group},
+ {"waitid", __NR_waitid},
+ {"wait4", __NR_wait4},
+ {"times", __NR_times},
+ {"set_thread_area", __NR_set_thread_area},
+ {"get_thread_area", __NR_get_thread_area},
+ {"set_tid_address", __NR_set_tid_address},
+ {"getpriority", __NR_getpriority},
+ {"setpriority", __NR_setpriority},
+ {"sched_getscheduler", __NR_sched_getscheduler},
+ {"sched_setscheduler", __NR_sched_setscheduler},
+ {"sched_rr_get_interval", __NR_sched_rr_get_interval},
+ {"sched_getparam", __NR_sched_getparam},
+ {"sched_setparam", __NR_sched_setparam},
+ {"sched_getaffinity", __NR_sched_getaffinity},
+ {"sched_setaffinity", __NR_sched_setaffinity},
+ {"sched_getattr", __NR_sched_getattr},
+ {"sched_setattr", __NR_sched_setattr},
+ {"sched_yield", __NR_sched_yield},
+};