// https://syzkaller.appspot.com/bug?id=004b0f7b61d4901cbfecfc33de7996e8cbe0a278 // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #define BITMASK_LEN(type, bf_len) (type)((1ull << (bf_len)) - 1) #define BITMASK_LEN_OFF(type, bf_off, bf_len) \ (type)(BITMASK_LEN(type, (bf_len)) << (bf_off)) #define STORE_BY_BITMASK(type, addr, val, bf_off, bf_len) \ if ((bf_off) == 0 && (bf_len) == 0) { \ *(type*)(addr) = (type)(val); \ } else { \ type new_val = *(type*)(addr); \ new_val &= ~BITMASK_LEN_OFF(type, (bf_off), (bf_len)); \ new_val |= ((type)(val)&BITMASK_LEN(type, (bf_len))) << (bf_off); \ *(type*)(addr) = new_val; \ } uint64_t r[1] = {0xffffffffffffffff}; void loop() { long res = 0; res = syscall(__NR_socket, 0x2b, 1, 1); if (res != -1) r[0] = res; *(uint64_t*)0x20000140 = 0x20000080; *(uint16_t*)0x20000080 = 0x1d; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint32_t*)0x20000148 = 0x10; *(uint64_t*)0x20000150 = 0x20000100; *(uint64_t*)0x20000100 = 0x200000c0; STORE_BY_BITMASK(uint32_t, 0x200000c0, 0, 0, 29); STORE_BY_BITMASK(uint32_t, 0x200000c0, 0, 29, 1); STORE_BY_BITMASK(uint32_t, 0x200000c0, 0x5f2, 30, 1); STORE_BY_BITMASK(uint32_t, 0x200000c0, 8, 31, 1); *(uint8_t*)0x200000c4 = 1; *(uint8_t*)0x200000c5 = 1; *(uint8_t*)0x200000c6 = 0; *(uint8_t*)0x200000c7 = 0; memcpy((void*)0x200000c8, "\xa9\xa6\xe2\x40\xe3\x64\xbc\xac", 8); *(uint64_t*)0x20000108 = 0x10; *(uint64_t*)0x20000158 = 1; *(uint64_t*)0x20000160 = 0; *(uint64_t*)0x20000168 = 0; *(uint32_t*)0x20000170 = 0x10; syscall(__NR_sendmsg, r[0], 0x20000140, 0x20000000); } int main() { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); loop(); return 0; }