// https://syzkaller.appspot.com/bug?id=fa92542b9ae72d5d923fc8939b600a8762386066 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_ioctl #define __NR_ioctl 29 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_pipe2 #define __NR_pipe2 59 #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)) { } // pipe2 arguments: [ // pipefd: ptr[out, pipefd] { // pipefd { // rfd: fd (resource) // wfd: fd (resource) // } // } // flags: pipe_flags = 0x0 (8 bytes) // ] res = syscall(__NR_pipe2, /*pipefd=*/0x200000c0ul, /*flags=*/0ul); if (res != -1) r[0] = *(uint32_t*)0x200000c0; // ioctl$sock_inet_udp_SIOCINQ arguments: [ // fd: sock_udp (resource) // cmd: const = 0x541b (4 bytes) // arg: nil // ] syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x541b, /*arg=*/0ul); return 0; }