// https://syzkaller.appspot.com/bug?id=e63a777d887eb30935e3055bbf29b0b23d449eb6 // 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_openat #define __NR_openat 56 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 211 #endif #ifndef __NR_socket #define __NR_socket 198 #endif uint64_t r[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0x0}; 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)) { } memcpy((void*)0x20000100, "/dev/net/tun\000", 13); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000100ul, /*flags=O_TRUNC|O_SYNC|O_NOFOLLOW|O_CLOEXEC|O_WRONLY*/ 0x189201, /*mode=*/0); if (res != -1) r[0] = res; memcpy((void*)0x20000040, "syzkaller0\000\000\000\000\000\000", 16); *(uint16_t*)0x20000050 = 2; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x400454ca, /*arg=*/0x20000040ul); res = syscall(__NR_socket, /*domain=*/1ul, /*type=SOCK_STREAM*/ 1ul, /*proto=*/0); if (res != -1) r[1] = res; res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0); if (res != -1) r[2] = res; memcpy((void*)0x20000100, "syzkaller0\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x8933, /*arg=*/0x20000100ul); if (res != -1) r[3] = *(uint32_t*)0x20000110; *(uint64_t*)0x20000000 = 0; *(uint32_t*)0x20000008 = 0; *(uint64_t*)0x20000010 = 0x200001c0; *(uint64_t*)0x200001c0 = 0x200026c0; *(uint32_t*)0x200026c0 = 0x38; *(uint16_t*)0x200026c4 = 0x24; *(uint16_t*)0x200026c6 = 0x6541; *(uint32_t*)0x200026c8 = 0; *(uint32_t*)0x200026cc = 0; *(uint8_t*)0x200026d0 = 0; *(uint8_t*)0x200026d1 = 0; *(uint16_t*)0x200026d2 = 0; *(uint32_t*)0x200026d4 = r[3]; *(uint16_t*)0x200026d8 = 0; *(uint16_t*)0x200026da = 0xb; *(uint16_t*)0x200026dc = -1; *(uint16_t*)0x200026de = -1; *(uint16_t*)0x200026e0 = 0xfff2; *(uint16_t*)0x200026e2 = 0; *(uint16_t*)0x200026e4 = 0xa; *(uint16_t*)0x200026e6 = 1; memcpy((void*)0x200026e8, "pfifo\000", 6); *(uint16_t*)0x200026f0 = 8; *(uint16_t*)0x200026f2 = 2; *(uint32_t*)0x200026f4 = 0x101; *(uint64_t*)0x200001c8 = 0x38; *(uint64_t*)0x20000018 = 1; *(uint64_t*)0x20000020 = 0; *(uint64_t*)0x20000028 = 0; *(uint32_t*)0x20000030 = 0x20000001; syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x20000000ul, /*f=*/0ul); *(uint64_t*)0x20000200 = 0; *(uint32_t*)0x20000208 = 0; *(uint64_t*)0x20000210 = 0x20000140; *(uint64_t*)0x20000140 = 0x20000300; *(uint32_t*)0x20000300 = 0x34; *(uint16_t*)0x20000304 = 0x24; *(uint16_t*)0x20000306 = 0x6541; *(uint32_t*)0x20000308 = 0x70bd2a; *(uint32_t*)0x2000030c = 0x80000; *(uint8_t*)0x20000310 = 0; *(uint8_t*)0x20000311 = 0; *(uint16_t*)0x20000312 = 0; *(uint32_t*)0x20000314 = r[3]; *(uint16_t*)0x20000318 = 0; *(uint16_t*)0x2000031a = 0; *(uint16_t*)0x2000031c = 0xffe6; *(uint16_t*)0x2000031e = 0xb; *(uint16_t*)0x20000320 = 0xffe0; *(uint16_t*)0x20000322 = 0xb; *(uint16_t*)0x20000324 = 0xa; *(uint16_t*)0x20000326 = 1; memcpy((void*)0x20000328, "codel\000", 6); *(uint16_t*)0x20000330 = 4; *(uint16_t*)0x20000332 = 2; *(uint64_t*)0x20000148 = 0x34; *(uint64_t*)0x20000218 = 1; *(uint64_t*)0x20000220 = 0; *(uint64_t*)0x20000228 = 0; *(uint32_t*)0x20000230 = 0x2000c061; syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x20000200ul, /*f=MSG_ZEROCOPY|MSG_MORE*/ 0x4008000ul); return 0; }