// https://syzkaller.appspot.com/bug?id=3897413eb15aa1bd9cd201cea5e58c4326448b51 // 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); *(uint64_t*)0x20000140 = 0x20001680; *(uint16_t*)0x20001680 = 0xeb9f; *(uint8_t*)0x20001682 = 1; *(uint8_t*)0x20001683 = 0; *(uint32_t*)0x20001684 = 0x18; *(uint32_t*)0x20001688 = 0; *(uint32_t*)0x2000168c = 0x34; *(uint32_t*)0x20001690 = 0x34; *(uint32_t*)0x20001694 = 0xc; *(uint32_t*)0x20001698 = 0xa; *(uint16_t*)0x2000169c = 0; *(uint8_t*)0x2000169e = 0; *(uint8_t*)0x2000169f = 7; *(uint32_t*)0x200016a0 = 0; *(uint32_t*)0x200016a4 = 3; *(uint16_t*)0x200016a8 = 0; *(uint8_t*)0x200016aa = 0; *(uint8_t*)0x200016ab = 0x11; *(uint32_t*)0x200016ac = 4; *(uint32_t*)0x200016b0 = -1; *(uint32_t*)0x200016b4 = 0; *(uint16_t*)0x200016b8 = 0; *(uint8_t*)0x200016ba = 0; *(uint8_t*)0x200016bb = 0xd; *(uint32_t*)0x200016bc = 2; *(uint32_t*)0x200016c0 = 0; *(uint16_t*)0x200016c4 = 0; *(uint8_t*)0x200016c6 = 0; STORE_BY_BITMASK(uint8_t, , 0x200016c7, 4, 0, 7); STORE_BY_BITMASK(uint8_t, , 0x200016c7, 0, 7, 1); *(uint32_t*)0x200016c8 = 0; *(uint8_t*)0x200016cc = 0; *(uint8_t*)0x200016cd = 0; *(uint8_t*)0x200016ce = 0; *(uint8_t*)0x200016cf = 0x5f; *(uint8_t*)0x200016d0 = 0; *(uint8_t*)0x200016d1 = 0; *(uint8_t*)0x200016d2 = 0; *(uint8_t*)0x200016d3 = 0; *(uint8_t*)0x200016d4 = 0; *(uint8_t*)0x200016d5 = 0; *(uint8_t*)0x200016d6 = 0x6c; *(uint8_t*)0x200016d7 = 0; *(uint64_t*)0x20000148 = 0x200004c0; *(uint32_t*)0x20000150 = 0x58; *(uint32_t*)0x20000154 = 0x1000; *(uint32_t*)0x20000158 = 1; syscall(__NR_bpf, 0x12ul, 0x20000140ul, 0x20ul); return 0; }