// https://syzkaller.appspot.com/bug?id=217f97c233f48820b6e5523aa936a016a82697a5 // 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*)0x200000000d80, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000d80ul, /*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 { // cdm: ccb_dev_match { // ccb_h: ccb_hdr { // pinfo: cam_pinfo { // priority: int32 = 0x1000 (4 bytes) // generation: int32 = 0x6 (4 bytes) // index: int32 = 0x5d5 (4 bytes) // } // pad = 0x0 (4 bytes) // xpt_links: union camq_entry { // prev: const = 0x0 (8 bytes) // } // sim_links: union camq_entry { // next: const = 0x0 (8 bytes) // } // periph_links: union camq_entry { // prev: const = 0x0 (8 bytes) // } // retry_count: int16 = 0x5 (2 bytes) // alloc_flags: int16 = 0x4 (2 bytes) // pad = 0x0 (4 bytes) // cbfcnp: intptr = 0xffffffff86f65ab3 (8 bytes) // func_code: ccb_hdr_func_codes = 0x3 (4 bytes) // status: int32 = 0x200 (4 bytes) // path: const = 0x0 (8 bytes) // path_id: int32 = 0x2e (4 bytes) // target_id: int32 = 0x800 (4 bytes) // target_lun: int64 = 0xe (8 bytes) // flags: int32 = 0x4 (4 bytes) // xflags: int32 = 0x156 (4 bytes) // periph_priv: union ccb_ppriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // ptr: intptr = 0x8000000000000000 (8 bytes) // } // union ccb_priv_entry { // field: intptr = 0x1 (8 bytes) // } // } // } // sim_priv: union ccb_spriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // ptr: intptr = 0x36 (8 bytes) // } // union ccb_priv_entry { // field: intptr = 0x5 (8 bytes) // } // } // } // qos: union ccb_qos_area { // sim_data: intptr = 0x1 (8 bytes) // } // timeout: int32 = 0x5 (4 bytes) // pad = 0x0 (4 bytes) // softtimeout: timeval { // sec: intptr = 0xdb0 (8 bytes) // usec: intptr = 0x0 (8 bytes) // } // } // status: ccb_dev_match_status = 0x1 (4 bytes) // num_patterns: int32 = 0x4 (4 bytes) // pattern_buf_len: int32 = 0x238b7853 (4 bytes) // pad = 0x0 (4 bytes) // patterns: nil // num_matches: int32 = 0x7 (4 bytes) // match_buf_len: int32 = 0x11 (4 bytes) // matches: nil // pos: ccb_dev_position { // generations: array[int32] { // int32 = 0x2 (4 bytes) // int32 = 0x4 (4 bytes) // int32 = 0x5 (4 bytes) // int32 = 0x4 (4 bytes) // } // position_type: dev_pos_type = 0xf00 (4 bytes) // pad = 0x0 (4 bytes) // cookie: ccb_dm_cookie { // bus: intptr = 0xd69 (8 bytes) // target: intptr = 0x6 (8 bytes) // device: intptr = 0xb310 (8 bytes) // periph: intptr = 0x9 (8 bytes) // pdrv: intptr = 0x7 (8 bytes) // } // } // } // } // } // ] *(uint32_t*)0x200000000dc0 = 0x1000; *(uint32_t*)0x200000000dc4 = 6; *(uint32_t*)0x200000000dc8 = 0x5d5; *(uint64_t*)0x200000000dd0 = 0; *(uint64_t*)0x200000000dd8 = 0; *(uint64_t*)0x200000000de0 = 0; *(uint16_t*)0x200000000de8 = 5; *(uint16_t*)0x200000000dea = 4; *(uint64_t*)0x200000000df0 = 0xffffffff86f65ab3; *(uint32_t*)0x200000000df8 = 3; *(uint32_t*)0x200000000dfc = 0x200; *(uint64_t*)0x200000000e00 = 0; *(uint32_t*)0x200000000e08 = 0x2e; *(uint32_t*)0x200000000e0c = 0x800; *(uint64_t*)0x200000000e10 = 0xe; *(uint32_t*)0x200000000e18 = 4; *(uint32_t*)0x200000000e1c = 0x156; *(uint64_t*)0x200000000e20 = 0x8000000000000000; *(uint64_t*)0x200000000e28 = 1; *(uint64_t*)0x200000000e30 = 0x36; *(uint64_t*)0x200000000e38 = 5; *(uint64_t*)0x200000000e40 = 1; *(uint32_t*)0x200000000e48 = 5; *(uint64_t*)0x200000000e50 = 0xdb0; *(uint64_t*)0x200000000e58 = 0; *(uint32_t*)0x200000000e60 = 1; *(uint32_t*)0x200000000e64 = 4; *(uint32_t*)0x200000000e68 = 0x238b7853; *(uint64_t*)0x200000000e70 = 0; *(uint32_t*)0x200000000e78 = 7; *(uint32_t*)0x200000000e7c = 0x11; *(uint64_t*)0x200000000e80 = 0; *(uint32_t*)0x200000000e88 = 2; *(uint32_t*)0x200000000e8c = 4; *(uint32_t*)0x200000000e90 = 5; *(uint32_t*)0x200000000e94 = 4; *(uint32_t*)0x200000000e98 = 0xf00; *(uint64_t*)0x200000000ea0 = 0xd69; *(uint64_t*)0x200000000ea8 = 6; *(uint64_t*)0x200000000eb0 = 0xb310; *(uint64_t*)0x200000000eb8 = 9; *(uint64_t*)0x200000000ec0 = 7; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc4e01a02ul, /*arg=*/0x200000000dc0ul); return 0; }