// 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)) { } // 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*)0x2000000000c0, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x2000000000c0ul, /*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 { // csio: ccb_scsiio { // ccb_h: ccb_hdr { // pinfo: cam_pinfo { // priority: int32 = 0x4e5 (4 bytes) // generation: int32 = 0x80000000 (4 bytes) // index: int32 = 0x200 (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 { // next: const = 0x0 (8 bytes) // } // retry_count: int16 = 0x4 (2 bytes) // alloc_flags: int16 = 0x7f (2 bytes) // pad = 0x0 (4 bytes) // cbfcnp: intptr = 0x6 (8 bytes) // func_code: ccb_hdr_func_codes = 0xa (4 bytes) // status: int32 = 0x2 (4 bytes) // path: const = 0x0 (8 bytes) // path_id: int32 = 0x1 (4 bytes) // target_id: int32 = 0xfc (4 bytes) // target_lun: int64 = 0x0 (8 bytes) // flags: int32 = 0x561 (4 bytes) // xflags: int32 = 0x1000 (4 bytes) // periph_priv: union ccb_ppriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // ptr: intptr = 0xffffffffffffff7f (8 bytes) // } // union ccb_priv_entry { // field: intptr = 0x0 (8 bytes) // } // } // } // sim_priv: union ccb_spriv_area { // entries: array[ccb_priv_entry] { // union ccb_priv_entry { // ptr: intptr = 0x8945 (8 bytes) // } // union ccb_priv_entry { // ptr: intptr = 0x7fff (8 bytes) // } // } // } // qos: union ccb_qos_area { // sim_data: intptr = 0x8000000000000001 (8 bytes) // } // timeout: int32 = 0xfffffff6 (4 bytes) // pad = 0x0 (4 bytes) // softtimeout: timeval { // sec: intptr = 0x4 (8 bytes) // usec: intptr = 0x7 (8 bytes) // } // } // next_ccb: nil // req_map: nil // data_ptr: nil // dxfer_len: int32 = 0x9 (4 bytes) // sense_data: scsi_sense_data { // error_code: int8 = 0x1 (1 bytes) // sense_buf: buffer: {34 c3 df a4 63 dd 58 7e cc a7 50 55 ab 25 df // cf 29 cd 88 ce 12 3b 25 e2 90 cf e6 0d db 17 44 d0 a1 6f 3f e0 // d4 69 ed b9 eb 51 8d b6 5f 59 08 22 2e 88 b6 45 81 65 75 b9 00 // b5 74 25 51 ae eb 11 cd cc 70 30 f3 79 53 0f 05 f0 1b 0d 68 2c // d8 01 b9 60 a1 d2 df fa be 43 ec 49 11 e6 b0 44 35 9d ed 0b 3f // 5c 1e 09 c0 41 d9 a8 4f 0c 30 42 48 ca 99 33 51 ab 13 5d 49 fd // d4 2a 58 6e 39 4b 27 59 b1 a9 dd fa e4 4e 08 1d 30 87 f6 76 30 // d5 06 f5 c7 de dd de a6 20 ec ba 26 42 5a 21 b2 bd e8 8f d4 ba // 5e 40 9a 37 ee 95 87 ab 35 6f 03 dc a9 5b a0 50 b3 bf 7d 33 c8 // 0e c3 7b c2 85 9a 40 ba 56 74 0e c3 3a 3c f9 be b8 8a 65 b3 d5 // c4 58 f1 61 ee 2d f3 ff 52 d8 c3 ec ba 7c 5e ec 9b fd aa 86 6c // 33 1d e9 a7 7c d1 e3 b9 cb 29 77 59 66 85 1a e0 59 63 fe 47 3b // 01 17 36 09 61} (length 0xfb) // } // sense_len: int8 = 0x9 (1 bytes) // cdb_len: int8 = 0x6 (1 bytes) // sglist_cnt: int16 = 0x4 (2 bytes) // scsi_status: int8 = 0x80 (1 bytes) // sense_resid: int8 = 0xe (1 bytes) // pad = 0x0 (2 bytes) // resid: int32 = 0x400 (4 bytes) // pad = 0x0 (4 bytes) // cdb_io: cdb_t { // cdb_ptr: nil // cdb_bytes: buffer: {05 ea 1f 41 a1 ef cf b7 92 7a ab 4a 9f 97 33 // 67} (length 0x10) // } // msg_ptr: ptr[in, buffer] { // buffer: {} (length 0x0) // } // msg_len: int16 = 0x5 (2 bytes) // tag_action: int8 = 0xb (1 bytes) // priority: int8 = 0xb0 (1 bytes) // tag_id: int32 = 0x3 (4 bytes) // init_id: int32 = 0x3 (4 bytes) // pad = 0x0 (4 bytes) // } // } // } // ] *(uint32_t*)0x200000000340 = 0x4e5; *(uint32_t*)0x200000000344 = 0x80000000; *(uint32_t*)0x200000000348 = 0x200; *(uint64_t*)0x200000000350 = 0; *(uint64_t*)0x200000000358 = 0; *(uint64_t*)0x200000000360 = 0; *(uint16_t*)0x200000000368 = 4; *(uint16_t*)0x20000000036a = 0x7f; *(uint64_t*)0x200000000370 = 6; *(uint32_t*)0x200000000378 = 0xa; *(uint32_t*)0x20000000037c = 2; *(uint64_t*)0x200000000380 = 0; *(uint32_t*)0x200000000388 = 1; *(uint32_t*)0x20000000038c = 0xfc; *(uint64_t*)0x200000000390 = 0; *(uint32_t*)0x200000000398 = 0x561; *(uint32_t*)0x20000000039c = 0x1000; *(uint64_t*)0x2000000003a0 = 0xffffffffffffff7f; *(uint64_t*)0x2000000003a8 = 0; *(uint64_t*)0x2000000003b0 = 0x8945; *(uint64_t*)0x2000000003b8 = 0x7fff; *(uint64_t*)0x2000000003c0 = 0x8000000000000001; *(uint32_t*)0x2000000003c8 = 0xfffffff6; *(uint64_t*)0x2000000003d0 = 4; *(uint64_t*)0x2000000003d8 = 7; *(uint64_t*)0x2000000003e0 = 0; *(uint64_t*)0x2000000003e8 = 0; *(uint64_t*)0x2000000003f0 = 0; *(uint32_t*)0x2000000003f8 = 9; *(uint8_t*)0x2000000003fc = 1; memcpy( (void*)0x2000000003fd, "\x34\xc3\xdf\xa4\x63\xdd\x58\x7e\xcc\xa7\x50\x55\xab\x25\xdf\xcf\x29\xcd" "\x88\xce\x12\x3b\x25\xe2\x90\xcf\xe6\x0d\xdb\x17\x44\xd0\xa1\x6f\x3f\xe0" "\xd4\x69\xed\xb9\xeb\x51\x8d\xb6\x5f\x59\x08\x22\x2e\x88\xb6\x45\x81\x65" "\x75\xb9\x00\xb5\x74\x25\x51\xae\xeb\x11\xcd\xcc\x70\x30\xf3\x79\x53\x0f" "\x05\xf0\x1b\x0d\x68\x2c\xd8\x01\xb9\x60\xa1\xd2\xdf\xfa\xbe\x43\xec\x49" "\x11\xe6\xb0\x44\x35\x9d\xed\x0b\x3f\x5c\x1e\x09\xc0\x41\xd9\xa8\x4f\x0c" "\x30\x42\x48\xca\x99\x33\x51\xab\x13\x5d\x49\xfd\xd4\x2a\x58\x6e\x39\x4b" "\x27\x59\xb1\xa9\xdd\xfa\xe4\x4e\x08\x1d\x30\x87\xf6\x76\x30\xd5\x06\xf5" "\xc7\xde\xdd\xde\xa6\x20\xec\xba\x26\x42\x5a\x21\xb2\xbd\xe8\x8f\xd4\xba" "\x5e\x40\x9a\x37\xee\x95\x87\xab\x35\x6f\x03\xdc\xa9\x5b\xa0\x50\xb3\xbf" "\x7d\x33\xc8\x0e\xc3\x7b\xc2\x85\x9a\x40\xba\x56\x74\x0e\xc3\x3a\x3c\xf9" "\xbe\xb8\x8a\x65\xb3\xd5\xc4\x58\xf1\x61\xee\x2d\xf3\xff\x52\xd8\xc3\xec" "\xba\x7c\x5e\xec\x9b\xfd\xaa\x86\x6c\x33\x1d\xe9\xa7\x7c\xd1\xe3\xb9\xcb" "\x29\x77\x59\x66\x85\x1a\xe0\x59\x63\xfe\x47\x3b\x01\x17\x36\x09\x61", 251); *(uint8_t*)0x2000000004f8 = 9; *(uint8_t*)0x2000000004f9 = 6; *(uint16_t*)0x2000000004fa = 4; *(uint8_t*)0x2000000004fc = 0x80; *(uint8_t*)0x2000000004fd = 0xe; *(uint32_t*)0x200000000500 = 0x400; *(uint64_t*)0x200000000508 = 0; memcpy((void*)0x200000000510, "\x05\xea\x1f\x41\xa1\xef\xcf\xb7\x92\x7a\xab\x4a\x9f\x97\x33\x67", 16); *(uint64_t*)0x200000000520 = 0x200000000300; *(uint16_t*)0x200000000528 = 5; *(uint8_t*)0x20000000052a = 0xb; *(uint8_t*)0x20000000052b = 0xb0; *(uint32_t*)0x20000000052c = 3; *(uint32_t*)0x200000000530 = 3; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc4e01a02ul, /*arg=*/0x200000000340ul); return 0; }