// https://syzkaller.appspot.com/bug?id=b98a7858e426a0a7a0781fe68f902cbf1e92f972 // 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 #include #include #include #ifndef __NR_listxattr #define __NR_listxattr 11 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 279 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_mprotect #define __NR_mprotect 226 #endif #ifndef __NR_openat #define __NR_openat 56 #endif #ifndef __NR_quotactl #define __NR_quotactl 60 #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 initialize_tun(void) { 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); } #define WIFI_INITIAL_DEVICE_COUNT 2 #define WIFI_MAC_BASE {0x08, 0x02, 0x11, 0x00, 0x00, 0x00} #define WIFI_IBSS_BSSID {0x50, 0x50, 0x50, 0x50, 0x50, 0x50} #define WIFI_IBSS_SSID {0x10, 0x10, 0x10, 0x10, 0x10, 0x10} #define WIFI_DEFAULT_FREQUENCY 2412 #define WIFI_DEFAULT_SIGNAL 0 #define WIFI_DEFAULT_RX_RATE 1 #define HWSIM_CMD_REGISTER 1 #define HWSIM_CMD_FRAME 2 #define HWSIM_CMD_NEW_RADIO 4 #define HWSIM_ATTR_SUPPORT_P2P_DEVICE 14 #define HWSIM_ATTR_PERM_ADDR 22 #define IF_OPER_UP 6 struct join_ibss_props { int wiphy_freq; bool wiphy_freq_fixed; uint8_t* mac; uint8_t* ssid; int ssid_len; }; static int set_interface_state(const char* interface_name, int on) { struct ifreq ifr; int sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock < 0) { return -1; } memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, interface_name); int ret = ioctl(sock, SIOCGIFFLAGS, &ifr); if (ret < 0) { close(sock); return -1; } if (on) ifr.ifr_flags |= IFF_UP; else ifr.ifr_flags &= ~IFF_UP; ret = ioctl(sock, SIOCSIFFLAGS, &ifr); close(sock); if (ret < 0) { return -1; } return 0; } static int nl80211_set_interface(struct nlmsg* nlmsg, int sock, int nl80211_family, uint32_t ifindex, uint32_t iftype, bool dofail) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL80211_CMD_SET_INTERFACE; netlink_init(nlmsg, nl80211_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, NL80211_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(nlmsg, NL80211_ATTR_IFTYPE, &iftype, sizeof(iftype)); int err = netlink_send_ext(nlmsg, sock, 0, NULL, dofail); if (err < 0) { } return err; } static int nl80211_join_ibss(struct nlmsg* nlmsg, int sock, int nl80211_family, uint32_t ifindex, struct join_ibss_props* props, bool dofail) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL80211_CMD_JOIN_IBSS; netlink_init(nlmsg, nl80211_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, NL80211_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(nlmsg, NL80211_ATTR_SSID, props->ssid, props->ssid_len); netlink_attr(nlmsg, NL80211_ATTR_WIPHY_FREQ, &(props->wiphy_freq), sizeof(props->wiphy_freq)); if (props->mac) netlink_attr(nlmsg, NL80211_ATTR_MAC, props->mac, ETH_ALEN); if (props->wiphy_freq_fixed) netlink_attr(nlmsg, NL80211_ATTR_FREQ_FIXED, NULL, 0); int err = netlink_send_ext(nlmsg, sock, 0, NULL, dofail); if (err < 0) { } return err; } static int get_ifla_operstate(struct nlmsg* nlmsg, int ifindex, bool dofail) { struct ifinfomsg info; memset(&info, 0, sizeof(info)); info.ifi_family = AF_UNSPEC; info.ifi_index = ifindex; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) { return -1; } netlink_init(nlmsg, RTM_GETLINK, 0, &info, sizeof(info)); int n; int err = netlink_send_ext(nlmsg, sock, RTM_NEWLINK, &n, dofail); close(sock); if (err) { return -1; } struct rtattr* attr = IFLA_RTA(NLMSG_DATA(nlmsg->buf)); for (; RTA_OK(attr, n); attr = RTA_NEXT(attr, n)) { if (attr->rta_type == IFLA_OPERSTATE) return *((int32_t*)RTA_DATA(attr)); } return -1; } static int await_ifla_operstate(struct nlmsg* nlmsg, char* interface, int operstate, bool dofail) { int ifindex = if_nametoindex(interface); while (true) { usleep(1000); int ret = get_ifla_operstate(nlmsg, ifindex, dofail); if (ret < 0) return ret; if (ret == operstate) return 0; } return 0; } static int nl80211_setup_ibss_interface(struct nlmsg* nlmsg, int sock, int nl80211_family_id, char* interface, struct join_ibss_props* ibss_props, bool dofail) { int ifindex = if_nametoindex(interface); if (ifindex == 0) { return -1; } int ret = nl80211_set_interface(nlmsg, sock, nl80211_family_id, ifindex, NL80211_IFTYPE_ADHOC, dofail); if (ret < 0) { return -1; } ret = set_interface_state(interface, 1); if (ret < 0) { return -1; } ret = nl80211_join_ibss(nlmsg, sock, nl80211_family_id, ifindex, ibss_props, dofail); if (ret < 0) { return -1; } return 0; } static int hwsim80211_create_device(struct nlmsg* nlmsg, int sock, int hwsim_family, uint8_t mac_addr[ETH_ALEN]) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = HWSIM_CMD_NEW_RADIO; netlink_init(nlmsg, hwsim_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, HWSIM_ATTR_SUPPORT_P2P_DEVICE, NULL, 0); netlink_attr(nlmsg, HWSIM_ATTR_PERM_ADDR, mac_addr, ETH_ALEN); int err = netlink_send(nlmsg, sock); if (err < 0) { } return err; } static void initialize_wifi_devices(void) { int rfkill = open("/dev/rfkill", O_RDWR); if (rfkill == -1) exit(1); struct rfkill_event event = {0}; event.type = RFKILL_TYPE_ALL; event.op = RFKILL_OP_CHANGE_ALL; if (write(rfkill, &event, sizeof(event)) != (ssize_t)(sizeof(event))) exit(1); close(rfkill); uint8_t mac_addr[6] = WIFI_MAC_BASE; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock < 0) exit(1); int hwsim_family_id = netlink_query_family_id(&nlmsg, sock, "MAC80211_HWSIM", true); int nl80211_family_id = netlink_query_family_id(&nlmsg, sock, "nl80211", true); if (hwsim_family_id < 0 || nl80211_family_id < 0) exit(1); uint8_t ssid[] = WIFI_IBSS_SSID; uint8_t bssid[] = WIFI_IBSS_BSSID; struct join_ibss_props ibss_props = {.wiphy_freq = WIFI_DEFAULT_FREQUENCY, .wiphy_freq_fixed = true, .mac = bssid, .ssid = ssid, .ssid_len = sizeof(ssid)}; for (int device_id = 0; device_id < WIFI_INITIAL_DEVICE_COUNT; device_id++) { mac_addr[5] = device_id; int ret = hwsim80211_create_device(&nlmsg, sock, hwsim_family_id, mac_addr); if (ret < 0) exit(1); char interface[6] = "wlan0"; interface[4] += device_id; if (nl80211_setup_ibss_interface(&nlmsg, sock, nl80211_family_id, interface, &ibss_props, true) < 0) exit(1); } for (int device_id = 0; device_id < WIFI_INITIAL_DEVICE_COUNT; device_id++) { char interface[6] = "wlan0"; interface[4] += device_id; int ret = await_ifla_operstate(&nlmsg, interface, IF_OPER_UP, true); if (ret < 0) exit(1); } 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 #define BTPROTO_HCI 1 #define ACL_LINK 1 #define SCAN_PAGE 2 typedef struct { uint8_t b[6]; } __attribute__((packed)) bdaddr_t; #define HCI_COMMAND_PKT 1 #define HCI_EVENT_PKT 4 #define HCI_VENDOR_PKT 0xff struct hci_command_hdr { uint16_t opcode; uint8_t plen; } __attribute__((packed)); struct hci_event_hdr { uint8_t evt; uint8_t plen; } __attribute__((packed)); #define HCI_EV_CONN_COMPLETE 0x03 struct hci_ev_conn_complete { uint8_t status; uint16_t handle; bdaddr_t bdaddr; uint8_t link_type; uint8_t encr_mode; } __attribute__((packed)); #define HCI_EV_CONN_REQUEST 0x04 struct hci_ev_conn_request { bdaddr_t bdaddr; uint8_t dev_class[3]; uint8_t link_type; } __attribute__((packed)); #define HCI_EV_REMOTE_FEATURES 0x0b struct hci_ev_remote_features { uint8_t status; uint16_t handle; uint8_t features[8]; } __attribute__((packed)); #define HCI_EV_CMD_COMPLETE 0x0e struct hci_ev_cmd_complete { uint8_t ncmd; uint16_t opcode; } __attribute__((packed)); #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a #define HCI_OP_READ_BUFFER_SIZE 0x1005 struct hci_rp_read_buffer_size { uint8_t status; uint16_t acl_mtu; uint8_t sco_mtu; uint16_t acl_max_pkt; uint16_t sco_max_pkt; } __attribute__((packed)); #define HCI_OP_READ_BD_ADDR 0x1009 struct hci_rp_read_bd_addr { uint8_t status; bdaddr_t bdaddr; } __attribute__((packed)); #define HCI_EV_LE_META 0x3e struct hci_ev_le_meta { uint8_t subevent; } __attribute__((packed)); #define HCI_EV_LE_CONN_COMPLETE 0x01 struct hci_ev_le_conn_complete { uint8_t status; uint16_t handle; uint8_t role; uint8_t bdaddr_type; bdaddr_t bdaddr; uint16_t interval; uint16_t latency; uint16_t supervision_timeout; uint8_t clk_accurancy; } __attribute__((packed)); struct hci_dev_req { uint16_t dev_id; uint32_t dev_opt; }; struct vhci_vendor_pkt_request { uint8_t type; uint8_t opcode; } __attribute__((packed)); struct vhci_pkt { uint8_t type; union { struct { uint8_t opcode; uint16_t id; } __attribute__((packed)) vendor_pkt; struct hci_command_hdr command_hdr; }; } __attribute__((packed)); #define HCIDEVUP _IOW('H', 201, int) #define HCISETSCAN _IOW('H', 221, int) static int vhci_fd = -1; static void rfkill_unblock_all() { int fd = open("/dev/rfkill", O_WRONLY); if (fd < 0) exit(1); struct rfkill_event event = {0}; event.idx = 0; event.type = RFKILL_TYPE_ALL; event.op = RFKILL_OP_CHANGE_ALL; event.soft = 0; event.hard = 0; if (write(fd, &event, sizeof(event)) < 0) exit(1); close(fd); } static void hci_send_event_packet(int fd, uint8_t evt, void* data, size_t data_len) { struct iovec iv[3]; struct hci_event_hdr hdr; hdr.evt = evt; hdr.plen = data_len; uint8_t type = HCI_EVENT_PKT; iv[0].iov_base = &type; iv[0].iov_len = sizeof(type); iv[1].iov_base = &hdr; iv[1].iov_len = sizeof(hdr); iv[2].iov_base = data; iv[2].iov_len = data_len; if (writev(fd, iv, sizeof(iv) / sizeof(struct iovec)) < 0) exit(1); } static void hci_send_event_cmd_complete(int fd, uint16_t opcode, void* data, size_t data_len) { struct iovec iv[4]; struct hci_event_hdr hdr; hdr.evt = HCI_EV_CMD_COMPLETE; hdr.plen = sizeof(struct hci_ev_cmd_complete) + data_len; struct hci_ev_cmd_complete evt_hdr; evt_hdr.ncmd = 1; evt_hdr.opcode = opcode; uint8_t type = HCI_EVENT_PKT; iv[0].iov_base = &type; iv[0].iov_len = sizeof(type); iv[1].iov_base = &hdr; iv[1].iov_len = sizeof(hdr); iv[2].iov_base = &evt_hdr; iv[2].iov_len = sizeof(evt_hdr); iv[3].iov_base = data; iv[3].iov_len = data_len; if (writev(fd, iv, sizeof(iv) / sizeof(struct iovec)) < 0) exit(1); } static bool process_command_pkt(int fd, char* buf, ssize_t buf_size) { struct hci_command_hdr* hdr = (struct hci_command_hdr*)buf; if (buf_size < (ssize_t)sizeof(struct hci_command_hdr) || hdr->plen != buf_size - sizeof(struct hci_command_hdr)) exit(1); switch (hdr->opcode) { case HCI_OP_WRITE_SCAN_ENABLE: { uint8_t status = 0; hci_send_event_cmd_complete(fd, hdr->opcode, &status, sizeof(status)); return true; } case HCI_OP_READ_BD_ADDR: { struct hci_rp_read_bd_addr rp = {0}; rp.status = 0; memset(&rp.bdaddr, 0xaa, 6); hci_send_event_cmd_complete(fd, hdr->opcode, &rp, sizeof(rp)); return false; } case HCI_OP_READ_BUFFER_SIZE: { struct hci_rp_read_buffer_size rp = {0}; rp.status = 0; rp.acl_mtu = 1021; rp.sco_mtu = 96; rp.acl_max_pkt = 4; rp.sco_max_pkt = 6; hci_send_event_cmd_complete(fd, hdr->opcode, &rp, sizeof(rp)); return false; } } char dummy[0xf9] = {0}; hci_send_event_cmd_complete(fd, hdr->opcode, dummy, sizeof(dummy)); return false; } static void* event_thread(void* arg) { while (1) { char buf[1024] = {0}; ssize_t buf_size = read(vhci_fd, buf, sizeof(buf)); if (buf_size < 0) exit(1); if (buf_size > 0 && buf[0] == HCI_COMMAND_PKT) { if (process_command_pkt(vhci_fd, buf + 1, buf_size - 1)) break; } } return NULL; } #define HCI_HANDLE_1 200 #define HCI_HANDLE_2 201 #define HCI_PRIMARY 0 #define HCI_OP_RESET 0x0c03 static void initialize_vhci() { int hci_sock = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (hci_sock < 0) exit(1); vhci_fd = open("/dev/vhci", O_RDWR); if (vhci_fd == -1) exit(1); const int kVhciFd = 202; if (dup2(vhci_fd, kVhciFd) < 0) exit(1); close(vhci_fd); vhci_fd = kVhciFd; struct vhci_vendor_pkt_request vendor_pkt_req = {HCI_VENDOR_PKT, HCI_PRIMARY}; if (write(vhci_fd, &vendor_pkt_req, sizeof(vendor_pkt_req)) != sizeof(vendor_pkt_req)) exit(1); struct vhci_pkt vhci_pkt; if (read(vhci_fd, &vhci_pkt, sizeof(vhci_pkt)) != sizeof(vhci_pkt)) exit(1); if (vhci_pkt.type == HCI_COMMAND_PKT && vhci_pkt.command_hdr.opcode == HCI_OP_RESET) { char response[1] = {0}; hci_send_event_cmd_complete(vhci_fd, HCI_OP_RESET, response, sizeof(response)); if (read(vhci_fd, &vhci_pkt, sizeof(vhci_pkt)) != sizeof(vhci_pkt)) exit(1); } if (vhci_pkt.type != HCI_VENDOR_PKT) exit(1); int dev_id = vhci_pkt.vendor_pkt.id; pthread_t th; if (pthread_create(&th, NULL, event_thread, NULL)) exit(1); int ret = ioctl(hci_sock, HCIDEVUP, dev_id); if (ret) { if (errno == ERFKILL) { rfkill_unblock_all(); ret = ioctl(hci_sock, HCIDEVUP, dev_id); } if (ret && errno != EALREADY) exit(1); } struct hci_dev_req dr = {0}; dr.dev_id = dev_id; dr.dev_opt = SCAN_PAGE; if (ioctl(hci_sock, HCISETSCAN, &dr)) exit(1); struct hci_ev_conn_request request; memset(&request, 0, sizeof(request)); memset(&request.bdaddr, 0xaa, 6); *(uint8_t*)&request.bdaddr.b[5] = 0x10; request.link_type = ACL_LINK; hci_send_event_packet(vhci_fd, HCI_EV_CONN_REQUEST, &request, sizeof(request)); struct hci_ev_conn_complete complete; memset(&complete, 0, sizeof(complete)); complete.status = 0; complete.handle = HCI_HANDLE_1; memset(&complete.bdaddr, 0xaa, 6); *(uint8_t*)&complete.bdaddr.b[5] = 0x10; complete.link_type = ACL_LINK; complete.encr_mode = 0; hci_send_event_packet(vhci_fd, HCI_EV_CONN_COMPLETE, &complete, sizeof(complete)); struct hci_ev_remote_features features; memset(&features, 0, sizeof(features)); features.status = 0; features.handle = HCI_HANDLE_1; hci_send_event_packet(vhci_fd, HCI_EV_REMOTE_FEATURES, &features, sizeof(features)); struct { struct hci_ev_le_meta le_meta; struct hci_ev_le_conn_complete le_conn; } le_conn; memset(&le_conn, 0, sizeof(le_conn)); le_conn.le_meta.subevent = HCI_EV_LE_CONN_COMPLETE; memset(&le_conn.le_conn.bdaddr, 0xaa, 6); *(uint8_t*)&le_conn.le_conn.bdaddr.b[5] = 0x11; le_conn.le_conn.role = 1; le_conn.le_conn.handle = HCI_HANDLE_2; hci_send_event_packet(vhci_fd, HCI_EV_LE_META, &le_conn, sizeof(le_conn)); pthread_join(th, NULL); close(hci_sock); } //% 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); initialize_vhci(); 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(); initialize_wifi_devices(); 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; } #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[2] = {0xffffffffffffffff, 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 31 00} (length 0x8) // } // flags: mount_flags = 0x8004 (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 { // init_itable: buffer: {69 6e 69 74 5f 69 74 61 62 6c 65} // (length 0xb) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // acl: buffer: {61 63 6c} (length 0x3) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // mb_optimize_scan: fs_opt["mb_optimize_scan", fmt[hex, // int32[0:1]]] { // name: buffer: {6d 62 5f 6f 70 74 69 6d 69 7a 65 5f 73 63 61 // 6e} (length 0x10) eq: const = 0x3d (1 bytes) val: int32 = // 0x1 (18 bytes) // } // } // 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 = 0x7b9 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x7b9) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x20000780, "ext4\000", 5)); NONFAILING(memcpy((void*)0x20000480, "./file1\000", 8)); NONFAILING(memcpy((void*)0x20000080, "init_itable", 11)); NONFAILING(*(uint8_t*)0x2000008b = 0x2c); NONFAILING(memcpy((void*)0x2000008c, "acl", 3)); NONFAILING(*(uint8_t*)0x2000008f = 0x2c); NONFAILING(memcpy((void*)0x20000090, "mb_optimize_scan", 16)); NONFAILING(*(uint8_t*)0x200000a0 = 0x3d); NONFAILING(sprintf((char*)0x200000a1, "0x%016llx", (long long)1)); NONFAILING(*(uint8_t*)0x200000b3 = 0x2c); NONFAILING(*(uint8_t*)0x200000b4 = 0); NONFAILING(memcpy( (void*)0x200007c0, "\x78\x9c\xec\xdd\xdf\x6b\x1c\xd5\x1e\x00\xf0\xef\x6c\x92\xe6\x47\x7b\x6f" "\x72\xe1\x72\xef\xed\x5b\xe0\x42\x6f\xa0\x74\x73\x53\x63\xab\xe0\x43\xc5" "\x07\x11\x2c\x14\xf4\xd9\x36\x6c\xb6\xa1\x66\x93\x2d\xd9\x4d\x69\x42\xc0" "\x16\x11\x7c\x11\x54\x7c\x10\xf4\xa5\xcf\xfe\xa8\x6f\xbe\xfa\x03\x7c\xd2" "\xff\xc2\x07\x69\xa9\x9a\x16\x2b\x3e\x48\x64\x76\x67\x93\x34\xd9\xcd\xaf" "\x26\xd9\x68\x3e\x1f\x98\xcc\x39\x33\xb3\x39\xe7\x3b\xe7\xcc\xcc\xd9\x9d" "\x61\x37\x80\x43\x6b\x30\xfd\x93\x8b\x38\x1e\x11\x6f\x27\x11\xfd\xd9\xf2" "\x24\x22\xba\x6a\xa9\xce\x88\x73\xf5\xed\x1e\x2e\x2e\xf4\x44\x44\x21\x89" "\xa5\xa5\x97\x7e\x4a\x6a\xdb\x3c\x58\x5c\x28\xc4\xaa\xd7\xa4\x8e\x66\x99" "\xff\x44\xc4\x57\x6f\x44\x9c\xcc\xad\x2f\xb7\x32\x37\x3f\x39\x56\x2a\x15" "\x67\xb2\xfc\x70\x75\xea\xea\x70\x65\x6e\xfe\xd4\x95\xa9\xb1\x89\xe2\x44" "\x71\xfa\xcc\xc8\xe8\xe8\xe9\xb3\x4f\x9e\x3d\xb3\x7b\xb1\xfe\xf2\xdd\xfc" "\xb1\xbb\xef\x3c\xff\xbf\x4f\xcf\xfd\xf6\xfa\xbf\x6f\xbf\xf5\x75\x12\xe7" "\xe2\x58\xb6\x6e\x75\x1c\xbb\x65\x30\x06\xb3\x7d\xd2\x95\xee\xc2\x47\x3c" "\xb7\xdb\x85\xb5\x59\xd2\xee\x0a\xb0\x23\xe9\xa1\xd9\x51\x3f\xca\xe3\x78" "\xf4\x47\x47\x2d\xd5\x42\xef\x7e\xd6\x0c\x00\xd8\x2b\xaf\x45\xc4\x12\x00" "\x70\xc8\x24\xae\xff\x00\x70\xc8\x34\x3e\x07\x78\xb0\xb8\x50\x68\x4c\xed" "\xfd\x44\x62\x7f\xdd\x7b\x36\x22\x7a\xea\xf1\x3f\xcc\xa6\xfa\x9a\xce\xec" "\x9e\x5d\x4f\xed\x3e\x68\xdf\x83\xe4\x91\x3b\x23\x49\x44\x0c\xec\x42\xf9" "\x83\x11\xf1\xe1\xe7\xaf\x9c\xe8\xc8\xf2\x69\x3d\xdc\x4b\x03\xf6\xc3\x8d" "\x9b\x11\x71\x69\x60\x70\xfd\xf9\x3f\x59\xf7\xcc\xc2\x76\xfd\x7f\xa3\x95" "\x4b\xdd\xb5\xd9\xe0\x9a\xc5\x87\xed\xfa\x03\xed\xf4\x45\x3a\xfe\x79\xaa" "\xd9\xf8\x2f\xb7\x3c\xfe\x89\x26\xe3\x9f\xee\xfa\xb1\xfb\xaf\xc7\x2d\x7f" "\xf3\xe3\x3f\x77\xe7\x71\xcb\xd8\x48\x3a\xfe\x7b\xa6\xfe\x6c\xdb\x9a\xf1" "\xdf\xf2\x43\x6b\x03\x1d\x59\xee\x6f\xb5\x31\x5f\x57\x72\xf9\x4a\xa9\x98" "\x9e\xdb\xfe\x1e\x11\x43\xd1\xd5\x9d\xe6\x47\x6a\x9b\x36\x1f\xb9\x0d\xdd" "\xff\xfd\x7e\xab\xf2\xb3\xf1\xdf\xc7\xe9\xf4\xf3\xbb\xaf\x7e\x94\x96\x9f" "\xce\x57\xb6\xc8\xdd\xe9\xec\x7e\xf4\x35\xe3\x63\xd5\xce\x6f\x1e\x37\xf0" "\xcc\xbd\x9b\xd1\x97\x25\xd7\xc4\x9f\x2c\xb7\x7f\xd2\x62\xfc\x7b\x61\x8b" "\x65\xbc\xf0\xf4\x9b\x1f\xb4\x5a\x97\xc6\x9f\xc6\xdb\x98\xd6\xc7\xbf\xb7" "\x96\x6e\x45\x9c\x68\xda\xfe\x2b\x6d\x99\x6c\xf8\x7c\xe2\x70\xad\x3b\x0c" "\x37\x3a\x45\x13\x9f\x7d\xff\x7e\x5f\xab\xf2\x57\xb7\x7f\x3a\xa5\xe5\xa7" "\xf3\xdd\x8f\xb4\xb9\x7b\x37\xa3\xd6\x01\x92\x64\x65\x1f\xd4\xd7\x2c\xc7" "\x3f\x90\xac\x7e\x5e\xb3\xb2\xfd\x32\xbe\xbd\xd5\xff\x65\xab\x75\x9b\xc7" "\xdf\xb4\xff\x8f\x1d\x49\x5e\xae\xa5\x8f\x64\xcb\xae\x8f\x55\xab\x33\x23" "\x11\x47\x92\x17\xd7\x2f\x3f\xbd\xf2\xda\x46\xbe\xb1\x7d\x1a\xff\xd0\x7f" "\x9b\x1f\xff\xf5\x62\x9b\xf7\xff\xf4\x3d\xe1\xa5\x2d\xc6\xdf\x79\xf7\xc7" "\x4f\x76\x1e\xff\xde\x4a\xe3\x1f\xdf\xb8\xff\xaf\x69\xff\x9e\x6c\xf1\xca" "\x92\xcd\x12\xb7\x1f\x4e\x76\xb4\x2a\x7f\x6b\xed\x3f\x5a\x4b\x0d\x65\x4b" "\xd2\xf6\xdf\x2c\xae\xad\xd4\x6b\x67\xbd\x19\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x2f\x17\x11\xc7\x22" "\xc9\xe5\x97\xd3\xb9\x5c\x3e\x5f\xff\x0d\xef\x7f\x46\x5f\xae\x54\xae\x54" "\x4f\x5e\x2e\xcf\x4e\x8f\x47\xed\xb7\xb2\x07\xa2\x2b\xd7\xf8\xaa\xcb\xfe" "\x55\xdf\x87\x3a\x92\x7d\x1f\x7e\x23\x7f\x7a\x4d\xfe\x89\x88\xf8\x47\x44" "\xbc\xd7\xdd\x5b\xcb\xe7\x0b\xe5\xd2\x78\xbb\x83\x07\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x80\xcc\xd1\x16\xbf\xff\x9f\xfa\xa1\xbb\xdd" "\xb5\x03\x00\xf6\x4c\x4f\xbb\x2b\x00\x00\xec\x3b\xd7\x7f\x00\x38\x7c\xb6" "\x77\xfd\xef\xdd\xb3\x7a\x00\x00\xfb\xc7\xfb\x7f\x00\x38\x7c\xb6\x7c\xfd" "\xbf\xb4\xb7\xf5\x00\x00\xf6\x8f\xf7\xff\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\xec\xb1\x0b\xe7\xcf\xa7\xd3\xd2\xaf\x8b\x0b" "\x85\x34\x3f\x7e\x6d\x6e\x76\xb2\x7c\xed\xd4\x78\xb1\x32\x99\x9f\x9a\x2d" "\xe4\x0b\xe5\x99\xab\xf9\x89\x72\x79\xa2\x54\xcc\x17\xca\x53\x2d\xff\xd1" "\x8d\xfa\xac\x54\x2e\x5f\x1d\x8d\xe9\xd9\xeb\xc3\xd5\x62\xa5\x3a\x5c\x99" "\x9b\xbf\x38\x55\x9e\x9d\xae\x5e\xbc\x32\x35\x36\x51\xbc\x58\xec\xda\xb7" "\xc8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\xeb\x2a\x73" "\xf3\x93\x63\xa5\x52\x71\xe6\x2f\x91\xb8\xb1\x12\xd8\x2e\xff\xe7\xde\xb6" "\xc6\xd5\x77\x30\x76\xef\xaa\x44\x67\x1c\x88\x6a\x1c\xe8\x44\x77\x1c\x88" "\x6a\xec\x30\xb1\xfa\x2c\xd1\xdb\x86\x33\x13\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xc0\x9f\xc3\x1f\x01\x00\x00\xff\xff\x78\x58\x17\x62", 1977)); NONFAILING(syz_mount_image(/*fs=*/0x20000780, /*dir=*/0x20000480, /*flags=MS_SILENT|MS_NODEV*/ 0x8004, /*opts=*/0x20000080, /*chdir=*/1, /*size=*/0x7b9, /*img=*/0x200007c0)); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x42 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x20000040, "./file1\000", 8)); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul, /*flags=O_CREAT|O_RDWR*/ 0x42, /*mode=*/0); if (res != -1) r[0] = res; // 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*)0x20000180, "/dev/loop", 9)); NONFAILING(*(uint8_t*)0x20000189 = 0x30); NONFAILING(*(uint8_t*)0x2000018a = 0); syscall(__NR_quotactl, /*cmd=Q_QUOTAON_GRP*/ 0xffffffff80000201ul, /*special=*/0x20000180ul, /*id=*/(intptr_t)-1, /*addr=*/0ul); // mprotect arguments: [ // addr: VMA[0x3000] // len: len = 0x3000 (8 bytes) // prot: mmap_prot = 0x9 (8 bytes) // ] syscall(__NR_mprotect, /*addr=*/0x20000000ul, /*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*)0x20000180, "hugetlb.1GB.usage_in_bytes\000", 27)); res = syscall(__NR_openat, /*fd=*/(intptr_t)-1, /*file=*/0x20000180ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[1] = 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=*/0x20000000ul, /*len=*/0xb36000ul, /*prot=PROT_SEM|PROT_WRITE*/ 0xaul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[1], /*offset=*/0ul); // syz_mount_image$vfat arguments: [ // fs: ptr[in, buffer] { // buffer: {76 66 61 74 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // flags: mount_flags = 0x280008a (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {61 6c 6c 6f 77 5f 75 74 69 6d 65 3d 30 30 30 30 // 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 31 2c 73 68 // 6f 72 74 6e 61 6d 65 3d 77 69 6e 39 35 2c 73 68 6f 72 74 6e 61 6d // 65 3d 77 69 6e 6e 74 2c 69 6f 63 68 61 72 73 65 74 3d 64 65 66 61 // 75 6c 74 2c 75 6e 69 5f 78 6c 61 74 65 3d 30 2c 6e 6f 6e 75 6d 74 // 61 69 6c 3d 30 2c 75 74 66 38 3d 30 2c 66 6c 75 73 68 2c 72 6f 64 // 69 72 2c 72 6f 64 69 72 2c 73 68 6f 72 74 6e 61 6d 65 3d 77 69 6e // 6e 74 2c 73 68 6f 72 74 6e 61 6d 65 3d 6c 6f 77 65 72 2c 63 68 65 // 63 6b 3d 73 74 72 69 63 74 2c 75 6e 69 5f 78 6c 61 74 65 3d 30 2c // 75 74 66 38 3d 30 2c 73 68 6f 72 74 6e 61 6d 65 3d 6d 69 78 65 64 // 2c 75 6e 69 5f 78 6c 61 74 65 3d 31 2c 73 68 6f 72 74 6e 61 6d 65 // 3d 77 69 6e 6e 74 2c 00 17 62 a0 7a 91 5c 8f 6c 33 78 b9 24 fc 25 // 0b da e4 5c d2 2b b3 3f 29 d7 2c f1 c8 41 0d f8 8b 83 b9 71 0b 49 // 37 4a 74 84 55 71 8c c4 af 5f 3c ed 9a a1 06 32 d5 95 e9 c8 c3 a8 // 9f 41 b6 50 b9 eb d4 88 6a e6 5b f0 2b 7c 8e a4 e7 6e f2 cc 24 1a // c9 f8 9f 27 53 df 98 db 0b a9 55 8c 75 33 63 f2 96 42 4e c6 0e 70 // 3f ac 2d b7 e9 f3 12 83 85 2e 11 5c f6 ac b8 d7 7b 3e 5d 68} // (length 0x16e) // } // union ANYUNION { // ANYRES64: ANYRES64 (resource) // } // union ANYUNION { // ANYRESDEC: ANYRES64 (resource) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // union ANYUNION { // ANYRESDEC: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {b1 1f 64 d5 df 01 9c e5 66 87 e4 95 34 e7 11 37 // 51 91 45 85 b4 fa 64 ff 92 10 e4 c4 93 00 ba 69 db eb 26 fe a1 eb // 67 d4 60 88 0e c2 73 18 33 f2 f5 9b 96 be eb 52 61 54 c4 cb 86 8f // 2e 6c 29 e1 1d 08 6e d7 6e 8b cf f2 c2 a2 37 a3 09 17 90 40 a2 35 // 17 4a 4c 3b 4c 50 51 38 a2 3e 44 77 5e 34 47 5f 1a 12 34 26 82 2c // 8b 44 e1 26 81 1b 24 8f 98 24 4c 42 1b 92 28 4e f4 da 2b 58 d9 45 // 56 e8 8a 09 f8 1c fe 90 29 0f cf eb ec 46 38 d0 09 09 96 d0 df 8f // d1 66 82 a2 ba 62 12 81 1f ab a7 24 83 d9 82 35 90 6b 48 e1 d4 6b // 4d c6 25 5f 7e b6 b5 85 1b 98 1a f6 5e e9 48 52 fe d6 6b f6 2a 34 // 56 57 f8 cb a9 58 c9 cf 4a b1 ce d6 02 46 54 8d a6 d5 9f 33 c2 f8 // 72 98 37 39 78 33 a7 3d bd cd f0 0a 75 7a 06 d3 40 a3 54 f9 95 42 // 8e 0d f7 e1 10 a8 21 74 1b 80 97 6d 61 1f ac 66 5a 21 fb 85 b8 a4 // c1 a5 4e f1 12 25 99 5c 90 0e ae 4f a4 ae 7f 25 8b af 41 98 33 6b // c6 0d d8 5f ac 75 f6 e9 af 06 8d df 48 1b 62 20 55 a2 a5 98 84 da // cb 65 7d 2c 44 66 78 6d 95 1d 58 da 4c 9c 1c 32 18 db 70 de 2b c1 // 67 f2 c1 31 f7 01 d8 63 40 e4 28 14 81 f8 b9 3d 61 08 26 cd c6 b1 // e2 bc e5 ab 2a 4e 33 70 26 17 2b 16 b6 8a b6 d4 a1 b8 ad dd 32 27 // be 62 ee 36 58 5a 2d 44 b1 05 12 a7 06 c6 26 87 98 dd 36 4e 34 f3 // 9a f0 cf ed 65 9b 20 71 07 4d 9a 8e 23 ba 1a 00 11 8d a7 ba 14 00 // a3 97 a5 20 75 b2 51 7b 2a ec e0 f9 ee b7 a0 9b d8 14 57 e9 38 ad // 64 b0 5e 21 95 33 05 98 5c 5e 89 ec b7 89 d8 81 bb a2 21 08 c0 02 // a5 ad e6 f6 90 f5 6e 69 df 8b d8 bd 8b 0a 4d ed a1 43 e5 5d 62 81 // 6e 66 b5 2a 2a 05 63 9a fe 4c 56 68 3b 69 59 a6 34 d7 de 4a 59 81 // 79 13 31 09 b3 9a eb 02 c0 f9 09 ef 2b 23 fe 93 32 c9 6d 86 c5 8b // 6e b1 ba 47 00 a3 e3 df 44 5a 66 e5 17 87 fa 6a 0c a7 30 ef 60 b6 // da e4 92 01 5e 43 2e b0 7f fc 6d 0f 9a ac 00 34 db 02 4d ca 90 88 // a3 cc d3 5f 56 36 09 85 89 1b f5 af 6e d3 8a cc bb 75 4f e8 b1 bb // 63 0e 82 fc 81 a5 da 65 77 7e 4e 95 57 90 bb 4d e2 8d d4 da 33 e5 // cd 98 3f fe ed 8d 54 ab 46 17 a4 f7 e3 7c e0 79 f5 db 12 90 16 48 // 9b 9b 99 34 b9 67 47 0e 13 e5 61 90 21 bf 2e 8e cd bf c8 86 c0 39 // b8 1b 22 2f 9b 21 a1 95 48 5f bb 56 7c 93 08 49 52 24 55 08 66 92 // 46 ea f2 d4 2f de 5e 1e 18 33 d7 47 56 8c fd 9e b7 77 3d 32 31 90 // f6 e5 13 36 49 9e 48 52 bf 99 d7 e1 4e 21 78 e6 bf de 79 ae 7c 4f // ad 24 c3 d7 35 49 57 b4 dd d0 06 c0 3b e7 dd f9 73 d8 a8 d6 4d b5 // 19 1c d8 8d 89 1e 2d 6b 8b 04 36 94 ba fc 6b e5 3d b8 af 68 e9 5a // 14 01 ca b8 b1 60 7f ea ed c2 f5 06 75 00 60 10 61 3f af be 74 47 // bb 18 89 91 b2 b6 d8 c4 62 da a7 e5 7c 56 fa db ab ed b2 2f b4 61 // 39 c8 40 0f ed 84 7d 06 8c 7a 17 55 fa d0 db 65 e9 f8 2f 14 4c 57 // 7a f1 3e 50 7c 53 9e d1 2c f7 c5 68 a2 e5 43 01 66 99 c3 16 23 8a // 53 22 39 1d 94 fb 4f 0c dc 5f 93 3a a1 43 4a 28 56 8a a3 e7 f1 e7 // 9e 69 9c 86 3b 53 00 bf 94 0f 30 73 6a b4 9a 2c 0a f2 8c 9b e0 93 // 83 6e 58 3e f7 75 b1 6c eb 40 33 1d 0f 84 cc c4 3b 57 4c d9 fd b6 // dc 86 68 19 5b e4 b9 d8 15 28 f9 4e f0 02 14 63 c7 3f 61 94 b9 bd // 78 30 5e d4 1d 0f 46 c8 9a 6c b7 b9 86 12 9b 43 ca 43 82 0b b8 7c // a3 29 b4 6d 02 f3 06 d3 49 a3 c2 46 5e 08 00 36 88 17 f3 05 25 ff // 27 8b 8e c5 a4 a0 35 15 2d e4 72 f8 ca cf 39 26 a2 42 6b 26 31 43 // 35 77 88 97 93 c3 d7 5f 42 c1 d6 ed 8e 2d b5 d3 8b 00 b7 88 10 e5 // e8 4b df 2b 70 4f 03 c2 6e 6b ea 03 65 15 11 de 0b 83 f6 fa 9e d1 // 5f ea fd 18 c8 87 40 30 e9 dc 21 49 94 57 64 bf ba f3 d0 15 4f 5c // e1 d2 98 36 f7 ff 1d 56 a5 1e 26 a2 90 5b ea 32 31 b7 7f 7b f0 f8 // 1d 31 cd 24 61 88 ba 81 2f 58 3b 97 d2 f6 66 cf db df 92 b0 6a 62 // de 4d f0 92 bc c2 aa 56 53 c1 a9 ff a9 03 ac 0a 53 dc 02 76 1a e5 // 9e b0 0e 6e 12 9e 51 fe 8e cf 59 fc 3d 16 38 92 c0 f2 52 5f 23 ea // b0 07 3b a5 9f 8d cf bc 95 d0 38 e9 c6 9a 41 84 cb 41 77 3d a3 98 // 9f c2 74 aa 2b d6 a6 b9 2b 2c 6f 1a d4 bf f2 3b d4 96 ce d3 b4 67 // 80 62 f8 1f d0 1c e1 9c 4b 4c 0a 91 b9 eb a7 85 c7 87 fa 0b 64 cc // 29 3f 3b ad c0 63 84 ad 58 b5 b9 cb b6 9d 8e 9f 08 02 0b 0a 54 71 // ed 62 c7 aa d7 21 93 f3 be ef 12 4e ff 5d bb 58 44 c8 05 14 8d 12 // 2f f5 7d 1f d6 73 70 83 67 8a 7f ee 29 d9 ad ca 33 71 a0 34 0b a7 // 61 8d 1b e2 8c b4 26 c8 5d 25 7d 11 bc 66 34 17 f8 b8 0a 32 55 25 // af e8 bf 5a a4 6e e0 5e af d9 98 7a 68 76 ab 04 08 1e 26 78 fe 71 // 27 6a 7f f6 db ad 0e c3 34 8a a9 e5 ec 11 1c f6 e4 2f 3d 53 0d 1c // 60 21 c7 ec b3 ea 61 2d b0 cc 99 b7 7f 76 89 85 39 e0 b8 bb 81 bf // b9 5b d6 50 e0 f3 c1 cc a1 8e 0c 65 d9 78 db 33 e7 06 78 81 c3 0b // dd 54 f0 cf 32 fd 51 c5 d2 50 e0 c3 cf 4b 67 92 0d 7c 53 d6 03 c9 // 90 50 e8 bb c3 2d c4 0d e2 e0 1c 88 fc 19 7e 0d 0c 12 24 d6 ba f3 // 92 07 ed 6d 26 bb 3e 0a 31 63 d9 97 34 7e f9 e0 d6 bf 27 be 26 b0 // 1e 85 75 75 da 18 fc 0b f1 24 49 ea 06 6f 86 7d 22 87 a0 0a 50 4e // fb d8 f8 31 3b 94 38 6f bf b5 da 1c 40 43 d1 dc eb 50 2a 6a 37 a1 // de c2 bd 17 87 d7 cf 90 c9 39 3b c4 61 b4 a8 fc 0c 1a d4 cb 26 14 // 86 b4 a6 35 cb 19 77 55 52 90 89 37 dd 4e a4 ce 58 85 9a c6 b6 c3 // 46 65 83 b9 83 3b 78 d5 eb e3 98 d3 5f 30 dd db 35 5f 19 84 e4 06 // 09 f7 5d 57 c0 0b 69 de 3d a2 ee e5 59 cc fa 6e 23 54 79 ce 90 95 // 5a 1e fc d2 ee 60 9f a0 b4 93 91 b0 39 10 24 96 5a c8 4d 81 44 2e // d3 f2 e3 73 5c f2 27 99 1c 18 a9 d7 d2 9b 36 40 59 21 1c 9d 79 ee // e2 74 89 9f f6 c9 99 8d 43 af 56 74 21 40 dd bf e4 6a 16 4c 96 c2 // 55 fc 7c 7b 5d dc 40 7e ff ad 69 3f 2b 14 d0 e9 fc ca 50 fd 19 75 // 6a 8d 34 9d d8 3d 08 35 81 0f cb d8 b3 e0 5f 92 32 44 69 d7 0a 2b // 72 ba a4 df 09 8a a6 95 d3 24 b8 57 d0 04 08 2e 9c ee 26 83 ee 88 // 40 a2 df 7f c3 d4 c9 7a 8c 21 fc 8f 5b 78 c9 0a 79 04 c3 9b e8 95 // 3e df 7a 60 9d d8 9d 11 41 4e 37 1c 1c ec 9b 74 14 5f 42 a9 d8 d6 // 14 09 c6 b2 ea 6c ee 03 e2 55 ff 60 af 27 99 43 3a f4 10 e2 7d 8c // e1 17 17 e0 d9 c6 06 fa ab 54 88 5a 9c 4c 7b 6f 74 22 ac 6b d3 28 // 9b ae 60 11 70 42 4b 7d 4b 40 71 e8 86 ac 7b b4 82 ab 46 1c 80 b7 // e5 97 a6 ec fc a8 24 ec 09 14 02 b2 c8 ad 6d 30 89 15 c4 81 d8 18 // bc 0c bc 23 b1 34 26 d5 5e 5f 32 8a e5 1d 56 1c c0 8b 07 02 34 a1 // 9b a4 85 83 a1 fa 4b 78 9f 73 27 ef 1a be 80 42 7b a9 cc d0 9f 2f // c1 b4 52 16 87 51 b4 72 a6 ec a6 de c4 a5 b2 59 e8 e7 1e 37 d3 d1 // 19 76 39 4d e0 c2 50 9e e1 7c 75 7a ed 85 47 bf 75 da 5b 78 03 60 // 9e 7a cf e8 dc 6c f3 fd a4 a7 e1 42 ba 39 5f cf 21 34 fa 2c 05 64 // ad f8 49 b1 bb f2 5c 43 0c 2a 75 26 9f c2 e6 7c e6 b3 17 79 24 72 // 93 14 94 75 66 01 b6 d5 8f b8 24 a3 8b a0 28 b9 4a bf 1e 4d 55 2e // c9 a9 cd 49 4f 2a 2d f5 12 91 b5 7d 29 2d 29 85 cc 04 7b fc 2a fe // cc b8 fc 10 79 c1 b7 e5 e9 38 e0 81 a6 7d 73 db 70 09 10 3d 6b e1 // 8b 72 da 6e 72 09 c2 54 4c 09 d6 3e 91 f8 4c 7c 70 85 6c 85 65 8e // 70 c5 5a 7b 91 33 e8 f6 af 3b b9 b1 60 6b 1a 44 af 87 d4 a9 57 46 // 62 56 d0 c3 ef 18 f9 6c 07 10 01 de 8e da 6a e1 04 90 ec d1 42 91 // e6 a9 f4 ea ca 6c 7e e4 32 90 d7 e3 37 37 e9 cc 0a 29 79 aa df 38 // ad e0 53 9d da ab d1 8c 27 35 6b 3c 47 e7 60 cf 31 22 af 9f c4 05 // a2 18 15 da d9 aa ab d5 8e da 38 36 1c 90 49 11 c9 66 f7 10 bd 02 // 48 a0 3e 41 b4 18 a6 f7 25 92 44 c9 e3 3a e0 4d 71 d0 dc 14 1b a1 // 19 d9 70 ae ea 80 0f 5d 28 ec fb 14 16 af 5e d7 70 01 9a 08 db d7 // 51 09 a7 f4 d0 30 6d 5f 85 ca 96 c3 9f 9d 66 e5 e3 02 f4 0f b4 e2 // 71 3d f1 07 f3 f5 38 09 dc a9 60 2a 38 bb fe 32 51 ec 95 65 22 8a // 4e 92 f9 75 d4 ef 37 51 f8 19 a7 e7 be ba b7 61 93 ea cf be b2 ab // 3d f4 5d 80 e5 db 8e 5d 43 35 8f 06 3c eb 7b 5c c4 f2 c3 87 17 79 // a2 2b 33 41 0d 18 6c 07 d0 b1 f5 c9 f7 b2 ac a2 d3 0f dd 9f b9 1e // 19 48 0c cb fe 35 90 df 92 34 60 42 11 cf 12 63 56 4c 14 57 c3 a1 // b9 52 61 cb 73 70 1d 6b a5 a5 ff a9 9a 03 21 c0 1f f2 7c f0 e1 71 // 2f 69 42 b3 b7 86 14 7c 85 f6 8b 72 77 ab 84 96 c5 0c 56 de dd e2 // 8b 72 27 a7 76 f5 1a 53 5a 5a 4b 26 c6 75 5a 32 9e 97 77 b7 ba 92 // 27 d1 b7 b8 cf 2a 53 47 b1 e8 35 96 92 bf 41 52 c2 8a 82 5c 23 25 // a5 4b c4 92 13 65 40 46 17 0d 22 17 5a 70 24 63 1a d7 c7 6a 9f 41 // 9a 13 d7 57 ed 33 30 db 2c 20 dc a4 50 85 25 95 e1 ca e7 47 8c b6 // 22 85 c6 8b bf 1b 4a 57 80 1d d9 46 23 92 e4 bf 75 0c 1c 4a 36 46 // 8a 0d c4 a7 a8 a7 68 9c ca 90 74 c4 d9 0d 6c 72 56 bc 6b b1 c8 1a // 37 73 ac 3e 72 dd 25 97 64 a9 0b fc d6 73 69 07 39 d4 86 9a e5 62 // 62 98 a4 4d 24 2e 8e d4 e0 37 21 63 e4 93 d4 d8 0e ff 28 ec 4a 48 // 16 f1 82 63 b5 aa 04 fd 2c ba a4 58 b3 a0 2c 00 7d 36 b3 ac 9e 86 // 6b d1 45 5e b0 06 58 03 de 38 96 61 f9 c7 de 5e 28 e2 5e 8e 37 23 // 61 c8 e0 80 7a 3d dc 8f a6 35 4f 8c ca 40 28 1a 7c 1f 66 b7 8f 83 // 3c 02 41 c5 70 f0 cc 52 7a 40 a7 ad 95 42 f9 ef eb f8 00 4d c6 c4 // b4 5a d4 56 04 a3 5b 4e 68 f8 f7 8d 36 e7 bb 74 ce ec 8e 34 1d 75 // b1 14 e4 fe 03 92 fb 69 19 fc 7a 0f fe 31 80 24 0b a1 01 2e 03 9a // cf 43 31 50 65 ed 3e 27 b6 92 1c 06 24 fa 0e 35 30 e1 7a a1 fc 8d // 00 fc 46 51 0f b1 37 a9 6b 14 be b6 8f 9b 14 84 79 06 cc ad 31 77 // ba 90 d1 28 b1 47 17 be d9 d1 25 8b 91 61 33 5f 31 5a c8 85 1c b1 // 6d 1d f6 92 9d 65 5c 00 ac 82 1d 82 a9 f0 47 a7 de 7e a8 1a bb ff // 9f b1 3c 39 f6 4c fe 39 ea 14 88 c8 e0 8b b6 95 46 4e 2a 1b 5a ff // 5f 65 1b 50 84 e5 71 56 63 fd a0 7f 24 75 37 36 c8 b1 67 8e c2 6a // 5d 6a 9c ae 9c 8f d1 2d 4b 0b 00 37 45 27 e7 f5 05 20 af dd 61 90 // 4a 8d 2a b6 f2 b2 de f0 73 00 36 68 e8 ff 99 52 78 b2 27 ce b2 f2 // e1 85 45 e6 9c 15 f0 cb 0e 30 87 93 2b b8 31 3a 0f 8b 11 dd e9 0e // 76 b7 20 b9 0a e2 13 53 76 ff 8a 59 3e 12 1b 00 93 88 58 13 b5 65 // f4 ef b8 e3 ab ad ef 9a d4 91 fa 8e 75 1d ec 67 19 66 2e 88 6c c9 // 1b 1c b6 df bc a0 97 73 c2 c5 6b a7 a0 bd e4 5d 35 8d 6c 98 7a a4 // d7 80 cd a5 a5 23 ee 22 8c 4c 34 12 c1 95 57 80 db 6d 18 31 83 aa // f1 9a a7 a7 8c fe 37 c2 99 57 da 23 34 9b 23 5f 50 e1 09 d8 09 e9 // f6 5f ab 3f 7c 27 e0 cf 0f 31 47 8b ba d9 18 cf 76 a8 fb 79 d2 42 // 4a 68 f6 c3 19 0a d8 de 3c ef 79 1a b7 43 b1 21 92 c0 e7 5d c8 c1 // fd 6a be 38 ef cc 7d d5 d6 67 1c db 7b 91 60 d5 90 d7 48 b9 a3 0c // ac 92 3a 97 d3 4f b0 3b c9 46 ad a8 06 a6 6b 38 e1 23 18 eb d6 a5 // 93 11 7c eb 43 4c 4d 38 77 79 b5 d2 f4 27 9d 96 d5 f3 b2 68 d3 10 // b7 5b ba de 2d 1c 4f b8 4c b5 3f f3 d0 2a 25 8b 2f e6 dd 5b 00 4c // a9 a5 4f 4f 26 91 d6 ec c7 67 20 2b 49 ff ad 94 18 32 5f 16 67 0b // ef 52 9e f4 1f e5 b6 f8 0d 9f a3 6b 02 21 d3 95 b7 2b a9 8e 56 6b // cc c0 58 47 28 85 14 32 9c a7 9b 57 6a 16 7e 35 f8 84 98 53 91 53 // 56 83 c8 13 2e 0c e6 94 ab 79 aa ee 03 1d 69 78 f3 3d 02 47 36 47 // f3 33 ea 00 ce 95 b2 f7 c3 3d 37 5c 28 e1 25 30 e8 fd 3c 00 64 3b // d5 fe 2e 71 b0 11 20 6e a2 f1 e8 6e 6c 40 59 0c 18 9d fa 35 72 9d // 93 1b ec 87 c8 c5 4d d8 d6 84 94 c8 b5 2d 3b c4 ce 13 c3 43 f5 d4 // d5 93 de 75 da 7c 9d de e4 4b 97 f9 5e e9 4e 09 2e a2 dc b8 42 6d // d5 ce 27 b6 bb f6 93 f9 a2 77 0b ba c5 ef c8 c3 27 e5 18 53 85 e6 // a5 1e 8c 20 73 5c 3e 1d 13 79 40 6b 0e 8d df 81 63 7a 8e c4 66 df // 78 90 c3 72 84 4b 4a 08 ff 5b 96 99 9d b0 69 44 ca 15 df 12 d2 a1 // a9 ba 19 7f e4 f9 0f b1 8e 5f 76 75 dd cd cd 8c f1 43 01 3d 2d ba // 3e ae 53 0f 72 94 f1 46 9b d3 c0 a9 4e 86 f6 f1 3c 4b 4c 92 81 ad // fc 4e 13 3d a8 97 4c 30 bd 57 e1 61 5e 7c 4f 52 a7 aa 2e 75 98 4d // 2c d3 cd fd 53 90 84 5c 8b 7c 9d b9 d7 72 13 3f e9 8e 59 79 48 dd // 17 b4 9e e1 84 32 a5 0a 05 7e 51 7b 05 0f 92 2b 7b 48 8e 9a ba 11 // 4e f1 0b 1e f5 34 82 46 d3 04 11 d3 0e 44 4d d3 b0 ce 1f 4a b0 9f // e0 b0 89 26 0f 58 00 f8 c3 2e 12 e3 d7 a4 00 d9 52 4e 9e d8 08 40 // d2 53 9a 8d bb e7 9c 8b 04 c1 a3 59 50 e3 e1 04 b8 92 25 2c 3b 78 // f2 a6 6b 6f d1 a8 a0 2b 61 41 2b 59 1a b1 fc 6b 83 89 6e 85 1c eb // 36 82 1c f0 37 34 38 1d db ed ff ab 60 ac 91 3b a1 2f 76 43 7c 5e // 47 a3 e7 5c 81 3c b3 d5 c8 ae f6 95 0a 6a bc e9 5d 8f a0 20 3b 1e // bf 26 0d 1e 53 a6 93 dd 88 74 09 96 b5 cf b4 41 cc 19 66 6f 77 da // a0 e3 5e 82 58 90 33 65 62 91 18 e2 40 e2 63 cd ea 7d 2c f4 4b b4 // 34 e9 67 6d d4 61 13 be 92 86 68 f7 1c 1e 26 2c dd 6e 22 70 e4 17 // cd a3 99 43 f1 b7 ca 63 d0 14 39 ea e3 3b a8 c9 1b 00 a3 2f 99 d5 // f6 05 25 9c d1 cc 0c 6d 41 de 3b a0 0d 0a ec 3e 3a b9 98 ed 71 23 // 28 52 32 b9 b8 7f 04 77 c4 f4 10 9e 2d 2d d7 f4 59 2c 0f 28 68 cc // 77 b3 57 c4 47 3c 2e d2 44 ad 07 72 2a e5 87 20 3b f2 ea c8 cc 1b // e3 f0 3e b2 f0 f2 e0 68 ca 89 3e e0 92 db 18 59 3f ec b4 26 16 73 // 4c 9b 30 bc 65 1c 0d 01 c5 6b a7 2b e0 12 6a 65 9e 32 ce 8a ee fb // 5c 8b f2 bb af 8f a4 2e b6 f5 ee a1 b6 c5 dc 8b 2b 2f d7 dd 50 de // ef 33 c8 ac 6a 94 b6 04 e8 72 83 81 2b 0d 32 66 8f 8b ff 20 19 03 // 9d 79 a9 0d 6f d0 4f 95 fc 42 d8 59 f9 14 58 a0 5d 90 74 44 6e e0 // ee 50 b2 13 bc dc e4 0a 31 83 69 03 f2 29 39 72 52 62 f0 a7 74 9a // 1b 4b 3b 2a 02 b4 78 a6 7c 7d 9b a0 f0 2e 5e 5b 1b 1d 88 ac db e3 // 5a 6f 88 b0 6d f4 b8 73 9a 4d 3d ec 53 79 80 9f de 06 e2 a6 14 2f // 98 67 97 ec fc 01 f2 48 92 5b 68 00 23 6a 48 8e d5 55 60 84 f3 e2 // 97 3f 62 b9 b1 0d 73 63 eb d6 17 f7 3d 7b 86 25 ed 26 d8 4b 52 9c // 6a 63 b4 18 86 65 79 63 67 29 90 5f 74 f7 2e 58 87 36 89 01 e4 c8 // 01 97 9e a8 b2 06 19 a5 17 c3 46 d8 71 44 8a 42 10 ec 45 54 a2 e7 // 3d 68 81 99 6e 39 1a 73 c5 12 66 d7 00 1d c6 ad 65 1e 1a c2 3c 1d // 57 b6 12 17 5f c7 65 ff 02 a6} (length 0x1000) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // } // } // chdir: int8 = 0x16 (1 bytes) // size: len = 0x2b4 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x2b4) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x20000100, "vfat\000", 5)); NONFAILING(memcpy((void*)0x20000000, "./bus\000", 6)); NONFAILING(memcpy( (void*)0x20002140, "\x61\x6c\x6c\x6f\x77\x5f\x75\x74\x69\x6d\x65\x3d\x30\x30\x30\x30\x30\x30" "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31\x2c" "\x73\x68\x6f\x72\x74\x6e\x61\x6d\x65\x3d\x77\x69\x6e\x39\x35\x2c\x73\x68" "\x6f\x72\x74\x6e\x61\x6d\x65\x3d\x77\x69\x6e\x6e\x74\x2c\x69\x6f\x63\x68" "\x61\x72\x73\x65\x74\x3d\x64\x65\x66\x61\x75\x6c\x74\x2c\x75\x6e\x69\x5f" "\x78\x6c\x61\x74\x65\x3d\x30\x2c\x6e\x6f\x6e\x75\x6d\x74\x61\x69\x6c\x3d" "\x30\x2c\x75\x74\x66\x38\x3d\x30\x2c\x66\x6c\x75\x73\x68\x2c\x72\x6f\x64" "\x69\x72\x2c\x72\x6f\x64\x69\x72\x2c\x73\x68\x6f\x72\x74\x6e\x61\x6d\x65" "\x3d\x77\x69\x6e\x6e\x74\x2c\x73\x68\x6f\x72\x74\x6e\x61\x6d\x65\x3d\x6c" "\x6f\x77\x65\x72\x2c\x63\x68\x65\x63\x6b\x3d\x73\x74\x72\x69\x63\x74\x2c" "\x75\x6e\x69\x5f\x78\x6c\x61\x74\x65\x3d\x30\x2c\x75\x74\x66\x38\x3d\x30" "\x2c\x73\x68\x6f\x72\x74\x6e\x61\x6d\x65\x3d\x6d\x69\x78\x65\x64\x2c\x75" "\x6e\x69\x5f\x78\x6c\x61\x74\x65\x3d\x31\x2c\x73\x68\x6f\x72\x74\x6e\x61" "\x6d\x65\x3d\x77\x69\x6e\x6e\x74\x2c\x00\x17\x62\xa0\x7a\x91\x5c\x8f\x6c" "\x33\x78\xb9\x24\xfc\x25\x0b\xda\xe4\x5c\xd2\x2b\xb3\x3f\x29\xd7\x2c\xf1" "\xc8\x41\x0d\xf8\x8b\x83\xb9\x71\x0b\x49\x37\x4a\x74\x84\x55\x71\x8c\xc4" "\xaf\x5f\x3c\xed\x9a\xa1\x06\x32\xd5\x95\xe9\xc8\xc3\xa8\x9f\x41\xb6\x50" "\xb9\xeb\xd4\x88\x6a\xe6\x5b\xf0\x2b\x7c\x8e\xa4\xe7\x6e\xf2\xcc\x24\x1a" "\xc9\xf8\x9f\x27\x53\xdf\x98\xdb\x0b\xa9\x55\x8c\x75\x33\x63\xf2\x96\x42" "\x4e\xc6\x0e\x70\x3f\xac\x2d\xb7\xe9\xf3\x12\x83\x85\x2e\x11\x5c\xf6\xac" "\xb8\xd7\x7b\x3e\x5d\x68", 366)); NONFAILING(*(uint64_t*)0x200022ae = r[0]); NONFAILING(sprintf((char*)0x200022b6, "%020llu", (long long)0)); NONFAILING(sprintf((char*)0x200022ca, "%023llo", (long long)-1)); NONFAILING(sprintf((char*)0x200022e1, "%020llu", (long long)-1)); NONFAILING(memcpy( (void*)0x200022f5, "\xb1\x1f\x64\xd5\xdf\x01\x9c\xe5\x66\x87\xe4\x95\x34\xe7\x11\x37\x51\x91" "\x45\x85\xb4\xfa\x64\xff\x92\x10\xe4\xc4\x93\x00\xba\x69\xdb\xeb\x26\xfe" "\xa1\xeb\x67\xd4\x60\x88\x0e\xc2\x73\x18\x33\xf2\xf5\x9b\x96\xbe\xeb\x52" "\x61\x54\xc4\xcb\x86\x8f\x2e\x6c\x29\xe1\x1d\x08\x6e\xd7\x6e\x8b\xcf\xf2" "\xc2\xa2\x37\xa3\x09\x17\x90\x40\xa2\x35\x17\x4a\x4c\x3b\x4c\x50\x51\x38" "\xa2\x3e\x44\x77\x5e\x34\x47\x5f\x1a\x12\x34\x26\x82\x2c\x8b\x44\xe1\x26" "\x81\x1b\x24\x8f\x98\x24\x4c\x42\x1b\x92\x28\x4e\xf4\xda\x2b\x58\xd9\x45" "\x56\xe8\x8a\x09\xf8\x1c\xfe\x90\x29\x0f\xcf\xeb\xec\x46\x38\xd0\x09\x09" "\x96\xd0\xdf\x8f\xd1\x66\x82\xa2\xba\x62\x12\x81\x1f\xab\xa7\x24\x83\xd9" "\x82\x35\x90\x6b\x48\xe1\xd4\x6b\x4d\xc6\x25\x5f\x7e\xb6\xb5\x85\x1b\x98" "\x1a\xf6\x5e\xe9\x48\x52\xfe\xd6\x6b\xf6\x2a\x34\x56\x57\xf8\xcb\xa9\x58" "\xc9\xcf\x4a\xb1\xce\xd6\x02\x46\x54\x8d\xa6\xd5\x9f\x33\xc2\xf8\x72\x98" "\x37\x39\x78\x33\xa7\x3d\xbd\xcd\xf0\x0a\x75\x7a\x06\xd3\x40\xa3\x54\xf9" "\x95\x42\x8e\x0d\xf7\xe1\x10\xa8\x21\x74\x1b\x80\x97\x6d\x61\x1f\xac\x66" "\x5a\x21\xfb\x85\xb8\xa4\xc1\xa5\x4e\xf1\x12\x25\x99\x5c\x90\x0e\xae\x4f" "\xa4\xae\x7f\x25\x8b\xaf\x41\x98\x33\x6b\xc6\x0d\xd8\x5f\xac\x75\xf6\xe9" "\xaf\x06\x8d\xdf\x48\x1b\x62\x20\x55\xa2\xa5\x98\x84\xda\xcb\x65\x7d\x2c" "\x44\x66\x78\x6d\x95\x1d\x58\xda\x4c\x9c\x1c\x32\x18\xdb\x70\xde\x2b\xc1" "\x67\xf2\xc1\x31\xf7\x01\xd8\x63\x40\xe4\x28\x14\x81\xf8\xb9\x3d\x61\x08" "\x26\xcd\xc6\xb1\xe2\xbc\xe5\xab\x2a\x4e\x33\x70\x26\x17\x2b\x16\xb6\x8a" "\xb6\xd4\xa1\xb8\xad\xdd\x32\x27\xbe\x62\xee\x36\x58\x5a\x2d\x44\xb1\x05" "\x12\xa7\x06\xc6\x26\x87\x98\xdd\x36\x4e\x34\xf3\x9a\xf0\xcf\xed\x65\x9b" "\x20\x71\x07\x4d\x9a\x8e\x23\xba\x1a\x00\x11\x8d\xa7\xba\x14\x00\xa3\x97" "\xa5\x20\x75\xb2\x51\x7b\x2a\xec\xe0\xf9\xee\xb7\xa0\x9b\xd8\x14\x57\xe9" "\x38\xad\x64\xb0\x5e\x21\x95\x33\x05\x98\x5c\x5e\x89\xec\xb7\x89\xd8\x81" "\xbb\xa2\x21\x08\xc0\x02\xa5\xad\xe6\xf6\x90\xf5\x6e\x69\xdf\x8b\xd8\xbd" "\x8b\x0a\x4d\xed\xa1\x43\xe5\x5d\x62\x81\x6e\x66\xb5\x2a\x2a\x05\x63\x9a" "\xfe\x4c\x56\x68\x3b\x69\x59\xa6\x34\xd7\xde\x4a\x59\x81\x79\x13\x31\x09" "\xb3\x9a\xeb\x02\xc0\xf9\x09\xef\x2b\x23\xfe\x93\x32\xc9\x6d\x86\xc5\x8b" "\x6e\xb1\xba\x47\x00\xa3\xe3\xdf\x44\x5a\x66\xe5\x17\x87\xfa\x6a\x0c\xa7" "\x30\xef\x60\xb6\xda\xe4\x92\x01\x5e\x43\x2e\xb0\x7f\xfc\x6d\x0f\x9a\xac" "\x00\x34\xdb\x02\x4d\xca\x90\x88\xa3\xcc\xd3\x5f\x56\x36\x09\x85\x89\x1b" "\xf5\xaf\x6e\xd3\x8a\xcc\xbb\x75\x4f\xe8\xb1\xbb\x63\x0e\x82\xfc\x81\xa5" "\xda\x65\x77\x7e\x4e\x95\x57\x90\xbb\x4d\xe2\x8d\xd4\xda\x33\xe5\xcd\x98" "\x3f\xfe\xed\x8d\x54\xab\x46\x17\xa4\xf7\xe3\x7c\xe0\x79\xf5\xdb\x12\x90" "\x16\x48\x9b\x9b\x99\x34\xb9\x67\x47\x0e\x13\xe5\x61\x90\x21\xbf\x2e\x8e" "\xcd\xbf\xc8\x86\xc0\x39\xb8\x1b\x22\x2f\x9b\x21\xa1\x95\x48\x5f\xbb\x56" "\x7c\x93\x08\x49\x52\x24\x55\x08\x66\x92\x46\xea\xf2\xd4\x2f\xde\x5e\x1e" "\x18\x33\xd7\x47\x56\x8c\xfd\x9e\xb7\x77\x3d\x32\x31\x90\xf6\xe5\x13\x36" "\x49\x9e\x48\x52\xbf\x99\xd7\xe1\x4e\x21\x78\xe6\xbf\xde\x79\xae\x7c\x4f" "\xad\x24\xc3\xd7\x35\x49\x57\xb4\xdd\xd0\x06\xc0\x3b\xe7\xdd\xf9\x73\xd8" "\xa8\xd6\x4d\xb5\x19\x1c\xd8\x8d\x89\x1e\x2d\x6b\x8b\x04\x36\x94\xba\xfc" "\x6b\xe5\x3d\xb8\xaf\x68\xe9\x5a\x14\x01\xca\xb8\xb1\x60\x7f\xea\xed\xc2" "\xf5\x06\x75\x00\x60\x10\x61\x3f\xaf\xbe\x74\x47\xbb\x18\x89\x91\xb2\xb6" "\xd8\xc4\x62\xda\xa7\xe5\x7c\x56\xfa\xdb\xab\xed\xb2\x2f\xb4\x61\x39\xc8" "\x40\x0f\xed\x84\x7d\x06\x8c\x7a\x17\x55\xfa\xd0\xdb\x65\xe9\xf8\x2f\x14" "\x4c\x57\x7a\xf1\x3e\x50\x7c\x53\x9e\xd1\x2c\xf7\xc5\x68\xa2\xe5\x43\x01" "\x66\x99\xc3\x16\x23\x8a\x53\x22\x39\x1d\x94\xfb\x4f\x0c\xdc\x5f\x93\x3a" "\xa1\x43\x4a\x28\x56\x8a\xa3\xe7\xf1\xe7\x9e\x69\x9c\x86\x3b\x53\x00\xbf" "\x94\x0f\x30\x73\x6a\xb4\x9a\x2c\x0a\xf2\x8c\x9b\xe0\x93\x83\x6e\x58\x3e" "\xf7\x75\xb1\x6c\xeb\x40\x33\x1d\x0f\x84\xcc\xc4\x3b\x57\x4c\xd9\xfd\xb6" "\xdc\x86\x68\x19\x5b\xe4\xb9\xd8\x15\x28\xf9\x4e\xf0\x02\x14\x63\xc7\x3f" "\x61\x94\xb9\xbd\x78\x30\x5e\xd4\x1d\x0f\x46\xc8\x9a\x6c\xb7\xb9\x86\x12" "\x9b\x43\xca\x43\x82\x0b\xb8\x7c\xa3\x29\xb4\x6d\x02\xf3\x06\xd3\x49\xa3" "\xc2\x46\x5e\x08\x00\x36\x88\x17\xf3\x05\x25\xff\x27\x8b\x8e\xc5\xa4\xa0" "\x35\x15\x2d\xe4\x72\xf8\xca\xcf\x39\x26\xa2\x42\x6b\x26\x31\x43\x35\x77" "\x88\x97\x93\xc3\xd7\x5f\x42\xc1\xd6\xed\x8e\x2d\xb5\xd3\x8b\x00\xb7\x88" "\x10\xe5\xe8\x4b\xdf\x2b\x70\x4f\x03\xc2\x6e\x6b\xea\x03\x65\x15\x11\xde" "\x0b\x83\xf6\xfa\x9e\xd1\x5f\xea\xfd\x18\xc8\x87\x40\x30\xe9\xdc\x21\x49" "\x94\x57\x64\xbf\xba\xf3\xd0\x15\x4f\x5c\xe1\xd2\x98\x36\xf7\xff\x1d\x56" "\xa5\x1e\x26\xa2\x90\x5b\xea\x32\x31\xb7\x7f\x7b\xf0\xf8\x1d\x31\xcd\x24" "\x61\x88\xba\x81\x2f\x58\x3b\x97\xd2\xf6\x66\xcf\xdb\xdf\x92\xb0\x6a\x62" "\xde\x4d\xf0\x92\xbc\xc2\xaa\x56\x53\xc1\xa9\xff\xa9\x03\xac\x0a\x53\xdc" "\x02\x76\x1a\xe5\x9e\xb0\x0e\x6e\x12\x9e\x51\xfe\x8e\xcf\x59\xfc\x3d\x16" "\x38\x92\xc0\xf2\x52\x5f\x23\xea\xb0\x07\x3b\xa5\x9f\x8d\xcf\xbc\x95\xd0" "\x38\xe9\xc6\x9a\x41\x84\xcb\x41\x77\x3d\xa3\x98\x9f\xc2\x74\xaa\x2b\xd6" "\xa6\xb9\x2b\x2c\x6f\x1a\xd4\xbf\xf2\x3b\xd4\x96\xce\xd3\xb4\x67\x80\x62" "\xf8\x1f\xd0\x1c\xe1\x9c\x4b\x4c\x0a\x91\xb9\xeb\xa7\x85\xc7\x87\xfa\x0b" "\x64\xcc\x29\x3f\x3b\xad\xc0\x63\x84\xad\x58\xb5\xb9\xcb\xb6\x9d\x8e\x9f" "\x08\x02\x0b\x0a\x54\x71\xed\x62\xc7\xaa\xd7\x21\x93\xf3\xbe\xef\x12\x4e" "\xff\x5d\xbb\x58\x44\xc8\x05\x14\x8d\x12\x2f\xf5\x7d\x1f\xd6\x73\x70\x83" "\x67\x8a\x7f\xee\x29\xd9\xad\xca\x33\x71\xa0\x34\x0b\xa7\x61\x8d\x1b\xe2" "\x8c\xb4\x26\xc8\x5d\x25\x7d\x11\xbc\x66\x34\x17\xf8\xb8\x0a\x32\x55\x25" "\xaf\xe8\xbf\x5a\xa4\x6e\xe0\x5e\xaf\xd9\x98\x7a\x68\x76\xab\x04\x08\x1e" "\x26\x78\xfe\x71\x27\x6a\x7f\xf6\xdb\xad\x0e\xc3\x34\x8a\xa9\xe5\xec\x11" "\x1c\xf6\xe4\x2f\x3d\x53\x0d\x1c\x60\x21\xc7\xec\xb3\xea\x61\x2d\xb0\xcc" "\x99\xb7\x7f\x76\x89\x85\x39\xe0\xb8\xbb\x81\xbf\xb9\x5b\xd6\x50\xe0\xf3" "\xc1\xcc\xa1\x8e\x0c\x65\xd9\x78\xdb\x33\xe7\x06\x78\x81\xc3\x0b\xdd\x54" "\xf0\xcf\x32\xfd\x51\xc5\xd2\x50\xe0\xc3\xcf\x4b\x67\x92\x0d\x7c\x53\xd6" "\x03\xc9\x90\x50\xe8\xbb\xc3\x2d\xc4\x0d\xe2\xe0\x1c\x88\xfc\x19\x7e\x0d" "\x0c\x12\x24\xd6\xba\xf3\x92\x07\xed\x6d\x26\xbb\x3e\x0a\x31\x63\xd9\x97" "\x34\x7e\xf9\xe0\xd6\xbf\x27\xbe\x26\xb0\x1e\x85\x75\x75\xda\x18\xfc\x0b" "\xf1\x24\x49\xea\x06\x6f\x86\x7d\x22\x87\xa0\x0a\x50\x4e\xfb\xd8\xf8\x31" "\x3b\x94\x38\x6f\xbf\xb5\xda\x1c\x40\x43\xd1\xdc\xeb\x50\x2a\x6a\x37\xa1" "\xde\xc2\xbd\x17\x87\xd7\xcf\x90\xc9\x39\x3b\xc4\x61\xb4\xa8\xfc\x0c\x1a" "\xd4\xcb\x26\x14\x86\xb4\xa6\x35\xcb\x19\x77\x55\x52\x90\x89\x37\xdd\x4e" "\xa4\xce\x58\x85\x9a\xc6\xb6\xc3\x46\x65\x83\xb9\x83\x3b\x78\xd5\xeb\xe3" "\x98\xd3\x5f\x30\xdd\xdb\x35\x5f\x19\x84\xe4\x06\x09\xf7\x5d\x57\xc0\x0b" "\x69\xde\x3d\xa2\xee\xe5\x59\xcc\xfa\x6e\x23\x54\x79\xce\x90\x95\x5a\x1e" "\xfc\xd2\xee\x60\x9f\xa0\xb4\x93\x91\xb0\x39\x10\x24\x96\x5a\xc8\x4d\x81" "\x44\x2e\xd3\xf2\xe3\x73\x5c\xf2\x27\x99\x1c\x18\xa9\xd7\xd2\x9b\x36\x40" "\x59\x21\x1c\x9d\x79\xee\xe2\x74\x89\x9f\xf6\xc9\x99\x8d\x43\xaf\x56\x74" "\x21\x40\xdd\xbf\xe4\x6a\x16\x4c\x96\xc2\x55\xfc\x7c\x7b\x5d\xdc\x40\x7e" "\xff\xad\x69\x3f\x2b\x14\xd0\xe9\xfc\xca\x50\xfd\x19\x75\x6a\x8d\x34\x9d" "\xd8\x3d\x08\x35\x81\x0f\xcb\xd8\xb3\xe0\x5f\x92\x32\x44\x69\xd7\x0a\x2b" "\x72\xba\xa4\xdf\x09\x8a\xa6\x95\xd3\x24\xb8\x57\xd0\x04\x08\x2e\x9c\xee" "\x26\x83\xee\x88\x40\xa2\xdf\x7f\xc3\xd4\xc9\x7a\x8c\x21\xfc\x8f\x5b\x78" "\xc9\x0a\x79\x04\xc3\x9b\xe8\x95\x3e\xdf\x7a\x60\x9d\xd8\x9d\x11\x41\x4e" "\x37\x1c\x1c\xec\x9b\x74\x14\x5f\x42\xa9\xd8\xd6\x14\x09\xc6\xb2\xea\x6c" "\xee\x03\xe2\x55\xff\x60\xaf\x27\x99\x43\x3a\xf4\x10\xe2\x7d\x8c\xe1\x17" "\x17\xe0\xd9\xc6\x06\xfa\xab\x54\x88\x5a\x9c\x4c\x7b\x6f\x74\x22\xac\x6b" "\xd3\x28\x9b\xae\x60\x11\x70\x42\x4b\x7d\x4b\x40\x71\xe8\x86\xac\x7b\xb4" "\x82\xab\x46\x1c\x80\xb7\xe5\x97\xa6\xec\xfc\xa8\x24\xec\x09\x14\x02\xb2" "\xc8\xad\x6d\x30\x89\x15\xc4\x81\xd8\x18\xbc\x0c\xbc\x23\xb1\x34\x26\xd5" "\x5e\x5f\x32\x8a\xe5\x1d\x56\x1c\xc0\x8b\x07\x02\x34\xa1\x9b\xa4\x85\x83" "\xa1\xfa\x4b\x78\x9f\x73\x27\xef\x1a\xbe\x80\x42\x7b\xa9\xcc\xd0\x9f\x2f" "\xc1\xb4\x52\x16\x87\x51\xb4\x72\xa6\xec\xa6\xde\xc4\xa5\xb2\x59\xe8\xe7" "\x1e\x37\xd3\xd1\x19\x76\x39\x4d\xe0\xc2\x50\x9e\xe1\x7c\x75\x7a\xed\x85" "\x47\xbf\x75\xda\x5b\x78\x03\x60\x9e\x7a\xcf\xe8\xdc\x6c\xf3\xfd\xa4\xa7" "\xe1\x42\xba\x39\x5f\xcf\x21\x34\xfa\x2c\x05\x64\xad\xf8\x49\xb1\xbb\xf2" "\x5c\x43\x0c\x2a\x75\x26\x9f\xc2\xe6\x7c\xe6\xb3\x17\x79\x24\x72\x93\x14" "\x94\x75\x66\x01\xb6\xd5\x8f\xb8\x24\xa3\x8b\xa0\x28\xb9\x4a\xbf\x1e\x4d" "\x55\x2e\xc9\xa9\xcd\x49\x4f\x2a\x2d\xf5\x12\x91\xb5\x7d\x29\x2d\x29\x85" "\xcc\x04\x7b\xfc\x2a\xfe\xcc\xb8\xfc\x10\x79\xc1\xb7\xe5\xe9\x38\xe0\x81" "\xa6\x7d\x73\xdb\x70\x09\x10\x3d\x6b\xe1\x8b\x72\xda\x6e\x72\x09\xc2\x54" "\x4c\x09\xd6\x3e\x91\xf8\x4c\x7c\x70\x85\x6c\x85\x65\x8e\x70\xc5\x5a\x7b" "\x91\x33\xe8\xf6\xaf\x3b\xb9\xb1\x60\x6b\x1a\x44\xaf\x87\xd4\xa9\x57\x46" "\x62\x56\xd0\xc3\xef\x18\xf9\x6c\x07\x10\x01\xde\x8e\xda\x6a\xe1\x04\x90" "\xec\xd1\x42\x91\xe6\xa9\xf4\xea\xca\x6c\x7e\xe4\x32\x90\xd7\xe3\x37\x37" "\xe9\xcc\x0a\x29\x79\xaa\xdf\x38\xad\xe0\x53\x9d\xda\xab\xd1\x8c\x27\x35" "\x6b\x3c\x47\xe7\x60\xcf\x31\x22\xaf\x9f\xc4\x05\xa2\x18\x15\xda\xd9\xaa" "\xab\xd5\x8e\xda\x38\x36\x1c\x90\x49\x11\xc9\x66\xf7\x10\xbd\x02\x48\xa0" "\x3e\x41\xb4\x18\xa6\xf7\x25\x92\x44\xc9\xe3\x3a\xe0\x4d\x71\xd0\xdc\x14" "\x1b\xa1\x19\xd9\x70\xae\xea\x80\x0f\x5d\x28\xec\xfb\x14\x16\xaf\x5e\xd7" "\x70\x01\x9a\x08\xdb\xd7\x51\x09\xa7\xf4\xd0\x30\x6d\x5f\x85\xca\x96\xc3" "\x9f\x9d\x66\xe5\xe3\x02\xf4\x0f\xb4\xe2\x71\x3d\xf1\x07\xf3\xf5\x38\x09" "\xdc\xa9\x60\x2a\x38\xbb\xfe\x32\x51\xec\x95\x65\x22\x8a\x4e\x92\xf9\x75" "\xd4\xef\x37\x51\xf8\x19\xa7\xe7\xbe\xba\xb7\x61\x93\xea\xcf\xbe\xb2\xab" "\x3d\xf4\x5d\x80\xe5\xdb\x8e\x5d\x43\x35\x8f\x06\x3c\xeb\x7b\x5c\xc4\xf2" "\xc3\x87\x17\x79\xa2\x2b\x33\x41\x0d\x18\x6c\x07\xd0\xb1\xf5\xc9\xf7\xb2" "\xac\xa2\xd3\x0f\xdd\x9f\xb9\x1e\x19\x48\x0c\xcb\xfe\x35\x90\xdf\x92\x34" "\x60\x42\x11\xcf\x12\x63\x56\x4c\x14\x57\xc3\xa1\xb9\x52\x61\xcb\x73\x70" "\x1d\x6b\xa5\xa5\xff\xa9\x9a\x03\x21\xc0\x1f\xf2\x7c\xf0\xe1\x71\x2f\x69" "\x42\xb3\xb7\x86\x14\x7c\x85\xf6\x8b\x72\x77\xab\x84\x96\xc5\x0c\x56\xde" "\xdd\xe2\x8b\x72\x27\xa7\x76\xf5\x1a\x53\x5a\x5a\x4b\x26\xc6\x75\x5a\x32" "\x9e\x97\x77\xb7\xba\x92\x27\xd1\xb7\xb8\xcf\x2a\x53\x47\xb1\xe8\x35\x96" "\x92\xbf\x41\x52\xc2\x8a\x82\x5c\x23\x25\xa5\x4b\xc4\x92\x13\x65\x40\x46" "\x17\x0d\x22\x17\x5a\x70\x24\x63\x1a\xd7\xc7\x6a\x9f\x41\x9a\x13\xd7\x57" "\xed\x33\x30\xdb\x2c\x20\xdc\xa4\x50\x85\x25\x95\xe1\xca\xe7\x47\x8c\xb6" "\x22\x85\xc6\x8b\xbf\x1b\x4a\x57\x80\x1d\xd9\x46\x23\x92\xe4\xbf\x75\x0c" "\x1c\x4a\x36\x46\x8a\x0d\xc4\xa7\xa8\xa7\x68\x9c\xca\x90\x74\xc4\xd9\x0d" "\x6c\x72\x56\xbc\x6b\xb1\xc8\x1a\x37\x73\xac\x3e\x72\xdd\x25\x97\x64\xa9" "\x0b\xfc\xd6\x73\x69\x07\x39\xd4\x86\x9a\xe5\x62\x62\x98\xa4\x4d\x24\x2e" "\x8e\xd4\xe0\x37\x21\x63\xe4\x93\xd4\xd8\x0e\xff\x28\xec\x4a\x48\x16\xf1" "\x82\x63\xb5\xaa\x04\xfd\x2c\xba\xa4\x58\xb3\xa0\x2c\x00\x7d\x36\xb3\xac" "\x9e\x86\x6b\xd1\x45\x5e\xb0\x06\x58\x03\xde\x38\x96\x61\xf9\xc7\xde\x5e" "\x28\xe2\x5e\x8e\x37\x23\x61\xc8\xe0\x80\x7a\x3d\xdc\x8f\xa6\x35\x4f\x8c" "\xca\x40\x28\x1a\x7c\x1f\x66\xb7\x8f\x83\x3c\x02\x41\xc5\x70\xf0\xcc\x52" "\x7a\x40\xa7\xad\x95\x42\xf9\xef\xeb\xf8\x00\x4d\xc6\xc4\xb4\x5a\xd4\x56" "\x04\xa3\x5b\x4e\x68\xf8\xf7\x8d\x36\xe7\xbb\x74\xce\xec\x8e\x34\x1d\x75" "\xb1\x14\xe4\xfe\x03\x92\xfb\x69\x19\xfc\x7a\x0f\xfe\x31\x80\x24\x0b\xa1" "\x01\x2e\x03\x9a\xcf\x43\x31\x50\x65\xed\x3e\x27\xb6\x92\x1c\x06\x24\xfa" "\x0e\x35\x30\xe1\x7a\xa1\xfc\x8d\x00\xfc\x46\x51\x0f\xb1\x37\xa9\x6b\x14" "\xbe\xb6\x8f\x9b\x14\x84\x79\x06\xcc\xad\x31\x77\xba\x90\xd1\x28\xb1\x47" "\x17\xbe\xd9\xd1\x25\x8b\x91\x61\x33\x5f\x31\x5a\xc8\x85\x1c\xb1\x6d\x1d" "\xf6\x92\x9d\x65\x5c\x00\xac\x82\x1d\x82\xa9\xf0\x47\xa7\xde\x7e\xa8\x1a" "\xbb\xff\x9f\xb1\x3c\x39\xf6\x4c\xfe\x39\xea\x14\x88\xc8\xe0\x8b\xb6\x95" "\x46\x4e\x2a\x1b\x5a\xff\x5f\x65\x1b\x50\x84\xe5\x71\x56\x63\xfd\xa0\x7f" "\x24\x75\x37\x36\xc8\xb1\x67\x8e\xc2\x6a\x5d\x6a\x9c\xae\x9c\x8f\xd1\x2d" "\x4b\x0b\x00\x37\x45\x27\xe7\xf5\x05\x20\xaf\xdd\x61\x90\x4a\x8d\x2a\xb6" "\xf2\xb2\xde\xf0\x73\x00\x36\x68\xe8\xff\x99\x52\x78\xb2\x27\xce\xb2\xf2" "\xe1\x85\x45\xe6\x9c\x15\xf0\xcb\x0e\x30\x87\x93\x2b\xb8\x31\x3a\x0f\x8b" "\x11\xdd\xe9\x0e\x76\xb7\x20\xb9\x0a\xe2\x13\x53\x76\xff\x8a\x59\x3e\x12" "\x1b\x00\x93\x88\x58\x13\xb5\x65\xf4\xef\xb8\xe3\xab\xad\xef\x9a\xd4\x91" "\xfa\x8e\x75\x1d\xec\x67\x19\x66\x2e\x88\x6c\xc9\x1b\x1c\xb6\xdf\xbc\xa0" "\x97\x73\xc2\xc5\x6b\xa7\xa0\xbd\xe4\x5d\x35\x8d\x6c\x98\x7a\xa4\xd7\x80" "\xcd\xa5\xa5\x23\xee\x22\x8c\x4c\x34\x12\xc1\x95\x57\x80\xdb\x6d\x18\x31" "\x83\xaa\xf1\x9a\xa7\xa7\x8c\xfe\x37\xc2\x99\x57\xda\x23\x34\x9b\x23\x5f" "\x50\xe1\x09\xd8\x09\xe9\xf6\x5f\xab\x3f\x7c\x27\xe0\xcf\x0f\x31\x47\x8b" "\xba\xd9\x18\xcf\x76\xa8\xfb\x79\xd2\x42\x4a\x68\xf6\xc3\x19\x0a\xd8\xde" "\x3c\xef\x79\x1a\xb7\x43\xb1\x21\x92\xc0\xe7\x5d\xc8\xc1\xfd\x6a\xbe\x38" "\xef\xcc\x7d\xd5\xd6\x67\x1c\xdb\x7b\x91\x60\xd5\x90\xd7\x48\xb9\xa3\x0c" "\xac\x92\x3a\x97\xd3\x4f\xb0\x3b\xc9\x46\xad\xa8\x06\xa6\x6b\x38\xe1\x23" "\x18\xeb\xd6\xa5\x93\x11\x7c\xeb\x43\x4c\x4d\x38\x77\x79\xb5\xd2\xf4\x27" "\x9d\x96\xd5\xf3\xb2\x68\xd3\x10\xb7\x5b\xba\xde\x2d\x1c\x4f\xb8\x4c\xb5" "\x3f\xf3\xd0\x2a\x25\x8b\x2f\xe6\xdd\x5b\x00\x4c\xa9\xa5\x4f\x4f\x26\x91" "\xd6\xec\xc7\x67\x20\x2b\x49\xff\xad\x94\x18\x32\x5f\x16\x67\x0b\xef\x52" "\x9e\xf4\x1f\xe5\xb6\xf8\x0d\x9f\xa3\x6b\x02\x21\xd3\x95\xb7\x2b\xa9\x8e" "\x56\x6b\xcc\xc0\x58\x47\x28\x85\x14\x32\x9c\xa7\x9b\x57\x6a\x16\x7e\x35" "\xf8\x84\x98\x53\x91\x53\x56\x83\xc8\x13\x2e\x0c\xe6\x94\xab\x79\xaa\xee" "\x03\x1d\x69\x78\xf3\x3d\x02\x47\x36\x47\xf3\x33\xea\x00\xce\x95\xb2\xf7" "\xc3\x3d\x37\x5c\x28\xe1\x25\x30\xe8\xfd\x3c\x00\x64\x3b\xd5\xfe\x2e\x71" "\xb0\x11\x20\x6e\xa2\xf1\xe8\x6e\x6c\x40\x59\x0c\x18\x9d\xfa\x35\x72\x9d" "\x93\x1b\xec\x87\xc8\xc5\x4d\xd8\xd6\x84\x94\xc8\xb5\x2d\x3b\xc4\xce\x13" "\xc3\x43\xf5\xd4\xd5\x93\xde\x75\xda\x7c\x9d\xde\xe4\x4b\x97\xf9\x5e\xe9" "\x4e\x09\x2e\xa2\xdc\xb8\x42\x6d\xd5\xce\x27\xb6\xbb\xf6\x93\xf9\xa2\x77" "\x0b\xba\xc5\xef\xc8\xc3\x27\xe5\x18\x53\x85\xe6\xa5\x1e\x8c\x20\x73\x5c" "\x3e\x1d\x13\x79\x40\x6b\x0e\x8d\xdf\x81\x63\x7a\x8e\xc4\x66\xdf\x78\x90" "\xc3\x72\x84\x4b\x4a\x08\xff\x5b\x96\x99\x9d\xb0\x69\x44\xca\x15\xdf\x12" "\xd2\xa1\xa9\xba\x19\x7f\xe4\xf9\x0f\xb1\x8e\x5f\x76\x75\xdd\xcd\xcd\x8c" "\xf1\x43\x01\x3d\x2d\xba\x3e\xae\x53\x0f\x72\x94\xf1\x46\x9b\xd3\xc0\xa9" "\x4e\x86\xf6\xf1\x3c\x4b\x4c\x92\x81\xad\xfc\x4e\x13\x3d\xa8\x97\x4c\x30" "\xbd\x57\xe1\x61\x5e\x7c\x4f\x52\xa7\xaa\x2e\x75\x98\x4d\x2c\xd3\xcd\xfd" "\x53\x90\x84\x5c\x8b\x7c\x9d\xb9\xd7\x72\x13\x3f\xe9\x8e\x59\x79\x48\xdd" "\x17\xb4\x9e\xe1\x84\x32\xa5\x0a\x05\x7e\x51\x7b\x05\x0f\x92\x2b\x7b\x48" "\x8e\x9a\xba\x11\x4e\xf1\x0b\x1e\xf5\x34\x82\x46\xd3\x04\x11\xd3\x0e\x44" "\x4d\xd3\xb0\xce\x1f\x4a\xb0\x9f\xe0\xb0\x89\x26\x0f\x58\x00\xf8\xc3\x2e" "\x12\xe3\xd7\xa4\x00\xd9\x52\x4e\x9e\xd8\x08\x40\xd2\x53\x9a\x8d\xbb\xe7" "\x9c\x8b\x04\xc1\xa3\x59\x50\xe3\xe1\x04\xb8\x92\x25\x2c\x3b\x78\xf2\xa6" "\x6b\x6f\xd1\xa8\xa0\x2b\x61\x41\x2b\x59\x1a\xb1\xfc\x6b\x83\x89\x6e\x85" "\x1c\xeb\x36\x82\x1c\xf0\x37\x34\x38\x1d\xdb\xed\xff\xab\x60\xac\x91\x3b" "\xa1\x2f\x76\x43\x7c\x5e\x47\xa3\xe7\x5c\x81\x3c\xb3\xd5\xc8\xae\xf6\x95" "\x0a\x6a\xbc\xe9\x5d\x8f\xa0\x20\x3b\x1e\xbf\x26\x0d\x1e\x53\xa6\x93\xdd" "\x88\x74\x09\x96\xb5\xcf\xb4\x41\xcc\x19\x66\x6f\x77\xda\xa0\xe3\x5e\x82" "\x58\x90\x33\x65\x62\x91\x18\xe2\x40\xe2\x63\xcd\xea\x7d\x2c\xf4\x4b\xb4" "\x34\xe9\x67\x6d\xd4\x61\x13\xbe\x92\x86\x68\xf7\x1c\x1e\x26\x2c\xdd\x6e" "\x22\x70\xe4\x17\xcd\xa3\x99\x43\xf1\xb7\xca\x63\xd0\x14\x39\xea\xe3\x3b" "\xa8\xc9\x1b\x00\xa3\x2f\x99\xd5\xf6\x05\x25\x9c\xd1\xcc\x0c\x6d\x41\xde" "\x3b\xa0\x0d\x0a\xec\x3e\x3a\xb9\x98\xed\x71\x23\x28\x52\x32\xb9\xb8\x7f" "\x04\x77\xc4\xf4\x10\x9e\x2d\x2d\xd7\xf4\x59\x2c\x0f\x28\x68\xcc\x77\xb3" "\x57\xc4\x47\x3c\x2e\xd2\x44\xad\x07\x72\x2a\xe5\x87\x20\x3b\xf2\xea\xc8" "\xcc\x1b\xe3\xf0\x3e\xb2\xf0\xf2\xe0\x68\xca\x89\x3e\xe0\x92\xdb\x18\x59" "\x3f\xec\xb4\x26\x16\x73\x4c\x9b\x30\xbc\x65\x1c\x0d\x01\xc5\x6b\xa7\x2b" "\xe0\x12\x6a\x65\x9e\x32\xce\x8a\xee\xfb\x5c\x8b\xf2\xbb\xaf\x8f\xa4\x2e" "\xb6\xf5\xee\xa1\xb6\xc5\xdc\x8b\x2b\x2f\xd7\xdd\x50\xde\xef\x33\xc8\xac" "\x6a\x94\xb6\x04\xe8\x72\x83\x81\x2b\x0d\x32\x66\x8f\x8b\xff\x20\x19\x03" "\x9d\x79\xa9\x0d\x6f\xd0\x4f\x95\xfc\x42\xd8\x59\xf9\x14\x58\xa0\x5d\x90" "\x74\x44\x6e\xe0\xee\x50\xb2\x13\xbc\xdc\xe4\x0a\x31\x83\x69\x03\xf2\x29" "\x39\x72\x52\x62\xf0\xa7\x74\x9a\x1b\x4b\x3b\x2a\x02\xb4\x78\xa6\x7c\x7d" "\x9b\xa0\xf0\x2e\x5e\x5b\x1b\x1d\x88\xac\xdb\xe3\x5a\x6f\x88\xb0\x6d\xf4" "\xb8\x73\x9a\x4d\x3d\xec\x53\x79\x80\x9f\xde\x06\xe2\xa6\x14\x2f\x98\x67" "\x97\xec\xfc\x01\xf2\x48\x92\x5b\x68\x00\x23\x6a\x48\x8e\xd5\x55\x60\x84" "\xf3\xe2\x97\x3f\x62\xb9\xb1\x0d\x73\x63\xeb\xd6\x17\xf7\x3d\x7b\x86\x25" "\xed\x26\xd8\x4b\x52\x9c\x6a\x63\xb4\x18\x86\x65\x79\x63\x67\x29\x90\x5f" "\x74\xf7\x2e\x58\x87\x36\x89\x01\xe4\xc8\x01\x97\x9e\xa8\xb2\x06\x19\xa5" "\x17\xc3\x46\xd8\x71\x44\x8a\x42\x10\xec\x45\x54\xa2\xe7\x3d\x68\x81\x99" "\x6e\x39\x1a\x73\xc5\x12\x66\xd7\x00\x1d\xc6\xad\x65\x1e\x1a\xc2\x3c\x1d" "\x57\xb6\x12\x17\x5f\xc7\x65\xff\x02\xa6", 4096)); NONFAILING(sprintf((char*)0x200032f5, "0x%016llx", (long long)-1)); NONFAILING(memcpy( (void*)0x200001c0, "\x78\x9c\xec\xdd\xcf\x6a\x33\x55\x14\x00\xf0\x33\xd3\x34\x89\xba\x48\x04" "\x57\x22\x38\xa0\x0b\x57\x1f\x5f\xbf\x27\x48\x91\x16\x8a\x59\x29\x59\xa8" "\x0b\x2d\xb6\x05\x49\x82\xd0\x42\xc1\x3f\x18\xbb\x72\xeb\xc6\x57\x70\x23" "\x08\xee\x7c\x09\x37\xbe\x81\xe0\x56\x70\x67\xc1\xc2\xc8\x64\x66\x4c\x42" "\xd3\x90\x54\x53\xff\xfd\x7e\x9b\x9e\xde\xb9\xe7\xce\xb9\xb7\x53\x4a\x17" "\x39\xf3\xee\x0b\xe3\xe1\x49\x16\x67\x57\x9f\xfc\x18\xed\x76\x12\x69\x2f" "\x7a\x71\x9d\x44\x37\xd2\xa8\x7d\x16\x0b\x7a\x5f\x04\x00\xf0\x6f\x76\x9d" "\xe7\xf1\x4b\x5e\xda\x24\x2f\x89\x88\xf6\xf6\xca\x02\x00\xb6\x68\xe3\xbf" "\xff\xdf\x6e\xbd\x24\x00\x60\xcb\xde\x78\xf3\xad\xd7\xf6\xfb\xfd\x83\xd7" "\xb3\xac\x1d\x87\xe3\xcf\x2f\x07\xc5\x7f\xf6\xc5\xd7\xf2\xfa\xfe\x59\xbc" "\x1f\xa3\x38\x8d\xc7\xd1\x89\x9b\x88\xfc\x0f\x65\x7c\x98\xe7\xf9\xa4\x91" "\x15\xba\xf1\xf2\x78\x72\x39\x28\x32\xc7\xef\x7c\x5f\xad\xbf\xff\x73\xc4" "\x34\x7f\x2f\x3a\xd1\x9d\x0e\x2d\xe6\x1f\xf5\x0f\xf6\xb2\xd2\x5c\xfe\xa4" "\xa8\xe3\xe9\xea\xfe\xbd\x22\xff\x49\x74\xe2\xb9\x25\xf7\x3f\xea\x1f\x3c" "\x59\x92\x1f\x83\x66\xbc\xf2\xd2\x5c\xfd\x8f\xa2\x13\x3f\xbc\x17\x1f\xc4" "\x28\x4e\xa6\x45\x94\xf9\x91\x46\x7c\xba\x97\x65\xaf\xe6\x5f\xfe\xfa\xf1" "\xdb\x45\x79\x45\x7e\x32\xb9\x1c\xb4\xa6\xf3\x66\xf2\x9d\x07\xfe\xd1\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x1f" "\xf6\xa8\xea\x9d\xd3\x8a\x69\xff\x9e\x62\xa8\xea\xbf\xb3\x73\x53\x7c\xb3" "\x1b\x59\xad\xbb\xd8\x9f\xa7\xcc\x4f\xea\x85\xe6\xfb\x03\xd5\x2f\x0c\xa8" "\xfa\xf3\x3c\xce\xb2\x2c\xaf\x26\xce\xf2\x1b\xf1\x7c\x23\x1a\x0f\xbf\x63" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\xe7\xb9" "\xf8\xf0\xa3\xe1\xf1\x68\x74\x7a\xfe\x97\x04\x75\x37\x80\xfa\x63\xfd\xf7" "\x5d\xa7\x37\x37\xf2\x62\xac\x9e\xdc\x9a\xdd\x2b\xad\xc2\x15\x2b\xc7\x4e" "\x3d\x27\x89\x58\x59\x46\xb1\x89\xb5\x6b\xfe\x2d\x2f\xdd\xef\xe8\x9e\xbd" "\xab\xe6\xaf\xbf\x59\x7b\x9d\xaf\xee\xdc\x7b\x2b\x16\x47\x76\x57\x9d\xcf" "\x9f\x0b\xd2\x2a\xa8\x9f\xae\xe1\x71\xb2\x78\x86\xf5\x85\x56\xd4\x23\xed" "\xfa\x21\xf9\x6e\x7e\xc1\x66\xac\x79\xd3\xe6\x5d\x97\xf2\x8d\x1e\xbf\xe6" "\xad\x91\x6e\x0c\x8f\x3b\x1b\x1f\x42\xf3\x99\x69\x30\x59\x31\x27\x92\x15" "\x85\x3d\x15\x3f\x95\x07\x54\x8d\x24\xf5\x2e\xd2\x2a\x68\x4e\x4f\x75\x69" "\xfa\x6e\x15\x44\x44\xba\x74\x4e\x7b\xfd\xe7\xb9\xf8\x4d\xb9\x25\xd1\xad" "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x6a\xf6" "\xa1\xdf\x25\x17\xaf\x56\xa6\xa6\x79\x6b\x6b\x65\x01\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\xc0\x83\x9a\xbd\xff\x7f\x83\x60\x52\x25\x2f" "\x9f\x13\x31\x37\xd2\x8c\xf3\x8b\xbf\x79\x8b\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x0f\xfc\x1e" "\x00\x00\xff\xff\x01\xc6\x54\x20", 692)); NONFAILING(syz_mount_image( /*fs=*/0x20000100, /*dir=*/0x20000000, /*flags=MS_LAZYTIME|MS_I_VERSION|MS_NOSUID|MS_NOEXEC|MS_DIRSYNC*/ 0x280008a, /*opts=*/0x20002140, /*chdir=*/0x16, /*size=*/0x2b4, /*img=*/0x200001c0)); // listxattr arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // list: nil // size: len = 0x0 (8 bytes) // ] NONFAILING(memcpy((void*)0x200004c0, "./file1\000", 8)); syscall(__NR_listxattr, /*path=*/0x200004c0ul, /*list=*/0ul, /*size=*/0ul); close_fds(); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*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=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); 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_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; }