// https://syzkaller.appspot.com/bug?id=f823224ada908fa5c207902a5a62065e53ca0fcc // 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)))) #ifndef __NR_bpf #define __NR_bpf 321 #endif 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); *(uint32_t*)0x20000080 = 5; *(uint32_t*)0x20000084 = 3; *(uint64_t*)0x20000088 = 0x20000280; *(uint8_t*)0x20000280 = 0x85; STORE_BY_BITMASK(uint8_t, , 0x20000281, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000281, 0, 4, 4); *(uint16_t*)0x20000282 = 0; *(uint32_t*)0x20000284 = 0x8d; *(uint8_t*)0x20000288 = 0x36; *(uint8_t*)0x20000289 = 0; *(uint16_t*)0x2000028a = 0; *(uint32_t*)0x2000028c = 0x80000000; *(uint8_t*)0x20000290 = 0x95; *(uint8_t*)0x20000291 = 0; *(uint16_t*)0x20000292 = 0; *(uint32_t*)0x20000294 = 0; *(uint64_t*)0x20000090 = 0x20000140; memcpy((void*)0x20000140, "GPL\000", 4); *(uint32_t*)0x20000098 = 1; *(uint32_t*)0x2000009c = 0xfc76; *(uint64_t*)0x200000a0 = 0x20000180; *(uint32_t*)0x200000a8 = 0; *(uint32_t*)0x200000ac = 0; *(uint8_t*)0x200000b0 = 0; *(uint8_t*)0x200000b1 = 0; *(uint8_t*)0x200000b2 = 0; *(uint8_t*)0x200000b3 = 0; *(uint8_t*)0x200000b4 = 0; *(uint8_t*)0x200000b5 = 0; *(uint8_t*)0x200000b6 = 0; *(uint8_t*)0x200000b7 = 0; *(uint8_t*)0x200000b8 = 0; *(uint8_t*)0x200000b9 = 0; *(uint8_t*)0x200000ba = 0; *(uint8_t*)0x200000bb = 0; *(uint8_t*)0x200000bc = 0; *(uint8_t*)0x200000bd = 0; *(uint8_t*)0x200000be = 0; *(uint8_t*)0x200000bf = 0; *(uint32_t*)0x200000c0 = 0; *(uint32_t*)0x200000c4 = 0; *(uint32_t*)0x200000c8 = -1; *(uint32_t*)0x200000cc = 8; *(uint64_t*)0x200000d0 = 0x20000040; *(uint32_t*)0x20000040 = 0; *(uint32_t*)0x20000044 = 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 = 0xfffffe77; *(uint32_t*)0x200000ec = 0; *(uint32_t*)0x200000f0 = -1; syscall(__NR_bpf, 5ul, 0x20000080ul, 0x48ul); return 0; }