// https://syzkaller.appspot.com/bug?id=ba641cf1c28ad207baa7f35534b2d6230d939cf0 // 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*)0x200000000000, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000000ul, /*flags=O_RDWR*/ 2ul, /*mode=*/0ul); if (res != -1) r[0] = res; // ioctl$CAMIOQUEUE arguments: [ // fd: fd_pass (resource) // cmd: const = 0x20001a04 (8 bytes) // arg: ptr[in, ptr[in, ccb]] { // ptr[in, ccb] { // union ccb { // cpi: ccb_pathinq { // ccb_h: ccb_hdr { // pinfo: cam_pinfo { // priority: int32 = 0xffffffff (4 bytes) // generation: int32 = 0x80000001 (4 bytes) // index: int32 = 0x6 (4 bytes) // } // pad = 0x0 (4 bytes) // xpt_links: union camq_entry { // prev: const = 0x19 (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 = 0x7 (2 bytes) // alloc_flags: int16 = 0x3 (2 bytes) // pad = 0x0 (4 bytes) // cbfcnp: intptr = 0x7f (8 bytes) // func_code: ccb_hdr_func_codes = 0x7 (4 bytes) // status: int32 = 0x4 (4 bytes) // path: const = 0x0 (8 bytes) // path_id: int32 = 0x6 (4 bytes) // target_id: int32 = 0x7f (4 bytes) // target_lun: int64 = 0x80000000 (8 bytes) // flags: int32 = 0xffffffff (4 bytes) // xflags: int32 = 0xa1 (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 = 0x2 (8 bytes) // } // } // } // sim_priv: union ccb_spriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // field: intptr = 0x1 (8 bytes) // } // union ccb_priv_entry { // ptr: intptr = 0xc7 (8 bytes) // } // } // } // qos: union ccb_qos_area { // periph_data: intptr = 0xa7 (8 bytes) // } // timeout: int32 = 0x2 (4 bytes) // pad = 0x0 (4 bytes) // softtimeout: timeval { // sec: intptr = 0x3 (8 bytes) // usec: intptr = 0x400 (8 bytes) // } // } // version_num: int8 = 0x6 (1 bytes) // hba_inquiry: int8 = 0x8 (1 bytes) // target_sprt: int16 = 0x1000 (2 bytes) // hba_misc: int32 = 0x4d6a0000 (4 bytes) // hba_eng_cnt: int16 = 0x200 (2 bytes) // vuhba_flags: buffer: {db e0 44 1e 81 42 e8 f5 8a 1b 8a bb bd 86} // (length 0xe) max_target: int32 = 0xc758 (4 bytes) max_lun: int32 // = 0x3 (4 bytes) async_flags: int32 = 0x9 (4 bytes) hpath_id: // int32 = 0x2 (4 bytes) initiator_id: int32 = 0x8 (4 bytes) // sim_vid: buffer: {83 76 c9 24 a7 b0 27 96 ce 3e d1 e2 a7 2a e6 // 73} (length 0x10) hba_vid: buffer: {0e 1c eb 8f df c9 fe b7 63 // 8a 97 92 ac 0c b5 07} (length 0x10) dev_name: buffer: {26 08 ba // 07 b4 be 00 00 00 00 00 00 00 00 00 00} (length 0x10) // unit_number: int32 = 0x6 (4 bytes) // bus_id: int32 = 0x8 (4 bytes) // base_transfer_speed: int32 = 0x4 (4 bytes) // protocol: cam_proto = 0x8 (4 bytes) // protocol_version: int32 = 0x9 (4 bytes) // transport: cam_xport = 0xe (4 bytes) // transport_version: int32 = 0x6 (4 bytes) // xport_specific: union ccb_pathinq_xport_specific { // nvme: ccb_pathinq_settings_nvme { // nsid: int32 = 0x7ffffffe (4 bytes) // domain: int32 = 0x3000 (4 bytes) // bus: int8 = 0x6 (1 bytes) // slot: int8 = 0x0 (1 bytes) // function: int8 = 0x2e (1 bytes) // extra: int8 = 0x0 (1 bytes) // dev_name: buffer: {c4 0f 5c 45 e7 1b b9 97 59 de 18 9d 94 23 // 49 b4 97 95 ad 76 56 d0 8d c8 9d 00 1e 91 6a 0d 46 c3 93 02 // 0c f4 a8 bb b2 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x34) // } // } // maxio: int32 = 0x0 (4 bytes) // hba_vendor: int16 = 0x1ff (2 bytes) // hba_device: int16 = 0x6 (2 bytes) // hba_subvendor: int16 = 0xa (2 bytes) // hba_subdevice: int16 = 0x8001 (2 bytes) // pad = 0x0 (4 bytes) // } // } // } // } // ] *(uint64_t*)0x200000000040 = 0x200000000080; *(uint32_t*)0x200000000080 = -1; *(uint32_t*)0x200000000084 = 0x80000001; *(uint32_t*)0x200000000088 = 6; *(uint64_t*)0x200000000090 = 0x19; *(uint64_t*)0x200000000098 = 0; *(uint64_t*)0x2000000000a0 = 0; *(uint16_t*)0x2000000000a8 = 7; *(uint16_t*)0x2000000000aa = 3; *(uint64_t*)0x2000000000b0 = 0x7f; *(uint32_t*)0x2000000000b8 = 7; *(uint32_t*)0x2000000000bc = 4; *(uint64_t*)0x2000000000c0 = 0; *(uint32_t*)0x2000000000c8 = 6; *(uint32_t*)0x2000000000cc = 0x7f; *(uint64_t*)0x2000000000d0 = 0x80000000; *(uint32_t*)0x2000000000d8 = -1; *(uint32_t*)0x2000000000dc = 0xa1; *(uint64_t*)0x2000000000e0 = 0; *(uint64_t*)0x2000000000e8 = 2; *(uint64_t*)0x2000000000f0 = 1; *(uint64_t*)0x2000000000f8 = 0xc7; *(uint64_t*)0x200000000100 = 0xa7; *(uint32_t*)0x200000000108 = 2; *(uint64_t*)0x200000000110 = 3; *(uint64_t*)0x200000000118 = 0x400; *(uint8_t*)0x200000000120 = 6; *(uint8_t*)0x200000000121 = 8; *(uint16_t*)0x200000000122 = 0x1000; *(uint32_t*)0x200000000124 = 0x4d6a0000; *(uint16_t*)0x200000000128 = 0x200; memcpy((void*)0x20000000012a, "\xdb\xe0\x44\x1e\x81\x42\xe8\xf5\x8a\x1b\x8a\xbb\xbd\x86", 14); *(uint32_t*)0x200000000138 = 0xc758; *(uint32_t*)0x20000000013c = 3; *(uint32_t*)0x200000000140 = 9; *(uint32_t*)0x200000000144 = 2; *(uint32_t*)0x200000000148 = 8; memcpy((void*)0x20000000014c, "\x83\x76\xc9\x24\xa7\xb0\x27\x96\xce\x3e\xd1\xe2\xa7\x2a\xe6\x73", 16); memcpy((void*)0x20000000015c, "\x0e\x1c\xeb\x8f\xdf\xc9\xfe\xb7\x63\x8a\x97\x92\xac\x0c\xb5\x07", 16); memcpy((void*)0x20000000016c, "\x26\x08\xba\x07\xb4\xbe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16); *(uint32_t*)0x20000000017c = 6; *(uint32_t*)0x200000000180 = 8; *(uint32_t*)0x200000000184 = 4; *(uint32_t*)0x200000000188 = 8; *(uint32_t*)0x20000000018c = 9; *(uint32_t*)0x200000000190 = 0xe; *(uint32_t*)0x200000000194 = 6; *(uint32_t*)0x200000000198 = 0x7ffffffe; *(uint32_t*)0x20000000019c = 0x3000; *(uint8_t*)0x2000000001a0 = 6; *(uint8_t*)0x2000000001a1 = 0; *(uint8_t*)0x2000000001a2 = 0x2e; *(uint8_t*)0x2000000001a3 = 0; memcpy( (void*)0x2000000001a4, "\xc4\x0f\x5c\x45\xe7\x1b\xb9\x97\x59\xde\x18\x9d\x94\x23\x49\xb4\x97\x95" "\xad\x76\x56\xd0\x8d\xc8\x9d\x00\x1e\x91\x6a\x0d\x46\xc3\x93\x02\x0c\xf4" "\xa8\xbb\xb2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 52); *(uint32_t*)0x200000000218 = 0; *(uint16_t*)0x20000000021c = 0x1ff; *(uint16_t*)0x20000000021e = 6; *(uint16_t*)0x200000000220 = 0xa; *(uint16_t*)0x200000000222 = 0x8001; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0x20001a04ul, /*arg=*/0x200000000040ul); return 0; }