// https://syzkaller.appspot.com/bug?id=762e7debe9358b9fb086b72671bc0b97bc686a88 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; static __thread int clone_ongoing; static __thread int skip_segv; static __thread jmp_buf segv_env; static void segv_handler(int sig, siginfo_t* info, void* ctx) { if (__atomic_load_n(&clone_ongoing, __ATOMIC_RELAXED) != 0) { exit(sig); } uintptr_t addr = (uintptr_t)info->si_addr; const uintptr_t prog_start = 1 << 20; const uintptr_t prog_end = 100 << 20; int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; int valid = addr < prog_start || addr > prog_end; if (skip && valid) { _longjmp(segv_env, 1); } exit(sig); } static void install_segv_handler(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8); syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8); memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = segv_handler; sa.sa_flags = SA_NODEFER | SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGBUS, &sa, NULL); } #define NONFAILING(...) \ ({ \ int ok = 1; \ __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ if (_setjmp(segv_env) == 0) { \ __VA_ARGS__; \ } else \ ok = 0; \ __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ ok; \ }) static void 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 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 unsigned int queue_count = 2; static void netlink_add_device_impl(struct nlmsg* nlmsg, const char* type, const char* name, bool up) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; netlink_init(nlmsg, RTM_NEWLINK, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); if (name) netlink_attr(nlmsg, IFLA_IFNAME, name, strlen(name)); netlink_attr(nlmsg, IFLA_NUM_TX_QUEUES, &queue_count, sizeof(queue_count)); netlink_attr(nlmsg, IFLA_NUM_RX_QUEUES, &queue_count, sizeof(queue_count)); netlink_nest(nlmsg, IFLA_LINKINFO); netlink_attr(nlmsg, IFLA_INFO_KIND, type, strlen(type)); } static void netlink_add_device(struct nlmsg* nlmsg, int sock, const char* type, const char* name) { netlink_add_device_impl(nlmsg, type, name, false); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_veth(struct nlmsg* nlmsg, int sock, const char* name, const char* peer) { netlink_add_device_impl(nlmsg, "veth", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_nest(nlmsg, VETH_INFO_PEER); nlmsg->pos += sizeof(struct ifinfomsg); netlink_attr(nlmsg, IFLA_IFNAME, peer, strlen(peer)); netlink_attr(nlmsg, IFLA_NUM_TX_QUEUES, &queue_count, sizeof(queue_count)); netlink_attr(nlmsg, IFLA_NUM_RX_QUEUES, &queue_count, sizeof(queue_count)); netlink_done(nlmsg); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_xfrm(struct nlmsg* nlmsg, int sock, const char* name) { netlink_add_device_impl(nlmsg, "xfrm", name, true); netlink_nest(nlmsg, IFLA_INFO_DATA); int if_id = 1; netlink_attr(nlmsg, 2, &if_id, sizeof(if_id)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_hsr(struct nlmsg* nlmsg, int sock, const char* name, const char* slave1, const char* slave2) { netlink_add_device_impl(nlmsg, "hsr", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); int ifindex1 = if_nametoindex(slave1); netlink_attr(nlmsg, IFLA_HSR_SLAVE1, &ifindex1, sizeof(ifindex1)); int ifindex2 = if_nametoindex(slave2); netlink_attr(nlmsg, IFLA_HSR_SLAVE2, &ifindex2, sizeof(ifindex2)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_linked(struct nlmsg* nlmsg, int sock, const char* type, const char* name, const char* link) { netlink_add_device_impl(nlmsg, type, name, false); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_vlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t id, uint16_t proto) { netlink_add_device_impl(nlmsg, "vlan", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_VLAN_ID, &id, sizeof(id)); netlink_attr(nlmsg, IFLA_VLAN_PROTOCOL, &proto, sizeof(proto)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_macvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link) { netlink_add_device_impl(nlmsg, "macvlan", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); uint32_t mode = MACVLAN_MODE_BRIDGE; netlink_attr(nlmsg, IFLA_MACVLAN_MODE, &mode, sizeof(mode)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_geneve(struct nlmsg* nlmsg, int sock, const char* name, uint32_t vni, struct in_addr* addr4, struct in6_addr* addr6) { netlink_add_device_impl(nlmsg, "geneve", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_GENEVE_ID, &vni, sizeof(vni)); if (addr4) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE, addr4, sizeof(*addr4)); if (addr6) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE6, addr6, sizeof(*addr6)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } #define IFLA_IPVLAN_FLAGS 2 #define IPVLAN_MODE_L3S 2 #undef IPVLAN_F_VEPA #define IPVLAN_F_VEPA 2 static void netlink_add_ipvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t mode, uint16_t flags) { netlink_add_device_impl(nlmsg, "ipvlan", name, false); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_IPVLAN_MODE, &mode, sizeof(mode)); netlink_attr(nlmsg, IFLA_IPVLAN_FLAGS, &flags, sizeof(flags)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_device_change(struct nlmsg* nlmsg, int sock, const char* name, bool up, const char* master, const void* mac, int macsize, const char* new_name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; hdr.ifi_index = if_nametoindex(name); netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr)); if (new_name) netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex)); } if (macsize) netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static int netlink_add_addr(struct nlmsg* nlmsg, int sock, const char* dev, const void* addr, int addrsize) { struct ifaddrmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ifa_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ifa_prefixlen = addrsize == 4 ? 24 : 120; hdr.ifa_scope = RT_SCOPE_UNIVERSE; hdr.ifa_index = if_nametoindex(dev); netlink_init(nlmsg, RTM_NEWADDR, NLM_F_CREATE | NLM_F_REPLACE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, IFA_LOCAL, addr, addrsize); netlink_attr(nlmsg, IFA_ADDRESS, addr, addrsize); return netlink_send(nlmsg, sock); } static void netlink_add_addr4(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in_addr in_addr; inet_pton(AF_INET, addr, &in_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in_addr, sizeof(in_addr)); if (err < 0) { } } static void netlink_add_addr6(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in6_addr in6_addr; inet_pton(AF_INET6, addr, &in6_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in6_addr, sizeof(in6_addr)); if (err < 0) { } } static 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); } #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); } //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDWR); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } static void setup_gadgetfs(); static void setup_binderfs(); static void setup_fusectl(); static void sandbox_common_mount_tmpfs(void) { write_file("/proc/sys/fs/mount-max", "100000"); if (mkdir("./syz-tmp", 0777)) exit(1); if (mount("", "./syz-tmp", "tmpfs", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot", 0777)) exit(1); if (mkdir("./syz-tmp/newroot/dev", 0700)) exit(1); unsigned bind_mount_flags = MS_BIND | MS_REC | MS_PRIVATE; if (mount("/dev", "./syz-tmp/newroot/dev", NULL, bind_mount_flags, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/proc", 0700)) exit(1); if (mount("syz-proc", "./syz-tmp/newroot/proc", "proc", 0, NULL)) exit(1); if (mkdir("./syz-tmp/newroot/selinux", 0700)) exit(1); const char* selinux_path = "./syz-tmp/newroot/selinux"; if (mount("/selinux", selinux_path, NULL, bind_mount_flags, NULL)) { if (errno != ENOENT) exit(1); if (mount("/sys/fs/selinux", selinux_path, NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); } if (mkdir("./syz-tmp/newroot/sys", 0700)) exit(1); if (mount("/sys", "./syz-tmp/newroot/sys", 0, bind_mount_flags, NULL)) exit(1); if (mount("/sys/kernel/debug", "./syz-tmp/newroot/sys/kernel/debug", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/sys/fs/smackfs", "./syz-tmp/newroot/sys/fs/smackfs", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mount("/proc/sys/fs/binfmt_misc", "./syz-tmp/newroot/proc/sys/fs/binfmt_misc", NULL, bind_mount_flags, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/newroot/syz-inputs", 0700)) exit(1); if (mount("/syz-inputs", "./syz-tmp/newroot/syz-inputs", NULL, bind_mount_flags | MS_RDONLY, NULL) && errno != ENOENT) exit(1); if (mkdir("./syz-tmp/pivot", 0777)) exit(1); if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) { if (chdir("./syz-tmp")) exit(1); } else { if (chdir("/")) exit(1); if (umount2("./pivot", MNT_DETACH)) exit(1); } if (chroot("./newroot")) exit(1); if (chdir("/")) exit(1); setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } static void setup_gadgetfs() { if (mkdir("/dev/gadgetfs", 0777)) { } if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { } } static void setup_fusectl() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } if (symlink("/dev/binderfs", "./binderfs")) { } } 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); } 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 loop(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 10; 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) + (call == 7 ? 4000 : 0) + (call == 9 ? 4000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } 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 32 00} (length 0x8) // } // flags: mount_flags = 0x404 (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 { // noblock_validity: buffer: {6e 6f 62 6c 6f 63 6b 5f 76 61 6c // 69 64 69 74 79} (length 0x10) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // max_batch_time: fs_opt["max_batch_time", fmt[hex, int32]] { // name: buffer: {6d 61 78 5f 62 61 74 63 68 5f 74 69 6d 65} // (length 0xe) eq: const = 0x3d (1 bytes) val: int32 = 0x2 // (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // resuid: fs_opt["resuid", fmt[hex, uid]] { // name: buffer: {72 65 73 75 69 64} (length 0x6) // eq: const = 0x3d (1 bytes) // val: uid (resource) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // block_validity: buffer: {62 6c 6f 63 6b 5f 76 61 6c 69 64 69 // 74 79} (length 0xe) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // stripe: fs_opt["stripe", fmt[hex, int32]] { // name: buffer: {73 74 72 69 70 65} (length 0x6) // eq: const = 0x3d (1 bytes) // val: int32 = 0x9 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // nombcache: buffer: {6e 6f 6d 62 63 61 63 68 65} (length 0x9) // } // 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 = 0x44f (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x44f) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000180, "ext4\000", 5)); NONFAILING(memcpy((void*)0x200000000200, "./file2\000", 8)); NONFAILING(memcpy((void*)0x2000000002c0, "noblock_validity", 16)); NONFAILING(*(uint8_t*)0x2000000002d0 = 0x2c); NONFAILING(memcpy((void*)0x2000000002d1, "max_batch_time", 14)); NONFAILING(*(uint8_t*)0x2000000002df = 0x3d); NONFAILING(sprintf((char*)0x2000000002e0, "0x%016llx", (long long)2)); NONFAILING(*(uint8_t*)0x2000000002f2 = 0x2c); NONFAILING(memcpy((void*)0x2000000002f3, "resuid", 6)); NONFAILING(*(uint8_t*)0x2000000002f9 = 0x3d); NONFAILING(sprintf((char*)0x2000000002fa, "0x%016llx", (long long)0)); NONFAILING(*(uint8_t*)0x20000000030c = 0x2c); NONFAILING(memcpy((void*)0x20000000030d, "block_validity", 14)); NONFAILING(*(uint8_t*)0x20000000031b = 0x2c); NONFAILING(memcpy((void*)0x20000000031c, "stripe", 6)); NONFAILING(*(uint8_t*)0x200000000322 = 0x3d); NONFAILING(sprintf((char*)0x200000000323, "0x%016llx", (long long)9)); NONFAILING(*(uint8_t*)0x200000000335 = 0x2c); NONFAILING(memcpy((void*)0x200000000336, "nombcache", 9)); NONFAILING(*(uint8_t*)0x20000000033f = 0x2c); NONFAILING(*(uint8_t*)0x200000000340 = 0); NONFAILING(memcpy( (void*)0x200000000640, "\x78\x9c\xec\xdb\xcb\x6f\x1b\xc5\x1f\x00\xf0\xef\xae\x93\xf6\xd7\xd7" "\x2f\xa1\x2a\x8f\x3e\x80\x40\x41\x54\x3c\x92\x26\x2d\xa5\x07\x2e\x20" "\x90\x38\x80\x84\x04\x87\x72\x0c\x49\x5a\x95\xba\x0d\x6a\x82\x44\xab" "\x08\x02\x42\xe5\x88\x2a\x71\x47\x1c\x91\xf8\x0b\x38\xc1\x05\x01\x27" "\x24\xae\x70\x47\x95\x2a\x14\x21\xb5\x70\x32\x5a\x7b\x37\xb1\x1d\xdb" "\x79\xd4\x89\xa1\xfe\x7c\xa4\x6d\x67\x76\xd7\x9d\xf9\x7a\x76\xbc\x33" "\x3b\xdd\x00\xfa\xd6\x48\xf6\x47\x12\xb1\x37\x22\x7e\x8d\x88\xa1\x5a" "\xb6\xf1\x84\x91\xda\x5f\xb7\x97\x16\xa6\xfe\x5a\x5a\x98\x4a\xa2\x52" "\x79\xe3\x8f\xa4\x7a\xde\xad\xa5\x85\xa9\xe2\xd4\xe2\x73\x7b\x8a\xcc" "\x40\x44\xfa\x49\x12\x87\x5b\x94\x3b\x77\xe5\xea\x85\xc9\x72\x79\xe6" "\x72\x9e\x1f\x9b\xbf\xf8\xee\xd8\xdc\x95\xab\xcf\x9c\xbf\x38\x79\x6e" "\xe6\xdc\xcc\xa5\x89\xd3\xa7\x4f\x9e\x18\x7f\xee\xd4\xc4\xb3\x5d\x89" "\x33\x8b\xeb\xd6\xa1\x0f\x66\x8f\x1c\x7c\xe5\xad\xeb\xaf\x4d\x9d\xb9" "\xfe\xf6\x8f\x5f\x27\x45\xfc\x4d\x71\x74\xc9\x48\xa7\x83\x8f\x57\x2a" "\x5d\x2e\xae\xb7\xf6\xd5\xa5\x93\x81\x1e\x56\x84\x0d\x29\xd5\xba\x69" "\x0c\x56\xfb\xff\x50\x94\x62\xa5\xf1\x86\xe2\xe5\x8f\x7b\x5a\x39\x60" "\x4b\x55\x2a\x95\xca\x7d\xed\x0f\x2f\x56\x80\xbb\x58\x12\xbd\xae\x01" "\xd0\x1b\xc5\x8d\x3e\x9b\xff\xe6\x5b\x71\xeb\xdf\x86\xd1\x47\xef\xdd" "\x7c\xa1\x36\x01\xca\x62\xbf\x9d\x6f\xb5\x23\x03\x91\xe6\xe7\x0c\x36" "\xcd\x6f\xbb\x69\x24\x22\xce\x2c\xfe\xfd\x45\xb6\xc5\x46\x9f\x43\xa4" "\x5b\x54\x29\x00\xe0\xae\xf6\x6d\x36\xfe\x79\xba\x61\xfc\x97\x8f\x3f" "\xd2\xa8\x7f\x2e\xf4\xff\x7c\x0d\x65\x38\x22\xee\x89\x88\xfd\x11\x71" "\x2a\x22\x0e\x44\xc4\xbd\x11\xd5\x73\xef\x8f\x88\x07\x5a\x15\x92\xb4" "\x2f\xbf\x79\x91\x64\xf5\xf8\x27\xbd\xb1\xe9\xe0\xd6\x21\x1b\xff\x3d" "\x9f\xaf\x6d\x35\x8e\xff\x96\x07\x57\xc3\xa5\x3c\xb7\xaf\x1a\xff\x60" "\x72\xf6\x7c\x79\xe6\x78\xfe\x9d\x1c\x8b\xc1\x9d\x59\x7e\xbc\x43\x19" "\xdf\xbd\xf4\xcb\x67\xed\x8e\xd5\x8f\xff\xb2\x2d\x2b\xbf\x18\x0b\xe6" "\xf5\xb8\x31\xb0\xb3\xf1\x33\xd3\x93\xf3\x93\x77\x12\x73\xbd\x9b\x1f" "\x45\x1c\x1a\x68\x15\x7f\xb2\xbc\x12\x90\x35\xdf\xc1\x88\x38\xb4\xc9" "\x32\xce\x3f\xf9\xd5\x91\x22\x7d\xb8\xd4\x78\x6c\xed\xf8\x3b\xe8\xc2" "\x3a\x53\xe5\xcb\x88\x27\x6a\xed\xbf\x18\x4d\xf1\x17\x92\xce\xeb\x93" "\x63\xff\x8b\xf2\xcc\xf1\xb1\xe2\xaa\x58\xed\xa7\x9f\xaf\xbd\xde\xae" "\xfc\x3b\x8a\xbf\x0b\xb2\xf6\xdf\xdd\xf2\xfa\x5f\x8e\x7f\x38\xa9\x5f" "\xaf\x9d\xdb\x78\x19\xd7\x7e\xfb\xb4\xed\x9c\x66\xb3\xd7\xff\x8e\xe4" "\xcd\x86\x7d\xef\x4f\xce\xcf\x5f\x1e\x8f\xd8\x91\xbc\x5a\xab\x74\xfd" "\xfe\x89\xa6\xf3\x26\x56\xce\xcf\xe2\x3f\x76\xb4\x75\xff\xdf\x1f\x2b" "\xdf\xc4\xe1\xec\xfa\x4f\x23\x1e\x8c\x88\x87\x22\xe2\xe1\xbc\xee\x8f" "\x44\xc4\xa3\x11\x71\xb4\x43\xfc\x3f\xbc\xf8\xd8\x3b\x1d\xe3\xff\xb3" "\x5d\xfc\x3b\x3b\xfc\xab\xdd\x91\xc5\x3f\xdd\xd0\xfe\xc5\x0f\x5f\xbb" "\xf6\x5f\x49\xec\x88\xe6\x3d\xad\x13\xa5\x0b\xdf\x7f\xd3\x50\xe8\x70" "\x53\xfc\x6b\xb6\xff\xc9\x6a\xea\x58\xbe\x67\x3d\xbf\x7f\xeb\xa9\xd7" "\xe6\xae\x66\x00\x00\x00\xf8\xef\xc9\x26\xfb\x7b\x23\x49\x47\x97\xd3" "\x69\x3a\x3a\x5a\xfb\x3f\xfc\x07\x62\x77\x5a\x9e\x9d\x9b\x7f\xea\xec" "\xec\x7b\x97\xa6\x6b\xef\x08\x0c\xc7\x60\x5a\x3c\xe9\x1a\xaa\x7b\x1e" "\x3a\x9e\x4f\xeb\x8b\xfc\x44\x53\xfe\x44\xfe\xdc\xf8\xf3\xd2\xae\x6a" "\x7e\x74\x6a\xb6\x3c\xdd\xeb\xe0\xa1\xcf\xed\x69\xd3\xff\x33\xbf\x97" "\x7a\x5d\x3b\x60\xcb\x79\x5f\x0b\xfa\x97\xfe\x0f\x7d\xab\xfe\x3d\x00" "\xa0\xcf\xb8\xff\x43\xff\x6a\xd1\xff\x77\xf5\xa2\x1e\xc0\xf6\x6b\x75" "\xff\xff\xb0\x07\xf5\x00\xb6\x5f\x53\xff\xb7\xec\x07\x7d\xc4\xfc\x1f" "\xfa\x97\xfe\x0f\xfd\x4b\xff\x87\xbe\x34\xb7\x2b\xd6\x7e\x49\x5e\x42" "\x62\x55\x22\xd2\x7f\x45\x35\x24\xb6\x28\xd1\xeb\x5f\x26\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\xee\xf8\x27\x00\x00\xff\xff\x05\xba\xea\xa8", 1103)); NONFAILING(syz_mount_image(/*fs=*/0x200000000180, /*dir=*/0x200000000200, /*flags=MS_NODEV|MS_NOATIME*/ 0x404, /*opts=*/0x2000000002c0, /*chdir=*/1, /*size=*/0x44f, /*img=*/0x200000000640)); break; case 1: // chdir arguments: [ // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // ] NONFAILING(memcpy((void*)0x200000000040, "./file0\000", 8)); syscall(__NR_chdir, /*dir=*/0x200000000040ul); break; case 2: // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {62 6c 6b 69 6f 2e 62 66 71 2e 69 64 6c 65 5f 74 69 6d 65 // 00} (length 0x14) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000000200, "blkio.bfq.idle_time\000", 20)); syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000200ul, /*flags=*/0x275a, /*mode=*/0); break; case 3: // quotactl$Q_QUOTAON arguments: [ // cmd: quota_cmd_quota_on = 0xffffffff80000201 (8 bytes) // special: ptr[in, blockdev_filename] { // union blockdev_filename { // loop: loop_filename { // prefix: buffer: {2f 64 65 76 2f 6c 6f 6f 70} (length 0x9) // id: proc = 0x0 (1 bytes) // z: const = 0x0 (1 bytes) // } // } // } // id: uid (resource) // addr: nil // ] NONFAILING(memcpy((void*)0x200000000180, "/dev/loop", 9)); NONFAILING(*(uint8_t*)0x200000000189 = 0x30); NONFAILING(*(uint8_t*)0x20000000018a = 0); syscall(__NR_quotactl, /*cmd=Q_QUOTAON_GRP*/ 0xffffffff80000201ul, /*special=*/0x200000000180ul, /*id=*/0, /*addr=*/0ul); break; case 4: // mprotect arguments: [ // addr: VMA[0x3000] // len: len = 0x3000 (8 bytes) // prot: mmap_prot = 0x1 (8 bytes) // ] syscall(__NR_mprotect, /*addr=*/0x200000000000ul, /*len=*/0x3000ul, /*prot=PROT_READ*/ 1ul); break; case 5: // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {6d 65 6d 6f 72 79 2e 63 75 72 72 65 6e 74 00} (length 0xf) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd NONFAILING(memcpy((void*)0x200000000180, "memory.current\000", 15)); res = syscall(__NR_openat, /*fd=*/(intptr_t)-1, /*file=*/0x200000000180ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; break; case 6: // mmap arguments: [ // addr: VMA[0xb36000] // len: len = 0xb36000 (4 bytes) // prot: mmap_prot = 0xa (8 bytes) // flags: mmap_flags = 0x28011 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0xb36000, /*prot=PROT_SEM|PROT_WRITE*/ 0xaul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[0], /*offset=*/0ul); break; case 7: // syz_mount_image$exfat arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 66 61 74 00} (length 0x6) // } // dir: ptr[in, buffer] { // buffer: {13 13 77 c5 fc 35 d4 14 54 d5 d4 1d 29 ad 1a 60 29 59 81 46 // e6 be 16 6e 41 ad 0d bd 40 54 03 3c 9f 33 bb da 82 24 a2 f3 d7 72 e7 // 63 6e 48 b3 3c bf 70 83 72 e8 f1 b9 93 3e c5 12 77 43 be 22 06 20 9e // f0 2d f9 cb f2 f6 e8 80 d3 38 2f 00} (length 0x4e) // } // flags: mount_flags = 0x2000084c (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {69 6f 63 68 61 72 73 65 74 3d 61 73 63 69 69 // 2c 64 69 73 63 61 72 64 2c 64 6d 61 73 6b 3d 30 30 30 30 30 30 // 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 37 2c 75 69 64 // 3d} (length 0x3a) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYRES8: ANYRES8 (resource) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {56 96 bd 20 54 ed c7 ca db bc 09 1b 37 fe 88 // 02 f8 d4 73 80 60 92 59 a7 01 b0 2c bf da 27 fc 3a 84 54 67 b8 // d6 5a 4a 36 8b 57 f2 f1 12 68 60 00 3e 90 b6 d7 f2 ce e6 7e 00 // cf} (length 0x3a) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 64 69 73 63 61 72 64 2c 00 fb 27 83 30 ab // 3b 48 84 d3 6a df 69 08 d1 1f 57 83 20 35 e9 6a 15 13 23 11 40 // da 18 2c a7 7a ee dc 49 2b bc 50 1d 94 f8 54 a7 e2 69 09 bd e6 // e6 98 d7 2a 15 ec 80 8a 86 c2 5d} (length 0x44) // } // } // } // chdir: int8 = 0x81 (1 bytes) // size: len = 0x14f3 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x14f3) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000400, "exfat\000", 6)); NONFAILING(memcpy( (void*)0x200000000240, "\023\023w\305\3745\324\024T\325\324\035)\255\032`)" "Y\201F\346\276\026nA\255\r\275@T\003<\2373\273\332\202$" "\242\363\327r\347cnH\263<\277p\203r\350\361\271\223>" "\305\022wC\276\"\006 \236\360-\371\313\362\366\350\200\3238/\000", 78)); NONFAILING(memcpy( (void*)0x200000000c00, "iocharset=ascii,discard,dmask=00000000000000000000007,uid=", 58)); NONFAILING(sprintf((char*)0x200000000c3a, "0x%016llx", (long long)r[0])); NONFAILING(*(uint8_t*)0x200000000c4c = r[0]); NONFAILING(sprintf((char*)0x200000000c4d, "0x%016llx", (long long)-1)); NONFAILING( memcpy((void*)0x200000000c5f, "\x56\x96\xbd\x20\x54\xed\xc7\xca\xdb\xbc\x09\x1b\x37\xfe\x88" "\x02\xf8\xd4\x73\x80\x60\x92\x59\xa7\x01\xb0\x2c\xbf\xda\x27" "\xfc\x3a\x84\x54\x67\xb8\xd6\x5a\x4a\x36\x8b\x57\xf2\xf1\x12" "\x68\x60\x00\x3e\x90\xb6\xd7\xf2\xce\xe6\x7e\x00\xcf", 58)); NONFAILING(sprintf((char*)0x200000000c99, "0x%016llx", (long long)0xee00)); NONFAILING(memcpy( (void*)0x200000000cab, "\x2c\x64\x69\x73\x63\x61\x72\x64\x2c\x00\xfb\x27\x83\x30\xab\x3b\x48" "\x84\xd3\x6a\xdf\x69\x08\xd1\x1f\x57\x83\x20\x35\xe9\x6a\x15\x13\x23" "\x11\x40\xda\x18\x2c\xa7\x7a\xee\xdc\x49\x2b\xbc\x50\x1d\x94\xf8\x54" "\xa7\xe2\x69\x09\xbd\xe6\xe6\x98\xd7\x2a\x15\xec\x80\x8a\x86\xc2\x5d", 68)); NONFAILING(memcpy( (void*)0x200000001580, "\x78\x9c\xec\xdc\x0b\x98\x8e\x55\xbb\x38\xf0\x75\xaf\xb5\x1e\xc6\x34" "\xe9\x6d\x92\xc3\xb0\xee\x75\x3f\xbc\x69\x68\x99\x24\xc9\x21\xa7\x1c" "\x92\x24\x09\x49\x4e\x09\x49\x93\x24\x09\x89\x71\x96\x34\x24\x21\xc7" "\x49\x72\x18\x92\xe4\x30\x8d\x49\xe3\x7c\x3e\xe4\x9c\x34\xf9\xa4\x49" "\x92\x90\x90\x64\xfd\x2f\xd5\xde\xbe\x6f\xf7\x7d\xbb\xbd\xff\xdf\xf7" "\xff\xdb\xd7\x9e\xfb\x77\x5d\xeb\xb2\x6e\xcf\x73\xdf\xef\x5a\x73\xcf" "\x35\xef\x7a\xde\xeb\x9a\xf9\xb6\xd7\x98\x7a\x2d\xeb\xd7\x6e\x46\x44" "\xe2\x9f\x02\xbf\xfd\x93\x22\x84\x88\x11\x42\x8c\x10\x42\x5c\x27\x84" "\x08\x84\x10\x15\xe3\x2b\xc6\x5f\xbe\x5e\x40\x41\xca\x3f\xf7\x22\xec" "\x5f\xab\x79\xfa\xd5\x5e\x01\xbb\x9a\xb8\xff\x79\x1b\xf7\x3f\x6f\xe3" "\xfe\xe7\x6d\xdc\xff\xbc\x8d\xfb\x9f\xb7\x71\xff\xf3\x36\xee\x7f\xde" "\xc6\xfd\x67\x2c\x2f\xdb\x31\xaf\xd8\xf5\x3c\xf2\xee\xe0\xcf\xff\xf3" "\x32\x7e\xff\xff\x5f\x24\xb7\xdc\xd4\x2f\x37\x95\xbb\xb1\xf7\x7f\x23" "\x85\xfb\x9f\xb7\x71\xff\xf3\x36\xee\x7f\xde\xc6\xfd\xcf\xdb\xb8\xff" "\x79\x1b\xf7\xff\x7f\xbf\x5a\xff\xc9\x35\xee\x7f\xde\xc6\xfd\x67\x2c" "\x2f\xbb\xda\x9f\x3f\xf3\xb8\xba\xe3\x6a\x7f\xff\x31\xc6\x18\x63\x8c" "\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6" "\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63" "\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31" "\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18" "\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c" "\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6" "\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63" "\x8c\x31\xc6\x18\xcb\x1b\xce\xfb\x2b\xb4\x10\xe2\xdf\xe6\xff\x30\xe1" "\xe7\x3f\xbb\x81\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\xff\xd3\xf8\xfc" "\x57\x7b\x05\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\xfb\x7f\x0f\x84\x14" "\x4a\x68\x11\x88\x7c\x22\xbf\x88\x11\x05\x44\xac\xb8\x46\xc4\x89\x6b" "\x45\x41\x71\x9d\x88\x88\xeb\x45\xbc\xb8\x41\x14\x12\x37\x8a\xc2\xa2" "\x88\x28\x2a\x8a\x89\x04\x51\x5c\x94\x10\x46\xa0\xb0\x82\x44\x28\x4a" "\x8a\x52\x22\x2a\x6e\x12\xa5\xc5\xcd\x22\x51\x94\x11\x65\xc5\x2d\xc2" "\x89\x72\x22\x49\xdc\x2a\xca\x8b\xdb\x44\x05\x71\xbb\xa8\x28\xee\x10" "\x95\xc4\x9d\xa2\xb2\xa8\x22\xaa\x8a\x6a\xe2\x2e\x51\x5d\xd4\x10\x35" "\x45\x2d\x51\x5b\xdc\x2d\xea\x88\xba\xa2\x9e\xa8\x2f\xee\x11\x0d\xc4" "\xbd\xa2\xa1\xb8\x4f\x34\x12\xf7\x8b\xc6\xe2\x01\xd1\x44\x3c\x28\x9a" "\x8a\x87\x44\x33\xd1\x5c\xb4\x10\x0f\x8b\x96\xe2\x11\xd1\x4a\x3c\x2a" "\x5a\x8b\x36\xa2\xad\x68\x27\xda\xff\x5f\xe5\xbf\x28\xfa\x89\x97\x44" "\x7f\x31\x40\xa4\x88\x81\x62\x90\x18\x2c\x86\x88\xa1\x62\x98\x18\x2e" "\x46\x88\x97\xc5\x48\xf1\x8a\x18\x25\x5e\x15\xa9\x62\xb4\x18\x23\x5e" "\x13\x63\xc5\xeb\x62\x9c\x78\x43\x8c\x17\x13\xc4\x44\xf1\xa6\x98\x24" "\x26\x8b\x29\x62\xaa\x98\x26\xa6\x8b\x34\xf1\x96\x98\x21\xde\x16\x33" "\xc5\x3b\x62\x96\x98\x2d\xe6\x88\xb9\x22\x5d\xcc\x13\xf3\xc5\xbb\x62" "\x81\x78\x4f\x2c\x14\xef\x8b\x45\xe2\x03\xb1\x58\x2c\x11\x4b\xc5\x32" "\x91\x21\x3e\x14\x99\x62\xb9\xc8\x12\x1f\x89\x15\xe2\x63\x91\x2d\x56" "\x8a\x55\x62\xb5\x58\x23\xd6\x8a\x75\x62\xbd\xd8\x20\x36\x8a\x4d\x62" "\xb3\xd8\x22\xb6\x8a\x6d\x62\xbb\xd8\x21\x3e\x11\x3b\xc5\x2e\xb1\x5b" "\xec\x11\x7b\xc5\x3e\xb1\x5f\x7c\x2a\x0e\x88\xcf\xc4\x41\xf1\xb9\xc8" "\x11\x5f\xfc\x37\xf3\xcf\xfd\x87\xfc\xde\x20\x40\x80\x04\x09\x1a\x34" "\xe4\x83\x7c\x10\x03\x31\x10\x0b\xb1\x10\x07\x71\x50\x10\x0a\x42\x04" "\x22\x10\x0f\xf1\x50\x08\x0a\x41\x61\x28\x0c\x45\xa1\x28\x24\x40\x02" "\x94\x80\x12\x80\x80\x40\x40\x50\x12\x4a\x42\x14\xa2\x50\x1a\x4a\x43" "\x22\x24\x42\x59\x28\x0b\x0e\x1c\x24\x41\x12\x94\x87\xdb\xa0\x02\x54" "\x80\x8a\x50\x11\x2a\x41\x25\xa8\x0c\x55\xa0\x0a\x54\x83\x6a\x50\x1d" "\xaa\x43\x4d\xa8\x09\xb5\xa1\x36\xd4\x81\x3a\x50\x0f\xea\xc1\x3d\x70" "\x0f\xdc\x0b\x0d\xa1\x21\x34\x82\x46\xd0\x18\x1a\x43\x13\x68\x02\x4d" "\xa1\x29\x34\x83\x66\xd0\x02\x5a\x40\x4b\x68\x09\xad\xa0\x15\xb4\x86" "\xd6\xd0\x16\xda\x42\x7b\x68\x0f\x1d\xa0\x03\x74\x84\x8e\xd0\x19\x3a" "\x43\x17\xe8\x02\x5d\xa1\x2b\x24\x43\x32\x74\x83\x6e\xd0\x1d\xba\x43" "\x0f\xe8\x01\x3d\xa1\x27\xf4\x82\x5e\xd0\x1b\xfa\x40\x1f\x78\x11\x5e" "\x84\x97\xe0\x25\x18\x00\x75\xe4\x40\x18\x04\x83\x60\x08\x0c\x81\x61" "\x30\x1c\x86\xc3\xcb\x30\x12\x5e\x81\x57\xe0\x55\x48\x85\xd1\x30\x06" "\x5e\x83\xd7\xe0\x75\x18\x07\x67\x61\x3c\x4c\x80\x89\x30\x11\xaa\xcb" "\xc9\x30\x05\xa6\x02\xc9\xe9\x90\x06\x69\x30\x03\x66\xc0\x4c\x98\x09" "\xb3\x60\x36\xcc\x86\xb9\x90\x0e\xf3\x60\x3e\xcc\x87\x05\xf0\x1e\xbc" "\x07\xef\xc3\x22\xf8\x00\x3e\x80\x25\xb0\x04\x96\x41\x06\x64\x40\x26" "\x2c\x87\x2c\xc8\x82\x15\x70\x0e\xb2\x61\x25\xac\x82\xd5\xb0\x06\xd6" "\xc2\x1a\x58\x0f\x1b\x60\x3d\x6c\x82\xcd\xb0\x09\xb6\xc2\x56\xd8\x0e" "\xdb\xe1\x13\xf8\x04\x76\xc1\x2e\xd8\x03\x7b\x60\x1f\xec\x83\x4f\xe1" "\x53\xf8\x0c\x3e\x83\x54\xc8\x81\x1c\x38\x04\x87\xe0\x30\x1c\x86\x23" "\x70\x04\x72\x21\x17\x8e\xc2\x51\x38\x06\xc7\xe0\x38\x1c\x87\x13\x70" "\x02\x4e\xc2\x29\x38\x0d\xa7\xe0\x0c\x9c\x81\xb3\x70\x0e\xce\xc3\x79" "\xb8\x00\x17\xe0\x22\x3c\x9f\xf0\x75\x8b\x7d\x65\x36\xa6\x0a\x79\x99" "\x96\x5a\xe6\x93\xf9\x64\x8c\x8c\x91\xb1\x32\x56\xc6\xc9\x38\x59\x50" "\x16\x94\x11\x19\x91\xf1\x32\x5e\x16\x92\x85\x64\x61\x59\x58\x16\x95" "\x45\x65\x82\x4c\x90\x25\x64\x09\x89\x12\x25\xc9\x50\x96\x94\x25\x65" "\x54\x46\x65\x69\x59\x5a\x26\xca\x44\x59\x56\x96\x95\x4e\x3a\x99\x24" "\x93\x64\x79\x59\x5e\x56\x90\x15\x64\x45\x79\x87\xac\x24\xef\x94\x95" "\x65\x15\xd9\xc9\x55\x93\xd5\x64\x75\xd9\xd9\xd5\x94\xb5\x64\x6d\x59" "\x5b\xd6\x91\x75\x65\x3d\x59\x5f\xd6\x97\x0d\x64\x03\xd9\x50\x36\x94" "\x8d\x64\x23\xd9\x58\x36\x96\x4d\xe4\x83\xb2\xa9\x1c\x08\xc3\xa0\xb9" "\xbc\xdc\x99\x96\x72\x34\xb4\x92\x63\xa0\xb5\x6c\x23\xdb\xca\x76\xf2" "\x75\x78\x4c\x76\x90\xe3\xa0\xa3\xec\x24\x3b\xcb\x27\xe4\x04\x18\x0f" "\x5d\x65\x07\x97\x2c\x9f\x96\xdd\xe4\x14\xe8\x2e\x9f\x95\x53\xe1\x39" "\xd9\x53\x4e\x87\x5e\xf2\x05\xd9\x5b\xf6\x91\x7d\xe5\x8b\xb2\x9f\xec" "\xe8\xfa\xcb\x01\x72\x16\x0c\x94\x83\xe4\x5c\x18\x22\x87\xca\x61\x72" "\xb8\x5c\x00\x75\xe5\xe5\x8e\xd5\x93\xaf\xca\x54\x39\x5a\x8e\x91\xaf" "\xc9\x65\xf0\xba\x1c\x27\xdf\x90\xe3\xe5\x04\x39\x51\xbe\x29\x27\xc9" "\xc9\x72\x8a\x9c\x2a\xa7\xc9\xe9\x32\x4d\xbe\x25\x67\xc8\xb7\xe5\x4c" "\xf9\x8e\x9c\x25\x67\xcb\x39\x72\xae\x4c\x97\xf3\xe4\x7c\xf9\xae\x5c" "\x20\xdf\x93\x0b\xe5\xfb\x72\x91\xfc\x40\x2e\x96\x4b\xe4\x52\xb9\x4c" "\x66\xc8\x0f\x65\xa6\x5c\x2e\xb3\xe4\x47\x72\x85\xfc\x58\x66\xcb\x95" "\x72\x95\x5c\x2d\xd7\xc8\xb5\x72\x9d\x5c\x2f\x37\xc8\x8d\x72\x93\xdc" "\x2c\xb7\xc8\xad\x72\x9b\xdc\x2e\x77\xc8\x4f\xe4\x4e\xb9\x4b\xee\x96" "\x7b\xe4\x5e\xb9\x4f\xee\x97\x9f\xca\x03\xf2\x33\x79\x50\x7e\x2e\x73" "\xe4\x17\xf2\x90\xfc\x8b\x3c\x2c\xbf\x94\x47\xe4\x57\x32\x57\x7e\x2d" "\x8f\xca\x6f\xe4\x31\xf9\xad\x3c\x2e\xbf\x93\x27\xe4\xf7\xf2\xa4\x3c" "\x25\x4f\xcb\x1f\xe4\x19\xf9\xa3\x3c\x2b\xcf\xc9\xf3\xf2\x27\x79\x41" "\xfe\x2c\x2f\xca\x5f\xe4\x25\xe9\xa5\x50\xa0\xa4\x52\x4a\xab\x40\xe5" "\x53\xf9\x55\x8c\x2a\xa0\x62\xd5\x35\x2a\x4e\x5d\xab\x0a\xaa\xeb\x54" "\x44\x5d\xaf\xe2\xd5\x0d\xaa\x90\xba\x51\x15\x56\x45\x54\x51\x55\x4c" "\x25\xa8\xe2\xaa\x84\x32\x0a\x95\x55\xa4\x42\x55\x52\x95\x52\x51\x75" "\x93\x2a\xad\x6e\x56\x89\xaa\x8c\x2a\xab\x6e\x51\x4e\x95\x53\x49\xea" "\x56\x55\x5e\xdd\xa6\x2a\xa8\xdb\x55\x45\x75\x87\xaa\xa4\xee\x54\x95" "\x55\x15\x55\x55\x55\x53\x77\xa9\xea\xaa\x86\xaa\xa9\x6a\xa9\xda\xea" "\x6e\x55\x47\xd5\x55\xf5\x54\x7d\x75\x8f\x6a\xa0\xee\x55\x0d\xd5\x7d" "\xaa\x91\xba\x5f\x35\x56\x0f\xa8\x26\xea\x41\xd5\x54\x3d\xa4\x9a\xa9" "\xe6\xaa\x85\x7a\x58\xb5\x54\x8f\xa8\x56\xea\x51\xd5\x5a\xb5\x51\x6d" "\x55\x3b\xd5\x5e\x3d\xa6\x3a\xa8\xc7\x55\x47\xd5\x49\x75\x56\x4f\xa8" "\x2e\xea\x49\xd5\x55\x3d\xa5\x92\xd5\xd3\xaa\x9b\x7a\x46\x75\x57\xcf" "\xaa\x1e\xea\x39\xd5\x53\x3d\xaf\x7a\xa9\x17\x54\x6f\xd5\x47\xf5\x55" "\xbf\xa8\x4b\xca\xab\xfe\x6a\x80\x4a\x51\x03\xd5\x20\x35\x58\x0d\x51" "\x43\xd5\x30\x35\x5c\x8d\x50\x2f\xab\x91\xea\x15\x35\x4a\xbd\xaa\x52" "\xd5\x68\x35\x46\xbd\xa6\xc6\xaa\xd7\xd5\x38\xf5\x86\x1a\xaf\x26\xa8" "\x89\xea\x4d\x35\x49\x4d\x56\x53\xd4\x54\x35\x4d\x4d\x57\x69\xea\x2d" "\x35\x43\xbd\xad\x66\xaa\x77\xd4\x2c\x35\x5b\xcd\x51\x73\x55\xba\x9a" "\xa7\x86\xfd\x5e\x69\xe1\x7f\x21\xff\xed\xbf\x93\x3f\xea\xd7\x57\xdf" "\xae\x76\xa8\x4f\xd4\x4e\xb5\x4b\xed\x56\x7b\xd4\x5e\xb5\x4f\xed\x57" "\xfb\xd5\x01\x75\x40\x1d\x54\x07\x55\x8e\xca\x51\x87\xd4\x21\x75\x58" "\x1d\x56\x47\xd4\x11\x95\xab\x72\xd5\x51\x75\x54\x1d\x53\xc7\xd4\x71" "\x75\x5c\x9d\x50\x27\xd4\x49\x75\x4a\xfd\xa4\x7e\x50\x67\xd4\x8f\xea" "\xac\x3a\xa7\xce\xa9\x9f\xd4\x05\x75\x41\x5d\xfc\xfd\x6b\x20\x34\x68" "\xa9\x95\xd6\x3a\xd0\xf9\x74\x7e\x1d\xa3\x0b\xe8\x58\x7d\x8d\x8e\xd3" "\xd7\xea\x82\xfa\x3a\x1d\xd1\xd7\xeb\x78\x7d\x83\x2e\xa4\x6f\xd4\x85" "\x75\x11\x5d\x54\x17\xd3\x09\xba\xb8\x2e\xa1\x8d\x46\x6d\x35\xe9\x50" "\x97\xd4\xa5\x74\x54\xdf\xa4\x4b\xeb\x9b\x75\xa2\x2e\xa3\xcb\xea\x5b" "\xb4\xd3\xe5\x74\x92\xbe\xf5\x9f\xce\xff\xb3\xf5\xb5\xd7\xed\x75\x07" "\xdd\x41\x77\xd4\x1d\x75\x67\xdd\x59\x77\xd1\x5d\x74\x57\xdd\x55\x27" "\xeb\x64\xdd\x4d\x77\xd3\xdd\x75\x77\xdd\x43\xf7\xd0\x3d\x75\x4f\xdd" "\x4b\xf7\xd2\xbd\x75\x6f\xdd\x57\xf7\xd5\xfd\x74\x3f\xdd\x5f\xf7\xd7" "\x29\x3a\x45\x0f\xd2\x83\xf5\x10\x3d\x54\x0f\xd3\xc3\xf5\x08\xfd\xb2" "\x1e\xa9\x47\xea\x51\x7a\x94\x4e\xd5\xa9\x7a\x8c\x1e\xa3\xc7\xea\xb1" "\x7a\x9c\x1e\xa7\xc7\xeb\xf1\x7a\xa2\x9e\xa8\x27\xe9\x49\x7a\x8a\x9e" "\xa2\xa7\xe9\x69\x3a\x4d\xa7\xe9\x19\x7a\x86\x9e\xa9\x67\xea\x59\x7a" "\x96\x9e\xa3\xe7\xe8\x74\x9d\xae\xe7\xeb\xf9\x7a\x81\x5e\xa0\x17\xea" "\x85\x7a\x91\x5e\xa4\x17\xeb\xc5\x7a\xa9\x5e\xaa\x33\x74\x86\xce\xd4" "\x99\x3a\x4b\x67\xe9\x15\x7a\x85\xce\xd6\x2b\xf5\x4a\xbd\x5a\xaf\xd6" "\x6b\xf5\x5a\xbd\x5e\xaf\xd7\x1b\xf5\x46\xbd\x59\x6f\xd6\x5b\xf5\x56" "\x9d\xad\x77\xe8\x1d\x7a\xa7\xde\xa9\x77\xeb\xdd\x7a\xaf\xde\xab\xf7" "\xeb\xfd\xfa\x80\x3e\xa0\x0f\xea\x83\x3a\x47\xe7\xe8\x43\xfa\x90\x3e" "\xac\x0f\xeb\x23\xfa\x88\xce\xd5\xb9\xfa\xa8\x3e\xaa\x8f\xe9\x63\xfa" "\xb8\x3e\xae\x4f\xe8\x13\xfa\xa4\x3e\xa9\x4f\xeb\xd3\xfa\x8c\x3e\xa3" "\xcf\xea\xb3\xfa\xbc\x3e\xaf\x2f\xe8\x0b\xfa\xa2\xbe\xa8\x2f\xe9\x4b" "\x97\x8f\x7d\x81\x0c\x64\xa0\x03\x1d\xe4\x0b\xf2\x05\x31\x41\x4c\x10" "\x1b\xc4\x06\x71\x41\x5c\x50\x30\x28\x18\x44\x82\x48\x10\x1f\xc4\x07" "\x85\x82\x1b\x83\xc2\x41\x91\xa0\x68\x50\x2c\x48\x08\x8a\x07\x25\x02" "\x13\x60\x60\x03\x0a\xc2\xa0\x64\x50\x2a\x88\x06\x37\x05\xa5\x83\x9b" "\x83\xc4\xa0\x4c\x50\x36\xb8\x25\x70\x41\xb9\x20\x29\xb8\x35\x28\x1f" "\xdc\x16\x54\x08\x6e\x0f\x2a\x06\x77\x04\x95\x82\x3b\x83\xca\x41\x95" "\xa0\x6a\x50\x2d\xb8\x2b\xa8\x1e\xd4\x08\x6a\x06\xb5\x82\xda\xc1\xdd" "\x41\x9d\xa0\x6e\x50\x2f\xa8\x1f\xdc\x13\x34\x08\xee\x0d\x1a\x06\xf7" "\x05\x8d\x82\xfb\x83\xc6\xc1\x03\x41\x93\xe0\xc1\xa0\x69\xf0\x50\xd0" "\x2c\x68\x1e\xb4\x08\x1e\x0e\x5a\x06\x8f\x04\xad\x82\x47\x83\xd6\x41" "\x9b\xa0\x6d\xd0\x2e\x68\xff\x2f\xad\xef\xfd\xd9\x22\x8f\xbb\xfe\x66" "\x80\x49\x31\x03\xcd\x20\x33\xd8\x0c\x31\x43\xcd\x30\x33\xdc\x8c\x30" "\x2f\x9b\x91\xe6\x15\x33\xca\xbc\x6a\x52\xcd\x68\x33\xc6\xbc\x66\xc6" "\x9a\xd7\xcd\x38\xf3\x86\x19\x6f\x26\x98\x89\xe6\x4d\x33\xc9\x4c\x36" "\x53\xcc\x54\x33\xcd\x4c\x37\x69\xe6\x2d\x33\xc3\xbc\x6d\x66\x9a\x77" "\xcc\x2c\x33\xdb\xcc\x31\x73\x4d\xba\x99\x57\xe3\xf7\x43\xb7\x59\x68" "\xde\x37\x8b\xcc\x07\x66\xb1\x59\x62\x96\x9a\x65\x26\xc3\x7c\x68\x32" "\xcd\x72\x93\x65\x3e\x32\x2b\xcc\xc7\x26\xdb\xac\x34\xab\xcc\x6a\xb3" "\xc6\xac\x35\xeb\xcc\x7a\xb3\xc1\x6c\x34\x9b\xcc\x66\xb3\xc5\x6c\x35" "\xdb\xcc\x76\xb3\xc3\x7c\x62\x76\x9a\x5d\x66\xb7\xd9\x63\xf6\x9a\x7d" "\x66\xbf\xf9\xd4\x1c\x30\x9f\x99\x83\xe6\x73\x93\x63\xbe\x30\x87\xcc" "\x5f\xcc\x61\xf3\xa5\x39\x62\xbe\x32\xb9\xe6\x6b\x73\xd4\x7c\x63\x8e" "\x99\x6f\xcd\x71\xf3\x9d\x39\x61\xbe\x37\x27\xcd\x29\x73\xda\xfc\x60" "\xce\x98\x1f\xcd\x59\x73\xce\x9c\x37\x3f\x99\x0b\xe6\x67\x73\xd1\xfc" "\x62\x2e\x19\x7f\xf9\x70\x7f\xf9\xed\x1d\x35\x6a\xcc\x87\xf9\x30\x06" "\x63\x30\x16\x63\x31\x0e\xe3\xb0\x20\x16\xc4\x08\x46\x30\x1e\xe3\xb1" "\x10\x16\xc2\xc2\x58\x18\x8b\x62\x51\x4c\xc0\x04\x2c\x81\x25\xf0\x32" "\x42\xc2\x92\x58\x12\xa3\x18\xc5\xd2\x58\x1a\x13\x31\x11\xcb\x62\x59" "\x74\xe8\x30\x09\x93\xb0\x3c\x96\xc7\x0a\x58\x01\x2b\x62\x45\xac\x84" "\x95\xb0\x32\x56\xc6\xaa\x58\x15\xef\xc2\xbb\xb0\x06\xd6\xc0\x5a\x58" "\x0b\xef\xc6\xbb\xb1\x2e\xd6\xc5\xfa\x58\x1f\x1b\x60\x03\x6c\x88\x0d" "\xb1\x11\x36\xc2\xc6\xd8\x18\x9b\x60\x13\x6c\x8a\x4d\xb1\x19\x36\xc3" "\x16\xd8\x02\x5b\x62\x4b\x6c\x85\xad\xb0\x35\xb6\xc6\xb6\xd8\x16\xdb" "\x63\x7b\xec\x80\x1d\xb0\x23\x76\xc4\xce\xd8\x19\xbb\x60\x17\xec\x8a" "\x5d\x31\x19\x93\xb1\x1b\x76\xc3\xee\xd8\x1d\x7b\x60\x0f\xec\x89\x3d" "\xb1\x17\xf6\xc2\xde\xd8\x1b\xfb\x62\x5f\xec\x87\xfd\xb0\x3f\xf6\xc7" "\x14\x4c\xc1\x41\x38\x08\x87\xe0\x10\x1c\x86\xc3\x70\x04\x8e\xc0\x91" "\x38\x12\x47\xe1\x28\x4c\xc5\x54\x1c\x83\x63\x70\x2c\x8e\xc5\x71\x38" "\x0e\xc7\xe3\x04\x9c\x88\x6f\xe2\x24\x9c\x8c\x53\x70\x2a\x4e\xc3\xe9" "\x98\x86\x69\x38\x03\x67\xe0\x4c\x9c\x89\xb3\x70\x16\xce\xc1\x39\x98" "\x8e\xe9\x38\x1f\xe7\xe3\x02\x5c\x80\x0b\x71\x21\x2e\xc2\x45\xb8\x18" "\x17\xe3\x52\x5c\x8a\x19\x98\x81\x99\x98\x89\x59\x98\x85\x2b\x70\x05" "\x66\x63\x36\xae\xc2\x55\xb8\x06\xd7\xe0\x3a\x5c\x87\x1b\x70\x03\x6e" "\xc2\x4d\xb8\x05\xb7\xe0\x36\xdc\x86\x3b\x70\x07\xee\xc4\x9d\xb8\x1b" "\x77\xe3\x5e\xdc\x8b\xfb\x71\x3f\x1e\xc0\x03\x78\x10\x0f\x62\x0e\xe6" "\xe0\x21\x3c\x84\x87\xf1\x30\x1e\xc1\x23\x98\x8b\xb9\x78\x14\x8f\xe2" "\x31\x3c\x86\xc7\xf1\x38\x9e\xc0\x13\x78\x12\x4f\xe2\x69\x3c\x8d\x67" "\xf0\x0c\x9e\xc5\xb3\x78\x1e\xcf\xe3\x05\xfc\x19\x2f\xe2\x2f\x78\x09" "\x3d\xc6\x58\x29\x62\xed\x35\x36\xce\x5e\x6b\x0b\xda\xeb\x6c\x8c\x2d" "\x60\xff\x3a\x2e\x6a\x8b\xd9\x04\x5b\xdc\x96\xb0\xc6\x16\xb6\x45\xfe" "\x26\x46\x6b\x6d\xa2\x2d\x63\xcb\xda\x5b\xac\xb3\xe5\x6c\x92\xbd\xf5" "\x0f\x71\x65\x5b\xc5\x56\xb5\xd5\xec\x5d\xb6\xba\xad\x61\x6b\xfe\x21" "\x6e\x60\xef\xb5\x0d\xed\x7d\xb6\x91\xbd\xdf\xd6\xb7\xf7\xfc\x4d\xdc" "\xd8\x3e\x60\x9b\xd8\x47\x6c\x53\xfb\xa8\x6d\x66\xdb\xd8\x16\xb6\x9d" "\x6d\x69\x1f\xb1\xad\xec\xa3\xb6\xb5\x6d\x63\xdb\xda\x76\xb6\x8b\x7d" "\xd2\x76\xb5\x4f\xd9\x64\xfb\xb4\xed\x66\x9f\xf9\x43\x9c\x69\x97\xdb" "\x0d\x76\xa3\xdd\x64\x37\xdb\x03\xf6\x33\x7b\xde\xfe\x64\x8f\xd9\x6f" "\xed\x05\xfb\xb3\xed\x6f\x07\xd8\x11\xf6\x65\x3b\xd2\xbe\x62\x47\xd9" "\x57\x6d\xaa\x1d\xfd\x87\x78\xa2\x7d\xd3\x4e\xb2\x93\xed\x14\x3b\xd5" "\x4e\xb3\xd3\xff\x10\xcf\xb1\x73\x6d\xba\x9d\x67\xe7\xdb\x77\xed\x02" "\xfb\xde\x1f\xe2\x0c\xfb\xa1\x5d\x64\xb3\xec\x62\xbb\xc4\x2e\xb5\xcb" "\x7e\x8d\x2f\xaf\x29\xcb\x7e\x64\x57\xd8\x8f\x6d\xb6\x5d\x69\x57\xd9" "\xd5\x76\x8d\x5d\x6b\xd7\xd9\xf5\xff\xbe\xd6\xd5\x76\xab\xdd\x66\xb7" "\xdb\xfd\xf6\x53\xbb\xd3\xee\xb2\xbb\xed\x1e\xbb\xd7\xee\xfb\x35\xbe" "\xbc\x8f\x83\xf6\x73\x9b\x63\xbf\xb0\x47\xed\x37\xf6\xb0\xfd\xd2\x1e" "\xb1\xc7\x6d\xae\xfd\xfa\xd7\xf8\xf2\xfe\x8e\xdb\xef\xec\x09\xfb\xbd" "\x3d\x69\x4f\xd9\xd3\xf6\x07\x7b\xc6\xfe\x68\xcf\xda\x73\xbf\xee\xff" "\xf2\xde\x7f\xb0\xbf\xd8\x4b\xd6\x5b\x41\x40\x92\x14\x69\x0a\x28\x1f" "\xe5\xa7\x18\x2a\x40\xb1\x74\x0d\xc5\xd1\xb5\x54\x90\xae\xa3\x08\x5d" "\x4f\xf1\x74\x03\x15\xa2\x1b\xa9\x30\x15\xa1\xa2\x54\x8c\x12\xa8\x38" "\x95\x20\x43\x48\x96\x88\x42\x2a\x49\xa5\x28\x4a\x37\x51\x69\xba\x99" "\x12\xa9\x0c\x95\xa5\x5b\xc8\x51\x39\x4a\xa2\x5b\xa9\x3c\xdd\x46\x15" "\xe8\x76\xaa\x48\x77\x50\x25\xba\x93\x2a\x53\x15\xaa\x4a\xd5\xe8\x2e" "\xaa\x4e\x35\xa8\x26\xd5\xa2\xda\x74\x37\xd5\xa1\xba\x54\x8f\xea\xd3" "\x3d\xd4\x80\xee\xa5\x86\x74\x1f\x35\xa2\xfb\xa9\x31\x3d\x40\x4d\xe8" "\x41\x6a\x4a\x0f\x51\x33\x6a\x4e\x2d\xe8\x61\x6a\x49\x8f\x50\x2b\x7a" "\x94\x5a\x53\x1b\x6a\x4b\xed\xa8\x3d\x3d\x46\x1d\xe8\x71\xea\x48\x9d" "\xa8\x33\x3d\x41\x5d\xe8\x49\xea\x4a\x4f\x51\x32\x3d\x4d\xdd\xe8\x19" "\xea\x4e\xcf\x52\x0f\x7a\x8e\x7a\xd2\xf3\xd4\x8b\x5e\xa0\xde\xd4\x87" "\xfa\xd2\x8b\xd4\x8f\x5e\xa2\xfe\x34\x80\x52\x68\x20\x0d\xa2\xc1\x34" "\x84\x86\xd2\x30\x1a\x4e\x23\xe8\x65\x1a\x49\xaf\xd0\x28\x7a\x95\x52" "\x69\x34\x8d\xa1\xd7\x68\x2c\xbd\x4e\xe3\xe8\x0d\x1a\x4f\x13\x68\x22" "\xbd\x49\x93\x68\x32\x4d\xa1\xa9\x34\x8d\xa6\x53\x1a\xbd\x45\x33\xe8" "\x6d\x9a\x49\xef\xd0\x2c\x9a\x4d\x73\x68\x2e\xa5\xd3\x3c\x9a\x4f\xef" "\xd2\x02\x7a\x8f\x16\xd2\xfb\xb4\x88\x3e\xa0\xc5\xb4\x84\x96\xd2\x32" "\xca\xa0\x0f\x29\x93\x96\x53\x16\x7d\x44\x2b\xe8\x63\xca\xa6\x95\xb4" "\x8a\x56\xd3\x1a\x5a\x4b\xeb\x68\x3d\x6d\xa0\x8d\xb4\x89\x36\xd3\x16" "\xda\x4a\xdb\x68\x3b\xed\xa0\x4f\x68\x27\xed\xa2\xdd\xb4\x87\xf6\xd2" "\x3e\xda\x4f\x9f\xd2\x01\xfa\x8c\x0e\xd2\xe7\x94\x43\x5f\xd0\x21\xfa" "\x0b\x1d\xa6\x2f\xe9\x08\x7d\x45\xb9\xf4\x35\x1d\xa5\x6f\xe8\x18\x7d" "\x4b\xc7\xe9\x3b\x3a\x41\xdf\xd3\x49\x3a\x45\xa7\xe9\x07\x3a\x43\x3f" "\xd2\x59\x3a\x47\xe7\xe9\x27\xba\x40\x3f\xd3\x45\xfa\x85\x2e\x91\x27" "\x11\x42\x28\x43\x15\xea\x30\x08\xf3\x85\xf9\xc3\x98\xb0\x40\x18\x1b" "\x5e\x13\xc6\x85\xd7\x86\x05\xc3\xeb\xc2\x48\x78\x7d\x18\x1f\xde\x10" "\x16\x0a\x6f\x0c\x0b\x87\x45\xc2\xa2\x61\xb1\x30\x21\x2c\x1e\x96\x08" "\x4d\x88\xa1\x0d\x29\x0c\xc3\x92\x61\xa9\x30\x1a\xde\x14\x96\x0e\x6f" "\x0e\x13\xc3\x32\x61\xd9\xf0\x96\xd0\x85\xe5\xc2\xa4\xf0\xd6\xb0\x7c" "\x78\x5b\x58\x21\xbc\x3d\xac\x18\xde\x11\x56\x0a\xef\x0c\x2b\x87\x55" "\xc2\x47\xee\xaf\x16\xde\x15\x56\x0f\x6b\x84\x35\xc3\x5a\x61\xed\xf0" "\xee\xb0\x4e\x58\x37\xac\x17\xd6\x0f\xef\x09\x1b\x84\xf7\x86\x0d\xc3" "\xfb\xc2\x46\xe1\xfd\x61\x85\xf0\x81\xb0\x49\xf8\x60\xd8\x34\x7c\x28" "\x6c\x16\x36\x0f\x5b\x84\x0f\x87\x2d\xc3\x47\xc2\x56\xe1\xa3\x61\xeb" "\xb0\x4d\xd8\x36\x6c\x17\xb6\x0f\x1f\x0b\x3b\x84\x8f\x87\x1d\xc3\x4e" "\x61\xe7\xf0\x89\xb0\x4b\xf8\x64\xd8\x35\x7c\x2a\x4c\x0e\x9f\x0e\xbb" "\x85\xcf\xfc\xe9\xf5\x94\x70\x60\x38\x28\x1c\x1c\x0e\x0e\xbd\xbf\x4f" "\x2d\x8d\x2e\x8b\x66\x44\x3f\x8c\x66\x46\x97\x47\xb3\xa2\x1f\x45\x57" "\x44\x3f\x8e\x66\x47\x57\x46\x57\x45\x57\x47\xd7\x44\xd7\x46\xd7\x45" "\xd7\x47\x37\x44\x37\x46\x37\x45\x37\x47\xb7\x44\xb7\x46\xb7\x45\xb7" "\x47\xbd\xaf\x9f\x5f\x38\x70\xd2\x29\xa7\x5d\xe0\xf2\xb9\xfc\x2e\xc6" "\x15\x70\xb1\xee\x1a\x17\xe7\xae\x75\x05\xdd\x75\x2e\xe2\xae\x77\xf1" "\xee\x06\x57\xc8\xdd\xe8\x0a\xbb\x22\xae\xa8\x2b\xe6\x12\x5c\x71\x57" "\xc2\x19\x87\xce\x3a\x72\xa1\x2b\xe9\x4a\xb9\xa8\xbb\xc9\x95\x76\x37" "\xbb\x44\x37\xb8\xf9\x6f\x07\x88\x72\x2e\xc9\xb5\x73\xed\x5d\x7b\xd7" "\xc1\x3d\xee\x3a\xba\x4e\xae\xb3\x7b\xc2\x3d\xe1\x9e\x74\x4f\xba\xa7" "\xdc\x53\xee\x69\xd7\xcd\x3d\xe3\xba\xbb\x67\x5d\x0f\xf7\x9c\xeb\xe9" "\x9e\x77\xcf\xbb\x17\x5c\x6f\xd7\xc7\xf5\x75\x2f\xba\x7e\xee\x25\xd7" "\xdf\x0d\x70\x29\x2e\xc5\x0d\x72\x83\xdc\x10\x37\xc4\x0d\x73\xc3\xdc" "\x08\x37\xc2\x8d\x74\x23\xdd\x28\x37\xca\xa5\xba\x54\x37\xc6\x8d\x71" "\x63\xdd\x58\x37\xce\x8d\x73\xe3\xdd\x78\x37\xd1\x4d\x74\x93\xdc\x24" "\x37\xc5\x4d\x71\xd3\xdc\x34\x97\xe6\xd2\xdc\x0c\x37\xc3\xcd\x74\x33" "\xdd\x2c\x37\xcb\xcd\x71\x73\x5c\xba\x4b\x77\xf3\xdd\x7c\xb7\xc0\x2d" "\x70\x0b\xdd\x42\xb7\x28\x71\x91\x5b\xec\x16\xbb\xa5\x6e\xa9\xcb\x70" "\x19\x2e\xd3\x65\xba\x2c\x97\xe5\x56\xb8\x15\x2e\xdb\x65\xbb\x55\x6e" "\x95\x5b\xe3\xd6\xb8\x75\x6e\x9d\xdb\xe0\x36\xb8\x4d\x6e\x93\xdb\xe2" "\xb6\xb8\x6d\x6e\x9b\xdb\xe1\x76\xb8\x9d\x6e\xa7\xdb\xed\x76\xbb\xbd" "\x6e\xaf\xdb\xef\xf6\xbb\x03\xee\x80\x3b\xe8\x0e\xba\x1c\x97\xe3\x0e" "\xb9\x43\xee\xb0\x3b\xec\x8e\xb8\xaf\x5c\xae\xfb\xda\x1d\x75\xdf\xb8" "\x63\xee\x5b\x77\xdc\x7d\xe7\x4e\xb8\xef\xdd\x49\x77\xca\x9d\x76\x3f" "\xb8\x33\xee\x47\x77\xd6\x9d\x73\xe7\xdd\x4f\xee\x82\xfb\xd9\x5d\x74" "\xbf\xb8\x4b\xce\xbb\xb4\xc8\x5b\x91\x19\x91\xb7\x23\x33\x23\xef\x44" "\x66\x45\x66\x47\xe6\x44\xe6\x46\xd2\x23\xf3\x22\xf3\x23\xef\x46\x16" "\x44\xde\x8b\x2c\x8c\xbc\x1f\x59\x14\xf9\x20\xb2\x38\xb2\x24\xb2\x34" "\xb2\x2c\x92\x11\xf9\x30\x92\x19\x59\x1e\xc9\x8a\x7c\x14\x59\x11\xf9" "\x38\x92\x1d\x59\x19\x59\x15\x59\x1d\x59\x13\x59\x1b\xf1\xbe\xf8\xce" "\xd0\x97\xf4\xa5\x7c\xd4\xdf\xe4\x4b\xfb\x9b\x7d\xa2\x2f\xe3\xcb\xfa" "\x5b\xbc\xf3\xe5\x7c\x92\xbf\xd5\x97\xf7\xb7\xf9\x0a\xfe\x76\x5f\xd1" "\xdf\xe1\x2b\xf9\x3b\x7d\x65\x5f\xc5\x57\xf5\x8f\xfa\xd6\xbe\x8d\x6f" "\xeb\xdb\xf9\xf6\xfe\x31\xdf\xc1\x3f\xee\x3b\xfa\x4e\xbe\xb3\x7f\xc2" "\x77\xf1\x4f\xfa\xae\xfe\x29\x9f\xec\x9f\xf6\xdd\xfc\x33\xbe\xbb\x7f" "\xd6\xf7\xf0\xcf\xf9\x9e\xfe\x79\xdf\xcb\xbf\xe0\x7b\xfb\x3e\xbe\xaf" "\x7f\xd1\xf7\xf3\x2f\xf9\xfe\x7e\x80\x4f\xf1\x03\xfd\x20\x3f\xd8\x0f" "\xf1\x43\xfd\x30\x3f\xdc\x8f\xf0\x2f\xfb\x91\xfe\x15\x3f\xca\xbf\xea" "\x53\xfd\x68\x3f\xc6\xbf\xe6\xc7\xfa\xd7\xfd\x38\xff\x86\x1f\xef\x27" "\xf8\x89\xfe\x4d\x3f\xc9\x4f\xf6\x53\xfc\x54\x3f\xcd\x4f\xf7\x69\xfe" "\x2d\x3f\xc3\xbf\xed\x67\xfa\x77\xfc\x2c\x3f\xdb\xcf\xf1\x73\x7d\xba" "\x9f\xe7\xe7\xfb\x77\xfd\x02\xff\x9e\x5f\xe8\xdf\xf7\x8b\xfc\x07\x7e" "\xb1\x5f\xe2\x97\xfa\x65\x3e\xc3\x7f\xe8\x33\xfd\x72\x9f\xe5\x3f\xf2" "\x2b\xfc\xc7\x3e\xdb\xaf\xf4\xab\xfc\x6a\xbf\xc6\xaf\xf5\xeb\xfc\x7a" "\xbf\xc1\x6f\xf4\x9b\xfc\x66\xbf\xc5\x6f\xf5\xdb\xfc\x76\xbf\xc3\x7f" "\xe2\x77\xfa\x5d\x7e\xb7\xdf\xe3\xf7\xfa\x7d\x7e\xbf\xff\xd4\x1f\xf0" "\x9f\xf9\x83\xfe\x73\x9f\xe3\xbf\xf0\x87\xfc\x5f\xfc\x61\xff\xa5\x3f" "\xe2\xbf\xf2\xb9\xfe\x6b\x7f\xd4\x7f\xe3\x8f\xf9\x6f\xfd\x71\xff\x9d" "\x3f\xe1\xbf\xf7\x27\xfd\x29\x7f\xda\xff\xe0\xcf\xf8\x1f\xfd\x59\x7f" "\xce\x9f\xf7\x3f\xf9\x0b\xfe\x67\x7f\xd1\xff\xe2\x2f\xf1\xaf\xa4\x31" "\xc6\x18\x63\x8c\xfd\x97\xa8\x3f\xb9\x3e\xf0\xef\xfc\x9f\xfc\x7d\x5c" "\x36\x48\x08\x71\xed\xae\x62\xb9\xff\xb1\xe6\x96\xc2\xbf\xcd\x87\xca" "\x84\x2e\x11\x21\xc4\xd3\x03\x7a\x35\xff\xb7\x51\xa7\x4e\x4a\x4a\xca" "\xef\xf7\x66\x2b\x11\x94\x5a\x22\x84\x88\x5c\xc9\xcf\x27\xae\xc4\x2b" "\x45\x67\xf1\xa4\x48\x16\x9d\x44\xf9\xbf\xbb\xbe\xa1\xb2\xcf\x05\xfa" "\x93\xfa\xd1\x3b\x84\x88\xfd\xab\x9c\x18\x71\x25\xbe\x52\xff\xb6\x7f" "\x50\xff\xb1\x27\x26\x66\x56\x0a\xcf\xc7\xff\x27\xf5\x97\x08\x91\x58" "\xea\x4a\x4e\x01\x71\x25\xbe\x52\xbf\xc2\x3f\xa8\x5f\xa4\xc3\x9f\xac" "\xbf\xc0\x97\x69\x42\x74\xfc\xab\x9c\x38\x71\x25\xbe\x52\x3f\x49\x3c" "\x2e\x9e\x11\xc9\x7f\x73\x27\x63\x8c\x31\xc6\x18\x63\x8c\x31\xf6\x9b" "\xa1\xb2\x6a\x8f\x3f\x7b\x7e\xbe\xfc\x7c\x9e\xa0\xaf\xe4\xe4\x17\x57" "\xe2\x3f\x7b\x3e\x67\x8c\x31\xc6\x18\x63\x8c\x31\xc6\xd8\xd5\xf7\x5c" "\x9f\xbe\x4f\x3d\x96\x9c\xdc\xa9\x07\x4f\x78\xc2\x13\x9e\xfc\xfb\xe4" "\x6a\xff\x64\x62\x8c\x31\xc6\x18\x63\x8c\xfd\xab\x5d\x39\xf4\x5f\xed" "\x95\x30\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31" "\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18" "\x63\x8c\x31\xc6\x18\x63\x79\xd7\xff\x8f\x3f\x27\x76\xb5\xf7\xc8\x18" "\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c" "\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6" "\x18\x63\x8c\x31\xc6\x18\x63\x8c\x31\xc6\x18\x63\x8c\x5d\x6d\xff\x27" "\x00\x00\xff\xff\x2c\x76\x40\xb9", 5363)); NONFAILING(syz_mount_image( /*fs=*/0x200000000400, /*dir=*/0x200000000240, /*flags=MS_NOEXEC|MS_NODIRATIME|MS_NODEV|MS_MANDLOCK|0x20000000*/ 0x2000084c, /*opts=*/0x200000000c00, /*chdir=*/0x81, /*size=*/0x14f3, /*img=*/0x200000001580)); break; case 8: // bpf$PROG_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: ptr[in, bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], fd_bpf_prog[opt]]] { // bpf_prog_t[flags[bpf_prog_type, int32], bpf_prog_attach_types, // bpf_btf_id[opt], fd_bpf_prog[opt]] { // type: bpf_prog_type = 0x1 (4 bytes) // ninsn: bytesize8 = 0x3 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {85 00 00 00 2e 00 00 00 84 00 00 00 00 00 // 00 00} (length 0x10) // } // } // } // license: nil // loglev: int32 = 0x0 (4 bytes) // logsize: len = 0x0 (4 bytes) // log: nil // kern_version: bpf_kern_version = 0x0 (4 bytes) // flags: bpf_prog_load_flags = 0x0 (4 bytes) // prog_name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00} (length 0x10) prog_ifindex: ifindex (resource) // expected_attach_type: union bpf_prog_attach_types { // fallback: bpf_attach_types = 0x0 (4 bytes) // } // btf_fd: fd_btf (resource) // func_info_rec_size: const = 0x8 (4 bytes) // func_info: nil // func_info_cnt: len = 0x0 (4 bytes) // line_info_rec_size: const = 0x10 (4 bytes) // line_info: nil // line_info_cnt: len = 0x0 (4 bytes) // attach_btf_id: bpf_btf_id (resource) // attach_prog_fd: fd_bpf_prog (resource) // core_relo_cnt: len = 0x0 (4 bytes) // fd_array: nil // core_relos: nil // core_relo_rec_size: const = 0x10 (4 bytes) // log_true_size: int32 = 0x0 (4 bytes) // prog_token_fd: union _bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], // fd_bpf_prog[opt]]_prog_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad: union _bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], // fd_bpf_prog[opt]]_pad_wrapper { // value: const = 0x0 (4 bytes) // } // } // } // size: len = 0x94 (8 bytes) // ] // returns fd_bpf_prog NONFAILING(*(uint32_t*)0x200000000100 = 1); NONFAILING(*(uint32_t*)0x200000000104 = 3); NONFAILING(*(uint64_t*)0x200000000108 = 0x200000001fd8); NONFAILING(memcpy( (void*)0x200000001fd8, "\x85\x00\x00\x00\x2e\x00\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00", 16)); NONFAILING(*(uint64_t*)0x200000000110 = 0); NONFAILING(*(uint32_t*)0x200000000118 = 0); NONFAILING(*(uint32_t*)0x20000000011c = 0); NONFAILING(*(uint64_t*)0x200000000120 = 0); NONFAILING(*(uint32_t*)0x200000000128 = 0); NONFAILING(*(uint32_t*)0x20000000012c = 0); NONFAILING(memset((void*)0x200000000130, 0, 16)); NONFAILING(*(uint32_t*)0x200000000140 = 0); NONFAILING(*(uint32_t*)0x200000000144 = 0); NONFAILING(*(uint32_t*)0x200000000148 = -1); NONFAILING(*(uint32_t*)0x20000000014c = 8); NONFAILING(*(uint64_t*)0x200000000150 = 0); NONFAILING(*(uint32_t*)0x200000000158 = 0); NONFAILING(*(uint32_t*)0x20000000015c = 0x10); NONFAILING(*(uint64_t*)0x200000000160 = 0); NONFAILING(*(uint32_t*)0x200000000168 = 0); NONFAILING(*(uint32_t*)0x20000000016c = 0); NONFAILING(*(uint32_t*)0x200000000170 = -1); NONFAILING(*(uint32_t*)0x200000000174 = 0); NONFAILING(*(uint64_t*)0x200000000178 = 0); NONFAILING(*(uint64_t*)0x200000000180 = 0); NONFAILING(*(uint32_t*)0x200000000188 = 0x10); NONFAILING(*(uint32_t*)0x20000000018c = 0); NONFAILING(*(uint32_t*)0x200000000190 = 0); syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000100ul, /*size=*/0x94ul); break; case 9: // syz_mount_image$vfat arguments: [ // fs: ptr[in, buffer] { // buffer: {76 66 61 74 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {13 13 77 c5 fc 35 d4 14 54 d5 d4 1d 29 ad 1a 60 29 59 81 46 // e6 be 16 6e 41 ad 0d bd 40 54 03 3c 9f 33 bb da 82 24 a2 f3 d7 72 e7 // 63 6e 48 b3 3c bf 70 83 72 e8 f1 b9 93 3e c5 12 77 43 be 22 06 20 9e // f0 2d f9 cb f2 f6 e8 80 d3 38 2f 00} (length 0x4e) // } // flags: mount_flags = 0x399446c (8 bytes) // opts: nil // chdir: int8 = 0x1 (1 bytes) // size: len = 0x0 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x0) // } // ] // returns fd_dir NONFAILING(memcpy((void*)0x200000000140, "vfat\000", 5)); NONFAILING(memcpy( (void*)0x200000000080, "\023\023w\305\3745\324\024T\325\324\035)\255\032`)" "Y\201F\346\276\026nA\255\r\275@T\003<\2373\273\332\202$" "\242\363\327r\347cnH\263<\277p\203r\350\361\271\223>" "\305\022wC\276\"\006 \236\360-\371\313\362\366\350\200\3238/\000", 78)); NONFAILING(syz_mount_image( /*fs=*/0x200000000140, /*dir=*/0x200000000080, /*flags=MS_LAZYTIME|MS_I_VERSION|MS_SHARED|MS_SLAVE|MS_POSIXACL|MS_REC|MS_STRICTATIME|0x46c*/ 0x399446c, /*opts=*/0, /*chdir=*/1, /*size=*/0, /*img=*/0x200000000080)); break; } } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; install_segv_handler(); do_sandbox_none(); return 0; }