// https://syzkaller.appspot.com/bug?id=2124574c870765702abb05dc8ba945ee12204531 // 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)) { } // openat$pass arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 70 61 73 73 30 00} (length 0xb) // } // flags: open_flags = 0x2 (8 bytes) // mode: const = 0x0 (8 bytes) // ] // returns fd_pass memcpy((void*)0x2000000000c0, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x2000000000c0ul, /*flags=O_RDWR*/ 2ul, /*mode=*/0ul); if (res != -1) r[0] = res; // select arguments: [ // n: len = 0x40 (8 bytes) // inp: ptr[inout, fd_set] { // fd_set { // mask0: int64 = 0x7fffffffffffffff (8 bytes) // mask1: int64 = 0x1 (8 bytes) // mask2: int64 = 0xb (8 bytes) // mask3: int64 = 0xea (8 bytes) // mask4: int64 = 0x6 (8 bytes) // mask5: int64 = 0x80 (8 bytes) // mask6: int64 = 0x3 (8 bytes) // mask7: int64 = 0x7fff (8 bytes) // } // } // outp: nil // exp: nil // tvp: nil // ] *(uint64_t*)0x200000000200 = 0x7fffffffffffffff; *(uint64_t*)0x200000000208 = 1; *(uint64_t*)0x200000000210 = 0xb; *(uint64_t*)0x200000000218 = 0xea; *(uint64_t*)0x200000000220 = 6; *(uint64_t*)0x200000000228 = 0x80; *(uint64_t*)0x200000000230 = 3; *(uint64_t*)0x200000000238 = 0x7fff; syscall(SYS_select, /*n=*/0x40ul, /*inp=*/0x200000000200ul, /*outp=*/0ul, /*exp=*/0ul, /*tvp=*/0ul); // ioctl$CAMIOQUEUE arguments: [ // fd: fd_pass (resource) // cmd: const = 0x20001a04 (8 bytes) // arg: ptr[in, ptr[in, ccb]] { // nil // } // ] *(uint64_t*)0x2000000001c0 = 0; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0x20001a04ul, /*arg=*/0x2000000001c0ul); return 0; }