go: downloading github.com/argoproj/argo-workflows/v3 v3.7.0 go: downloading k8s.io/apimachinery v0.33.1 go: downloading k8s.io/client-go v0.33.1 go: downloading k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 go: downloading sigs.k8s.io/randfill v1.0.0 go: downloading sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 go: downloading github.com/fxamacker/cbor/v2 v2.8.0 go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.7.0 go: downloading k8s.io/api v0.33.1 go: downloading k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff go: downloading github.com/google/gnostic-models v0.6.9 go: downloading github.com/emicklei/go-restful/v3 v3.12.2 go: downloading github.com/go-openapi/jsonreference v0.21.0 go: downloading github.com/go-openapi/swag v0.23.1 go: downloading github.com/go-openapi/jsonpointer v0.21.1 go: downloading github.com/mailru/easyjson v0.9.0 ? github.com/google/syzkaller/dashboard/api [no test files] ok github.com/google/syzkaller/dashboard/app 3.148s ok github.com/google/syzkaller/dashboard/dashapi (cached) ok github.com/google/syzkaller/executor 2.045s ok github.com/google/syzkaller/pkg/asset 0.557s ok github.com/google/syzkaller/pkg/ast 2.267s ok github.com/google/syzkaller/pkg/auth (cached) ok github.com/google/syzkaller/pkg/bisect 209.470s ok github.com/google/syzkaller/pkg/bisect/minimize (cached) ok github.com/google/syzkaller/pkg/build 6.966s ? github.com/google/syzkaller/pkg/clangtool [no test files] ok github.com/google/syzkaller/pkg/compiler 24.319s ok github.com/google/syzkaller/pkg/config (cached) ok github.com/google/syzkaller/pkg/corpus 6.642s ok github.com/google/syzkaller/pkg/cover 4.880s ok github.com/google/syzkaller/pkg/cover/backend 8.574s ok github.com/google/syzkaller/pkg/coveragedb 0.715s ? github.com/google/syzkaller/pkg/coveragedb/mocks [no test files] ? github.com/google/syzkaller/pkg/coveragedb/spannerclient [no test files] ok github.com/google/syzkaller/pkg/covermerger 3.859s ? github.com/google/syzkaller/pkg/covermerger/mocks [no test files] --- FAIL: TestGenerate (16.67s) --- FAIL: TestGenerate/openbsd/amd64 (0.02s) testutil.go:35: seed=1754039393225023566 testutil.go:35: seed=1754039393245323203 --- FAIL: TestGenerate/openbsd/amd64/5 (1.95s) csource_test.go:149: 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :383:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 383 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor142596085 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/3 (1.95s) csource_test.go:149: 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :381:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 381 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor76275183 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/12 (2.84s) csource_test.go:149: 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :328:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 328 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor3721901007 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/15 (3.18s) csource_test.go:149: 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :383:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 383 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor2085950698 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/8 (3.54s) csource_test.go:149: 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :404:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 404 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor782245747 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/7 (3.55s) csource_test.go:149: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:true HandleSegv:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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; } 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; } 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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(); loop(); return 0; } :356:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 356 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor1737567821 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/6 (3.67s) csource_test.go:149: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:10 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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, 500); 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 < 15000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :381:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 381 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor1627868272 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/2 (3.67s) csource_test.go:149: 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :301:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 301 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor448670889 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/4 (3.79s) csource_test.go:149: 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: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :381:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 381 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor2693536932 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/1 (3.82s) csource_test.go:149: 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:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: getsockopt$sock_linger(0xffffffffffffff9c, 0xffff, 0x80, &(0x7f0000000000), &(0x7f0000000040)=0x8) (fail_nth: 1) sendto(0xffffffffffffff9c, &(0x7f0000000080)="933c24e0977f47a4e07e47a4774b794f37247377b0c1df49fd34a2d01e48a6022cbc48fea0559442215bf89c8a53bc5ffefc8d33f08a43fecb8dfd4fac13009161fd00373907268fe5085d40d0e8d497ce33d993f7f49ea38f98d5fc5a54cf873c5a01f816cbdd952b7cf0fe62d4ecc769bef3c1b55d5cd8dd1c29", 0x7b, 0xd, &(0x7f0000000100)=@un=@file={0x0, './file0\x00'}, 0xa) (async) r0 = open$dir(&(0x7f0000000140)='./file0\x00', 0x100, 0x13a) (rerun: 4) openat(r0, &(0x7f0000000180)='./file1\x00', 0x80, 0x2) chroot(&(0x7f00000001c0)='./file1\x00') open(&(0x7f0000000200)='./file1\x00', 0x40, 0x73) r1 = openat$wsmuxmouse(0xffffffffffffff9c, &(0x7f0000000240), 0x200, 0x0) unlinkat(r1, &(0x7f0000000280)='./file0\x00', 0x0) mknod(&(0x7f00000002c0)='./file1/file0\x00', 0x120, 0x7fffffff) chdir(&(0x7f0000000300)='./file1/file0\x00') syz_emit_ethernet(0x13e, &(0x7f0000000000)={@empty, @local, [], {@ipv4={0x800, {{0xe, 0x4, 0x1, 0x3c, 0x130, 0x65, 0x5, 0x87, 0xc, 0x0, @broadcast, @empty, {[@rr={0x7, 0x23, 0x3, [@remote={0xac, 0x14, 0x0}, @multicast2, @remote={0xac, 0x14, 0x0}, @rand_addr=0xa3, @loopback, @empty, @multicast1, @multicast2]}]}}, @generic="5a58660746365d41ee10d4e5f113eec438fab21ee7ddc7dce7e2b276259c58c416b7b9eb100af76894fdd0bb847c736def47c7a5c88f8055e0678efb445274aab87f4582a687a121f9255191091e6905d6489ad65cf1a24983a9353ea65eb8a16d8c95c7e92df808df2c973e51608f5aeec42e9fe4c444e3e5d983814e74e611bc21232b513f6dc9eba51faca6acf356bb0998aab342b2f230a1cde165ebcbd1177b3526020074a9326c1c0e6678655ab316699386ed9bd844bf70343efbbe27322326cf39712c13bd2767c90205c76284a5abc1d2c1f72d37adf56303f31da6ba0677f6aa1198e222a497ffbf83ae5abbb352c807a862c2"}}}}) syz_extract_tcp_res(&(0x7f0000000140), 0x1cbc, 0x2f9) syz_open_pts() csource_test.go:150: 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint32_t*)0x200000000040 = 8; inject_fault(1); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(getsockopt))(/*fd=*/0xffffff9c, /*level=*/0xffff, /*optname=*/0x80, /*optval=*/0x200000000000, /*optlen=*/0x200000000040); break; case 1: memcpy((void*)0x200000000080, "\x93\x3c\x24\xe0\x97\x7f\x47\xa4\xe0\x7e\x47\xa4\x77\x4b\x79\x4f\x37\x24\x73\x77\xb0\xc1\xdf\x49\xfd\x34\xa2\xd0\x1e\x48\xa6\x02\x2c\xbc\x48\xfe\xa0\x55\x94\x42\x21\x5b\xf8\x9c\x8a\x53\xbc\x5f\xfe\xfc\x8d\x33\xf0\x8a\x43\xfe\xcb\x8d\xfd\x4f\xac\x13\x00\x91\x61\xfd\x00\x37\x39\x07\x26\x8f\xe5\x08\x5d\x40\xd0\xe8\xd4\x97\xce\x33\xd9\x93\xf7\xf4\x9e\xa3\x8f\x98\xd5\xfc\x5a\x54\xcf\x87\x3c\x5a\x01\xf8\x16\xcb\xdd\x95\x2b\x7c\xf0\xfe\x62\xd4\xec\xc7\x69\xbe\xf3\xc1\xb5\x5d\x5c\xd8\xdd\x1c\x29", 123); *(uint16_t*)0x200000000100 = 0; memcpy((void*)0x200000000102, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(sendto))(/*fd=*/0xffffff9c, /*buf=*/0x200000000080, /*len=*/0x7b, /*f=MSG_EOR|MSG_DONTROUTE|MSG_OOB*/0xd, /*addr=*/0x200000000100, /*addrlen=*/0xa); break; case 2: memcpy((void*)0x200000000140, "./file0\000", 8); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); for (int i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000140, /*flags=O_NOFOLLOW*/0x100, /*mode=S_IWOTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IRUSR*/0x13a); } if (res != -1) r[0] = res; break; case 3: memcpy((void*)0x200000000180, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/r[0], /*file=*/0x200000000180, /*flags=O_RSYNC*/0x80, /*mode=S_IWOTH*/2); break; case 4: memcpy((void*)0x2000000001c0, "./file1\000", 8); ((intptr_t(*)(intptr_t))CAST(chroot))(/*dir=*/0x2000000001c0); break; case 5: memcpy((void*)0x200000000200, "./file1\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(open))(/*file=*/0x200000000200, /*flags=O_ASYNC*/0x40, /*mode=S_IXOTH|S_IWOTH|S_IWGRP|S_IRGRP|S_IXUSR*/0x73); break; case 6: memcpy((void*)0x200000000240, "/dev/wsmouse\000", 13); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(openat))(/*fd=*/0xffffffffffffff9c, /*file=*/0x200000000240, /*flags=O_CREAT*/0x200, /*mode=*/0); if (res != -1) r[1] = res; break; case 7: memcpy((void*)0x200000000280, "./file0\000", 8); ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(unlinkat))(/*fd=*/r[1], /*path=*/0x200000000280, /*flags=*/0); break; case 8: memcpy((void*)0x2000000002c0, "./file1/file0\000", 14); NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ break; case 9: memcpy((void*)0x200000000300, "./file1/file0\000", 14); ((intptr_t(*)(intptr_t))CAST(chdir))(/*dir=*/0x200000000300); 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; } :381:3: error: call to undeclared function 'NONFAILING'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 381 | NONFAILING(((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(mknod))(/*file=*/0x2000000002c0, /*mode=*/0x120, /*dev=*/0x7fffffff)); /* major = 255, minor = 8388607 */ | ^ 1 error generated. compiler invocation: c++ [-o /tmp/syz-executor1190343117 -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-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument] --- FAIL: TestGenerate/openbsd/amd64/0 (4.11s) csource_test.go:147: --- FAIL: TestGenerate/openbsd/amd64/9 (4.46s) csource_test.go:147: --- FAIL: TestGenerate/openbsd/amd64/14 (0.92s) csource_test.go:147: --- FAIL: TestGenerate/openbsd/amd64/11 (3.16s) csource_test.go:147: --- FAIL: TestGenerate/openbsd/amd64/10 (3.22s) csource_test.go:147: FAIL FAIL github.com/google/syzkaller/pkg/csource 37.399s ok github.com/google/syzkaller/pkg/db 4.519s ? github.com/google/syzkaller/pkg/debugtracer [no test files] ? github.com/google/syzkaller/pkg/declextract [no test files] ok github.com/google/syzkaller/pkg/email (cached) ok github.com/google/syzkaller/pkg/email/lore 0.346s ok github.com/google/syzkaller/pkg/flatrpc 0.338s ok github.com/google/syzkaller/pkg/fuzzer 8.408s ok github.com/google/syzkaller/pkg/fuzzer/queue 0.708s ok github.com/google/syzkaller/pkg/gce 0.752s ? github.com/google/syzkaller/pkg/gcs [no test files] ? github.com/google/syzkaller/pkg/gcs/mocks [no test files] ? github.com/google/syzkaller/pkg/hash [no test files] ? github.com/google/syzkaller/pkg/html [no test files] ok github.com/google/syzkaller/pkg/html/pages 0.369s ok github.com/google/syzkaller/pkg/html/urlutil (cached) ? github.com/google/syzkaller/pkg/ifaceprobe [no test files] ok github.com/google/syzkaller/pkg/ifuzz (cached) ok github.com/google/syzkaller/pkg/ifuzz/arm64 (cached) ? github.com/google/syzkaller/pkg/ifuzz/arm64/gen [no test files] ? github.com/google/syzkaller/pkg/ifuzz/arm64/generated [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/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] ok github.com/google/syzkaller/pkg/image 19.437s ok github.com/google/syzkaller/pkg/instance 18.209s ? github.com/google/syzkaller/pkg/kcidb [no test files] ok github.com/google/syzkaller/pkg/kconfig 0.948s ok github.com/google/syzkaller/pkg/kd (cached) ok github.com/google/syzkaller/pkg/log (cached) 2025/08/01 02:10:09 adding modified_functions to focus areas: ["function"] 2025/08/01 02:10:09 failed to grep for the header usages: failed to run ["/usr/bin/grep" "-rl" "--include" "*.c" ""]: exit status 2 grep: unknown option -- include usage: grep [-abcEFGHhIiLlnoqRsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [-m num] [--binary-files=value] [--context[=num]] [--label=name] [--line-buffered] [--null] [pattern] [file ...] 2025/08/01 02:10:09 adding directly modified files to focus areas: ["b.c" "header.h"] --- FAIL: TestPatchFocusAreas (0.14s) diff_test.go:54: Error Trace: /syzkaller/gopath/src/github.com/google/syzkaller/pkg/manager/diff_test.go:54 Error: Not equal: expected: []mgrconfig.FocusArea{mgrconfig.FocusArea{Name:"symbols", Filter:mgrconfig.CovFilterCfg{Files:[]string(nil), Functions:[]string{"function"}, RawPCs:[]string(nil)}, Weight:6}, mgrconfig.FocusArea{Name:"files", Filter:mgrconfig.CovFilterCfg{Files:[]string{"b.c", "header.h"}, Functions:[]string(nil), RawPCs:[]string(nil)}, Weight:3}, mgrconfig.FocusArea{Name:"included", Filter:mgrconfig.CovFilterCfg{Files:[]string{"a.c"}, Functions:[]string(nil), RawPCs:[]string(nil)}, Weight:2}, mgrconfig.FocusArea{Name:"", Filter:mgrconfig.CovFilterCfg{Files:[]string(nil), Functions:[]string(nil), RawPCs:[]string(nil)}, Weight:1}} actual : []mgrconfig.FocusArea{mgrconfig.FocusArea{Name:"symbols", Filter:mgrconfig.CovFilterCfg{Files:[]string(nil), Functions:[]string{"function"}, RawPCs:[]string(nil)}, Weight:6}, mgrconfig.FocusArea{Name:"files", Filter:mgrconfig.CovFilterCfg{Files:[]string{"b.c", "header.h"}, Functions:[]string(nil), RawPCs:[]string(nil)}, Weight:3}, mgrconfig.FocusArea{Name:"", Filter:mgrconfig.CovFilterCfg{Files:[]string(nil), Functions:[]string(nil), RawPCs:[]string(nil)}, Weight:1}} Diff: --- Expected +++ Actual @@ -1,2 +1,2 @@ -([]mgrconfig.FocusArea) (len=4) { +([]mgrconfig.FocusArea) (len=3) { (mgrconfig.FocusArea) { @@ -25,13 +25,2 @@ (mgrconfig.FocusArea) { - Name: (string) (len=8) "included", - Filter: (mgrconfig.CovFilterCfg) { - Files: ([]string) (len=1) { - (string) (len=3) "a.c" - }, - Functions: ([]string) , - RawPCs: ([]string) - }, - Weight: (float64) 2 - }, - (mgrconfig.FocusArea) { Name: (string) "", Test: TestPatchFocusAreas 2025/08/01 02:10:09 starting bug reproductions (max 3 VMs, 2 repros) 2025/08/01 02:10:09 start reproducing 'A' 2025/08/01 02:10:09 start reproducing 'B' 2025/08/01 02:10:09 repro finished 'A', repro=false crepro=false desc='' hub=false from_dashboard=false 2025/08/01 02:10:09 repro finished 'B', repro=false crepro=false desc='' hub=false from_dashboard=false 2025/08/01 02:10:09 starting bug reproductions (max 1 VMs, 1 repros) 2025/08/01 02:10:09 start reproducing 'A' 2025/08/01 02:10:09 repro finished 'A', repro=false crepro=false desc='' hub=false from_dashboard=true 2025/08/01 02:10:09 start reproducing 'B' 2025/08/01 02:10:09 repro finished 'B', repro=false crepro=false desc='' hub=false from_dashboard=true 2025/08/01 02:10:09 start reproducing 'C' 2025/08/01 02:10:09 repro finished 'C', repro=false crepro=false desc='' hub=true from_dashboard=false 2025/08/01 02:10:09 start reproducing 'A' 2025/08/01 02:10:09 repro finished 'A', repro=false crepro=false desc='' hub=false from_dashboard=true 2025/08/01 02:10:09 start reproducing 'B' 2025/08/01 02:10:09 repro finished 'B', repro=false crepro=false desc='' hub=false from_dashboard=true 2025/08/01 02:10:09 start reproducing 'C' 2025/08/01 02:10:09 starting bug reproductions (max 3 VMs, 2 repros) 2025/08/01 02:10:09 start reproducing 'A' 2025/08/01 02:10:09 repro finished 'A', repro=false crepro=false desc='' hub=false from_dashboard=false 2025/08/01 02:10:09 repro finished 'C', repro=false crepro=false desc='' hub=true from_dashboard=false 2025/08/01 02:10:10 starting bug reproductions (max 1 VMs, 1 repros) 2025/08/01 02:10:10 start reproducing 'A' 2025/08/01 02:10:10 repro finished 'A', repro=false crepro=false desc='' hub=false from_dashboard=false 2025/08/01 02:10:10 starting bug reproductions (max 1 VMs, 1 repros) 2025/08/01 02:10:10 start reproducing 'C' 2025/08/01 02:10:10 repro finished 'C', repro=false crepro=false desc='' hub=false from_dashboard=false FAIL FAIL github.com/google/syzkaller/pkg/manager 12.124s ok github.com/google/syzkaller/pkg/mgrconfig 11.825s ok github.com/google/syzkaller/pkg/osutil (cached) ok github.com/google/syzkaller/pkg/report 25.994s ? github.com/google/syzkaller/pkg/report/crash [no test files] ok github.com/google/syzkaller/pkg/repro 17.381s ok github.com/google/syzkaller/pkg/rpcserver 11.894s ? github.com/google/syzkaller/pkg/rpcserver/mocks [no test files] ? github.com/google/syzkaller/pkg/rpctype [no test files] ok github.com/google/syzkaller/pkg/runtest 61.291s ok github.com/google/syzkaller/pkg/serializer (cached) ok github.com/google/syzkaller/pkg/signal (cached) ok github.com/google/syzkaller/pkg/stat 1.308s ok github.com/google/syzkaller/pkg/stat/sample (cached) ? github.com/google/syzkaller/pkg/stat/syzbotstats [no test files] ok github.com/google/syzkaller/pkg/subsystem 0.256s ok github.com/google/syzkaller/pkg/subsystem/linux 0.677s ok github.com/google/syzkaller/pkg/subsystem/lists 0.716s ok github.com/google/syzkaller/pkg/symbolizer 0.414s ? github.com/google/syzkaller/pkg/testutil [no test files] ok github.com/google/syzkaller/pkg/tool 0.182s ok github.com/google/syzkaller/pkg/validator 1.175s ok github.com/google/syzkaller/pkg/vcs 122.394s ok github.com/google/syzkaller/pkg/vminfo 24.453s ok github.com/google/syzkaller/prog 130.354s ok github.com/google/syzkaller/prog/test 13.189s ? 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] ok github.com/google/syzkaller/sys/linux 21.192s ok github.com/google/syzkaller/sys/netbsd 16.119s ok github.com/google/syzkaller/sys/openbsd 18.992s ? 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] ok github.com/google/syzkaller/syz-ci 71.203s ok github.com/google/syzkaller/syz-cluster/controller 1.014s ok github.com/google/syzkaller/syz-cluster/dashboard 0.566s ok github.com/google/syzkaller/syz-cluster/email-reporter 0.906s ? github.com/google/syzkaller/syz-cluster/pkg/api [no test files] ? github.com/google/syzkaller/syz-cluster/pkg/app [no test files] ok github.com/google/syzkaller/syz-cluster/pkg/blob 0.550s ok github.com/google/syzkaller/syz-cluster/pkg/controller 0.533s ok github.com/google/syzkaller/syz-cluster/pkg/db 0.580s ok github.com/google/syzkaller/syz-cluster/pkg/emailclient 0.564s ok github.com/google/syzkaller/syz-cluster/pkg/report 0.645s ok github.com/google/syzkaller/syz-cluster/pkg/reporter 0.241s ? github.com/google/syzkaller/syz-cluster/pkg/service [no test files] ok github.com/google/syzkaller/syz-cluster/pkg/triage 3.508s ? github.com/google/syzkaller/syz-cluster/pkg/workflow [no test files] ? github.com/google/syzkaller/syz-cluster/reporter-server [no test files] ok github.com/google/syzkaller/syz-cluster/series-tracker 0.459s ? github.com/google/syzkaller/syz-cluster/tools/db-mgmt [no test files] ? github.com/google/syzkaller/syz-cluster/tools/send-test-email [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] ok github.com/google/syzkaller/syz-cluster/workflow/fuzz-step 5.874s ? github.com/google/syzkaller/syz-cluster/workflow/triage-step [no test files] ok github.com/google/syzkaller/syz-hub 0.143s ok github.com/google/syzkaller/syz-hub/state 0.488s ok github.com/google/syzkaller/syz-manager 3.867s ? github.com/google/syzkaller/tools/arm64 [no test files] ? github.com/google/syzkaller/tools/syz-benchcmp [no test files] ? github.com/google/syzkaller/tools/syz-bisect [no test files] ? github.com/google/syzkaller/tools/syz-build [no test files] ? github.com/google/syzkaller/tools/syz-check [no test files] ? github.com/google/syzkaller/tools/syz-cover [no test files] ? github.com/google/syzkaller/tools/syz-covermerger [no test files] ? github.com/google/syzkaller/tools/syz-crush [no test files] ok github.com/google/syzkaller/tools/syz-db 4.570s ? github.com/google/syzkaller/tools/syz-db-export [no test files] ok github.com/google/syzkaller/tools/syz-declextract 4.851s ? 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-expand [no test files] ? github.com/google/syzkaller/tools/syz-fillreports [no test files] ? github.com/google/syzkaller/tools/syz-fix-analyzer [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-hubtool [no test files] ? github.com/google/syzkaller/tools/syz-kcidb [no test files] ok github.com/google/syzkaller/tools/syz-kconf 3.637s ok github.com/google/syzkaller/tools/syz-linter (cached) ? github.com/google/syzkaller/tools/syz-lore [no test files] ? github.com/google/syzkaller/tools/syz-make [no test files] ? github.com/google/syzkaller/tools/syz-minconfig [no test files] ? github.com/google/syzkaller/tools/syz-mutate [no test files] ? github.com/google/syzkaller/tools/syz-prog2c [no test files] ? github.com/google/syzkaller/tools/syz-query-subsystems [no test files] ? github.com/google/syzkaller/tools/syz-reporter [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-symbolize [no test files] ok github.com/google/syzkaller/tools/syz-testbed 4.966s ? github.com/google/syzkaller/tools/syz-testbuild [no test files] ? github.com/google/syzkaller/tools/syz-trace2syz [no test files] ok github.com/google/syzkaller/tools/syz-trace2syz/parser 4.824s ok github.com/google/syzkaller/tools/syz-trace2syz/proggen 6.128s ? github.com/google/syzkaller/tools/syz-tty [no test files] ? github.com/google/syzkaller/tools/syz-upgrade [no test files] ? github.com/google/syzkaller/tools/syz-usbgen [no test files] ok github.com/google/syzkaller/vm 13.809s ? 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] ok github.com/google/syzkaller/vm/dispatcher 0.612s ? github.com/google/syzkaller/vm/gce [no test files] ? github.com/google/syzkaller/vm/gvisor [no test files] ok github.com/google/syzkaller/vm/isolated 3.494s ok github.com/google/syzkaller/vm/proxyapp 5.724s ? github.com/google/syzkaller/vm/proxyapp/mocks [no test files] ? github.com/google/syzkaller/vm/proxyapp/proxyrpc [no test files] ? github.com/google/syzkaller/vm/qemu [no test files] ? github.com/google/syzkaller/vm/starnix [no test files] ok github.com/google/syzkaller/vm/vmimpl 2.587s ? github.com/google/syzkaller/vm/vmm [no test files] ? github.com/google/syzkaller/vm/vmware [no test files] FAIL