// https://syzkaller.appspot.com/bug?id=f9b01630f485f7543062ce8c950599021f8b84d1 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*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)) { } // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 64 65 62 75 67 00} (length 0x8) // } // mode: open_mode = 0x1ff (8 bytes) // ] memcpy((void*)0x200000000000, "./debug\000", 8); syscall( __NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000000ul, /*mode=S_IXOTH|S_IWOTH|S_IROTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IXUSR|S_IWUSR|0x100*/ 0x1fful); // mount arguments: [ // src: nil // dst: ptr[in, buffer] { // buffer: {2e 2f 64 65 62 75 67 00} (length 0x8) // } // type: ptr[in, buffer] { // buffer: {64 65 62 75 67 66 73 00} (length 0x8) // } // flags: mount_flags = 0x0 (8 bytes) // data: nil // ] memcpy((void*)0x200000000200, "./debug\000", 8); memcpy((void*)0x200000000300, "debugfs\000", 8); syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000000200ul, /*type=*/0x200000000300ul, /*flags=*/0ul, /*data=*/0ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 64 65 62 75 67 2f 73 70 6c 69 74 5f 68 75 67 65 5f 70 // 61 67 65 73 00} (length 0x19) // } // flags: open_flags = 0x1 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000400, "./debug/split_huge_pages\000", 25); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000400ul, /*flags=O_WRONLY*/ 1, /*mode=*/0); if (res != -1) r[0] = res; // write$P9_RLERRORu arguments: [ // fd: wfd9p (resource) // data: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {2f 16 30 6b 96 21 8b c2 e5 22 ff 84 ce 2f 7a 9c // fd e2 be f4 c8 8b 0b 1f b8 01 ba 72 de 37 bc 5c 28 a3 7f ac 70 22 // 98 d6 a2 3b b3 9a 6d 93 c6 d0 89 d9 2d af 1d 82 d7 53 ed 31 d0 f6 // 99 e6 7c 2f a7 8d d1 42 3d c8 c6 9d 35 82 bc 6e 62 36 b8 17 1a b2 // 3c 1d b6 4a 07 d7 ac 95 49 0a c4 bd 73 33 c8 92 58 69 81 8d 0f b9 // a8 08 52 2c 5e ad 7a bd d9 19 c0 c0 81 0e 04 07 4a 4d 47 54 c3 45 // ec be 17 35 6b 12 c9 75 71 a7 49 79 a3 a6 b4 6c 43 f0 c0 44 c0 96} // (length 0x94) // } // } // } // size: bytesize = 0xf (8 bytes) // ] memcpy((void*)0x200000000340, "\x2f\x16\x30\x6b\x96\x21\x8b\xc2\xe5\x22\xff\x84\xce\x2f\x7a\x9c\xfd" "\xe2\xbe\xf4\xc8\x8b\x0b\x1f\xb8\x01\xba\x72\xde\x37\xbc\x5c\x28\xa3" "\x7f\xac\x70\x22\x98\xd6\xa2\x3b\xb3\x9a\x6d\x93\xc6\xd0\x89\xd9\x2d" "\xaf\x1d\x82\xd7\x53\xed\x31\xd0\xf6\x99\xe6\x7c\x2f\xa7\x8d\xd1\x42" "\x3d\xc8\xc6\x9d\x35\x82\xbc\x6e\x62\x36\xb8\x17\x1a\xb2\x3c\x1d\xb6" "\x4a\x07\xd7\xac\x95\x49\x0a\xc4\xbd\x73\x33\xc8\x92\x58\x69\x81\x8d" "\x0f\xb9\xa8\x08\x52\x2c\x5e\xad\x7a\xbd\xd9\x19\xc0\xc0\x81\x0e\x04" "\x07\x4a\x4d\x47\x54\xc3\x45\xec\xbe\x17\x35\x6b\x12\xc9\x75\x71\xa7" "\x49\x79\xa3\xa6\xb4\x6c\x43\xf0\xc0\x44\xc0\x96", 148); syscall(__NR_write, /*fd=*/r[0], /*data=*/0x200000000340ul, /*size=*/0xful); return 0; }