// 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 #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, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0); intptr_t res = 0; *(uint32_t*)0x20fe1000 = 5; *(uint32_t*)0x20fe1004 = 0x83; *(uint32_t*)0x20fe1008 = 0x80; *(uint32_t*)0x20fe100c = 0xf; *(uint32_t*)0x20fe1010 = 1; *(uint32_t*)0x20fe1014 = -1; *(uint32_t*)0x20fe1018 = 0; *(uint8_t*)0x20fe101c = 0; *(uint8_t*)0x20fe101d = 0; *(uint8_t*)0x20fe101e = 0; *(uint8_t*)0x20fe101f = 0; *(uint8_t*)0x20fe1020 = 0; *(uint8_t*)0x20fe1021 = 0; *(uint8_t*)0x20fe1022 = 0; *(uint8_t*)0x20fe1023 = 0; *(uint8_t*)0x20fe1024 = 0; *(uint8_t*)0x20fe1025 = 0; *(uint8_t*)0x20fe1026 = 0; *(uint8_t*)0x20fe1027 = 0; *(uint8_t*)0x20fe1028 = 0; *(uint8_t*)0x20fe1029 = 0; *(uint8_t*)0x20fe102a = 0; *(uint8_t*)0x20fe102b = 0; *(uint32_t*)0x20fe102c = 0; *(uint32_t*)0x20fe1030 = -1; *(uint32_t*)0x20fe1034 = 0; *(uint32_t*)0x20fe1038 = 0; *(uint32_t*)0x20fe103c = 0; res = syscall(__NR_bpf, 0ul, 0x20fe1000ul, 0x40ul); if (res != -1) r[0] = res; *(uint32_t*)0x20fed000 = 2; *(uint32_t*)0x20fed004 = 9; *(uint64_t*)0x20fed008 = 0x200000c0; *(uint8_t*)0x200000c0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200000c1, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000c1, 0, 4, 4); *(uint16_t*)0x200000c2 = 0; *(uint32_t*)0x200000c4 = 0; *(uint8_t*)0x200000c8 = 0; *(uint8_t*)0x200000c9 = 0; *(uint16_t*)0x200000ca = 0; *(uint32_t*)0x200000cc = 0; *(uint8_t*)0x200000d0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200000d1, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000d1, 2, 4, 4); *(uint16_t*)0x200000d2 = 0; *(uint32_t*)0x200000d4 = r[0]; *(uint8_t*)0x200000d8 = 0; *(uint8_t*)0x200000d9 = 0; *(uint16_t*)0x200000da = 0; *(uint32_t*)0x200000dc = 0x40000000; *(uint8_t*)0x200000e0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200000e1, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000e1, 1, 4, 4); *(uint16_t*)0x200000e2 = 0; *(uint32_t*)0x200000e4 = -1; *(uint8_t*)0x200000e8 = 0; *(uint8_t*)0x200000e9 = 0; *(uint16_t*)0x200000ea = 0; *(uint32_t*)0x200000ec = 0; *(uint8_t*)0x200000f0 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200000f1, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000f1, 1, 4, 4); *(uint16_t*)0x200000f2 = 0; *(uint32_t*)0x200000f4 = -1; *(uint8_t*)0x200000f8 = 0; *(uint8_t*)0x200000f9 = 0; *(uint16_t*)0x200000fa = 0; *(uint32_t*)0x200000fc = 0; *(uint8_t*)0x20000100 = 0x95; *(uint8_t*)0x20000101 = 0; *(uint16_t*)0x20000102 = 0; *(uint32_t*)0x20000104 = 0; *(uint64_t*)0x20fed010 = 0x20919ff6; memcpy((void*)0x20919ff6, "syzkaller\000", 10); *(uint32_t*)0x20fed018 = 0; *(uint32_t*)0x20fed01c = 0xe1; *(uint64_t*)0x20fed020 = 0x20000000; *(uint32_t*)0x20fed028 = 0; *(uint32_t*)0x20fed02c = 0; *(uint8_t*)0x20fed030 = 0; *(uint8_t*)0x20fed031 = 0; *(uint8_t*)0x20fed032 = 0; *(uint8_t*)0x20fed033 = 0; *(uint8_t*)0x20fed034 = 0; *(uint8_t*)0x20fed035 = 0; *(uint8_t*)0x20fed036 = 0; *(uint8_t*)0x20fed037 = 0; *(uint8_t*)0x20fed038 = 0; *(uint8_t*)0x20fed039 = 0; *(uint8_t*)0x20fed03a = 0; *(uint8_t*)0x20fed03b = 0; *(uint8_t*)0x20fed03c = 0; *(uint8_t*)0x20fed03d = 0; *(uint8_t*)0x20fed03e = 0; *(uint8_t*)0x20fed03f = 0; *(uint32_t*)0x20fed040 = 0; *(uint32_t*)0x20fed044 = 0; *(uint32_t*)0x20fed048 = -1; *(uint32_t*)0x20fed04c = 8; *(uint64_t*)0x20fed050 = 0x20000000; *(uint32_t*)0x20000000 = 0; *(uint32_t*)0x20000004 = 0; *(uint32_t*)0x20fed058 = 0; *(uint32_t*)0x20fed05c = 0x10; *(uint64_t*)0x20fed060 = 0x20000000; *(uint32_t*)0x20000000 = 0; *(uint32_t*)0x20000004 = 0; *(uint32_t*)0x20000008 = 0; *(uint32_t*)0x2000000c = 0; *(uint32_t*)0x20fed068 = 0; *(uint32_t*)0x20fed06c = 0; *(uint32_t*)0x20fed070 = -1; syscall(__NR_bpf, 5ul, 0x20fed000ul, 0x14ul); return 0; }