// https://syzkaller.appspot.com/bug?id=157b9613a410da014866c2865af1be18db03d922 // 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*)0x20000000 = 0; *(uint32_t*)0x20000008 = 0; *(uint64_t*)0x20000010 = 0x20000080; *(uint64_t*)0x20000080 = 0x20000f80; *(uint32_t*)0x20000f80 = 0x58; *(uint8_t*)0x20000f84 = 2; *(uint8_t*)0x20000f85 = 6; *(uint16_t*)0x20000f86 = 1; *(uint32_t*)0x20000f88 = 0; *(uint32_t*)0x20000f8c = 0; *(uint8_t*)0x20000f90 = 0; *(uint8_t*)0x20000f91 = 0; *(uint16_t*)0x20000f92 = htobe16(0); *(uint16_t*)0x20000f94 = 0x12; *(uint16_t*)0x20000f96 = 3; memcpy((void*)0x20000f98, "hash:net,port\000", 14); *(uint16_t*)0x20000fa8 = 5; *(uint16_t*)0x20000faa = 4; *(uint8_t*)0x20000fac = 0; *(uint16_t*)0x20000fb0 = 9; *(uint16_t*)0x20000fb2 = 2; memcpy((void*)0x20000fb4, "syz0\000", 5); *(uint16_t*)0x20000fbc = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000fbe, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000fbf, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000fbf, 1, 7, 1); *(uint16_t*)0x20000fc0 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000fc2, 6, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000fc3, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000fc3, 0, 7, 1); *(uint32_t*)0x20000fc4 = htobe32(0); *(uint16_t*)0x20000fc8 = 5; *(uint16_t*)0x20000fca = 5; *(uint8_t*)0x20000fcc = 2; *(uint16_t*)0x20000fd0 = 5; *(uint16_t*)0x20000fd2 = 1; *(uint8_t*)0x20000fd4 = 7; *(uint64_t*)0x20000088 = 0x58; *(uint64_t*)0x20000018 = 1; *(uint64_t*)0x20000020 = 0; *(uint64_t*)0x20000028 = 0; *(uint32_t*)0x20000030 = 0; syscall(__NR_sendmsg, r[0], 0x20000000ul, 0ul); res = syscall(__NR_socket, 0x10ul, 3ul, 0xcul); if (res != -1) r[1] = res; *(uint64_t*)0x20000180 = 0; *(uint32_t*)0x20000188 = 0; *(uint64_t*)0x20000190 = 0x20000140; *(uint64_t*)0x20000140 = 0x20000080; *(uint32_t*)0x20000080 = 0x4c; *(uint8_t*)0x20000084 = 0xb; *(uint8_t*)0x20000085 = 6; *(uint16_t*)0x20000086 = 1; *(uint32_t*)0x20000088 = 0; *(uint32_t*)0x2000008c = 0; *(uint8_t*)0x20000090 = 0; *(uint8_t*)0x20000091 = 0; *(uint16_t*)0x20000092 = htobe16(0); *(uint16_t*)0x20000094 = 5; *(uint16_t*)0x20000096 = 1; *(uint8_t*)0x20000098 = 7; *(uint16_t*)0x2000009c = 9; *(uint16_t*)0x2000009e = 2; memcpy((void*)0x200000a0, "syz0\000", 5); *(uint16_t*)0x200000a8 = 0x24; STORE_BY_BITMASK(uint16_t, , 0x200000aa, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000ab, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000ab, 1, 7, 1); *(uint16_t*)0x200000ac = 8; STORE_BY_BITMASK(uint16_t, , 0x200000ae, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000af, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000af, 0, 7, 1); *(uint32_t*)0x200000b0 = htobe32(4); *(uint16_t*)0x200000b4 = 9; *(uint16_t*)0x200000b6 = 0x1a; memcpy((void*)0x200000b8, "syz0\000", 5); *(uint16_t*)0x200000c0 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200000c2, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000c3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000c3, 1, 7, 1); *(uint16_t*)0x200000c4 = 8; *(uint16_t*)0x200000c6 = 1; *(uint32_t*)0x200000c8 = htobe32(0); *(uint64_t*)0x20000148 = 0x4c; *(uint64_t*)0x20000198 = 1; *(uint64_t*)0x200001a0 = 0; *(uint64_t*)0x200001a8 = 0; *(uint32_t*)0x200001b0 = 0; syscall(__NR_sendmsg, r[1], 0x20000180ul, 0ul); return 0; }