// https://syzkaller.appspot.com/bug?id=546a5fd9e24e4dfa784e2a6e7b2ed1b89cd3ef92 // 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*)0x20000040 = 0; *(uint32_t*)0x20000048 = 0; *(uint64_t*)0x20000050 = 0x20000000; *(uint64_t*)0x20000000 = 0x20000280; *(uint32_t*)0x20000280 = 0x3c; *(uint16_t*)0x20000284 = 0x10; *(uint16_t*)0x20000286 = 0x705; *(uint32_t*)0x20000288 = 0; *(uint32_t*)0x2000028c = 0; *(uint8_t*)0x20000290 = 0; *(uint8_t*)0x20000291 = 0; *(uint16_t*)0x20000292 = 0; *(uint32_t*)0x20000294 = 0; *(uint32_t*)0x20000298 = 0; *(uint32_t*)0x2000029c = 0; *(uint16_t*)0x200002a0 = 0x1c; STORE_BY_BITMASK(uint16_t, , 0x200002a2, 0x12, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200002a3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200002a3, 1, 7, 1); *(uint16_t*)0x200002a4 = 0x12; *(uint16_t*)0x200002a6 = 1; memcpy((void*)0x200002a8, "erspan\000", 7); *(uint16_t*)0x200002b0 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200002b2, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200002b3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200002b3, 1, 7, 1); *(uint16_t*)0x200002b4 = 6; *(uint16_t*)0x200002b6 = 2; *(uint16_t*)0x200002b8 = 0; *(uint64_t*)0x20000008 = 0x3c; *(uint64_t*)0x20000058 = 1; *(uint64_t*)0x20000060 = 0; *(uint64_t*)0x20000068 = 0; *(uint32_t*)0x20000070 = 0; syscall(__NR_sendmsg, r[0], 0x20000040ul, 0ul); return 0; }