// https://syzkaller.appspot.com/bug?id=46e7b5852ab512ad509aea38e57d4d5dfe152e2d // 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)) { } // writev arguments: [ // fd: fd (resource) // vec: ptr[in, array[iovec_in]] { // array[iovec_in] { // iovec_in { // addr: nil // len: len = 0x0 (8 bytes) // } // iovec_in { // addr: nil // len: len = 0x0 (8 bytes) // } // iovec_in { // addr: ptr[in, buffer] { // buffer: {} (length 0x0) // } // len: len = 0x0 (8 bytes) // } // iovec_in { // addr: nil // len: len = 0x0 (8 bytes) // } // iovec_in { // addr: nil // len: len = 0x0 (8 bytes) // } // } // } // vlen: len = 0x5 (8 bytes) // ] *(uint64_t*)0x200000000500 = 0; *(uint64_t*)0x200000000508 = 0; *(uint64_t*)0x200000000510 = 0; *(uint64_t*)0x200000000518 = 0; *(uint64_t*)0x200000000520 = 0x200000000680; *(uint64_t*)0x200000000528 = 0; *(uint64_t*)0x200000000530 = 0; *(uint64_t*)0x200000000538 = 0; *(uint64_t*)0x200000000540 = 0; *(uint64_t*)0x200000000548 = 0; syscall(SYS_writev, /*fd=*/(intptr_t)-1, /*vec=*/0x200000000500ul, /*vlen=*/5ul); // 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*)0x200000000300, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000300ul, /*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 = 0x8 (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 = 0x7 (8 bytes) // func_code: ccb_hdr_func_codes = 0x71f (4 bytes) // status: int32 = 0x2 (4 bytes) // path: const = 0x0 (8 bytes) // path_id: int32 = 0x2e (4 bytes) // target_id: int32 = 0x6 (4 bytes) // target_lun: int64 = 0x901 (8 bytes) // flags: int32 = 0x4 (4 bytes) // xflags: int32 = 0x80000001 (4 bytes) // periph_priv: union ccb_ppriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // ptr: intptr = 0x0 (8 bytes) // } // union ccb_priv_entry { // field: intptr = 0x3f (8 bytes) // } // } // } // sim_priv: union ccb_spriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // ptr: intptr = 0x7fff (8 bytes) // } // union ccb_priv_entry { // field: intptr = 0x4fb (8 bytes) // } // } // } // qos: union ccb_qos_area { // sim_data: intptr = 0x4 (8 bytes) // } // timeout: int32 = 0x5 (4 bytes) // pad = 0x0 (4 bytes) // softtimeout: timeval { // sec: intptr = 0x3 (8 bytes) // usec: intptr = 0x4 (8 bytes) // } // } // status: ccb_dev_match_status = 0x5 (4 bytes) // num_patterns: int32 = 0x4 (4 bytes) // pattern_buf_len: int32 = 0x238b3853 (4 bytes) // pad = 0x0 (4 bytes) // patterns: nil // num_matches: int32 = 0xffff (4 bytes) // match_buf_len: int32 = 0xd (4 bytes) // matches: nil // pos: ccb_dev_position { // generations: array[int32] { // int32 = 0x9 (4 bytes) // int32 = 0x2 (4 bytes) // int32 = 0x9 (4 bytes) // int32 = 0x4 (4 bytes) // } // position_type: dev_pos_type = 0x100 (4 bytes) // pad = 0x0 (4 bytes) // cookie: ccb_dm_cookie { // bus: intptr = 0x7 (8 bytes) // target: intptr = 0xa (8 bytes) // device: intptr = 0xb310 (8 bytes) // periph: intptr = 0x25f (8 bytes) // pdrv: intptr = 0x7 (8 bytes) // } // } // } // } // } // ] *(uint32_t*)0x200000000340 = 0x1000; *(uint32_t*)0x200000000344 = 8; *(uint32_t*)0x200000000348 = 0x5d5; *(uint64_t*)0x200000000350 = 0; *(uint64_t*)0x200000000358 = 0; *(uint64_t*)0x200000000360 = 0; *(uint16_t*)0x200000000368 = 5; *(uint16_t*)0x20000000036a = 4; *(uint64_t*)0x200000000370 = 7; *(uint32_t*)0x200000000378 = 0x71f; *(uint32_t*)0x20000000037c = 2; *(uint64_t*)0x200000000380 = 0; *(uint32_t*)0x200000000388 = 0x2e; *(uint32_t*)0x20000000038c = 6; *(uint64_t*)0x200000000390 = 0x901; *(uint32_t*)0x200000000398 = 4; *(uint32_t*)0x20000000039c = 0x80000001; *(uint64_t*)0x2000000003a0 = 0; *(uint64_t*)0x2000000003a8 = 0x3f; *(uint64_t*)0x2000000003b0 = 0x7fff; *(uint64_t*)0x2000000003b8 = 0x4fb; *(uint64_t*)0x2000000003c0 = 4; *(uint32_t*)0x2000000003c8 = 5; *(uint64_t*)0x2000000003d0 = 3; *(uint64_t*)0x2000000003d8 = 4; *(uint32_t*)0x2000000003e0 = 5; *(uint32_t*)0x2000000003e4 = 4; *(uint32_t*)0x2000000003e8 = 0x238b3853; *(uint64_t*)0x2000000003f0 = 0; *(uint32_t*)0x2000000003f8 = 0xffff; *(uint32_t*)0x2000000003fc = 0xd; *(uint64_t*)0x200000000400 = 0; *(uint32_t*)0x200000000408 = 9; *(uint32_t*)0x20000000040c = 2; *(uint32_t*)0x200000000410 = 9; *(uint32_t*)0x200000000414 = 4; *(uint32_t*)0x200000000418 = 0x100; *(uint64_t*)0x200000000420 = 7; *(uint64_t*)0x200000000428 = 0xa; *(uint64_t*)0x200000000430 = 0xb310; *(uint64_t*)0x200000000438 = 0x25f; *(uint64_t*)0x200000000440 = 7; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc4e01a02ul, /*arg=*/0x200000000340ul); return 0; }