go: downloading k8s.io/apimachinery v0.32.1 go: downloading github.com/golang-migrate/migrate/v4 v4.18.2 go: downloading k8s.io/client-go v0.32.1 go: downloading k8s.io/api v0.32.1 go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.4.2 go: downloading sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 ? github.com/google/syzkaller/dashboard/api [no test files] ok github.com/google/syzkaller/dashboard/app 4.976s ok github.com/google/syzkaller/dashboard/dashapi 0.136s ok github.com/google/syzkaller/executor 2.218s ok github.com/google/syzkaller/pkg/asset 0.625s ok github.com/google/syzkaller/pkg/ast 2.426s ok github.com/google/syzkaller/pkg/auth 0.166s ? github.com/google/syzkaller/pkg/clangtool [no test files] ? github.com/google/syzkaller/pkg/coveragedb/spannerclient [no test files] ? github.com/google/syzkaller/pkg/coveragedb/mocks [no test files] ? github.com/google/syzkaller/pkg/covermerger/mocks [no test files] ? github.com/google/syzkaller/pkg/declextract [no test files] ? github.com/google/syzkaller/pkg/debugtracer [no test files] ? github.com/google/syzkaller/pkg/gcs [no test files] ? github.com/google/syzkaller/pkg/hash [no test files] ? github.com/google/syzkaller/pkg/ifaceprobe [no test files] ? github.com/google/syzkaller/pkg/ifuzz/arm64/gen [no test files] ? github.com/google/syzkaller/pkg/ifuzz/iset [no test files] ? github.com/google/syzkaller/pkg/ifuzz/powerpc [no test files] ? github.com/google/syzkaller/pkg/ifuzz/arm64/generated [no test files] ? github.com/google/syzkaller/pkg/ifuzz/powerpc/generated [no test files] ? github.com/google/syzkaller/pkg/ifuzz/x86 [no test files] ? github.com/google/syzkaller/pkg/ifuzz/x86/gen [no test files] ? github.com/google/syzkaller/pkg/ifuzz/x86/generated [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] ? github.com/google/syzkaller/pkg/rpcserver/mocks [no test files] ? github.com/google/syzkaller/pkg/stat/syzbotstats [no test files] ? github.com/google/syzkaller/pkg/testutil [no test files] ? github.com/google/syzkaller/pkg/tools [no test files] ? github.com/google/syzkaller/sys [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/fuchsia [no test files] ? github.com/google/syzkaller/sys/fuchsia/fidlgen [no test files] ? github.com/google/syzkaller/sys/fuchsia/layout [no test files] ? github.com/google/syzkaller/sys/generated [no test files] ? 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/syz-cluster/dashboard [no test files] ? github.com/google/syzkaller/syz-cluster/db-mgmt [no test files] ? github.com/google/syzkaller/syz-cluster/pkg/api [no test files] ? github.com/google/syzkaller/syz-cluster/pkg/app [no test files] ? github.com/google/syzkaller/syz-cluster/pkg/workflow [no test files] ? github.com/google/syzkaller/syz-cluster/workflow/boot-step [no test files] ? github.com/google/syzkaller/syz-cluster/workflow/build-step [no test files] ? github.com/google/syzkaller/syz-cluster/workflow/triage-step [no test files] ? github.com/google/syzkaller/tools/syz-bisect [no test files] ? github.com/google/syzkaller/tools/arm64 [no test files] ? github.com/google/syzkaller/tools/syz-check [no test files] ? github.com/google/syzkaller/tools/syz-build [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-covermerger [no test files] ? github.com/google/syzkaller/tools/syz-crush [no test files] ? github.com/google/syzkaller/tools/syz-db-export [no test files] ? github.com/google/syzkaller/tools/syz-diff [no test files] ? github.com/google/syzkaller/tools/syz-execprog [no test files] ? github.com/google/syzkaller/tools/syz-fix-analyzer [no test files] ? github.com/google/syzkaller/tools/syz-fillreports [no test files] ? github.com/google/syzkaller/tools/syz-expand [no test files] ? github.com/google/syzkaller/tools/syz-fmt [no test files] ? github.com/google/syzkaller/tools/syz-gemini-seed [no test files] ? github.com/google/syzkaller/tools/syz-kcidb [no test files] ? github.com/google/syzkaller/tools/syz-hubtool [no test files] ? 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-prog2c [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-showprio [no test files] ? github.com/google/syzkaller/tools/syz-reporter [no test files] ? github.com/google/syzkaller/tools/syz-symbolize [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-usbgen [no test files] ? github.com/google/syzkaller/tools/syz-upgrade [no test files] ? 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/pkg/bisect 222.456s ok github.com/google/syzkaller/pkg/bisect/minimize 0.393s ok github.com/google/syzkaller/pkg/build 7.374s ok github.com/google/syzkaller/pkg/compiler 21.029s ok github.com/google/syzkaller/pkg/config 0.202s ok github.com/google/syzkaller/pkg/corpus 8.287s ok github.com/google/syzkaller/pkg/cover 6.403s ok github.com/google/syzkaller/pkg/cover/backend 6.240s ok github.com/google/syzkaller/pkg/coveragedb 0.596s ok github.com/google/syzkaller/pkg/covermerger 2.034s --- FAIL: TestGenerate (13.47s) --- FAIL: TestGenerate/openbsd/amd64 (0.01s) testutil.go:35: seed=1738768547500436788 testutil.go:35: seed=1738768547514878028 --- FAIL: TestGenerate/openbsd/amd64/5 (2.89s) csource_test.go:151: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:4 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #include static unsigned long long procid; 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 const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); for (procid = 0; procid < 4; procid++) { if (fork() == 0) { use_temporary_dir(); do_sandbox_none(); } } sleep(1000000); return 0; } :348:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor386190563 -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/4 (2.79s) csource_test.go:151: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:1 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #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 const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); use_temporary_dir(); do_sandbox_none(); return 0; } :346:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor4099505821 -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 (2.81s) csource_test.go:151: 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); use_temporary_dir(); do_sandbox_none(); return 0; } :266:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor2063040977 -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/12 (3.31s) csource_test.go:151: opts: {Threaded:true Repeat:true 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:false HandleSegv:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #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 int inject_fault(int nth) { return 0; } static const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); do_sandbox_none(); return 0; } :293:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor25451007 -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/3 (3.31s) csource_test.go:151: opts: {Threaded:true Repeat:true RepeatTimes:10 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #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 const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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 < 10; 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); use_temporary_dir(); do_sandbox_none(); return 0; } :346:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor1337794488 -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/0 (3.44s) csource_test.go:151: opts: {Threaded:false Repeat:true 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 const char* setup_fault() { return NULL; } #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() { if (setsid() == -1 && errno != EPERM) exit(1); 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 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {} memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); ((intptr_t(*)())CAST(getpid))(); memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); syz_open_pts(); } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); use_temporary_dir(); do_sandbox_none(); return 0; } :200:2: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor370594228 -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/15 (3.61s) csource_test.go:151: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:2 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #include static unsigned long long procid; 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 const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); for (procid = 0; procid < 2; procid++) { if (fork() == 0) { use_temporary_dir(); do_sandbox_none(); } } sleep(1000000); return 0; } :348:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor1739577123 -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/9 (4.01s) csource_test.go:151: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox:none SandboxArg:-9223372036854775808 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #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 const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); use_temporary_dir(); do_sandbox_none(); return 0; } :346:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor483520498 -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/14 (4.14s) csource_test.go:151: opts: {Threaded:true Repeat:true 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 Trace:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #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 const char* setup_fault() { return NULL; } 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; } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } fprintf(stderr, "### start\n"); int i, call, thread; for (call = 0; call < 11; 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); fprintf(stderr, "### call=0 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); fprintf(stderr, "### call=1 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); res = -1; errno = EFAULT; NONFAILING(res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ fprintf(stderr, "### call=2 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); fprintf(stderr, "### call=3 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); fprintf(stderr, "### call=4 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); fprintf(stderr, "### call=5 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); fprintf(stderr, "### call=6 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 7: res = -1; errno = EFAULT; res = ((intptr_t(*)())CAST(getpid))(); fprintf(stderr, "### call=7 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); res = -1; errno = EFAULT; NONFAILING(res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ fprintf(stderr, "### call=8 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); fprintf(stderr, "### call=9 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 10: res = -1; errno = EFAULT; res = syz_open_pts(); fprintf(stderr, "### call=10 errno=%u\n", res == -1 ? errno : 0); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); use_temporary_dir(); do_sandbox_none(); return 0; } :355:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor3111866841 -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/8 (1.57s) csource_test.go:151: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox:setuid 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 Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: readlink(&(0x7f0000000000)='./file0\x00', &(0x7f0000000040)=""/73, 0x49) (fail_nth: 1) mkdir(&(0x7f00000000c0)='./file0\x00', 0x61) (async) mknod(&(0x7f0000000100)='./file0\x00', 0x8, 0x7) (rerun: 4) rename(&(0x7f0000000140)='./file0\x00', &(0x7f0000000180)='./file0\x00') r0 = accept$unix(0xffffffffffffff9c, &(0x7f00000001c0)=@file={0x0, ""/66}, &(0x7f0000000240)=0x44) recvmsg(r0, &(0x7f0000000400)={0x0, 0x0, &(0x7f0000000340)=[{&(0x7f0000000280)=""/169, 0xa9}], 0x1, &(0x7f0000000380)=""/89, 0x59}, 0x1000) getpeername$unix(r0, &(0x7f0000000440)=@file={0x0, ""/504}, &(0x7f0000000640)=0x1fa) getpid() mknod(&(0x7f0000000680)='./file0\x00', 0x2000, 0x0) ioctl$WSDISPLAYIO_ADDSCREEN(0xffffffffffffff9c, 0x80245753, &(0x7f00000006c0)={0x0, './file0\x00', './file0\x00'}) syz_emit_ethernet(0x57, &(0x7f0000000000)={@remote, @remote, [{[], {0x8100, 0x0, 0x1, 0x3}}], {@generic={0x80d5, "a61327c722e4890bd72dc57d8f583cf0400a3566fb2ffed2f8119d7f2785f404f1c290034ce1c87850194b4d6af1cc40b8f14371f75accc390f19fa02aaf6d89c2c996e884"}}}) syz_extract_tcp_res(&(0x7f0000000080), 0x3, 0x84) syz_open_pts() csource_test.go:152: 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 #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 const char* setup_fault() { return NULL; } 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 wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, WUNTRACED) != pid) { } return WEXITSTATUS(status); } static int do_sandbox_setuid(void) { int pid = fork(); if (pid != 0) return wait_for_loop(pid); sandbox_common(); char pwbuf[1024]; struct passwd *pw, pwres; if (getpwnam_r("nobody", &pwres, pwbuf, sizeof(pwbuf), &pw) != 0 || !pw) exit(1); if (setgroups(0, NULL)) exit(1); if (setgid(pw->pw_gid)) exit(1); if (setuid(pw->pw_uid)) exit(1); loop(); exit(1); } 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) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 11; 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: memcpy((void*)0x200000000000, "./file0\000", 8); inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(readlink))(/*path=*/0x200000000000, /*buf=*/0x200000000040, /*siz=*/0x49); break; case 1: memcpy((void*)0x2000000000c0, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(mkdir))(/*path=*/0x2000000000c0, /*mode=S_IXOTH|S_IRGRP|S_IXUSR*/0x61); break; case 2: memcpy((void*)0x200000000100, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ for (int i = 0; i < 4; i++) { NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ } break; case 3: memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000180, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t))CAST(rename))(/*old=*/0x200000000140, /*new=*/0x200000000180); break; case 4: *(uint32_t*)0x200000000240 = 0x44; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(accept))(/*fd=*/0xffffff9c, /*peer=*/0x2000000001c0, /*peerlen=*/0x200000000240); if (res != -1) r[0] = res; break; case 5: *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 0; *(uint64_t*)0x200000000410 = 0x200000000340; *(uint64_t*)0x200000000340 = 0x200000000280; *(uint64_t*)0x200000000348 = 0xa9; *(uint64_t*)0x200000000418 = 1; *(uint64_t*)0x200000000420 = 0x200000000380; *(uint64_t*)0x200000000428 = 0x59; *(uint32_t*)0x200000000430 = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(recvmsg))(/*fd=*/r[0], /*msg=*/0x200000000400, /*f=MSG_WAITFORONE*/0x1000); break; case 6: *(uint32_t*)0x200000000640 = 0x1fa; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(getpeername))(/*fd=*/r[0], /*peer=*/0x200000000440, /*peerlen=*/0x200000000640); break; case 7: ((intptr_t(*)())CAST(getpid))(); break; case 8: memcpy((void*)0x200000000680, "./file0\000", 8); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000680, /*mode=S_IFCHR*/0x2000, /*dev=*/0)); /* major = 0, minor = 0 */ break; case 9: *(uint32_t*)0x2000000006c0 = 0; memcpy((void*)0x2000000006c4, "./file0\000\000\000\000\000\000\000\000\000", 16); memcpy((void*)0x2000000006d4, "./file0\000\000\000\000\000\000\000\000\000", 16); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(ioctl))(/*fd=*/0xffffff9c, /*cmd=*/0x80245753, /*arg=*/0x2000000006c0); break; case 10: syz_open_pts(); break; } } int main(void) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(mmap))(/*addr=*/0x200000000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ*/3, /*flags=MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE*/0x1012, /*fd=*/-1, /*offset=*/0); const char* reason; (void)reason; if ((reason = setup_fault())) printf("the reproducer may not work as expected: fault injection setup failed: %s\n", reason); use_temporary_dir(); do_sandbox_setuid(); return 0; } :369:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x200000000100, /*mode=*/8, /*dev=*/7)); /* major = 0, minor = 7 */ ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor4145049156 -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/11 (1.66s) csource_test.go:149: --- FAIL: TestGenerate/openbsd/amd64/10 (1.40s) csource_test.go:149: --- FAIL: TestGenerate/openbsd/amd64/7 (1.91s) csource_test.go:149: --- FAIL: TestGenerate/openbsd/amd64/1 (1.75s) csource_test.go:149: --- FAIL: TestGenerate/openbsd/amd64/6 (1.69s) csource_test.go:149: FAIL FAIL github.com/google/syzkaller/pkg/csource 30.301s ok github.com/google/syzkaller/pkg/db 3.944s ok github.com/google/syzkaller/pkg/email 0.264s ok github.com/google/syzkaller/pkg/email/lore 0.429s ok github.com/google/syzkaller/pkg/flatrpc 0.141s ok github.com/google/syzkaller/pkg/fuzzer 10.650s ok github.com/google/syzkaller/pkg/fuzzer/queue 0.524s ok github.com/google/syzkaller/pkg/gce 0.259s ok github.com/google/syzkaller/pkg/html 0.384s ok github.com/google/syzkaller/pkg/html/pages 0.313s ok github.com/google/syzkaller/pkg/ifuzz 3.028s ok github.com/google/syzkaller/pkg/ifuzz/arm64 0.114s ok github.com/google/syzkaller/pkg/image 16.400s ok github.com/google/syzkaller/pkg/instance 8.531s ok github.com/google/syzkaller/pkg/kconfig 0.344s ok github.com/google/syzkaller/pkg/kd 0.141s ok github.com/google/syzkaller/pkg/log 0.134s ok github.com/google/syzkaller/pkg/manager 13.204s ok github.com/google/syzkaller/pkg/mgrconfig 13.768s ok github.com/google/syzkaller/pkg/osutil 5.071s ok github.com/google/syzkaller/pkg/report 27.242s ok github.com/google/syzkaller/pkg/repro 12.383s ok github.com/google/syzkaller/pkg/rpcserver 12.916s ok github.com/google/syzkaller/pkg/runtest 50.643s ok github.com/google/syzkaller/pkg/serializer 0.382s ok github.com/google/syzkaller/pkg/signal 0.124s ok github.com/google/syzkaller/pkg/stat 1.486s ok github.com/google/syzkaller/pkg/stat/sample 0.851s ok github.com/google/syzkaller/pkg/subsystem 0.119s ok github.com/google/syzkaller/pkg/subsystem/linux 0.670s ok github.com/google/syzkaller/pkg/subsystem/lists 1.383s ok github.com/google/syzkaller/pkg/symbolizer 0.617s ok github.com/google/syzkaller/pkg/tool 0.519s ok github.com/google/syzkaller/pkg/validator 0.447s ok github.com/google/syzkaller/pkg/vcs 121.226s ok github.com/google/syzkaller/pkg/vminfo 26.522s ok github.com/google/syzkaller/prog 136.717s ok github.com/google/syzkaller/prog/test 23.582s ok github.com/google/syzkaller/sys/linux 22.143s ok github.com/google/syzkaller/sys/netbsd 22.622s ok github.com/google/syzkaller/sys/openbsd 18.048s ok github.com/google/syzkaller/syz-ci 71.031s ok github.com/google/syzkaller/syz-cluster/controller 0.783s ok github.com/google/syzkaller/syz-cluster/pkg/blob 0.461s ok github.com/google/syzkaller/syz-cluster/pkg/db 0.476s ok github.com/google/syzkaller/syz-cluster/pkg/triage 17.495s ok github.com/google/syzkaller/syz-cluster/series-tracker 1.144s ok github.com/google/syzkaller/syz-cluster/workflow/fuzz-step 6.068s ok github.com/google/syzkaller/syz-hub 0.289s ok github.com/google/syzkaller/syz-hub/state 1.120s ok github.com/google/syzkaller/syz-manager 5.566s ok github.com/google/syzkaller/tools/syz-db 6.315s ok github.com/google/syzkaller/tools/syz-declextract 5.973s ok github.com/google/syzkaller/tools/syz-kconf 0.230s ok github.com/google/syzkaller/tools/syz-linter 2.524s ? github.com/google/syzkaller/vm/proxyapp/mocks [no test files] ? github.com/google/syzkaller/vm/starnix [no test files] ? github.com/google/syzkaller/vm/qemu [no test files] ? github.com/google/syzkaller/vm/proxyapp/proxyrpc [no test files] ok github.com/google/syzkaller/tools/syz-testbed 6.002s ok github.com/google/syzkaller/tools/syz-trace2syz/parser 5.385s ? github.com/google/syzkaller/vm/vmm [no test files] ? github.com/google/syzkaller/vm/vmware [no test files] ok github.com/google/syzkaller/tools/syz-trace2syz/proggen 6.890s ok github.com/google/syzkaller/vm 16.423s ok github.com/google/syzkaller/vm/dispatcher 0.675s ok github.com/google/syzkaller/vm/isolated 3.660s ok github.com/google/syzkaller/vm/proxyapp 5.445s ok github.com/google/syzkaller/vm/vmimpl 2.471s FAIL