// https://syzkaller.appspot.com/bug?id=4dda623b413f675b255dbda7e2f4ffc0a72c0e02 // 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)) { } // fhopen arguments: [ // fhp: ptr[in, fhandle] { // fhandle { // fh_fsid: fsid { // val: array[int32] { // int32 = 0x70 (4 bytes) // int32 = 0x32 (4 bytes) // } // } // fh_fid: fid { // fid_len: int16 = 0x5 (2 bytes) // fid_data0: int16 = 0xffff (2 bytes) // fid_data: buffer: {04 00 00 00 00 00 00 00 00 00 00 00 00 00 10 // 00} (length 0x10) // } // } // } // flags: open_flags = 0x0 (8 bytes) // ] // returns fd *(uint32_t*)0x200000000000 = 0x70; *(uint32_t*)0x200000000004 = 0x32; *(uint16_t*)0x200000000008 = 5; *(uint16_t*)0x20000000000a = -1; memcpy((void*)0x20000000000c, "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", 16); res = syscall(SYS_fhopen, /*fhp=*/0x200000000000ul, /*flags=*/0ul); if (res != -1) r[0] = res; // freebsd11_getdents arguments: [ // fd: fd_dir (resource) // ent: ptr[out, buffer] { // buffer: (DirOut) // } // count: len = 0x20 (8 bytes) // ] syscall(SYS_freebsd11_getdents, /*fd=*/r[0], /*ent=*/0x200000000080ul, /*count=*/0x20ul); for (int i = 0; i < 64; i++) { syscall(SYS_freebsd11_getdents, /*fd=*/r[0], /*ent=*/0x200000000080ul, /*count=*/0x20ul); } return 0; }