// https://syzkaller.appspot.com/bug?id=4b623f46ef7212d2d4777fe94a13f6722ff3c4c1 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[2] = {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)) { } // openat$loop_ctrl arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 6c 6f 6f 70 2d 63 6f 6e 74 72 6f 6c 00} // (length 0x12) // } // flags: open_flags = 0x0 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_loop_ctrl memcpy((void*)0x200000000080, "/dev/loop-control\000", 18); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000080ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[0] = res; // ioctl$BTRFS_IOC_BALANCE_CTL arguments: [ // fd: fd (resource) // cmd: const = 0x4c80 (4 bytes) // arg: btrfs_balance_ctl_values = 0xb0275faa5ab88745 (8 bytes) // ] syscall( __NR_ioctl, /*fd=*/r[0], /*cmd=*/0x4c80, /*arg=BTRFS_BALANCE_CTL_PAUSE|0xb0275faa5ab88744*/ 0xb0275faa5ab88745ul); // openat$loop_ctrl arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 6c 6f 6f 70 2d 63 6f 6e 74 72 6f 6c 00} // (length 0x12) // } // flags: open_flags = 0x0 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_loop_ctrl memcpy((void*)0x200000000080, "/dev/loop-control\000", 18); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000080ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[1] = res; // ioctl$BTRFS_IOC_BALANCE_CTL arguments: [ // fd: fd (resource) // cmd: const = 0x4c81 (4 bytes) // arg: btrfs_balance_ctl_values = 0xb0275faa5ab88745 (8 bytes) // ] syscall( __NR_ioctl, /*fd=*/r[1], /*cmd=*/0x4c81, /*arg=BTRFS_BALANCE_CTL_PAUSE|0xb0275faa5ab88744*/ 0xb0275faa5ab88745ul); return 0; }