// https://syzkaller.appspot.com/bug?id=741a345bddaaee4d8fda8e2378597d2cc61ffdbe // 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, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0); intptr_t res = 0; res = syscall(__NR_socket, 0x10ul, 3ul, 0ul); if (res != -1) r[0] = res; *(uint64_t*)0x20000080 = 0; *(uint32_t*)0x20000088 = 0; *(uint64_t*)0x20000090 = 0x20000200; *(uint64_t*)0x20000200 = 0x20000000; *(uint32_t*)0x20000000 = 0x40; *(uint16_t*)0x20000004 = 0x10; *(uint16_t*)0x20000006 = 0x801; *(uint32_t*)0x20000008 = 0; *(uint32_t*)0x2000000c = 0; *(uint8_t*)0x20000010 = 0; *(uint8_t*)0x20000011 = 0; *(uint16_t*)0x20000012 = 0; *(uint32_t*)0x20000014 = 0; *(uint32_t*)0x20000018 = 0; *(uint32_t*)0x2000001c = 0; *(uint16_t*)0x20000020 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x20000022, 0x1a, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000023, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000023, 1, 7, 1); *(uint16_t*)0x20000024 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000026, 0xa, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000027, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000027, 1, 7, 1); *(uint16_t*)0x20000028 = 5; *(uint16_t*)0x2000002a = 8; *(uint8_t*)0x2000002c = 0; *(uint16_t*)0x20000030 = 8; *(uint16_t*)0x20000032 = 0x1b; *(uint32_t*)0x20000034 = 0; *(uint16_t*)0x20000038 = 8; *(uint16_t*)0x2000003a = 4; *(uint32_t*)0x2000003c = 0x3ff; *(uint64_t*)0x20000208 = 0x40; *(uint64_t*)0x20000098 = 1; *(uint64_t*)0x200000a0 = 0; *(uint64_t*)0x200000a8 = 0; *(uint32_t*)0x200000b0 = 0x54; syscall(__NR_sendmsg, r[0], 0x20000080ul, 0ul); return 0; }