// https://syzkaller.appspot.com/bug?id=90327807ff0b887e0095088ad6077d185a870e59 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*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=*/0x1000ul, /*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)) { } // mkdir arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // mode: open_mode = 0x0 (8 bytes) // ] memcpy((void*)0x200000000040, "./file0\000", 8); syscall(__NR_mkdir, /*path=*/0x200000000040ul, /*mode=*/0ul); // pipe2$9p arguments: [ // pipefd: ptr[out, pipe_9p] { // pipe_9p { // rfd: rfd9p (resource) // wfd: wfd9p (resource) // } // } // flags: pipe_flags = 0x800 (8 bytes) // ] res = syscall(__NR_pipe2, /*pipefd=*/0x200000000240ul, /*flags=O_NONBLOCK*/ 0x800ul); if (res != -1) { r[0] = *(uint32_t*)0x200000000240; r[1] = *(uint32_t*)0x200000000244; } // write$P9_RVERSION arguments: [ // fd: wfd9p (resource) // data: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {15 00 00 00 65 ff ff 09 7b 00 00 08 00 39 50 32 // 30 30 30 2e 4c} (length 0x15) // } // } // } // size: bytesize = 0x15 (8 bytes) // ] memcpy((void*)0x200000000080, "\x15\x00\x00\x00\x65\xff\xff\x09\x7b\x00\x00\x08\x00\x39\x50\x32\x30" "\x30\x30\x2e\x4c", 21); syscall(__NR_write, /*fd=*/r[1], /*data=*/0x200000000080ul, /*size=*/0x15ul); // dup arguments: [ // oldfd: fd (resource) // ] // returns fd res = syscall(__NR_dup, /*oldfd=*/r[1]); if (res != -1) r[2] = res; // write$FUSE_BMAP arguments: [ // fd: fd_fuse (resource) // arg: ptr[in, fuse_out_t[fuse_unique, fuse_bmap_out]] { // fuse_out_t[fuse_unique, fuse_bmap_out] { // len: len = 0x18 (4 bytes) // err: fuse_errors = 0x0 (4 bytes) // unique: fuse_unique (resource) // payload: fuse_bmap_out { // block: int64 = 0x0 (8 bytes) // } // } // } // len: bytesize = 0x18 (8 bytes) // ] *(uint32_t*)0x200000000100 = 0x18; *(uint32_t*)0x200000000104 = 0; *(uint64_t*)0x200000000108 = 0; *(uint64_t*)0x200000000110 = 0; syscall(__NR_write, /*fd=*/r[2], /*arg=*/0x200000000100ul, /*len=*/0x18ul); // write$FUSE_DIRENTPLUS arguments: [ // fd: fd_fuse (resource) // arg: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {b0 00 00 00 00 00 00 ab 28 4d c9 a9 40 95 f5 4e // 34 f1 1a 5a 48 0d 21 15 80 57 45 f8 a2 4d} (length 0x1e) // } // } // } // len: bytesize = 0xb0 (8 bytes) // ] memcpy((void*)0x200000000440, "\xb0\x00\x00\x00\x00\x00\x00\xab\x28\x4d\xc9\xa9\x40\x95\xf5\x4e\x34" "\xf1\x1a\x5a\x48\x0d\x21\x15\x80\x57\x45\xf8\xa2\x4d", 30); syscall(__NR_write, /*fd=*/r[2], /*arg=*/0x200000000440ul, /*len=*/0xb0ul); // write$FUSE_NOTIFY_RETRIEVE arguments: [ // fd: fd_fuse (resource) // arg: ptr[in, fuse_notify[FUSE_NOTIFY_RETRIEVE, // fuse_notify_retrieve_out]] { // fuse_notify[FUSE_NOTIFY_RETRIEVE, fuse_notify_retrieve_out] { // len: len = 0x14c (4 bytes) // err: const = 0x5 (4 bytes) // unique: const = 0x0 (8 bytes) // payload: fuse_notify_retrieve_out { // notify_unique: const = 0x0 (8 bytes) // nodeid: int64 = 0x0 (8 bytes) // offset: int64 = 0x0 (8 bytes) // size: int32 = 0x0 (4 bytes) // padding: const = 0x0 (4 bytes) // } // } // } // len: bytesize = 0x137 (8 bytes) // ] *(uint32_t*)0x2000000000c0 = 0x14c; *(uint32_t*)0x2000000000c4 = 5; *(uint64_t*)0x2000000000c8 = 0; *(uint64_t*)0x2000000000d0 = 0; *(uint64_t*)0x2000000000d8 = 0; *(uint64_t*)0x2000000000e0 = 0; *(uint32_t*)0x2000000000e8 = 0; *(uint32_t*)0x2000000000ec = 0; syscall(__NR_write, /*fd=*/r[2], /*arg=*/0x2000000000c0ul, /*len=*/0x137ul); // mount$9p_fd arguments: [ // src: const = 0x0 (8 bytes) // dst: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // type: ptr[in, buffer] { // buffer: {39 70 00} (length 0x3) // } // flags: mount_flags = 0x0 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {74 72 61 6e 73 3d 66 64 2c 72 66 64 6e 6f 3d} // (length 0xf) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 77 66 64 6e 6f 3d} (length 0x7) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // } // } // ] memcpy((void*)0x200000000040, "./file0\000", 8); memcpy((void*)0x200000000b80, "9p\000", 3); memcpy((void*)0x200000000000, "trans=fd,rfdno=", 15); sprintf((char*)0x20000000000f, "0x%016llx", (long long)r[0]); memcpy((void*)0x200000000021, ",wfdno=", 7); sprintf((char*)0x200000000028, "0x%016llx", (long long)r[2]); syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000000040ul, /*type=*/0x200000000b80ul, /*flags=*/0ul, /*opts=*/0x200000000000ul); // chdir arguments: [ // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // ] memcpy((void*)0x200000001100, "./file0\000", 8); syscall(__NR_chdir, /*dir=*/0x200000001100ul); // mkdir arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // mode: open_mode = 0x0 (8 bytes) // ] memcpy((void*)0x2000000004c0, "./bus\000", 6); syscall(__NR_mkdir, /*path=*/0x2000000004c0ul, /*mode=*/0ul); return 0; }