// https://syzkaller.appspot.com/bug?id=a47fdd8aff3314383f8e2d125ffbc6edb34d22a0 // 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*)0x200000000000, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000000ul, /*flags=O_RDWR*/ 2ul, /*mode=*/0ul); if (res != -1) r[0] = res; // kevent arguments: [ // kqueue: kqueue (resource) // changelist: ptr[in, array[kevent]] { // array[kevent] { // kevent { // ident: intptr = 0xffffffffffffff96 (8 bytes) // filter: filters = 0xfffffffffffffffd (2 bytes) // flags: evflags = 0x0 (2 bytes) // fflags: fflags = 0x10 (4 bytes) // data: int64 = 0xc (8 bytes) // udata: intptr = 0x401 (8 bytes) // ext: array[int64] { // int64 = 0x0 (8 bytes) // int64 = 0x5 (8 bytes) // int64 = 0x9 (8 bytes) // int64 = 0x7 (8 bytes) // } // } // kevent { // ident: intptr = 0x7f (8 bytes) // filter: filters = 0xfffffffffffffff5 (2 bytes) // flags: evflags = 0x4001 (2 bytes) // fflags: fflags = 0x80000000 (4 bytes) // data: int64 = 0x7 (8 bytes) // udata: intptr = 0x1 (8 bytes) // ext: array[int64] { // int64 = 0x7 (8 bytes) // int64 = 0x80 (8 bytes) // int64 = 0x6c (8 bytes) // int64 = 0x200 (8 bytes) // } // } // } // } // nchanges: len = 0x2 (8 bytes) // eventlist: nil // nevents: len = 0x0 (8 bytes) // timeout: nil // ] *(uint64_t*)0x2000000000c0 = 0xffffffffffffff96; *(uint16_t*)0x2000000000c8 = 0xfffd; *(uint16_t*)0x2000000000ca = 0; *(uint32_t*)0x2000000000cc = 0x10; *(uint64_t*)0x2000000000d0 = 0xc; *(uint64_t*)0x2000000000d8 = 0x401; *(uint64_t*)0x2000000000e0 = 0; *(uint64_t*)0x2000000000e8 = 5; *(uint64_t*)0x2000000000f0 = 9; *(uint64_t*)0x2000000000f8 = 7; *(uint64_t*)0x200000000100 = 0x7f; *(uint16_t*)0x200000000108 = 0xfff5; *(uint16_t*)0x20000000010a = 0x4001; *(uint32_t*)0x20000000010c = 0x80000000; *(uint64_t*)0x200000000110 = 7; *(uint64_t*)0x200000000118 = 1; *(uint64_t*)0x200000000120 = 7; *(uint64_t*)0x200000000128 = 0x80; *(uint64_t*)0x200000000130 = 0x6c; *(uint64_t*)0x200000000138 = 0x200; syscall(SYS_kevent, /*kqueue=*/(intptr_t)-1, /*changelist=*/0x2000000000c0ul, /*nchanges=*/2ul, /*eventlist=*/0ul, /*nevents=*/0ul, /*timeout=*/0ul); // ioctl$CAMIOQUEUE arguments: [ // fd: fd_pass (resource) // cmd: const = 0x20001a04 (8 bytes) // arg: ptr[in, ptr[in, ccb]] { // nil // } // ] *(uint64_t*)0x200000000080 = 0; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0x20001a04ul, /*arg=*/0x200000000080ul); return 0; }