// https://syzkaller.appspot.com/bug?id=a81009dc8e8230ddc3a1ac89af4760e40c27f8c4 // 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*)0x200000000280, "/dev/pass0\000", 11); res = syscall(SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000280ul, /*flags=O_RDWR*/ 2ul, /*mode=*/0ul); if (res != -1) r[0] = res; // fcntl$lock arguments: [ // fd: fd (resource) // cmd: fcntl_lock = 0xd (8 bytes) // lock: ptr[in, flock] { // flock { // type: flock_type = 0x1 (2 bytes) // whence: seek_whence = 0x1 (2 bytes) // pad = 0x0 (4 bytes) // start: intptr = 0x20000000a (8 bytes) // len: intptr = 0xa (8 bytes) // pid: pid (resource) // pad = 0x0 (4 bytes) // } // } // ] *(uint16_t*)0x200000000300 = 1; *(uint16_t*)0x200000000302 = 1; *(uint64_t*)0x200000000308 = 0x20000000a; *(uint64_t*)0x200000000310 = 0xa; *(uint32_t*)0x200000000318 = 0; syscall(SYS_fcntl, /*fd=*/r[0], /*cmd=F_SETLKW*/ 0xdul, /*lock=*/0x200000000300ul); // ioctl$CAMIOQUEUE arguments: [ // fd: fd_pass (resource) // cmd: const = 0x20001a04 (8 bytes) // arg: ptr[in, ptr[in, ccb]] { // nil // } // ] *(uint64_t*)0x2000000002c0 = 0; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0x20001a04ul, /*arg=*/0x2000000002c0ul); return 0; }