// https://syzkaller.appspot.com/bug?id=130cae4a4387fae6614fccf5eed180400ea30948 // 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 static unsigned long long procid; #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) 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) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); 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); 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); 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_hsr(struct nlmsg* nlmsg, int sock, const char* name, const char* slave1, const char* slave2) { netlink_add_device_impl(nlmsg, "hsr", name); 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); 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); 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); 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); 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); 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) { char buf[16]; sprintf(buf, "%u %u", addr, port_count); if (write_file("/sys/bus/netdevsim/new_device", buf)) { 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"}, {"netdevsim", netdevsim}, {"veth", 0}, {"xfrm", "xfrm0"}, {"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_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); } static void setup_common() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setsid(); 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 = 0; 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); setup_common(); sandbox_common(); drop_caps(); initialize_netdevices_init(); if (unshare(CLONE_NEWNET)) { } initialize_netdevices(); loop(); exit(1); } #define NL802154_CMD_SET_SHORT_ADDR 11 #define NL802154_ATTR_IFINDEX 3 #define NL802154_ATTR_SHORT_ADDR 10 static void setup_802154() { int sock_route = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock_route == -1) exit(1); int sock_generic = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock_generic < 0) exit(1); int nl802154_family_id = netlink_query_family_id(&nlmsg, sock_generic, "nl802154", true); for (int i = 0; i < 2; i++) { char devname[] = "wpan0"; devname[strlen(devname) - 1] += i; uint64_t hwaddr = 0xaaaaaaaaaaaa0002 + (i << 8); uint16_t shortaddr = 0xaaa0 + i; int ifindex = if_nametoindex(devname); struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL802154_CMD_SET_SHORT_ADDR; netlink_init(&nlmsg, nl802154_family_id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, NL802154_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(&nlmsg, NL802154_ATTR_SHORT_ADDR, &shortaddr, sizeof(shortaddr)); int err = netlink_send(&nlmsg, sock_generic); if (err < 0) { } netlink_device_change(&nlmsg, sock_route, devname, true, 0, &hwaddr, sizeof(hwaddr), 0); if (i == 0) { netlink_add_device_impl(&nlmsg, "lowpan", "lowpan0"); netlink_done(&nlmsg); netlink_attr(&nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(&nlmsg, sock_route); if (err < 0) { } } } close(sock_route); close(sock_generic); } #ifndef __NR_bpf #define __NR_bpf 321 #endif uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void loop(void) { intptr_t res = 0; res = syscall(__NR_socket, 0x10ul, 3ul, 0); if (res != -1) r[0] = res; *(uint32_t*)0x20000180 = 6; *(uint32_t*)0x20000184 = 4; *(uint64_t*)0x20000188 = 0x20000200; memcpy((void*)0x20000200, "\x18\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x85" "\x00\x00\x00\x2c\x00\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00", 32); *(uint64_t*)0x20000190 = 0x200000c0; memcpy((void*)0x200000c0, "GPL\000", 4); *(uint32_t*)0x20000198 = 4; *(uint32_t*)0x2000019c = 0x1000; *(uint64_t*)0x200001a0 = 0x2062b000; *(uint32_t*)0x200001a8 = 0; *(uint32_t*)0x200001ac = 0; memset((void*)0x200001b0, 0, 16); *(uint32_t*)0x200001c0 = 0; *(uint32_t*)0x200001c4 = 0; *(uint32_t*)0x200001c8 = -1; *(uint32_t*)0x200001cc = 8; *(uint64_t*)0x200001d0 = 0; *(uint32_t*)0x200001d8 = 0; *(uint32_t*)0x200001dc = 0x10; *(uint64_t*)0x200001e0 = 0; *(uint32_t*)0x200001e8 = 0; *(uint32_t*)0x200001ec = 0; *(uint32_t*)0x200001f0 = -1; res = syscall(__NR_bpf, 5ul, 0x20000180ul, 0x70ul); if (res != -1) r[1] = res; *(uint64_t*)0x20000140 = 0; *(uint32_t*)0x20000148 = 0; *(uint64_t*)0x20000150 = 0x20000080; *(uint64_t*)0x20000080 = 0x20000000; *(uint32_t*)0x20000000 = 0x34; *(uint16_t*)0x20000004 = 0x10; *(uint16_t*)0x20000006 = 0x801; *(uint32_t*)0x20000008 = 0; *(uint32_t*)0x2000000c = 0; *(uint8_t*)0x20000010 = 0; *(uint8_t*)0x20000011 = 0; *(uint16_t*)0x20000012 = 0; *(uint32_t*)0x20000014 = 0; *(uint32_t*)0x20000018 = 0; *(uint32_t*)0x2000001c = 0x9000000; *(uint16_t*)0x20000020 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000022, 0x2b, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000023, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000023, 1, 7, 1); *(uint16_t*)0x20000024 = 8; *(uint16_t*)0x20000026 = 1; *(uint32_t*)0x20000028 = r[1]; *(uint16_t*)0x2000002c = 8; *(uint16_t*)0x2000002e = 0x1b; *(uint32_t*)0x20000030 = 0; *(uint64_t*)0x20000088 = 0x34; *(uint64_t*)0x20000158 = 1; *(uint64_t*)0x20000160 = 0; *(uint64_t*)0x20000168 = 0; *(uint32_t*)0x20000170 = 0; syscall(__NR_sendmsg, r[0], 0x20000140ul, 0ul); *(uint32_t*)0x20000200 = 0xc; *(uint32_t*)0x20000204 = 0xe; *(uint64_t*)0x20000208 = 0x20000380; memcpy( (void*)0x20000380, "\xb7\x02\x00\x00\x06\x00\x00\x00\xbf\xa3\x00\x00\x00\x00\x00\x00\x07\x03" "\x00\x00\x00\x7e\xff\xff\x7a\x0a\xf0\xff\xf8\xff\xff\xff\x79\xa4\xf0\xff" "\x00\x00\x00\x00\xb7\x06\x00\x00\xff\xff\xff\xff\x2d\x64\x05\x00\x00\x00" "\x00\x00\x65\x04\x04\x00\x01\x00\x00\x00\x04\x04\x00\x00\x01\x00\x7d\x60" "\xb7\x03\x00\x00\x01\x00\x00\x00\x6a\x0a\x00\xfe\x00\x00\x00\x00\x85\x00" "\x00\x00\x0d\x00\x00\x00\xb7\x00\x00\x00\x00\x00\x00\x00\x95\x00\x00\x00" "\x00\x00\x00\x00\x49\x6c\xf2\x82\x7f\xb4\x3a\x43\x1c\xa7\xeb\xfc\xd0\xcd" "\x00\x00\x6e\xd3\xd0\x9a\x61\x75\x03\x79\x58\xe2\x71\xb6\x0d\xed\xf8\x93" "\x7f\x02\x00\x8b\x5e\x5a\x07\x6d\x83\x92\x3d\xd2\x9c\x03\x40\x55\xd4\x7d" "\xaf\xe6\xc8\xdc\x3d\x5d\x78\xc0\x7f\x34\xe4\xd5\xb3\x18\x5b\x31\x0e\xfd" "\x49\x89\x14\x7a\x00\x00\x00\x00\xf1\x10\x02\x6e\x6d\x2e\xf8\x31\xab\x7e" "\xd4\x8b\x87\xe5\xb9\xda\xf3\xf0\x9c\x9d\x2a\x9c\x5a\xfc\x2d\xa0\xc3\x4f" "\x17\xe3\xad\xee\xf3\xbb\x62\x20\x03\xb5\x38\xdf\xd8\xe0\x12\xe7\x95\x78" "\x0f\x45\x80\xd7\x60\x55\x1b\x5b\x0a\x34\x1a\x2d\x7c\xbd\xb9\x00\x76\xa5" "\xb2\xca\x8e\x05\x00\x00\x00\x3a\x14\x81\x7a\xc6\x1e\x4d\xd1\x11\x83\xa1" "\x34\x77\xbf\x7e\x06\x0e\x36\x70\xef\x0e\x78\x9f\x65\xf1\x32\x8d\x67\x04" "\x23\xb1\x0d\xa7\xfb\x25\xa7\x90\x2c\xbe\x7b\xc0\x4b\x82\xd2\x78\x9c\xb1" "\x32\xb8\x66\x7c\x21\x47\x66\x19\xf2\x8d\x99\x61\xb6\x26\xc5\x7c\x26\x91" "\x20\x81\x71\x65\x6d\x60\xa1\x7e\x3c\x1c\x4b\x75\x1c\x51\x16\x0f\xbc\xbb" "\x58\xe2\x3f\x3e\xe6\x14\x8b\xa5\x32\xe6\xea\x09\xc3\x46\xdf\xeb\xd3\x1a" "\x08\xb3\x28\x08\xb8\x02\x00\x00\x00\x00\x00\x00\x00\x33\x4d\x83\x23\x9d" "\x0c\x2e\x9f\xf1\x0f\xf2\xd2\x70\x80\xe7\x11\x13\x61\x0e\x10\xd8\x58\xe8" "\x03\x00\x00\x00\xb6\xc8\x6a\xda\xc1\x22\x33\xf9\xa1\xfb\x9c\x2a\xec\x61" "\xce\x63\xa3\x8d\x31\x6e\xf4\x9b\x66\xd6\xe4\x2f\xd5\x01\x17\xb8\x9a\x9a" "\xb3\x59\xb4\xee\xa0\xc6\xe9\x57\x67\xd4\x2b\x4e\x54\x86\x1d\x02\x27\xdb" "\xfd\x2e\x6d\x7f\x71\x5a\x5f\x3d\x74\xca\x89\x1c\x45\x94\xe8\xa4\x39\x9e" "\x01\xea\xdd\x39\x64\x66\x3e\x88\x53\x5c\x13\x3f\x71\x30\x85\x6f\x75\x64" "\x36\x30\x37\x67\xd2\xe2\x4f\x29\xe5\xda\xd9\x79\x6e\xdb\x69\x7a\x6e\xa0" "\x18\x2b\xab\xc1\x8c\xae\x2e\xd4\xb4\x39\x0a\xf9\xa9\xce\xef\xd0\x7e\x00" "\x2c\xab\x5e\xbf\x8a\xad\x34\x73\x21\x81\xfe\xb2\x15\x13\x9f\x15\xea\x7e" "\x8c\xb0\xc7\xcb\xe3\x1f\xba\xe7\xc3\x4d\x5a\xc5\xe7\xe6\x4c\x21\xad\xd9" "\x19\x1e\xad\xd6\xe1\x79\x5a\xd6\xa0\xf7\xf8\xcd\x3f\xcc\xbd\xc3\xde\xc0" "\x4b\x25\xdf\xc1\x79\x75\x23\x83\x45\xd4\xf7\x1a\xf3\x59\x10\xb1\x58\xe5" "\x66\x57\xb7\x21\x8b\xaa\xa7\xcb\xf7\x81\xc0\xa9\x78\xd5\x04\x99\xcc\xc4" "\x21\xac\xe5\xe8\x5e\xfb\x17\xc7\xbe\xba\x3d\xa8\x22\x3f\xe5\x30\x8e\x4e" "\x65\xee\xba\xac\xe0\x4f\x40\x87\xc4\xf0\xd8\x0d\x9a\x88\xf9\xdb\xb5\x93" "\xdd\xeb\xf7\x01\x32\xa4\xd0\x17\x5b\x88\x9b\x8e\xcc\xf7\x07\x88\x20\x42" "\xe7\x16\xdf\x9b\x57\xb2\x90\xc6\x61\xd4\xe8\x50\x31\x08\x6e\x97\xbc\xc5" "\xca\x0e\x22\x1a\x0e\x34\x32\x3c\x12\x91\x02\xb7\xb7\xa6\x43\xe8\x2c\x88" "\xa1\x94\x0b\x3c\x02\xed\x9c\x92\xd6\xf6\x4b\x12\x82\xdc\x51\x9b\x00\x15" "\x98\x30\xd7\x61\x70\x01\x15\x4c\x46\xbd\x3c\xa9\x63\x18\xc5\x70\xf0\x72" "\x1f\xc7\xaa\x2a\x58\x09\x00\x00\x00\x00\x00\x00\x00\x94\xf2\x2c\xdf\x55" "\x0e\xf0\x91\xa7\x80\x98\x53\x4f\x0d\x97\x30\x58\x59\x41\x19\xd0\x6d\x5e" "\xa9\xa8\xd0\x85\x73\x7f\xec\x6e\x2a\x07\x14\x74\xcf\xc1\x23\x46\xe4\x7a" "\xd9\x7f\x4e\xad\x7c\xf7\x54\xa5\x2e\x4b\x2d\x0f\x22\xd4\x28\xbd\x70\x54" "\x14\x88\x87\x00\xa3\x0e\x23\x66\xc6\xa0\x6b\x33\x67\xa3\x89\xca\x39\x05" "\x97\x87\x79\x00\x17\xb0\x68\x9a\x17\x3d\xb9\xc2\x4d\xb6\x5c\x1e\x00\x01" "\x5c\x1d\x57\x3d\xab\x18\xfd\x06\x00\x88\x5f\x1e\xa8\xf2\x45\x3d\xcb\x6a" "\x2b\xfd\x29\x9f\xc3\xcd\xaf\xda\x32\x3e\x9c\x70\x80\xbd\xf4\x39\x7b\xc4" "\x9d\x70\xc0\x60\xd5\x7b\xc8\x8f\xbe\x09\xba\xa0\x58\xb0\x40\x36\x0a\xb9" "\x26\x15\x03\xde\xf3\x63\xfb\x09\x94\x08\x88\x5a\xfc\x2b\xf9\xa4\xf8\xc3" "\x50\x70\x66\x9e\x88\x9f\x5e\x4b\xe1\xb8\xe0\xd6\x34\xeb\xc1\x0d\x69\x7e" "\x98\x18\x6f\xc5\x14\x1b\xd6\x70\xdb\xa6\xf4\x32\x79\xf7\x3d\xb9\xde\xc7" "\x50\x70\xcd\x9a\xb0\xfd\x96\xb0\x69\xef\x6d\x28\x57\xb6\xbf\x95\x50\x12" "\xcf\x7f\xe5\x0d\x13\x3d\xa8\x6e\x04\x77\xe4\xa6\xcc\x99\x9d\xc2\x1c\x3e" "\xf4\x08\xe6\x33\xdf\xa3\x5f\x14\xd6\xe7\x34\x83\x7d\x36\x5e\x63\x84\x5f" "\x3c\x10\x92\xf8\xdd\x4f\xc7\xea\xc9\xe8\xaf\x39\x04\x4b\x06\x00\x00\x00" "\x00\x00\x00\x00\x73\x33\x9c\x4c\xad\x4e\xad\x13\x48\x47\x42\x50\xed\xa2" "\xc8\x06\x7a\xb7\x30\xc1\xd8\x2a\x56\x87\xf2\xed\x69\x00\x00\x52\x2a\x0b" "\x74\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x93\xfc\x7a\x82\xb9\x8f\x99\xd9\xde\xdf\x7b\xa1\x7f\x5f" "\x0b\x6d\x15\xe5\x52\xfb\xd2\x1f\x7e\xec\xff\x10\x24\x1f\x43\xaf\x03\xee" "\xa8\x4c\x43\x04\xa5\xd3\xf9\x3c\x3f\xc7\x4c\x00\x00\x00\x00\x00\x00\x43" "\xe1\xed\x82\xb9\xaa\x0a\xe9\x2a\x49\x99\x84\xa0\x82\x77\x6e\xb0\x93\x75" "\x23\xf5\x29\x2d\x12\x65\x99\x06\x00\x5c\xde\x64\xf9\x03\xc3\x41\x5c\x61" "\x8a\x32\x9a\x31\x8f\x08\x58\xf1\x9c\x6d\xef\x80\xe1\x48\x1e\x8e\x1c\x00" "\x98\xfc\x3f\x38\xb7\xa5\x72\x11\xad\xb1\x5d\x82\x4c\xfd\xcf\x22\x96\x28" "\xc0\xde\x49\x86\x0a\x44\x28\x63\xd6\xe2\x57\xcf\xa4\xce\x50\xf3\xd1\x63" "\xd4\x42\x82\x44\x14\xa7\xda\x26\xcc\x86\xd7\xe1\x86\x31\xc2\x06\x1b\x1c" "\x8a\x8e\x3c\x06\x83\x7f\xe0\x8d\xe6\x2f\x87\x10\xca\x97\x79\x60\xb7\x4d" "\x00\x00\xce\x73\xda\x60\x22\xa8\x67\x1d\x1a\x35\x75\xb4\xe1\x8c\x28\xc7" "\x32\x03\xbf\x13\x46\x86\xdd\x65\x80\x84\x52\xcb\x6b\x76\xfc\xb1\x34\x25" "\x2c\x78\xde\x9b\x24\x0d\xe7\xb4\xcd\x01\x5a\x77\xf7\x6b\xb6\x47\x06\x00" "\x00\x0d\x0b\x3d\x8f\x3f\x96\x4f\x43\x2a\x4b\xf6\xcd\xdd\x62\x00\x00\x00" "\x00\x6b\x6f\xdb\x9c\x84\x68\xae\x1d\x98\x6a\x89\x3b\x95\x19\x44\x4d\x16" "\xa6\xdf\xa9\x2c\x04\x33\x1a\x66\x98\x50\x70\x48\xfa\xb5\xae\x40\x2a\xcd" "\x05\xfe\x62\x1f\x22\x71\x2d\xfd\x09\xea\x47\x70\xb4\x27\x8f\xa1\x45\x47" "\xd8\xce\x3c\x21\x18\x8e\x5e\x4e\x2b\xaa\xcd\x98\xe8\xe4\x51\xd6\xaa\xaf" "\xf8\x01\x53\x63\x6e\xd1\xd9\x93\x46\xc2\x46\x8d\xd9\x52\x59\x5d\x78\xe9" "\x58\x3b\x58\x56\xf3\xce\x91\x1f\xb2\x3d\x29\xbc\x8d\x15\xfc\x0f\xb2\xda" "\xf4\xea\x5d\xe3\x60\x99\xe3\xcd\xdc\xb2\x4e\xbb\x6e\xdd\xb9\xa4\x2c\x00" "\x00\xab\xe1\xc6\xea\x55\x88\x7d\xfa\x18\xd0\xae\xa1\xb6\xec\xa5\xa8\x83" "\x70\x2b\x0b\xf3\xae\xeb\xb2\x25\x89\x5d\xb9\x0e\x23\x71\x57\xa3\x4e\x9f" "\x44\x72\x37\xea\x5b\x39\x1b\xdd\xd1\x29\x0f\x7c\xe9\x87\xa0\xe3\x6b\x8e" "\x71\xb1\x77\x9b\xbe\x95\xff\xa9\xc3\xc0\xf6\xba\x66\xe4\xd4\x8e\x75\x25" "\x3e\x49\xd2\x18\x36\xe4\xb3\x22\x06\x16\xaa\xfb\xe7\xa3\xa1\x83\x75\xae" "\x59\x3e\xb5\x8f\xd5\x00\x42\x62\x86\x47\x24\x66\x82\x3c\xaa\x1c\x80\x0a" "\xaa\xa0\xd9\x46\x3c\x0c\x4e\xa5\x54\x1a\x55\xdf\x6e\xef\xfe\xc0\x57\x17" "\x30\xb0\x88\x16\xcd\xfc\xcb\x98\x37\x4c\x64\x4e\xea\x45\xde\x78\x67\xa0" "\xef\xba\xd0\xab\x2b\xc3\x3b\xb5\x04\x40\xa9\x0b\x79\x3b\x2b\x33\xf7\x4a" "\x11\x2a\x3b\x91\xb4\x0b\xed\x8d\xb2\xdf\x86\x33\x20\x7f\x83\x87\x4c\xa5" "\x2a\xb0\xf3\xf7\xb0\x58\xb1\x35\x23\xb8\x96\x80\x0b\x99\x29\x72\xd9\x60" "\x95\x51\xc2\x7a\x59\x16\xea\x16\x06\x9c\x5b\xf5\x5b\x98\xd9\x26\xd3\xc2" "\x7e\x79\x45\xb2\x99\x96\xe5\xce\xfb\xc9\xf8\x57\xbc\x13\x32\xd2\x00\x19" "\x4f\x65\x8b\x93\x07\x80\x60\x31\x34\xae\x6b\x7f\x29\xea\xbd\xa6\xe3\x21" "\x98\x21\xe2\x1b\x79\x0c\x47\x5b\x14\xb7\xfe\x4f\xe0\x02\xdf\xfd\x65\x1f" "\xaa\x79\xbb\x0c\xee\x0c\xda\xc2\xbc\x32\x18\xf2\xdd\xaa\x6f\x7b\xa0\x4b" "\x69\x6a\x30\xd3\x13\xbe\xd3\x0b\xa8\x8d\xa0\x9c\x01\xa4\xb8\x27\xaa\x17" "\x84\xd9\x27\xac\xa9\xb8\x54\x05\x34\xc5\xc4\x9a\x03\x00\xcf\xbc\x22\x13" "\xfc\xb1\x1a\x45\x4d\x1f\x32\xfb\x16\x99\x74\xaa\xe6\x24\xea\x59\x50\x0f" "\x5e\x04\x8b\x27\x80\x66\x6d\x7f\x49\xaf\x25\xbe\x90\x99\x84\xae\xa1\xbc" "\x1f\x33\x42\x6f\x86\xb4\xb9\x41\xc0\x8d\xfe\x2b\xc8\xec\x24\x6e\xc1\xaa" "\xe1\x20\xd3\x24\x05\xe4\x28\x92\x3f\x3a\x83\xd9\xba\x5c\x8f\xf2\x26\xeb" "\xf2\x12\x0b\x45\x1e\x28\x06\x37\x0f\x1e\xd6\x0c\x9f\xd5\xd9\xaf\x3c\x32" "\x4d\xa5\x2d\x4b\xd2\xe0\x1d\x3a\xc2\xd5\x78\xd7\x2e\x46\x63\x32\x2d\xfc" "\x92\x45\xce\x3e\x3a\x09\x7f\xb8\x2f\x4e\x3b\x61\xa5\x70\xb9\x6f\x82\x74" "\xf7\x2f\x1c\x55\xee\x3d\x32\x5c\x74\x96\xaf\xc2\xf1\x0c\xfe\xa5\x16\xae" "\x43\x67\x51\x22\x73\x78\xf0\x0c\xa0\xf1\xf6\xc1\xdc\x70\x0d\xd9\x0b\x96" "\xa3\x30\xf9\x2b\xff\x73\x6c\x83\xca\x53\xe7\xf0\x2b\x73\x4d\x1a\x92\x92" "\x89\x6f\x5d\x7f\x24\x4b\xfa\xb4\x94\x2c\x70\x42\xe8\x82\x06\xf6\x41\xea" "\xfc\xc5\xb4\xba\x7a\x78\x80\x53\x3c\xde\xac\x99\x5d\x7a\x00\x84\xe7\xad" "\xc2\xdc\x12\x41\x79\x97\xb0\x30\x87\xc7\xb3\xb4\x4b\x06\xf6\x15\x8a\x2a" "\x18\xce\x0e\x56\xff\xbe\xb2\x2f\x40\x52\x1d\xd9\x97\x25\x83\xd4\x13\x09" "\x8a\xa8\x0d\xb9\x8e\xf3\x24\xa2\xbf\xb6\x96\x1c\x07\xb4\x75\x21\x97\x3c" "\xf0\xbb\x6f\x55\x30\xf6\x21\x6b\x04\x7b\x35\xd6\xe0\x6b\x72\xb2\x2b\x29" "\xde\x42\xbb\x1b\xc8\xce\x0a\x0e\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xb9\x2e\xb1\x97\xe4\x14\x96\x27\x92\xda\xb2\x41\x46\x89" "\xa5\x40\xd2\x80\x17\x92\x75\x6f\x90\xb3\x7f\x08\x58\xef\xc3\x87\xf5\x59" "\x20\x24\x31\x4a\x4b\x0e\xd7\x50\xfa\x72\xe5\x94\x8a\xc3\x55\xe9\xc5\x2a" "\x4e\xf5\x78\xd4\x13\xe7\xb2\xa9\xe2\xf8\x7f\x7b\x44\x94\x9f\xe1\x4c\x00" "\x00\x00\x00\x00\x00\x47\x03\x0c\x09\xf6\x2d\x44\x4b\x49\x81\xdb\x81\x79" "\x97\x76\xee\xb4\x44\x82\x78\xde\x51\x97\x05\xfa\x8b\x56\x77\x9b\xc8\xcc" "\x92\x7b\x30\x8c\x8e\x50\x81\x7f\x76\x15\x83\x62\xc7\x49\x04\xf8\x9c\xbc" "\x58\x8a\xae\x84\x56\x7a\x83\x57\x1f\xf7\x2b\xb6\x5c\x08\x2b\x5a\x8d\xed" "\xc0\x5a\x31\x67\xd8\x42\x05\xd5\xaf\x86\x55\x3c\x21\xe1\xf0\x23\xa5\x1c" "\x0e\x17\x9f\xcc\xfb\xc2\x01\x98\x23\x3d\xdc\xaa\x45\x61\x38\x99\xd1\x90" "\x82\x45\x3b\x18\x0c\xa0\xc5\x25\xb8\xd3\xcf\xaf\x7d\x0b\xcd\xde\xb5\xd5" "\xc7\x16\x60\x38\xf6\x76\xa9\x29\x41\x39\x3b\xa5\xe5\x1f\x77\x17\x28\x22" "\xbd\x90\x3d\x9f\x8b\x43\x66\x56\x77\x17\x74\xed\x88\xda\xab\x0d\x0c\xfd" "\xd1\xbf\x4d\x30\x1a\x4c\xb3\xad\x66\xd8\x30\xe1\x0f\x7c\x1d\xe1\x32\x18" "\xef\x61\x32\x04\xc2\xb7\xc1\xad\x48\xb0\x1c\x20\x8f\x40\x32\xe9\xb3\xbb" "\xa7\xd6\xce\xca\x38\xd3\xe9\x6d\xb0\x49\xb9\x2f\xc3\x2e\xe3\x4f\xe7\xa3" "\x41\x9c\x8f\xbf\x03\xd6\x1c\x15\x9d\xc5\x86\x68\xe1\xb1\xb1\xa2\xc5\x5b" "\x61\x4d\x62\x2b\x8d\xe9\x7f\x4a\xe4\x56\x81\xed\x3e\x73\xdb\x3c\x78\xca" "\x18\xc9\x70\x63\x02\xa6\x48\xcd\x3d\x8f\x82\x9d\x82\x09\x0a\x6e\x3a\xf0" "\x8d\x1c\x47\xed\xf1\xa4\xd7\x29\x81\x09\xf3\x1b\x60\x78\x71\x1e\xe7\x2e" "\xac\xab\x61\x21\x3b\xf5\xe2\x25\x9b\x66\xe4\x36\x4f\x69\x36\xfc\x11\x11" "\xf2\x1e\x85\x7e\xdb\xdc\xe9\xe4\x46\x5f\x1e\x2b\x78\x87\x93\x1f\x53\x0e" "\xa1\x4c\xc3\x6b\xf6\x1c\xfd\x3a\x80\xcc\x73\xca\x80\x9e\x54\x4b\x14\x02" "\x9b\x51\xa6\xa2\x1d\xec\xcf\xa5\x26\x29\x1c\x07\x51\xdd\x2f\x7f\x99\xe7" "\x12\xfe\x6b\x15\xf0\x3f\x89\x68\xa3\xeb\xa2\x64\x6a\x21\xf1\x91\xbc\x18" "\x9c\x7b\x0f\xdd\x84\x1e\x7b\x27\xa8\x9f\x6f\xc1\xbc\x23\xeb\xaa\x8d\x26" "\x38\x72\x82\x4a\x2d\x87\x71\xc9\x72\x45\xfe\x85\x8d\x90\x41\x86\x29\xb4" "\xd5\xcc\x8b\x75\xd3\xd5\xbf\x3d\xad\x92\x40\x7b\xa3\xac\xb6\xe6\x61\x83" "\xf1\xaf\xb6\x2a\x5e\x43\xed\xe0\x8e\xb1\x44\xf7\x37\xfc\x6a\x83\xd3\xbe" "\x3c\x67\x36\x77\x00\x00", 2616); *(uint64_t*)0x20000210 = 0x20000340; memcpy((void*)0x20000340, "syzkaller\000", 10); *(uint32_t*)0x20000218 = 0; *(uint32_t*)0x2000021c = 0; *(uint64_t*)0x20000220 = 0; *(uint32_t*)0x20000228 = 0; *(uint32_t*)0x2000022c = 0; memset((void*)0x20000230, 0, 16); *(uint32_t*)0x20000240 = 0; *(uint32_t*)0x20000244 = 0; *(uint32_t*)0x20000248 = -1; *(uint32_t*)0x2000024c = 8; *(uint64_t*)0x20000250 = 0x20000000; *(uint32_t*)0x20000000 = 0; *(uint32_t*)0x20000004 = 0; *(uint32_t*)0x20000258 = 0; *(uint32_t*)0x2000025c = 0x10; *(uint64_t*)0x20000260 = 0x20000000; *(uint32_t*)0x20000000 = 0; *(uint32_t*)0x20000004 = 0; *(uint32_t*)0x20000008 = 0; *(uint32_t*)0x2000000c = 0; *(uint32_t*)0x20000268 = 0; *(uint32_t*)0x2000026c = 0; *(uint32_t*)0x20000270 = -1; res = syscall(__NR_bpf, 5ul, 0x20000200ul, 0x48ul); if (res != -1) r[2] = res; *(uint32_t*)0x20000040 = r[2]; *(uint32_t*)0x20000044 = 0x2a0; *(uint32_t*)0x20000048 = 0xe; *(uint32_t*)0x2000004c = 0; *(uint64_t*)0x20000050 = 0x200000c0; memcpy((void*)0x200000c0, "\xb9\xff\x03\x00\x60\x0d\x69\x8c\xff\x9e\x14\xf0\x08\x00", 14); *(uint64_t*)0x20000058 = 0; *(uint32_t*)0x20000060 = 0x200; *(uint32_t*)0x20000064 = 0x60000000; *(uint32_t*)0x20000068 = 0; *(uint32_t*)0x2000006c = 0; *(uint64_t*)0x20000070 = 0; *(uint64_t*)0x20000078 = 0; *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; syscall(__NR_bpf, 0xaul, 0x20000040ul, 0x48ul); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); setup_802154(); do_sandbox_none(); return 0; }