// https://syzkaller.appspot.com/bug?id=66f48a45762e3568449d268c42bf62e63419100b // 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[5] = {0xffffffffffffffff, 0x0, 0xffffffffffffffff, 0xffffffffffffffff, 0x0}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/0x803ul, /*proto=*/0); if (res != -1) r[0] = res; *(uint64_t*)0x20000380 = 0; *(uint32_t*)0x20000388 = 0; *(uint64_t*)0x20000390 = 0x20000340; *(uint64_t*)0x20000340 = 0; *(uint64_t*)0x20000348 = 0x14; *(uint64_t*)0x20000398 = 1; *(uint64_t*)0x200003a0 = 0; *(uint64_t*)0x200003a8 = 0; *(uint32_t*)0x200003b0 = 0; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000380ul, /*f=*/0ul); *(uint32_t*)0x20000300 = 0x14; res = syscall(__NR_getsockname, /*fd=*/r[0], /*addr=*/0x20000100ul, /*addrlen=*/0x20000300ul); if (res != -1) r[1] = *(uint32_t*)0x20000104; res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0); if (res != -1) r[2] = res; res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/0x803ul, /*proto=*/0); if (res != -1) r[3] = res; *(uint64_t*)0x20000380 = 0; *(uint32_t*)0x20000388 = 0; *(uint64_t*)0x20000390 = 0x20000340; *(uint64_t*)0x20000340 = 0; *(uint64_t*)0x20000348 = 0x14; *(uint64_t*)0x20000398 = 1; *(uint64_t*)0x200003a0 = 0; *(uint64_t*)0x200003a8 = 0; *(uint32_t*)0x200003b0 = 0; syscall(__NR_sendmsg, /*fd=*/r[3], /*msg=*/0x20000380ul, /*f=*/0ul); *(uint32_t*)0x20000200 = 0x28a; res = syscall(__NR_getsockname, /*fd=*/r[3], /*addr=*/0x20000140ul, /*addrlen=*/0x20000200ul); if (res != -1) r[4] = *(uint32_t*)0x20000144; *(uint64_t*)0x20000080 = 0; *(uint32_t*)0x20000088 = 0; *(uint64_t*)0x20000090 = 0x20000500; *(uint64_t*)0x20000500 = 0x20000240; *(uint32_t*)0x20000240 = 0x38; *(uint16_t*)0x20000244 = 0x10; *(uint16_t*)0x20000246 = 0x439; *(uint32_t*)0x20000248 = 0; *(uint32_t*)0x2000024c = 0; *(uint8_t*)0x20000250 = 0; *(uint8_t*)0x20000251 = 0; *(uint16_t*)0x20000252 = 0; *(uint32_t*)0x20000254 = r[4]; *(uint32_t*)0x20000258 = 0x1be49; *(uint32_t*)0x2000025c = 0; *(uint16_t*)0x20000260 = 0x18; STORE_BY_BITMASK(uint16_t, , 0x20000262, 0x12, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000263, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000263, 1, 7, 1); *(uint16_t*)0x20000264 = 8; *(uint16_t*)0x20000266 = 1; memcpy((void*)0x20000268, "sit\000", 4); *(uint16_t*)0x2000026c = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000026e, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000026f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000026f, 1, 7, 1); *(uint16_t*)0x20000270 = 8; *(uint16_t*)0x20000272 = 1; *(uint32_t*)0x20000274 = r[1]; *(uint64_t*)0x20000508 = 0x38; *(uint64_t*)0x20000098 = 1; *(uint64_t*)0x200000a0 = 0; *(uint64_t*)0x200000a8 = 0; *(uint32_t*)0x200000b0 = 0; syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x20000080ul, /*f=*/0ul); return 0; }