// https://syzkaller.appspot.com/bug?id=8a714baf83fab0471d9e235a083a6d01bebe0015 // 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=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; *(uint32_t*)0x20000240 = 0x11; *(uint32_t*)0x20000244 = 4; *(uint64_t*)0x20000248 = 0x20000140; *(uint8_t*)0x20000140 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000141, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000141, 0, 4, 4); *(uint16_t*)0x20000142 = 0; *(uint32_t*)0x20000144 = 0; *(uint8_t*)0x20000148 = 0; *(uint8_t*)0x20000149 = 0; *(uint16_t*)0x2000014a = 0; *(uint32_t*)0x2000014c = 0; *(uint8_t*)0x20000150 = 0x85; *(uint8_t*)0x20000151 = 0; *(uint16_t*)0x20000152 = 0; *(uint32_t*)0x20000154 = 0xae; *(uint8_t*)0x20000158 = 0x95; *(uint8_t*)0x20000159 = 0; *(uint16_t*)0x2000015a = 0; *(uint32_t*)0x2000015c = 0; *(uint64_t*)0x20000250 = 0x200001c0; memcpy((void*)0x200001c0, "GPL\000", 4); *(uint32_t*)0x20000258 = 0; *(uint32_t*)0x2000025c = 0; *(uint64_t*)0x20000260 = 0; *(uint32_t*)0x20000268 = 0; *(uint32_t*)0x2000026c = 0; memset((void*)0x20000270, 0, 16); *(uint32_t*)0x20000280 = 0; *(uint32_t*)0x20000284 = 0; *(uint32_t*)0x20000288 = -1; *(uint32_t*)0x2000028c = 8; *(uint64_t*)0x20000290 = 0; *(uint32_t*)0x20000298 = 0; *(uint32_t*)0x2000029c = 0x10; *(uint64_t*)0x200002a0 = 0; *(uint32_t*)0x200002a8 = 0; *(uint32_t*)0x200002ac = 0; *(uint32_t*)0x200002b0 = 0; *(uint32_t*)0x200002b4 = 0; *(uint64_t*)0x200002b8 = 0; *(uint64_t*)0x200002c0 = 0; *(uint32_t*)0x200002c8 = 0x10; *(uint32_t*)0x200002cc = 8; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20000240ul, /*size=*/0x90ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000080 = r[0]; *(uint32_t*)0x20000084 = -1; *(uint32_t*)0x20000088 = 0; syscall(__NR_bpf, /*cmd=*/0xaul, /*arg=*/0x20000080ul, /*size=*/0xcul); return 0; }