// https://syzkaller.appspot.com/bug?id=f5eaa13d5f13a8f864adb1a6177ed10abab07914 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include static void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0); use_temporary_dir(); intptr_t res = 0; res = syscall(__NR_socket, 0x10ul, 3ul, 0xcul); if (res != -1) r[0] = res; *(uint64_t*)0x20000300 = 0; *(uint32_t*)0x20000308 = 0; *(uint64_t*)0x20000310 = 0x200002c0; *(uint64_t*)0x200002c0 = 0x20000000; *(uint32_t*)0x20000000 = 0x50; *(uint8_t*)0x20000004 = 2; *(uint8_t*)0x20000005 = 6; *(uint16_t*)0x20000006 = 1; *(uint32_t*)0x20000008 = 0; *(uint32_t*)0x2000000c = 0; *(uint8_t*)0x20000010 = 0; *(uint8_t*)0x20000011 = 0; *(uint16_t*)0x20000012 = htobe16(0); *(uint16_t*)0x20000014 = 9; *(uint16_t*)0x20000016 = 2; memcpy((void*)0x20000018, "syz0\000", 5); *(uint16_t*)0x20000020 = 0x15; *(uint16_t*)0x20000022 = 3; memcpy((void*)0x20000024, "hash:ip,port,net\000", 17); *(uint16_t*)0x20000038 = 5; *(uint16_t*)0x2000003a = 1; *(uint8_t*)0x2000003c = 7; *(uint16_t*)0x20000040 = 5; *(uint16_t*)0x20000042 = 4; *(uint8_t*)0x20000044 = 0; *(uint16_t*)0x20000048 = 5; *(uint16_t*)0x2000004a = 5; *(uint8_t*)0x2000004c = 0xa; *(uint64_t*)0x200002c8 = 0x50; *(uint64_t*)0x20000318 = 1; *(uint64_t*)0x20000320 = 0; *(uint64_t*)0x20000328 = 0; *(uint32_t*)0x20000330 = 0; syscall(__NR_sendmsg, r[0], 0x20000300ul, 0ul); res = syscall(__NR_socket, 0x10ul, 3ul, 0xcul); if (res != -1) r[1] = res; *(uint64_t*)0x20000400 = 0; *(uint32_t*)0x20000408 = 0; *(uint64_t*)0x20000410 = 0x200003c0; *(uint64_t*)0x200003c0 = 0x20000440; *(uint32_t*)0x20000440 = 0x158; *(uint8_t*)0x20000444 = 0xb; *(uint8_t*)0x20000445 = 6; *(uint16_t*)0x20000446 = 1; *(uint32_t*)0x20000448 = 0x70bd29; *(uint32_t*)0x2000044c = 0x25dfdbfd; *(uint8_t*)0x20000450 = 7; *(uint8_t*)0x20000451 = 0; *(uint16_t*)0x20000452 = htobe16(9); *(uint16_t*)0x20000454 = 5; *(uint16_t*)0x20000456 = 1; *(uint8_t*)0x20000458 = 7; *(uint16_t*)0x2000045c = 0x20; STORE_BY_BITMASK(uint16_t, , 0x2000045e, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000045f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000045f, 1, 7, 1); *(uint16_t*)0x20000460 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x20000462, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000463, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000463, 1, 7, 1); *(uint16_t*)0x20000464 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000466, 0x18, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000467, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000467, 0, 7, 1); *(uint64_t*)0x20000468 = htobe64(0); *(uint16_t*)0x20000470 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000472, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000473, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000473, 1, 7, 1); *(uint16_t*)0x20000474 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000476, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000477, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000477, 0, 7, 1); *(uint32_t*)0x20000478 = htobe32(9); *(uint16_t*)0x2000047c = 0x38; STORE_BY_BITMASK(uint16_t, , 0x2000047e, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000047f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000047f, 1, 7, 1); *(uint16_t*)0x20000480 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000482, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000483, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000483, 1, 7, 1); *(uint16_t*)0x20000484 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000486, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000487, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000487, 0, 7, 1); *(uint32_t*)0x20000488 = htobe32(0); *(uint16_t*)0x2000048c = 0x10; STORE_BY_BITMASK(uint16_t, , 0x2000048e, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000048f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000048f, 1, 7, 1); *(uint16_t*)0x20000490 = 0xa; *(uint16_t*)0x20000492 = 0x11; *(uint8_t*)0x20000494 = 0xaa; *(uint8_t*)0x20000495 = 0xaa; *(uint8_t*)0x20000496 = 0xaa; *(uint8_t*)0x20000497 = 0xaa; *(uint8_t*)0x20000498 = 0xaa; *(uint8_t*)0x20000499 = 0xbb; *(uint16_t*)0x2000049c = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000049e, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000049f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000049f, 1, 7, 1); *(uint16_t*)0x200004a0 = 8; STORE_BY_BITMASK(uint16_t, , 0x200004a2, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004a3, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004a3, 0, 7, 1); *(uint32_t*)0x200004a4 = htobe32(0xfffffffb); *(uint16_t*)0x200004a8 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200004aa, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004ab, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004ab, 1, 7, 1); *(uint16_t*)0x200004ac = 5; *(uint16_t*)0x200004ae = 0x15; *(uint8_t*)0x200004b0 = 0xe1; *(uint16_t*)0x200004b4 = 0x38; STORE_BY_BITMASK(uint16_t, , 0x200004b6, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004b7, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004b7, 1, 7, 1); *(uint16_t*)0x200004b8 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200004ba, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004bb, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004bb, 1, 7, 1); *(uint16_t*)0x200004bc = 6; STORE_BY_BITMASK(uint16_t, , 0x200004be, 0x1d, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004bf, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004bf, 0, 7, 1); *(uint16_t*)0x200004c0 = htobe16(7); *(uint16_t*)0x200004c4 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200004c6, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004c7, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004c7, 1, 7, 1); *(uint16_t*)0x200004c8 = 8; STORE_BY_BITMASK(uint16_t, , 0x200004ca, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004cb, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004cb, 0, 7, 1); *(uint32_t*)0x200004cc = htobe32(0xfff); *(uint16_t*)0x200004d0 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200004d2, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004d3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004d3, 1, 7, 1); *(uint16_t*)0x200004d4 = 6; STORE_BY_BITMASK(uint16_t, , 0x200004d6, 0x1d, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004d7, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004d7, 0, 7, 1); *(uint16_t*)0x200004d8 = htobe16(0x6d); *(uint16_t*)0x200004dc = 0x10; STORE_BY_BITMASK(uint16_t, , 0x200004de, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004df, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004df, 1, 7, 1); *(uint16_t*)0x200004e0 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200004e2, 0x1b, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004e3, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004e3, 0, 7, 1); *(uint64_t*)0x200004e4 = htobe64(9); *(uint16_t*)0x200004ec = 0x38; STORE_BY_BITMASK(uint16_t, , 0x200004ee, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004ef, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004ef, 1, 7, 1); *(uint16_t*)0x200004f0 = 0x18; STORE_BY_BITMASK(uint16_t, , 0x200004f2, 0x14, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004f3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004f3, 1, 7, 1); *(uint16_t*)0x200004f4 = 0x14; *(uint16_t*)0x200004f6 = 2; memcpy((void*)0x200004f8, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000", 16); *(uint16_t*)0x20000508 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000050a, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000050b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000050b, 1, 7, 1); *(uint16_t*)0x2000050c = 8; *(uint16_t*)0x2000050e = 1; *(uint32_t*)0x20000510 = htobe32(0); *(uint16_t*)0x20000514 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000516, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000517, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000517, 0, 7, 1); *(uint32_t*)0x20000518 = htobe32(7); *(uint16_t*)0x2000051c = 8; STORE_BY_BITMASK(uint16_t, , 0x2000051e, 0x1c, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000051f, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000051f, 0, 7, 1); *(uint32_t*)0x20000520 = htobe32(0xcac63400); *(uint16_t*)0x20000524 = 9; *(uint16_t*)0x20000526 = 2; memcpy((void*)0x20000528, "syz0\000", 5); *(uint16_t*)0x20000530 = 0x60; STORE_BY_BITMASK(uint16_t, , 0x20000532, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000533, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000533, 1, 7, 1); *(uint16_t*)0x20000534 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x20000536, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000537, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000537, 1, 7, 1); *(uint16_t*)0x20000538 = 9; *(uint16_t*)0x2000053a = 0x12; memcpy((void*)0x2000053c, "syz0\000", 5); *(uint16_t*)0x20000544 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x20000546, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000547, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000547, 1, 7, 1); *(uint16_t*)0x20000548 = 0xa; *(uint16_t*)0x2000054a = 0x11; *(uint8_t*)0x2000054c = 0xaa; *(uint8_t*)0x2000054d = 0xaa; *(uint8_t*)0x2000054e = 0xaa; *(uint8_t*)0x2000054f = 0xaa; *(uint8_t*)0x20000550 = 0xaa; *(uint8_t*)0x20000551 = 0x32; *(uint16_t*)0x20000554 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000556, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000557, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000557, 1, 7, 1); *(uint16_t*)0x20000558 = 6; STORE_BY_BITMASK(uint16_t, , 0x2000055a, 0x1d, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000055b, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000055b, 0, 7, 1); *(uint16_t*)0x2000055c = htobe16(0x40); *(uint16_t*)0x20000560 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x20000562, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000563, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000563, 1, 7, 1); *(uint16_t*)0x20000564 = 9; *(uint16_t*)0x20000566 = 0x13; memcpy((void*)0x20000568, "syz0\000", 5); *(uint16_t*)0x20000570 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x20000572, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000573, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000573, 1, 7, 1); *(uint16_t*)0x20000574 = 9; *(uint16_t*)0x20000576 = 0x12; memcpy((void*)0x20000578, "syz0\000", 5); *(uint16_t*)0x20000580 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x20000582, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000583, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000583, 1, 7, 1); *(uint16_t*)0x20000584 = 9; *(uint16_t*)0x20000586 = 0x12; memcpy((void*)0x20000588, "syz0\000", 5); *(uint16_t*)0x20000590 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000592, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000593, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000593, 0, 7, 1); *(uint32_t*)0x20000594 = htobe32(6); *(uint64_t*)0x200003c8 = 0x158; *(uint64_t*)0x20000418 = 1; *(uint64_t*)0x20000420 = 0; *(uint64_t*)0x20000428 = 0; *(uint32_t*)0x20000430 = 0x810; syscall(__NR_sendmsg, r[1], 0x20000400ul, 0x4000100ul); return 0; }