// https://syzkaller.appspot.com/bug?id=4e947674d10b0fb0cb94d4d723989cee439a71d6 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_bind #define __NR_bind 361 #endif #ifndef __NR_dup2 #define __NR_dup2 63 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_sendmmsg #define __NR_sendmmsg 345 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 370 #endif #ifndef __NR_sendto #define __NR_sendto 369 #endif #ifndef __NR_socket #define __NR_socket 359 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); long res = 0; *(uint32_t*)0x20000180 = 0; *(uint32_t*)0x20000184 = 0; *(uint32_t*)0x20000188 = 0x20000000; *(uint32_t*)0x20000000 = 0x20000100; *(uint32_t*)0x20000004 = 0; *(uint32_t*)0x2000018c = 1; *(uint32_t*)0x20000190 = 0; *(uint32_t*)0x20000194 = 0; *(uint32_t*)0x20000198 = 0; syscall(__NR_sendmsg, -1, 0x20000180, 0); *(uint32_t*)0x200001c0 = 0; *(uint32_t*)0x200001c4 = 0; *(uint32_t*)0x200001c8 = 0x20000000; *(uint32_t*)0x20000000 = 0x20184000; memcpy((void*)0x20184000, "\x02\x0e\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08" "\x00\x12\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00" "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x03\x00\x06\x00\x00" "\x00\x08\x00\x02\x00\x00\x80\xac\x14\xff\xbb\xf0\x00\x00\x00\x00\x00" "\x00\x00\x03\x00\x05\x00\x00\x00\x00\x00\x02\x00\x42\x3b\x1d\x63\x2b" "\x91\xc5\x20\x00\x00\x00\x00\x00\x00", 128); *(uint32_t*)0x20000004 = 0x80; *(uint32_t*)0x200001cc = 1; *(uint32_t*)0x200001d0 = 0; *(uint32_t*)0x200001d4 = 0; *(uint32_t*)0x200001d8 = 0; syscall(__NR_sendmsg, -1, 0x200001c0, 0); res = syscall(__NR_socket, 0xf, 3, 2); if (res != -1) r[0] = res; syscall(__NR_sendmmsg, (long)r[0], 0x20000180, 0x44b084a6, 0); res = syscall(__NR_socket, 2, 2, 0x88); if (res != -1) r[1] = res; *(uint16_t*)0x20000000 = 2; *(uint16_t*)0x20000002 = htobe16(0x4e21); *(uint32_t*)0x20000004 = htobe32(0); *(uint8_t*)0x20000008 = 0; *(uint8_t*)0x20000009 = 0; *(uint8_t*)0x2000000a = 0; *(uint8_t*)0x2000000b = 0; *(uint8_t*)0x2000000c = 0; *(uint8_t*)0x2000000d = 0; *(uint8_t*)0x2000000e = 0; *(uint8_t*)0x2000000f = 0; syscall(__NR_bind, (long)r[1], 0x20000000, 0x10); res = syscall(__NR_dup2, (long)r[1], (long)r[1]); if (res != -1) r[2] = res; *(uint16_t*)0x20000100 = 2; *(uint16_t*)0x20000102 = htobe16(0x4e21); *(uint32_t*)0x20000104 = htobe32(0); *(uint8_t*)0x20000108 = 0; *(uint8_t*)0x20000109 = 0; *(uint8_t*)0x2000010a = 0; *(uint8_t*)0x2000010b = 0; *(uint8_t*)0x2000010c = 0; *(uint8_t*)0x2000010d = 0; *(uint8_t*)0x2000010e = 0; *(uint8_t*)0x2000010f = 0; syscall(__NR_sendto, (long)r[2], 0x20000140, 0, 0x8000, 0x20000100, 0x10); *(uint16_t*)0x20000040 = 2; *(uint16_t*)0x20000042 = htobe16(0); *(uint32_t*)0x20000044 = htobe32(-1); *(uint8_t*)0x20000048 = 0; *(uint8_t*)0x20000049 = 0; *(uint8_t*)0x2000004a = 0; *(uint8_t*)0x2000004b = 0; *(uint8_t*)0x2000004c = 0; *(uint8_t*)0x2000004d = 0; *(uint8_t*)0x2000004e = 0; *(uint8_t*)0x2000004f = 0; syscall(__NR_sendto, (long)r[1], 0x20000080, 0, 0, 0x20000040, 0x10); return 0; }