// https://syzkaller.appspot.com/bug?id=583b200c0464331b3f9cf1d67566de0834f916d6 // 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[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; *(uint32_t*)0x200008c0 = 5; *(uint32_t*)0x200008c4 = 1; *(uint32_t*)0x200008c8 = 8; *(uint32_t*)0x200008cc = 2; *(uint32_t*)0x200008d0 = 0; *(uint32_t*)0x200008d4 = 1; *(uint32_t*)0x200008d8 = 0; memset((void*)0x200008dc, 0, 16); *(uint32_t*)0x200008ec = 0; *(uint32_t*)0x200008f0 = -1; *(uint32_t*)0x200008f4 = 0; *(uint32_t*)0x200008f8 = 0; *(uint32_t*)0x200008fc = 0; *(uint64_t*)0x20000900 = 0; res = syscall(__NR_bpf, 0ul, 0x200008c0ul, 0x48ul); if (res != -1) r[0] = res; *(uint32_t*)0x200008c0 = 0xd; *(uint32_t*)0x200008c4 = 2; *(uint32_t*)0x200008c8 = 4; *(uint32_t*)0x200008cc = 4; *(uint32_t*)0x200008d0 = 1; *(uint32_t*)0x200008d4 = r[0]; *(uint32_t*)0x200008d8 = 0; memset((void*)0x200008dc, 0, 16); *(uint32_t*)0x200008ec = 0; *(uint32_t*)0x200008f0 = -1; *(uint32_t*)0x200008f4 = 0; *(uint32_t*)0x200008f8 = 0; *(uint32_t*)0x200008fc = 0; *(uint64_t*)0x20000900 = 0; res = syscall(__NR_bpf, 0ul, 0x200008c0ul, 0x48ul); if (res != -1) r[1] = res; *(uint32_t*)0x20000300 = 0x11; *(uint32_t*)0x20000304 = 5; *(uint64_t*)0x20000308 = 0x200002c0; *(uint8_t*)0x200002c0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200002c1, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002c1, 0, 4, 4); *(uint16_t*)0x200002c2 = 0; *(uint32_t*)0x200002c4 = 0; *(uint8_t*)0x200002c8 = 0; *(uint8_t*)0x200002c9 = 0; *(uint16_t*)0x200002ca = 0; *(uint32_t*)0x200002cc = 0; *(uint8_t*)0x200002d0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200002d1, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200002d1, 1, 4, 4); *(uint16_t*)0x200002d2 = 0; *(uint32_t*)0x200002d4 = r[1]; *(uint8_t*)0x200002d8 = 0; *(uint8_t*)0x200002d9 = 0; *(uint16_t*)0x200002da = 0; *(uint32_t*)0x200002dc = 0; *(uint8_t*)0x200002e0 = 0x95; *(uint8_t*)0x200002e1 = 0; *(uint16_t*)0x200002e2 = 0; *(uint32_t*)0x200002e4 = 0; *(uint64_t*)0x20000310 = 0x20000100; memcpy((void*)0x20000100, "syzkaller\000", 10); *(uint32_t*)0x20000318 = 4; *(uint32_t*)0x2000031c = 0xe5; *(uint64_t*)0x20000320 = 0x20000000; *(uint32_t*)0x20000328 = 0; *(uint32_t*)0x2000032c = 0; memset((void*)0x20000330, 0, 16); *(uint32_t*)0x20000340 = 0; *(uint32_t*)0x20000344 = 0; *(uint32_t*)0x20000348 = -1; *(uint32_t*)0x2000034c = 8; *(uint64_t*)0x20000350 = 0; *(uint32_t*)0x20000358 = 0; *(uint32_t*)0x2000035c = 0x10; *(uint64_t*)0x20000360 = 0; *(uint32_t*)0x20000368 = 0; *(uint32_t*)0x2000036c = 0; *(uint32_t*)0x20000370 = 0; *(uint32_t*)0x20000374 = 0; *(uint64_t*)0x20000378 = 0; syscall(__NR_bpf, 5ul, 0x20000300ul, 0x80ul); return 0; }