// https://syzkaller.appspot.com/bug?id=1547ecde46fc0f51f3e2860436c3473376c0521e // 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_sendmsg #define __NR_sendmsg 211 #endif #ifndef __NR_socket #define __NR_socket 198 #endif #ifndef __NR_socketpair #define __NR_socketpair 199 #endif uint64_t r[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0x0, 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)) { } res = syscall(__NR_socket, /*domain=AF_NETLINK*/ 0x10ul, /*type=SOCK_RAW*/ 3ul, /*proto=*/0); if (res != -1) r[0] = res; res = syscall(__NR_socketpair, /*domain=*/1ul, /*type=SOCK_SEQPACKET*/ 5ul, /*proto=*/0, /*fds=*/0x20000240ul); if (res != -1) r[1] = *(uint32_t*)0x20000244; memcpy((void*)0x20000000, "lo\000\000\000\000\000\000\000\000\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x8933, /*arg=*/0x20000000ul); if (res != -1) r[2] = *(uint32_t*)0x20000010; *(uint64_t*)0x20000040 = 0; *(uint32_t*)0x20000048 = 0; *(uint64_t*)0x20000050 = 0x20000780; *(uint64_t*)0x20000780 = 0x20001340; *(uint32_t*)0x20001340 = 0x48; *(uint16_t*)0x20001344 = 0x24; *(uint16_t*)0x20001346 = 0xd0f; *(uint32_t*)0x20001348 = 0x70bd2d; *(uint32_t*)0x2000134c = 0; *(uint8_t*)0x20001350 = 0x60; *(uint8_t*)0x20001351 = 0; *(uint16_t*)0x20001352 = 0; *(uint32_t*)0x20001354 = r[2]; *(uint16_t*)0x20001358 = 0; *(uint16_t*)0x2000135a = 0xa; *(uint16_t*)0x2000135c = -1; *(uint16_t*)0x2000135e = -1; *(uint16_t*)0x20001360 = 0; *(uint16_t*)0x20001362 = -1; *(uint16_t*)0x20001364 = 8; *(uint16_t*)0x20001366 = 1; memcpy((void*)0x20001368, "htb\000", 4); *(uint16_t*)0x2000136c = 0x1c; *(uint16_t*)0x2000136e = 2; *(uint16_t*)0x20001370 = 0x18; *(uint16_t*)0x20001372 = 2; *(uint32_t*)0x20001374 = 3; *(uint32_t*)0x20001378 = 1; *(uint32_t*)0x2000137c = 0; *(uint32_t*)0x20001380 = 0; *(uint32_t*)0x20001384 = 0; *(uint64_t*)0x20000788 = 0x48; *(uint64_t*)0x20000058 = 1; *(uint64_t*)0x20000060 = 0; *(uint64_t*)0x20000068 = 0; *(uint32_t*)0x20000070 = 0; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000040ul, /*f=MSG_BATCH|MSG_NOSIGNAL|MSG_EOR*/ 0x44080ul); res = syscall(__NR_socket, /*domain=AF_NETLINK*/ 0x10ul, /*type=SOCK_RAW*/ 3ul, /*proto=*/0); if (res != -1) r[3] = res; *(uint64_t*)0x20000040 = 0; *(uint32_t*)0x20000048 = 0; *(uint64_t*)0x20000050 = 0x20000780; *(uint64_t*)0x20000780 = 0x200001c0; *(uint32_t*)0x200001c0 = 0x78; *(uint16_t*)0x200001c4 = 0x24; *(uint16_t*)0x200001c6 = 0xd0f; *(uint32_t*)0x200001c8 = 0; *(uint32_t*)0x200001cc = 0; *(uint8_t*)0x200001d0 = 0x60; *(uint8_t*)0x200001d1 = 0; *(uint16_t*)0x200001d2 = 0; *(uint32_t*)0x200001d4 = r[2]; *(uint16_t*)0x200001d8 = 0; *(uint16_t*)0x200001da = 0xf; *(uint16_t*)0x200001dc = 0xa; *(uint16_t*)0x200001de = 0xa; *(uint16_t*)0x200001e0 = 6; *(uint16_t*)0x200001e2 = 0; *(uint16_t*)0x200001e4 = 8; *(uint16_t*)0x200001e6 = 1; memcpy((void*)0x200001e8, "sfq\000", 4); *(uint16_t*)0x200001ec = 0x48; *(uint16_t*)0x200001ee = 2; *(uint32_t*)0x200001f0 = 7; *(uint32_t*)0x200001f4 = 8; *(uint32_t*)0x200001f8 = 4; *(uint32_t*)0x200001fc = 0; *(uint32_t*)0x20000200 = 7; *(uint32_t*)0x20000204 = 0xf0; *(uint32_t*)0x20000208 = 1; *(uint32_t*)0x2000020c = 0x31a; *(uint32_t*)0x20000210 = 3; *(uint32_t*)0x20000214 = 0x88a; *(uint8_t*)0x20000218 = 0xd; *(uint8_t*)0x20000219 = 0x8e; *(uint8_t*)0x2000021a = 0x1f; *(uint8_t*)0x2000021b = 3; *(uint32_t*)0x2000021c = 0xff; *(uint32_t*)0x20000220 = 0x4415; *(uint32_t*)0x20000224 = 2; *(uint32_t*)0x20000228 = 0x800; *(uint32_t*)0x2000022c = 5; *(uint32_t*)0x20000230 = 0; *(uint32_t*)0x20000234 = 5; *(uint64_t*)0x20000788 = 0x78; *(uint64_t*)0x20000058 = 1; *(uint64_t*)0x20000060 = 0; *(uint64_t*)0x20000068 = 0; *(uint32_t*)0x20000070 = 0; syscall(__NR_sendmsg, /*fd=*/r[3], /*msg=*/0x20000040ul, /*f=MSG_NOSIGNAL*/ 0x4000ul); return 0; }