// https://syzkaller.appspot.com/bug?id=9f640e969e36776be02eb136b1f0a75fc6f5ed49 // 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, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); intptr_t res = 0; *(uint32_t*)0x20000c40 = 1; *(uint32_t*)0x20000c44 = 0x80; *(uint32_t*)0x20000c48 = 8; *(uint32_t*)0x20000c4c = 0x81; *(uint32_t*)0x20000c50 = 0x81; *(uint32_t*)0x20000c54 = -1; *(uint32_t*)0x20000c58 = 0; memset((void*)0x20000c5c, 0, 16); *(uint32_t*)0x20000c6c = 0; *(uint32_t*)0x20000c70 = -1; *(uint32_t*)0x20000c74 = 0; *(uint32_t*)0x20000c78 = 0; *(uint32_t*)0x20000c7c = 0; *(uint64_t*)0x20000c80 = 0; res = syscall(__NR_bpf, 0ul, 0x20000c40ul, 0x48ul); if (res != -1) r[0] = res; *(uint32_t*)0x200004c0 = 0x11; *(uint32_t*)0x200004c4 = 5; *(uint64_t*)0x200004c8 = 0x20000000; *(uint8_t*)0x20000000 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000001, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000001, 0, 4, 4); *(uint16_t*)0x20000002 = 0; *(uint32_t*)0x20000004 = 0; *(uint8_t*)0x20000008 = 0; *(uint8_t*)0x20000009 = 0; *(uint16_t*)0x2000000a = 0; *(uint32_t*)0x2000000c = 0; *(uint8_t*)0x20000010 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000011, 0xa, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000011, 1, 4, 4); *(uint16_t*)0x20000012 = 0; *(uint32_t*)0x20000014 = r[0]; *(uint8_t*)0x20000018 = 0; *(uint8_t*)0x20000019 = 0; *(uint16_t*)0x2000001a = 0; *(uint32_t*)0x2000001c = 0; *(uint8_t*)0x20000020 = 0x95; *(uint8_t*)0x20000021 = 0; *(uint16_t*)0x20000022 = 0; *(uint32_t*)0x20000024 = 0; *(uint64_t*)0x200004d0 = 0x20000300; memcpy((void*)0x20000300, "syzkaller\000", 10); *(uint32_t*)0x200004d8 = 6; *(uint32_t*)0x200004dc = 0xcf; *(uint64_t*)0x200004e0 = 0x20000340; *(uint32_t*)0x200004e8 = 0; *(uint32_t*)0x200004ec = 0; memset((void*)0x200004f0, 0, 16); *(uint32_t*)0x20000500 = 0; *(uint32_t*)0x20000504 = 0; *(uint32_t*)0x20000508 = -1; *(uint32_t*)0x2000050c = 8; *(uint64_t*)0x20000510 = 0; *(uint32_t*)0x20000518 = 0; *(uint32_t*)0x2000051c = 0x10; *(uint64_t*)0x20000520 = 0; *(uint32_t*)0x20000528 = 0; *(uint32_t*)0x2000052c = 0; *(uint32_t*)0x20000530 = 0; *(uint32_t*)0x20000534 = 0; *(uint64_t*)0x20000538 = 0; syscall(__NR_bpf, 5ul, 0x200004c0ul, 0x80ul); return 0; }