// https://syzkaller.appspot.com/bug?id=007e4773adba81108370d2ac3043a362de94c8a4 // 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_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } 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 void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; for (;;) { uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts); if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) return 1; now = current_time_ms(); if (now - start > timeout) return 0; } } 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 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_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_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 struct nlmsg nlmsg; #define DEVLINK_FAMILY_NAME "devlink" #define DEVLINK_CMD_PORT_GET 5 #define DEVLINK_ATTR_BUS_NAME 1 #define DEVLINK_ATTR_DEV_NAME 2 #define DEVLINK_ATTR_NETDEV_NAME 7 static struct nlmsg nlmsg2; static void initialize_devlink_ports(const char* bus_name, const char* dev_name, const char* netdev_prefix) { struct genlmsghdr genlhdr; int len, total_len, id, err, offset; uint16_t netdev_index; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) exit(1); int rtsock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (rtsock == -1) exit(1); id = netlink_query_family_id(&nlmsg, sock, DEVLINK_FAMILY_NAME, true); if (id == -1) goto error; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = DEVLINK_CMD_PORT_GET; netlink_init(&nlmsg, id, NLM_F_DUMP, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1); netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1); err = netlink_send_ext(&nlmsg, sock, id, &total_len, true); if (err < 0) { goto error; } offset = 0; netdev_index = 0; while ((len = netlink_next_msg(&nlmsg, offset, total_len)) != -1) { struct nlattr* attr = (struct nlattr*)(nlmsg.buf + offset + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg.buf + offset + len; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == DEVLINK_ATTR_NETDEV_NAME) { char* port_name; char netdev_name[IFNAMSIZ]; port_name = (char*)(attr + 1); snprintf(netdev_name, sizeof(netdev_name), "%s%d", netdev_prefix, netdev_index); netlink_device_change(&nlmsg2, rtsock, port_name, true, 0, 0, 0, netdev_name); break; } } offset += len; netdev_index++; } error: close(rtsock); close(sock); } static int runcmdline(char* cmdline) { int ret = system(cmdline); if (ret) { } return ret; } #define DEV_IPV4 "172.20.20.%d" #define DEV_IPV6 "fe80::%02x" #define DEV_MAC 0x00aaaaaaaaaa static void netdevsim_add(unsigned int addr, unsigned int port_count) { write_file("/sys/bus/netdevsim/del_device", "%u", addr); if (write_file("/sys/bus/netdevsim/new_device", "%u %u", addr, port_count)) { char buf[32]; snprintf(buf, sizeof(buf), "netdevsim%d", addr); initialize_devlink_ports("netdevsim", buf, "netdevsim"); } } #define WG_GENL_NAME "wireguard" enum wg_cmd { WG_CMD_GET_DEVICE, WG_CMD_SET_DEVICE, }; enum wgdevice_attribute { WGDEVICE_A_UNSPEC, WGDEVICE_A_IFINDEX, WGDEVICE_A_IFNAME, WGDEVICE_A_PRIVATE_KEY, WGDEVICE_A_PUBLIC_KEY, WGDEVICE_A_FLAGS, WGDEVICE_A_LISTEN_PORT, WGDEVICE_A_FWMARK, WGDEVICE_A_PEERS, }; enum wgpeer_attribute { WGPEER_A_UNSPEC, WGPEER_A_PUBLIC_KEY, WGPEER_A_PRESHARED_KEY, WGPEER_A_FLAGS, WGPEER_A_ENDPOINT, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, WGPEER_A_LAST_HANDSHAKE_TIME, WGPEER_A_RX_BYTES, WGPEER_A_TX_BYTES, WGPEER_A_ALLOWEDIPS, WGPEER_A_PROTOCOL_VERSION, }; enum wgallowedip_attribute { WGALLOWEDIP_A_UNSPEC, WGALLOWEDIP_A_FAMILY, WGALLOWEDIP_A_IPADDR, WGALLOWEDIP_A_CIDR_MASK, }; static void netlink_wireguard_setup(void) { const char ifname_a[] = "wg0"; const char ifname_b[] = "wg1"; const char ifname_c[] = "wg2"; const char private_a[] = "\xa0\x5c\xa8\x4f\x6c\x9c\x8e\x38\x53\xe2\xfd\x7a\x70\xae\x0f\xb2\x0f\xa1" "\x52\x60\x0c\xb0\x08\x45\x17\x4f\x08\x07\x6f\x8d\x78\x43"; const char private_b[] = "\xb0\x80\x73\xe8\xd4\x4e\x91\xe3\xda\x92\x2c\x22\x43\x82\x44\xbb\x88\x5c" "\x69\xe2\x69\xc8\xe9\xd8\x35\xb1\x14\x29\x3a\x4d\xdc\x6e"; const char private_c[] = "\xa0\xcb\x87\x9a\x47\xf5\xbc\x64\x4c\x0e\x69\x3f\xa6\xd0\x31\xc7\x4a\x15" "\x53\xb6\xe9\x01\xb9\xff\x2f\x51\x8c\x78\x04\x2f\xb5\x42"; const char public_a[] = "\x97\x5c\x9d\x81\xc9\x83\xc8\x20\x9e\xe7\x81\x25\x4b\x89\x9f\x8e\xd9\x25" "\xae\x9f\x09\x23\xc2\x3c\x62\xf5\x3c\x57\xcd\xbf\x69\x1c"; const char public_b[] = "\xd1\x73\x28\x99\xf6\x11\xcd\x89\x94\x03\x4d\x7f\x41\x3d\xc9\x57\x63\x0e" "\x54\x93\xc2\x85\xac\xa4\x00\x65\xcb\x63\x11\xbe\x69\x6b"; const char public_c[] = "\xf4\x4d\xa3\x67\xa8\x8e\xe6\x56\x4f\x02\x02\x11\x45\x67\x27\x08\x2f\x5c" "\xeb\xee\x8b\x1b\xf5\xeb\x73\x37\x34\x1b\x45\x9b\x39\x22"; const uint16_t listen_a = 20001; const uint16_t listen_b = 20002; const uint16_t listen_c = 20003; const uint16_t af_inet = AF_INET; const uint16_t af_inet6 = AF_INET6; const struct sockaddr_in endpoint_b_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_b), .sin_addr = {htonl(INADDR_LOOPBACK)}}; const struct sockaddr_in endpoint_c_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_c), .sin_addr = {htonl(INADDR_LOOPBACK)}}; struct sockaddr_in6 endpoint_a_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_a)}; endpoint_a_v6.sin6_addr = in6addr_loopback; struct sockaddr_in6 endpoint_c_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_c)}; endpoint_c_v6.sin6_addr = in6addr_loopback; const struct in_addr first_half_v4 = {0}; const struct in_addr second_half_v4 = {(uint32_t)htonl(128 << 24)}; const struct in6_addr first_half_v6 = {{{0}}}; const struct in6_addr second_half_v6 = {{{0x80}}}; const uint8_t half_cidr = 1; const uint16_t persistent_keepalives[] = {1, 3, 7, 9, 14, 19}; struct genlmsghdr genlhdr = {.cmd = WG_CMD_SET_DEVICE, .version = 1}; int sock; int id, err; sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) { return; } id = netlink_query_family_id(&nlmsg, sock, WG_GENL_NAME, true); if (id == -1) goto error; netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_a, strlen(ifname_a) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_a, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_a, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[0], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v6, sizeof(endpoint_c_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[1], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_b, strlen(ifname_b) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_b, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_b, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[2], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v4, sizeof(endpoint_c_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[3], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_c, strlen(ifname_c) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_c, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_c, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[4], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[5], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } error: close(sock); } static void initialize_netdevices(void) { char netdevsim[16]; sprintf(netdevsim, "netdevsim%d", (int)procid); struct { const char* type; const char* dev; } devtypes[] = { {"ip6gretap", "ip6gretap0"}, {"bridge", "bridge0"}, {"vcan", "vcan0"}, {"bond", "bond0"}, {"team", "team0"}, {"dummy", "dummy0"}, {"nlmon", "nlmon0"}, {"caif", "caif0"}, {"batadv", "batadv0"}, {"vxcan", "vxcan1"}, {"veth", 0}, {"wireguard", "wg0"}, {"wireguard", "wg1"}, {"wireguard", "wg2"}, }; const char* devmasters[] = {"bridge", "bond", "team", "batadv"}; struct { const char* name; int macsize; bool noipv6; } devices[] = { {"lo", ETH_ALEN}, {"sit0", 0}, {"bridge0", ETH_ALEN}, {"vcan0", 0, true}, {"tunl0", 0}, {"gre0", 0}, {"gretap0", ETH_ALEN}, {"ip_vti0", 0}, {"ip6_vti0", 0}, {"ip6tnl0", 0}, {"ip6gre0", 0}, {"ip6gretap0", ETH_ALEN}, {"erspan0", ETH_ALEN}, {"bond0", ETH_ALEN}, {"veth0", ETH_ALEN}, {"veth1", ETH_ALEN}, {"team0", ETH_ALEN}, {"veth0_to_bridge", ETH_ALEN}, {"veth1_to_bridge", ETH_ALEN}, {"veth0_to_bond", ETH_ALEN}, {"veth1_to_bond", ETH_ALEN}, {"veth0_to_team", ETH_ALEN}, {"veth1_to_team", ETH_ALEN}, {"veth0_to_hsr", ETH_ALEN}, {"veth1_to_hsr", ETH_ALEN}, {"hsr0", 0}, {"dummy0", ETH_ALEN}, {"nlmon0", 0}, {"vxcan0", 0, true}, {"vxcan1", 0, true}, {"caif0", ETH_ALEN}, {"batadv0", ETH_ALEN}, {netdevsim, ETH_ALEN}, {"xfrm0", ETH_ALEN}, {"veth0_virt_wifi", ETH_ALEN}, {"veth1_virt_wifi", ETH_ALEN}, {"virt_wifi0", ETH_ALEN}, {"veth0_vlan", ETH_ALEN}, {"veth1_vlan", ETH_ALEN}, {"vlan0", ETH_ALEN}, {"vlan1", ETH_ALEN}, {"macvlan0", ETH_ALEN}, {"macvlan1", ETH_ALEN}, {"ipvlan0", ETH_ALEN}, {"ipvlan1", ETH_ALEN}, {"veth0_macvtap", ETH_ALEN}, {"veth1_macvtap", ETH_ALEN}, {"macvtap0", ETH_ALEN}, {"macsec0", ETH_ALEN}, {"veth0_to_batadv", ETH_ALEN}, {"veth1_to_batadv", ETH_ALEN}, {"batadv_slave_0", ETH_ALEN}, {"batadv_slave_1", ETH_ALEN}, {"geneve0", ETH_ALEN}, {"geneve1", ETH_ALEN}, {"wg0", 0}, {"wg1", 0}, {"wg2", 0}, }; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) netlink_add_device(&nlmsg, sock, devtypes[i].type, devtypes[i].dev); for (i = 0; i < sizeof(devmasters) / (sizeof(devmasters[0])); i++) { char master[32], slave0[32], veth0[32], slave1[32], veth1[32]; sprintf(slave0, "%s_slave_0", devmasters[i]); sprintf(veth0, "veth0_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave0, veth0); sprintf(slave1, "%s_slave_1", devmasters[i]); sprintf(veth1, "veth1_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave1, veth1); sprintf(master, "%s0", devmasters[i]); netlink_device_change(&nlmsg, sock, slave0, false, master, 0, 0, NULL); netlink_device_change(&nlmsg, sock, slave1, false, master, 0, 0, NULL); } netlink_add_xfrm(&nlmsg, sock, "xfrm0"); netlink_device_change(&nlmsg, sock, "bridge_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "bridge_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "hsr_slave_0", "veth0_to_hsr"); netlink_add_veth(&nlmsg, sock, "hsr_slave_1", "veth1_to_hsr"); netlink_add_hsr(&nlmsg, sock, "hsr0", "hsr_slave_0", "hsr_slave_1"); netlink_device_change(&nlmsg, sock, "hsr_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "hsr_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "veth0_virt_wifi", "veth1_virt_wifi"); netlink_add_linked(&nlmsg, sock, "virt_wifi", "virt_wifi0", "veth1_virt_wifi"); netlink_add_veth(&nlmsg, sock, "veth0_vlan", "veth1_vlan"); netlink_add_vlan(&nlmsg, sock, "vlan0", "veth0_vlan", 0, htons(ETH_P_8021Q)); netlink_add_vlan(&nlmsg, sock, "vlan1", "veth0_vlan", 1, htons(ETH_P_8021AD)); netlink_add_macvlan(&nlmsg, sock, "macvlan0", "veth1_vlan"); netlink_add_macvlan(&nlmsg, sock, "macvlan1", "veth1_vlan"); netlink_add_ipvlan(&nlmsg, sock, "ipvlan0", "veth0_vlan", IPVLAN_MODE_L2, 0); netlink_add_ipvlan(&nlmsg, sock, "ipvlan1", "veth0_vlan", IPVLAN_MODE_L3S, IPVLAN_F_VEPA); netlink_add_veth(&nlmsg, sock, "veth0_macvtap", "veth1_macvtap"); netlink_add_linked(&nlmsg, sock, "macvtap", "macvtap0", "veth0_macvtap"); netlink_add_linked(&nlmsg, sock, "macsec", "macsec0", "veth1_macvtap"); char addr[32]; sprintf(addr, DEV_IPV4, 14 + 10); struct in_addr geneve_addr4; if (inet_pton(AF_INET, addr, &geneve_addr4) <= 0) exit(1); struct in6_addr geneve_addr6; if (inet_pton(AF_INET6, "fc00::01", &geneve_addr6) <= 0) exit(1); netlink_add_geneve(&nlmsg, sock, "geneve0", 0, &geneve_addr4, 0); netlink_add_geneve(&nlmsg, sock, "geneve1", 1, 0, &geneve_addr6); netdevsim_add((int)procid, 4); netlink_wireguard_setup(); for (i = 0; i < sizeof(devices) / (sizeof(devices[0])); i++) { char addr[32]; sprintf(addr, DEV_IPV4, i + 10); netlink_add_addr4(&nlmsg, sock, devices[i].name, addr); if (!devices[i].noipv6) { sprintf(addr, DEV_IPV6, i + 10); netlink_add_addr6(&nlmsg, sock, devices[i].name, addr); } uint64_t macaddr = DEV_MAC + ((i + 10ull) << 40); netlink_device_change(&nlmsg, sock, devices[i].name, true, 0, &macaddr, devices[i].macsize, NULL); } close(sock); } static void initialize_netdevices_init(void) { int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); struct { const char* type; int macsize; bool noipv6; bool noup; } devtypes[] = { {"nr", 7, true}, {"rose", 5, true, true}, }; unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) { char dev[32], addr[32]; sprintf(dev, "%s%d", devtypes[i].type, (int)procid); sprintf(addr, "172.30.%d.%d", i, (int)procid + 1); netlink_add_addr4(&nlmsg, sock, dev, addr); if (!devtypes[i].noipv6) { sprintf(addr, "fe88::%02x:%02x", i, (int)procid + 1); netlink_add_addr6(&nlmsg, sock, dev, addr); } int macsize = devtypes[i].macsize; uint64_t macaddr = 0xbbbbbb + ((unsigned long long)i << (8 * (macsize - 2))) + (procid << (8 * (macsize - 1))); netlink_device_change(&nlmsg, sock, dev, !devtypes[i].noup, 0, &macaddr, macsize, NULL); } close(sock); } #define MAX_FDS 30 //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDWR); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } #define XT_TABLE_SIZE 1536 #define XT_MAX_ENTRIES 10 struct xt_counters { uint64_t pcnt, bcnt; }; struct ipt_getinfo { char name[32]; unsigned int valid_hooks; unsigned int hook_entry[5]; unsigned int underflow[5]; unsigned int num_entries; unsigned int size; }; struct ipt_get_entries { char name[32]; unsigned int size; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct ipt_replace { char name[32]; unsigned int valid_hooks; unsigned int num_entries; unsigned int size; unsigned int hook_entry[5]; unsigned int underflow[5]; unsigned int num_counters; struct xt_counters* counters; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct ipt_table_desc { const char* name; struct ipt_getinfo info; struct ipt_replace replace; }; static struct ipt_table_desc ipv4_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, {.name = "raw"}, {.name = "security"}, }; static struct ipt_table_desc ipv6_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, {.name = "raw"}, {.name = "security"}, }; #define IPT_BASE_CTL 64 #define IPT_SO_SET_REPLACE (IPT_BASE_CTL) #define IPT_SO_GET_INFO (IPT_BASE_CTL) #define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) struct arpt_getinfo { char name[32]; unsigned int valid_hooks; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_entries; unsigned int size; }; struct arpt_get_entries { char name[32]; unsigned int size; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_replace { char name[32]; unsigned int valid_hooks; unsigned int num_entries; unsigned int size; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_counters; struct xt_counters* counters; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_table_desc { const char* name; struct arpt_getinfo info; struct arpt_replace replace; }; static struct arpt_table_desc arpt_tables[] = { {.name = "filter"}, }; #define ARPT_BASE_CTL 96 #define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL) #define ARPT_SO_GET_INFO (ARPT_BASE_CTL) #define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1) static void checkpoint_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; table->replace.size = table->info.size; memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry)); memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow)); memcpy(table->replace.entrytable, entries.entrytable, table->info.size); } close(fd); } static void reset_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; if (table->info.valid_hooks == 0) continue; struct ipt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, level, IPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_arptables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; table->replace.size = table->info.size; memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry)); memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow)); memcpy(table->replace.entrytable, entries.entrytable, table->info.size); } close(fd); } static void reset_arptables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; if (table->info.valid_hooks == 0) continue; struct arpt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } else { } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, SOL_IP, ARPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } #define NF_BR_NUMHOOKS 6 #define EBT_TABLE_MAXNAMELEN 32 #define EBT_CHAIN_MAXNAMELEN 32 #define EBT_BASE_CTL 128 #define EBT_SO_SET_ENTRIES (EBT_BASE_CTL) #define EBT_SO_GET_INFO (EBT_BASE_CTL) #define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO + 1) #define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES + 1) #define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO + 1) struct ebt_replace { char name[EBT_TABLE_MAXNAMELEN]; unsigned int valid_hooks; unsigned int nentries; unsigned int entries_size; struct ebt_entries* hook_entry[NF_BR_NUMHOOKS]; unsigned int num_counters; struct ebt_counter* counters; char* entries; }; struct ebt_entries { unsigned int distinguisher; char name[EBT_CHAIN_MAXNAMELEN]; unsigned int counter_offset; int policy; unsigned int nentries; char data[0] __attribute__((aligned(__alignof__(struct ebt_replace)))); }; struct ebt_table_desc { const char* name; struct ebt_replace replace; char entrytable[XT_TABLE_SIZE]; }; static struct ebt_table_desc ebt_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "broute"}, }; static void checkpoint_ebtables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (size_t i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_INFO, &table->replace, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->replace.entries_size > sizeof(table->entrytable)) exit(1); table->replace.num_counters = 0; table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_ENTRIES, &table->replace, &optlen)) exit(1); } close(fd); } static void reset_ebtables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: case ENOENT: return; } exit(1); } for (unsigned i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; if (table->replace.valid_hooks == 0) continue; struct ebt_replace replace; memset(&replace, 0, sizeof(replace)); strcpy(replace.name, table->name); socklen_t optlen = sizeof(replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INFO, &replace, &optlen)) exit(1); replace.num_counters = 0; table->replace.entries = 0; for (unsigned h = 0; h < NF_BR_NUMHOOKS; h++) table->replace.hook_entry[h] = 0; if (memcmp(&table->replace, &replace, sizeof(table->replace)) == 0) { char entrytable[XT_TABLE_SIZE]; memset(&entrytable, 0, sizeof(entrytable)); replace.entries = entrytable; optlen = sizeof(replace) + replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_ENTRIES, &replace, &optlen)) exit(1); if (memcmp(table->entrytable, entrytable, replace.entries_size) == 0) continue; } for (unsigned j = 0, h = 0; h < NF_BR_NUMHOOKS; h++) { if (table->replace.valid_hooks & (1 << h)) { table->replace.hook_entry[h] = (struct ebt_entries*)table->entrytable + j; j++; } } table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (setsockopt(fd, SOL_IP, EBT_SO_SET_ENTRIES, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_net_namespace(void) { checkpoint_ebtables(); checkpoint_arptables(); checkpoint_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); checkpoint_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } static void reset_net_namespace(void) { reset_ebtables(); reset_arptables(); reset_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); reset_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } static void mount_cgroups(const char* dir, const char** controllers, int count) { if (mkdir(dir, 0777)) { return; } char enabled[128] = {0}; int i = 0; for (; i < count; i++) { if (mount("none", dir, "cgroup", 0, controllers[i])) { continue; } umount(dir); strcat(enabled, ","); strcat(enabled, controllers[i]); } if (enabled[0] == 0) { if (rmdir(dir) && errno != EBUSY) exit(1); return; } if (mount("none", dir, "cgroup", 0, enabled + 1)) { if (rmdir(dir) && errno != EBUSY) exit(1); } if (chmod(dir, 0777)) { } } static void mount_cgroups2(const char** controllers, int count) { if (mkdir("/syzcgroup/unified", 0777)) { return; } if (mount("none", "/syzcgroup/unified", "cgroup2", 0, NULL)) { if (rmdir("/syzcgroup/unified") && errno != EBUSY) exit(1); return; } if (chmod("/syzcgroup/unified", 0777)) { } int control = open("/syzcgroup/unified/cgroup.subtree_control", O_WRONLY); if (control == -1) return; int i; for (i = 0; i < count; i++) if (write(control, controllers[i], strlen(controllers[i])) < 0) { } close(control); } static void setup_cgroups() { const char* unified_controllers[] = {"+cpu", "+io", "+pids"}; const char* net_controllers[] = {"net", "net_prio", "devices", "blkio", "freezer"}; const char* cpu_controllers[] = {"cpuset", "cpuacct", "hugetlb", "rlimit", "memory"}; if (mkdir("/syzcgroup", 0777)) { return; } mount_cgroups2(unified_controllers, sizeof(unified_controllers) / sizeof(unified_controllers[0])); mount_cgroups("/syzcgroup/net", net_controllers, sizeof(net_controllers) / sizeof(net_controllers[0])); mount_cgroups("/syzcgroup/cpu", cpu_controllers, sizeof(cpu_controllers) / sizeof(cpu_controllers[0])); write_file("/syzcgroup/cpu/cgroup.clone_children", "1"); write_file("/syzcgroup/cpu/cpuset.memory_pressure_enabled", "1"); } static void setup_cgroups_loop() { int pid = getpid(); char file[128]; char cgroupdir[64]; snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/unified/syz%llu", procid); if (mkdir(cgroupdir, 0777)) { } snprintf(file, sizeof(file), "%s/pids.max", cgroupdir); write_file(file, "32"); snprintf(file, sizeof(file), "%s/cgroup.procs", cgroupdir); write_file(file, "%d", pid); snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/cpu/syz%llu", procid); if (mkdir(cgroupdir, 0777)) { } snprintf(file, sizeof(file), "%s/cgroup.procs", cgroupdir); write_file(file, "%d", pid); snprintf(file, sizeof(file), "%s/memory.soft_limit_in_bytes", cgroupdir); write_file(file, "%d", 299 << 20); snprintf(file, sizeof(file), "%s/memory.limit_in_bytes", cgroupdir); write_file(file, "%d", 300 << 20); snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/net/syz%llu", procid); if (mkdir(cgroupdir, 0777)) { } snprintf(file, sizeof(file), "%s/cgroup.procs", cgroupdir); write_file(file, "%d", pid); } static void setup_cgroups_test() { char cgroupdir[64]; snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/unified/syz%llu", procid); if (symlink(cgroupdir, "./cgroup")) { } snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/cpu/syz%llu", procid); if (symlink(cgroupdir, "./cgroup.cpu")) { } snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/net/syz%llu", procid); if (symlink(cgroupdir, "./cgroup.net")) { } } static void initialize_cgroups() { if (mkdir("./syz-tmp/newroot/syzcgroup", 0700)) exit(1); if (mkdir("./syz-tmp/newroot/syzcgroup/unified", 0700)) exit(1); if (mkdir("./syz-tmp/newroot/syzcgroup/cpu", 0700)) exit(1); if (mkdir("./syz-tmp/newroot/syzcgroup/net", 0700)) exit(1); unsigned bind_mount_flags = MS_BIND | MS_REC | MS_PRIVATE; if (mount("/syzcgroup/unified", "./syz-tmp/newroot/syzcgroup/unified", NULL, bind_mount_flags, NULL)) { } if (mount("/syzcgroup/cpu", "./syz-tmp/newroot/syzcgroup/cpu", NULL, bind_mount_flags, NULL)) { } if (mount("/syzcgroup/net", "./syz-tmp/newroot/syzcgroup/net", NULL, bind_mount_flags, NULL)) { } } 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); initialize_cgroups(); if (mkdir("./syz-tmp/pivot", 0777)) exit(1); if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) { if (chdir("./syz-tmp")) exit(1); } else { if (chdir("/")) exit(1); if (umount2("./pivot", MNT_DETACH)) exit(1); } if (chroot("./newroot")) exit(1); if (chdir("/")) exit(1); setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } static void setup_gadgetfs() { if (mkdir("/dev/gadgetfs", 0777)) { } if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { } } static void setup_fusectl() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (getppid() == 1) exit(1); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); sandbox_common(); drop_caps(); initialize_netdevices_init(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); initialize_netdevices(); sandbox_common_mount_tmpfs(); loop(); exit(1); } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; retry: while (umount2(dir, umount_flags) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, umount_flags) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, umount_flags)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, umount_flags)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_loop() { setup_cgroups_loop(); checkpoint_net_namespace(); } static void reset_loop() { char buf[64]; snprintf(buf, sizeof(buf), "/dev/loop%llu", procid); int loopfd = open(buf, O_RDWR); if (loopfd != -1) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } reset_net_namespace(); } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); setup_cgroups_test(); write_file("/proc/self/oom_score_adj", "1000"); if (symlink("/dev/binderfs", "./binderfs")) { } } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } #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; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 7; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); event_timedwait(&th->done, 50 + (call == 0 ? 4000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); close_fds(); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { setup_loop(); int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: // 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 = 0x3000046 (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 { // delalloc: buffer: {64 65 6c 61 6c 6c 6f 63} (length 0x8) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // data_err_abort: buffer: {64 61 74 61 5f 65 72 72 3d 61 62 6f // 72 74} (length 0xe) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // barrier_val: fs_opt["barrier", fmt[hex, int32]] { // name: buffer: {62 61 72 72 69 65 72} (length 0x7) // eq: const = 0x3d (1 bytes) // val: int32 = 0x2 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // dioread_lock: buffer: {64 69 6f 72 65 61 64 5f 6c 6f 63 6b} // (length 0xc) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // data_err_ignore: buffer: {64 61 74 61 5f 65 72 72 3d 69 67 // 6e 6f 72 65} (length 0xf) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // max_dir_size_kb: fs_opt["max_dir_size_kb", fmt[hex, int32]] // { // name: buffer: {6d 61 78 5f 64 69 72 5f 73 69 7a 65 5f 6b // 62} (length 0xf) eq: const = 0x3d (1 bytes) val: int32 = // 0x4007b1 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // data_err_ignore: buffer: {64 61 74 61 5f 65 72 72 3d 69 67 // 6e 6f 72 65} (length 0xf) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // grpquota: buffer: {67 72 70 71 75 6f 74 61} (length 0x8) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // nobh: buffer: {6e 6f 62 68} (length 0x4) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // user_xattr: buffer: {75 73 65 72 5f 78 61 74 74 72} (length // 0xa) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // bh: buffer: {62 68} (length 0x2) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // dioread_nolock: buffer: {64 69 6f 72 65 61 64 5f 6e 6f 6c 6f // 63 6b} (length 0xe) // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x553 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x553) // } // ] // returns fd_dir memcpy((void*)0x200000000040, "ext4\000", 5); memcpy((void*)0x200000000000, "./file1\000", 8); memcpy((void*)0x200000000380, "delalloc", 8); *(uint8_t*)0x200000000388 = 0x2c; memcpy((void*)0x200000000389, "data_err=abort", 14); *(uint8_t*)0x200000000397 = 0x2c; memcpy((void*)0x200000000398, "barrier", 7); *(uint8_t*)0x20000000039f = 0x3d; sprintf((char*)0x2000000003a0, "0x%016llx", (long long)2); *(uint8_t*)0x2000000003b2 = 0x2c; memcpy((void*)0x2000000003b3, "dioread_lock", 12); *(uint8_t*)0x2000000003bf = 0x2c; memcpy((void*)0x2000000003c0, "data_err=ignore", 15); *(uint8_t*)0x2000000003cf = 0x2c; memcpy((void*)0x2000000003d0, "max_dir_size_kb", 15); *(uint8_t*)0x2000000003df = 0x3d; sprintf((char*)0x2000000003e0, "0x%016llx", (long long)0x4007b1); *(uint8_t*)0x2000000003f2 = 0x2c; memcpy((void*)0x2000000003f3, "data_err=ignore", 15); *(uint8_t*)0x200000000402 = 0x2c; memcpy((void*)0x200000000403, "grpquota", 8); *(uint8_t*)0x20000000040b = 0x2c; memcpy((void*)0x20000000040c, "nobh", 4); *(uint8_t*)0x200000000410 = 0x2c; memcpy((void*)0x200000000411, "user_xattr", 10); *(uint8_t*)0x20000000041b = 0x2c; memcpy((void*)0x20000000041c, "bh", 2); *(uint8_t*)0x20000000041e = 0x2c; memcpy((void*)0x20000000041f, "dioread_nolock", 14); *(uint8_t*)0x20000000042d = 0x2c; *(uint8_t*)0x20000000042e = 0; memcpy( (void*)0x200000000a40, "\x78\x9c\xec\xdd\xdf\x6b\x5b\x55\x1c\x00\xf0\xef\x4d\xdb\xfd\xd6\x75" "\x30\x86\x8a\x48\x61\x0f\x4e\xe6\xd2\xb5\xf5\xc7\x04\x1f\xe6\xa3\xe8" "\x70\xa0\xef\x33\xb4\x77\x65\x34\x59\x46\x93\x8e\xb5\x0e\xdc\x1e\xdc" "\x8b\x2f\x32\x04\x11\x07\xe2\xbb\xbe\xfb\x38\xfc\x07\xfc\x2b\x06\x3a" "\x18\x32\x8a\x3e\xf8\x12\xb9\xe9\x4d\x97\xad\x49\x9b\x75\xd9\xd2\x99" "\xcf\x07\x6e\x39\x27\xf7\x26\xe7\x7e\x73\xef\xf7\xf4\xdc\x9c\x1b\x12" "\xc0\xd0\x9a\xc8\xfe\x14\x22\x5e\x8e\x88\x6f\x92\x88\x83\x11\x91\xe4" "\xeb\x46\x23\x5f\x39\xb1\xb6\xdd\xea\xfd\xab\xb3\xd9\x92\x44\xa3\xf1" "\xe9\x5f\x49\x73\xbb\xac\xde\x7a\xad\xd6\xf3\xf6\xe7\x95\x97\x22\xe2" "\xb7\xaf\x22\x8e\x17\x36\xb6\x5b\x5b\x5e\x59\x28\x95\xcb\xe9\x62\x5e" "\x9f\xac\x57\x2e\x4d\xd6\x96\x57\x4e\x5c\xa8\x94\xe6\xd3\xf9\xf4\xe2" "\xf4\xcc\xcc\xa9\xb7\x67\xa6\xdf\x7b\xf7\x9d\xbe\xc5\xfa\xc6\xd9\x7f" "\xbe\xff\xe4\xf6\x87\xa7\xbe\x3e\xba\xfa\xdd\x2f\x77\x0f\xdd\x4c\xe2" "\x74\x1c\xc8\xd7\xb5\xc7\xf1\x04\xae\xb5\x57\x26\x62\x22\x7f\x4f\xc6" "\xe2\xf4\x23\x1b\x4e\xf5\xa1\xb1\x9d\x24\x19\xf4\x0e\xb0\x2d\x23\x79" "\x9e\x8f\x45\xd6\x07\x1c\x8c\x91\x3c\xeb\x81\xff\xbf\x2f\x23\xa2\x01" "\x0c\xa9\x44\xfe\xc3\x90\x6a\x8d\x03\x5a\xd7\xf6\x7d\xba\x0e\x7e\x6e" "\xdc\xfb\x60\xed\x02\x68\x63\xfc\xa3\x6b\x9f\x8d\xc4\x9e\xe6\xb5\xd1" "\xbe\xd5\xe4\xa1\x2b\xa3\xec\x7a\x77\xbc\x0f\xed\x67\x6d\xfc\xfa\xe7" "\xad\x9b\xd9\x12\xfd\xfb\x1c\x02\x60\x4b\xd7\xae\x47\xc4\xc9\xd1\xd1" "\x8d\xfd\x5f\x92\xf7\x7f\xdb\x77\xb2\x87\x6d\x1e\x6d\x43\xff\x07\xcf" "\xce\xed\x6c\xfc\xf3\x66\xa7\xf1\x4f\x61\x7d\xfc\x13\x1d\xc6\x3f\xfb" "\x3b\xe4\xee\x76\x6c\x9d\xff\x85\xbb\x7d\x68\xa6\xab\x6c\xfc\xf7\x7e" "\xc7\xf1\xef\xfa\xa4\xd5\xf8\x48\x5e\x7b\xa1\x39\xe6\x1b\x4b\xce\x5f" "\x28\xa7\x59\xdf\xf6\x62\x44\x1c\x8b\xb1\xdd\x59\x7d\xb3\xf9\x9c\x53" "\xab\x77\x1a\xdd\xd6\xb5\x8f\xff\xb2\x25\x6b\xbf\x35\x16\xcc\xf7\xe3" "\xee\xe8\xee\x87\x9f\x33\x57\xaa\x97\x9e\x24\xe6\x76\xf7\xae\x47\xbc" "\xd2\x71\xfc\x9b\xac\x1f\xff\xa4\xc3\xf1\xcf\xde\x8f\xb3\x3d\xb6\x71" "\x24\xbd\xf5\x5a\xb7\x75\x5b\xc7\xff\x74\x35\x7e\x8a\x78\xbd\xe3\xf1" "\x7f\x30\xa3\x95\x6c\x3e\x3f\x39\xd9\x3c\x1f\x26\x5b\x67\xc5\x46\x7f" "\xdf\x38\xf2\x7b\xb7\xf6\x07\x1d\x7f\x76\xfc\xf7\x6d\x1e\xff\x78\xd2" "\x3e\x5f\x5b\x7b\xfc\x36\x7e\xdc\xf3\x6f\xda\x6d\xdd\x43\xf1\x47\xef" "\xe7\xff\xae\xe4\xb3\x66\x79\x57\xfe\xd8\x95\x52\xbd\xbe\x38\x15\xb1" "\x2b\xf9\x78\xe3\xe3\xd3\x0f\x9e\xdb\xaa\xb7\xb6\xcf\xe2\x3f\x76\x74" "\xf3\xfe\xaf\xd3\xf9\xbf\x37\x22\x3e\xef\x31\xfe\x1b\x87\x7f\x7e\xb5" "\xa7\xf8\x07\x74\xfc\xe7\x1e\xeb\xf8\x3f\x7e\xe1\xce\x47\x5f\xfc\xd0" "\xad\xfd\xde\xfa\xbf\xb7\x9a\xa5\x63\xf9\x23\xbd\xf4\x7f\xbd\xee\xe0" "\x93\xbc\x77\x00\x00\x00\x00\x00\x00\xb0\xd3\x14\x22\xe2\x40\x24\x85" "\xe2\x7a\xb9\x50\x28\x16\xd7\xee\xef\x38\x1c\xfb\x0a\xe5\x6a\xad\x7e" "\xfc\x7c\x75\xe9\xe2\x5c\x34\xbf\x2b\x3b\x1e\x63\x85\xd6\x4c\xf7\xc1" "\xb6\xfb\x21\xa6\xf2\xfb\x61\x5b\xf5\xe9\x47\xea\x33\x11\x71\x28\x22" "\xbe\x1d\xd9\xdb\xac\x17\x67\xab\xe5\xb9\x41\x07\x0f\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3b\xc4\xfe\x2e\xdf\xff" "\xcf\xfc\x31\x32\xe8\xbd\x03\x9e\x3a\x3f\xf9\x0d\xc3\x6b\xcb\xfc\xef" "\xc7\x2f\x3d\x01\x3b\x92\xff\xff\x30\xbc\xe4\x3f\x0c\x2f\xf9\x0f\xc3" "\x4b\xfe\xc3\xf0\x92\xff\x30\xbc\xe4\x3f\x0c\x2f\xf9\x0f\xc3\x4b\xfe" "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x40\x5f\x9d\x3d\x73\x26\x5b\x1a\xab\xf7\xaf\xce\x66" "\xf5\xb9\xcb\xcb\x4b\x0b\xd5\xcb\x27\xe6\xd2\xda\x42\xb1\xb2\x34\x5b" "\x9c\xad\x2e\x5e\x2a\xce\x57\xab\xf3\xe5\xb4\x38\x5b\xad\x6c\xf5\x7a" "\xe5\x6a\xf5\xd2\xd4\x74\x2c\x5d\x99\xac\xa7\xb5\xfa\x64\x6d\x79\xe5" "\x5c\xa5\xba\x74\xb1\x7e\xee\x42\xa5\x34\x9f\x9e\x4b\xc7\x9e\x49\x54" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x7c" "\xa9\x2d\xaf\x2c\x94\xca\xe5\x74\x51\x41\x61\x5b\x85\xd1\x9d\xb1\x1b" "\x0a\x7d\x2e\x0c\xba\x67\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\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\x07\xfe\x0b\x00\x00\xff\xff\xe8" "\x06\x37\xb1", 1363); syz_mount_image( /*fs=*/0x200000000040, /*dir=*/0x200000000000, /*flags=MS_LAZYTIME|MS_STRICTATIME|MS_NOSUID|MS_NODEV|MS_MANDLOCK*/ 0x3000046, /*opts=*/0x200000000380, /*chdir=*/1, /*size=*/0x553, /*img=*/0x200000000a40); break; case 1: // mount$incfs arguments: [ // src: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // dst: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // type: ptr[in, buffer] { // buffer: {69 6e 63 72 65 6d 65 6e 74 61 6c 2d 66 73 00} (length 0xf) // } // flags: mount_flags = 0x0 (8 bytes) // opts: nil // ] memcpy((void*)0x200000000140, "./file0\000", 8); memcpy((void*)0x200000000100, "./file0\000", 8); memcpy((void*)0x200000000040, "incremental-fs\000", 15); syscall(__NR_mount, /*src=*/0x200000000140ul, /*dst=*/0x200000000100ul, /*type=*/0x200000000040ul, /*flags=*/0ul, /*opts=*/0ul); break; case 2: // creat arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // mode: open_mode = 0x0 (8 bytes) // ] // returns fd memcpy((void*)0x200000000040, "./bus\000", 6); syscall(__NR_creat, /*file=*/0x200000000040ul, /*mode=*/0ul); break; case 3: // mount arguments: [ // src: 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) // } // } // } // dst: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // type: nil // flags: mount_flags = 0x63d014 (8 bytes) // data: nil // ] memcpy((void*)0x200000000380, "/dev/loop", 9); *(uint8_t*)0x200000000389 = 0x30 + procid * 1; *(uint8_t*)0x20000000038a = 0; memcpy((void*)0x200000000180, "./bus\000", 6); syscall( __NR_mount, /*src=*/0x200000000380ul, /*dst=*/0x200000000180ul, /*type=*/0ul, /*flags=MS_UNBINDABLE|MS_POSIXACL|MS_REC|MS_SYNCHRONOUS|MS_SILENT|0x601004*/ 0x63d014ul, /*data=*/0ul); break; case 4: // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // flags: open_flags = 0x185102 (8 bytes) // mode: open_mode = 0x0 (8 bytes) // ] // returns fd memcpy((void*)0x200000000080, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x200000000080ul, /*flags=O_SYNC|O_NOCTTY|O_DIRECT|O_CLOEXEC|O_RDWR*/ 0x185102ul, /*mode=*/0ul); if (res != -1) r[0] = res; break; case 5: // mmap arguments: [ // addr: VMA[0x800000] // len: len = 0x800000 (8 bytes) // prot: mmap_prot = 0x2 (8 bytes) // flags: mmap_flags = 0x28011 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x800000ul, /*prot=PROT_WRITE*/ 2ul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[0], /*offset=*/0ul); break; case 6: // write$UHID_INPUT arguments: [ // fd: fd_uhid (resource) // data: ptr[in, uhid_req[UHID_INPUT, uhid_input_req]] { // uhid_req[UHID_INPUT, uhid_input_req] { // type: const = 0x8 (4 bytes) // data: uhid_input_req { // data: buffer: {45 5e 99 f0 1d 7d 7e c0 b7 92 64 c1 c8 33 98 e0 // 8b 17 c1 a5 ce bd 63 f4 25 e6 e9 ba ce 7f 6f 52 a2 8f 77 85 42 // e5 1b 13 05 f3 7d 85 57 73 3a 54 87 22 a5 fa dc f5 e0 64 a1 ae // 67 35 d8 63 5d 14 65 2e d5 c0 18 b4 46 9e f4 00 38 b0 fc e2 2f // 8f 44 db b6 42 76 b4 2a b6 12 03 fd fc 4a 1f 5e 98 1b 0f 90 1e // a8 4c 16 28 a7 e8 5e dc 42 93 25 96 a4 8a 76 8f 54 5a 8c 3b a2 // 0d 0b cc 0f 2a 12 6d 3a 35 19 13 43 dd 27 11 3a ca 34 03 7a 52 // 50 ac 97 d0 08 f3 28 7f d6 a9 5f 7f fd e1 ad 03 27 9d 24 05 2f // 17 14 10 1d 0c dc e8 1d c6 95 3a 47 29 0c 31 c4 67 dc e8 23 2e // dd e1 f5 72 93 89 d2 39 d0 11 55 a9 0b 71 06 95 b1 21 9b db af // 54 be 4d b2 90 3d b1 f2 00 f5 72 5d 74 c1 68 12 71 81 da e3 be // dc 79 84 0a 9c 4f b9 07 7a d4 4e f5 33 9d 17 02 02 6e 09 83 ff // b1 e0 4b a1 06 30 85 35 62 d3 7e 35 ec 27 24 9b 77 94 c5 d1 6f // b4 66 17 39 94 8a ff 20 25 e5 67 64 6e 7a d9 58 06 ac 67 df 08 // aa af 0f 60 8f 38 fe 3e 2d 58 fe cf f3 c8 85 a8 ce 59 93 51 85 // 4d 15 f8 22 03 88 7d 8c f0 5b a8 d9 81 43 c8 f9 23 e7 91 ff a4 // 75 e8 b2 a2 47 dd 49 66 3d 6a 2a bc 17 45 f8 e8 d2 3b 1e 9f b8 // c2 e8 80 5b af da 80 2c e5 dc 84 76 31 72 71 be 13 bf 45 4e 9d // 11 73 6f 3e e3 d8 30 41 93 94 85 61 47 f9 5e d8 4e 11 c7 a5 a9 // 8c aa 2c 43 e0 56 87 58 83 cd 2a 71 97 97 58 db ff 78 5a bd 0a // d1 a4 94 59 e4 94 cb 40 9d 4e fe 0f 6c 92 77 1e e8 39 38 79 9d // aa db 2b f9 8c cb df 25 17 cd bd 5b cb ff 91 9e 51 d2 25 c5 b0 // d7 f4 55 df bb fb 9e 2a b2 11 1a 17 ae 55 95 94 95 d8 d7 66 c7 // cd 62 ef a3 3d bf 1d 74 23 8c 25 7f 47 51 6b 74 ec dc 8e 46 85 // e4 61 de 05 79 23 7c ae 86 6d fe 2a f4 56 0a 93 76 29 7a cf 56 // c3 9b 96 bd 4c 63 c9 ce 32 24 37 03 42 3b d4 ca 0a 2f b1 1c 01 // 5e 5b 07 9d 5b 19 20 36 fa 66 3b ab 46 66 57 10 53 3e 16 7b 63 // c3 b3 cd bb f9 8f e5 bf 65 e9 87 14 4a 6c 2b 62 51 b7 ef 59 23 // 8e c9 a1 99 4c c9 66 ea 7e 05 2c 5c e4 07 24 ad f1 4e a1 00 f5 // e3 04 b0 e8 a5 77 39 84 bb e9 ea 74 a9 aa b9 b0 06 d3 ff 2a cf // 84 8e 4e 18 13 cf a5 13 cf 97 52 f5 a0 c5 13 4d 8a 44 87 33 b8 // 24 78 63 bb 68 30 a4 7c e8 1c a8 07 42 d5 54 b8 b2 b3 76 0d df // 64 0d 89 58 46 84 5d 19 9c 81 70 10 8c 98 90 8b fc 5a 8a 4c 4e // ad 5a d7 cf 99 be 82 53 a1 4b fb 59 8b f1 0f 39 f7 c9 56 21 ea // c1 03 d3 e1 ea a8 22 b8 3c 64 62 e6 42 8e e6 f8 dd 0d c7 d2 bb // a4 04 80 f2 28 36 d4 43 c6 55 f8 3e c0 90 5f c9 98 53 2a b6 73 // 65 33 f7 96 66 3f f4 1e 82 0c 23 61 f5 54 92 11 10 e1 be 5d 9a // f4 7e ea e2 62 40 43 43 c0 b4 28 36 26 1a 71 6f 5e 4c a8 ac 38 // b9 0d 2a 46 1f 9c 9a e0 88 ce 43 75 49 d0 86 ec a6 0b 61 71 c0 // ab 0e 98 db 0c 0b 21 2b 6d c3 b0 6d af 78 c8 91 2d 22 d4 57 dc // 48 bd 6a 0a b3 96 5f 93 b3 df ba b1 62 6f 2d d0 5b 3a ee 0b 04 // da 6a a8 08 a3 9c 41 04 1f 11 b5 5c fa 3d 44 72 a4 98 5f 6a 22 // 4d 58 ee 82 03 c0 5d 6d b2 08 d5 7e 93 ee de 51 11 0d d3 6b cd // 66 45 be 26 6d e2 a7 1d 96 0d 81 ce 1d 9b 66 44 e6 bd 94 d7 90 // f5 29 4a 0a cf 78 9f 43 b2 1a 83 c8 17 b0 d1 36 90 eb 9a 83 c6 // 3e 87 55 85 80 63 c6 1b fa 42 0f 37 2d b6 87 a9 19 eb 67 2f 25 // c2 2d cc fc af 22 f9 3d 17 f3 33 5e 30 42 b6 ba 1b ea b5 4d c2 // c6 aa df a1 67 34 0a a5 b3 71 5f 66 d1 47 60 48 b0 8e 58 10 f1 // c7 90 d6 18 6b 5f 42 f3 10 35 87 17 fa 8c dc 2a 31 7f 92 6c 81 // 1b 8f f3 6c 72 7b 4a 48 5a 5b 08 75 20 78 77 ae 41 65 5a 10 7e // 0f f3 35 b7 b9 c2 42 83 12 59 84 2c 0e ed e5 42 bd c6 4d f2 a2 // e5 f2 ca de 65 1b c5 7e 72 28 3f 23 9b b1 d6 9a 29 80 44 b8 93 // 43 f8 be 1a ec b4 6d bc 68 5a 3b 3e 26 c3 e3 2d 30 45 e6 01 b2 // 09 af 08 6c 03 a3 fa d6 09 44 ce 9f 70 27 f4 2d 9c ce fb e2 35 // 3e 5b bf dd 6e a7 71 69 3c 13 14 b7 02 db 9f 8c c5 ce 5a d0 5e // f9 9f 54 da 13 13 9b 83 2d 6b 98 32 61 aa d7 e0 f6 cc 39 54 54 // 7b 90 2b 51 cf 34 5e 0d f0 31 10 97 be 34 b3 0e 4c a7 13 dc bc // 52 0e 52 2f 7c 6a ee e5 b3 10 66 cc c7 98 76 ad ca 6f 55 6c b1 // b2 31 00 3e 31 69 99 1a 25 12 93 c6 7c ce 9a 78 bf fe 36 c7 78 // b8 ce 91 10 fd ac 3e c5 4b ac 57 d7 93 fe 1f eb bf 66 9d 69 6a // cd ec b5 f6 1f e6 bd 1b c0 50 c3 73 5b a0 a7 cd 0d a7 f4 92 61 // d7 1d 6e a8 f7 5c 9d 7d 5d 84 34 72 d1 5c 75 e9 b3 d2 33 b8 7d // 75 1b e4 7b ac 72 14 9e 7c 46 c9 79 f3 5a 61 56 63 1e 96 75 e1 // f5 36 c4 9d b2 a0 50 4b e5 15 29 30 8e df 0e 78 92 0a 13 47 9b // 24 b2 5a 3d 2e b4 18 a9 28 9b a4 56 92 48 3c d9 1e 9f c7 c5 b6 // a4 ed 13 ad fe c4 4e 7a c6 f5 30 bc 11 a6 45 6d 73 88 a7 b5 da // 3f d5 23 dd 73 02 47 7e b6 7d 87 ad 9a 6e 13 c9 36 ae 83 b1 79 // b3 a4 8f 63 5a 4e 7d ca ad d3 c0 c6 9a b6 ac 97 e7 fa c7 93 0e // 66 4e cd a2 a4 40 be 58 85 48 e0 f0 cb b4 8a 77 56 60 ec 34 0f // 2d f2 9a 7f a0 8f 99 fb fb 35 ea 01 67 fe 85 0d 15 65 11 17 d5 // d6 16 f5 cc be 22 0e f7 69 6c 60 0a 0b 0b 1b 46 29 d9 78 b9 09 // a1 b4 03 fe 8e d6 4c 23 fa 91 27 b4 5a 1f ab 86 92 69 04 2e bd // 76 f4 ff f2 a4 ca d5 d2 cd 7a 75 72 fa 43 06 a9 54 3e 2e 5e 94 // 18 f7 85 6e bf 2a 70 35 44 18 db 24 2c d6 37 b8 a8 2b bb d1 e9 // 2d a2 ef 0b bd 77 97 c0 6d bb 62 29 59 06 8e d4 1b 02 59 7a aa // 42 18 94 9e a6 b0 2c 92 af a4 f9 bc aa 15 7d 41 19 6b 58 3b 8b // d5 d7 2b d1 bc 45 03 bd 44 7b fa 78 ef 27 be 07 ea 1b 04 0f 2b // fa cb c5 9c 70 a7 29 de b0 b3 9e e3 6f 73 6d 59 b0 0c 49 e1 46 // 98 59 86 28 49 0c a9 d6 ce 6a 51 35 89 54 87 d3 cd 99 25 c5 ce // 75 8d dc a0 b5 86 59 d8 3a a9 96 9b 80 b0 d1 90 83 a0 26 96 6b // 7d 82 f4 7f 20 cd ef f2 ed f7 5b 78 70 51 d6 18 2b b2 5b d6 06 // 25 69 b9 57 12 fd 26 b3 c1 86 07 b4 af e2 ba bc 3c 61 9f 3d be // 35 5e 9e 22 9b 65 a3 40 ca d5 5b 29 5b 2b 21 db 11 48 46 55 30 // 95 40 01 00 00 00 00 00 00 24 62 e6 aa 97 e1 14 84 a9 d6 b3 a9 // f5 8e 17 12 2a 5a 79 8e 92 c3 88 5e 32 00 a2 53 cc be 59 a9 4e // a1 46 cf 27 02 d7 c5 03 dd 11 34 a6 ad 51 53 51 67 1b eb b1 a2 // 6a 27 01 d9 ae 10 23 46 aa e5 a2 bc a3 84 01 27 fd 98 6c 83 1a // 2e e1 20 75 57 92 bc d2 01 82 df f8 f3 7f 4e d2 52 ca d1 32 78 // d3 29 91 4b e4 75 77 3e 07 7b 8d ba ca 00 3c a7 b6 d4 c2 08 78 // 8a cd 4b b8 7a 60 c4 0e 08 ee 55 18 97 f5 cc af de ae 66 e6 48 // 69 73 bc f8 0d 24 87 62 e5 26 70 3f e4 5c 21 2c e4 c4 c6 56 62 // 7c d5 32 9b 5d ab 25 1c 97 e4 44 8f ea ab ea f1 63 0e 07 ba 04 // 3a 2a 8f 40 05 d2 3f ed 63 da 24 7a 8e 29 63 9b 97 e7 c2 bb 1e // d8 c0 23 33 39 76 18 8e 91 4d ee c0 ac 2a f4 b7 f3 78 12 7b f3 // 38 16 b8 1c 61 77 ed a8 f1 43 19 5a f5 50 2d 45 e4 17 7a 7d 94 // 58 3c 11 25 e2 e4 59 bd 51 83 f6 97 6f f5 58 89 94 f9 bf 09 d5 // 25 57 be c2 ae 55 f9 de 3e ea fd 9c 57 2f c8 0f 4b 3d e5 19 f7 // c2 31 bc 53 e9 b3 ff d6 73 b4 54 13 bc 78 f8 b3 b8 f2 68 d6 40 // 3c c5 6f b6 9c d3 c0 39 c7 13 9b a5 33 5f 69 b7 78 33 c0 87 b9 // 5f f3 c0 fb bd 07 8c b2 0a f0 ad c7 bf ca 2b 01 76 52 76 25 ce // 31 e0 af 4b a3 b5 b6 64 28 36 3a 18 9f 05 e1 3c 57 f8 8f a9 6d // d2 1b 35 16 b9 47 44 b8 7c ed 87 fe d0 aa 90 e6 e5 33 57 20 6f // 0f 3c 0b e3 ea 96 08 27 e3 12 81 ee cf ad 74 db 9a 7f 4f 14 eb // 59 7f 7a 70 a4 e4 f4 1e 48 4f ca 46 73 31 3d 2e 3d 3f 70 98 7b // 11 74 d8 4b 89 3d d4 c1 91 a0 ef a4 68 ed 04 5c bc 49 92 90 dc // 65 fc 4b 85 09 8f 83 68 5e 52 14 a2 4d 30 4d b6 9c f7 ed b6 e9 // 9e 5d 93 da 62 55 c8 42 30 31 5d 33 1a 84 a5 c3 3c 59 58 13 4d // be 3e 01 29 0a 4e bb 13 43 78 a2 af 7c 23 fb de 0a dc 48 f3 21 // 35 dd c7 ab 3c bc 94 67 e8 1e 76 48 40 85 db 2a bb 90 2b 87 58 // 1a d6 de 8f 9d 47 e6 d5 99 63 6d ed 2d 47 f4 c2 a7 13 eb 3e 61 // 7c 89 ce 50 10 66 c0 5c 7b 68 04 f5 77 34 35 15 58 30 26 0b 9f // da e8 0a 1c 3f 14 8a 0e 22 3c f7 d0 54 3a 7a ff bf 89 f0 1d ad // c3 67 f1 86 08 11 0a d7 8f d6 58 5f a0 df af aa 4d 05 1f 1a 5d // 49 f2 da a6 1d 43 49 28 b1 95 6c 18 41 58 ad fa b0 a1 dd 4b b3 // a1 42 38 ed 7e 4b 22 ca b1 94 35 4f 24 fb f8 02 d0 e4 fa 8a 97 // 11 15 b9 f3 0d dc b2 0c 85 cf 25 72 d1 d4 72 73 06 03 6a 43 cc // 7a f5 d2 02 61 b7 f5 a0 27 48 bd c5 c1 03 90 f9 0e 72 e9 6c a4 // a2 bf bd c0 01 7b dc 3c 1f 5b b9 a5 a5 95 ba 30 7f 52 0a 1a aa // b1 b5 c6 e6 cd 9d 8b 57 b3 6b ac 97 19 df 2c 65 02 dd 36 1f 5d // 5b 56 a1 fe ea b8 ae 68 a1 71 42 90 3b b0 89 88 02 af bb 8f 23 // f1 d9 5e d4 2f 6a 53 f7 87 08 8d 5b 67 15 5e ec 11 97 4d 2d 4b // c4 1e cd 7d 7b aa f8 41 0d 98 05 71 a4 20 72 12 7d 4b 49 5f 18 // 3d 09 18 05 b6 d6 78 22 88 23 1a 18 21 ff e7 3a b9 8f df 77 77 // 34 a5 2f c7 fd 0e b2 a0 94 c2 f9 46 a5 79 19 2c d2 ad bb 64 dc // ec 0d ed 01 99 d1 dc 92 18 d3 66 c6 ac c4 0e f9 7f 92 c5 42 04 // 81 29 9f db 01 f0 48 c2 6a 72 af 8e 69 ee fb e8 32 1e 17 dd 8e // 05 45 c3 59 1c 1a bd dc 06 a9 29 90 3a 0c 66 ed 18 77 1d 87 79 // 11 f9 d4 c1 3f 85 e9 dd 0c 3a 68 af 8d b2 71 35 90 6c b3 ea 8a // d2 10 77 fb 9a 8f bd fd 33 97 e4 3d fc d5 e8 c5 7d 28 39 75 ad // 29 41 75 b7 17 1c 1e d7 61 60 5d cb a2 3f e7 f1 9d 1b 57 3f c0 // d7 d6 77 07 46 34 58 2a a7 59 8a 4f 36 7b a0 64 d6 72 7a 2a e7 // bc 98 b0 7c d6 c4 6e 6a 35 5a 7b 44 8e bb c6 e4 52 f2 22 78 dd // d6 c6 45 e3 de d6 f6 b8 6b b7 b6 c1 79 df c6 c7 73 48 36 a1 98 // ca 24 e8 12 04 2c e4 97 77 ac f5 48 6b 71 1b 36 a3 27 2a 93 48 // 10 a3 d6 0d ff 12 56 94 21 3b 52 a2 f2 d7 0f 09 6b 01 32 fe 75 // d1 e4 7a 5b 7e 18 a9 53 e5 57 34 9c c6 c2 23 93 12 a2 2d 36 b5 // 35 ce 3a 16 b8 21 f5 18 37 72 76 6a a0 58 23 08 1b a1 dc 9a b9 // b4 b8 2a be 2d 38 c4 b0 8f 1c a7 4b 88 ee ca 8a ab 19 1d 5c db // 60 b8 3d 23 e8 c5 e2 25 d8 60 dd d6 5d b0 a2 fc 1e 5d 78 59 17 // d3 96 d3 c0 dd 77 38 45 0a 9f a0 c5 70 21 be 1d 3f 83 bd 62 61 // 1c 16 14 d5 c9 94 0c 19 43 0b bd ea 07 b2 31 be 81 8a 60 ad f1 // c3 97 7f 0d a5 66 2b d3 8b f6 84 1c ac 80 35 cb 9d 43 96 be 9f // 03 e7 93 fb 61 44 d0 6d ce 79 9f 24 50 3a 97 92 7a 67 0a e1 03 // 10 c3 f6 53 68 fe 09 bf dc a9 ae 4a 2e 7d 70 49 d0 fd 11 3c fd // 76 8c be 58 88 d1 f3 39 5a cd 4c 19 00 2e cd e7 bc 35 ee f3 d2 // a8 c8 a6 9a d4 77 1d 00 29 7c 78 c5 09 d8 d5 3a 5d b4 da 43 57 // 87 e4 e9 8d e1 68 04 f3 30 51 9b dd 26 a2 9a 88 ae 42 d5 45 fe // d6 8a a4 aa 8a 69 0a ff cd d2 6c 82 1e 3c 11 e7 a1 21 8f 59 cb // 72 e3 65 13 2d 81 4a c4 28 e8 70 4d 50 4a 26 43 cd 32 51 27 8f // 94 a2 6a 80 0b 18 7d 20 c5 cd de 7f ff 45 35 9f 68 cf 28 5f d7 // 81 36 a6 68 26 7a d1 49 94 8d 4c 6c fb 00 47 d6 f4 79 36 9a e5 // 78 be f3 f9 60 e7 6a 49 f2 79 fe d5 45 ea 5c 8b fd d5 f0 8e bc // 03 5e d0 ce 8f 17 cd 07 04 e5 46 3f 8a 4e 91 ca fa e8 99 4f 6f // 0a 18 ad a6 a5 26 25 ed aa d1 6a ae 16 ac b1 51 47 cc 64 2f 1a // 63 72 81 fd ed 28 95 46 3b 84 ed 0a a8 69 68 ea b4 20 25 c3 e5 // c7 41 b0 15 1e 21 d6 16 f7 0a d9 30 b6 27 af 0a 98 ee 84 f2 fc // e4 84 35 d8 52 dc 56 f9 45 58 3b fd a0 b3 01 b5 84 e8 9c 0e 0e // ed 88 58 e8 46 ce 26 d0 3e 0a 49 ef e8 f4 4b 10 f5 aa 9b 1c 13 // 1e 80 be b6 f3 4f 7f 61 86 48 1b 05 f0 c9 72 55 b4 f3 9a 1b 2e // ff ec 2f c2 3a 93 ab 4c ba a1 d1 59 c6 07 71 fb 29 6c bc 01 97 // 87 06 7a 6f f8 d3 40 5a 49 17 fa 3d e5 21 63 d9 c4 9a 6c 2f 92 // b8 c6 43 ea 23 39 b6 7c de a9 e9 2c 16 12 99 8b 03 d3 e9 f1 b4 // 7c b4 6f ad f0 b0 f4 cd bb 15 49 f1 1a 7b d8 c6 93 63 70 6f 7b // 58 43 a5 7a 7c 0e f3 84 e7 2f 3e 44 0a 09 b2 d7 27 77 ab 6b c9 // f3 19 72 11 09 3b 50 a0 27 15 c5 97 69 7e 6e 2d 2b 0b a5 c4 8b // 3e 74 89 f0 84 2f 05 79 7a 50 e6 97 ae 56 ac 6c d6 82 52 03 28 // 35 d6 db df 6a d6 b5 0a 52 1d f2 9d e0 36 5c 6a 65 29 3f 90 d3 // a0 96 69 c2 cf 4d 6d a7 18 5a 4b ba 4a 65 86 47 2d 7a 3c 97 7b // 9a 01 8d 8c 56 66 e1 b6 98 cf 49 52 74 44 ef 8e 55 51 e6 0f 13 // f8 5a fe 6d 5e f5 9a 05 02 42 43 af d1 72 82 3f e4 96 8e d2 a5 // 6c 95 fd 4e 71 a2 b2 c6 c3 26 f5 70 1e bf e8 53 8c 69 3b 20 fa // b1 7b 1f fb c3 bc 4d da 26 6c 6b 3f 87 5c ed bc be d5 9d 2b f1 // f5 40 97 c1 43 53 88 f6 69 eb ff d7 37 50 41 f9 3b a8 b9 77 23 // 45 5f 03 40 ec 0d 9a 27 95 30 fa 6b b3 09 20 0f b2 8d 3f d8 5a // 5f 60 18 61 41 3a df f9 57 6f f3 05 ec 4c f6 40 de 16 41 79 98 // 66 42 50 15 f4 a4 24 1f 56 f3 70 93 b4 04 87 08 68 a8 6f 46 05 // fc ee 2f e4 87 0e c0 56 53 b1 5d 81 1c f0 54 f9 b7 d1 77 dd ac // 58 2d 9f 92 53 00 78 88 97 62 15 e2 8f c1 3b 5f 7c 33 35 58 2e // a8 f5 94 09 01 50 ca 47 58 cf e5 dc e3 f6 15 3b ff e1 2a 84 5e // db 3f 01 5a 3b 1f 49 97 9e 89 ee 9e 28 0c 51 e3 9b c3 24 09 91 // 93 8f ca aa 3a 96 60 20 17 30 90 a5 a7 f0 84 1d 1d 09 f9 9b d9 // 6a d0 1c a3 23 6e e5 9c de 0e d3 a0 05 0f e9 77 ee a0 55 19 2b // a6 00 a4 93 84 e3 44 d6 6d f1 59 5c 82 c3 ca 0c 48 c6 a8 35 17 // ee 92 eb 76 07 e8 ee 4b b1 31 9d d9 87 a9 9d 74 b1 2c 21 e7 3c // 61 91 3d 1c 99 d3 45 e4 ff 9c 21 66 37 67 85 ab 43 c7 9a 10 76 // 2a 19 ea 9d 9a 4c cd 4e a4 e9 a0 8a 38 05 c5 e1 d7 b7 c7 64 ac // 9e 47 4a 0f 13 dd d9 31 de 1f e3 5f fe 19 16 ba 4e aa 52 f6 db // 1d 17 0b b1 c1 9b 66 41 72 74 e3 ce 5e a2 ab 34 79 31 6f 79 85 // 95 05 8a a9 a0 f0 df c0 27 4c 37 9a 25 00 b1 75 25 aa 06 ce 0c // 77 5d 28 b7 c7 68 0a 6d 4d ee 42 a2 80 ca 18 93 23 01 09 96 72 // 9c 17 c3 cc 0a 7d 57 32 81 8f 2c f4 29 4d 3f 32 65 25 e9 d5 e2 // 17 a2 85 ba f5 1d 85 5d a2 c0 00 58 bc bd a8 9e 6f 51 a6 dc a2 // 81 b9 7e 69 2e a3 31 c7 dd cd f8 a8 db e4 78 5b 47 2f ee fc ab // 05 a1 d3 e6 8a 37 87 35 dc c7 f9 23 15 1e b0 28 c3 cd 85 d9 4e // f4 c0 a1 d3 28 e8 5f ec c4 a6 81 f7 b1 7b c0 f9 41 a3 00 00 00 // 00 00 00 00 00 00} (length 0x1000) size: len = 0x1000 (2 bytes) // } // } // } // len: len = 0x1006 (8 bytes) // ] *(uint32_t*)0x200000001f00 = 8; memcpy( (void*)0x200000001f04, "\x45\x5e\x99\xf0\x1d\x7d\x7e\xc0\xb7\x92\x64\xc1\xc8\x33\x98\xe0\x8b" "\x17\xc1\xa5\xce\xbd\x63\xf4\x25\xe6\xe9\xba\xce\x7f\x6f\x52\xa2\x8f" "\x77\x85\x42\xe5\x1b\x13\x05\xf3\x7d\x85\x57\x73\x3a\x54\x87\x22\xa5" "\xfa\xdc\xf5\xe0\x64\xa1\xae\x67\x35\xd8\x63\x5d\x14\x65\x2e\xd5\xc0" "\x18\xb4\x46\x9e\xf4\x00\x38\xb0\xfc\xe2\x2f\x8f\x44\xdb\xb6\x42\x76" "\xb4\x2a\xb6\x12\x03\xfd\xfc\x4a\x1f\x5e\x98\x1b\x0f\x90\x1e\xa8\x4c" "\x16\x28\xa7\xe8\x5e\xdc\x42\x93\x25\x96\xa4\x8a\x76\x8f\x54\x5a\x8c" "\x3b\xa2\x0d\x0b\xcc\x0f\x2a\x12\x6d\x3a\x35\x19\x13\x43\xdd\x27\x11" "\x3a\xca\x34\x03\x7a\x52\x50\xac\x97\xd0\x08\xf3\x28\x7f\xd6\xa9\x5f" "\x7f\xfd\xe1\xad\x03\x27\x9d\x24\x05\x2f\x17\x14\x10\x1d\x0c\xdc\xe8" "\x1d\xc6\x95\x3a\x47\x29\x0c\x31\xc4\x67\xdc\xe8\x23\x2e\xdd\xe1\xf5" "\x72\x93\x89\xd2\x39\xd0\x11\x55\xa9\x0b\x71\x06\x95\xb1\x21\x9b\xdb" "\xaf\x54\xbe\x4d\xb2\x90\x3d\xb1\xf2\x00\xf5\x72\x5d\x74\xc1\x68\x12" "\x71\x81\xda\xe3\xbe\xdc\x79\x84\x0a\x9c\x4f\xb9\x07\x7a\xd4\x4e\xf5" "\x33\x9d\x17\x02\x02\x6e\x09\x83\xff\xb1\xe0\x4b\xa1\x06\x30\x85\x35" "\x62\xd3\x7e\x35\xec\x27\x24\x9b\x77\x94\xc5\xd1\x6f\xb4\x66\x17\x39" "\x94\x8a\xff\x20\x25\xe5\x67\x64\x6e\x7a\xd9\x58\x06\xac\x67\xdf\x08" "\xaa\xaf\x0f\x60\x8f\x38\xfe\x3e\x2d\x58\xfe\xcf\xf3\xc8\x85\xa8\xce" "\x59\x93\x51\x85\x4d\x15\xf8\x22\x03\x88\x7d\x8c\xf0\x5b\xa8\xd9\x81" "\x43\xc8\xf9\x23\xe7\x91\xff\xa4\x75\xe8\xb2\xa2\x47\xdd\x49\x66\x3d" "\x6a\x2a\xbc\x17\x45\xf8\xe8\xd2\x3b\x1e\x9f\xb8\xc2\xe8\x80\x5b\xaf" "\xda\x80\x2c\xe5\xdc\x84\x76\x31\x72\x71\xbe\x13\xbf\x45\x4e\x9d\x11" "\x73\x6f\x3e\xe3\xd8\x30\x41\x93\x94\x85\x61\x47\xf9\x5e\xd8\x4e\x11" "\xc7\xa5\xa9\x8c\xaa\x2c\x43\xe0\x56\x87\x58\x83\xcd\x2a\x71\x97\x97" "\x58\xdb\xff\x78\x5a\xbd\x0a\xd1\xa4\x94\x59\xe4\x94\xcb\x40\x9d\x4e" "\xfe\x0f\x6c\x92\x77\x1e\xe8\x39\x38\x79\x9d\xaa\xdb\x2b\xf9\x8c\xcb" "\xdf\x25\x17\xcd\xbd\x5b\xcb\xff\x91\x9e\x51\xd2\x25\xc5\xb0\xd7\xf4" "\x55\xdf\xbb\xfb\x9e\x2a\xb2\x11\x1a\x17\xae\x55\x95\x94\x95\xd8\xd7" "\x66\xc7\xcd\x62\xef\xa3\x3d\xbf\x1d\x74\x23\x8c\x25\x7f\x47\x51\x6b" "\x74\xec\xdc\x8e\x46\x85\xe4\x61\xde\x05\x79\x23\x7c\xae\x86\x6d\xfe" "\x2a\xf4\x56\x0a\x93\x76\x29\x7a\xcf\x56\xc3\x9b\x96\xbd\x4c\x63\xc9" "\xce\x32\x24\x37\x03\x42\x3b\xd4\xca\x0a\x2f\xb1\x1c\x01\x5e\x5b\x07" "\x9d\x5b\x19\x20\x36\xfa\x66\x3b\xab\x46\x66\x57\x10\x53\x3e\x16\x7b" "\x63\xc3\xb3\xcd\xbb\xf9\x8f\xe5\xbf\x65\xe9\x87\x14\x4a\x6c\x2b\x62" "\x51\xb7\xef\x59\x23\x8e\xc9\xa1\x99\x4c\xc9\x66\xea\x7e\x05\x2c\x5c" "\xe4\x07\x24\xad\xf1\x4e\xa1\x00\xf5\xe3\x04\xb0\xe8\xa5\x77\x39\x84" "\xbb\xe9\xea\x74\xa9\xaa\xb9\xb0\x06\xd3\xff\x2a\xcf\x84\x8e\x4e\x18" "\x13\xcf\xa5\x13\xcf\x97\x52\xf5\xa0\xc5\x13\x4d\x8a\x44\x87\x33\xb8" "\x24\x78\x63\xbb\x68\x30\xa4\x7c\xe8\x1c\xa8\x07\x42\xd5\x54\xb8\xb2" "\xb3\x76\x0d\xdf\x64\x0d\x89\x58\x46\x84\x5d\x19\x9c\x81\x70\x10\x8c" "\x98\x90\x8b\xfc\x5a\x8a\x4c\x4e\xad\x5a\xd7\xcf\x99\xbe\x82\x53\xa1" "\x4b\xfb\x59\x8b\xf1\x0f\x39\xf7\xc9\x56\x21\xea\xc1\x03\xd3\xe1\xea" "\xa8\x22\xb8\x3c\x64\x62\xe6\x42\x8e\xe6\xf8\xdd\x0d\xc7\xd2\xbb\xa4" "\x04\x80\xf2\x28\x36\xd4\x43\xc6\x55\xf8\x3e\xc0\x90\x5f\xc9\x98\x53" "\x2a\xb6\x73\x65\x33\xf7\x96\x66\x3f\xf4\x1e\x82\x0c\x23\x61\xf5\x54" "\x92\x11\x10\xe1\xbe\x5d\x9a\xf4\x7e\xea\xe2\x62\x40\x43\x43\xc0\xb4" "\x28\x36\x26\x1a\x71\x6f\x5e\x4c\xa8\xac\x38\xb9\x0d\x2a\x46\x1f\x9c" "\x9a\xe0\x88\xce\x43\x75\x49\xd0\x86\xec\xa6\x0b\x61\x71\xc0\xab\x0e" "\x98\xdb\x0c\x0b\x21\x2b\x6d\xc3\xb0\x6d\xaf\x78\xc8\x91\x2d\x22\xd4" "\x57\xdc\x48\xbd\x6a\x0a\xb3\x96\x5f\x93\xb3\xdf\xba\xb1\x62\x6f\x2d" "\xd0\x5b\x3a\xee\x0b\x04\xda\x6a\xa8\x08\xa3\x9c\x41\x04\x1f\x11\xb5" "\x5c\xfa\x3d\x44\x72\xa4\x98\x5f\x6a\x22\x4d\x58\xee\x82\x03\xc0\x5d" "\x6d\xb2\x08\xd5\x7e\x93\xee\xde\x51\x11\x0d\xd3\x6b\xcd\x66\x45\xbe" "\x26\x6d\xe2\xa7\x1d\x96\x0d\x81\xce\x1d\x9b\x66\x44\xe6\xbd\x94\xd7" "\x90\xf5\x29\x4a\x0a\xcf\x78\x9f\x43\xb2\x1a\x83\xc8\x17\xb0\xd1\x36" "\x90\xeb\x9a\x83\xc6\x3e\x87\x55\x85\x80\x63\xc6\x1b\xfa\x42\x0f\x37" "\x2d\xb6\x87\xa9\x19\xeb\x67\x2f\x25\xc2\x2d\xcc\xfc\xaf\x22\xf9\x3d" "\x17\xf3\x33\x5e\x30\x42\xb6\xba\x1b\xea\xb5\x4d\xc2\xc6\xaa\xdf\xa1" "\x67\x34\x0a\xa5\xb3\x71\x5f\x66\xd1\x47\x60\x48\xb0\x8e\x58\x10\xf1" "\xc7\x90\xd6\x18\x6b\x5f\x42\xf3\x10\x35\x87\x17\xfa\x8c\xdc\x2a\x31" "\x7f\x92\x6c\x81\x1b\x8f\xf3\x6c\x72\x7b\x4a\x48\x5a\x5b\x08\x75\x20" "\x78\x77\xae\x41\x65\x5a\x10\x7e\x0f\xf3\x35\xb7\xb9\xc2\x42\x83\x12" "\x59\x84\x2c\x0e\xed\xe5\x42\xbd\xc6\x4d\xf2\xa2\xe5\xf2\xca\xde\x65" "\x1b\xc5\x7e\x72\x28\x3f\x23\x9b\xb1\xd6\x9a\x29\x80\x44\xb8\x93\x43" "\xf8\xbe\x1a\xec\xb4\x6d\xbc\x68\x5a\x3b\x3e\x26\xc3\xe3\x2d\x30\x45" "\xe6\x01\xb2\x09\xaf\x08\x6c\x03\xa3\xfa\xd6\x09\x44\xce\x9f\x70\x27" "\xf4\x2d\x9c\xce\xfb\xe2\x35\x3e\x5b\xbf\xdd\x6e\xa7\x71\x69\x3c\x13" "\x14\xb7\x02\xdb\x9f\x8c\xc5\xce\x5a\xd0\x5e\xf9\x9f\x54\xda\x13\x13" "\x9b\x83\x2d\x6b\x98\x32\x61\xaa\xd7\xe0\xf6\xcc\x39\x54\x54\x7b\x90" "\x2b\x51\xcf\x34\x5e\x0d\xf0\x31\x10\x97\xbe\x34\xb3\x0e\x4c\xa7\x13" "\xdc\xbc\x52\x0e\x52\x2f\x7c\x6a\xee\xe5\xb3\x10\x66\xcc\xc7\x98\x76" "\xad\xca\x6f\x55\x6c\xb1\xb2\x31\x00\x3e\x31\x69\x99\x1a\x25\x12\x93" "\xc6\x7c\xce\x9a\x78\xbf\xfe\x36\xc7\x78\xb8\xce\x91\x10\xfd\xac\x3e" "\xc5\x4b\xac\x57\xd7\x93\xfe\x1f\xeb\xbf\x66\x9d\x69\x6a\xcd\xec\xb5" "\xf6\x1f\xe6\xbd\x1b\xc0\x50\xc3\x73\x5b\xa0\xa7\xcd\x0d\xa7\xf4\x92" "\x61\xd7\x1d\x6e\xa8\xf7\x5c\x9d\x7d\x5d\x84\x34\x72\xd1\x5c\x75\xe9" "\xb3\xd2\x33\xb8\x7d\x75\x1b\xe4\x7b\xac\x72\x14\x9e\x7c\x46\xc9\x79" "\xf3\x5a\x61\x56\x63\x1e\x96\x75\xe1\xf5\x36\xc4\x9d\xb2\xa0\x50\x4b" "\xe5\x15\x29\x30\x8e\xdf\x0e\x78\x92\x0a\x13\x47\x9b\x24\xb2\x5a\x3d" "\x2e\xb4\x18\xa9\x28\x9b\xa4\x56\x92\x48\x3c\xd9\x1e\x9f\xc7\xc5\xb6" "\xa4\xed\x13\xad\xfe\xc4\x4e\x7a\xc6\xf5\x30\xbc\x11\xa6\x45\x6d\x73" "\x88\xa7\xb5\xda\x3f\xd5\x23\xdd\x73\x02\x47\x7e\xb6\x7d\x87\xad\x9a" "\x6e\x13\xc9\x36\xae\x83\xb1\x79\xb3\xa4\x8f\x63\x5a\x4e\x7d\xca\xad" "\xd3\xc0\xc6\x9a\xb6\xac\x97\xe7\xfa\xc7\x93\x0e\x66\x4e\xcd\xa2\xa4" "\x40\xbe\x58\x85\x48\xe0\xf0\xcb\xb4\x8a\x77\x56\x60\xec\x34\x0f\x2d" "\xf2\x9a\x7f\xa0\x8f\x99\xfb\xfb\x35\xea\x01\x67\xfe\x85\x0d\x15\x65" "\x11\x17\xd5\xd6\x16\xf5\xcc\xbe\x22\x0e\xf7\x69\x6c\x60\x0a\x0b\x0b" "\x1b\x46\x29\xd9\x78\xb9\x09\xa1\xb4\x03\xfe\x8e\xd6\x4c\x23\xfa\x91" "\x27\xb4\x5a\x1f\xab\x86\x92\x69\x04\x2e\xbd\x76\xf4\xff\xf2\xa4\xca" "\xd5\xd2\xcd\x7a\x75\x72\xfa\x43\x06\xa9\x54\x3e\x2e\x5e\x94\x18\xf7" "\x85\x6e\xbf\x2a\x70\x35\x44\x18\xdb\x24\x2c\xd6\x37\xb8\xa8\x2b\xbb" "\xd1\xe9\x2d\xa2\xef\x0b\xbd\x77\x97\xc0\x6d\xbb\x62\x29\x59\x06\x8e" "\xd4\x1b\x02\x59\x7a\xaa\x42\x18\x94\x9e\xa6\xb0\x2c\x92\xaf\xa4\xf9" "\xbc\xaa\x15\x7d\x41\x19\x6b\x58\x3b\x8b\xd5\xd7\x2b\xd1\xbc\x45\x03" "\xbd\x44\x7b\xfa\x78\xef\x27\xbe\x07\xea\x1b\x04\x0f\x2b\xfa\xcb\xc5" "\x9c\x70\xa7\x29\xde\xb0\xb3\x9e\xe3\x6f\x73\x6d\x59\xb0\x0c\x49\xe1" "\x46\x98\x59\x86\x28\x49\x0c\xa9\xd6\xce\x6a\x51\x35\x89\x54\x87\xd3" "\xcd\x99\x25\xc5\xce\x75\x8d\xdc\xa0\xb5\x86\x59\xd8\x3a\xa9\x96\x9b" "\x80\xb0\xd1\x90\x83\xa0\x26\x96\x6b\x7d\x82\xf4\x7f\x20\xcd\xef\xf2" "\xed\xf7\x5b\x78\x70\x51\xd6\x18\x2b\xb2\x5b\xd6\x06\x25\x69\xb9\x57" "\x12\xfd\x26\xb3\xc1\x86\x07\xb4\xaf\xe2\xba\xbc\x3c\x61\x9f\x3d\xbe" "\x35\x5e\x9e\x22\x9b\x65\xa3\x40\xca\xd5\x5b\x29\x5b\x2b\x21\xdb\x11" "\x48\x46\x55\x30\x95\x40\x01\x00\x00\x00\x00\x00\x00\x24\x62\xe6\xaa" "\x97\xe1\x14\x84\xa9\xd6\xb3\xa9\xf5\x8e\x17\x12\x2a\x5a\x79\x8e\x92" "\xc3\x88\x5e\x32\x00\xa2\x53\xcc\xbe\x59\xa9\x4e\xa1\x46\xcf\x27\x02" "\xd7\xc5\x03\xdd\x11\x34\xa6\xad\x51\x53\x51\x67\x1b\xeb\xb1\xa2\x6a" "\x27\x01\xd9\xae\x10\x23\x46\xaa\xe5\xa2\xbc\xa3\x84\x01\x27\xfd\x98" "\x6c\x83\x1a\x2e\xe1\x20\x75\x57\x92\xbc\xd2\x01\x82\xdf\xf8\xf3\x7f" "\x4e\xd2\x52\xca\xd1\x32\x78\xd3\x29\x91\x4b\xe4\x75\x77\x3e\x07\x7b" "\x8d\xba\xca\x00\x3c\xa7\xb6\xd4\xc2\x08\x78\x8a\xcd\x4b\xb8\x7a\x60" "\xc4\x0e\x08\xee\x55\x18\x97\xf5\xcc\xaf\xde\xae\x66\xe6\x48\x69\x73" "\xbc\xf8\x0d\x24\x87\x62\xe5\x26\x70\x3f\xe4\x5c\x21\x2c\xe4\xc4\xc6" "\x56\x62\x7c\xd5\x32\x9b\x5d\xab\x25\x1c\x97\xe4\x44\x8f\xea\xab\xea" "\xf1\x63\x0e\x07\xba\x04\x3a\x2a\x8f\x40\x05\xd2\x3f\xed\x63\xda\x24" "\x7a\x8e\x29\x63\x9b\x97\xe7\xc2\xbb\x1e\xd8\xc0\x23\x33\x39\x76\x18" "\x8e\x91\x4d\xee\xc0\xac\x2a\xf4\xb7\xf3\x78\x12\x7b\xf3\x38\x16\xb8" "\x1c\x61\x77\xed\xa8\xf1\x43\x19\x5a\xf5\x50\x2d\x45\xe4\x17\x7a\x7d" "\x94\x58\x3c\x11\x25\xe2\xe4\x59\xbd\x51\x83\xf6\x97\x6f\xf5\x58\x89" "\x94\xf9\xbf\x09\xd5\x25\x57\xbe\xc2\xae\x55\xf9\xde\x3e\xea\xfd\x9c" "\x57\x2f\xc8\x0f\x4b\x3d\xe5\x19\xf7\xc2\x31\xbc\x53\xe9\xb3\xff\xd6" "\x73\xb4\x54\x13\xbc\x78\xf8\xb3\xb8\xf2\x68\xd6\x40\x3c\xc5\x6f\xb6" "\x9c\xd3\xc0\x39\xc7\x13\x9b\xa5\x33\x5f\x69\xb7\x78\x33\xc0\x87\xb9" "\x5f\xf3\xc0\xfb\xbd\x07\x8c\xb2\x0a\xf0\xad\xc7\xbf\xca\x2b\x01\x76" "\x52\x76\x25\xce\x31\xe0\xaf\x4b\xa3\xb5\xb6\x64\x28\x36\x3a\x18\x9f" "\x05\xe1\x3c\x57\xf8\x8f\xa9\x6d\xd2\x1b\x35\x16\xb9\x47\x44\xb8\x7c" "\xed\x87\xfe\xd0\xaa\x90\xe6\xe5\x33\x57\x20\x6f\x0f\x3c\x0b\xe3\xea" "\x96\x08\x27\xe3\x12\x81\xee\xcf\xad\x74\xdb\x9a\x7f\x4f\x14\xeb\x59" "\x7f\x7a\x70\xa4\xe4\xf4\x1e\x48\x4f\xca\x46\x73\x31\x3d\x2e\x3d\x3f" "\x70\x98\x7b\x11\x74\xd8\x4b\x89\x3d\xd4\xc1\x91\xa0\xef\xa4\x68\xed" "\x04\x5c\xbc\x49\x92\x90\xdc\x65\xfc\x4b\x85\x09\x8f\x83\x68\x5e\x52" "\x14\xa2\x4d\x30\x4d\xb6\x9c\xf7\xed\xb6\xe9\x9e\x5d\x93\xda\x62\x55" "\xc8\x42\x30\x31\x5d\x33\x1a\x84\xa5\xc3\x3c\x59\x58\x13\x4d\xbe\x3e" "\x01\x29\x0a\x4e\xbb\x13\x43\x78\xa2\xaf\x7c\x23\xfb\xde\x0a\xdc\x48" "\xf3\x21\x35\xdd\xc7\xab\x3c\xbc\x94\x67\xe8\x1e\x76\x48\x40\x85\xdb" "\x2a\xbb\x90\x2b\x87\x58\x1a\xd6\xde\x8f\x9d\x47\xe6\xd5\x99\x63\x6d" "\xed\x2d\x47\xf4\xc2\xa7\x13\xeb\x3e\x61\x7c\x89\xce\x50\x10\x66\xc0" "\x5c\x7b\x68\x04\xf5\x77\x34\x35\x15\x58\x30\x26\x0b\x9f\xda\xe8\x0a" "\x1c\x3f\x14\x8a\x0e\x22\x3c\xf7\xd0\x54\x3a\x7a\xff\xbf\x89\xf0\x1d" "\xad\xc3\x67\xf1\x86\x08\x11\x0a\xd7\x8f\xd6\x58\x5f\xa0\xdf\xaf\xaa" "\x4d\x05\x1f\x1a\x5d\x49\xf2\xda\xa6\x1d\x43\x49\x28\xb1\x95\x6c\x18" "\x41\x58\xad\xfa\xb0\xa1\xdd\x4b\xb3\xa1\x42\x38\xed\x7e\x4b\x22\xca" "\xb1\x94\x35\x4f\x24\xfb\xf8\x02\xd0\xe4\xfa\x8a\x97\x11\x15\xb9\xf3" "\x0d\xdc\xb2\x0c\x85\xcf\x25\x72\xd1\xd4\x72\x73\x06\x03\x6a\x43\xcc" "\x7a\xf5\xd2\x02\x61\xb7\xf5\xa0\x27\x48\xbd\xc5\xc1\x03\x90\xf9\x0e" "\x72\xe9\x6c\xa4\xa2\xbf\xbd\xc0\x01\x7b\xdc\x3c\x1f\x5b\xb9\xa5\xa5" "\x95\xba\x30\x7f\x52\x0a\x1a\xaa\xb1\xb5\xc6\xe6\xcd\x9d\x8b\x57\xb3" "\x6b\xac\x97\x19\xdf\x2c\x65\x02\xdd\x36\x1f\x5d\x5b\x56\xa1\xfe\xea" "\xb8\xae\x68\xa1\x71\x42\x90\x3b\xb0\x89\x88\x02\xaf\xbb\x8f\x23\xf1" "\xd9\x5e\xd4\x2f\x6a\x53\xf7\x87\x08\x8d\x5b\x67\x15\x5e\xec\x11\x97" "\x4d\x2d\x4b\xc4\x1e\xcd\x7d\x7b\xaa\xf8\x41\x0d\x98\x05\x71\xa4\x20" "\x72\x12\x7d\x4b\x49\x5f\x18\x3d\x09\x18\x05\xb6\xd6\x78\x22\x88\x23" "\x1a\x18\x21\xff\xe7\x3a\xb9\x8f\xdf\x77\x77\x34\xa5\x2f\xc7\xfd\x0e" "\xb2\xa0\x94\xc2\xf9\x46\xa5\x79\x19\x2c\xd2\xad\xbb\x64\xdc\xec\x0d" "\xed\x01\x99\xd1\xdc\x92\x18\xd3\x66\xc6\xac\xc4\x0e\xf9\x7f\x92\xc5" "\x42\x04\x81\x29\x9f\xdb\x01\xf0\x48\xc2\x6a\x72\xaf\x8e\x69\xee\xfb" "\xe8\x32\x1e\x17\xdd\x8e\x05\x45\xc3\x59\x1c\x1a\xbd\xdc\x06\xa9\x29" "\x90\x3a\x0c\x66\xed\x18\x77\x1d\x87\x79\x11\xf9\xd4\xc1\x3f\x85\xe9" "\xdd\x0c\x3a\x68\xaf\x8d\xb2\x71\x35\x90\x6c\xb3\xea\x8a\xd2\x10\x77" "\xfb\x9a\x8f\xbd\xfd\x33\x97\xe4\x3d\xfc\xd5\xe8\xc5\x7d\x28\x39\x75" "\xad\x29\x41\x75\xb7\x17\x1c\x1e\xd7\x61\x60\x5d\xcb\xa2\x3f\xe7\xf1" "\x9d\x1b\x57\x3f\xc0\xd7\xd6\x77\x07\x46\x34\x58\x2a\xa7\x59\x8a\x4f" "\x36\x7b\xa0\x64\xd6\x72\x7a\x2a\xe7\xbc\x98\xb0\x7c\xd6\xc4\x6e\x6a" "\x35\x5a\x7b\x44\x8e\xbb\xc6\xe4\x52\xf2\x22\x78\xdd\xd6\xc6\x45\xe3" "\xde\xd6\xf6\xb8\x6b\xb7\xb6\xc1\x79\xdf\xc6\xc7\x73\x48\x36\xa1\x98" "\xca\x24\xe8\x12\x04\x2c\xe4\x97\x77\xac\xf5\x48\x6b\x71\x1b\x36\xa3" "\x27\x2a\x93\x48\x10\xa3\xd6\x0d\xff\x12\x56\x94\x21\x3b\x52\xa2\xf2" "\xd7\x0f\x09\x6b\x01\x32\xfe\x75\xd1\xe4\x7a\x5b\x7e\x18\xa9\x53\xe5" "\x57\x34\x9c\xc6\xc2\x23\x93\x12\xa2\x2d\x36\xb5\x35\xce\x3a\x16\xb8" "\x21\xf5\x18\x37\x72\x76\x6a\xa0\x58\x23\x08\x1b\xa1\xdc\x9a\xb9\xb4" "\xb8\x2a\xbe\x2d\x38\xc4\xb0\x8f\x1c\xa7\x4b\x88\xee\xca\x8a\xab\x19" "\x1d\x5c\xdb\x60\xb8\x3d\x23\xe8\xc5\xe2\x25\xd8\x60\xdd\xd6\x5d\xb0" "\xa2\xfc\x1e\x5d\x78\x59\x17\xd3\x96\xd3\xc0\xdd\x77\x38\x45\x0a\x9f" "\xa0\xc5\x70\x21\xbe\x1d\x3f\x83\xbd\x62\x61\x1c\x16\x14\xd5\xc9\x94" "\x0c\x19\x43\x0b\xbd\xea\x07\xb2\x31\xbe\x81\x8a\x60\xad\xf1\xc3\x97" "\x7f\x0d\xa5\x66\x2b\xd3\x8b\xf6\x84\x1c\xac\x80\x35\xcb\x9d\x43\x96" "\xbe\x9f\x03\xe7\x93\xfb\x61\x44\xd0\x6d\xce\x79\x9f\x24\x50\x3a\x97" "\x92\x7a\x67\x0a\xe1\x03\x10\xc3\xf6\x53\x68\xfe\x09\xbf\xdc\xa9\xae" "\x4a\x2e\x7d\x70\x49\xd0\xfd\x11\x3c\xfd\x76\x8c\xbe\x58\x88\xd1\xf3" "\x39\x5a\xcd\x4c\x19\x00\x2e\xcd\xe7\xbc\x35\xee\xf3\xd2\xa8\xc8\xa6" "\x9a\xd4\x77\x1d\x00\x29\x7c\x78\xc5\x09\xd8\xd5\x3a\x5d\xb4\xda\x43" "\x57\x87\xe4\xe9\x8d\xe1\x68\x04\xf3\x30\x51\x9b\xdd\x26\xa2\x9a\x88" "\xae\x42\xd5\x45\xfe\xd6\x8a\xa4\xaa\x8a\x69\x0a\xff\xcd\xd2\x6c\x82" "\x1e\x3c\x11\xe7\xa1\x21\x8f\x59\xcb\x72\xe3\x65\x13\x2d\x81\x4a\xc4" "\x28\xe8\x70\x4d\x50\x4a\x26\x43\xcd\x32\x51\x27\x8f\x94\xa2\x6a\x80" "\x0b\x18\x7d\x20\xc5\xcd\xde\x7f\xff\x45\x35\x9f\x68\xcf\x28\x5f\xd7" "\x81\x36\xa6\x68\x26\x7a\xd1\x49\x94\x8d\x4c\x6c\xfb\x00\x47\xd6\xf4" "\x79\x36\x9a\xe5\x78\xbe\xf3\xf9\x60\xe7\x6a\x49\xf2\x79\xfe\xd5\x45" "\xea\x5c\x8b\xfd\xd5\xf0\x8e\xbc\x03\x5e\xd0\xce\x8f\x17\xcd\x07\x04" "\xe5\x46\x3f\x8a\x4e\x91\xca\xfa\xe8\x99\x4f\x6f\x0a\x18\xad\xa6\xa5" "\x26\x25\xed\xaa\xd1\x6a\xae\x16\xac\xb1\x51\x47\xcc\x64\x2f\x1a\x63" "\x72\x81\xfd\xed\x28\x95\x46\x3b\x84\xed\x0a\xa8\x69\x68\xea\xb4\x20" "\x25\xc3\xe5\xc7\x41\xb0\x15\x1e\x21\xd6\x16\xf7\x0a\xd9\x30\xb6\x27" "\xaf\x0a\x98\xee\x84\xf2\xfc\xe4\x84\x35\xd8\x52\xdc\x56\xf9\x45\x58" "\x3b\xfd\xa0\xb3\x01\xb5\x84\xe8\x9c\x0e\x0e\xed\x88\x58\xe8\x46\xce" "\x26\xd0\x3e\x0a\x49\xef\xe8\xf4\x4b\x10\xf5\xaa\x9b\x1c\x13\x1e\x80" "\xbe\xb6\xf3\x4f\x7f\x61\x86\x48\x1b\x05\xf0\xc9\x72\x55\xb4\xf3\x9a" "\x1b\x2e\xff\xec\x2f\xc2\x3a\x93\xab\x4c\xba\xa1\xd1\x59\xc6\x07\x71" "\xfb\x29\x6c\xbc\x01\x97\x87\x06\x7a\x6f\xf8\xd3\x40\x5a\x49\x17\xfa" "\x3d\xe5\x21\x63\xd9\xc4\x9a\x6c\x2f\x92\xb8\xc6\x43\xea\x23\x39\xb6" "\x7c\xde\xa9\xe9\x2c\x16\x12\x99\x8b\x03\xd3\xe9\xf1\xb4\x7c\xb4\x6f" "\xad\xf0\xb0\xf4\xcd\xbb\x15\x49\xf1\x1a\x7b\xd8\xc6\x93\x63\x70\x6f" "\x7b\x58\x43\xa5\x7a\x7c\x0e\xf3\x84\xe7\x2f\x3e\x44\x0a\x09\xb2\xd7" "\x27\x77\xab\x6b\xc9\xf3\x19\x72\x11\x09\x3b\x50\xa0\x27\x15\xc5\x97" "\x69\x7e\x6e\x2d\x2b\x0b\xa5\xc4\x8b\x3e\x74\x89\xf0\x84\x2f\x05\x79" "\x7a\x50\xe6\x97\xae\x56\xac\x6c\xd6\x82\x52\x03\x28\x35\xd6\xdb\xdf" "\x6a\xd6\xb5\x0a\x52\x1d\xf2\x9d\xe0\x36\x5c\x6a\x65\x29\x3f\x90\xd3" "\xa0\x96\x69\xc2\xcf\x4d\x6d\xa7\x18\x5a\x4b\xba\x4a\x65\x86\x47\x2d" "\x7a\x3c\x97\x7b\x9a\x01\x8d\x8c\x56\x66\xe1\xb6\x98\xcf\x49\x52\x74" "\x44\xef\x8e\x55\x51\xe6\x0f\x13\xf8\x5a\xfe\x6d\x5e\xf5\x9a\x05\x02" "\x42\x43\xaf\xd1\x72\x82\x3f\xe4\x96\x8e\xd2\xa5\x6c\x95\xfd\x4e\x71" "\xa2\xb2\xc6\xc3\x26\xf5\x70\x1e\xbf\xe8\x53\x8c\x69\x3b\x20\xfa\xb1" "\x7b\x1f\xfb\xc3\xbc\x4d\xda\x26\x6c\x6b\x3f\x87\x5c\xed\xbc\xbe\xd5" "\x9d\x2b\xf1\xf5\x40\x97\xc1\x43\x53\x88\xf6\x69\xeb\xff\xd7\x37\x50" "\x41\xf9\x3b\xa8\xb9\x77\x23\x45\x5f\x03\x40\xec\x0d\x9a\x27\x95\x30" "\xfa\x6b\xb3\x09\x20\x0f\xb2\x8d\x3f\xd8\x5a\x5f\x60\x18\x61\x41\x3a" "\xdf\xf9\x57\x6f\xf3\x05\xec\x4c\xf6\x40\xde\x16\x41\x79\x98\x66\x42" "\x50\x15\xf4\xa4\x24\x1f\x56\xf3\x70\x93\xb4\x04\x87\x08\x68\xa8\x6f" "\x46\x05\xfc\xee\x2f\xe4\x87\x0e\xc0\x56\x53\xb1\x5d\x81\x1c\xf0\x54" "\xf9\xb7\xd1\x77\xdd\xac\x58\x2d\x9f\x92\x53\x00\x78\x88\x97\x62\x15" "\xe2\x8f\xc1\x3b\x5f\x7c\x33\x35\x58\x2e\xa8\xf5\x94\x09\x01\x50\xca" "\x47\x58\xcf\xe5\xdc\xe3\xf6\x15\x3b\xff\xe1\x2a\x84\x5e\xdb\x3f\x01" "\x5a\x3b\x1f\x49\x97\x9e\x89\xee\x9e\x28\x0c\x51\xe3\x9b\xc3\x24\x09" "\x91\x93\x8f\xca\xaa\x3a\x96\x60\x20\x17\x30\x90\xa5\xa7\xf0\x84\x1d" "\x1d\x09\xf9\x9b\xd9\x6a\xd0\x1c\xa3\x23\x6e\xe5\x9c\xde\x0e\xd3\xa0" "\x05\x0f\xe9\x77\xee\xa0\x55\x19\x2b\xa6\x00\xa4\x93\x84\xe3\x44\xd6" "\x6d\xf1\x59\x5c\x82\xc3\xca\x0c\x48\xc6\xa8\x35\x17\xee\x92\xeb\x76" "\x07\xe8\xee\x4b\xb1\x31\x9d\xd9\x87\xa9\x9d\x74\xb1\x2c\x21\xe7\x3c" "\x61\x91\x3d\x1c\x99\xd3\x45\xe4\xff\x9c\x21\x66\x37\x67\x85\xab\x43" "\xc7\x9a\x10\x76\x2a\x19\xea\x9d\x9a\x4c\xcd\x4e\xa4\xe9\xa0\x8a\x38" "\x05\xc5\xe1\xd7\xb7\xc7\x64\xac\x9e\x47\x4a\x0f\x13\xdd\xd9\x31\xde" "\x1f\xe3\x5f\xfe\x19\x16\xba\x4e\xaa\x52\xf6\xdb\x1d\x17\x0b\xb1\xc1" "\x9b\x66\x41\x72\x74\xe3\xce\x5e\xa2\xab\x34\x79\x31\x6f\x79\x85\x95" "\x05\x8a\xa9\xa0\xf0\xdf\xc0\x27\x4c\x37\x9a\x25\x00\xb1\x75\x25\xaa" "\x06\xce\x0c\x77\x5d\x28\xb7\xc7\x68\x0a\x6d\x4d\xee\x42\xa2\x80\xca" "\x18\x93\x23\x01\x09\x96\x72\x9c\x17\xc3\xcc\x0a\x7d\x57\x32\x81\x8f" "\x2c\xf4\x29\x4d\x3f\x32\x65\x25\xe9\xd5\xe2\x17\xa2\x85\xba\xf5\x1d" "\x85\x5d\xa2\xc0\x00\x58\xbc\xbd\xa8\x9e\x6f\x51\xa6\xdc\xa2\x81\xb9" "\x7e\x69\x2e\xa3\x31\xc7\xdd\xcd\xf8\xa8\xdb\xe4\x78\x5b\x47\x2f\xee" "\xfc\xab\x05\xa1\xd3\xe6\x8a\x37\x87\x35\xdc\xc7\xf9\x23\x15\x1e\xb0" "\x28\xc3\xcd\x85\xd9\x4e\xf4\xc0\xa1\xd3\x28\xe8\x5f\xec\xc4\xa6\x81" "\xf7\xb1\x7b\xc0\xf9\x41\xa3\x00\x00\x00\x00\x00\x00\x00\x00\x00", 4096); *(uint16_t*)0x200000002f04 = 0x1000; syscall(__NR_write, /*fd=*/(intptr_t)-1, /*data=*/0x200000001f00ul, /*len=*/0x1006ul); break; } } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); setup_cgroups(); const char* reason; (void)reason; if ((reason = setup_swap())) printf("the reproducer may not work as expected: swap setup failed: %s\n", reason); for (procid = 0; procid < 5; procid++) { if (fork() == 0) { use_temporary_dir(); do_sandbox_none(); } } sleep(1000000); return 0; }