// https://syzkaller.appspot.com/bug?id=5d219f42b3182fd7f2380d391f7198a74ccb43f7 // 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)) { } // ftruncate arguments: [ // fd: fd (resource) // len: intptr = 0x8531 (8 bytes) // ] syscall(SYS_ftruncate, /*fd=*/(intptr_t)-1, /*len=*/0x8531ul); // 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*)0x200000000100, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000100ul, /*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 = 0x1ff (4 bytes) // generation: int32 = 0x6 (4 bytes) // index: int32 = 0x5d5 (4 bytes) // } // pad = 0x0 (4 bytes) // xpt_links: union camq_entry { // next: const = 0x0 (8 bytes) // } // sim_links: union camq_entry { // prev: 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 = 0x5 (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 { // field: intptr = 0x7f (8 bytes) // } // union ccb_priv_entry { // ptr: intptr = 0x2 (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 { // field: intptr = 0x5 (8 bytes) // } // } // } // qos: union ccb_qos_area { // periph_data: intptr = 0x9 (8 bytes) // } // timeout: int32 = 0x5 (4 bytes) // pad = 0x0 (4 bytes) // softtimeout: timeval { // sec: intptr = 0x8000000db0 (8 bytes) // usec: intptr = 0xffffffffffffffff (8 bytes) // } // } // status: ccb_dev_match_status = 0x1 (4 bytes) // num_patterns: int32 = 0x4000009 (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 = 0xfffffffc (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 = 0xfffffffffffff22d (8 bytes) // } // } // } // } // } // ] *(uint32_t*)0x200000000200 = 0x1ff; *(uint32_t*)0x200000000204 = 6; *(uint32_t*)0x200000000208 = 0x5d5; *(uint64_t*)0x200000000210 = 0; *(uint64_t*)0x200000000218 = 0; *(uint64_t*)0x200000000220 = 0; *(uint16_t*)0x200000000228 = 5; *(uint16_t*)0x20000000022a = 4; *(uint64_t*)0x200000000230 = 0xffffffff86f65ab3; *(uint32_t*)0x200000000238 = 3; *(uint32_t*)0x20000000023c = 0x200; *(uint64_t*)0x200000000240 = 0; *(uint32_t*)0x200000000248 = 0x2e; *(uint32_t*)0x20000000024c = 5; *(uint64_t*)0x200000000250 = 0xe; *(uint32_t*)0x200000000258 = 4; *(uint32_t*)0x20000000025c = 0x156; *(uint64_t*)0x200000000260 = 0x7f; *(uint64_t*)0x200000000268 = 2; *(uint64_t*)0x200000000270 = 8; *(uint64_t*)0x200000000278 = 5; *(uint64_t*)0x200000000280 = 9; *(uint32_t*)0x200000000288 = 5; *(uint64_t*)0x200000000290 = 0x8000000db0; *(uint64_t*)0x200000000298 = -1; *(uint32_t*)0x2000000002a0 = 1; *(uint32_t*)0x2000000002a4 = 0x4000009; *(uint32_t*)0x2000000002a8 = 0x238b7853; *(uint64_t*)0x2000000002b0 = 0; *(uint32_t*)0x2000000002b8 = 7; *(uint32_t*)0x2000000002bc = 0x11; *(uint64_t*)0x2000000002c0 = 0; *(uint32_t*)0x2000000002c8 = 2; *(uint32_t*)0x2000000002cc = 4; *(uint32_t*)0x2000000002d0 = 5; *(uint32_t*)0x2000000002d4 = 0xfffffffc; *(uint32_t*)0x2000000002d8 = 0xf00; *(uint64_t*)0x2000000002e0 = 0xd69; *(uint64_t*)0x2000000002e8 = 6; *(uint64_t*)0x2000000002f0 = 0xb310; *(uint64_t*)0x2000000002f8 = 9; *(uint64_t*)0x200000000300 = 0xfffffffffffff22d; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc4e01a02ul, /*arg=*/0x200000000200ul); return 0; }