// https://syzkaller.appspot.com/bug?id=5c8b4d8ea14d505d11874f51a1943b2869733719 // 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)))) 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*)0x20000780 = 0xf; *(uint32_t*)0x20000784 = 4; *(uint64_t*)0x20000788 = 0x20000040; *(uint8_t*)0x20000040 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000041, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000041, 0, 4, 4); *(uint16_t*)0x20000042 = 0; *(uint32_t*)0x20000044 = 0; *(uint8_t*)0x20000048 = 0; *(uint8_t*)0x20000049 = 0; *(uint16_t*)0x2000004a = 0; *(uint32_t*)0x2000004c = 0; *(uint8_t*)0x20000050 = 0x85; *(uint8_t*)0x20000051 = 0; *(uint16_t*)0x20000052 = 0; *(uint32_t*)0x20000054 = 0xbb; *(uint8_t*)0x20000058 = 0x95; *(uint8_t*)0x20000059 = 0; *(uint16_t*)0x2000005a = 0; *(uint32_t*)0x2000005c = 0; *(uint64_t*)0x20000790 = 0x20000000; memcpy((void*)0x20000000, "GPL\000", 4); *(uint32_t*)0x20000798 = 0; *(uint32_t*)0x2000079c = 0; *(uint64_t*)0x200007a0 = 0; *(uint32_t*)0x200007a8 = 0; *(uint32_t*)0x200007ac = 0; memset((void*)0x200007b0, 0, 16); *(uint32_t*)0x200007c0 = 0; *(uint32_t*)0x200007c4 = 0x2b; *(uint32_t*)0x200007c8 = -1; *(uint32_t*)0x200007cc = 8; *(uint64_t*)0x200007d0 = 0; *(uint32_t*)0x200007d8 = 0; *(uint32_t*)0x200007dc = 0x10; *(uint64_t*)0x200007e0 = 0; *(uint32_t*)0x200007e8 = 0; *(uint32_t*)0x200007ec = 0; *(uint32_t*)0x200007f0 = 0; *(uint32_t*)0x200007f4 = 0; *(uint64_t*)0x200007f8 = 0; syscall(__NR_bpf, 5ul, 0x20000780ul, 0x80ul); return 0; }