// 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)) { } // 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 { // 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 { // prev: 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 = 0x0 (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 { // ptr: intptr = 0x8000000000000000 (8 bytes) // } // union ccb_priv_entry { // ptr: intptr = 0x7 (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 { // periph_data: intptr = 0x9 (8 bytes) // } // timeout: int32 = 0x5 (4 bytes) // pad = 0x0 (4 bytes) // softtimeout: timeval { // sec: intptr = 0xdb0 (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 = 0xffff0d3f (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*)0x200000000080 = 0x1ff; *(uint32_t*)0x200000000084 = 6; *(uint32_t*)0x200000000088 = 0x5d5; *(uint64_t*)0x200000000090 = 0; *(uint64_t*)0x200000000098 = 0; *(uint64_t*)0x2000000000a0 = 0; *(uint16_t*)0x2000000000a8 = 5; *(uint16_t*)0x2000000000aa = 4; *(uint64_t*)0x2000000000b0 = 0; *(uint32_t*)0x2000000000b8 = 3; *(uint32_t*)0x2000000000bc = 0x200; *(uint64_t*)0x2000000000c0 = 0; *(uint32_t*)0x2000000000c8 = 0x2e; *(uint32_t*)0x2000000000cc = 5; *(uint64_t*)0x2000000000d0 = 0xe; *(uint32_t*)0x2000000000d8 = 4; *(uint32_t*)0x2000000000dc = 0x156; *(uint64_t*)0x2000000000e0 = 0x8000000000000000; *(uint64_t*)0x2000000000e8 = 7; *(uint64_t*)0x2000000000f0 = 0x36; *(uint64_t*)0x2000000000f8 = 5; *(uint64_t*)0x200000000100 = 9; *(uint32_t*)0x200000000108 = 5; *(uint64_t*)0x200000000110 = 0xdb0; *(uint64_t*)0x200000000118 = -1; *(uint32_t*)0x200000000120 = 1; *(uint32_t*)0x200000000124 = 0x4000009; *(uint32_t*)0x200000000128 = 0x238b7853; *(uint64_t*)0x200000000130 = 0; *(uint32_t*)0x200000000138 = 7; *(uint32_t*)0x20000000013c = 0x11; *(uint64_t*)0x200000000140 = 0; *(uint32_t*)0x200000000148 = 2; *(uint32_t*)0x20000000014c = 4; *(uint32_t*)0x200000000150 = 5; *(uint32_t*)0x200000000154 = 0xffff0d3f; *(uint32_t*)0x200000000158 = 0xf00; *(uint64_t*)0x200000000160 = 0xd69; *(uint64_t*)0x200000000168 = 6; *(uint64_t*)0x200000000170 = 0xb310; *(uint64_t*)0x200000000178 = 9; *(uint64_t*)0x200000000180 = 0xfffffffffffff22d; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc4e01a02ul, /*arg=*/0x200000000080ul); return 0; }