// https://syzkaller.appspot.com/bug?id=a8f4b5fec94d9229d3fd8cfb5a2db8b9ad0dec8c // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static __thread int clone_ongoing; static __thread int skip_segv; static __thread jmp_buf segv_env; static void segv_handler(int sig, siginfo_t* info, void* ctx) { if (__atomic_load_n(&clone_ongoing, __ATOMIC_RELAXED) != 0) { exit(sig); } uintptr_t addr = (uintptr_t)info->si_addr; const uintptr_t prog_start = 1 << 20; const uintptr_t prog_end = 100 << 20; int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; int valid = addr < prog_start || addr > prog_end; if (skip && valid) { _longjmp(segv_env, 1); } exit(sig); } static void install_segv_handler(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8); syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8); memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = segv_handler; sa.sa_flags = SA_NODEFER | SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGBUS, &sa, NULL); } #define NONFAILING(...) \ ({ \ int ok = 1; \ __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ if (_setjmp(segv_env) == 0) { \ __VA_ARGS__; \ } else \ ok = 0; \ __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ ok; \ }) static void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } struct nlmsg { char* pos; int nesting; struct nlattr* nested[8]; char buf[4096]; }; static void netlink_init(struct nlmsg* nlmsg, int typ, int flags, const void* data, int size) { memset(nlmsg, 0, sizeof(*nlmsg)); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_type = typ; hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; memcpy(hdr + 1, data, size); nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size); } static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data, int size) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_len = sizeof(*attr) + size; attr->nla_type = typ; if (size > 0) memcpy(attr + 1, data, size); nlmsg->pos += NLMSG_ALIGN(attr->nla_len); } static void netlink_nest(struct nlmsg* nlmsg, int typ) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_type = typ; nlmsg->pos += sizeof(*attr); nlmsg->nested[nlmsg->nesting++] = attr; } static void netlink_done(struct nlmsg* nlmsg) { struct nlattr* attr = nlmsg->nested[--nlmsg->nesting]; attr->nla_len = nlmsg->pos - (char*)attr; } static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type, int* reply_len, bool dofail) { if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting) exit(1); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_len = nlmsg->pos - nlmsg->buf; struct sockaddr_nl addr; memset(&addr, 0, sizeof(addr)); addr.nl_family = AF_NETLINK; ssize_t n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr)); if (n != (ssize_t)hdr->nlmsg_len) { if (dofail) exit(1); return -1; } n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); if (reply_len) *reply_len = 0; if (n < 0) { if (dofail) exit(1); return -1; } if (n < (ssize_t)sizeof(struct nlmsghdr)) { errno = EINVAL; if (dofail) exit(1); return -1; } if (hdr->nlmsg_type == NLMSG_DONE) return 0; if (reply_len && hdr->nlmsg_type == reply_type) { *reply_len = n; return 0; } if (n < (ssize_t)(sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr))) { errno = EINVAL; if (dofail) exit(1); return -1; } if (hdr->nlmsg_type != NLMSG_ERROR) { errno = EINVAL; if (dofail) exit(1); return -1; } errno = -((struct nlmsgerr*)(hdr + 1))->error; return -errno; } static int netlink_send(struct nlmsg* nlmsg, int sock) { return netlink_send_ext(nlmsg, sock, 0, NULL, true); } static int netlink_query_family_id(struct nlmsg* nlmsg, int sock, const char* family_name, bool dofail) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = CTRL_CMD_GETFAMILY; netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, family_name, strnlen(family_name, GENL_NAMSIZ - 1) + 1); int n = 0; int err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n, dofail); if (err < 0) { return -1; } uint16_t id = 0; struct nlattr* attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg->buf + n; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == CTRL_ATTR_FAMILY_ID) { id = *(uint16_t*)(attr + 1); break; } } if (!id) { errno = EINVAL; return -1; } recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); return id; } static int netlink_next_msg(struct nlmsg* nlmsg, unsigned int offset, unsigned int total_len) { struct nlmsghdr* hdr = (struct nlmsghdr*)(nlmsg->buf + offset); if (offset == total_len || offset + hdr->nlmsg_len > total_len) return -1; return hdr->nlmsg_len; } static unsigned int queue_count = 2; static void netlink_add_device_impl(struct nlmsg* nlmsg, const char* type, const char* name, bool up) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; netlink_init(nlmsg, RTM_NEWLINK, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); if (name) netlink_attr(nlmsg, IFLA_IFNAME, name, strlen(name)); netlink_attr(nlmsg, IFLA_NUM_TX_QUEUES, &queue_count, sizeof(queue_count)); netlink_attr(nlmsg, IFLA_NUM_RX_QUEUES, &queue_count, sizeof(queue_count)); netlink_nest(nlmsg, IFLA_LINKINFO); netlink_attr(nlmsg, IFLA_INFO_KIND, type, strlen(type)); } static void netlink_add_device(struct nlmsg* nlmsg, int sock, const char* type, const char* name) { netlink_add_device_impl(nlmsg, type, name, false); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_veth(struct nlmsg* nlmsg, int sock, const char* name, const char* peer) { netlink_add_device_impl(nlmsg, "veth", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_nest(nlmsg, VETH_INFO_PEER); nlmsg->pos += sizeof(struct ifinfomsg); netlink_attr(nlmsg, IFLA_IFNAME, peer, strlen(peer)); netlink_attr(nlmsg, IFLA_NUM_TX_QUEUES, &queue_count, sizeof(queue_count)); netlink_attr(nlmsg, IFLA_NUM_RX_QUEUES, &queue_count, sizeof(queue_count)); netlink_done(nlmsg); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_xfrm(struct nlmsg* nlmsg, int sock, const char* name) { netlink_add_device_impl(nlmsg, "xfrm", name, true); netlink_nest(nlmsg, IFLA_INFO_DATA); int if_id = 1; netlink_attr(nlmsg, 2, &if_id, sizeof(if_id)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_hsr(struct nlmsg* nlmsg, int sock, const char* name, const char* slave1, const char* slave2) { netlink_add_device_impl(nlmsg, "hsr", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); int ifindex1 = if_nametoindex(slave1); netlink_attr(nlmsg, IFLA_HSR_SLAVE1, &ifindex1, sizeof(ifindex1)); int ifindex2 = if_nametoindex(slave2); netlink_attr(nlmsg, IFLA_HSR_SLAVE2, &ifindex2, sizeof(ifindex2)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_linked(struct nlmsg* nlmsg, int sock, const char* type, const char* name, const char* link) { netlink_add_device_impl(nlmsg, type, name, false); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_vlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t id, uint16_t proto) { netlink_add_device_impl(nlmsg, "vlan", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_VLAN_ID, &id, sizeof(id)); netlink_attr(nlmsg, IFLA_VLAN_PROTOCOL, &proto, sizeof(proto)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_macvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link) { netlink_add_device_impl(nlmsg, "macvlan", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); uint32_t mode = MACVLAN_MODE_BRIDGE; netlink_attr(nlmsg, IFLA_MACVLAN_MODE, &mode, sizeof(mode)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_geneve(struct nlmsg* nlmsg, int sock, const char* name, uint32_t vni, struct in_addr* addr4, struct in6_addr* addr6) { netlink_add_device_impl(nlmsg, "geneve", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_GENEVE_ID, &vni, sizeof(vni)); if (addr4) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE, addr4, sizeof(*addr4)); if (addr6) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE6, addr6, sizeof(*addr6)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } #define IFLA_IPVLAN_FLAGS 2 #define IPVLAN_MODE_L3S 2 #undef IPVLAN_F_VEPA #define IPVLAN_F_VEPA 2 static void netlink_add_ipvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t mode, uint16_t flags) { netlink_add_device_impl(nlmsg, "ipvlan", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_IPVLAN_MODE, &mode, sizeof(mode)); netlink_attr(nlmsg, IFLA_IPVLAN_FLAGS, &flags, sizeof(flags)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_device_change(struct nlmsg* nlmsg, int sock, const char* name, bool up, const char* master, const void* mac, int macsize, const char* new_name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; hdr.ifi_index = if_nametoindex(name); netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr)); if (new_name) netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex)); } if (macsize) netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static int netlink_add_addr(struct nlmsg* nlmsg, int sock, const char* dev, const void* addr, int addrsize) { struct ifaddrmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ifa_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ifa_prefixlen = addrsize == 4 ? 24 : 120; hdr.ifa_scope = RT_SCOPE_UNIVERSE; hdr.ifa_index = if_nametoindex(dev); netlink_init(nlmsg, RTM_NEWADDR, NLM_F_CREATE | NLM_F_REPLACE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, IFA_LOCAL, addr, addrsize); netlink_attr(nlmsg, IFA_ADDRESS, addr, addrsize); return netlink_send(nlmsg, sock); } static void netlink_add_addr4(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in_addr in_addr; inet_pton(AF_INET, addr, &in_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in_addr, sizeof(in_addr)); if (err < 0) { } } static void netlink_add_addr6(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in6_addr in6_addr; inet_pton(AF_INET6, addr, &in6_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in6_addr, sizeof(in6_addr)); if (err < 0) { } } static void netlink_add_neigh(struct nlmsg* nlmsg, int sock, const char* name, const void* addr, int addrsize, const void* mac, int macsize) { struct ndmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ndm_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ndm_ifindex = if_nametoindex(name); hdr.ndm_state = NUD_PERMANENT; netlink_init(nlmsg, RTM_NEWNEIGH, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, NDA_DST, addr, addrsize); netlink_attr(nlmsg, NDA_LLADDR, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static struct nlmsg nlmsg; static int tunfd = -1; #define TUN_IFACE "syz_tun" #define LOCAL_MAC 0xaaaaaaaaaaaa #define REMOTE_MAC 0xaaaaaaaaaabb #define LOCAL_IPV4 "172.20.20.170" #define REMOTE_IPV4 "172.20.20.187" #define LOCAL_IPV6 "fe80::aa" #define REMOTE_IPV6 "fe80::bb" #define IFF_NAPI 0x0010 static void correct_dev_net_tun(void) { struct stat st; if (stat("/dev/net/tun", &st) == 0) { if (S_ISCHR(st.st_mode) && major(st.st_rdev) == 10 && minor(st.st_rdev) == 200) return; if (unlink("/dev/net/tun")) { } } if (mkdir("/dev/net", 0755) && errno != EEXIST) { } if (mknod("/dev/net/tun", S_IFCHR | 0666, makedev(10, 200))) { } if (chmod("/dev/net/tun", 0666)) { } } static void initialize_tun(void) { correct_dev_net_tun(); tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); if (tunfd == -1) { printf("tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n"); printf("otherwise fuzzing or reproducing might not work as intended\n"); return; } const int kTunFd = 200; if (dup2(tunfd, kTunFd) < 0) exit(1); close(tunfd); tunfd = kTunFd; struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, TUN_IFACE, IFNAMSIZ); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { exit(1); } char sysctl[64]; sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/accept_dad", TUN_IFACE); write_file(sysctl, "0"); sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/router_solicitations", TUN_IFACE); write_file(sysctl, "0"); int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); netlink_add_addr4(&nlmsg, sock, TUN_IFACE, LOCAL_IPV4); netlink_add_addr6(&nlmsg, sock, TUN_IFACE, LOCAL_IPV6); uint64_t macaddr = REMOTE_MAC; struct in_addr in_addr; inet_pton(AF_INET, REMOTE_IPV4, &in_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in_addr, sizeof(in_addr), &macaddr, ETH_ALEN); struct in6_addr in6_addr; inet_pton(AF_INET6, REMOTE_IPV6, &in6_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in6_addr, sizeof(in6_addr), &macaddr, ETH_ALEN); macaddr = LOCAL_MAC; netlink_device_change(&nlmsg, sock, TUN_IFACE, true, 0, &macaddr, ETH_ALEN, NULL); close(sock); } #define DEVLINK_FAMILY_NAME "devlink" #define DEVLINK_CMD_PORT_GET 5 #define DEVLINK_ATTR_BUS_NAME 1 #define DEVLINK_ATTR_DEV_NAME 2 #define DEVLINK_ATTR_NETDEV_NAME 7 static struct nlmsg nlmsg2; static void initialize_devlink_ports(const char* bus_name, const char* dev_name, const char* netdev_prefix) { struct genlmsghdr genlhdr; int len, total_len, id, err, offset; uint16_t netdev_index; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) exit(1); int rtsock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (rtsock == -1) exit(1); id = netlink_query_family_id(&nlmsg, sock, DEVLINK_FAMILY_NAME, true); if (id == -1) goto error; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = DEVLINK_CMD_PORT_GET; netlink_init(&nlmsg, id, NLM_F_DUMP, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1); netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1); err = netlink_send_ext(&nlmsg, sock, id, &total_len, true); if (err < 0) { goto error; } offset = 0; netdev_index = 0; while ((len = netlink_next_msg(&nlmsg, offset, total_len)) != -1) { struct nlattr* attr = (struct nlattr*)(nlmsg.buf + offset + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg.buf + offset + len; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == DEVLINK_ATTR_NETDEV_NAME) { char* port_name; char netdev_name[IFNAMSIZ]; port_name = (char*)(attr + 1); snprintf(netdev_name, sizeof(netdev_name), "%s%d", netdev_prefix, netdev_index); netlink_device_change(&nlmsg2, rtsock, port_name, true, 0, 0, 0, netdev_name); break; } } offset += len; netdev_index++; } error: close(rtsock); close(sock); } static int runcmdline(char* cmdline) { int ret = system(cmdline); if (ret) { } return ret; } #define DEV_IPV4 "172.20.20.%d" #define DEV_IPV6 "fe80::%02x" #define DEV_MAC 0x00aaaaaaaaaa static void netdevsim_add(unsigned int addr, unsigned int port_count) { write_file("/sys/bus/netdevsim/del_device", "%u", addr); if (write_file("/sys/bus/netdevsim/new_device", "%u %u", addr, port_count)) { char buf[32]; snprintf(buf, sizeof(buf), "netdevsim%d", addr); initialize_devlink_ports("netdevsim", buf, "netdevsim"); } } #define WG_GENL_NAME "wireguard" enum wg_cmd { WG_CMD_GET_DEVICE, WG_CMD_SET_DEVICE, }; enum wgdevice_attribute { WGDEVICE_A_UNSPEC, WGDEVICE_A_IFINDEX, WGDEVICE_A_IFNAME, WGDEVICE_A_PRIVATE_KEY, WGDEVICE_A_PUBLIC_KEY, WGDEVICE_A_FLAGS, WGDEVICE_A_LISTEN_PORT, WGDEVICE_A_FWMARK, WGDEVICE_A_PEERS, }; enum wgpeer_attribute { WGPEER_A_UNSPEC, WGPEER_A_PUBLIC_KEY, WGPEER_A_PRESHARED_KEY, WGPEER_A_FLAGS, WGPEER_A_ENDPOINT, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, WGPEER_A_LAST_HANDSHAKE_TIME, WGPEER_A_RX_BYTES, WGPEER_A_TX_BYTES, WGPEER_A_ALLOWEDIPS, WGPEER_A_PROTOCOL_VERSION, }; enum wgallowedip_attribute { WGALLOWEDIP_A_UNSPEC, WGALLOWEDIP_A_FAMILY, WGALLOWEDIP_A_IPADDR, WGALLOWEDIP_A_CIDR_MASK, }; static void netlink_wireguard_setup(void) { const char ifname_a[] = "wg0"; const char ifname_b[] = "wg1"; const char ifname_c[] = "wg2"; const char private_a[] = "\xa0\x5c\xa8\x4f\x6c\x9c\x8e\x38\x53\xe2\xfd\x7a\x70\xae\x0f\xb2\x0f\xa1" "\x52\x60\x0c\xb0\x08\x45\x17\x4f\x08\x07\x6f\x8d\x78\x43"; const char private_b[] = "\xb0\x80\x73\xe8\xd4\x4e\x91\xe3\xda\x92\x2c\x22\x43\x82\x44\xbb\x88\x5c" "\x69\xe2\x69\xc8\xe9\xd8\x35\xb1\x14\x29\x3a\x4d\xdc\x6e"; const char private_c[] = "\xa0\xcb\x87\x9a\x47\xf5\xbc\x64\x4c\x0e\x69\x3f\xa6\xd0\x31\xc7\x4a\x15" "\x53\xb6\xe9\x01\xb9\xff\x2f\x51\x8c\x78\x04\x2f\xb5\x42"; const char public_a[] = "\x97\x5c\x9d\x81\xc9\x83\xc8\x20\x9e\xe7\x81\x25\x4b\x89\x9f\x8e\xd9\x25" "\xae\x9f\x09\x23\xc2\x3c\x62\xf5\x3c\x57\xcd\xbf\x69\x1c"; const char public_b[] = "\xd1\x73\x28\x99\xf6\x11\xcd\x89\x94\x03\x4d\x7f\x41\x3d\xc9\x57\x63\x0e" "\x54\x93\xc2\x85\xac\xa4\x00\x65\xcb\x63\x11\xbe\x69\x6b"; const char public_c[] = "\xf4\x4d\xa3\x67\xa8\x8e\xe6\x56\x4f\x02\x02\x11\x45\x67\x27\x08\x2f\x5c" "\xeb\xee\x8b\x1b\xf5\xeb\x73\x37\x34\x1b\x45\x9b\x39\x22"; const uint16_t listen_a = 20001; const uint16_t listen_b = 20002; const uint16_t listen_c = 20003; const uint16_t af_inet = AF_INET; const uint16_t af_inet6 = AF_INET6; const struct sockaddr_in endpoint_b_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_b), .sin_addr = {htonl(INADDR_LOOPBACK)}}; const struct sockaddr_in endpoint_c_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_c), .sin_addr = {htonl(INADDR_LOOPBACK)}}; struct sockaddr_in6 endpoint_a_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_a)}; endpoint_a_v6.sin6_addr = in6addr_loopback; struct sockaddr_in6 endpoint_c_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_c)}; endpoint_c_v6.sin6_addr = in6addr_loopback; const struct in_addr first_half_v4 = {0}; const struct in_addr second_half_v4 = {(uint32_t)htonl(128 << 24)}; const struct in6_addr first_half_v6 = {{{0}}}; const struct in6_addr second_half_v6 = {{{0x80}}}; const uint8_t half_cidr = 1; const uint16_t persistent_keepalives[] = {1, 3, 7, 9, 14, 19}; struct genlmsghdr genlhdr = {.cmd = WG_CMD_SET_DEVICE, .version = 1}; int sock; int id, err; sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) { return; } id = netlink_query_family_id(&nlmsg, sock, WG_GENL_NAME, true); if (id == -1) goto error; netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_a, strlen(ifname_a) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_a, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_a, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[0], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v6, sizeof(endpoint_c_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[1], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_b, strlen(ifname_b) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_b, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_b, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[2], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v4, sizeof(endpoint_c_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[3], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_c, strlen(ifname_c) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_c, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_c, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[4], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[5], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } error: close(sock); } static void initialize_netdevices(void) { char netdevsim[16]; sprintf(netdevsim, "netdevsim%d", (int)procid); struct { const char* type; const char* dev; } devtypes[] = { {"ip6gretap", "ip6gretap0"}, {"bridge", "bridge0"}, {"vcan", "vcan0"}, {"bond", "bond0"}, {"team", "team0"}, {"dummy", "dummy0"}, {"nlmon", "nlmon0"}, {"caif", "caif0"}, {"batadv", "batadv0"}, {"vxcan", "vxcan1"}, {"veth", 0}, {"wireguard", "wg0"}, {"wireguard", "wg1"}, {"wireguard", "wg2"}, }; const char* devmasters[] = {"bridge", "bond", "team", "batadv"}; struct { const char* name; int macsize; bool noipv6; } devices[] = { {"lo", ETH_ALEN}, {"sit0", 0}, {"bridge0", ETH_ALEN}, {"vcan0", 0, true}, {"tunl0", 0}, {"gre0", 0}, {"gretap0", ETH_ALEN}, {"ip_vti0", 0}, {"ip6_vti0", 0}, {"ip6tnl0", 0}, {"ip6gre0", 0}, {"ip6gretap0", ETH_ALEN}, {"erspan0", ETH_ALEN}, {"bond0", ETH_ALEN}, {"veth0", ETH_ALEN}, {"veth1", ETH_ALEN}, {"team0", ETH_ALEN}, {"veth0_to_bridge", ETH_ALEN}, {"veth1_to_bridge", ETH_ALEN}, {"veth0_to_bond", ETH_ALEN}, {"veth1_to_bond", ETH_ALEN}, {"veth0_to_team", ETH_ALEN}, {"veth1_to_team", ETH_ALEN}, {"veth0_to_hsr", ETH_ALEN}, {"veth1_to_hsr", ETH_ALEN}, {"hsr0", 0}, {"dummy0", ETH_ALEN}, {"nlmon0", 0}, {"vxcan0", 0, true}, {"vxcan1", 0, true}, {"caif0", ETH_ALEN}, {"batadv0", ETH_ALEN}, {netdevsim, ETH_ALEN}, {"xfrm0", ETH_ALEN}, {"veth0_virt_wifi", ETH_ALEN}, {"veth1_virt_wifi", ETH_ALEN}, {"virt_wifi0", ETH_ALEN}, {"veth0_vlan", ETH_ALEN}, {"veth1_vlan", ETH_ALEN}, {"vlan0", ETH_ALEN}, {"vlan1", ETH_ALEN}, {"macvlan0", ETH_ALEN}, {"macvlan1", ETH_ALEN}, {"ipvlan0", ETH_ALEN}, {"ipvlan1", ETH_ALEN}, {"veth0_macvtap", ETH_ALEN}, {"veth1_macvtap", ETH_ALEN}, {"macvtap0", ETH_ALEN}, {"macsec0", ETH_ALEN}, {"veth0_to_batadv", ETH_ALEN}, {"veth1_to_batadv", ETH_ALEN}, {"batadv_slave_0", ETH_ALEN}, {"batadv_slave_1", ETH_ALEN}, {"geneve0", ETH_ALEN}, {"geneve1", ETH_ALEN}, {"wg0", 0}, {"wg1", 0}, {"wg2", 0}, }; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) netlink_add_device(&nlmsg, sock, devtypes[i].type, devtypes[i].dev); for (i = 0; i < sizeof(devmasters) / (sizeof(devmasters[0])); i++) { char master[32], slave0[32], veth0[32], slave1[32], veth1[32]; sprintf(slave0, "%s_slave_0", devmasters[i]); sprintf(veth0, "veth0_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave0, veth0); sprintf(slave1, "%s_slave_1", devmasters[i]); sprintf(veth1, "veth1_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave1, veth1); sprintf(master, "%s0", devmasters[i]); netlink_device_change(&nlmsg, sock, slave0, false, master, 0, 0, NULL); netlink_device_change(&nlmsg, sock, slave1, false, master, 0, 0, NULL); } netlink_add_xfrm(&nlmsg, sock, "xfrm0"); netlink_device_change(&nlmsg, sock, "bridge_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "bridge_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "hsr_slave_0", "veth0_to_hsr"); netlink_add_veth(&nlmsg, sock, "hsr_slave_1", "veth1_to_hsr"); netlink_add_hsr(&nlmsg, sock, "hsr0", "hsr_slave_0", "hsr_slave_1"); netlink_device_change(&nlmsg, sock, "hsr_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "hsr_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "veth0_virt_wifi", "veth1_virt_wifi"); netlink_add_linked(&nlmsg, sock, "virt_wifi", "virt_wifi0", "veth1_virt_wifi"); netlink_add_veth(&nlmsg, sock, "veth0_vlan", "veth1_vlan"); netlink_add_vlan(&nlmsg, sock, "vlan0", "veth0_vlan", 0, htons(ETH_P_8021Q)); netlink_add_vlan(&nlmsg, sock, "vlan1", "veth0_vlan", 1, htons(ETH_P_8021AD)); netlink_add_macvlan(&nlmsg, sock, "macvlan0", "veth1_vlan"); netlink_add_macvlan(&nlmsg, sock, "macvlan1", "veth1_vlan"); netlink_add_ipvlan(&nlmsg, sock, "ipvlan0", "veth0_vlan", IPVLAN_MODE_L2, 0); netlink_add_ipvlan(&nlmsg, sock, "ipvlan1", "veth0_vlan", IPVLAN_MODE_L3S, IPVLAN_F_VEPA); netlink_add_veth(&nlmsg, sock, "veth0_macvtap", "veth1_macvtap"); netlink_add_linked(&nlmsg, sock, "macvtap", "macvtap0", "veth0_macvtap"); netlink_add_linked(&nlmsg, sock, "macsec", "macsec0", "veth1_macvtap"); char addr[32]; sprintf(addr, DEV_IPV4, 14 + 10); struct in_addr geneve_addr4; if (inet_pton(AF_INET, addr, &geneve_addr4) <= 0) exit(1); struct in6_addr geneve_addr6; if (inet_pton(AF_INET6, "fc00::01", &geneve_addr6) <= 0) exit(1); netlink_add_geneve(&nlmsg, sock, "geneve0", 0, &geneve_addr4, 0); netlink_add_geneve(&nlmsg, sock, "geneve1", 1, 0, &geneve_addr6); netdevsim_add((int)procid, 4); netlink_wireguard_setup(); for (i = 0; i < sizeof(devices) / (sizeof(devices[0])); i++) { char addr[32]; sprintf(addr, DEV_IPV4, i + 10); netlink_add_addr4(&nlmsg, sock, devices[i].name, addr); if (!devices[i].noipv6) { sprintf(addr, DEV_IPV6, i + 10); netlink_add_addr6(&nlmsg, sock, devices[i].name, addr); } uint64_t macaddr = DEV_MAC + ((i + 10ull) << 40); netlink_device_change(&nlmsg, sock, devices[i].name, true, 0, &macaddr, devices[i].macsize, NULL); } close(sock); } static void initialize_netdevices_init(void) { int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); struct { const char* type; int macsize; bool noipv6; bool noup; } devtypes[] = { {"nr", 7, true}, {"rose", 5, true, true}, }; unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) { char dev[32], addr[32]; sprintf(dev, "%s%d", devtypes[i].type, (int)procid); sprintf(addr, "172.30.%d.%d", i, (int)procid + 1); netlink_add_addr4(&nlmsg, sock, dev, addr); if (!devtypes[i].noipv6) { sprintf(addr, "fe88::%02x:%02x", i, (int)procid + 1); netlink_add_addr6(&nlmsg, sock, dev, addr); } int macsize = devtypes[i].macsize; uint64_t macaddr = 0xbbbbbb + ((unsigned long long)i << (8 * (macsize - 2))) + (procid << (8 * (macsize - 1))); netlink_device_change(&nlmsg, sock, dev, !devtypes[i].noup, 0, &macaddr, macsize, NULL); } close(sock); } #define MAX_FDS 30 //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDWR); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } static void setup_gadgetfs(); static void setup_binderfs(); static void setup_fusectl(); static void sandbox_common_mount_tmpfs(void) { write_file("/proc/sys/fs/mount-max", "100000"); if (mkdir("./syz-tmp", 0777)) exit(1); if (mount("", "./syz-tmp", "tmpfs", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot", 0777)) exit(1); if (mkdir("./syz-tmp/newroot/dev", 0700)) exit(1); unsigned bind_mount_flags = MS_BIND | MS_REC | MS_PRIVATE; if (mount("/dev", "./syz-tmp/newroot/dev", NULL, bind_mount_flags, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/proc", 0700)) exit(1); if (mount("syz-proc", "./syz-tmp/newroot/proc", "proc", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/selinux", 0700)) exit(1); const char* selinux_path = "./syz-tmp/newroot/selinux"; if (mount("/selinux", selinux_path, NULL, bind_mount_flags, NULL)) { if (errno != ENOENT) exit(1); if (mount("/sys/fs/selinux", selinux_path, NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); } if (mkdir("./syz-tmp/newroot/sys", 0700)) exit(1); if (mount("/sys", "./syz-tmp/newroot/sys", 0, bind_mount_flags, NULL)) exit(1); if (mount("/sys/kernel/debug", "./syz-tmp/newroot/sys/kernel/debug", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/sys/fs/smackfs", "./syz-tmp/newroot/sys/fs/smackfs", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/proc/sys/fs/binfmt_misc", "./syz-tmp/newroot/proc/sys/fs/binfmt_misc", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/newroot/syz-inputs", 0700)) exit(1); if (mount("/syz-inputs", "./syz-tmp/newroot/syz-inputs", NULL, bind_mount_flags | MS_RDONLY, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/pivot", 0777)) exit(1); if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) { if (chdir("./syz-tmp")) exit(1); } else { if (chdir("/")) exit(1); if (umount2("./pivot", MNT_DETACH)) exit(1); } if (chroot("./newroot")) exit(1); if (chdir("/")) exit(1); setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } static void setup_gadgetfs() { if (mkdir("/dev/gadgetfs", 0777)) { } if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { } } static void setup_fusectl() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (getppid() == 1) exit(1); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); sandbox_common(); drop_caps(); initialize_netdevices_init(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); initialize_tun(); initialize_netdevices(); sandbox_common_mount_tmpfs(); loop(); exit(1); } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } static const char* setup_binfmt_misc() { if (mount(0, "/proc/sys/fs/binfmt_misc", "binfmt_misc", 0, 0) && errno != EBUSY) { return NULL; } if (!write_file("/proc/sys/fs/binfmt_misc/register", ":syz0:M:0:\x01::./file0:") || !write_file("/proc/sys/fs/binfmt_misc/register", ":syz1:M:1:\x02::./file0:POC")) return "write(/proc/sys/fs/binfmt_misc/register) failed"; return NULL; } static const char* setup_usb() { if (chmod("/dev/raw-gadget", 0666)) return "failed to chmod /dev/raw-gadget"; return NULL; } static void setup_sysctl() { int cad_pid = fork(); if (cad_pid < 0) exit(1); if (cad_pid == 0) { for (;;) sleep(100); } char tmppid[32]; snprintf(tmppid, sizeof(tmppid), "%d", cad_pid); struct { const char* name; const char* data; } files[] = { {"/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"}, {"/proc/sys/kernel/hung_task_check_interval_secs", "20"}, {"/proc/sys/net/core/bpf_jit_kallsyms", "1"}, {"/proc/sys/net/core/bpf_jit_harden", "0"}, {"/proc/sys/kernel/kptr_restrict", "0"}, {"/proc/sys/kernel/softlockup_all_cpu_backtrace", "1"}, {"/proc/sys/fs/mount-max", "100"}, {"/proc/sys/vm/oom_dump_tasks", "0"}, {"/proc/sys/debug/exception-trace", "0"}, {"/proc/sys/kernel/printk", "7 4 1 3"}, {"/proc/sys/kernel/keys/gc_delay", "1"}, {"/proc/sys/vm/oom_kill_allocating_task", "1"}, {"/proc/sys/kernel/ctrl-alt-del", "0"}, {"/proc/sys/kernel/cad_pid", tmppid}, }; for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].name, files[i].data)) { } } kill(cad_pid, SIGKILL); while (waitpid(cad_pid, NULL, 0) != cad_pid) ; } #define SWAP_FILE "./swap-file" #define SWAP_FILE_SIZE (128 * 1000 * 1000) static const char* setup_swap() { swapoff(SWAP_FILE); unlink(SWAP_FILE); int fd = open(SWAP_FILE, O_CREAT | O_WRONLY | O_CLOEXEC, 0600); if (fd == -1) return "swap file open failed"; fallocate(fd, FALLOC_FL_ZERO_RANGE, 0, SWAP_FILE_SIZE); close(fd); char cmdline[64]; sprintf(cmdline, "mkswap %s", SWAP_FILE); if (runcmdline(cmdline)) return "mkswap failed"; if (swapon(SWAP_FILE, SWAP_FLAG_PREFER) == 1) return "swapon failed"; return NULL; } uint64_t r[1] = {0xffffffffffffffff}; void loop(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$ext4 arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 74 34 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x1208002 (8 bytes) // opts: ptr[in, fs_options[ext4_options]] { // fs_options[ext4_options] { // elems: array[fs_opt_elem[ext4_options]] { // fs_opt_elem[ext4_options] { // elem: union ext4_options { // grpquota: buffer: {67 72 70 71 75 6f 74 61} (length 0x8) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // delalloc: buffer: {64 65 6c 61 6c 6c 6f 63} (length 0x8) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // resuid: fs_opt["resuid", fmt[hex, uid]] { // name: buffer: {72 65 73 75 69 64} (length 0x6) // eq: const = 0x3d (1 bytes) // val: uid (resource) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // debug: buffer: {64 65 62 75 67} (length 0x5) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // dioread_nolock: buffer: {64 69 6f 72 65 61 64 5f 6e 6f 6c 6f // 63 6b} (length 0xe) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // bsddf: buffer: {62 73 64 64 66} (length 0x5) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // nomblk_io_submit: buffer: {6e 6f 6d 62 6c 6b 5f 69 6f 5f 73 75 // 62 6d 69 74} (length 0x10) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // noauto_da_alloc: buffer: {6e 6f 61 75 74 6f 5f 64 61 5f 61 6c // 6c 6f 63} (length 0xf) // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x5d8 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x5d8) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000580, "ext4\000", 5)); NONFAILING(memcpy((void*)0x200000001480, "./file0\000", 8)); NONFAILING(memcpy((void*)0x200000000100, "grpquota", 8)); NONFAILING(*(uint8_t*)0x200000000108 = 0x2c); NONFAILING(memcpy((void*)0x200000000109, "delalloc", 8)); NONFAILING(*(uint8_t*)0x200000000111 = 0x2c); NONFAILING(memcpy((void*)0x200000000112, "resuid", 6)); NONFAILING(*(uint8_t*)0x200000000118 = 0x3d); NONFAILING(sprintf((char*)0x200000000119, "0x%016llx", (long long)0)); NONFAILING(*(uint8_t*)0x20000000012b = 0x2c); NONFAILING(memcpy((void*)0x20000000012c, "debug", 5)); NONFAILING(*(uint8_t*)0x200000000131 = 0x2c); NONFAILING(memcpy((void*)0x200000000132, "dioread_nolock", 14)); NONFAILING(*(uint8_t*)0x200000000140 = 0x2c); NONFAILING(memcpy((void*)0x200000000141, "bsddf", 5)); NONFAILING(*(uint8_t*)0x200000000146 = 0x2c); NONFAILING(memcpy((void*)0x200000000147, "nomblk_io_submit", 16)); NONFAILING(*(uint8_t*)0x200000000157 = 0x2c); NONFAILING(memcpy((void*)0x200000000158, "noauto_da_alloc", 15)); NONFAILING(*(uint8_t*)0x200000000167 = 0x2c); NONFAILING(*(uint8_t*)0x200000000168 = 0); NONFAILING(memcpy( (void*)0x2000000005c0, "\x78\x9c\xec\xdd\xcf\x6f\x14\x55\x1c\x00\xf0\xef\x6c\x7f\xd0\x52\xb4\x85" "\x18\x15\x0f\xd2\xc4\x18\x48\x94\x96\x16\x30\xc4\x78\x80\xab\x21\x0d\xfe" "\x88\x17\x2f\x56\x5a\x10\x29\xd0\xd0\x1a\x2d\x9a\x50\x12\xbc\x98\x18\x2f" "\xc6\x98\x78\xf2\x20\xfe\x17\x4a\xe4\xca\x49\x4f\x1e\xbc\x78\x32\x24\x44" "\x0d\x47\x13\xd7\xcc\x76\xa6\x74\xdb\xd9\x96\x2e\x6d\xa7\x32\x9f\x4f\xb2" "\xf4\xcd\x7b\x3b\xbc\x37\xdd\x7e\xfb\xde\xbe\xbe\x37\x1b\x40\x65\x0d\xa6" "\xff\xd4\x22\xf6\x46\xc4\x74\x12\xd1\x9f\xcc\x2f\x96\x75\x46\x56\x38\xb8" "\xf0\xbc\x7b\x7f\x7f\x72\x3a\x7d\x24\x51\xaf\xbf\xf1\x67\x12\x49\x96\x97" "\x3f\x3f\xc9\xbe\xf6\x65\x27\xf7\x44\xc4\xcf\x3f\x25\xb1\xa7\x63\x65\xbd" "\x33\x73\x57\xce\x8f\x4f\x4d\x4d\x5e\xce\x8e\x87\x67\x2f\x4c\x0f\xcf\xcc" "\x5d\x39\x78\xee\xc2\xf8\xd9\xc9\xb3\x93\x17\x47\x5f\x1a\x3d\x76\xf4\xc8" "\xd1\x63\x23\x87\xda\xba\xae\xab\x05\x79\x27\xaf\xbf\xff\x61\xff\x67\x63" "\x6f\x7f\xf7\xcd\x3f\xc9\xc8\xf7\xbf\x8d\x25\x71\x3c\x5e\xcd\x9e\xb8\xf4" "\x3a\x36\xca\x60\x0c\x36\xbe\x27\xc9\xca\xa2\xbe\x63\x1b\x5d\x59\x49\x3a" "\xb2\x9f\x93\xa5\x2f\x71\xd2\x59\x62\x83\x58\x97\xfc\xf5\xeb\x8a\x88\xa7" "\xa2\x3f\x3a\xe2\xfe\x8b\xd7\x1f\x9f\xbe\x56\x6a\xe3\x80\x4d\x55\x4f\x22" "\xea\x40\x45\x25\xe2\x1f\x2a\x2a\x1f\x07\xe4\xef\xed\x97\xbf\x0f\xae\x95" "\x32\x2a\x01\xb6\xc2\xdd\x13\x0b\x13\x00\x2b\xe3\xbf\x73\x61\x6e\x30\x7a" "\x1a\x73\x03\x3b\xef\x25\xb1\x74\x5a\x27\x89\x88\xf6\x66\xe6\x9a\xed\x8a" "\x88\xdb\xb7\xc6\xae\x9f\xb9\x35\x76\x3d\x36\x69\x1e\x0e\x28\x36\x7f\x2d" "\x22\x9e\x2e\x8a\xff\xa4\x11\xff\x03\xd1\x13\x03\x8d\xf8\xaf\x35\xc5\x7f" "\x3a\x2e\x38\x95\x7d\x4d\xf3\x5f\x6f\xb3\xfe\xe5\x53\xc5\xe2\x1f\xb6\xce" "\x42\xfc\xf7\xac\x1a\xff\xd1\x22\xfe\xdf\x59\x12\xff\xef\xb6\x59\xff\xe0" "\xfd\xe4\x7b\xbd\x4d\xf1\xdf\xdb\xee\x25\x01\x00\x00\x00\x00\x00\x40\x65" "\xdd\x3c\x11\x11\x2f\x16\xfd\xfd\xbf\xb6\xb8\xfe\x27\x0a\xd6\xff\xf4\x45" "\xc4\xf1\x0d\xa8\x7f\x70\xd9\xf1\xca\xbf\xff\xd7\xee\x6c\x40\x35\x40\x81" "\xbb\x27\x22\x5e\x29\x5c\xff\x5b\xcb\x57\xff\x0e\x74\x64\xa9\xc7\x1a\xeb" "\x01\xba\x92\x33\xe7\xa6\x26\x0f\x45\xc4\xe3\x11\x71\x20\xba\x76\xa4\xc7" "\x23\xab\xd4\x71\xf0\xf3\x3d\x5f\xb7\x2a\x1b\xcc\xd6\xff\xe5\x8f\xb4\xfe" "\xdb\xd9\x5a\xc0\xac\x1d\x77\x3a\x77\x34\x9f\x33\x31\x3e\x3b\xfe\xb0\xd7" "\x0d\x44\xdc\xbd\x16\xf1\x4c\xe1\xfa\xdf\x64\xb1\xff\x4f\x0a\xfa\xff\xf4" "\xf7\xc1\xf4\x03\xd6\xb1\xe7\xf9\x1b\xa7\x5a\x95\xad\x1d\xff\xc0\x66\xa9" "\x7f\x1b\xb1\xbf\xb0\xff\xbf\x7f\xd7\x8a\x64\xf5\xfb\x73\x0c\x37\xc6\x03" "\xc3\xf9\xa8\x60\xa5\x67\x3f\xfe\xe2\x87\x56\xf5\xb7\x1b\xff\x6e\x31\x01" "\x0f\x2f\xed\xff\x77\xae\x1e\xff\x03\xc9\xd2\xfb\xf5\xcc\xac\xbf\x8e\xc3" "\x73\x9d\xf5\x56\x65\xed\x8e\xff\xbb\x93\x37\x1b\xb7\x9c\xe9\xce\xf2\x3e" "\x1a\x9f\x9d\xbd\x3c\x12\xd1\x9d\x9c\xec\x48\x73\x9b\xf2\x47\xd7\xdf\x66" "\x78\x14\xe5\xf1\x90\xc7\x4b\x1a\xff\x07\x9e\x5b\x7d\xfe\xaf\x68\xfc\xdf" "\x1b\x11\xf3\xcb\xfe\xef\xe4\xaf\xe6\x3d\xc5\xb9\x27\xff\xed\xfb\xbd\x55" "\x7b\x8c\xff\xa1\x3c\x69\xfc\x4f\xac\xab\xff\x5f\x7f\x62\xf4\xc6\xc0\x8f" "\xad\xea\x7f\xb0\xfe\xff\x48\xa3\xaf\x3f\x90\xe5\x98\xff\x83\x05\x5f\xe5" "\x61\xda\xdd\x9c\x5f\x10\x8e\x9d\x45\x45\x5b\xdd\x5e\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x78\x14\xd4\x22\x62\x57\x24\xb5\xa1\xc5\x74\xad\x36\x34\x14\xd1" "\x17\x11\x4f\xc4\xce\xda\xd4\xa5\x99\xd9\x17\xce\x5c\xfa\xe0\xe2\x44\x5a" "\xd6\xf8\xfc\xff\x5a\xfe\x49\xbf\xfd\x0b\xc7\x49\xfe\xf9\xff\x03\x4b\x8e" "\x47\x97\x1d\x1f\x8e\x88\xdd\x11\xf1\x65\x47\x6f\xe3\x78\xe8\xf4\xa5\xa9" "\x89\xb2\x2f\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xb6\x89\xbe\x16\xfb\xff\x53\x7f\x74\x94\xdd\x3a\x60\xd3\x75\x96\xdd" "\x00\xa0\x34\x05\xf1\xff\x4b\x19\xed\x00\xb6\x9e\xfe\x1f\xaa\x4b\xfc\x43" "\x75\x89\x7f\xa8\x2e\xf1\x0f\xd5\x25\xfe\xa1\xba\xc4\x3f\x54\x97\xf8\x87" "\xea\x12\xff\x00\x00\x00\x00\x00\xf0\x48\xd9\xbd\xef\xe6\xaf\x49\x44\xcc" "\xbf\xdc\xdb\x78\xa4\xba\xb3\xb2\xae\x52\x5b\x06\x6c\xb6\x5a\xd9\x0d\x00" "\x4a\xe3\x16\x3f\x50\x5d\x96\xfe\x40\x75\x79\x8f\x0f\x24\x6b\x94\xf7\xb4" "\x3c\x69\xad\x33\x57\x33\x7d\xfa\x21\x4e\x06\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x80\xca\xd9\xbf\xd7\xfe\x7f\xa8\x2a\xfb\xff\xa1\xba\xec\xff\x87" "\xea\xca\xf7\xff\xef\x2b\xb9\x1d\xc0\xd6\xf3\x1e\x1f\x88\x35\x76\xf2\x17" "\xee\xff\x5f\xf3\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\x23\xcd" "\xcc\x5d\x39\x3f\x3e\x35\x35\x79\x59\xe2\xad\xed\xd1\x8c\xad\x4c\xd4\xeb" "\xf5\xab\xe9\x4f\xc1\x76\x69\xcf\xff\x3c\x91\x2f\x85\xdf\x2e\xed\x59\x96" "\xc8\xf7\xfa\x3d\xd8\x59\xe5\xfd\x4e\x02\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9a\xfd\x17\x00\x00\xff\xff\x16\x12" "\x24\xc5", 1496)); NONFAILING(syz_mount_image( /*fs=*/0x200000000580, /*dir=*/0x200000001480, /*flags=MS_STRICTATIME|MS_SILENT|MS_RELATIME|MS_NOSUID*/ 0x1208002, /*opts=*/0x200000000100, /*chdir=*/1, /*size=*/0x5d8, /*img=*/0x2000000005c0)); // lchown arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // uid: uid (resource) // gid: gid (resource) // ] NONFAILING(memcpy((void*)0x2000000006c0, "./file0\000", 8)); syscall(__NR_lchown, /*file=*/0x2000000006c0ul, /*uid=*/0, /*gid=*/0xee01); // quotactl$Q_QUOTAON arguments: [ // cmd: quota_cmd_quota_on = 0xffffffff80000201 (8 bytes) // special: ptr[in, blockdev_filename] { // union blockdev_filename { // loop: loop_filename { // prefix: buffer: {2f 64 65 76 2f 6c 6f 6f 70} (length 0x9) // id: proc = 0x0 (1 bytes) // z: const = 0x0 (1 bytes) // } // } // } // id: uid (resource) // addr: nil // ] NONFAILING(memcpy((void*)0x200000000180, "/dev/loop", 9)); NONFAILING(*(uint8_t*)0x200000000189 = 0x30); NONFAILING(*(uint8_t*)0x20000000018a = 0); syscall(__NR_quotactl, /*cmd=Q_QUOTAON_GRP*/ 0xffffffff80000201ul, /*special=*/0x200000000180ul, /*id=*/0, /*addr=*/0ul); // mprotect arguments: [ // addr: VMA[0x3000] // len: len = 0x3000 (8 bytes) // prot: mmap_prot = 0x9 (8 bytes) // ] syscall(__NR_mprotect, /*addr=*/0x200000000000ul, /*len=*/0x3000ul, /*prot=PROT_SEM|PROT_READ*/ 9ul); // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {68 75 67 65 74 6c 62 2e 31 47 42 2e 75 73 61 67 65 5f 69 6e // 5f 62 79 74 65 73 00} (length 0x1b) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd NONFAILING( memcpy((void*)0x200000000180, "hugetlb.1GB.usage_in_bytes\000", 27)); res = syscall(__NR_openat, /*fd=*/(intptr_t)-1, /*file=*/0x200000000180ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; // mmap arguments: [ // addr: VMA[0xb36000] // len: len = 0xb36000 (8 bytes) // prot: mmap_prot = 0xa (8 bytes) // flags: mmap_flags = 0x28011 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0xb36000ul, /*prot=PROT_SEM|PROT_WRITE*/ 0xaul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[0], /*offset=*/0ul); // syz_mount_image$exfat arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 66 61 74 00} (length 0x6) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 32 00} (length 0x8) // } // flags: mount_flags = 0x3000cd0 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x151a (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x151a) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000240, "exfat\000", 6)); NONFAILING(memcpy((void*)0x2000000005c0, "./file2\000", 8)); NONFAILING(memcpy( (void*)0x200000003f40, "\x78\x9c\xec\xdc\x0b\xb8\x4e\xd5\xd6\x38\xf0\x31\xe6\x9c\x8b\x4d\x2e\x6f" "\x92\xfb\x1a\x73\x2c\xde\xe4\x32\x49\x92\x50\x92\x8a\x24\x49\x42\x72\x4f" "\x48\x92\x24\x49\x12\x9b\xdc\x92\x90\x84\x5c\x77\x92\x7b\xc8\x3d\xed\xb4" "\xdd\xef\x97\xdc\x93\x76\x8e\x24\x49\x42\x72\x0b\xf3\xff\x6c\xe9\xef\x74" "\x4e\x3d\x9d\xce\xd7\xf7\x39\xdf\xb7\xc7\xef\x79\xd6\x63\x0e\x6b\x8d\xf1" "\x8e\xb5\xc7\x7e\xf7\xbb\xd6\x7a\x9e\xbd\xbf\xed\x34\xb8\x4a\xfd\xaa\x95" "\xeb\x30\x33\xfc\x3b\xf4\x2f\x0b\xfc\xf9\x9f\x44\x00\x48\x00\x80\x7e\x00" "\x90\x1d\x00\x02\x00\x28\x93\xa3\x4c\x8e\xb4\xfd\x99\x34\x26\xfe\x5b\x2f" "\x22\xfe\x9b\xd4\x9d\x7a\xa5\x3b\x10\x57\x92\xcc\x3f\x7d\x93\xf9\xa7\x6f" "\x32\xff\xf4\x4d\xe6\x9f\xbe\xc9\xfc\xd3\x37\x99\x7f\xfa\x26\xf3\x4f\xdf" "\x64\xfe\x42\xa4\x6b\xd3\xf3\x5e\x2d\x5b\xfa\xdd\xe4\xf9\xff\xff\x72\xea" "\xbf\x92\x2c\x9f\xff\xe9\x02\xfe\xde\x0e\x99\xff\xff\x35\xfa\x4f\x1d\x2d" "\xf3\x4f\xdf\x64\xfe\xe9\x9b\xcc\x3f\x7d\x93\xf9\xa7\x3f\x97\x6f\xc1\x82" "\x2b\xda\x87\xb8\xf2\xe4\xfd\x9f\xbe\xc9\xfc\x85\x48\xd7\xfe\xf2\x67\xca" "\x6b\x4f\x5f\xe9\x67\xda\xb2\xfd\x89\x4d\x08\x21\x84\x10\x42\x08\x21\x84" "\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08" "\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10" "\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21" "\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42" "\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84" "\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08" "\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\xf8\x1f\x70\xda\x5f\x66" "\x00\xe0\x97\xf5\x95\xee\x4b\x08\x21\x84\x10\x42\x08\x21\x84\x10\x7f\x1d" "\xff\xfe\x95\xee\x40\x08\x21\x84\x10\x42\x08\x21\x84\x10\xff\xfd\x10\x14" "\x68\x30\x10\x40\x06\xc8\x08\x09\x90\x09\x32\xc3\x55\x90\x05\xb2\x42\x36" "\xc8\x0e\x31\xb8\x1a\x72\xc0\x35\x90\x13\xae\x85\x5c\x90\x1b\xf2\x40\x5e" "\xc8\x07\xf9\xa1\x00\x84\x40\x60\x81\x21\x82\x82\x50\x08\xe2\x70\x1d\x14" "\x86\xeb\xa1\x08\x14\x85\x62\x50\x1c\x1c\x94\x80\x92\x70\x03\x94\x82\x1b" "\xa1\x34\xdc\x04\x65\xe0\x66\x28\x0b\xb7\x40\x39\x28\x7f\xf1\x35\xd3\xdc" "\x0e\x95\xe0\x0e\xa8\x0c\x77\xc2\x5d\x70\x37\x54\x81\xaa\x70\x0f\x54\x83" "\x7b\xa1\x3a\xdc\x07\x35\xe0\x7e\xa8\x09\x0f\x40\x2d\x78\x10\x6a\xc3\x43" "\x50\x07\xea\x42\x3d\x78\x18\xea\xc3\x23\xd0\x00\x1a\x42\x23\x68\x0c\x4d" "\xa0\x29\x34\xfb\x83\xfc\xa4\xec\xbf\x95\xff\x22\x74\x85\x97\xa0\x1b\x74" "\x87\x44\xe8\x01\x3d\xe1\x65\xe8\x05\xbd\xa1\x0f\xf4\x85\x7e\xf0\x0a\xf4" "\x87\x57\x61\x00\xbc\x06\x03\x61\x10\x0c\x86\xd7\x61\x08\xbc\x01\x43\xe1" "\x4d\x18\x06\xc3\x61\x04\xbc\x05\x23\x61\x14\x8c\x86\x31\x30\x16\xc6\x41" "\x12\xbc\x0d\xe3\xe1\x1d\x98\x00\xef\x3e\x92\x15\x26\xc1\x64\x98\x02\x53" "\x61\x1a\x4c\x87\xf7\x60\x06\xcc\x84\x59\xf0\x3e\xcc\x86\x39\x30\x17\x92" "\x32\xcd\x87\x05\xb0\x10\x3e\x80\x45\xf0\x21\x24\xc3\x47\xb0\x18\x3e\x86" "\x14\x58\x02\x4b\x61\x19\x2c\x87\x15\xb0\x12\x56\xc1\x6a\x58\x03\x6b\x61" "\x1d\xac\x87\x0d\xb0\x11\x36\xc1\x66\xf8\x04\xb6\xc0\x56\xd8\x06\xdb\x61" "\x07\xec\x84\x5d\xf0\x29\xec\x86\xcf\x60\x0f\x7c\x0e\xa9\xf8\xc5\x9f\xcc" "\x3f\xf5\xeb\x7c\xe8\x8c\x80\x80\x0a\x15\x1a\x34\x98\x01\x33\x60\x02\x26" "\x60\x66\xcc\x8c\x59\x30\x0b\x66\xc3\x6c\x18\xc3\x18\xe6\xc0\x1c\x98\x13" "\x73\x62\x2e\xcc\x85\x79\x30\x0f\x26\x62\x3e\x2c\x80\x05\x90\x90\x90\x91" "\xb1\x20\x16\xc4\x38\xc6\xb1\x30\x16\xc6\x22\x58\x04\x8b\x61\x31\x74\xe8" "\xb0\x24\x96\xc4\x52\x78\xde\x7b\x5f\x1a\xcb\x60\x19\x2c\x8b\x65\xb1\x1c" "\x96\xc7\xf2\x78\x2b\xde\x8a\x15\xb1\x22\x56\xc2\x4a\x58\x19\x2b\xe3\x5d" "\x78\x17\x56\xc1\x2a\x78\x0f\xde\x83\xf7\x62\x75\xac\x8e\x35\xb0\x06\xd6" "\xc4\x9a\x58\x0b\x6b\x61\x6d\xac\x8d\x75\xb0\x0e\xd6\xc3\x7a\x58\x1f\xeb" "\x63\x03\x6c\x80\x8d\xb0\x11\x36\xc1\x26\xd8\x0c\x9b\x61\x73\x6c\x8e\x2d" "\xb0\x05\xb6\xc2\x56\xd8\x1a\x5b\x63\x1b\x6c\x83\x6d\xb1\x2d\xb6\xc3\x76" "\xd8\x1e\xdb\x63\x07\xec\x80\x1d\xb1\x23\x76\xc2\x4e\xd8\x19\x5f\xc0\x17" "\xf0\x45\x7c\x11\x5f\xc2\x97\xb0\x3b\xde\xa5\x7a\x60\x4f\xec\x89\xbd\xb0" "\x17\xf6\xc1\xbe\xd8\x17\x5f\xc1\xfe\xf8\x2a\xbe\x8a\xaf\xe1\x40\x1c\x84" "\x83\xf1\x75\x7c\x1d\xdf\xc0\xa1\x78\x12\x87\xe1\x70\x1c\x81\x23\xb0\xa2" "\x1a\x85\xa3\x71\x0c\xb2\x1a\x87\x49\x98\x84\x19\x61\x3c\x4e\xc0\x09\x38" "\x11\x27\xe1\x24\x9c\x82\x53\x71\x1a\x4e\x37\x80\x33\x70\x26\xce\xc4\xf7" "\x71\x36\xce\xc1\x39\x38\x0f\xe7\xe1\x02\x5c\x88\x0b\x71\x11\x7e\x88\xc9" "\x98\x8c\x8b\xf1\x14\xa6\xe0\x12\x5c\x8a\xcb\x70\x39\xae\xc0\xe5\xb8\x0a" "\x57\xe3\x2a\x5c\x8b\xeb\x70\x2d\x6e\xc0\x0d\xb8\x09\x37\xe1\x27\xf8\x09" "\x6e\xc5\xad\xb8\x1d\xb7\xe3\x4e\xdc\x89\x9f\xe2\xa7\xf8\x19\x7e\x86\x03" "\x31\x15\x53\x71\x2f\xee\xc5\x7d\xb8\x0f\xf7\xe3\x7e\x3c\x80\x07\xf0\x20" "\x1e\xc4\x43\x78\x08\x0f\xe3\x61\x3c\x82\x47\xf0\x28\x1e\xc3\xe3\x78\x0c" "\x4f\xe0\x09\x3c\x89\xa7\xf0\x34\x00\x9c\xc5\xb3\x78\x0e\xcf\xe1\x05\xbc" "\x90\xf6\xe6\x57\x69\x8c\x32\x2a\x83\xca\xa0\x12\x54\x82\xca\xac\x32\xab" "\x2c\x2a\x8b\xca\xa6\xb2\xa9\x98\x8a\xa9\x1c\x2a\x87\xca\xa9\x72\xaa\x5c" "\x2a\x97\xca\xa3\xf2\xa8\x7c\x2a\x9f\x2a\xa0\x0a\x28\x52\xa4\x58\x45\xaa" "\xa0\x2a\xa8\xe2\x2a\xae\x0a\xab\xc2\xaa\x88\x2a\xa2\x8a\xa9\x62\xca\x29" "\xa7\x4a\xaa\x92\xaa\x94\x2a\xa5\x4a\xab\xd2\xaa\x8c\xba\x59\x95\x55\xb7" "\xa8\x72\xaa\xbc\x6a\xe9\x6e\x55\xb7\xaa\x8a\xaa\x95\xab\xa4\xee\x50\x95" "\x55\x65\x75\x97\xba\x5b\x55\x51\x55\x55\x55\x55\x4d\x55\x53\xd5\x55\x75" "\x55\x43\xd5\x50\x35\x55\x4d\x55\x4b\x3d\xa8\x6a\xab\x1e\xd8\x07\xeb\xaa" "\xb4\xc9\xd4\x57\x83\xb0\x81\x1a\x8c\x8d\x54\x63\xd5\x44\x35\x55\x6f\xe0" "\xa3\xaa\xb9\x1a\x8a\x2d\x54\x4b\xd5\x4a\x3d\xae\x86\xe3\x30\x6c\xa3\x9a" "\xbb\xb6\xea\x29\xd5\x4e\x8d\xc6\xf6\xea\x19\x35\x06\x9f\x55\x1d\xd5\x38" "\xec\xa4\x9e\x57\x9d\xd5\x0b\xaa\x8b\x7a\x51\x75\x55\x2d\x5c\x37\xd5\x5d" "\x4d\xc4\x1e\xaa\xa7\x9a\x82\xbd\x54\x6f\xd5\x47\xf5\x55\x33\xf0\x6e\x95" "\x36\xb1\x2a\xea\x35\xf5\x62\xc6\x41\x6a\xb0\x7a\x5d\x2d\xc0\x37\xd4\x50" "\xf5\xa6\x1a\xa6\x86\xab\x11\xea\x2d\x35\x52\x8d\x52\xa3\xd5\x18\x35\x56" "\x8d\x53\x49\xea\x6d\x35\x5e\xbd\xa3\x26\xa8\x77\xd5\x44\x35\x49\x4d\x56" "\x53\xd4\x54\x35\x4d\x4d\x57\xef\xa9\x19\x6a\xa6\x9a\xa5\xde\x57\xb3\xd5" "\x1c\x0d\x6a\x9e\x9a\xaf\x16\xa8\x85\xea\x03\xb5\x48\x7d\xa8\x92\xd5\x47" "\x6a\xb1\xfa\x58\xa5\xa8\x25\x6a\xa9\x5a\xa6\x96\xab\x15\x6a\xa5\x5a\xa5" "\x56\xab\x35\x6a\xad\x5a\xa7\xd6\xab\x0d\x6a\xa3\xda\xa4\x36\xab\x4f\xd4" "\x16\xb5\x55\x6d\x53\xdb\xd5\x0e\xb5\x53\xed\x52\x9f\xaa\xdd\xea\x33\xb5" "\x47\x7d\xae\x52\xd5\x17\x6a\xaf\xfa\x9b\xda\xa7\xbe\x54\xfb\xd5\x57\xea" "\x80\xfa\x5a\x1d\x54\xdf\xa8\x43\xea\x5b\x75\x58\x7d\xa7\x8e\xa8\xef\xd5" "\x51\x75\x4c\x1d\x57\x3f\xa8\x13\xea\x47\x75\x52\x9d\x52\xa7\xd5\x19\x75" "\x56\xfd\xa4\xce\xa9\xf3\xea\x82\xf2\x0a\x34\x6a\xa5\xb5\x36\x3a\xd0\x19" "\x74\x46\x9d\xa0\x33\xe9\xcc\xfa\x2a\x9d\x45\x67\xd5\xd9\x74\x76\x1d\xd3" "\x57\xeb\x1c\xfa\x1a\x9d\x53\x5f\xab\x73\xe9\xdc\x3a\x8f\xc9\xab\xf3\xe9" "\xfc\xba\x80\x0e\x35\x69\xab\x59\x47\xba\xa0\x2e\xa4\xe3\xfa\x3a\x5d\x58" "\x5f\xaf\x8b\xe8\xa2\xba\x98\x2e\xae\x9d\x2e\xa1\x4b\xea\x1b\x74\x29\x7d" "\xa3\x2e\xad\x6f\xd2\x65\xf4\xcd\xba\xac\xbe\x45\x97\xd3\xe5\x75\x05\x0f" "\xfa\x36\x5d\x51\xdf\xae\x2b\xe9\x3b\x74\x65\x7d\xa7\xce\x04\x00\x55\x74" "\x55\x7d\x8f\xae\xa6\xef\xd5\xd5\xf5\x7d\xba\x86\xbe\x5f\xd7\xd4\x0f\xe8" "\x5a\xfa\x41\x5d\x5b\x3f\xa4\xeb\xe8\xba\xba\x9e\x7e\x58\xd7\xd7\x8f\xe8" "\x06\xba\xa1\x6e\xa4\x1b\xeb\x26\xba\xa9\x6e\xa6\x1f\xd5\xcd\xf5\x63\xba" "\x85\x6e\xa9\x5b\xe9\xc7\x75\x6b\xfd\x84\x6e\xa3\x9f\xd4\x6d\xf5\x53\xba" "\x9d\x7e\x5a\xb7\xd7\xcf\xe8\x0e\xfa\x59\xdd\x51\x3f\xa7\x3b\xe9\xe7\x75" "\x67\xfd\x82\xee\xa2\xcf\xeb\x0b\xda\xeb\x6e\xba\xbb\x4e\xd4\x3d\x74\x4f" "\xfd\xb2\xee\xa5\x7b\xeb\x3e\xba\xaf\xee\xa7\x5f\xd1\xfd\xf5\xab\x7a\x80" "\x7e\x4d\x0f\xd4\x83\xf4\x60\xfd\xba\x1e\xa2\xdf\xd0\x43\xf5\x9b\x7a\x98" "\x1e\xae\x47\xe8\xb7\xf4\x48\x3d\x4a\x8f\xd6\x63\xf4\x58\x3d\x4e\x27\xe9" "\xb7\xf5\x78\xfd\x8e\x9e\xa0\xdf\xd5\x13\xf5\x24\x3d\x59\x4f\xd1\x53\xf5" "\x34\xdd\xe7\x52\xa5\x59\xff\x42\xfe\x3b\xbf\x91\x3f\xe0\xe2\xab\x6f\xd2" "\x9b\xf5\x27\x7a\x8b\xde\xaa\xb7\xe9\xed\x7a\x87\xde\xa9\x77\xe9\x5d\x7a" "\xb7\xde\xad\xf7\xe8\x3d\x3a\x55\xa7\xea\xbd\x7a\xaf\xde\xa7\xf7\xe9\xfd" "\x7a\xbf\x3e\xa0\x0f\xe8\x83\xfa\xa0\x3e\xa4\x0f\xe9\xc3\xfa\xb0\x3e\xa2" "\x8f\xe8\xa3\xfa\x98\x3e\xa3\x7f\xd0\x27\xf4\x8f\xfa\xa4\x3e\xa5\x4f\xe9" "\x33\xfa\xac\x3e\xab\xcf\x5d\xfa\x1a\x80\x41\xa3\x8c\x36\xc6\x04\x26\x83" "\xc9\x68\x12\x4c\x26\x93\xd9\x5c\x65\xb2\x98\xac\x26\x9b\xc9\x6e\x62\xe6" "\x6a\x93\xc3\x5c\x63\x72\x9a\x6b\x4d\x2e\x93\xdb\xe4\x31\x79\x47\x3d\x63" "\xf2\x9b\x02\x26\x34\x64\xac\x61\x13\x99\x82\xa6\x90\x89\x9b\xeb\x4c\x61" "\x73\xbd\x29\x62\x8a\x9a\x62\xa6\xb8\x71\xa6\x84\x29\x69\x6e\xf8\xad\x7c" "\x93\xef\x4f\xe4\xff\x51\x7f\xcd\x4c\x33\xd3\xdc\x34\x37\x2d\x4c\x0b\xd3" "\xca\xb4\x32\xad\x4d\x6b\xd3\xc6\xb4\x31\x6d\x4d\x5b\xd3\xce\xb4\x33\xed" "\x4d\x7b\xd3\xc1\x74\x30\x1d\x4d\x47\xd3\xc9\x74\x32\x9d\x4d\x67\xd3\xc5" "\x74\x31\x5d\x4d\x57\xd3\xcd\x74\x33\x89\x26\xd1\xf4\x34\x2f\x9b\x5e\xa6" "\xb7\xe9\x63\xfa\x9a\x7e\xe6\x15\xd3\xdf\xf4\x37\x03\xcc\x00\x33\xd0\x0c" "\x34\x83\xcd\x60\x33\xc4\x0c\x31\x43\xcd\x50\x33\xcc\x0c\x33\x23\xcc\x08" "\x33\xd2\x8c\x34\xa3\xcd\x68\x33\xd6\x8c\x35\x49\x3e\xbb\x19\x6f\xc6\x9b" "\x09\x66\x82\x99\x68\x26\x9a\xc9\xfd\xb2\x9b\xa9\x66\xaa\x99\x6e\xa6\x9b" "\x19\x66\x86\x99\x65\x66\x99\xd9\x66\xb6\x99\x6b\xe6\x9a\xf9\x66\xbe\x59" "\x68\x16\x9a\x45\x66\x91\x49\x36\xc9\x66\xb1\x59\x6c\x52\xcc\x12\xb3\xc4" "\x2c\x33\xcb\xcc\x0a\xb3\xc2\xac\x32\xab\xcc\x1a\xb3\xc6\xac\x33\xeb\xcc" "\x06\xb3\xc1\xa4\x98\xcd\x66\xb3\xd9\x62\xb6\x98\x6d\x66\x9b\xd9\x61\x76" "\x98\x5d\x66\x97\xd9\x6d\x76\x9b\x3d\x66\x8f\x49\x35\xa9\x66\xaf\xd9\x6b" "\xf6\x99\x7d\x66\xbf\xd9\x6f\x0e\x98\x03\xe6\xa0\x39\x68\x0e\x99\x43\xe6" "\xb0\x39\x6c\x8e\x98\x23\xe6\xa8\x39\x6a\x8e\x9b\xe3\xe6\x84\x39\x61\x4e" "\x9a\x93\xe6\xb4\x39\x6d\xce\x9a\xb3\xe6\x9c\x39\x67\x2e\x98\x0b\x69\x97" "\x7d\x81\x0a\x54\x60\x02\x13\x64\x08\x32\x04\x09\x41\x42\x90\x39\xc8\x1c" "\x64\x09\xb2\x04\xd9\x82\x6c\x41\x2c\x88\x05\x39\x82\x1c\x41\xce\xe0\xda" "\x20\x57\x90\x3b\xc8\x13\xe4\x0d\xf2\x05\xf9\x83\x02\x41\x18\x50\x60\x03" "\x0e\xa2\xa0\x60\x50\x28\x88\x07\xd7\x05\x85\x83\xeb\x83\x22\x41\xd1\xa0" "\x58\x50\x3c\x70\x41\x89\xa0\x64\x70\x43\x50\x2a\xb8\x31\x28\x1d\xdc\x14" "\x94\x09\x6e\x0e\xca\x06\xb7\x04\xe5\x82\xf2\x41\x85\xe0\xd6\xe0\xb6\xa0" "\x62\x70\x7b\x50\x29\xb8\x23\xa8\x1c\xdc\x19\xdc\x15\xdc\x1d\x54\x09\xaa" "\x06\xf7\x04\xd5\x82\x7b\x83\xea\xc1\x7d\x41\x8d\xe0\xfe\xa0\x66\xf0\x40" "\x50\x2b\x78\x30\xa8\x1d\x3c\x14\xd4\x09\xea\x06\xf5\x82\x87\x83\xfa\xc1" "\x23\x41\x83\xa0\x61\xd0\x28\x68\x1c\x34\x09\x9a\x06\xcd\xfe\xd2\xfa\xde" "\x9f\xcc\xfd\x98\xeb\x16\x76\x0f\x13\xc3\x1e\x61\xcf\xf0\xe5\xb0\x57\xd8" "\x3b\xec\x13\xf6\x0d\xfb\x85\xaf\x84\xfd\xc3\x57\xc3\x01\xe1\x6b\xe1\xc0" "\x70\x50\x38\x38\x7c\x3d\x1c\x12\xbe\x11\x0e\x0d\xdf\x0c\x87\x85\xc3\xc3" "\x11\xe1\x5b\xe1\xc8\x70\x54\x38\x3a\x1c\x13\x8e\x0d\xc7\x85\x49\xe1\xdb" "\xe1\xf8\xf0\x9d\x70\x42\xf8\x6e\x38\x31\x9c\x14\x4e\x0e\xa6\x84\x53\xc3" "\x69\xe1\xf4\xf0\xbd\x70\x46\x38\x33\x9c\x15\xbe\x1f\xce\x0e\xe7\x84\x73" "\xc3\x79\xe1\xfc\x70\x41\x88\x3f\x5f\x12\x43\x72\xf8\x51\xb8\x38\xfc\x38" "\x4c\x09\x97\x84\x4b\xc3\x65\xe1\xf2\x70\x45\xb8\x32\x5c\x15\xae\x0e\xd7" "\x84\x6b\xc3\x75\xe1\xfa\x70\x43\x99\xfe\x3f\x1f\x1a\x6e\x09\xb7\x86\xdb" "\xc2\xed\xe1\x8e\x70\x67\xb8\x2b\xfc\x34\xdc\x1d\x7e\x16\xee\x09\x3f\x0f" "\x53\xc3\x2f\xc2\xbd\xe1\xdf\xc2\x7d\xe1\x97\xe1\xfe\xf0\xab\xf0\x40\xf8" "\x75\x78\x30\xfc\x26\x3c\x14\x7e\x1b\x1e\x0e\xbf\x0b\x8f\x84\xdf\x87\x47" "\xc3\x63\xe1\xf1\xf0\x87\xf0\x44\xf8\x63\x78\x32\x3c\x15\x9e\x0e\xcf\x84" "\x67\xc3\x9f\xc2\x73\xe1\xf9\xf0\x42\xe8\xd3\x2e\xee\xd3\x3e\xde\xc9\x90" "\xa1\x0c\x94\x81\x12\x28\x81\x32\x53\x66\xca\x42\x59\x28\x1b\x65\xa3\x18" "\xc5\x28\x07\xe5\xa0\x9c\x94\x93\x72\x51\x2e\xca\x43\x79\x28\x1f\xe5\xa3" "\x02\x19\x0b\x50\x1a\x26\xa6\x82\x54\x90\xe2\x14\xa7\xc2\x54\x98\x8a\x50" "\x11\x2a\x46\xc5\xc8\x91\xa3\x92\x54\x92\x4a\x51\x29\x2a\x4d\xa5\xa9\x0c" "\x95\xa1\xb2\x54\x96\xca\x51\x39\xaa\x40\x15\xe8\x36\xba\x8d\x6e\xa7\xdb" "\xe9\x0e\xba\x83\xee\xa4\x3b\xe9\x6e\xba\x9b\xaa\x52\x55\xaa\x46\xd5\xa8" "\x3a\x55\xa7\x1a\x54\x83\x6a\x52\x4d\xaa\x45\xb5\xa8\x36\xd5\xa6\x3a\x54" "\x87\xea\x51\x3d\xaa\x4f\xf5\xa9\x01\x35\xa0\x46\xd4\x88\x9a\x50\x13\x6a" "\x46\xcd\xa8\x39\x35\xa7\x16\xd4\x82\x5a\x51\x2b\x6a\x4d\xad\xa9\x0d\xb5" "\xa1\xb6\xd4\x96\xda\x51\x3b\x6a\x4f\xed\xa9\x03\x75\xa0\x8e\xd4\x91\x3a" "\x51\x27\xea\x4c\x9d\xa9\x0b\x75\xa1\xae\xd4\x95\xba\x51\x37\x4a\xa4\x44" "\xea\x49\x3d\xa9\x17\xf5\xa2\x3e\xd4\x87\xfa\x51\x3f\xea\x4f\xfd\x69\x00" "\x0d\xa0\x81\x34\x90\x06\xd3\x60\x1a\x42\x43\x68\x28\x0d\xa5\x61\x34\x9c" "\x46\xd0\x5b\x34\x92\x46\xd1\x68\x1a\x43\x63\x69\x1c\x25\x51\x12\x8d\xa7" "\xf1\x34\x81\x26\xd0\x44\x9a\x48\x93\x69\x32\x4d\xa5\xa9\x34\x9d\xa6\xd3" "\x0c\x9a\x41\xb3\x68\x16\xcd\xa6\xd9\x34\x97\xe6\xd2\x7c\x9a\x4f\x0b\x69" "\x21\x2d\xa2\x45\x94\x4c\xc9\xb4\x98\x16\x53\x0a\xa5\xd0\x52\x5a\x4a\xcb" "\x69\x39\xad\xa4\x95\xb4\x9a\x56\xd3\x5a\x5a\x4b\xeb\x69\x3d\x6d\xa4\x8d" "\xb4\x99\x36\xd3\x16\xda\x42\xdb\x68\x1b\xed\xa0\x1d\xb4\x8b\x76\xd1\x6e" "\xda\x4d\x7b\x68\x0f\xa5\x52\x2a\xed\xa5\xbd\xb4\x8f\xf6\xd1\x7e\xda\x4f" "\x07\xe8\x00\x1d\xa4\x83\x74\x88\x0e\xd1\x61\x3a\x4c\x47\xe8\x08\x1d\xa5" "\xa3\x74\x9c\x8e\xd3\x09\x3a\x41\x27\xe9\x24\x9d\xa6\xd3\x74\x96\x7e\xa2" "\x73\x74\x9e\x2e\x90\xa7\x04\x9b\xc9\x66\xb6\x57\xd9\x2c\x36\xab\xcd\x66" "\xb3\xdb\x7f\x8c\xf3\xd8\xbc\x36\x9f\xcd\x6f\x0b\xd8\xd0\xe6\xb2\xb9\x7f" "\x15\x93\xb5\xb6\x88\x2d\x6a\x8b\xd9\xe2\xd6\xd9\x12\xb6\xa4\xbd\xe1\x9f" "\xe2\x72\xb6\xbc\xad\x60\x6f\xb5\xb7\xd9\x8a\xf6\x76\x5b\xc9\x96\xb3\x99" "\xe0\xef\xe3\x6a\xf6\x5e\x5b\xdd\xde\x67\x6b\xd8\xfb\x6d\x55\x7b\xcf\xaf" "\xe2\x9a\xf6\x01\x5b\xcb\x3e\x62\x6b\xdb\x86\xb6\x8e\x6d\x6c\xeb\xd9\xa6" "\xb6\xbe\x7d\xc4\x36\xb0\x0d\x6d\x23\xdb\xd8\x36\xb1\x4d\x6d\x6b\xfb\x84" "\x6d\x63\x9f\xb4\x6d\xed\x53\x09\xed\xec\xd3\x7f\x1f\xdb\xb4\x78\x91\xfd" "\xd0\xae\xb6\x6b\xec\x5a\xbb\xce\xee\xb6\x9f\xd9\xd3\xf6\x8c\x3d\x64\xbf" "\xb5\x67\xed\x4f\xb6\x9b\xed\x6e\xfb\xd9\x57\x6c\x7f\xfb\xaa\x1d\x60\x5f" "\xb3\x03\xed\xa0\x5f\xc7\x00\x76\x84\x7d\xcb\x8e\xb4\xa3\xec\x68\x3b\xc6" "\x8e\xb5\xe3\xfe\x29\x9e\x6c\xa7\xd8\xa9\x76\x9a\x9d\x6e\xdf\xb3\x33\xec" "\xcc\x7f\x8a\x17\xda\x0f\xec\x6c\x9b\x6c\xe7\xda\x79\x76\xbe\x5d\x70\x31" "\x4e\xeb\x29\xd9\x7e\x64\x17\xdb\x8f\x6d\x8a\x5d\x62\x97\xda\x65\x76\xb9" "\x5d\x61\x57\xda\x55\xff\xbf\xd7\x65\x76\x83\xdd\x68\x37\xd9\x5d\xf6\x53" "\xbb\xc5\x6e\xb5\xdb\xec\x76\xbb\xc3\xee\xbc\x18\xa7\x9d\xc7\x1e\xfb\xb9" "\x4d\xb5\x5f\xd8\x83\xf6\x1b\xbb\xcf\x7e\x69\xf7\xdb\xc3\xf6\x80\xfd\xfa" "\x62\x9c\x76\x7e\x87\xed\x77\xf6\x88\xfd\xde\x1e\xb5\xc7\x7a\x80\xfd\xc1" "\x9e\xb0\x3f\xda\x93\xf6\xd4\xc5\xf3\x4f\x3b\xf7\x1f\xec\x79\x7b\xc1\x7a" "\x0b\x8c\xac\x58\xb3\xe1\x80\x33\x70\x46\x4e\xe0\x4c\x9c\x99\xaf\xe2\x2c" "\x9c\x95\xb3\x71\x76\x8e\xf1\xd5\x9c\x83\xaf\xe1\x9c\x7c\x2d\xe7\xe2\xdc" "\x9c\x87\xf3\x72\x3e\xce\xcf\x05\x38\x64\x62\xcb\xcc\x11\x17\xe4\x42\x1c" "\xe7\xeb\xb8\x30\x5f\xcf\x45\xb8\x28\x17\xe3\xe2\xec\xb8\x04\x97\xe4\x1b" "\xb8\x14\xdf\xc8\xa5\xf9\x26\x2e\xc3\x37\x73\x59\xbe\x85\xcb\x71\x79\xae" "\xc0\xb7\xf2\x6d\x5c\x91\x6f\xe7\x4a\x7c\x07\x57\xe6\x3b\xf9\x2e\xbe\x9b" "\xab\x70\x55\xbe\x87\xab\xf1\xbd\x5c\x9d\xef\xe3\x1a\x7c\x3f\xd7\xe4\x07" "\xb8\x16\x3f\xc8\xb5\xf9\x21\xae\xc3\x75\xb9\x1e\x3f\xcc\xf5\xf9\x11\x6e" "\xc0\x0d\xb9\x11\x37\xe6\x26\xdc\x94\x9b\xf1\xa3\xdc\x9c\x1f\xe3\x16\xdc" "\x92\x5b\xf1\xe3\xdc\x9a\x9f\xe0\x36\xfc\x24\xb7\xe5\xa7\xb8\x1d\x3f\xcd" "\xed\xf9\x19\xee\xc0\xcf\x72\x47\x7e\x8e\x3b\xf1\xf3\xdc\x99\x5f\xe0\x2e" "\xfc\x22\x77\xe5\x97\xb8\x1b\x77\xe7\x44\xee\xc1\x3d\xf9\x65\xee\xc5\xbd" "\xb9\x0f\xf7\xe5\x7e\xfc\x0a\xf7\xe7\x57\x79\x00\xbf\xc6\x03\x79\x10\x0f" "\xe6\xd7\x79\x08\xbf\xc1\x43\xf9\x4d\x1e\xc6\xc3\x79\x04\xbf\xc5\x23\x79" "\x14\x8f\xe6\x31\x3c\x96\xc7\x71\x12\xbf\xcd\xe3\xf9\x1d\x9e\xc0\xef\xf2" "\x44\x9e\xc4\x93\x79\x0a\x4f\xe5\x69\x3c\x9d\xdf\xe3\x19\x3c\x93\x67\xf1" "\xfb\x3c\x9b\xe7\xf0\x5c\x9e\xc7\xf3\x79\x01\x2f\xe4\x0f\x78\x11\x7f\xc8" "\xc9\xfc\x11\x2f\xe6\x8f\x39\x85\x97\xf0\x52\x5e\xc6\xcb\x79\x05\xaf\xe4" "\x55\xbc\x9a\xd7\xf0\x5a\x5e\xc7\xeb\x79\x03\x6f\xe4\x4d\xbc\x99\x3f\xe1" "\x2d\xbc\x95\xb7\xf1\x76\xde\xc1\x3b\x79\x17\x7f\xca\xbb\xf9\x33\xde\xc3" "\x9f\x73\x2a\x7f\xc1\x7b\xf9\x6f\xbc\x8f\xbf\xe4\xfd\xfc\x15\x1f\xe0\xaf" "\xf9\x20\x7f\xc3\x87\xf8\x5b\x3e\xcc\xdf\xf1\x11\xfe\x9e\x8f\xf2\x31\x3e" "\xce\x3f\xf0\x09\xfe\x91\x4f\xf2\x29\x3e\xcd\x67\xf8\x2c\xff\xc4\xe7\xf8" "\x3c\x5f\x60\xcf\x10\x61\xa4\x22\x1d\x99\x28\x88\x32\x44\x19\xa3\x84\x28" "\x53\x94\x39\xba\x2a\xca\x12\x65\x8d\xb2\x45\xd9\xa3\x58\x74\x75\x94\x23" "\xba\x26\xca\x19\x5d\x1b\xe5\x8a\x72\x47\x79\xa2\xbc\x51\xbe\x28\x7f\x54" "\x20\x0a\x23\x8a\x6c\xc4\x51\x14\x15\x8c\x0a\x45\xf1\xe8\xba\xa8\x70\x74" "\x7d\x54\x24\x2a\x1a\x15\x8b\x8a\x47\x2e\x2a\x11\x95\x8c\x6e\x88\x4a\x45" "\x37\x46\xa5\xa3\x9b\xa2\x32\xd1\xcd\x51\xd9\xe8\x96\xa8\x5c\x54\x3e\xaa" "\x10\xdd\x1a\xdd\x16\x55\x8c\x6e\x8f\x2a\x45\x77\x44\x95\xa3\x3b\xa3\xbb" "\xa2\xbb\xa3\x2a\x51\xd5\xe8\x9e\xa8\x5a\x74\x6f\x54\x3d\xba\x2f\xaa\x11" "\xdd\x1f\x95\x8e\x1e\x88\x6a\x45\x0f\x46\xb5\xa3\x87\xa2\x3a\x51\xdd\xa8" "\x5e\xf4\x70\x54\x3f\x7a\x24\x6a\x10\x35\x8c\x1a\x45\x8d\xa3\x26\x51\xd3" "\xa8\x59\xf4\x68\xd4\x3c\x7a\x2c\x6a\x11\xb5\x8c\x5a\x45\x8f\x47\xad\xa3" "\x27\xa2\x36\xd1\x93\x51\xdb\xe8\xa9\xa8\x5d\xf4\xf4\xe5\xfd\x45\x83\x9f" "\x3f\x4d\xff\x61\x7f\x62\xd4\x23\xd2\x97\x9e\x90\xdd\xa7\xe7\xc7\x17\xc4" "\x17\xc6\x3f\x88\x2f\x8a\x7f\x18\x4f\x8e\x7f\x14\x5f\x1c\xff\x38\x9e\x12" "\x5f\x12\x5f\x1a\x5f\x16\x5f\x1e\x5f\x11\x5f\x19\x5f\x15\x5f\x1d\x5f\x13" "\x5f\x1b\x5f\x17\x5f\x1f\xdf\x10\xdf\x18\xdf\x14\xf7\xbe\x6a\x46\x70\x98" "\x76\x23\x0c\xc6\x05\x2e\x83\xcb\xe8\x12\x5c\x26\x97\xd9\x5d\xe5\xb2\xb8" "\xac\x2e\x9b\xcb\xee\x62\xee\x6a\x97\xc3\x5d\xe3\x72\xba\x6b\x5d\x2e\x97" "\xdb\xe5\x71\x79\x5d\x3e\x97\xdf\x15\x70\xa1\x23\x67\x1d\xbb\xc8\x15\x74" "\x85\x5c\xdc\x5d\xe7\x0a\xbb\xeb\x5d\x11\x57\xd4\x15\x73\xc5\x9d\x73\x25" "\x5c\x49\xd7\xd4\x35\x73\xcd\x5c\x73\xf7\x98\x6b\xe1\x5a\xba\x56\xee\x71" "\xf7\xb8\x7b\xc2\x3d\xe1\x9e\x4c\xb8\xd4\xb8\x6b\xef\x9e\x71\x1d\xdc\xb3" "\xae\xa3\x7b\xce\x3d\xe7\x9e\x77\x9d\xdd\x0b\xae\x8b\x7b\xd1\x75\x75\x2f" "\xb9\x6e\xae\xbb\x4b\x74\x89\xae\xa7\xeb\xe9\x7a\xb9\x5e\xae\x8f\xeb\xe3" "\xfa\xb9\x7e\xae\xbf\xeb\xef\x06\xb8\x01\x6e\xa0\x1b\xe8\x06\xbb\xc1\x6e" "\x88\x1b\xe2\x86\xba\xa1\x6e\x98\x1b\xe6\x46\xb8\x11\x6e\xa4\x1b\xe9\x46" "\xbb\xd1\x6e\xac\x1b\xeb\x92\x5c\x92\x1b\xef\xc6\xbb\x09\x6e\x82\x9b\xe8" "\x26\xba\xc9\x6e\xb2\x9b\xea\xa6\xba\xe9\x6e\xba\x9b\xe1\x66\xb8\x59\x6e" "\x96\x9b\xed\x66\xbb\xb9\x6e\xae\x9b\xef\xe6\xbb\x85\x6e\xa1\x5b\xe4\x16" "\xb9\x64\x97\xec\x16\xbb\xc5\x2e\xc5\xa5\xb8\xa5\x6e\xa9\x5b\xee\x96\xbb" "\x95\x6e\xa5\x5b\xed\x56\xbb\xb5\x6e\xad\x5b\xef\xd6\xbb\x8d\x6e\xa3\xdb" "\xec\x36\xbb\x2d\x6e\x8b\xdb\xe6\xb6\xb9\x1d\x6e\x87\xdb\xe5\x76\xb9\xdd" "\x6e\xb7\xdb\xe3\xf6\xb8\x54\x97\xea\xf6\xba\xbd\x6e\x9f\xdb\xe7\xf6\xbb" "\xaf\xdc\x01\xf7\xb5\x3b\xe8\xbe\x71\x87\xdc\xb7\xee\xb0\xfb\xce\x1d\x71" "\xdf\xbb\xa3\xee\x98\x3b\xee\xbc\x3e\xe1\x7e\x74\x27\xdd\x29\x77\xda\x9d" "\x71\x67\xdd\x4f\xee\x9c\x3b\xef\x2e\x38\xef\x92\x62\x6f\xc7\xc6\xc7\xde" "\x89\x4d\x88\xbd\x1b\x9b\x18\x9b\x14\x9b\x1c\x9b\x12\x9b\x1a\x9b\x16\x9b" "\x1e\x7b\x2f\x36\x23\x36\x33\x36\x2b\xf6\x7e\x6c\x76\x6c\x4e\x6c\x6e\x6c" "\x5e\x6c\x7e\x6c\x41\x6c\x61\xec\x83\xd8\xa2\xd8\x87\xb1\xe4\xd8\x47\xb1" "\xc5\xb1\x8f\x63\x29\xb1\x25\xb1\xa5\xb1\x65\xb1\xe5\xb1\x15\x31\xef\xf3" "\x6f\x89\x7c\x41\x5f\xc8\xc7\xfd\x75\xbe\xb0\xbf\xde\x17\xf1\x45\x7d\x31" "\x5f\xdc\x3b\x5f\xc2\x97\xf4\x37\xf8\x52\xfe\x46\x5f\xda\xdf\xe4\xcb\xf8" "\x9b\x7d\x59\x7f\x8b\x2f\xe7\xcb\xfb\x0a\xbe\xa1\x6f\xe4\x1b\xfb\x26\xbe" "\xa9\x6f\xe6\x1f\xf5\xcd\xfd\x63\xbe\x85\x6f\xe9\x5b\xf9\xc7\x7d\x6b\xff" "\x84\x6f\xe3\x9f\xf4\x6d\xfd\x53\xbe\x9d\x7f\xda\xb7\xf7\xcf\xf8\x0e\xfe" "\x59\xdf\xd1\x3f\xe7\x3b\xf9\xe7\xe7\x5c\x9a\xb2\xef\xea\x5f\xf2\xdd\x7c" "\x77\x9f\xe8\x7b\xf8\x9e\xfe\x65\xdf\xcb\xf7\xf6\x7d\x7c\x5f\xdf\x0f\x5f" "\xf1\xfd\xfd\xab\x7e\x80\x7f\xcd\x0f\xf4\x83\xfc\x60\xff\xba\x1f\xe2\xdf" "\xf0\x43\xfd\x9b\x7e\x98\x1f\xee\x47\xf8\xb7\xfc\x48\x3f\xca\x8f\xf6\x63" "\xfc\x58\x3f\xce\x27\xf9\xb7\xfd\x78\xff\x8e\x9f\xe0\xdf\xf5\x13\xfd\x24" "\x3f\xd9\x4f\xf1\x53\xfd\x34\x3f\xdd\xbf\xe7\x67\xf8\x99\x7e\x96\x7f\xdf" "\xcf\xf6\x73\xfc\x5c\x3f\xcf\xcf\xf7\x0b\xfc\x42\xff\x81\x5f\xe4\x3f\xf4" "\xc9\xfe\x23\xbf\xd8\x7f\xec\x53\xfc\x12\xbf\xd4\x2f\xf3\xcb\xfd\x0a\xbf" "\xd2\xaf\xf2\xab\xfd\x1a\xbf\xd6\xaf\xf3\xeb\xfd\x06\xbf\xd1\x6f\xf2\x9b" "\xfd\x27\x7e\x8b\xdf\xea\xb7\xf9\xed\x7e\x87\xdf\xe9\x77\xf9\x4f\xfd\x6e" "\xff\x99\xdf\xe3\x3f\xf7\xa9\xfe\x0b\xbf\xd7\xff\xcd\xef\xf3\x5f\xfa\xfd" "\xfe\x2b\x7f\xc0\x7f\xed\x0f\xfa\x6f\xfc\x21\xff\xad\x3f\xec\xbf\xf3\x47" "\xfc\xf7\xfe\xa8\x3f\xe6\x8f\xfb\x1f\xfc\x09\xff\xa3\x3f\xe9\x4f\xf9\xd3" "\xfe\x8c\x3f\xeb\x7f\xf2\xe7\xfc\x79\x7f\x41\x7e\x67\x4d\x08\x21\x84\x10" "\xe2\x5f\xa2\xff\x60\x7f\x8f\xdf\xf8\x3f\x75\x69\x4b\xd3\x13\x00\xb2\x6e" "\xcd\x7b\xe0\x1f\x6b\xae\xcf\xf5\xf3\xba\xb7\xda\xdd\x2e\x06\x00\x4f\x75" "\xef\x54\xf7\xd2\x96\x01\xea\x26\x26\x26\x5e\x3a\x36\x45\x43\x50\x68\x1e" "\x00\xc4\x2e\xe7\x67\x80\xcb\xf1\x12\x68\x05\x4f\x40\x5b\x68\x09\xa5\x7e" "\xb3\xbf\xde\xaa\xc2\xc5\xeb\xbe\xbf\xab\x5f\xb7\xee\x3f\xd4\x8f\xdf\x0c" "\x90\x19\x20\xd3\x2f\x39\x69\xb7\x47\xbf\xc4\x97\xeb\xdf\xf8\x3b\xf5\x1b" "\x7e\xc0\xbf\x5b\x7f\x09\xa4\x68\x84\xf8\x3c\x80\x22\x85\x2e\xe7\xa4\x15" "\xfe\x25\xbe\x5c\xbf\xf4\xef\xd4\xdf\xd9\xfa\xf7\xeb\x5f\xec\x3f\xd3\x97" "\x49\x00\x2d\xfe\x2e\x27\x0b\x5c\x8e\x2f\xd7\x2f\x09\x8f\xc1\xd3\xd0\xf6" "\x57\x47\x0a\x21\x84\x10\x42\x08\x21\x84\x10\x3f\xeb\xad\xce\x76\xfe\x83" "\xfb\xcf\x8b\xf7\xe7\xf9\xcc\xaf\xf3\x7e\x89\xff\xe8\xfe\xfc\x0f\x54\xfa" "\xaf\xf6\x2f\x84\x10\x42\x08\x21\x84\x10\x42\x88\x3f\xf6\xec\x0b\x5d\x9e" "\x7c\xb4\x6d\xdb\x96\x1d\xfe\x2f\x2f\x32\xfe\x67\xb4\xf1\x1f\xb0\x40\x00" "\xf8\xf3\x59\x59\x2f\x7d\xb3\xfc\xa7\x9c\x85\x2c\xfe\x07\x16\x57\xf8\x07" "\x93\x10\x42\x08\x21\x84\x10\xe2\x2f\x77\xf9\xa2\xff\x4a\x77\x22\x84\x10" "\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21" "\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42" "\xa4\x5f\xff\xfe\x5f\x08\x53\xff\xf2\xc1\x57\xfa\x1c\x85\x10\x42\x08\x21" "\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42" "\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84\x10\x42\x08\x21\x84" "\x10\x42\x08\x21\x84\x10\x42\x88\x2b\xed\xff\x05\x00\x00\xff\xff\x11\x3a" "\x4f\xfd", 5402)); NONFAILING(syz_mount_image( /*fs=*/0x200000000240, /*dir=*/0x2000000005c0, /*flags=MS_LAZYTIME|MS_SYNCHRONOUS|MS_STRICTATIME|MS_NODIRATIME|MS_NOATIME|0xc0*/ 0x3000cd0, /*opts=*/0x200000000440, /*chdir=*/1, /*size=*/0x151a, /*img=*/0x200000003f40)); // chown arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // uid: uid (resource) // gid: gid (resource) // ] NONFAILING(memcpy((void*)0x200000000140, "./file0\000", 8)); syscall(__NR_chown, /*file=*/0x200000000140ul, /*uid=*/0, /*gid=*/0); close_fds(); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); setup_sysctl(); const char* reason; (void)reason; if ((reason = setup_binfmt_misc())) printf("the reproducer may not work as expected: binfmt_misc setup failed: " "%s\n", reason); if ((reason = setup_usb())) printf("the reproducer may not work as expected: USB injection setup " "failed: %s\n", reason); if ((reason = setup_swap())) printf("the reproducer may not work as expected: swap setup failed: %s\n", reason); install_segv_handler(); use_temporary_dir(); do_sandbox_none(); return 0; }