// https://syzkaller.appspot.com/bug?id=ffb3b968582af45169155ae8f13d408eef7673bd // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(SYS_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x1012ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // openat$pass arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 70 61 73 73 30 00} (length 0xb) // } // flags: open_flags = 0x2 (8 bytes) // mode: const = 0x0 (8 bytes) // ] // returns fd_pass memcpy((void*)0x200000000040, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000040ul, /*flags=O_RDWR*/ 2ul, /*mode=*/0ul); if (res != -1) r[0] = res; // ioctl$CAMIOCOMMAND arguments: [ // fd: fd_pass (resource) // cmd: const = 0xc4e01a02 (8 bytes) // arg: ptr[inout, ccb] { // union ccb { // cgdl: ccb_getdevlist { // ccb_h: ccb_hdr { // pinfo: cam_pinfo { // priority: int32 = 0x235 (4 bytes) // generation: int32 = 0x2 (4 bytes) // index: int32 = 0x7b (4 bytes) // } // pad = 0x0 (4 bytes) // xpt_links: union camq_entry { // next: const = 0x0 (8 bytes) // } // sim_links: union camq_entry { // next: const = 0x0 (8 bytes) // } // periph_links: union camq_entry { // next: const = 0x0 (8 bytes) // } // retry_count: int16 = 0x2 (2 bytes) // alloc_flags: int16 = 0x2 (2 bytes) // pad = 0x0 (4 bytes) // cbfcnp: intptr = 0x3 (8 bytes) // func_code: ccb_hdr_func_codes = 0x100 (4 bytes) // status: int32 = 0x7 (4 bytes) // path: const = 0x0 (8 bytes) // path_id: int32 = 0x16e6 (4 bytes) // target_id: int32 = 0x40 (4 bytes) // target_lun: int64 = 0x91d (8 bytes) // flags: int32 = 0x3 (4 bytes) // xflags: int32 = 0xffffffff (4 bytes) // periph_priv: union ccb_ppriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // field: intptr = 0x0 (8 bytes) // } // union ccb_priv_entry { // field: intptr = 0x7 (8 bytes) // } // } // } // sim_priv: union ccb_spriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // ptr: intptr = 0x8 (8 bytes) // } // union ccb_priv_entry { // ptr: intptr = 0x6 (8 bytes) // } // } // } // qos: union ccb_qos_area { // periph_data: intptr = 0x7fffffffffffffff (8 bytes) // } // timeout: int32 = 0x200 (4 bytes) // pad = 0x0 (4 bytes) // softtimeout: timeval { // sec: intptr = 0x0 (8 bytes) // usec: intptr = 0x2 (8 bytes) // } // } // periph_name: buffer: {bf fe e6 1d e5 51 50 19 31 e0 cf f0 14 e7 83 // 2b} (length 0x10) unit_number: int32 = 0x1fe5eee8 (4 bytes) // generation: int32 = 0x580000 (4 bytes) // index: int32 = 0xb23 (4 bytes) // status: ccb_getdevlist_status_e = 0x1 (4 bytes) // } // } // } // ] *(uint32_t*)0x200000000380 = 0x235; *(uint32_t*)0x200000000384 = 2; *(uint32_t*)0x200000000388 = 0x7b; *(uint64_t*)0x200000000390 = 0; *(uint64_t*)0x200000000398 = 0; *(uint64_t*)0x2000000003a0 = 0; *(uint16_t*)0x2000000003a8 = 2; *(uint16_t*)0x2000000003aa = 2; *(uint64_t*)0x2000000003b0 = 3; *(uint32_t*)0x2000000003b8 = 0x100; *(uint32_t*)0x2000000003bc = 7; *(uint64_t*)0x2000000003c0 = 0; *(uint32_t*)0x2000000003c8 = 0x16e6; *(uint32_t*)0x2000000003cc = 0x40; *(uint64_t*)0x2000000003d0 = 0x91d; *(uint32_t*)0x2000000003d8 = 3; *(uint32_t*)0x2000000003dc = -1; *(uint64_t*)0x2000000003e0 = 0; *(uint64_t*)0x2000000003e8 = 7; *(uint64_t*)0x2000000003f0 = 8; *(uint64_t*)0x2000000003f8 = 6; *(uint64_t*)0x200000000400 = 0x7fffffffffffffff; *(uint32_t*)0x200000000408 = 0x200; *(uint64_t*)0x200000000410 = 0; *(uint64_t*)0x200000000418 = 2; memcpy((void*)0x200000000420, "\xbf\xfe\xe6\x1d\xe5\x51\x50\x19\x31\xe0\xcf\xf0\x14\xe7\x83\x2b", 16); *(uint32_t*)0x200000000430 = 0x1fe5eee8; *(uint32_t*)0x200000000434 = 0x580000; *(uint32_t*)0x200000000438 = 0xb23; *(uint32_t*)0x20000000043c = 1; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc4e01a02ul, /*arg=*/0x200000000380ul); return 0; }