// https://syzkaller.appspot.com/bug?id=79c7cd17a7d2b58c5973606a4fa7e63d56974443 // 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)))) uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0); intptr_t res = 0; res = syscall(__NR_socket, 0x10ul, 3ul, 0xcul); if (res != -1) r[0] = res; *(uint64_t*)0x20001080 = 0; *(uint32_t*)0x20001088 = 0; *(uint64_t*)0x20001090 = 0x20000080; *(uint64_t*)0x20000080 = 0x20000f80; *(uint32_t*)0x20000f80 = 0x50; *(uint8_t*)0x20000f84 = 2; *(uint8_t*)0x20000f85 = 6; *(uint16_t*)0x20000f86 = 0x505; *(uint32_t*)0x20000f88 = 0; *(uint32_t*)0x20000f8c = 0; *(uint8_t*)0x20000f90 = 0; *(uint8_t*)0x20000f91 = 0; *(uint16_t*)0x20000f92 = htobe16(0); *(uint16_t*)0x20000f94 = 0xc; *(uint16_t*)0x20000f96 = 3; memcpy((void*)0x20000f98, "hash:ip\000", 8); *(uint16_t*)0x20000fa0 = 5; *(uint16_t*)0x20000fa2 = 4; *(uint8_t*)0x20000fa4 = 0; *(uint16_t*)0x20000fa8 = 9; *(uint16_t*)0x20000faa = 2; memcpy((void*)0x20000fac, "syz0\000", 5); *(uint16_t*)0x20000fb4 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000fb6, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000fb7, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000fb7, 1, 7, 1); *(uint16_t*)0x20000fb8 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000fba, 6, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000fbb, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000fbb, 0, 7, 1); *(uint32_t*)0x20000fbc = htobe32(0); *(uint16_t*)0x20000fc0 = 5; *(uint16_t*)0x20000fc2 = 5; *(uint8_t*)0x20000fc4 = 2; *(uint16_t*)0x20000fc8 = 5; *(uint16_t*)0x20000fca = 1; *(uint8_t*)0x20000fcc = 7; *(uint64_t*)0x20000088 = 0x50; *(uint64_t*)0x20001098 = 1; *(uint64_t*)0x200010a0 = 0; *(uint64_t*)0x200010a8 = 0; *(uint32_t*)0x200010b0 = 0; syscall(__NR_sendmsg, r[0], 0x20001080ul, 0ul); res = syscall(__NR_socket, 0x10ul, 3ul, 0xcul); if (res != -1) r[1] = res; *(uint64_t*)0x20001a00 = 0; *(uint32_t*)0x20001a08 = 0; *(uint64_t*)0x20001a10 = 0x200019c0; *(uint64_t*)0x200019c0 = 0x20001900; *(uint32_t*)0x20001900 = 0x34; *(uint8_t*)0x20001904 = 0xb; *(uint8_t*)0x20001905 = 6; *(uint16_t*)0x20001906 = 1; *(uint32_t*)0x20001908 = 0; *(uint32_t*)0x2000190c = 0; *(uint8_t*)0x20001910 = 0; *(uint8_t*)0x20001911 = 0; *(uint16_t*)0x20001912 = htobe16(0); *(uint16_t*)0x20001914 = 5; *(uint16_t*)0x20001916 = 1; *(uint8_t*)0x20001918 = 7; *(uint16_t*)0x2000191c = 9; *(uint16_t*)0x2000191e = 2; memcpy((void*)0x20001920, "syz0\000", 5); *(uint16_t*)0x20001928 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000192a, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000192b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000192b, 1, 7, 1); *(uint16_t*)0x2000192c = 8; STORE_BY_BITMASK(uint16_t, , 0x2000192e, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000192f, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000192f, 0, 7, 1); *(uint32_t*)0x20001930 = htobe32(9); *(uint64_t*)0x200019c8 = 0x34; *(uint64_t*)0x20001a18 = 1; *(uint64_t*)0x20001a20 = 0; *(uint64_t*)0x20001a28 = 0; *(uint32_t*)0x20001a30 = 0; syscall(__NR_sendmsg, r[1], 0x20001a00ul, 0ul); return 0; }