? github.com/google/syzkaller/dashboard/dashapi [no test files] ok github.com/google/syzkaller/dashboard/app 0.126s ok github.com/google/syzkaller/executor 3.043s ok github.com/google/syzkaller/pkg/asset 0.160s ok github.com/google/syzkaller/pkg/ast 1.096s ok github.com/google/syzkaller/pkg/auth 0.019s ok github.com/google/syzkaller/pkg/bisect 12.947s ? 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/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] ok github.com/google/syzkaller/pkg/build 9.482s ok github.com/google/syzkaller/pkg/compiler 6.018s ok github.com/google/syzkaller/pkg/config 0.008s ? 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/pkg/cover 48.514s ok github.com/google/syzkaller/pkg/cover/backend 0.902s --- FAIL: TestGenerate (27.78s) --- FAIL: TestGenerate/fuchsia/amd64 (0.16s) testutil.go:33: seed=1686129281200617389 testutil.go:33: seed=1686129281361148308 --- FAIL: TestGenerate/fuchsia/amd64/0 (1.35s) csource_test.go:150: 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_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_one(void) { intptr_t res = 0; *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); syz_future_time(0); syz_job_default(); syz_mmap(0x20ffe000, 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; } :148: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :174:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor3126164730 -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/13 (0.61s) csource_test.go:150: 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:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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) { fprintf(stderr, "### start\n"); 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); fprintf(stderr, "### call=0 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); fprintf(stderr, "### call=1 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); fprintf(stderr, "### call=2 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); fprintf(stderr, "### call=3 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); fprintf(stderr, "### call=4 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 5: res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); fprintf(stderr, "### call=5 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); fprintf(stderr, "### call=6 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 7: res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); fprintf(stderr, "### call=7 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); fprintf(stderr, "### call=8 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; res = -1; errno = EFAULT; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); fprintf(stderr, "### call=9 errno=%u\n", (intptr_t)(int)res == -1 ? errno : 0); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); res = -1; errno = EFAULT; res = syz_execute_func(0x20000000); fprintf(stderr, "### call=10 errno=%u\n", res == -1 ? errno : 0); break; case 11: res = -1; errno = EFAULT; res = syz_future_time(0); fprintf(stderr, "### call=11 errno=%u\n", res == -1 ? errno : 0); break; case 12: res = -1; errno = EFAULT; res = syz_job_default(); fprintf(stderr, "### call=12 errno=%u\n", res == -1 ? errno : 0); break; case 13: res = -1; errno = EFAULT; res = syz_mmap(0x20ffe000, 0x2000); fprintf(stderr, "### call=13 errno=%u\n", res == -1 ? errno : 0); break; case 14: res = -1; errno = EFAULT; res = syz_process_self(); fprintf(stderr, "### call=14 errno=%u\n", res == -1 ? errno : 0); break; case 15: res = -1; errno = EFAULT; res = syz_thread_self(); fprintf(stderr, "### call=15 errno=%u\n", res == -1 ? errno : 0); break; case 16: res = -1; errno = EFAULT; res = syz_vmar_root_self(); fprintf(stderr, "### call=16 errno=%u\n", res == -1 ? errno : 0); break; } } int main(void) { syz_mmap(0x20000000, 0x1000000); setup_fault(); use_temporary_dir(); do_sandbox_none(); return 0; } :283: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :337:54: error: use of undeclared identifier 'zx_socket_set_disposition' res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor167439568 -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.60s) csource_test.go:150: 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:false HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static int inject_fault(int nth) { return 0; } static 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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(); do_sandbox_none(); return 0; } :269: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :307:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor101529765 -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 (1.23s) csource_test.go:150: 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_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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; } :285: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :323:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor2275679721 -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 (1.01s) csource_test.go:150: 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_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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; } :283: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :321:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor1891329643 -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/8 (1.01s) csource_test.go:150: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox:none SandboxArg:-9223372036854775808 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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; } :281: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :319:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor975682908 -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 (1.01s) csource_test.go:150: opts: {Threaded:true Repeat:true RepeatTimes:0 Procs:0 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false UseTmpDir:true HandleSegv:false Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}} program: zx_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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; } :275: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :313:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor1257562223 -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 (1.01s) csource_test.go:150: 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_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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; } :281: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :319:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor1696711493 -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/12 (1.48s) csource_test.go:150: 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_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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; } :283: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :321:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor816729461 -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/4 (0.97s) csource_test.go:148: --- FAIL: TestGenerate/fuchsia/amd64/6 (1.47s) csource_test.go:150: 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_channel_call_etc(0x0, 0x91b4, 0x7fffffffffffffff, &(0x7f0000000200)={&(0x7f0000000040)="02927efc10422f223c7af18f4cdefa88d4533233881327a3e01adf70a1", &(0x7f0000000080)=[0x0, 0x0, 0x0, 0x0], &(0x7f00000000c0)=""/209, &(0x7f00000001c0)=[0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0], 0x1d, 0x4, 0xd1, 0x9}, &(0x7f0000000240), &(0x7f0000000280)) (fail_nth: 1) fdio_service_connect$fuchsia_cobalt_Logger(&(0x7f0000000000), r2) (async) zx_futex_wait(&(0x7f00000002c0)=0x8000, 0x6, r1, 0x0) (rerun: 4) zx_interrupt_wait(r0, &(0x7f0000000300)=0x0) zx_clock_create(0x0, &(0x7f0000000340)={r3}, &(0x7f0000000380)) zx_eventpair_create$VALID_OPTIONS(0x0, &(0x7f00000003c0)=0x0, &(0x7f0000000400)) zx_socket_set_disposition(r4, 0x2, 0x0) zx_handle_replace(r0, 0x8000, &(0x7f0000000440)=0x0) zx_channel_call$fuchsia_hardware_ethernet_DeviceConfigMulticastAddMac(r5, 0x0, r3, &(0x7f0000010540)={&(0x7f0000000480)={{}, {"58d366390c8f"}}, &(0x7f00000004c0), &(0x7f0000000500), &(0x7f0000010500), 0x16, 0x0, 0x10000}, &(0x7f0000010580), &(0x7f00000105c0)) zx_channel_call$fuchsia_cobalt_ControllerGenerateAggregatedObservations(r5, 0x0, 0x0, &(0x7f0000020700)={&(0x7f0000010600)={{}, 0x9, {0x9, 0xffffffffffffffff}, [0x7fffffff, 0xd694, 0x6, 0x6d, 0x2, 0xfffffffd, 0x6, 0x6]}, &(0x7f0000010680), &(0x7f00000106c0), &(0x7f00000206c0), 0x44, 0x0, 0x10000}, &(0x7f0000020740), &(0x7f0000020780)) syz_execute_func(&(0x7f0000000000)="362e0f5b9d71000000c4e19d72d209450f1ae466667848f3450f1efb66460f6f5cf6003e660f382b80004000002e26f009bc1ea5f3000042e0a6808500100000fa") syz_future_time(0x0) syz_job_default() syz_mmap(&(0x7f0000ffe000/0x2000)=nil, 0x2000) syz_process_self() syz_thread_self() syz_vmar_root_self() csource_test.go:151: failed to build program: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: *(uint64_t*)0x20000200 = 0x20000040; memcpy((void*)0x20000040, "\x02\x92\x7e\xfc\x10\x42\x2f\x22\x3c\x7a\xf1\x8f\x4c\xde\xfa\x88\xd4\x53\x32\x33\x88\x13\x27\xa3\xe0\x1a\xdf\x70\xa1", 29); *(uint64_t*)0x20000208 = 0x20000080; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000210 = 0x200000c0; *(uint64_t*)0x20000218 = 0x200001c0; *(uint32_t*)0x20000220 = 0x1d; *(uint32_t*)0x20000224 = 4; *(uint32_t*)0x20000228 = 0xd1; *(uint32_t*)0x2000022c = 9; inject_fault(1); res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call_etc))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); if (res == ZX_OK) { r[0] = *(uint32_t*)0x200001cc; r[1] = *(uint32_t*)0x200001d0; r[2] = *(uint32_t*)0x200001d4; } break; case 1: memcpy((void*)0x20000000, "/svc/\000", 6); ((intptr_t(*)(intptr_t,intptr_t))CAST(fdio_service_connect))(0x20000000, r[2]); break; case 2: *(uint32_t*)0x200002c0 = 0x8000; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); { int i; for(i = 0; i < 4; i++) { ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_futex_wait))(0x200002c0, 6, r[1], 0); } } break; case 3: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t))CAST(zx_interrupt_wait))(r[0], 0x20000300); if (res == ZX_OK) r[3] = *(uint64_t*)0x20000300; break; case 4: *(uint64_t*)0x20000340 = r[3]; ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_clock_create))(0, 0x20000340, 0x20000380); break; case 5: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_eventpair_create))(0, 0x200003c0, 0x20000400); if (res == ZX_OK) r[4] = *(uint32_t*)0x200003c0; break; case 6: ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); break; case 7: res = -1; res = ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_handle_replace))(r[0], 0x8000, 0x20000440); if (res == ZX_OK) r[5] = *(uint32_t*)0x20000440; break; case 8: *(uint64_t*)0x20010540 = 0x20000480; *(uint32_t*)0x20000480 = 0; memset((void*)0x20000484, 0, 3); *(uint8_t*)0x20000487 = 1; *(uint64_t*)0x20000488 = 0x39fce1800000000; memcpy((void*)0x20000490, "\x58\xd3\x66\x39\x0c\x8f", 6); *(uint64_t*)0x20010548 = 0x200004c0; *(uint64_t*)0x20010550 = 0x20000500; *(uint64_t*)0x20010558 = 0x20010500; *(uint32_t*)0x20010560 = 0x16; *(uint32_t*)0x20010564 = 0; *(uint32_t*)0x20010568 = 0x10000; *(uint32_t*)0x2001056c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, r[3], 0x20010540, 0x20010580, 0x200105c0); break; case 9: *(uint64_t*)0x20020700 = 0x20010600; *(uint32_t*)0x20010600 = 0; memset((void*)0x20010604, 0, 3); *(uint8_t*)0x20010607 = 1; *(uint64_t*)0x20010608 = 0x5ad64bce00000000; *(uint32_t*)0x20010610 = 9; *(uint64_t*)0x20010614 = 9; *(uint64_t*)0x2001061c = -1; *(uint32_t*)0x20010624 = 0x7fffffff; *(uint32_t*)0x20010628 = 0xd694; *(uint32_t*)0x2001062c = 6; *(uint32_t*)0x20010630 = 0x6d; *(uint32_t*)0x20010634 = 2; *(uint32_t*)0x20010638 = 0xfffffffd; *(uint32_t*)0x2001063c = 6; *(uint32_t*)0x20010640 = 6; *(uint64_t*)0x20020708 = 0x20010680; *(uint64_t*)0x20020710 = 0x200106c0; *(uint64_t*)0x20020718 = 0x200206c0; *(uint32_t*)0x20020720 = 0x44; *(uint32_t*)0x20020724 = 0; *(uint32_t*)0x20020728 = 0x10000; *(uint32_t*)0x2002072c = 0; ((intptr_t(*)(intptr_t,intptr_t,intptr_t,intptr_t,intptr_t,intptr_t))CAST(zx_channel_call))(r[5], 0, 0, 0x20020700, 0x20020740, 0x20020780); break; case 10: memcpy((void*)0x20000000, "\x36\x2e\x0f\x5b\x9d\x71\x00\x00\x00\xc4\xe1\x9d\x72\xd2\x09\x45\x0f\x1a\xe4\x66\x66\x78\x48\xf3\x45\x0f\x1e\xfb\x66\x46\x0f\x6f\x5c\xf6\x00\x3e\x66\x0f\x38\x2b\x80\x00\x40\x00\x00\x2e\x26\xf0\x09\xbc\x1e\xa5\xf3\x00\x00\x42\xe0\xa6\x80\x85\x00\x10\x00\x00\xfa", 65); syz_execute_func(0x20000000); break; case 11: syz_future_time(0); break; case 12: syz_job_default(); break; case 13: syz_mmap(0x20ffe000, 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; } :281: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))(0, 0x91b4, 0x7fffffffffffffff, 0x20000200, 0x20000240, 0x20000280); ^ :319:48: error: use of undeclared identifier 'zx_socket_set_disposition' ((intptr_t(*)(intptr_t,intptr_t,intptr_t))CAST(zx_socket_set_disposition))(r[4], 2, 0); ^ 2 errors generated. compiler invocation: /syzkaller/shared/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang [-o /tmp/syz-executor3851142834 -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 (1.48s) csource_test.go:148: --- FAIL: TestGenerate/fuchsia/amd64/1 (1.10s) csource_test.go:148: --- FAIL: TestGenerate/fuchsia/amd64/2 (1.10s) csource_test.go:148: FAIL FAIL github.com/google/syzkaller/pkg/csource 43.534s ok github.com/google/syzkaller/pkg/db 4.835s ok github.com/google/syzkaller/pkg/email 0.028s ok github.com/google/syzkaller/pkg/email/lore 0.026s ok github.com/google/syzkaller/pkg/host 40.895s ok github.com/google/syzkaller/pkg/html 0.017s ok github.com/google/syzkaller/pkg/ifuzz 0.822s ok github.com/google/syzkaller/pkg/image 3.055s ok github.com/google/syzkaller/pkg/instance 4.007s ok github.com/google/syzkaller/pkg/ipc 41.515s ok github.com/google/syzkaller/pkg/kconfig 0.851s ok github.com/google/syzkaller/pkg/kd 0.006s ok github.com/google/syzkaller/pkg/log 0.006s ok github.com/google/syzkaller/pkg/mgrconfig 4.273s ok github.com/google/syzkaller/pkg/osutil 0.201s ok github.com/google/syzkaller/pkg/report 27.162s ok github.com/google/syzkaller/pkg/repro 4.632s ok github.com/google/syzkaller/pkg/runtest 93.580s ok github.com/google/syzkaller/pkg/serializer 0.044s ok github.com/google/syzkaller/pkg/stats 0.015s ok github.com/google/syzkaller/pkg/subsystem 0.042s ok github.com/google/syzkaller/pkg/subsystem/linux 0.080s ok github.com/google/syzkaller/pkg/subsystem/lists 0.518s ok github.com/google/syzkaller/pkg/symbolizer 0.144s ok github.com/google/syzkaller/pkg/tool 0.068s ok github.com/google/syzkaller/pkg/vcs 11.418s ? 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/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/prog 19.723s ok github.com/google/syzkaller/prog/test 0.632s ok github.com/google/syzkaller/sys/linux 0.261s ok github.com/google/syzkaller/sys/netbsd 0.026s ok github.com/google/syzkaller/sys/openbsd 0.031s ok github.com/google/syzkaller/syz-ci 3.247s ok github.com/google/syzkaller/syz-fuzzer 0.605s ok github.com/google/syzkaller/syz-hub 0.030s ok github.com/google/syzkaller/syz-hub/state 0.054s ok github.com/google/syzkaller/syz-manager 3.381s ok github.com/google/syzkaller/syz-verifier 2.956s ok github.com/google/syzkaller/tools/syz-kconf 0.028s ok github.com/google/syzkaller/tools/syz-linter 1.851s ok github.com/google/syzkaller/tools/syz-trace2syz/parser 0.014s ok github.com/google/syzkaller/tools/syz-trace2syz/proggen 0.245s ok github.com/google/syzkaller/vm 10.364s ok github.com/google/syzkaller/vm/isolated 2.574s ok github.com/google/syzkaller/vm/proxyapp 5.569s ok github.com/google/syzkaller/vm/vmimpl 2.585s FAIL