// https://syzkaller.appspot.com/bug?id=458231ba46ddd8a86fdb638ee417b07405f7005b // 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[1] = {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, 0xc); if (res != -1) r[0] = res; *(uint64_t*)0x20000300 = 0; *(uint32_t*)0x20000308 = 0; *(uint64_t*)0x20000310 = 0x200000c0; *(uint64_t*)0x200000c0 = 0x20000340; *(uint32_t*)0x20000340 = 0x80; *(uint8_t*)0x20000344 = 0; *(uint8_t*)0x20000345 = 1; *(uint16_t*)0x20000346 = 0x401; *(uint32_t*)0x20000348 = 0; *(uint32_t*)0x2000034c = 0; *(uint8_t*)0x20000350 = 0xe; *(uint8_t*)0x20000351 = 0; *(uint16_t*)0x20000352 = htobe16(0); *(uint16_t*)0x20000354 = 0x24; STORE_BY_BITMASK(uint16_t, , 0x20000356, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000357, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000357, 1, 7, 1); *(uint16_t*)0x20000358 = 0x14; STORE_BY_BITMASK(uint16_t, , 0x2000035a, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000035b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000035b, 1, 7, 1); *(uint16_t*)0x2000035c = 8; *(uint16_t*)0x2000035e = 1; *(uint32_t*)0x20000360 = htobe32(0xe0000001); *(uint16_t*)0x20000364 = 8; *(uint16_t*)0x20000366 = 2; *(uint8_t*)0x20000368 = 0xac; *(uint8_t*)0x20000369 = 0x14; *(uint8_t*)0x2000036a = 0x14; *(uint8_t*)0x2000036b = 0; *(uint16_t*)0x2000036c = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000036e, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000036f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000036f, 1, 7, 1); *(uint16_t*)0x20000370 = 5; *(uint16_t*)0x20000372 = 1; *(uint8_t*)0x20000374 = 1; *(uint16_t*)0x20000378 = 4; STORE_BY_BITMASK(uint16_t, , 0x2000037a, 0xd, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000037b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000037b, 1, 7, 1); *(uint16_t*)0x2000037c = 0x3c; STORE_BY_BITMASK(uint16_t, , 0x2000037e, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000037f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000037f, 1, 7, 1); *(uint16_t*)0x20000380 = 0x2c; STORE_BY_BITMASK(uint16_t, , 0x20000382, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000383, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000383, 1, 7, 1); *(uint16_t*)0x20000384 = 0x14; *(uint16_t*)0x20000386 = 3; *(uint8_t*)0x20000388 = 0xfc; *(uint8_t*)0x20000389 = 2; *(uint8_t*)0x2000038a = 0; *(uint8_t*)0x2000038b = 0; *(uint8_t*)0x2000038c = 0; *(uint8_t*)0x2000038d = 0; *(uint8_t*)0x2000038e = 0; *(uint8_t*)0x2000038f = 0; *(uint8_t*)0x20000390 = 0; *(uint8_t*)0x20000391 = 0; *(uint8_t*)0x20000392 = 0; *(uint8_t*)0x20000393 = 0; *(uint8_t*)0x20000394 = 0; *(uint8_t*)0x20000395 = 0; *(uint8_t*)0x20000396 = 0; *(uint8_t*)0x20000397 = 0; *(uint16_t*)0x20000398 = 0x14; *(uint16_t*)0x2000039a = 4; *(uint8_t*)0x2000039c = -1; *(uint8_t*)0x2000039d = 1; *(uint8_t*)0x2000039e = 0; *(uint8_t*)0x2000039f = 0; *(uint8_t*)0x200003a0 = 0; *(uint8_t*)0x200003a1 = 0; *(uint8_t*)0x200003a2 = 0; *(uint8_t*)0x200003a3 = 0; *(uint8_t*)0x200003a4 = 0; *(uint8_t*)0x200003a5 = 0; *(uint8_t*)0x200003a6 = 0; *(uint8_t*)0x200003a7 = 0; *(uint8_t*)0x200003a8 = 0; *(uint8_t*)0x200003a9 = 0; *(uint8_t*)0x200003aa = 0; *(uint8_t*)0x200003ab = 1; *(uint16_t*)0x200003ac = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200003ae, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003af, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003af, 1, 7, 1); *(uint16_t*)0x200003b0 = 5; *(uint16_t*)0x200003b2 = 1; *(uint8_t*)0x200003b4 = 1; *(uint16_t*)0x200003b8 = 8; STORE_BY_BITMASK(uint16_t, , 0x200003ba, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003bb, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003bb, 0, 7, 1); *(uint32_t*)0x200003bc = htobe32(0); *(uint64_t*)0x200000c8 = 0x80; *(uint64_t*)0x20000318 = 1; *(uint64_t*)0x20000320 = 0; *(uint64_t*)0x20000328 = 0; *(uint32_t*)0x20000330 = 0; syscall(__NR_sendmsg, r[0], 0x20000300ul, 0ul); return 0; }