// https://syzkaller.appspot.com/bug?id=dece816b2ad9d2b88b2d566736027a19f64236c7 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_openat #define __NR_openat 56 #endif #ifndef __NR_ppoll #define __NR_ppoll 73 #endif uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*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=*/0x21000000ul, /*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$fuse arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 66 75 73 65 00} (length 0xa) // } // flags: const = 0x2 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_fuse memcpy((void*)0x20004100, "/dev/fuse\000", 10); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20004100ul, /*flags=*/2, /*mode=*/0); if (res != -1) r[0] = res; // ppoll arguments: [ // fds: ptr[in, array[pollfd]] { // array[pollfd] { // pollfd { // fd: fd (resource) // events: pollfd_events = 0x8008 (2 bytes) // revents: const = 0x0 (2 bytes) // } // } // } // nfds: len = 0x1 (8 bytes) // tsp: nil // sigmask: nil // size: len = 0x0 (8 bytes) // ] *(uint32_t*)0x20004180 = r[0]; *(uint16_t*)0x20004184 = 0x8008; *(uint16_t*)0x20004186 = 0; syscall(__NR_ppoll, /*fds=*/0x20004180ul, /*nfds=*/1ul, /*tsp=*/0ul, /*sigmask=*/0ul, /*size=*/0ul); return 0; }