// https://syzkaller.appspot.com/bug?id=8593724cce469c9898b7fbc49f48f4943fee940f // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif #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; *(uint32_t*)0x20000080 = 3; *(uint32_t*)0x20000084 = 3; *(uint64_t*)0x20000088 = 0x20001fd8; *(uint8_t*)0x20001fd8 = 0x85; STORE_BY_BITMASK(uint8_t, , 0x20001fd9, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20001fd9, 0, 4, 4); *(uint16_t*)0x20001fda = 0; *(uint32_t*)0x20001fdc = 0x4f; *(uint8_t*)0x20001fe0 = 0x5d; *(uint8_t*)0x20001fe1 = 0; *(uint16_t*)0x20001fe2 = 0; *(uint32_t*)0x20001fe4 = 0; *(uint8_t*)0x20001fe8 = 0x95; *(uint8_t*)0x20001fe9 = 0; *(uint16_t*)0x20001fea = 0; *(uint32_t*)0x20001fec = 0; *(uint64_t*)0x20000090 = 0x20000000; memcpy((void*)0x20000000, "GPL\000", 4); *(uint32_t*)0x20000098 = 5; *(uint32_t*)0x2000009c = 0x487; *(uint64_t*)0x200000a0 = 0x2000cf3d; *(uint32_t*)0x200000a8 = 0; *(uint32_t*)0x200000ac = 0; memset((void*)0x200000b0, 0, 16); *(uint32_t*)0x200000c0 = 0; *(uint32_t*)0x200000c4 = 0; *(uint32_t*)0x200000c8 = -1; *(uint32_t*)0x200000cc = 8; *(uint64_t*)0x200000d0 = 0x20000000; *(uint32_t*)0x20000000 = 0; *(uint32_t*)0x20000004 = 0; *(uint32_t*)0x200000d8 = 0; *(uint32_t*)0x200000dc = 0x10; *(uint64_t*)0x200000e0 = 0x20000000; *(uint32_t*)0x20000000 = 0; *(uint32_t*)0x20000004 = 0; *(uint32_t*)0x20000008 = 0; *(uint32_t*)0x2000000c = 0; *(uint32_t*)0x200000e8 = 0; *(uint32_t*)0x200000ec = 0; *(uint32_t*)0x200000f0 = -1; *(uint32_t*)0x200000f4 = 0; *(uint64_t*)0x200000f8 = 0; res = syscall(__NR_bpf, 5ul, 0x20000080ul, 0x48ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000180 = r[0]; *(uint32_t*)0x20000184 = 0; *(uint32_t*)0x20000188 = 0xe; *(uint32_t*)0x2000018c = 0xa0010bdc; *(uint64_t*)0x20000190 = 0x20000380; memcpy((void*)0x20000380, "\x26\x3a\xbd\x03\x0e\x98\xff\x4d\xc8\x70\xbd\x66\x88\xa8", 14); *(uint64_t*)0x20000198 = 0; *(uint32_t*)0x200001a0 = 0x405; *(uint32_t*)0x200001a4 = 0; *(uint32_t*)0x200001a8 = 0; *(uint32_t*)0x200001ac = 0; *(uint64_t*)0x200001b0 = 0x20000000; *(uint64_t*)0x200001b8 = 0x20000000; *(uint32_t*)0x200001c0 = 0; *(uint32_t*)0x200001c4 = 0; syscall(__NR_bpf, 0xaul, 0x20000180ul, 0x28ul); return 0; }