? github.com/google/syzkaller/dashboard/dashapi [no test files] ok github.com/google/syzkaller/dashboard/app (cached) ? github.com/google/syzkaller/pkg/debugtracer [no test files] ? github.com/google/syzkaller/pkg/gce [no test files] ? github.com/google/syzkaller/pkg/gcs [no test files] ? github.com/google/syzkaller/pkg/hash [no test files] ? github.com/google/syzkaller/pkg/html [no test files] ? github.com/google/syzkaller/pkg/html/pages [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] ? github.com/google/syzkaller/pkg/ipc/ipcconfig [no test files] ? github.com/google/syzkaller/pkg/kcidb [no test files] ? github.com/google/syzkaller/pkg/rpctype [no test files] ? github.com/google/syzkaller/pkg/signal [no test files] ? github.com/google/syzkaller/pkg/testutil [no test files] ? github.com/google/syzkaller/pkg/tools [no test files] ok github.com/google/syzkaller/executor 2.920s ok github.com/google/syzkaller/pkg/asset (cached) ok github.com/google/syzkaller/pkg/ast 0.765s ok github.com/google/syzkaller/pkg/auth (cached) ok github.com/google/syzkaller/pkg/bisect 23.204s ok github.com/google/syzkaller/pkg/build 23.407s ok github.com/google/syzkaller/pkg/compiler 4.100s ok github.com/google/syzkaller/pkg/config (cached) ok github.com/google/syzkaller/pkg/cover 49.439s ok github.com/google/syzkaller/pkg/cover/backend 0.454s --- FAIL: TestGenerate (29.23s) --- FAIL: TestGenerate/fuchsia/amd64 (0.07s) testutil.go:33: seed=1681475600044003231 --- FAIL: TestGenerate/fuchsia/amd64/12 (0.28s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:true Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :396:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor3622136569 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/0 (0.29s) csource_test.go:133: opts: {Threaded:false Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 static void use_temporary_dir(void) { char tmpdir_template[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } static void execute_one(void); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_one(void) { intptr_t res = 0; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); syz_future_time(0); syz_job_default(); syz_mmap(0x20000000, 0x2000); syz_process_self(); syz_thread_self(); syz_vmar_root_self(); } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :245:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor592079564 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/3 (0.28s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :394:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor4276773653 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/2 (0.27s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void loop(void) { int i, call, thread; for (call = 0; call < 17; 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[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :388:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor2042223703 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/7 (0.29s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); loop(); return 0; } :388:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor1827042327 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/6 (0.28s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :394:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor3604095822 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/5 (0.29s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 static unsigned long long procid; 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); for (procid = 0; procid < 4; procid++) { if (fork() == 0) { use_temporary_dir(); do_sandbox_none(); } } sleep(1000000); return 0; } :396:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor1269030000 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/9 (0.28s) csource_test.go:133: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox:none SandboxArg:9223372036854775807 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 UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :394:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor824116558 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/1 (0.28s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :394:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor3508233752 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/14 (0.29s) csource_test.go:133: 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 UseTmpDir:true HandleSegv:false Repro:true Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_interrupt_wait(0x0, &(0x7f0000000000)=0x0) (fail_nth: 1) zx_channel_call$fuchsia_hardware_ethernet_DeviceStop(0x0, 0x0, r0, &(0x7f0000010100)={&(0x7f0000000040), &(0x7f0000000080), &(0x7f00000000c0), &(0x7f00000100c0), 0x10, 0x0, 0x10000}, &(0x7f0000010140), &(0x7f0000010180)) (async) zx_channel_call$fuchsia_io_DirectorySetAttr(0x0, 0x0, r0, &(0x7f00000202c0)={&(0x7f00000101c0)={{}, 0x409, {0xac02, 0x0, 0x4, 0x2, 0x40000, 0x200, 0x6}}, &(0x7f0000010240), &(0x7f0000010280), &(0x7f0000020280), 0x48, 0x0, 0x10000}, &(0x7f0000020300), &(0x7f0000020340)) (rerun: 4) zx_channel_call$fuchsia_cobalt_ControllerRequestSendSoon(0x0, 0x0, r0, &(0x7f0000030440)={&(0x7f0000020380), &(0x7f00000203c0), &(0x7f0000020400), &(0x7f0000030400), 0x10, 0x0, 0x10000}, &(0x7f0000030480), &(0x7f00000304c0)) zx_channel_call$fuchsia_io_FileSync(0x0, 0x0, r0, &(0x7f00000405c0)={&(0x7f0000030500), &(0x7f0000030540), &(0x7f0000030580), &(0x7f0000040580), 0x10, 0x0, 0x10000}, &(0x7f0000040600), &(0x7f0000040640)) zx_channel_call$fuchsia_io_FileClose(0x0, 0x0, r0, &(0x7f0000050740)={&(0x7f0000040680), &(0x7f00000406c0), &(0x7f0000040700), &(0x7f0000050700), 0x10, 0x0, 0x10000}, &(0x7f0000050780), &(0x7f00000507c0)) zx_handle_replace(0x0, 0x4000, &(0x7f0000050800)=0x0) zx_channel_call$fuchsia_io_FileNodeGetFlags(r1, 0x0, r0, &(0x7f0000060900)={&(0x7f0000050840), &(0x7f0000050880), &(0x7f00000508c0), &(0x7f00000608c0), 0x10, 0x0, 0x10000}, &(0x7f0000060940), &(0x7f0000060980)) zx_channel_call_etc(r1, 0x8001, r0, &(0x7f0000060b40)={&(0x7f00000609c0)="291771071d72d15c39cae109187d8bf4fcc452870dc357c3fd0cadcea9c914635a4f9320b61c168d051b48147bb19379302f17fb3e61a8de5c5f9ce8aa01cd8a881f044c4e6e3d9bd2e83ab8af2b680795018c55f3fd92e6ca2a31e1a1b790dcd658131ea7193e9f1961c044ca953d9de2d33cb5230f", &(0x7f0000060a40)=[r1], &(0x7f0000060a80)=""/121, &(0x7f0000060b00)=[0x0, 0x0], 0x76, 0x1, 0x79, 0x2}, &(0x7f0000060b80), &(0x7f0000060bc0)) zx_channel_call$fuchsia_cobalt_MetricEventLoggerLogOccurrence(r2, 0x0, 0x0, &(0x7f0000070cc0)={&(0x7f0000060c00)={{}, 0x9, 0x4f2e1f, {0x8c7a}, [0xac1c, 0x3, 0x4, 0x0]}, &(0x7f0000060c40), &(0x7f0000060c80), &(0x7f0000070c80), 0x3c, 0x0, 0x10000}, &(0x7f0000070d00), &(0x7f0000070d40)) syz_execute_func(&(0x7f0000000000)="41e900000100dfe0652ef30fe689dfd20000660f7408410f380b2a3e400ff7e8c422e9accdf341688124e8122e430fe77100f20f2d11") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000000000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:134: 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 static unsigned long long procid; 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[] = "/tmp/syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static int inject_fault(int nth) { return 0; } static void setup_fault() { } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) usleep(200); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout_ms) { uint64_t start = current_time_ms(); for (;;) { if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED)) return 1; if (current_time_ms() - start > timeout_ms) return 0; usleep(200); } } long syz_mmap(size_t addr, size_t size) { zx_handle_t root = zx_vmar_root_self(); zx_info_vmar_t info; zx_status_t status = zx_object_get_info(root, ZX_INFO_VMAR, &info, sizeof(info), 0, 0); if (status != ZX_OK) { return status; } zx_handle_t vmo; status = zx_vmo_create(size, 0, &vmo); if (status != ZX_OK) { return status; } uintptr_t mapped_addr; status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, addr - info.base, vmo, 0, size, &mapped_addr); zx_status_t close_vmo_status = zx_handle_close(vmo); if (close_vmo_status != ZX_OK) { } return status; } static long syz_process_self(void) { return zx_process_self(); } static long syz_thread_self(void) { return zx_thread_self(); } static long syz_vmar_root_self(void) { return zx_vmar_root_self(); } static long syz_job_default(void) { return zx_job_default(); } static long syz_future_time(volatile long when) { zx_time_t delta_ms = 10000; switch (when) { case 0: delta_ms = 5; break; case 1: delta_ms = 30; break; } zx_time_t now = 0; zx_clock_read(ZX_CLOCK_MONOTONIC, &now); return now + delta_ms * 1000 * 1000; } static void loop(); static int do_sandbox_none(void) { loop(); return 0; } #define CAST(f) ({void* p = (void*)f; p; }) static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 17; 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); static void loop(void) { execute_one(); } uint64_t r[3] = {0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(0, 0x20000000); if (res == ZX_OK) r[0] = *(uint64_t*)0x20000000; break; case 1: *(uint64_t*)0x20010100 = 0x20000040; *(uint32_t*)0x20000040 = 0; memset((void*)0x20000044, 0, 3); *(uint8_t*)0x20000047 = 1; *(uint64_t*)0x20000048 = 0x3dfcfe9500000000; *(uint64_t*)0x20010108 = 0x20000080; *(uint64_t*)0x20010110 = 0x200000c0; *(uint64_t*)0x20010118 = 0x200100c0; *(uint32_t*)0x20010120 = 0x10; *(uint32_t*)0x20010124 = 0; *(uint32_t*)0x20010128 = 0x10000; *(uint32_t*)0x2001012c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20010100, 0x20010140, 0x20010180); break; case 2: *(uint64_t*)0x200202c0 = 0x200101c0; *(uint32_t*)0x200101c0 = 0; memset((void*)0x200101c4, 0, 3); *(uint8_t*)0x200101c7 = 1; *(uint64_t*)0x200101c8 = 0xbd5559a00000000; *(uint32_t*)0x200101d0 = 0x409; *(uint32_t*)0x200101d4 = 0xac02; *(uint64_t*)0x200101d8 = 0; *(uint64_t*)0x200101e0 = 4; *(uint64_t*)0x200101e8 = 2; *(uint64_t*)0x200101f0 = 0x40000; *(uint64_t*)0x200101f8 = 0x200; *(uint64_t*)0x20010200 = 6; *(uint64_t*)0x200202c8 = 0x20010240; *(uint64_t*)0x200202d0 = 0x20010280; *(uint64_t*)0x200202d8 = 0x20020280; *(uint32_t*)0x200202e0 = 0x48; *(uint32_t*)0x200202e4 = 0; *(uint32_t*)0x200202e8 = 0x10000; *(uint32_t*)0x200202ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200202c0, 0x20020300, 0x20020340); } } break; case 3: *(uint64_t*)0x20030440 = 0x20020380; *(uint32_t*)0x20020380 = 0; memset((void*)0x20020384, 0, 3); *(uint8_t*)0x20020387 = 1; *(uint64_t*)0x20020388 = 0x8d7092700000000; *(uint64_t*)0x20030448 = 0x200203c0; *(uint64_t*)0x20030450 = 0x20020400; *(uint64_t*)0x20030458 = 0x20030400; *(uint32_t*)0x20030460 = 0x10; *(uint32_t*)0x20030464 = 0; *(uint32_t*)0x20030468 = 0x10000; *(uint32_t*)0x2003046c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20030440, 0x20030480, 0x200304c0); break; case 4: *(uint64_t*)0x200405c0 = 0x20030500; *(uint32_t*)0x20030500 = 0; memset((void*)0x20030504, 0, 3); *(uint8_t*)0x20030507 = 1; *(uint64_t*)0x20030508 = 0x62423faa00000000; *(uint64_t*)0x200405c8 = 0x20030540; *(uint64_t*)0x200405d0 = 0x20030580; *(uint64_t*)0x200405d8 = 0x20040580; *(uint32_t*)0x200405e0 = 0x10; *(uint32_t*)0x200405e4 = 0; *(uint32_t*)0x200405e8 = 0x10000; *(uint32_t*)0x200405ec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x200405c0, 0x20040600, 0x20040640); break; case 5: *(uint64_t*)0x20050740 = 0x20040680; *(uint32_t*)0x20040680 = 0; memset((void*)0x20040684, 0, 3); *(uint8_t*)0x20040687 = 1; *(uint64_t*)0x20040688 = 0x52b9568700000000; *(uint64_t*)0x20050748 = 0x200406c0; *(uint64_t*)0x20050750 = 0x20040700; *(uint64_t*)0x20050758 = 0x20050700; *(uint32_t*)0x20050760 = 0x10; *(uint32_t*)0x20050764 = 0; *(uint32_t*)0x20050768 = 0x10000; *(uint32_t*)0x2005076c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(0, 0, r[0], 0x20050740, 0x20050780, 0x200507c0); break; case 6: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(0, 0x4000, 0x20050800); if (res == ZX_OK) r[1] = *(uint32_t*)0x20050800; break; case 7: *(uint64_t*)0x20060900 = 0x20050840; *(uint32_t*)0x20050840 = 0; memset((void*)0x20050844, 0, 3); *(uint8_t*)0x20050847 = 1; *(uint64_t*)0x20050848 = 0x3c24c22300000000; *(uint64_t*)0x20060908 = 0x20050880; *(uint64_t*)0x20060910 = 0x200508c0; *(uint64_t*)0x20060918 = 0x200608c0; *(uint32_t*)0x20060920 = 0x10; *(uint32_t*)0x20060924 = 0; *(uint32_t*)0x20060928 = 0x10000; *(uint32_t*)0x2006092c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[1], 0, r[0], 0x20060900, 0x20060940, 0x20060980); break; case 8: *(uint64_t*)0x20060b40 = 0x200609c0; memcpy((void*)0x200609c0, "\x29\x17\x71\x07\x1d\x72\xd1\x5c\x39\xca\xe1\x09\x18\x7d\x8b\xf4\xfc\xc4\x52\x87\x0d\xc3\x57\xc3\xfd\x0c\xad\xce\xa9\xc9\x14\x63\x5a\x4f\x93\x20\xb6\x1c\x16\x8d\x05\x1b\x48\x14\x7b\xb1\x93\x79\x30\x2f\x17\xfb\x3e\x61\xa8\xde\x5c\x5f\x9c\xe8\xaa\x01\xcd\x8a\x88\x1f\x04\x4c\x4e\x6e\x3d\x9b\xd2\xe8\x3a\xb8\xaf\x2b\x68\x07\x95\x01\x8c\x55\xf3\xfd\x92\xe6\xca\x2a\x31\xe1\xa1\xb7\x90\xdc\xd6\x58\x13\x1e\xa7\x19\x3e\x9f\x19\x61\xc0\x44\xca\x95\x3d\x9d\xe2\xd3\x3c\xb5\x23\x0f", 118); *(uint64_t*)0x20060b48 = 0x20060a40; *(uint32_t*)0x20060a40 = r[1]; *(uint64_t*)0x20060b50 = 0x20060a80; *(uint64_t*)0x20060b58 = 0x20060b00; *(uint32_t*)0x20060b60 = 0x76; *(uint32_t*)0x20060b64 = 1; *(uint32_t*)0x20060b68 = 0x79; *(uint32_t*)0x20060b6c = 2; res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); if (res == ZX_OK) r[2] = *(uint32_t*)0x20060b00; break; case 9: *(uint64_t*)0x20070cc0 = 0x20060c00; *(uint32_t*)0x20060c00 = 0; memset((void*)0x20060c04, 0, 3); *(uint8_t*)0x20060c07 = 1; *(uint64_t*)0x20060c08 = 0x4dd49b4000000000; *(uint32_t*)0x20060c10 = 9; *(uint64_t*)0x20060c14 = 0x4f2e1f; *(uint64_t*)0x20060c1c = 0x8c7a; *(uint64_t*)0x20060c24 = 0; *(uint32_t*)0x20060c2c = 0xac1c; *(uint32_t*)0x20060c30 = 3; *(uint32_t*)0x20060c34 = 4; *(uint32_t*)0x20060c38 = 0; *(uint64_t*)0x20070cc8 = 0x20060c40; *(uint64_t*)0x20070cd0 = 0x20060c80; *(uint64_t*)0x20070cd8 = 0x20070c80; *(uint32_t*)0x20070ce0 = 0x3c; *(uint32_t*)0x20070ce4 = 0; *(uint32_t*)0x20070ce8 = 0x10000; *(uint32_t*)0x20070cec = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[2], 0, 0, 0x20070cc0, 0x20070d00, 0x20070d40); break; case 10: memcpy((void*)0x20000000, "\x41\xe9\x00\x00\x01\x00\xdf\xe0\x65\x2e\xf3\x0f\xe6\x89\xdf\xd2\x00\x00\x66\x0f\x74\x08\x41\x0f\x38\x0b\x2a\x3e\x40\x0f\xf7\xe8\xc4\x22\xe9\xac\xcd\xf3\x41\x68\x81\x24\xe8\x12\x2e\x43\x0f\xe7\x71\x00\xf2\x0f\x2d\x11", 54); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20000000, 0x2000); break; case 14: syz_process_self(); break; case 15: syz_thread_self(); break; case 16: syz_vmar_root_self(); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); for (procid = 0; procid < 2; procid++) { if (fork() == 0) { use_temporary_dir(); do_sandbox_none(); } } sleep(1000000); return 0; } :398:81: error: use of undeclared identifier 'zx_channel_call_etc' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(r[1], 0x8001, r[0], 0x20060b40, 0x20060b80, 0x20060bc0); ^ 1 error generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor131926518 -DGOOS_fuchsia=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -Wno-deprecated -target x86_64-fuchsia -ldriver -lfdio -lzircon --sysroot /syzkaller/shared/fuchsia/out/x64/zircon_toolchain/obj/zircon/public/sysroot/sysroot -I /syzkaller/shared/fuchsia/sdk/lib/fdio/include -I /syzkaller/shared/fuchsia/zircon/system/ulib/fidl/include -I /syzkaller/shared/fuchsia/src/lib/ddk/include -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.device.manager -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.nand -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/sdk/fidl/fuchsia.hardware.usb.peripheral -I /syzkaller/shared/fuchsia/out/x64/fidling/gen/zircon/vdso/zx -L /syzkaller/shared/fuchsia/out/x64/x64-shared -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-array-bounds -Wno-unused-command-line-argument] --- FAIL: TestGenerate/fuchsia/amd64/10 (0.28s) csource_test.go:131: --- FAIL: TestGenerate/fuchsia/amd64/13 (0.29s) csource_test.go:131: --- FAIL: TestGenerate/fuchsia/amd64/4 (0.29s) csource_test.go:131: --- FAIL: TestGenerate/fuchsia/amd64/8 (0.28s) csource_test.go:131: FAIL FAIL github.com/google/syzkaller/pkg/csource 39.766s ok github.com/google/syzkaller/pkg/db (cached) ok github.com/google/syzkaller/pkg/email (cached) ok github.com/google/syzkaller/pkg/email/lore (cached) ok github.com/google/syzkaller/pkg/host 18.427s ok github.com/google/syzkaller/pkg/ifuzz (cached) ok github.com/google/syzkaller/pkg/image 2.521s ok github.com/google/syzkaller/pkg/instance 6.094s ok github.com/google/syzkaller/pkg/ipc 51.176s ok github.com/google/syzkaller/pkg/kconfig 0.687s ok github.com/google/syzkaller/pkg/kd (cached) ok github.com/google/syzkaller/pkg/log (cached) ok github.com/google/syzkaller/pkg/mgrconfig 4.893s ok github.com/google/syzkaller/pkg/osutil (cached) ok github.com/google/syzkaller/pkg/report 27.902s ok github.com/google/syzkaller/pkg/repro 4.738s ? github.com/google/syzkaller/sys [no test files] ? github.com/google/syzkaller/sys/akaros [no test files] ? github.com/google/syzkaller/sys/akaros/gen [no test files] ? github.com/google/syzkaller/sys/darwin [no test files] ? github.com/google/syzkaller/sys/darwin/gen [no test files] ? github.com/google/syzkaller/sys/freebsd [no test files] ? github.com/google/syzkaller/sys/freebsd/gen [no test files] ? github.com/google/syzkaller/sys/fuchsia [no test files] ? github.com/google/syzkaller/sys/fuchsia/fidlgen [no test files] ? github.com/google/syzkaller/sys/fuchsia/gen [no test files] ? github.com/google/syzkaller/sys/fuchsia/layout [no test files] ? github.com/google/syzkaller/sys/linux/gen [no test files] ? github.com/google/syzkaller/sys/netbsd [no test files] ? github.com/google/syzkaller/sys/netbsd/gen [no test files] ? github.com/google/syzkaller/sys/openbsd/gen [no test files] ? github.com/google/syzkaller/sys/syz-extract [no test files] ? github.com/google/syzkaller/sys/syz-sysgen [no test files] ? github.com/google/syzkaller/sys/targets [no test files] ? github.com/google/syzkaller/sys/test [no test files] ? github.com/google/syzkaller/sys/test/gen [no test files] ? github.com/google/syzkaller/sys/trusty [no test files] ? github.com/google/syzkaller/sys/trusty/gen [no test files] ? github.com/google/syzkaller/sys/windows [no test files] ? github.com/google/syzkaller/sys/windows/gen [no test files] ? github.com/google/syzkaller/syz-runner [no test files] ? github.com/google/syzkaller/tools/syz-benchcmp [no test files] ? github.com/google/syzkaller/tools/syz-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-crush [no test files] ? github.com/google/syzkaller/tools/syz-db [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-fmt [no test files] ? github.com/google/syzkaller/tools/syz-hubtool [no test files] ? github.com/google/syzkaller/tools/syz-imagegen [no test files] ? github.com/google/syzkaller/tools/syz-kcidb [no test files] ? github.com/google/syzkaller/tools/syz-lore [no test files] ? github.com/google/syzkaller/tools/syz-make [no test files] ? github.com/google/syzkaller/tools/syz-minconfig [no test files] ? github.com/google/syzkaller/tools/syz-mutate [no test files] ? github.com/google/syzkaller/tools/syz-prog2c [no test files] ? github.com/google/syzkaller/tools/syz-query-subsystems [no test files] ? github.com/google/syzkaller/tools/syz-reporter [no test files] ? github.com/google/syzkaller/tools/syz-repro [no test files] ? github.com/google/syzkaller/tools/syz-reprolist [no test files] ? github.com/google/syzkaller/tools/syz-runtest [no test files] ? github.com/google/syzkaller/tools/syz-showprio [no test files] ? github.com/google/syzkaller/tools/syz-stress [no test files] ? github.com/google/syzkaller/tools/syz-symbolize [no test files] ? github.com/google/syzkaller/tools/syz-testbed [no test files] ? github.com/google/syzkaller/tools/syz-testbuild [no test files] ? github.com/google/syzkaller/tools/syz-trace2syz [no test files] ? github.com/google/syzkaller/tools/syz-tty [no test files] ? github.com/google/syzkaller/tools/syz-upgrade [no test files] ? github.com/google/syzkaller/tools/syz-usbgen [no test files] ? github.com/google/syzkaller/vm/adb [no test files] ? github.com/google/syzkaller/vm/bhyve [no test files] ? github.com/google/syzkaller/vm/cuttlefish [no test files] ? github.com/google/syzkaller/vm/gce [no test files] ? github.com/google/syzkaller/vm/gvisor [no test files] ? github.com/google/syzkaller/vm/kvm [no test files] ? github.com/google/syzkaller/vm/odroid [no test files] ? 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] ? github.com/google/syzkaller/vm/vmm [no test files] ? github.com/google/syzkaller/vm/vmware [no test files] ok github.com/google/syzkaller/pkg/runtest 81.282s ok github.com/google/syzkaller/pkg/serializer (cached) ok github.com/google/syzkaller/pkg/stats (cached) ok github.com/google/syzkaller/pkg/subsystem (cached) ok github.com/google/syzkaller/pkg/subsystem/linux (cached) ok github.com/google/syzkaller/pkg/subsystem/lists (cached) ok github.com/google/syzkaller/pkg/symbolizer (cached) ok github.com/google/syzkaller/pkg/tool (cached) ok github.com/google/syzkaller/pkg/vcs (cached) ok github.com/google/syzkaller/prog 12.931s ok github.com/google/syzkaller/prog/test (cached) ok github.com/google/syzkaller/sys/linux 0.159s ok github.com/google/syzkaller/sys/openbsd (cached) ok github.com/google/syzkaller/syz-ci 1.880s ok github.com/google/syzkaller/syz-fuzzer 0.402s ok github.com/google/syzkaller/syz-hub 0.022s ok github.com/google/syzkaller/syz-hub/state 0.056s ok github.com/google/syzkaller/syz-manager 2.118s ok github.com/google/syzkaller/syz-verifier 1.719s ok github.com/google/syzkaller/tools/syz-kconf (cached) ok github.com/google/syzkaller/tools/syz-linter (cached) ok github.com/google/syzkaller/tools/syz-trace2syz/parser 0.016s ok github.com/google/syzkaller/tools/syz-trace2syz/proggen 0.203s ok github.com/google/syzkaller/vm 9.663s ok github.com/google/syzkaller/vm/isolated 1.712s ok github.com/google/syzkaller/vm/proxyapp 4.167s ok github.com/google/syzkaller/vm/vmimpl 1.782s FAIL