// https://syzkaller.appspot.com/bug?id=02568ee96e5c44a7785f938d37ef6fd3840c6d8f // 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*)0x20002c80 = 3; *(uint32_t*)0x20002c84 = 0xc; *(uint64_t*)0x20002c88 = 0x20000140; *(uint8_t*)0x20000140 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000141, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000141, 0, 4, 4); *(uint16_t*)0x20000142 = 0; *(uint32_t*)0x20000144 = -1; *(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 = 0x27; *(uint8_t*)0x20000158 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000159, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000159, 0, 4, 4); *(uint16_t*)0x2000015a = 0; *(uint32_t*)0x2000015c = 0x25702020; *(uint8_t*)0x20000160 = 0; *(uint8_t*)0x20000161 = 0; *(uint16_t*)0x20000162 = 0; *(uint32_t*)0x20000164 = 0x20202000; STORE_BY_BITMASK(uint8_t, , 0x20000168, 3, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000168, 3, 3, 2); STORE_BY_BITMASK(uint8_t, , 0x20000168, 3, 5, 3); STORE_BY_BITMASK(uint8_t, , 0x20000169, 0xa, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000169, 1, 4, 4); *(uint16_t*)0x2000016a = 0xfff8; *(uint32_t*)0x2000016c = 0; STORE_BY_BITMASK(uint8_t, , 0x20000170, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000170, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000170, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000171, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000171, 0xa, 4, 4); *(uint16_t*)0x20000172 = 0; *(uint32_t*)0x20000174 = 0; STORE_BY_BITMASK(uint8_t, , 0x20000178, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000178, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000178, 0, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000179, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000179, 0, 4, 4); *(uint16_t*)0x2000017a = 0; *(uint32_t*)0x2000017c = 0xfffffff8; STORE_BY_BITMASK(uint8_t, , 0x20000180, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000180, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000180, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000181, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000181, 0, 4, 4); *(uint16_t*)0x20000182 = 0; *(uint32_t*)0x20000184 = 8; STORE_BY_BITMASK(uint8_t, , 0x20000188, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000188, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000188, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000189, 3, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000189, 0, 4, 4); *(uint16_t*)0x2000018a = 0; *(uint32_t*)0x2000018c = 0; *(uint8_t*)0x20000190 = 0x85; *(uint8_t*)0x20000191 = 0; *(uint16_t*)0x20000192 = 0; *(uint32_t*)0x20000194 = 0x71; *(uint8_t*)0x20000198 = 0x95; *(uint8_t*)0x20000199 = 0; *(uint16_t*)0x2000019a = 0; *(uint32_t*)0x2000019c = 0; *(uint64_t*)0x20002c90 = 0x20000080; memcpy((void*)0x20000080, "GPL\000", 4); *(uint32_t*)0x20002c98 = 0; *(uint32_t*)0x20002c9c = 0; *(uint64_t*)0x20002ca0 = 0; *(uint32_t*)0x20002ca8 = 0; *(uint32_t*)0x20002cac = 0; memset((void*)0x20002cb0, 0, 16); *(uint32_t*)0x20002cc0 = 0; *(uint32_t*)0x20002cc4 = 0; *(uint32_t*)0x20002cc8 = -1; *(uint32_t*)0x20002ccc = 8; *(uint64_t*)0x20002cd0 = 0; *(uint32_t*)0x20002cd8 = 0; *(uint32_t*)0x20002cdc = 0x10; *(uint64_t*)0x20002ce0 = 0; *(uint32_t*)0x20002ce8 = 0; *(uint32_t*)0x20002cec = 0; *(uint32_t*)0x20002cf0 = 0; *(uint32_t*)0x20002cf4 = 0; *(uint64_t*)0x20002cf8 = 0; *(uint64_t*)0x20002d00 = 0; *(uint32_t*)0x20002d08 = 0x10; *(uint32_t*)0x20002d0c = 0; res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x20002c80ul, /*size=*/0x90ul); if (res != -1) r[0] = res; *(uint32_t*)0x200002c0 = r[0]; *(uint32_t*)0x200002c4 = 0; *(uint32_t*)0x200002c8 = 0xe; *(uint32_t*)0x200002cc = 0; *(uint64_t*)0x200002d0 = 0x20000100; memcpy((void*)0x20000100, "\xe0\xb9\x54\x7e\xd3\x87\xdb\xe9\xab\xc8\x9b\x6f\x5b\xec", 14); *(uint64_t*)0x200002d8 = 0; *(uint32_t*)0x200002e0 = 0; *(uint32_t*)0x200002e4 = 0; *(uint32_t*)0x200002e8 = 0; *(uint32_t*)0x200002ec = 0; *(uint64_t*)0x200002f0 = 0; *(uint64_t*)0x200002f8 = 0; *(uint32_t*)0x20000300 = 0; *(uint32_t*)0x20000304 = 0; *(uint32_t*)0x20000308 = 0; syscall(__NR_bpf, /*cmd=*/0xaul, /*arg=*/0x200002c0ul, /*size=*/0x48ul); return 0; }