? github.com/google/syzkaller/dashboard/dashapi [no test files] ok github.com/google/syzkaller/dashboard/app (cached) ? github.com/google/syzkaller/pkg/debugtracer [no test files] ? github.com/google/syzkaller/pkg/gcs [no test files] ? github.com/google/syzkaller/pkg/gce [no test files] ? github.com/google/syzkaller/pkg/hash [no test files] ok github.com/google/syzkaller/executor 6.282s ok github.com/google/syzkaller/pkg/asset (cached) ok github.com/google/syzkaller/pkg/ast 1.102s ok github.com/google/syzkaller/pkg/auth (cached) ok github.com/google/syzkaller/pkg/bisect (cached) ok github.com/google/syzkaller/pkg/bisect/minimize (cached) ok github.com/google/syzkaller/pkg/build (cached) ? github.com/google/syzkaller/pkg/html/pages [no test files] ? github.com/google/syzkaller/pkg/ifuzz/powerpc [no test files] ? github.com/google/syzkaller/pkg/ifuzz/iset [no test files] ? github.com/google/syzkaller/pkg/ifuzz/powerpc/generated [no test files] ? github.com/google/syzkaller/pkg/ifuzz/x86/gen [no test files] ? github.com/google/syzkaller/pkg/ifuzz/x86 [no test files] ? github.com/google/syzkaller/pkg/ifuzz/x86/generated [no test files] ok github.com/google/syzkaller/pkg/compiler 8.422s ok github.com/google/syzkaller/pkg/config (cached) ok github.com/google/syzkaller/pkg/cover (cached) ok github.com/google/syzkaller/pkg/cover/backend (cached) ? github.com/google/syzkaller/pkg/ipc/ipcconfig [no test files] ? github.com/google/syzkaller/pkg/kcidb [no test files] ? github.com/google/syzkaller/pkg/report/crash [no test files] ? github.com/google/syzkaller/pkg/rpctype [no test files] --- FAIL: TestGenerate (8.29s) --- FAIL: TestGenerate/openbsd/amd64 (0.35s) testutil.go:33: seed=1689936149177752577 testutil.go:33: seed=1689936149513970902 --- FAIL: TestGenerate/openbsd/amd64/7 (1.33s) csource_test.go:150: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: wait4(0xffffffffffffffff, &(0x7f0000000000), 0x2, &(0x7f0000000040)) (fail_nth: 1) getrusage(0xffffffffffffffff, &(0x7f0000000100)) (async) getsockopt(0xffffffffffffff9c, 0x860, 0xd710, &(0x7f00000001c0)=""/87, &(0x7f0000000240)=0x57) (rerun: 4) getgroups(0x7, &(0x7f0000000280)=[0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0x0, 0x0, 0xffffffffffffffff, 0xffffffffffffffff]) setsockopt$sock_cred(0xffffffffffffffff, 0xffff, 0x1022, &(0x7f00000002c0)={0x0, 0xffffffffffffffff, r1}, 0xc) setsockopt$sock_cred(0xffffffffffffffff, 0xffff, 0x1022, &(0x7f0000000300)={0x0, 0xffffffffffffffff, r0}, 0xc) getsockopt$sock_int(0xffffffffffffff9c, 0xffff, 0x1, &(0x7f0000000340), &(0x7f0000000380)=0x4) r3 = msgget$private(0x0, 0x602) r4 = geteuid() msgctl$IPC_SET(r3, 0x1, &(0x7f0000000400)={{0x3, r4, r2, 0xffffffffffffffff, 0x0, 0x6, 0x9}, 0x4, 0x334, 0x0, 0x0, 0x3, 0x7, 0x5, 0x10001}) syz_emit_ethernet(0x4f, &(0x7f0000000000)={@local, @remote, [], {@generic={0x828f, "5c411aa42a745b3f748ba559409d41f28903668249ef7aa3966e6fbad63bd3d75958db8dddc230ae169f470b952b4ca7557ba865e8f2eaf75f1bf240c9f7290016"}}}) syz_execute_func(&(0x7f0000000080)="f045ff8a00000000420f587cd10036660f1eef660f38404608c4a27db69d8c0c592cc4a37d1d0d0000000099c4e1fa2dcac46140c26f0004c4e1ede1f236d9f7") syz_extract_tcp_res(&(0x7f00000000c0), 0x0, 0x80) syz_open_pts() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void kill_and_wait(int pid, int* status) { kill(pid, SIGKILL); while (waitpid(-1, status, 0) != pid) { } } static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static void __attribute__((noinline)) remove_dir(const char* dir) { DIR* dp = opendir(dir); if (dp == NULL) { if (errno == EACCES) { if (rmdir(dir)) exit(1); return; } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } if (unlink(filename)) { exit(1); } } closedir(dp); while (rmdir(dir)) { exit(1); } } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { pthread_mutex_t mu; pthread_cond_t cv; int state; } event_t; static void event_init(event_t* ev) { if (pthread_mutex_init(&ev->mu, 0)) exit(1); if (pthread_cond_init(&ev->cv, 0)) exit(1); ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { pthread_mutex_lock(&ev->mu); if (ev->state) exit(1); ev->state = 1; pthread_mutex_unlock(&ev->mu); pthread_cond_broadcast(&ev->cv); } static void event_wait(event_t* ev) { pthread_mutex_lock(&ev->mu); while (!ev->state) pthread_cond_wait(&ev->cv, &ev->mu); pthread_mutex_unlock(&ev->mu); } static int event_isset(event_t* ev) { pthread_mutex_lock(&ev->mu); int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; pthread_mutex_lock(&ev->mu); for (;;) { if (ev->state) break; uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); now = current_time_ms(); if (now - start > timeout) break; } int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } #define CAST static uintptr_t syz_open_pts(void) { int master, slave; if (openpty(&master, &slave, NULL, NULL, NULL) == -1) return -1; if (dup2(master, master + 100) != -1) close(master); return slave; } static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 12; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); if (call == 1) break; event_timedwait(&th->done, 50); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } static void execute_one(void); #define WAIT_FLAGS 0 static void loop(void) { int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[5] = {0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(wait4))(/*pid=*/-1, /*status=*/0x20000000, /*options=*/2, /*ru=*/0x20000040); break; case 1: ((intptr_t(*)(intptr_t,intptr_t))CAST(getrusage))(/*who=*/-1, /*usage=*/0x20000100); break; case 2: *(uint32_t*)0x20000240 = 0x57; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0x860, /*optname=*/0xd710, /*optval=*/0x200001c0, /*optlen=*/0x20000240); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0x860, /*optname=*/0xd710, /*optval=*/0x200001c0, /*optlen=*/0x20000240); } } break; case 3: *(uint32_t*)0x20000280 = -1; *(uint32_t*)0x20000284 = -1; *(uint32_t*)0x20000288 = 0; *(uint32_t*)0x2000028c = 0; *(uint32_t*)0x20000290 = 0; *(uint32_t*)0x20000294 = -1; *(uint32_t*)0x20000298 = -1; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(getgroups))(/*size=*/7, /*list=*/0x20000280); if (res != -1) { r[0] = *(uint32_t*)0x2000028c; r[1] = *(uint32_t*)0x20000294; r[2] = *(uint32_t*)0x20000298; } break; case 4: *(uint32_t*)0x200002c0 = 0; *(uint32_t*)0x200002c4 = -1; *(uint32_t*)0x200002c8 = r[1]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(setsockopt))(/*fd=*/-1, /*level=*/0xffff, /*optname=*/0x1022, /*optval=*/0x200002c0, /*optlen=*/0xc); break; case 5: *(uint32_t*)0x20000300 = 0; *(uint32_t*)0x20000304 = -1; *(uint32_t*)0x20000308 = r[0]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(setsockopt))(/*fd=*/-1, /*level=*/0xffff, /*optname=*/0x1022, /*optval=*/0x20000300, /*optlen=*/0xc); break; case 6: *(uint32_t*)0x20000380 = 4; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/1, /*optval=*/0x20000340, /*optlen=*/0x20000380); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(msgget))(/*key=*/0, /*flags=*/0x602); if (res != -1) r[3] = res; break; case 8: res = -1; res = ((intptr_t(*)())CAST(geteuid))(); if (res != -1) r[4] = res; break; case 9: *(uint32_t*)0x20000400 = 3; *(uint32_t*)0x20000404 = r[4]; *(uint32_t*)0x20000408 = r[2]; *(uint32_t*)0x2000040c = -1; *(uint32_t*)0x20000410 = 0; *(uint32_t*)0x20000414 = 6; *(uint16_t*)0x20000418 = 9; *(uint16_t*)0x2000041a = 0; *(uint64_t*)0x20000420 = 0; *(uint64_t*)0x20000428 = 0; *(uint64_t*)0x20000430 = 4; *(uint64_t*)0x20000438 = 0x334; *(uint32_t*)0x20000440 = 0; *(uint32_t*)0x20000444 = 0; *(uint64_t*)0x20000448 = 3; *(uint64_t*)0x20000450 = 7; *(uint64_t*)0x20000458 = 5; *(uint64_t*)0x20000460 = 0x10001; *(uint64_t*)0x20000468 = 0; *(uint64_t*)0x20000470 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(msgctl))(/*msqid=*/r[3], /*cmd=*/1, /*buf=*/0x20000400); break; case 10: memcpy((void*)0x20000080, "\xf0\x45\xff\x8a\x00\x00\x00\x00\x42\x0f\x58\x7c\xd1\x00\x36\x66\x0f\x1e\xef\x66\x0f\x38\x40\x46\x08\xc4\xa2\x7d\xb6\x9d\x8c\x0c\x59\x2c\xc4\xa3\x7d\x1d\x0d\x00\x00\x00\x00\x99\xc4\xe1\xfa\x2d\xca\xc4\x61\x40\xc2\x6f\x00\x04\xc4\xe1\xed\xe1\xf2\x36\xd9\xf7", 64); syz_execute_func(/*text=*/0x20000080); break; case 11: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x20000000, /*len=*/0x1000000, /*prot=*/3, /*flags=*/0x1012, /*fd=*/-1, /*offset=*/0); setup_fault(); use_temporary_dir(); loop(); return 0; } :318:39: error: use of undeclared identifier 'getrusage' ((intptr_t(*)(intptr_t,intptr_t))CAST(getrusage))(/*who=*/-1, /*usage=*/0x20000100); ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor1469926538 -DGOOS_openbsd=1 -DGOARCH_amd64=1 -DHOSTGOOS_openbsd=1 -x c - -m64 -static -lutil -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/2 (0.97s) csource_test.go:150: opts: {Threaded:true Repeat:false RepeatTimes:0 Procs:0 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: wait4(0xffffffffffffffff, &(0x7f0000000000), 0x2, &(0x7f0000000040)) (fail_nth: 1) getrusage(0xffffffffffffffff, &(0x7f0000000100)) (async) getsockopt(0xffffffffffffff9c, 0x860, 0xd710, &(0x7f00000001c0)=""/87, &(0x7f0000000240)=0x57) (rerun: 4) getgroups(0x7, &(0x7f0000000280)=[0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0x0, 0x0, 0xffffffffffffffff, 0xffffffffffffffff]) setsockopt$sock_cred(0xffffffffffffffff, 0xffff, 0x1022, &(0x7f00000002c0)={0x0, 0xffffffffffffffff, r1}, 0xc) setsockopt$sock_cred(0xffffffffffffffff, 0xffff, 0x1022, &(0x7f0000000300)={0x0, 0xffffffffffffffff, r0}, 0xc) getsockopt$sock_int(0xffffffffffffff9c, 0xffff, 0x1, &(0x7f0000000340), &(0x7f0000000380)=0x4) r3 = msgget$private(0x0, 0x602) r4 = geteuid() msgctl$IPC_SET(r3, 0x1, &(0x7f0000000400)={{0x3, r4, r2, 0xffffffffffffffff, 0x0, 0x6, 0x9}, 0x4, 0x334, 0x0, 0x0, 0x3, 0x7, 0x5, 0x10001}) syz_emit_ethernet(0x4f, &(0x7f0000000000)={@local, @remote, [], {@generic={0x828f, "5c411aa42a745b3f748ba559409d41f28903668249ef7aa3966e6fbad63bd3d75958db8dddc230ae169f470b952b4ca7557ba865e8f2eaf75f1bf240c9f7290016"}}}) syz_execute_func(&(0x7f0000000080)="f045ff8a00000000420f587cd10036660f1eef660f38404608c4a27db69d8c0c592cc4a37d1d0d0000000099c4e1fa2dcac46140c26f0004c4e1ede1f236d9f7") syz_extract_tcp_res(&(0x7f00000000c0), 0x0, 0x80) syz_open_pts() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { pthread_mutex_t mu; pthread_cond_t cv; int state; } event_t; static void event_init(event_t* ev) { if (pthread_mutex_init(&ev->mu, 0)) exit(1); if (pthread_cond_init(&ev->cv, 0)) exit(1); ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { pthread_mutex_lock(&ev->mu); if (ev->state) exit(1); ev->state = 1; pthread_mutex_unlock(&ev->mu); pthread_cond_broadcast(&ev->cv); } static void event_wait(event_t* ev) { pthread_mutex_lock(&ev->mu); while (!ev->state) pthread_cond_wait(&ev->cv, &ev->mu); pthread_mutex_unlock(&ev->mu); } static int event_isset(event_t* ev) { pthread_mutex_lock(&ev->mu); int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; pthread_mutex_lock(&ev->mu); for (;;) { if (ev->state) break; uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); now = current_time_ms(); if (now - start > timeout) break; } int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } #define CAST static uintptr_t syz_open_pts(void) { int master, slave; if (openpty(&master, &slave, NULL, NULL, NULL) == -1) return -1; if (dup2(master, master + 100) != -1) close(master); return slave; } static void sandbox_common() { struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = 8 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 0; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); } static void loop(); static int do_sandbox_none(void) { sandbox_common(); loop(); return 0; } static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void loop(void) { int i, call, thread; for (call = 0; call < 12; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); if (call == 1) break; event_timedwait(&th->done, 50); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } uint64_t r[5] = {0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(wait4))(/*pid=*/-1, /*status=*/0x20000000, /*options=*/2, /*ru=*/0x20000040); break; case 1: ((intptr_t(*)(intptr_t,intptr_t))CAST(getrusage))(/*who=*/-1, /*usage=*/0x20000100); break; case 2: *(uint32_t*)0x20000240 = 0x57; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0x860, /*optname=*/0xd710, /*optval=*/0x200001c0, /*optlen=*/0x20000240); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0x860, /*optname=*/0xd710, /*optval=*/0x200001c0, /*optlen=*/0x20000240); } } break; case 3: *(uint32_t*)0x20000280 = -1; *(uint32_t*)0x20000284 = -1; *(uint32_t*)0x20000288 = 0; *(uint32_t*)0x2000028c = 0; *(uint32_t*)0x20000290 = 0; *(uint32_t*)0x20000294 = -1; *(uint32_t*)0x20000298 = -1; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(getgroups))(/*size=*/7, /*list=*/0x20000280); if (res != -1) { r[0] = *(uint32_t*)0x2000028c; r[1] = *(uint32_t*)0x20000294; r[2] = *(uint32_t*)0x20000298; } break; case 4: *(uint32_t*)0x200002c0 = 0; *(uint32_t*)0x200002c4 = -1; *(uint32_t*)0x200002c8 = r[1]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(setsockopt))(/*fd=*/-1, /*level=*/0xffff, /*optname=*/0x1022, /*optval=*/0x200002c0, /*optlen=*/0xc); break; case 5: *(uint32_t*)0x20000300 = 0; *(uint32_t*)0x20000304 = -1; *(uint32_t*)0x20000308 = r[0]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(setsockopt))(/*fd=*/-1, /*level=*/0xffff, /*optname=*/0x1022, /*optval=*/0x20000300, /*optlen=*/0xc); break; case 6: *(uint32_t*)0x20000380 = 4; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/1, /*optval=*/0x20000340, /*optlen=*/0x20000380); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(msgget))(/*key=*/0, /*flags=*/0x602); if (res != -1) r[3] = res; break; case 8: res = -1; res = ((intptr_t(*)())CAST(geteuid))(); if (res != -1) r[4] = res; break; case 9: *(uint32_t*)0x20000400 = 3; *(uint32_t*)0x20000404 = r[4]; *(uint32_t*)0x20000408 = r[2]; *(uint32_t*)0x2000040c = -1; *(uint32_t*)0x20000410 = 0; *(uint32_t*)0x20000414 = 6; *(uint16_t*)0x20000418 = 9; *(uint16_t*)0x2000041a = 0; *(uint64_t*)0x20000420 = 0; *(uint64_t*)0x20000428 = 0; *(uint64_t*)0x20000430 = 4; *(uint64_t*)0x20000438 = 0x334; *(uint32_t*)0x20000440 = 0; *(uint32_t*)0x20000444 = 0; *(uint64_t*)0x20000448 = 3; *(uint64_t*)0x20000450 = 7; *(uint64_t*)0x20000458 = 5; *(uint64_t*)0x20000460 = 0x10001; *(uint64_t*)0x20000468 = 0; *(uint64_t*)0x20000470 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(msgctl))(/*msqid=*/r[3], /*cmd=*/1, /*buf=*/0x20000400); break; case 10: memcpy((void*)0x20000080, "\xf0\x45\xff\x8a\x00\x00\x00\x00\x42\x0f\x58\x7c\xd1\x00\x36\x66\x0f\x1e\xef\x66\x0f\x38\x40\x46\x08\xc4\xa2\x7d\xb6\x9d\x8c\x0c\x59\x2c\xc4\xa3\x7d\x1d\x0d\x00\x00\x00\x00\x99\xc4\xe1\xfa\x2d\xca\xc4\x61\x40\xc2\x6f\x00\x04\xc4\xe1\xed\xe1\xf2\x36\xd9\xf7", 64); syz_execute_func(/*text=*/0x20000080); break; case 11: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x20000000, /*len=*/0x1000000, /*prot=*/3, /*flags=*/0x1012, /*fd=*/-1, /*offset=*/0); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :260:57: error: use of undeclared identifier 'wait4'; did you mean 'write'? ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(wait4))(/*pid=*/-1, /*status=*/0x20000000, /*options=*/2, /*ru=*/0x20000040); ^~~~~ write /usr/include/unistd.h:373:10: note: 'write' declared here ssize_t write(int, const void *, size_t) ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor125657014 -DGOOS_openbsd=1 -DGOARCH_amd64=1 -DHOSTGOOS_openbsd=1 -x c - -m64 -static -lutil -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-but-set-variable -Wno-unused-command-line-argument] FAIL FAIL github.com/google/syzkaller/pkg/csource 18.726s ok github.com/google/syzkaller/pkg/db (cached) ok github.com/google/syzkaller/pkg/email (cached) ok github.com/google/syzkaller/pkg/email/lore (cached) ok github.com/google/syzkaller/pkg/host (cached) ok github.com/google/syzkaller/pkg/html (cached) ok github.com/google/syzkaller/pkg/ifuzz (cached) ok github.com/google/syzkaller/pkg/image (cached) ok github.com/google/syzkaller/pkg/instance (cached) ok github.com/google/syzkaller/pkg/ipc (cached) ok github.com/google/syzkaller/pkg/kconfig (cached) ok github.com/google/syzkaller/pkg/kd (cached) ok github.com/google/syzkaller/pkg/log (cached) ok github.com/google/syzkaller/pkg/mgrconfig (cached) ok github.com/google/syzkaller/pkg/osutil (cached) ok github.com/google/syzkaller/pkg/report (cached) ok github.com/google/syzkaller/pkg/repro (cached) ? github.com/google/syzkaller/pkg/signal [no test files] ? github.com/google/syzkaller/pkg/testutil [no test files] ? github.com/google/syzkaller/pkg/tools [no test files] ok github.com/google/syzkaller/pkg/runtest (cached) ok github.com/google/syzkaller/pkg/serializer (cached) ok github.com/google/syzkaller/pkg/stats (cached) ok github.com/google/syzkaller/pkg/subsystem (cached) ok github.com/google/syzkaller/pkg/subsystem/linux (cached) ok github.com/google/syzkaller/pkg/subsystem/lists (cached) ok github.com/google/syzkaller/pkg/symbolizer (cached) ok github.com/google/syzkaller/pkg/tool (cached) ok github.com/google/syzkaller/pkg/vcs (cached) ? github.com/google/syzkaller/sys [no test files] ? github.com/google/syzkaller/sys/akaros [no test files] ? github.com/google/syzkaller/sys/akaros/gen [no test files] ? github.com/google/syzkaller/sys/darwin [no test files] ? github.com/google/syzkaller/sys/freebsd [no test files] ? github.com/google/syzkaller/sys/freebsd/gen [no test files] ? github.com/google/syzkaller/sys/darwin/gen [no test files] ? github.com/google/syzkaller/sys/fuchsia [no test files] ? github.com/google/syzkaller/sys/fuchsia/gen [no test files] ? github.com/google/syzkaller/sys/fuchsia/layout [no test files] ok github.com/google/syzkaller/prog (cached) ? github.com/google/syzkaller/sys/fuchsia/fidlgen [no test files] ok github.com/google/syzkaller/prog/test (cached) ? github.com/google/syzkaller/sys/linux/gen [no test files] ok github.com/google/syzkaller/sys/linux (cached) ? github.com/google/syzkaller/sys/netbsd/gen [no test files] ok github.com/google/syzkaller/sys/netbsd (cached) ? github.com/google/syzkaller/sys/openbsd/gen [no test files] ok github.com/google/syzkaller/sys/openbsd (cached) ? github.com/google/syzkaller/sys/syz-extract [no test files] ? github.com/google/syzkaller/sys/syz-sysgen [no test files] ? github.com/google/syzkaller/sys/targets [no test files] ? github.com/google/syzkaller/sys/test [no test files] ? github.com/google/syzkaller/sys/trusty [no test files] ? github.com/google/syzkaller/sys/windows [no test files] ? github.com/google/syzkaller/sys/test/gen [no test files] ? github.com/google/syzkaller/sys/windows/gen [no test files] ? github.com/google/syzkaller/sys/trusty/gen [no test files] ok github.com/google/syzkaller/syz-ci (cached) ok github.com/google/syzkaller/syz-fuzzer (cached) ok github.com/google/syzkaller/syz-hub (cached) ? github.com/google/syzkaller/syz-runner [no test files] ? github.com/google/syzkaller/tools/syz-benchcmp [no test files] ? github.com/google/syzkaller/tools/syz-cover [no test files] ? github.com/google/syzkaller/tools/syz-build [no test files] ? github.com/google/syzkaller/tools/syz-check [no test files] ? github.com/google/syzkaller/tools/syz-bisect [no test files] ? github.com/google/syzkaller/tools/syz-db [no test files] ? github.com/google/syzkaller/tools/syz-crush [no test files] ? github.com/google/syzkaller/tools/syz-execprog [no test files] ok github.com/google/syzkaller/syz-hub/state (cached) ok github.com/google/syzkaller/syz-manager (cached) ok github.com/google/syzkaller/syz-verifier (cached) ? github.com/google/syzkaller/tools/syz-expand [no test files] ? github.com/google/syzkaller/tools/syz-fillreports [no test files] ? github.com/google/syzkaller/tools/syz-fmt [no test files] ? github.com/google/syzkaller/tools/syz-hubtool [no test files] ? github.com/google/syzkaller/tools/syz-kcidb [no test files] ok github.com/google/syzkaller/tools/syz-kconf (cached) ? github.com/google/syzkaller/tools/syz-lore [no test files] ? github.com/google/syzkaller/tools/syz-make [no test files] ? github.com/google/syzkaller/tools/syz-minconfig [no test files] ? github.com/google/syzkaller/tools/syz-mutate [no test files] ? github.com/google/syzkaller/tools/syz-query-subsystems [no test files] ? github.com/google/syzkaller/tools/syz-repro [no test files] ? github.com/google/syzkaller/tools/syz-prog2c [no test files] ? github.com/google/syzkaller/tools/syz-reporter [no test files] ok github.com/google/syzkaller/tools/syz-linter (cached) ? github.com/google/syzkaller/tools/syz-runtest [no test files] ? github.com/google/syzkaller/tools/syz-reprolist [no test files] ? github.com/google/syzkaller/tools/syz-showprio [no test files] ? github.com/google/syzkaller/tools/syz-stress [no test files] ? github.com/google/syzkaller/tools/syz-symbolize [no test files] ? github.com/google/syzkaller/tools/syz-testbed [no test files] ? github.com/google/syzkaller/tools/syz-testbuild [no test files] ? github.com/google/syzkaller/tools/syz-trace2syz [no test files] ? github.com/google/syzkaller/tools/syz-tty [no test files] ? github.com/google/syzkaller/tools/syz-upgrade [no test files] ? github.com/google/syzkaller/tools/syz-usbgen [no test files] ok github.com/google/syzkaller/tools/syz-trace2syz/parser (cached) ok github.com/google/syzkaller/tools/syz-trace2syz/proggen (cached) ? github.com/google/syzkaller/vm/adb [no test files] ? github.com/google/syzkaller/vm/bhyve [no test files] ? github.com/google/syzkaller/vm/cuttlefish [no test files] ? github.com/google/syzkaller/vm/gce [no test files] ? github.com/google/syzkaller/vm/gvisor [no test files] ok github.com/google/syzkaller/vm (cached) ? github.com/google/syzkaller/vm/kvm [no test files] ? github.com/google/syzkaller/vm/odroid [no test files] ok github.com/google/syzkaller/vm/isolated (cached) ? github.com/google/syzkaller/vm/proxyapp/mocks [no test files] ? github.com/google/syzkaller/vm/qemu [no test files] ? github.com/google/syzkaller/vm/proxyapp/proxyrpc [no test files] ? github.com/google/syzkaller/vm/starnix [no test files] ? github.com/google/syzkaller/vm/vmm [no test files] ? github.com/google/syzkaller/vm/vmware [no test files] ok github.com/google/syzkaller/vm/proxyapp (cached) ok github.com/google/syzkaller/vm/vmimpl (cached) FAIL