// 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[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; *(uint32_t*)0x20000140 = 1; *(uint32_t*)0x20000144 = 4; *(uint32_t*)0x20000148 = 0xb4; *(uint32_t*)0x2000014c = 0x7f; *(uint32_t*)0x20000150 = 1; *(uint32_t*)0x20000154 = -1; *(uint32_t*)0x20000158 = 0; memset((void*)0x2000015c, 0, 16); *(uint32_t*)0x2000016c = 0; *(uint32_t*)0x20000170 = -1; *(uint32_t*)0x20000174 = 0; *(uint32_t*)0x20000178 = 0; *(uint32_t*)0x2000017c = 0; *(uint64_t*)0x20000180 = 0; res = syscall(__NR_bpf, /*cmd=*/0x100000000000000ul, /*arg=*/0x20000140ul, /*size=*/0x48ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000440 = 0x11; *(uint32_t*)0x20000444 = 5; *(uint64_t*)0x20000448 = 0x20000680; *(uint8_t*)0x20000680 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000681, 8, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000681, 0, 4, 4); *(uint16_t*)0x20000682 = 0; *(uint32_t*)0x20000684 = 0; *(uint8_t*)0x20000688 = 0; *(uint8_t*)0x20000689 = 0; *(uint16_t*)0x2000068a = 0; *(uint32_t*)0x2000068c = 0; *(uint8_t*)0x20000690 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000691, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000691, 1, 4, 4); *(uint16_t*)0x20000692 = 0; *(uint32_t*)0x20000694 = r[0]; *(uint8_t*)0x20000698 = 0; *(uint8_t*)0x20000699 = 0; *(uint16_t*)0x2000069a = 0; *(uint32_t*)0x2000069c = 0; *(uint8_t*)0x200006a0 = 0x95; *(uint8_t*)0x200006a1 = 0; *(uint16_t*)0x200006a2 = 0; *(uint32_t*)0x200006a4 = 0; *(uint64_t*)0x20000450 = 0x200001c0; memcpy((void*)0x200001c0, "syzkaller\000", 10); *(uint32_t*)0x20000458 = 4; *(uint32_t*)0x2000045c = 0xf4; *(uint64_t*)0x20000460 = 0x20000040; *(uint32_t*)0x20000468 = 0; *(uint32_t*)0x2000046c = 1; memset((void*)0x20000470, 0, 16); *(uint32_t*)0x20000480 = 0; *(uint32_t*)0x20000484 = 0; *(uint32_t*)0x20000488 = -1; *(uint32_t*)0x2000048c = 8; *(uint64_t*)0x20000490 = 0; *(uint32_t*)0x20000498 = 0; *(uint32_t*)0x2000049c = 0x10; *(uint64_t*)0x200004a0 = 0; *(uint32_t*)0x200004a8 = 0; *(uint32_t*)0x200004ac = 0; *(uint32_t*)0x200004b0 = 0; *(uint32_t*)0x200004b4 = 0; *(uint64_t*)0x200004b8 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000440ul, /*size=*/0x80ul); return 0; }