// 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, 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*)0x204f9fe4 = 5; *(uint32_t*)0x204f9fe8 = 4; *(uint32_t*)0x204f9fec = 0x24; *(uint32_t*)0x204f9ff0 = 4; *(uint32_t*)0x204f9ff4 = 9; *(uint32_t*)0x204f9ff8 = -1; *(uint32_t*)0x204f9ffc = 0; memset((void*)0x204fa000, 0, 16); *(uint32_t*)0x204fa010 = 0; *(uint32_t*)0x204fa014 = -1; *(uint32_t*)0x204fa018 = 0; *(uint32_t*)0x204fa01c = 0; *(uint32_t*)0x204fa020 = 0; res = syscall(__NR_bpf, 0ul, 0x204f9fe4ul, 0x40ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000300 = 0x11; *(uint32_t*)0x20000304 = 5; *(uint64_t*)0x20000308 = 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, 0, 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*)0x20000310 = 0x20000100; memcpy((void*)0x20000100, "GPL\000", 4); *(uint32_t*)0x20000318 = 4; *(uint32_t*)0x2000031c = 0x8f; *(uint64_t*)0x20000320 = 0x20000040; *(uint32_t*)0x20000328 = 0; *(uint32_t*)0x2000032c = 0; memset((void*)0x20000330, 0, 16); *(uint32_t*)0x20000340 = 0; *(uint32_t*)0x20000344 = 0; *(uint32_t*)0x20000348 = -1; *(uint32_t*)0x2000034c = 8; *(uint64_t*)0x20000350 = 0; *(uint32_t*)0x20000358 = 0; *(uint32_t*)0x2000035c = 0x10; *(uint64_t*)0x20000360 = 0; *(uint32_t*)0x20000368 = 0; *(uint32_t*)0x2000036c = 0; *(uint32_t*)0x20000370 = 0; syscall(__NR_bpf, 5ul, 0x20000300ul, 0x78ul); return 0; }