// https://syzkaller.appspot.com/bug?id=fae1fcb4f080abd71cc89775330f46abbd0e3334 // 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)))) int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } *(uint32_t*)0x200000000440 = 0xb; *(uint32_t*)0x200000000444 = 6; *(uint64_t*)0x200000000448 = 0x200000000000; *(uint8_t*)0x200000000000 = 5; STORE_BY_BITMASK(uint8_t, , 0x200000000001, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000001, 0, 4, 4); *(uint16_t*)0x200000000002 = 0; *(uint32_t*)0x200000000004 = 0; *(uint8_t*)0x200000000008 = 0x71; *(uint8_t*)0x200000000009 = 0x11; *(uint16_t*)0x20000000000a = 0xa9; *(uint32_t*)0x20000000000c = 0; *(uint8_t*)0x200000000010 = 0x85; STORE_BY_BITMASK(uint8_t, , 0x200000000011, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000011, 1, 4, 4); *(uint16_t*)0x200000000012 = 0; *(uint32_t*)0x200000000014 = 2; *(uint8_t*)0x200000000018 = 0x85; *(uint8_t*)0x200000000019 = 0; *(uint16_t*)0x20000000001a = 0; *(uint32_t*)0x20000000001c = 0x2a; *(uint8_t*)0x200000000020 = 0x95; *(uint8_t*)0x200000000021 = 0; *(uint16_t*)0x200000000022 = 0; *(uint32_t*)0x200000000024 = 0; *(uint8_t*)0x200000000028 = 0x95; *(uint8_t*)0x200000000029 = 0; *(uint16_t*)0x20000000002a = 0x5a5; *(uint32_t*)0x20000000002c = 0; *(uint64_t*)0x200000000450 = 0x200000000080; memcpy((void*)0x200000000080, "GPL\000", 4); *(uint32_t*)0x200000000458 = 5; *(uint32_t*)0x20000000045c = 0x29e; *(uint64_t*)0x200000000460 = 0x20000000cf3d; *(uint32_t*)0x200000000468 = 0; *(uint32_t*)0x20000000046c = 0; memset((void*)0x200000000470, 0, 16); *(uint32_t*)0x200000000480 = 0; *(uint32_t*)0x200000000484 = 0; *(uint32_t*)0x200000000488 = -1; *(uint32_t*)0x20000000048c = 6; *(uint64_t*)0x200000000490 = 0; *(uint32_t*)0x200000000498 = 0; *(uint32_t*)0x20000000049c = 0x10; *(uint64_t*)0x2000000004a0 = 0; *(uint32_t*)0x2000000004a8 = 0; *(uint32_t*)0x2000000004ac = 0; *(uint32_t*)0x2000000004b0 = -1; *(uint32_t*)0x2000000004b4 = 0; *(uint64_t*)0x2000000004b8 = 0; *(uint64_t*)0x2000000004c0 = 0; *(uint32_t*)0x2000000004c8 = 0x10; *(uint32_t*)0x2000000004cc = 0; *(uint32_t*)0x2000000004d0 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000440ul, /*size=*/0x70ul); return 0; }