// https://syzkaller.appspot.com/bug?id=92c9df95bc2dfc3eb097ba4961f3d5a3f0e215cc // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #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)))) #ifndef __NR_bpf #define __NR_bpf 321 #endif 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*)0x20000480 = 0x11; *(uint32_t*)0x20000484 = 3; *(uint64_t*)0x20000488 = 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 = 0x95; *(uint8_t*)0x20000011 = 0; *(uint16_t*)0x20000012 = 0; *(uint32_t*)0x20000014 = 0; *(uint64_t*)0x20000490 = 0x20000080; memcpy((void*)0x20000080, "GPL\000", 4); *(uint32_t*)0x20000498 = 0; *(uint32_t*)0x2000049c = 0; *(uint64_t*)0x200004a0 = 0; *(uint32_t*)0x200004a8 = 0; *(uint32_t*)0x200004ac = 0; *(uint8_t*)0x200004b0 = 0x2e; *(uint8_t*)0x200004b1 = 0; *(uint8_t*)0x200004b2 = 0; *(uint8_t*)0x200004b3 = 0; *(uint8_t*)0x200004b4 = 0; *(uint8_t*)0x200004b5 = 0; *(uint8_t*)0x200004b6 = 0; *(uint8_t*)0x200004b7 = 0; *(uint8_t*)0x200004b8 = 0; *(uint8_t*)0x200004b9 = 0; *(uint8_t*)0x200004ba = 0; *(uint8_t*)0x200004bb = 0; *(uint8_t*)0x200004bc = 0; *(uint8_t*)0x200004bd = 0; *(uint8_t*)0x200004be = 0; *(uint8_t*)0x200004bf = 0; *(uint32_t*)0x200004c0 = 0; *(uint32_t*)0x200004c4 = 0; *(uint32_t*)0x200004c8 = -1; *(uint32_t*)0x200004cc = 8; *(uint64_t*)0x200004d0 = 0; *(uint32_t*)0x200004d8 = 0; *(uint32_t*)0x200004dc = 0x10; *(uint64_t*)0x200004e0 = 0; *(uint32_t*)0x200004e8 = 0; *(uint32_t*)0x200004ec = 0; *(uint32_t*)0x200004f0 = 0; res = syscall(__NR_bpf, 5ul, 0x20000480ul, 0x78ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000600 = r[0]; *(uint32_t*)0x20000604 = 0; *(uint32_t*)0x20000608 = 0; *(uint32_t*)0x2000060c = 0; *(uint64_t*)0x20000610 = 0; *(uint64_t*)0x20000618 = 0; *(uint32_t*)0x20000620 = 0; *(uint32_t*)0x20000624 = 0; *(uint32_t*)0x20000628 = 0xfffffc26; *(uint32_t*)0x2000062c = 0; *(uint64_t*)0x20000630 = 0x200000c0; memcpy((void*)0x200000c0, "\000", 1); *(uint64_t*)0x20000638 = 0; *(uint32_t*)0x20000640 = 0; *(uint32_t*)0x20000644 = 0; syscall(__NR_bpf, 0xaul, 0x20000600ul, 0x48ul); return 0; }