// https://syzkaller.appspot.com/bug?id=736921746ecb7f3629801f0b2d9a124275453f63 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include 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; 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 = 0x7fff (2 bytes) // fid_data0: int16 = 0xffff (2 bytes) // fid_data: buffer: {f9 00 00 00 fe ff ff ff 00 00 00 00 00 00 00 // 00} (length 0x10) // } // } // } // flags: open_flags = 0x80 (8 bytes) // ] // returns fd *(uint32_t*)0x200000000000 = 0x70; *(uint32_t*)0x200000000004 = 0x32; *(uint16_t*)0x200000000008 = 0x7fff; *(uint16_t*)0x20000000000a = -1; memcpy((void*)0x20000000000c, "\xf9\x00\x00\x00\xfe\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00", 16); syscall(SYS_fhopen, /*fhp=*/0x200000000000ul, /*flags=O_SYNC*/ 0x80ul); return 0; }