// https://syzkaller.appspot.com/bug?id=80ffd087a886df22d21a44af2c6809a5d3ff2d9b // 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[3] = {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=*/3ul, /*proto=*/0); if (res != -1) r[0] = res; res = syscall(__NR_socket, /*domain=*/0x11ul, /*type=*/2ul, /*proto=*/0x300); if (res != -1) r[1] = res; memcpy((void*)0x20000080, "ip6tnl0\000\000\000\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x8933, /*arg=*/0x20000080ul); if (res != -1) r[2] = *(uint32_t*)0x20000090; *(uint64_t*)0x200007c0 = 0; *(uint32_t*)0x200007c8 = 0; *(uint64_t*)0x200007d0 = 0x20004640; *(uint64_t*)0x20004640 = 0x20000980; *(uint32_t*)0x20000980 = 0x108; *(uint16_t*)0x20000984 = 0x24; *(uint16_t*)0x20000986 = 0xf0b; *(uint32_t*)0x20000988 = 0; *(uint32_t*)0x2000098c = 0; *(uint8_t*)0x20000990 = 0; *(uint8_t*)0x20000991 = 0; *(uint16_t*)0x20000992 = 0; *(uint32_t*)0x20000994 = r[2]; *(uint16_t*)0x20000998 = 0; *(uint16_t*)0x2000099a = 0; *(uint16_t*)0x2000099c = -1; *(uint16_t*)0x2000099e = -1; *(uint16_t*)0x200009a0 = 0; *(uint16_t*)0x200009a2 = 0; *(uint16_t*)0x200009a4 = 0xa; *(uint16_t*)0x200009a6 = 1; memcpy((void*)0x200009a8, "netem\000", 6); *(uint16_t*)0x200009b0 = 0xd8; *(uint16_t*)0x200009b2 = 2; *(uint32_t*)0x200009b4 = 0; *(uint32_t*)0x200009b8 = 0; *(uint32_t*)0x200009bc = 0; *(uint32_t*)0x200009c0 = 0; *(uint32_t*)0x200009c4 = 0; *(uint32_t*)0x200009c8 = 0; *(uint16_t*)0x200009cc = 0x14; *(uint16_t*)0x200009ce = 6; *(uint32_t*)0x200009d0 = 0; *(uint32_t*)0x200009d4 = 0; *(uint32_t*)0x200009d8 = 0; *(uint32_t*)0x200009dc = 0; *(uint16_t*)0x200009e0 = 0xa; *(uint16_t*)0x200009e2 = 2; memcpy((void*)0x200009e4, "\x58\xd5\xc0\x80\xbb\xdd", 6); *(uint16_t*)0x200009ec = 0x4c; STORE_BY_BITMASK(uint16_t, , 0x200009ee, 5, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200009ef, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200009ef, 1, 7, 1); *(uint16_t*)0x200009f0 = 0x18; *(uint16_t*)0x200009f2 = 8; *(uint32_t*)0x200009f4 = 0; *(uint32_t*)0x200009f8 = 0; *(uint32_t*)0x200009fc = 0; *(uint32_t*)0x20000a00 = 0; *(uint32_t*)0x20000a04 = 0; *(uint16_t*)0x20000a08 = 0x18; *(uint16_t*)0x20000a0a = 1; *(uint32_t*)0x20000a0c = 0; *(uint32_t*)0x20000a10 = 0; *(uint32_t*)0x20000a14 = 0; *(uint32_t*)0x20000a18 = 0; *(uint32_t*)0x20000a1c = 0; *(uint16_t*)0x20000a20 = 0x18; *(uint16_t*)0x20000a22 = 1; *(uint32_t*)0x20000a24 = 0; *(uint32_t*)0x20000a28 = 0; *(uint32_t*)0x20000a2c = 0; *(uint32_t*)0x20000a30 = 0; *(uint32_t*)0x20000a34 = 0; *(uint16_t*)0x20000a38 = 0x44; STORE_BY_BITMASK(uint16_t, , 0x20000a3a, 5, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000a3b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000a3b, 1, 7, 1); *(uint16_t*)0x20000a3c = 0x14; *(uint16_t*)0x20000a3e = 2; *(uint32_t*)0x20000a40 = 0; *(uint32_t*)0x20000a44 = 0; *(uint32_t*)0x20000a48 = 0; *(uint32_t*)0x20000a4c = 0; *(uint16_t*)0x20000a50 = 0x14; *(uint16_t*)0x20000a52 = 2; *(uint32_t*)0x20000a54 = 0; *(uint32_t*)0x20000a58 = 0; *(uint32_t*)0x20000a5c = 0; *(uint32_t*)0x20000a60 = 0; *(uint16_t*)0x20000a64 = 0x18; *(uint16_t*)0x20000a66 = 1; *(uint32_t*)0x20000a68 = 0; *(uint32_t*)0x20000a6c = 0; *(uint32_t*)0x20000a70 = 0; *(uint32_t*)0x20000a74 = 0; *(uint32_t*)0x20000a78 = 0; *(uint16_t*)0x20000a7c = 0xc; *(uint16_t*)0x20000a7e = 3; *(uint32_t*)0x20000a80 = 0; *(uint32_t*)0x20000a84 = 0; *(uint64_t*)0x20004648 = 0x108; *(uint64_t*)0x200007d8 = 1; *(uint64_t*)0x200007e0 = 0; *(uint64_t*)0x200007e8 = 0; *(uint32_t*)0x200007f0 = 0; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x200007c0ul, /*f=*/0ul); return 0; }