// https://syzkaller.appspot.com/bug?id=2500c14068a4a448dbcc55240a82733c02632a02 // 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 #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_openat #define __NR_openat 56 #endif #ifndef __NR_write #define __NR_write 64 #endif static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static 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; if (size > 0) 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, IFLA_XFRM_IF_ID, &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) { } } 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; 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_GENL_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_PORT_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"); } } 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", 0}, {"ipvlan1", 0}, {"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}, {"ipvtap0", 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_linked(&nlmsg, sock, "ipvtap", "ipvtap0", "veth0_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 netlink_add_rxe(void) { if (access("/dev/infiniband/uverbs0", F_OK) == 0) return; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) return; int rdma = socket(AF_NETLINK, SOCK_RAW, NETLINK_RDMA); if (rdma == -1) { close(sock); return; } netlink_add_device(&nlmsg, sock, "dummy", "rxe_eth0"); netlink_add_addr4(&nlmsg, sock, "rxe_eth0", "172.20.20.170"); netlink_add_addr6(&nlmsg, sock, "rxe_eth0", "fe80::aa"); uint8_t macaddr[ETH_ALEN] = {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}; netlink_device_change(&nlmsg, sock, "rxe_eth0", true, 0, macaddr, ETH_ALEN, NULL); uint16_t type = RDMA_NL_GET_TYPE(RDMA_NL_NLDEV, RDMA_NLDEV_CMD_NEWLINK); netlink_init(&nlmsg, type, 0, NULL, 0); netlink_attr(&nlmsg, RDMA_NLDEV_ATTR_DEV_NAME, "rxe0", 5); netlink_attr(&nlmsg, RDMA_NLDEV_ATTR_LINK_TYPE, "rxe", 4); netlink_attr(&nlmsg, RDMA_NLDEV_ATTR_NDEV_NAME, "rxe_eth0", 9); int err = netlink_send_ext(&nlmsg, rdma, 0, NULL, false); if (err < 0) { } close(rdma); 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); netlink_add_rxe(); } #define MAX_FDS 30 static void setup_gadgetfs(); static void setup_binderfs(); static void setup_fusectl(); static void setup_tap_dev(const char* cls, const char* dev, const char* node) { unsigned ifindex = if_nametoindex(dev); if (!ifindex) { return; } char path[128], buf[32] = {}; snprintf(path, sizeof(path), "./syz-tmp/net_sys/class/%s/tap%u/dev", cls, ifindex); int fd = open(path, O_RDONLY); if (fd < 0) { return; } ssize_t n = read(fd, buf, sizeof(buf) - 1); close(fd); unsigned maj = 0, min = 0; if (n <= 0 || sscanf(buf, "%u:%u", &maj, &min) != 2) { return; } if (mknod(node, S_IFCHR | 0666, makedev(maj, min))) { } } static void setup_tap_devs(void) { if (mkdir("./syz-tmp/net_sys", 0700)) { return; } if (mount("sysfs", "./syz-tmp/net_sys", "sysfs", 0, NULL)) { rmdir("./syz-tmp/net_sys"); return; } setup_tap_dev("macvtap", "macvtap0", "./syz-tmp/newroot/macvtap0"); setup_tap_dev("ipvtap", "ipvtap0", "./syz-tmp/newroot/ipvtap0"); umount2("./syz-tmp/net_sys", MNT_DETACH); rmdir("./syz-tmp/net_sys"); } 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); setup_tap_devs(); 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, "stats=global")) { 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); } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { setup_test(); execute_one(); close_fds(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[9] = {0xffffffffffffffff, 0x0, 0x0, 0x0, 0x0, 0x1000, 0x0, 0x0, 0x0}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // openat$uverbs0 arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 69 6e 66 69 6e 69 62 61 6e 64 2f 75 76 65 72 // 62 73 30 00} (length 0x18) // } // flags: const = 0x2 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_rdma memcpy((void*)0x20000280, "/dev/infiniband/uverbs0\000", 24); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000280ul, /*flags=*/2, /*mode=*/0); if (res != -1) r[0] = res; // write$MLX5_GET_CONTEXT arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, mlx5_get_context_cmd] { // mlx5_get_context_cmd { // command: const = 0x0 (4 bytes) // in_words: bytesize4 = 0xc (2 bytes) // out_words: bytesize4 = 0x14 (2 bytes) // response: ptr[out, mlx5_get_context_cmd_resp] { // mlx5_get_context_cmd_resp { // async_fd: fd (resource) // num_comp_vectors: int32 = 0x0 (4 bytes) // qp_tab_size: int32 = 0x0 (4 bytes) // bf_reg_size: int32 = 0x0 (4 bytes) // tot_uuars: int32 = 0x0 (4 bytes) // cache_line_size: int32 = 0x0 (4 bytes) // max_sq_desc_sz: int16 = 0x0 (2 bytes) // max_rq_desc_sz: int16 = 0x0 (2 bytes) // max_send_wqebb: int32 = 0x0 (4 bytes) // max_recv_wr: int32 = 0x0 (4 bytes) // max_srq_recv_wr: int32 = 0x0 (4 bytes) // num_ports: int16 = 0x0 (2 bytes) // reserved1: const = 0x0 (2 bytes) // comp_mask: int32 = 0x0 (4 bytes) // response_length: int32 = 0x0 (4 bytes) // cqe_version_cmds_supp_uhw: int16 = 0x0 (2 bytes) // reserved2: const = 0x0 (2 bytes) // hca_core_clock_offset: int64 = 0x0 (8 bytes) // log_uar_size: int32 = 0x0 (4 bytes) // num_uars_per_page: int32 = 0x0 (4 bytes) // num_dyn_bfregs: int32 = 0x0 (4 bytes) // reserved3: const = 0x0 (4 bytes) // } // } // total_num_uuars: int32 = 0x0 (4 bytes) // num_low_latency_uuars: int32 = 0x0 (4 bytes) // flags: int32 = 0x0 (4 bytes) // comp_mask: int32 = 0x0 (4 bytes) // cqe_version: int16 = 0x0 (2 bytes) // reserved1: const = 0x0 (2 bytes) // reserved2: const = 0x0 (4 bytes) // lib_caps: int64 = 0x0 (8 bytes) // } // } // len: len = 0x30 (8 bytes) // ] *(uint32_t*)0x20000000 = 0; *(uint16_t*)0x20000004 = 0xc; *(uint16_t*)0x20000006 = 0x14; *(uint64_t*)0x20000008 = 0x20000040; *(uint32_t*)0x20000010 = 0; *(uint32_t*)0x20000014 = 0; *(uint32_t*)0x20000018 = 0; *(uint32_t*)0x2000001c = 0; *(uint16_t*)0x20000020 = 0; *(uint16_t*)0x20000022 = 0; *(uint32_t*)0x20000024 = 0; *(uint64_t*)0x20000028 = 0; syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000000ul, /*len=*/0x30ul); // write$ALLOC_PD arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, alloc_pd_cmd] { // alloc_pd_cmd { // command: const = 0x3 (4 bytes) // in_words: bytesize4 = 0x4 (2 bytes) // out_words: bytesize4 = 0x1 (2 bytes) // response: ptr[out, alloc_pd_cmd_resp] { // alloc_pd_cmd_resp { // pd_handle: pd_handle (resource) // } // } // driver_data: array[int64] { // } // } // } // len: len = 0x10 (8 bytes) // ] *(uint32_t*)0x20000380 = 3; *(uint16_t*)0x20000384 = 4; *(uint16_t*)0x20000386 = 1; *(uint64_t*)0x20000388 = 0x200003c0; res = syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000380ul, /*len=*/0x10ul); if (res != -1) r[1] = *(uint32_t*)0x200003c0; // write$CREATE_CQ arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, create_cq_cmd] { // create_cq_cmd { // command: const = 0x12 (4 bytes) // in_words: bytesize4 = 0xa (2 bytes) // out_words: bytesize4 = 0x6 (2 bytes) // response: ptr[out, create_cq_resp] { // create_cq_resp { // cq_handle: cq_handle (resource) // cqe: int32 = 0x0 (4 bytes) // mi: rxe_mminfo { // offset: rdma_mmap_offset (resource) // size: int32 = 0x0 (4 bytes) // pad: int32 = 0x0 (4 bytes) // } // } // } // user_handle: int64 = 0x0 (8 bytes) // cqe: int32 = 0x10 (4 bytes) // comp_vector: int32 = 0x0 (4 bytes) // comp_channel: fd_comp_channel (resource) // reserved: const = 0x0 (4 bytes) // } // } // len: len = 0x28 (8 bytes) // ] *(uint32_t*)0x20000480 = 0x12; *(uint16_t*)0x20000484 = 0xa; *(uint16_t*)0x20000486 = 6; *(uint64_t*)0x20000488 = 0x200004c0; *(uint64_t*)0x20000490 = 0; *(uint32_t*)0x20000498 = 0x10; *(uint32_t*)0x2000049c = 0; *(uint32_t*)0x200004a0 = -1; *(uint32_t*)0x200004a4 = 0; res = syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000480ul, /*len=*/0x28ul); if (res != -1) r[2] = *(uint32_t*)0x200004c0; // write$CREATE_QP arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, create_qp_cmd] { // create_qp_cmd { // command: const = 0x18 (4 bytes) // in_words: bytesize4 = 0x10 (2 bytes) // out_words: bytesize4 = 0x10 (2 bytes) // response: ptr[out, create_qp_resp] { // create_qp_resp { // qp_handle: qp_handle (resource) // qpn: qp_number (resource) // max_send_wr: int32 = 0x0 (4 bytes) // max_recv_wr: int32 = 0x0 (4 bytes) // max_send_sge: int32 = 0x0 (4 bytes) // max_recv_sge: int32 = 0x0 (4 bytes) // max_inline_data: int32 = 0x0 (4 bytes) // reserved: const = 0x0 (4 bytes) // rq_mi: rxe_mminfo { // offset: rdma_mmap_offset (resource) // size: int32 = 0x0 (4 bytes) // pad: int32 = 0x0 (4 bytes) // } // sq_mi: rxe_mminfo { // offset: rdma_mmap_offset (resource) // size: int32 = 0x0 (4 bytes) // pad: int32 = 0x0 (4 bytes) // } // } // } // user_handle: int64 = 0x0 (8 bytes) // pd_handle: pd_handle (resource) // send_cq_handle: cq_handle (resource) // recv_cq_handle: cq_handle (resource) // srq_handle: srq_handle (resource) // max_send_wr: int32 = 0x8 (4 bytes) // max_recv_wr: int32 = 0x8 (4 bytes) // max_send_sge: int32 = 0x1 (4 bytes) // max_recv_sge: int32 = 0x1 (4 bytes) // max_inline_data: int32 = 0x0 (4 bytes) // sq_sig_all: int8 = 0x1 (1 bytes) // qp_type: ib_qp_type = 0x2 (1 bytes) // is_srq: int8 = 0x0 (1 bytes) // reserved1: const = 0x0 (1 bytes) // } // } // len: len = 0x40 (8 bytes) // ] *(uint32_t*)0x20000500 = 0x18; *(uint16_t*)0x20000504 = 0x10; *(uint16_t*)0x20000506 = 0x10; *(uint64_t*)0x20000508 = 0x20000540; *(uint64_t*)0x20000510 = 0; *(uint32_t*)0x20000518 = r[1]; *(uint32_t*)0x2000051c = r[2]; *(uint32_t*)0x20000520 = r[2]; *(uint32_t*)0x20000524 = 0; *(uint32_t*)0x20000528 = 8; *(uint32_t*)0x2000052c = 8; *(uint32_t*)0x20000530 = 1; *(uint32_t*)0x20000534 = 1; *(uint32_t*)0x20000538 = 0; *(uint8_t*)0x2000053c = 1; *(uint8_t*)0x2000053d = 2; *(uint8_t*)0x2000053e = 0; *(uint8_t*)0x2000053f = 0; res = syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000500ul, /*len=*/0x40ul); if (res != -1) { r[3] = *(uint32_t*)0x20000540; r[4] = *(uint32_t*)0x20000544; r[5] = *(uint64_t*)0x20000570; r[6] = *(uint32_t*)0x20000518; r[7] = *(uint32_t*)0x20000520; r[8] = *(uint32_t*)0x20000524; } // write$MODIFY_QP arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, modify_qp_cmd] { // modify_qp_cmd { // command: const = 0x1a (4 bytes) // in_words: bytesize4 = 0x1e (2 bytes) // out_words: const = 0x0 (2 bytes) // dest_dgid: union ipv6_addr { // loopback: ipv6_addr_loopback { // a0: const = 0x0 (8 bytes) // a1: const = 0x1 (8 bytes) // } // } // dest_flow_label: int32 = 0x0 (4 bytes) // dest_dlid: int16 = 0x0 (2 bytes) // dest_reserved: const = 0x0 (2 bytes) // dest_sgid_index: int8 = 0x0 (1 bytes) // dest_hop_limit: int8 = 0x0 (1 bytes) // dest_traffic_class: int8 = 0x0 (1 bytes) // dest_sl: int8 = 0x0 (1 bytes) // dest_src_path_bits: int8 = 0x0 (1 bytes) // dest_static_rate: int8 = 0x0 (1 bytes) // dest_is_global: int8 = 0x0 (1 bytes) // dest_port_num: int8 = 0x1 (1 bytes) // alt_dest_dgid: union ipv6_addr { // loopback: ipv6_addr_loopback { // a0: const = 0x0 (8 bytes) // a1: const = 0x1 (8 bytes) // } // } // alt_dest_flow_label: int32 = 0x0 (4 bytes) // alt_dest_dlid: int16 = 0x0 (2 bytes) // alt_dest_reserved: const = 0x0 (2 bytes) // alt_dest_sgid_index: int8 = 0x0 (1 bytes) // alt_dest_hop_limit: int8 = 0x0 (1 bytes) // alt_dest_traffic_class: int8 = 0x0 (1 bytes) // alt_dest_sl: int8 = 0x0 (1 bytes) // alt_dest_src_path_bits: int8 = 0x0 (1 bytes) // alt_dest_static_rate: int8 = 0x0 (1 bytes) // alt_dest_is_global: int8 = 0x0 (1 bytes) // alt_dest_port_num: int8 = 0x0 (1 bytes) // qp_handle: qp_handle (resource) // attr_mask: ib_qp_attr_mask = 0x39 (4 bytes) // qkey: int32 = 0x0 (4 bytes) // rq_psn: int32 = 0x0 (4 bytes) // sq_psn: int32 = 0x0 (4 bytes) // dest_qp_num: qp_number (resource) // qp_access_flags: ib_access_flags = 0x7 (4 bytes) // pkey_index: int16 = 0x0 (2 bytes) // alt_pkey_index: int16 = 0x0 (2 bytes) // qp_state: ib_qp_state = 0x1 (1 bytes) // cur_qp_state: ib_qp_state = 0x0 (1 bytes) // path_mtu: ib_mtu = 0x1 (1 bytes) // path_mig_state: ib_mig_state = 0x0 (1 bytes) // en_sqd_async_notify: int8 = 0x0 (1 bytes) // max_rd_atomic: int8 = 0x0 (1 bytes) // max_dest_rd_atomic: int8 = 0x0 (1 bytes) // min_rnr_timer: int8 = 0x0 (1 bytes) // port_num: int8 = 0x1 (1 bytes) // timeout: int8 = 0x0 (1 bytes) // retry_cnt: int8 = 0x0 (1 bytes) // rnr_retry: int8 = 0x0 (1 bytes) // alt_port_num: int8 = 0x0 (1 bytes) // alt_timeout: int8 = 0x0 (1 bytes) // reserved: const = 0x0 (2 bytes) // } // } // len: len = 0x78 (8 bytes) // ] *(uint32_t*)0x20000580 = 0x1a; *(uint16_t*)0x20000584 = 0x1e; *(uint16_t*)0x20000586 = 0; *(uint64_t*)0x20000588 = htobe64(0); *(uint64_t*)0x20000590 = htobe64(1); *(uint32_t*)0x20000598 = 0; *(uint16_t*)0x2000059c = 0; *(uint16_t*)0x2000059e = 0; *(uint8_t*)0x200005a0 = 0; *(uint8_t*)0x200005a1 = 0; *(uint8_t*)0x200005a2 = 0; *(uint8_t*)0x200005a3 = 0; *(uint8_t*)0x200005a4 = 0; *(uint8_t*)0x200005a5 = 0; *(uint8_t*)0x200005a6 = 0; *(uint8_t*)0x200005a7 = 1; *(uint64_t*)0x200005a8 = htobe64(0); *(uint64_t*)0x200005b0 = htobe64(1); *(uint32_t*)0x200005b8 = 0; *(uint16_t*)0x200005bc = 0; *(uint16_t*)0x200005be = 0; *(uint8_t*)0x200005c0 = 0; *(uint8_t*)0x200005c1 = 0; *(uint8_t*)0x200005c2 = 0; *(uint8_t*)0x200005c3 = 0; *(uint8_t*)0x200005c4 = 0; *(uint8_t*)0x200005c5 = 0; *(uint8_t*)0x200005c6 = 0; *(uint8_t*)0x200005c7 = 0; *(uint32_t*)0x200005c8 = r[3]; *(uint32_t*)0x200005cc = 0x39; *(uint32_t*)0x200005d0 = 0; *(uint32_t*)0x200005d4 = 0; *(uint32_t*)0x200005d8 = 0; *(uint32_t*)0x200005dc = 0; *(uint32_t*)0x200005e0 = 7; *(uint16_t*)0x200005e4 = 0; *(uint16_t*)0x200005e6 = 0; *(uint8_t*)0x200005e8 = 1; *(uint8_t*)0x200005e9 = 0; *(uint8_t*)0x200005ea = 1; *(uint8_t*)0x200005eb = 0; *(uint8_t*)0x200005ec = 0; *(uint8_t*)0x200005ed = 0; *(uint8_t*)0x200005ee = 0; *(uint8_t*)0x200005ef = 0; *(uint8_t*)0x200005f0 = 1; *(uint8_t*)0x200005f1 = 0; *(uint8_t*)0x200005f2 = 0; *(uint8_t*)0x200005f3 = 0; *(uint8_t*)0x200005f4 = 0; *(uint8_t*)0x200005f5 = 0; *(uint16_t*)0x200005f6 = 0; syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000580ul, /*len=*/0x78ul); // write$MODIFY_QP arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, modify_qp_cmd] { // modify_qp_cmd { // command: const = 0x1a (4 bytes) // in_words: bytesize4 = 0x1e (2 bytes) // out_words: const = 0x0 (2 bytes) // dest_dgid: union ipv6_addr { // ipv4: ipv6_addr_ipv4 { // a0: buffer: {00 00 00 00 00 00 00 00 00 00} (length 0xa) // a1: buffer: {ff ff} (length 0x2) // a3: union ipv4_addr { // local: ipv4_addr_t[const[170, int8]] { // a0: const = 0xac (1 bytes) // a1: const = 0x14 (1 bytes) // a2: const = 0x14 (1 bytes) // a3: const = 0xaa (1 bytes) // } // } // } // } // dest_flow_label: int32 = 0x0 (4 bytes) // dest_dlid: int16 = 0x0 (2 bytes) // dest_reserved: const = 0x0 (2 bytes) // dest_sgid_index: int8 = 0x1 (1 bytes) // dest_hop_limit: int8 = 0x1 (1 bytes) // dest_traffic_class: int8 = 0x0 (1 bytes) // dest_sl: int8 = 0x0 (1 bytes) // dest_src_path_bits: int8 = 0x0 (1 bytes) // dest_static_rate: int8 = 0x0 (1 bytes) // dest_is_global: int8 = 0x1 (1 bytes) // dest_port_num: int8 = 0x1 (1 bytes) // alt_dest_dgid: union ipv6_addr { // loopback: ipv6_addr_loopback { // a0: const = 0x0 (8 bytes) // a1: const = 0x1 (8 bytes) // } // } // alt_dest_flow_label: int32 = 0x0 (4 bytes) // alt_dest_dlid: int16 = 0x0 (2 bytes) // alt_dest_reserved: const = 0x0 (2 bytes) // alt_dest_sgid_index: int8 = 0x0 (1 bytes) // alt_dest_hop_limit: int8 = 0x0 (1 bytes) // alt_dest_traffic_class: int8 = 0x0 (1 bytes) // alt_dest_sl: int8 = 0x0 (1 bytes) // alt_dest_src_path_bits: int8 = 0x0 (1 bytes) // alt_dest_static_rate: int8 = 0x0 (1 bytes) // alt_dest_is_global: int8 = 0x0 (1 bytes) // alt_dest_port_num: int8 = 0x0 (1 bytes) // qp_handle: qp_handle (resource) // attr_mask: ib_qp_attr_mask = 0x129181 (4 bytes) // qkey: int32 = 0x0 (4 bytes) // rq_psn: int32 = 0x0 (4 bytes) // sq_psn: int32 = 0x0 (4 bytes) // dest_qp_num: qp_number (resource) // qp_access_flags: ib_access_flags = 0x7 (4 bytes) // pkey_index: int16 = 0x0 (2 bytes) // alt_pkey_index: int16 = 0x0 (2 bytes) // qp_state: ib_qp_state = 0x2 (1 bytes) // cur_qp_state: ib_qp_state = 0x1 (1 bytes) // path_mtu: ib_mtu = 0x3 (1 bytes) // path_mig_state: ib_mig_state = 0x0 (1 bytes) // en_sqd_async_notify: int8 = 0x0 (1 bytes) // max_rd_atomic: int8 = 0x1 (1 bytes) // max_dest_rd_atomic: int8 = 0x1 (1 bytes) // min_rnr_timer: int8 = 0xc (1 bytes) // port_num: int8 = 0x1 (1 bytes) // timeout: int8 = 0x0 (1 bytes) // retry_cnt: int8 = 0x0 (1 bytes) // rnr_retry: int8 = 0x0 (1 bytes) // alt_port_num: int8 = 0x0 (1 bytes) // alt_timeout: int8 = 0x0 (1 bytes) // reserved: const = 0x0 (2 bytes) // } // } // len: len = 0x78 (8 bytes) // ] *(uint32_t*)0x20000600 = 0x1a; *(uint16_t*)0x20000604 = 0x1e; *(uint16_t*)0x20000606 = 0; memset((void*)0x20000608, 0, 10); memset((void*)0x20000612, 255, 2); *(uint8_t*)0x20000614 = 0xac; *(uint8_t*)0x20000615 = 0x14; *(uint8_t*)0x20000616 = 0x14; *(uint8_t*)0x20000617 = 0xaa; *(uint32_t*)0x20000618 = 0; *(uint16_t*)0x2000061c = 0; *(uint16_t*)0x2000061e = 0; *(uint8_t*)0x20000620 = 1; *(uint8_t*)0x20000621 = 1; *(uint8_t*)0x20000622 = 0; *(uint8_t*)0x20000623 = 0; *(uint8_t*)0x20000624 = 0; *(uint8_t*)0x20000625 = 0; *(uint8_t*)0x20000626 = 1; *(uint8_t*)0x20000627 = 1; *(uint64_t*)0x20000628 = htobe64(0); *(uint64_t*)0x20000630 = htobe64(1); *(uint32_t*)0x20000638 = 0; *(uint16_t*)0x2000063c = 0; *(uint16_t*)0x2000063e = 0; *(uint8_t*)0x20000640 = 0; *(uint8_t*)0x20000641 = 0; *(uint8_t*)0x20000642 = 0; *(uint8_t*)0x20000643 = 0; *(uint8_t*)0x20000644 = 0; *(uint8_t*)0x20000645 = 0; *(uint8_t*)0x20000646 = 0; *(uint8_t*)0x20000647 = 0; *(uint32_t*)0x20000648 = r[3]; *(uint32_t*)0x2000064c = 0x129181; *(uint32_t*)0x20000650 = 0; *(uint32_t*)0x20000654 = 0; *(uint32_t*)0x20000658 = 0; *(uint32_t*)0x2000065c = r[4]; *(uint32_t*)0x20000660 = 7; *(uint16_t*)0x20000664 = 0; *(uint16_t*)0x20000666 = 0; *(uint8_t*)0x20000668 = 2; *(uint8_t*)0x20000669 = 1; *(uint8_t*)0x2000066a = 3; *(uint8_t*)0x2000066b = 0; *(uint8_t*)0x2000066c = 0; *(uint8_t*)0x2000066d = 1; *(uint8_t*)0x2000066e = 1; *(uint8_t*)0x2000066f = 0xc; *(uint8_t*)0x20000670 = 1; *(uint8_t*)0x20000671 = 0; *(uint8_t*)0x20000672 = 0; *(uint8_t*)0x20000673 = 0; *(uint8_t*)0x20000674 = 0; *(uint8_t*)0x20000675 = 0; *(uint16_t*)0x20000676 = 0; syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000600ul, /*len=*/0x78ul); // write$MODIFY_QP arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, modify_qp_cmd] { // modify_qp_cmd { // command: const = 0x1a (4 bytes) // in_words: bytesize4 = 0x1e (2 bytes) // out_words: const = 0x0 (2 bytes) // dest_dgid: union ipv6_addr { // loopback: ipv6_addr_loopback { // a0: const = 0x0 (8 bytes) // a1: const = 0x1 (8 bytes) // } // } // dest_flow_label: int32 = 0x0 (4 bytes) // dest_dlid: int16 = 0x0 (2 bytes) // dest_reserved: const = 0x0 (2 bytes) // dest_sgid_index: int8 = 0x0 (1 bytes) // dest_hop_limit: int8 = 0x0 (1 bytes) // dest_traffic_class: int8 = 0x0 (1 bytes) // dest_sl: int8 = 0x0 (1 bytes) // dest_src_path_bits: int8 = 0x0 (1 bytes) // dest_static_rate: int8 = 0x0 (1 bytes) // dest_is_global: int8 = 0x0 (1 bytes) // dest_port_num: int8 = 0x1 (1 bytes) // alt_dest_dgid: union ipv6_addr { // loopback: ipv6_addr_loopback { // a0: const = 0x0 (8 bytes) // a1: const = 0x1 (8 bytes) // } // } // alt_dest_flow_label: int32 = 0x0 (4 bytes) // alt_dest_dlid: int16 = 0x0 (2 bytes) // alt_dest_reserved: const = 0x0 (2 bytes) // alt_dest_sgid_index: int8 = 0x0 (1 bytes) // alt_dest_hop_limit: int8 = 0x0 (1 bytes) // alt_dest_traffic_class: int8 = 0x0 (1 bytes) // alt_dest_sl: int8 = 0x0 (1 bytes) // alt_dest_src_path_bits: int8 = 0x0 (1 bytes) // alt_dest_static_rate: int8 = 0x0 (1 bytes) // alt_dest_is_global: int8 = 0x0 (1 bytes) // alt_dest_port_num: int8 = 0x0 (1 bytes) // qp_handle: qp_handle (resource) // attr_mask: ib_qp_attr_mask = 0x12e01 (4 bytes) // qkey: int32 = 0x0 (4 bytes) // rq_psn: int32 = 0x0 (4 bytes) // sq_psn: int32 = 0x0 (4 bytes) // dest_qp_num: qp_number (resource) // qp_access_flags: ib_access_flags = 0x7 (4 bytes) // pkey_index: int16 = 0x0 (2 bytes) // alt_pkey_index: int16 = 0x0 (2 bytes) // qp_state: ib_qp_state = 0x3 (1 bytes) // cur_qp_state: ib_qp_state = 0x2 (1 bytes) // path_mtu: ib_mtu = 0x3 (1 bytes) // path_mig_state: ib_mig_state = 0x0 (1 bytes) // en_sqd_async_notify: int8 = 0x0 (1 bytes) // max_rd_atomic: int8 = 0x1 (1 bytes) // max_dest_rd_atomic: int8 = 0x1 (1 bytes) // min_rnr_timer: int8 = 0xc (1 bytes) // port_num: int8 = 0x4 (1 bytes) // timeout: int8 = 0xe (1 bytes) // retry_cnt: int8 = 0x7 (1 bytes) // rnr_retry: int8 = 0x7 (1 bytes) // alt_port_num: int8 = 0x2 (1 bytes) // alt_timeout: int8 = 0x0 (1 bytes) // reserved: const = 0x0 (2 bytes) // } // } // len: len = 0x78 (8 bytes) // ] *(uint32_t*)0x20000680 = 0x1a; *(uint16_t*)0x20000684 = 0x1e; *(uint16_t*)0x20000686 = 0; *(uint64_t*)0x20000688 = htobe64(0); *(uint64_t*)0x20000690 = htobe64(1); *(uint32_t*)0x20000698 = 0; *(uint16_t*)0x2000069c = 0; *(uint16_t*)0x2000069e = 0; *(uint8_t*)0x200006a0 = 0; *(uint8_t*)0x200006a1 = 0; *(uint8_t*)0x200006a2 = 0; *(uint8_t*)0x200006a3 = 0; *(uint8_t*)0x200006a4 = 0; *(uint8_t*)0x200006a5 = 0; *(uint8_t*)0x200006a6 = 0; *(uint8_t*)0x200006a7 = 1; *(uint64_t*)0x200006a8 = htobe64(0); *(uint64_t*)0x200006b0 = htobe64(1); *(uint32_t*)0x200006b8 = 0; *(uint16_t*)0x200006bc = 0; *(uint16_t*)0x200006be = 0; *(uint8_t*)0x200006c0 = 0; *(uint8_t*)0x200006c1 = 0; *(uint8_t*)0x200006c2 = 0; *(uint8_t*)0x200006c3 = 0; *(uint8_t*)0x200006c4 = 0; *(uint8_t*)0x200006c5 = 0; *(uint8_t*)0x200006c6 = 0; *(uint8_t*)0x200006c7 = 0; *(uint32_t*)0x200006c8 = r[3]; *(uint32_t*)0x200006cc = 0x12e01; *(uint32_t*)0x200006d0 = 0; *(uint32_t*)0x200006d4 = 0; *(uint32_t*)0x200006d8 = 0; *(uint32_t*)0x200006dc = r[4]; *(uint32_t*)0x200006e0 = 7; *(uint16_t*)0x200006e4 = 0; *(uint16_t*)0x200006e6 = 0; *(uint8_t*)0x200006e8 = 3; *(uint8_t*)0x200006e9 = 2; *(uint8_t*)0x200006ea = 3; *(uint8_t*)0x200006eb = 0; *(uint8_t*)0x200006ec = 0; *(uint8_t*)0x200006ed = 1; *(uint8_t*)0x200006ee = 1; *(uint8_t*)0x200006ef = 0xc; *(uint8_t*)0x200006f0 = 4; *(uint8_t*)0x200006f1 = 0xe; *(uint8_t*)0x200006f2 = 7; *(uint8_t*)0x200006f3 = 7; *(uint8_t*)0x200006f4 = 2; *(uint8_t*)0x200006f5 = 0; *(uint16_t*)0x200006f6 = 0; syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000680ul, /*len=*/0x78ul); // mmap$rdma arguments: [ // addr: VMA[0x1000] // len: len = 0x1000 (4 bytes) // prot: const = 0x3 (8 bytes) // flags: const = 0x11 (8 bytes) // fd: fd_rdma (resource) // offset: rdma_mmap_offset (resource) // ] // returns rdma_ring_ptr syscall(__NR_mmap, /*addr=*/0x20002000ul, /*len=*/0x1000, /*prot=*/3ul, /*flags=*/0x11ul, /*fd=*/r[0], /*offset=*/r[5]); // write$MLX5_CREATE_DV_QP arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, mlx5_create_dv_qp_cmd] { // mlx5_create_dv_qp_cmd { // command: const = 0x18 (4 bytes) // in_words: bytesize4 = 0x1e (2 bytes) // out_words: bytesize4 = 0x0 (2 bytes) // response: nil // user_handle: int64 = 0x1 (8 bytes) // pd_handle: pd_handle (resource) // send_cq_handle: cq_handle (resource) // recv_cq_handle: cq_handle (resource) // srq_handle: srq_handle (resource) // max_send_wr: int32 = 0x2 (4 bytes) // max_recv_wr: int32 = 0x7 (4 bytes) // max_send_sge: int32 = 0x9 (4 bytes) // max_recv_sge: int32 = 0x0 (4 bytes) // max_inline_data: int32 = 0x8 (4 bytes) // sq_sig_all: int8 = 0x31 (1 bytes) // qp_type: const = 0xff (1 bytes) // is_srq: int8 = 0x40 (1 bytes) // reserved0: const = 0x0 (1 bytes) // driver_data: array[int64] { // int64 = 0x5 (8 bytes) // } // buf_addr: nil // db_addr: ptr[in, buffer] { // buffer: {50 55 21 2a 20 de 0d 40 05 1f a8 1a 3e 6a 0f 07 cd b9 25 // a3 70 34 39 91 1e 2b cd 99 08 44 ef fc 76 30 b6 f9 b1 b7 40 8a 23 // 9c 04 92 cd 4d 10 b7 8a 77 2e e4 72 c5 34 bc f1 16 aa a8 8c c0 77 // 3e 1a 84 9b 2c 81 7c 51 12 07 d1 e3 40 d9 5b d2 ee b6 00 da 45 89 // 39 cc 5e a8 fc e8 10 9b e6 22 26 d7 c8 99 31 66 90 11 c5 d0 ba b8 // d1 0b 34 66 ac 12 a4 6e ac 06 76 ad fe 0e ae 24 51 38 cb 64 f6 9c // 3d 58 e1 0d 3b a2 63 54 ad 37 00 42 b8 47 dc 22 b5 d6 70 a0 4e 32 // 69 43 00 46 96 ef 65 44 47 f7 52 b4 43 18 63 ed 2e 39 38 b6 de c0 // 40 d1 a9 6e fb e8 78 a0 b0 9f a9 c1 ad 31 df f8 2c 54 44 4e 76 5f // ef 4b 56 b5 20 f0 54 8a 0e 9d a7 0f 6f 3a 5b 98 62 ab 8a 3f 89 68 // 90 3c 1b c8 4b a1 9b 67 fb 32 53 e5 bf c7 db 45 ac 5d d4 e7 9e 0f // c0 87 bc ea 08 a6 fe fb fa 5d 1f 33 e0 31 17 0f f3 f1 59 68 21 6a // 60 84 67 b7 9c 63 b2 47 61 de b0 e6 7b 7a 46 35 0c d6 a9 49 fe 24 // 6a 09 e9 d4 5e ba f5 de 06 ba 98 e4 d5 08 97 6a 42 bc bd 84 dd 19 // d5 fe 3f 1a 8d cf 99 1c 7f f9 60 04 84 37 d6 10 f3 f3 65 7b d0 76 // 21 fc 8d 61 99 9f 85 5a 07 9b 35 14 9e a3 d0 fa d1 65 c3 71 07 cf // fe 7b 63 84 fa f4 0b b0 32 15 bb 23 37 82 b9 3f 10 c3 6d 79 4d 16 // bb 48 99 3d d9 c1 fc ce 68 0e 28 a7 81 9d f5 a4 1a 6e c3 8a 4c c5 // 9f a1 f1 e0 bb bb b4 90 36 35 11 18 a3 0f c5 b6 de 10 35 9e 4d 67 // cb 0f 25 b5 75 2b 60 ee 89 e5 02 e4 b7 de 53 68 1e 84 7a f2 8f 6e // 3d 46 7b b7 69 3d 6a c7 92 fa 66 d9 77 55 67 c7 a2 df 24 44 cc 3c // 36 3a f8 f5 b7 96 0b 80 11 1f a5 1e 0f c7 92 60 49 35 09 73 d7 79 // 1e e2 cd 0b 1a df 26 58 94 c8 f6 53 8a 22 6c 3d 25 7e d4 98 97 38 // 97 ef a9 47 ae 8e 26 17 25 83 fd 19 f6 7a 03 4e 28 0c 8e f2 a1 db // 77 a1 e1 b7 a6 8c 9a e7 8d a0 cf 55 b7 9b 1a 4b e5 53 3f 04 6e ae // 0c 70 33 dc 3e 60 60 07 a4 6d a1 f3 cd 96 df 76 d8 90 e5 ea 8e 16 // e7 37 d0 e7 d3 e2 93 85 f8 9a e0 5e e5 d8 1d 96 9d 42 34 73 c3 15 // 3e 8b c7 b5 ce 87 f9 6f 87 bf b7 06 71 1f 72 c2 ab 5d bd 60 34 7c // b0 11 ff f0 0e de b0 72 de 06 49 1c aa 9e 65 3f ea c4 34 e6 f0 d0 // 8b fe 2f 0c 39 9e 2f 46 c8 72 89 24 60 76 c6 8e 9b b5 1f e0 32 f9 // cc da 16 df a2 7f 7b 63 6f 48 2e b2 58 f9 d5 39 2b 63 b7 8e 69 b6 // 16 97 99 1f ea 90 71 3c 1e cc e9 6b 3f ae f7 be 96 86 cd 13 80 9e // 01 7a 40 e6 1d ac 58 1f 7f 02 16 36 6f 3b 49 9e 2e 3e 0c 0a 48 23 // 5c dd 74 a0 ee d3 68 1e 74 02 9f ee 92 f5 ef ed 8e 4c c2 08 72 bd // fe 92 a3 01 7c e5 96 8d 50 8e 83 1b 3d 83 22 27 9f 2a b8 5c 98 d1 // 1a be f1 69 96 38 86 c6 71 d0 a5 88 07 ee 60 d0 85 21 6c 76 ba a7 // 1a ac 10 d5 3e 6e eb cd 2f bc f0 58 16 95 d7 f0 9d ae 91 24 e0 c6 // 38 c2 5a 55 8e 9a 9d d1 5a 96 af bc 45 cf 9d 7b cf ef 0e 3d 5a c9 // c9 33 5b 98 57 c1 2f 3a 73 bc 1e 6e f7 93 69 4f 6f 00 41 de 59 e0 // 36 3d c9 7e 73 4c 82 b7 06 97 f3 e8 20 2e 0b 60 27 24 22 69 4e d3 // fd 23 a8 26 d7 03 96 41 52 5a 5a fd 15 79 e7 99 46 3d c0 3e fb b0 // 58 fe 23 c0 cd cb 51 33 8c 48 83 0c 26 0e 9c 6f 61 55 42 22 41 df // 70 26 93 20 ed f6 f0 25 ec 32 55 e7 56 c3 7c 09 c4 08 e7 b4 0d 60 // 95 0b 4e ca 07 87 88 3b 1c d9 08 a1 ef e8 0b d5 c1 18 c1 f5 1c 71 // c4 b2 e2 cd 09 87 52 90 61 6f f3 8e fd d8 f5 f2 5c 59 c4 12 04 d8 // 4a 71 46 af dc 01 af 62 91 1f 68 c0 66 8d 75 5a fe 2f bd 53 7f c9 // 2a 00 05 32 5b 87 bf 51 cd 33 30 f0 69 48 f5 bc 43 c6 b9 e3 0a c6 // 68 25 0b 56 09 0b c5 b6 56 95 b0 80 d7 d3 7e 02 7d db 0d 10 4f 9a // e9 c6 a9 fc 76 d3 3d 5c 86 3e f0 dc 11 74 a9 e3 c2 e7 53 fb d8 27 // b4 7d 0e ad 75 23 84 29 fb 41 35 31 cf ac 7d 6a dc 74 75 d6 14 d9 // 98 93 cf 59 12 7b 7a 80 47 9d cc f3 d0 ef b0 d9 81 22 4b 44 86 1d // 17 67 69 65 7b 44 2d 82 ec c5 2f 6b 59 eb ed 64 6e ac 24 8e d0 ad // cf db b6 df bf 3d b5 34 27 3c 28 17 d5 e3 73 c9 1e 91 ba bb 04 b9 // e6 89 8c 14 d3 a0 b5 d3 40 3e e8 b1 d7 b4 02 21 1a 60 2a 16 91 1f // a8 7c cd 47 2e 60 b8 df 22 a4 99 56 35 2b 81 b7 db bb b9 4e 57 dd // 83 33 10 36 28 5a 76 b8 bd 52 6c 83 46 b8 98 87 2b 2b b7 b9 13 ce // ef 55 f2 6b b6 27 34 06 36 f8 99 d2 9e 94 85 81 9d 9a 0d 22 d5 c5 // 4b 7e 17 bd d0 8a a1 a0 8d 6a 51 78 a9 a9 db c5 42 33 9f e4 23 d5 // d6 a3 0d 56 29 93 8c aa 2c e1 8f 6f e9 72 1e 58 71 b8 c4 a2 2c 87 // 15 df 27 82 75 b1 a2 a0 4c 36 39 8b f5 0a 85 05 9d 73 41 09 a0 57 // d6 94 39 ed 16 56 ae 7e d8 f5 d1 f2 20 d2 b0 b1 fd 74 11 59 fa 86 // 77 48 d2 54 dc 42 e8 66 73 76 86 81 6a 73 b6 27 2b 78 27 cc be 1f // 3b 01 86 19 f8 98 fd b3 04 50 f0 68 2b 2d 39 6c e9 de d5 52 ba 41 // bf 56 61 89 11 ab 14 0b 3e 83 dd 23 0d 95 f0 3d 57 2a 33 1b 38 89 // a8 dd bc 84 41 fb 7e 6d 5b 61 ff 96 a5 f7 ff 0f 89 b5 d7 c5 e8 2f // 79 23 85 63 61 57 37 d4 a9 f5 c7 e7 dd 9c d3 11 6b 98 ff 18 ec 4b // 70 20 90 11 f4 94 65 00 1f e9 5b 27 27 64 9d 82 5e 96 f0 1c 0d 3b // c3 75 a0 fb ea c4 af 7e 01 a5 9d 5e 09 25 7d 1e df 94 56 02 c4 99 // 12 f3 85 41 a4 9f 52 5a 0b b0 93 ed 1b 0f 25 58 c7 03 c4 ea 06 2a // dd 08 8e c3 a8 a9 91 36 1b 8e a0 58 9d 40 b1 34 c0 7b 60 42 9e 95 // db 31 ac 98 f7 1b ee e8 de be 57 1a b6 be 9f da 75 34 69 17 aa 05 // 4c 27 fa 60 a0 cf 77 ed a0 d6 d4 44 f4 39 63 84 6e 55 be 8b 1c 56 // 7a 78 94 9b 4c 36 fc fd b1 9a a7 3d c5 61 c8 f5 2e b5 f7 80 54 b1 // f2 19 72 63 02 87 b4 f9 b5 35 9c 51 1d 07 43 ee 99 cf fe 45 d3 38 // a7 e7 18 94 c1 1d 88 01 e5 f4 e4 90 df 61 be 08 0a 0d 5c b5 1f 81 // c2 ea ed c1 b2 53 55 38 1d cd 66 b1 23 fa 72 be 08 b5 57 1a 80 93 // d3 e1 1a 69 9f dc fe fb 71 fb d8 95 ac f6 79 8d 1b d0 84 84 bf a1 // 39 35 41 58 62 55 2f c4 a3 ef f9 99 3d f9 eb 06 2d bc 70 41 67 24 // 3a 9f 04 3b 87 b0 f1 6e 6d bc 65 16 2f 0b fc cf 66 9b 2e 89 a9 13 // 29 cd ed b7 81 dd 81 7c e7 e7 03 70 a9 b9 9f 65 5d c1 e3 52 92 31 // 62 a6 36 b4 78 ca cb e2 2b cd ae 89 fb 8b 28 df 6e de 50 48 c1 5b // 4d 0e 0a 9e b8 c6 0c 20 8b 07 1e 1f e2 51 26 5f 7e 49 ee 59 38 c0 // e5 4b 8b f6 a7 e1 fa 7a 51 94 80 03 76 7a 4f fe 1e 07 18 ce d2 73 // 11 0c 5d bb ec 02 9f d5 30 03 e0 0d 2e 90 24 69 58 57 fd 09 4b 2a // 32 fd 57 0d ea 43 0d b9 f0 87 9b 69 60 98 b5 13 ba 81 25 48 de 53 // cb 1a 6d d7 5e d3 45 97 e5 91 fd 96 39 d9 2a c1 50 de c9 28 fc 4a // e9 d2 5d 82 41 1d 9e 44 f0 6b 89 45 1c d6 fc b0 83 5a a6 87 31 2c // 97 f7 94 ff 18 e2 bb bc f5 04 f4 8d 18 88 e8 8e 25 34 23 15 2f fc // f0 43 b0 28 88 07 cb 7d 08 e5 3b 15 ef 17 25 d0 50 4e 3e c1 fc 20 // 6d 00 0f 86 44 3a ab eb 19 60 02 ff 78 9d 56 b6 dd 9b 87 f7 4c 41 // 4a db 6f 59 e9 aa ae 51 03 10 f2 bf 7d 47 06 53 f8 7f 67 7a 21 6d // 8f d9 f3 73 30 1f c7 01 3e 5d e8 26 41 29 ba 3e 00 29 e3 82 dd 04 // 1b 9f fc 03 b9 e2 62 1b e7 3a 6b 1e e3 f1 ed 50 45 8c 25 e6 5e a5 // 80 ef c7 4b 7b 23 5a 2c f4 4d 27 f7 e9 29 e7 9c 32 7f 9c 84 20 02 // 3b 82 86 a5 ae 8b db 96 56 d5 67 98 31 6a 57 9a 75 3b 58 30 82 78 // 20 ed 5c 28 2c 96 ec b2 08 68 0e 21 55 fe f5 25 17 d5 a3 33 68 39 // 40 b8 57 74 66 23 62 12 2e f6 e8 5d 37 c7 4c 9b 7c 99 31 2d 9f 7c // 26 55 6c 58 c1 d6 7d 9f cf 2b 5d 0c 6d 39 05 f2 2f dd ad ec 7e 18 // 97 82 db 06 9d 69 03 71 7e 52 ea 07 87 8d 44 98 a4 91 3b 00 33 bd // ac d1 f4 77 94 0a 0b a0 82 56 83 b0 55 92 5b 4f 57 42 3b f0 8a c9 // 23 8f cc eb 95 ec 0b 5d b1 e8 c4 05 da 7a 21 3e e1 0b 6c ef 0f a5 // 4c c1 22 6e 55 81 b0 95 ef 6c 45 e2 be ec 21 c4 7f db 7e 8b 01 5d // 92 3b 46 bd fd 45 00 57 4e a6 91 8e db ac 95 9b 12 b5 64 47 f7 9b // 14 6d 04 1b 79 da 39 2a 23 e6 f3 73 07 04 00 e1 6a de 3a e7 21 b3 // 25 93 d3 ac 20 5d 0f f9 d5 9f 23 bc a4 f2 18 a3 74 49 8f 9b e2 87 // e0 e7 ea 82 86 10 ed 8b 61 f0 31 2e 70 b6 c2 5e 68 7b fd 18 66 57 // e5 4d b2 61 8b 98 53 86 9d 69 0b 30 b9 d8 59 c8 4e d8 b3 e9 14 19 // 52 5a 0a 1e f5 f8 95 df 39 03 40 ef 59 8f 3c 23 66 80 32 d9 04 80 // cb a4 af 12 60 cb 13 d6 18 90 01 18 d0 b4 32 6c b1 e6 bd f4 7e c3 // cf 6a bb 5f ea 58 8d 1e c5 14 ae a4 18 a7 21 08 95 76 0d 57 86 be // ce 85 f5 a6 57 fd ea 9c 1f b0 50 ae 7a af 75 61 2c 6b 54 89 dd b8 // 91 25 a6 d2 21 60 6a 8c 14 aa db 40 a2 c7 07 63 ad 6c 99 90 69 45 // 1a f6 b8 b8 da f0 04 45 4b 48 d8 aa 3e 60 07 79 34 10 bb 0a 9c c0 // 0c 1f d4 1a e4 97 b0 5f 83 16 ea 1e b8 3e 54 0d 17 31 89 e4 26 af // 58 ab 09 9c b1 7a 3b 85 b8 38 c2 77 ea 95 3c 94 56 67 88 4c 4b d1 // b0 89 28 2b 3d 4c d6 1c cf 38 83 33 17 6a 1e e9 52 ab ee bf f1 10 // ea 3c f7 5a f5 5f b8 71 01 63 55 d0 cd 8e 5d 1e 7f 1a da cf a7 be // 53 1a a3 ec e7 e6 51 c0 23 68 de 36 c4 d0 ec 5c e5 4b 9a e0 80 74 // c6 b5 1e e6 c2 04 6b 5e d7 4c c7 d4 cf 1a 72 46 fa cd 88 d2 31 f8 // 35 41 ee 8f 01 6e 27 15 42 35 dc e8 23 10 97 92 e2 f2 e6 a2 0a 40 // c9 a8 41 4a 72 1f 2a 49 0d f0 8a 0d b7 e0 bb da 22 94 b4 5b 45 c4 // 01 59 64 9a 0f a5 91 b0 42 6c ef db 62 25 db 13 c3 74 a0 8a 3a 6f // 7c 89 a1 c7 e1 64 f2 fc f9 26 b5 78 1e 78 ea 47 c5 4c 46 3d 60 83 // 17 83 83 82 6a 4a ae f4 8e 35 59 0e 0c 61 19 c1 00 7b cd 3d 52 d0 // be f0 c0 e5 34 e5 2c e6 df 4b 24 58 34 01 46 70 9d 0d 1f 55 49 0d // 8b 64 85 a2 4a c0 fc cc 9d ba 0b 53 32 7c 19 8c 66 21 7f ee 8f 37 // 91 3e 15 9f bf ce 7d cb 41 94 ab 3c 59 5e 4c 30 fd 4d 42 cd 18 6d // eb bf 45 ab fa e4 9b a3 13 eb 7a b3 f5 61 dc a2 07 64 24 8e 91 c9 // 52 e2 ef 2c 26 10 fd d3 1c 57 2b 06 ff 41 21 da df 57 e5 05 65 bd // fa a2 01 3e 06 fc 93 27 99 d1 a5 a5 4a 7a 21 97 7e 20 ad de 8d 13 // 77 7d ea c0 f7 30 7b 92 29 2a fc 15 81 d7 72 70 79 51 27 00 fe f2 // 01 65 ba 01 d2 89 b4 9c d6 6f 29 10 42 27 01 fa c2 63 92 ec e1 f9 // af ba 4e 87 e5 fe 46 7f 8a 59 43 24 d2 52 07 14 cc 94 01 77 98 19 // d1 ed 09 93 4a 77 ba ae 40 ff 71 ca f2 f4 f2 44 12 cd 05 43 61 ff // 8f e6 43 7d 4c f9 53 88 47 30 72 b6 e0 33 bf fc 1b ee 1f 4b 57 57 // 7c 2a 36 1e db 83 60 c7 03 4a 5d 87 03 36 ef 5e 07 ee 00 6c e5 25 // f2 1b d9 d1 2f ff aa 03 b6 7b e4 3e a8 03 50 e7 46 c9 a4 b1 76 fa // 16 f5 15 b6 b4 41 5e df 84 99 bc 0c 60 18 46 f2 72 f5 b7 f5 f0 52 // 2c 69 3a e1 d1 f4 4f bc a3 e5 c8 f2 58 51 f4 24 9e 62 f5 15 c8 6d // 08 27 70 9f 14 4a 30 c5 d9 85 50 ae f1 14 da 54 5b ee dc 7f f8 40 // aa b4 4c 46 c4 2c 07 c6 da 0e ec 8c ec 32 2f d2 ed 01 ee dc 65 83 // 58 0b f8 98 96 39 12 7d ee 84 87 27 ed 5f a7 9d c3 4b 4c e1 2a 03 // b2 e3 0f 68 b5 ea 73 e4 7a 00 ca 35 91 a8 ba a4 be 67 77 d2 31 50 // 0f f6 a3 91 bb 45 ea 51 9d f0 25 ac 12 bc c5 ab f6 cb cf e1 82 44 // 8a 56 ca 8f f1 f0 0b 61 13 8a 89 f5 45 38 18 ea 6b 71 3f 94 e5 f6 // ba e5 4b 90 64 ee d4 7e 64 6c cd 89 07 10 2c d8 94 03 03 dd 29 c9 // 41 b9 19 e1 e8 77 8a 5c cd 18 b9 75 75 81 3b 41 18 49 9e 99 cc 23 // 69 9c e5 3f ff b6 dd 3a 4a 62 cd 41 5e a5 2b a1 11 75 69 87 d1 10 // 27 79 6b bf cf bc 46 07 b9 a6 77 1e 95 30 58 0e 9e c6 20 76 ef ea // 6f 40 c2 a8 ef 7f c5 3a 6f b6 7f 4f 26 31 ca ff a6 65 fd ae 08 5a // 3f fb 6a 91 6d a2 3d b5 9e 73 a6 9a 64 e9 78 d3 3e 0d 30 77 e7 e7 // 86 4d 33 aa c4 0f d7 c9 e8 d6 64 c3 70 d2 3a f1 aa 0d 6a 7c 95 d0 // 60 ff ac 90 f0 22 ef 96 4d c9 0a 96 54 50 90 8d 68 25 cf e9 59 8a // ec 3a 25 20 7d 08 68 cb a4 d7 f9 87 d0 27 78 28 1d ae 52 04 f3 2e // f3 52 da 1c a9 98 11 28 50 f5 b1 27 d5 a0 aa b8 90 74 e4 66 d9 a5 // 94 34 57 b3 c8 53 74 39 b4 34 84 35 5b 0d 27 d9 7e c3 00 23 7f 2e // 13 f1 b1 f5 0d f0 bb 61 9b 70 5c 30 4c eb 93 0c 9f 19 86 1d 1c df // 09 be 8f b6 eb 61 2b 63 16 68 c4 d9 a3 dc 6c be 3e 5c 9c 49 1c 30 // 3b 28 ed 16 da 76 4d a2 1a 68 ba 17 d4 e9 dd 44 5d a0 a2 6e 11 4b // f1 64 52 5a 70 a0 94 8e 86 fc 88 c7 38 ae 71 2b c2 2f 61 14 c0 e8 // ff 6e c5 e4 c8 70 9c 9e a4 28 f1 04 d8 a1 aa 4f 9a 03 1d 32 cd d5 // 2f ca d9 91 ba 13 ba 01 b7 74 83 24 a8 7e 66 08 b7 bb b0 d2 d8 6d // 61 3c b6 86 99 bd ab 24 48 5f 46 c2 e9 e9 cc 73 d3 79 f6 06 61 68 // 33 d5 5a 41 43 1f d5 ef d6 87 b9 18 d0 b7 2a b0 9a 17 d6 0e c7 27 // 4e 1f 30 52 11 bb 63 db 9a 04 b0 22 8b 06 17 04 4d 01 0b 68 76 d8 // e9 4d 99 c9 3d 15 db cb 7f a3 30 15 72 a9 71 a2 ac 76 cc 49 43 73 // 0d 41 1b 76 00 46 29 91 91 e8 68 a3 8a b1 bf 82 c8 65 3f e2 ec af // 25 fa 67 81 88 bf ba 34 94 70 b4 4f f4 73 08 c1 80 79 60 8c fb 36 // 1c 14 65 6b f6 2f f6 6d 2f 02 cd 16 79 65 fb b4 fa 31 aa 6e ad 3b // 6f 1a 34 8d 79 2d bb e0 2a 55 9f ba ba 9e 44 3b cc cc 52 38 bd 1e // dd 36 f4 cf 04 56 ed da 97 b2 fb 1f 67 e9 6c f1 34 d6 ad a4 69 72 // da 02 f1 70 5c 68 19 07 16 c0 46 d4 9f fb f7 5e 1e 78 ec 93 28 4b // 39 fb 21 08 68 7a fe 2c 5a 3f 02 aa da 83 56 e7 2e 09 17 c5 82 3d // 0d 77 d8 a1 14 49 0b 61 d8 33 a7 02 5a fc cd d3 e3 a0 eb 0d 80 76 // 96 1f 7d 2c 3d ec 14 f0 b6 ff d6 82 aa 02 59 90 63 47 15 24 fd 33 // 4c 9a b4 32 1f 22 a8 73 dd 9d 5d 2c 51 6a 99 40 ae a6 44 00 20 89 // 5d a2 cf 30 48 2f 1d 65 ed 6f 95 1f 3d 80 fc 25 84 89 83 75 5c fb // bd 97 54 73 32 d5 68 1c 3e e7 fb a2 23 7d 11 46 5d ec 45 6d cb 10 // 1c 18 3d 11 5f 44 1c 82 81 3d b8 02 5d 86 93 5c 3c 56 f8 40 6c 73 // 88 23 46 38 38 79 d3 97 bd 90 77 fd 52 e9 be 66 c5 84 92 a4 e6 41 // 3d 12 58 d4 c9 f1 1a 64 5b eb fd bf f5 e2 6a 1b 8d ac 0a 35 e2 1e // 3c f5 3c ca 58 22 97 cb ea c2 1f 27 bc 6c 80 95 fd d4 ee b1 e3 0a // 93 f5 63 a2 6d fd f0 4d 92 c1 9c cd 75 98 8b 44 8e 60 06 70 59 1c // 1e f0 26 90 e4 d5 7e e7 36 da 26 70 9e 70 59 cb fd 24 b0 02 35 3a // 6b 53 8f 6b 64 7f a0 c7 65 c0 19 3d e7 72 38 8e e2 45 a0 2e 0e f1 // ec 1b c0 d2 e5 83 84 c0 99 a9 c0 f5 d2 50 72 f8 78 b3 a9 f5 a5 75 // 64 87 eb b7 89 c9 52} (length 0x1000) // } // sq_wqe_count: int32 = 0x5 (4 bytes) // rq_wqe_count: int32 = 0x2 (4 bytes) // rq_wqe_shift: int32 = 0x8 (4 bytes) // flags: int32 = 0x5 (4 bytes) // uidx: int32 = 0x87 (4 bytes) // reserved1: const = 0x0 (4 bytes) // access_key: int64 = 0x7f (8 bytes) // } // } // len: len = 0x78 (8 bytes) // ] *(uint32_t*)0x20002a00 = 0x18; *(uint16_t*)0x20002a04 = 0x1e; *(uint16_t*)0x20002a06 = 0; *(uint64_t*)0x20002a08 = 0; *(uint64_t*)0x20002a10 = 1; *(uint32_t*)0x20002a18 = r[6]; *(uint32_t*)0x20002a1c = r[7]; *(uint32_t*)0x20002a20 = r[2]; *(uint32_t*)0x20002a24 = r[8]; *(uint32_t*)0x20002a28 = 2; *(uint32_t*)0x20002a2c = 7; *(uint32_t*)0x20002a30 = 9; *(uint32_t*)0x20002a34 = 0; *(uint32_t*)0x20002a38 = 8; *(uint8_t*)0x20002a3c = 0x31; *(uint8_t*)0x20002a3d = -1; *(uint8_t*)0x20002a3e = 0x40; *(uint8_t*)0x20002a3f = 0; *(uint64_t*)0x20002a40 = 5; *(uint64_t*)0x20002a48 = 0; *(uint64_t*)0x20002a50 = 0x20001a00; memcpy( (void*)0x20001a00, "\x50\x55\x21\x2a\x20\xde\x0d\x40\x05\x1f\xa8\x1a\x3e\x6a\x0f\x07\xcd\xb9" "\x25\xa3\x70\x34\x39\x91\x1e\x2b\xcd\x99\x08\x44\xef\xfc\x76\x30\xb6\xf9" "\xb1\xb7\x40\x8a\x23\x9c\x04\x92\xcd\x4d\x10\xb7\x8a\x77\x2e\xe4\x72\xc5" "\x34\xbc\xf1\x16\xaa\xa8\x8c\xc0\x77\x3e\x1a\x84\x9b\x2c\x81\x7c\x51\x12" "\x07\xd1\xe3\x40\xd9\x5b\xd2\xee\xb6\x00\xda\x45\x89\x39\xcc\x5e\xa8\xfc" "\xe8\x10\x9b\xe6\x22\x26\xd7\xc8\x99\x31\x66\x90\x11\xc5\xd0\xba\xb8\xd1" "\x0b\x34\x66\xac\x12\xa4\x6e\xac\x06\x76\xad\xfe\x0e\xae\x24\x51\x38\xcb" "\x64\xf6\x9c\x3d\x58\xe1\x0d\x3b\xa2\x63\x54\xad\x37\x00\x42\xb8\x47\xdc" "\x22\xb5\xd6\x70\xa0\x4e\x32\x69\x43\x00\x46\x96\xef\x65\x44\x47\xf7\x52" "\xb4\x43\x18\x63\xed\x2e\x39\x38\xb6\xde\xc0\x40\xd1\xa9\x6e\xfb\xe8\x78" "\xa0\xb0\x9f\xa9\xc1\xad\x31\xdf\xf8\x2c\x54\x44\x4e\x76\x5f\xef\x4b\x56" "\xb5\x20\xf0\x54\x8a\x0e\x9d\xa7\x0f\x6f\x3a\x5b\x98\x62\xab\x8a\x3f\x89" "\x68\x90\x3c\x1b\xc8\x4b\xa1\x9b\x67\xfb\x32\x53\xe5\xbf\xc7\xdb\x45\xac" "\x5d\xd4\xe7\x9e\x0f\xc0\x87\xbc\xea\x08\xa6\xfe\xfb\xfa\x5d\x1f\x33\xe0" "\x31\x17\x0f\xf3\xf1\x59\x68\x21\x6a\x60\x84\x67\xb7\x9c\x63\xb2\x47\x61" "\xde\xb0\xe6\x7b\x7a\x46\x35\x0c\xd6\xa9\x49\xfe\x24\x6a\x09\xe9\xd4\x5e" "\xba\xf5\xde\x06\xba\x98\xe4\xd5\x08\x97\x6a\x42\xbc\xbd\x84\xdd\x19\xd5" "\xfe\x3f\x1a\x8d\xcf\x99\x1c\x7f\xf9\x60\x04\x84\x37\xd6\x10\xf3\xf3\x65" "\x7b\xd0\x76\x21\xfc\x8d\x61\x99\x9f\x85\x5a\x07\x9b\x35\x14\x9e\xa3\xd0" "\xfa\xd1\x65\xc3\x71\x07\xcf\xfe\x7b\x63\x84\xfa\xf4\x0b\xb0\x32\x15\xbb" "\x23\x37\x82\xb9\x3f\x10\xc3\x6d\x79\x4d\x16\xbb\x48\x99\x3d\xd9\xc1\xfc" "\xce\x68\x0e\x28\xa7\x81\x9d\xf5\xa4\x1a\x6e\xc3\x8a\x4c\xc5\x9f\xa1\xf1" "\xe0\xbb\xbb\xb4\x90\x36\x35\x11\x18\xa3\x0f\xc5\xb6\xde\x10\x35\x9e\x4d" "\x67\xcb\x0f\x25\xb5\x75\x2b\x60\xee\x89\xe5\x02\xe4\xb7\xde\x53\x68\x1e" "\x84\x7a\xf2\x8f\x6e\x3d\x46\x7b\xb7\x69\x3d\x6a\xc7\x92\xfa\x66\xd9\x77" "\x55\x67\xc7\xa2\xdf\x24\x44\xcc\x3c\x36\x3a\xf8\xf5\xb7\x96\x0b\x80\x11" "\x1f\xa5\x1e\x0f\xc7\x92\x60\x49\x35\x09\x73\xd7\x79\x1e\xe2\xcd\x0b\x1a" "\xdf\x26\x58\x94\xc8\xf6\x53\x8a\x22\x6c\x3d\x25\x7e\xd4\x98\x97\x38\x97" "\xef\xa9\x47\xae\x8e\x26\x17\x25\x83\xfd\x19\xf6\x7a\x03\x4e\x28\x0c\x8e" "\xf2\xa1\xdb\x77\xa1\xe1\xb7\xa6\x8c\x9a\xe7\x8d\xa0\xcf\x55\xb7\x9b\x1a" "\x4b\xe5\x53\x3f\x04\x6e\xae\x0c\x70\x33\xdc\x3e\x60\x60\x07\xa4\x6d\xa1" "\xf3\xcd\x96\xdf\x76\xd8\x90\xe5\xea\x8e\x16\xe7\x37\xd0\xe7\xd3\xe2\x93" "\x85\xf8\x9a\xe0\x5e\xe5\xd8\x1d\x96\x9d\x42\x34\x73\xc3\x15\x3e\x8b\xc7" "\xb5\xce\x87\xf9\x6f\x87\xbf\xb7\x06\x71\x1f\x72\xc2\xab\x5d\xbd\x60\x34" "\x7c\xb0\x11\xff\xf0\x0e\xde\xb0\x72\xde\x06\x49\x1c\xaa\x9e\x65\x3f\xea" "\xc4\x34\xe6\xf0\xd0\x8b\xfe\x2f\x0c\x39\x9e\x2f\x46\xc8\x72\x89\x24\x60" "\x76\xc6\x8e\x9b\xb5\x1f\xe0\x32\xf9\xcc\xda\x16\xdf\xa2\x7f\x7b\x63\x6f" "\x48\x2e\xb2\x58\xf9\xd5\x39\x2b\x63\xb7\x8e\x69\xb6\x16\x97\x99\x1f\xea" "\x90\x71\x3c\x1e\xcc\xe9\x6b\x3f\xae\xf7\xbe\x96\x86\xcd\x13\x80\x9e\x01" "\x7a\x40\xe6\x1d\xac\x58\x1f\x7f\x02\x16\x36\x6f\x3b\x49\x9e\x2e\x3e\x0c" "\x0a\x48\x23\x5c\xdd\x74\xa0\xee\xd3\x68\x1e\x74\x02\x9f\xee\x92\xf5\xef" "\xed\x8e\x4c\xc2\x08\x72\xbd\xfe\x92\xa3\x01\x7c\xe5\x96\x8d\x50\x8e\x83" "\x1b\x3d\x83\x22\x27\x9f\x2a\xb8\x5c\x98\xd1\x1a\xbe\xf1\x69\x96\x38\x86" "\xc6\x71\xd0\xa5\x88\x07\xee\x60\xd0\x85\x21\x6c\x76\xba\xa7\x1a\xac\x10" "\xd5\x3e\x6e\xeb\xcd\x2f\xbc\xf0\x58\x16\x95\xd7\xf0\x9d\xae\x91\x24\xe0" "\xc6\x38\xc2\x5a\x55\x8e\x9a\x9d\xd1\x5a\x96\xaf\xbc\x45\xcf\x9d\x7b\xcf" "\xef\x0e\x3d\x5a\xc9\xc9\x33\x5b\x98\x57\xc1\x2f\x3a\x73\xbc\x1e\x6e\xf7" "\x93\x69\x4f\x6f\x00\x41\xde\x59\xe0\x36\x3d\xc9\x7e\x73\x4c\x82\xb7\x06" "\x97\xf3\xe8\x20\x2e\x0b\x60\x27\x24\x22\x69\x4e\xd3\xfd\x23\xa8\x26\xd7" "\x03\x96\x41\x52\x5a\x5a\xfd\x15\x79\xe7\x99\x46\x3d\xc0\x3e\xfb\xb0\x58" "\xfe\x23\xc0\xcd\xcb\x51\x33\x8c\x48\x83\x0c\x26\x0e\x9c\x6f\x61\x55\x42" "\x22\x41\xdf\x70\x26\x93\x20\xed\xf6\xf0\x25\xec\x32\x55\xe7\x56\xc3\x7c" "\x09\xc4\x08\xe7\xb4\x0d\x60\x95\x0b\x4e\xca\x07\x87\x88\x3b\x1c\xd9\x08" "\xa1\xef\xe8\x0b\xd5\xc1\x18\xc1\xf5\x1c\x71\xc4\xb2\xe2\xcd\x09\x87\x52" "\x90\x61\x6f\xf3\x8e\xfd\xd8\xf5\xf2\x5c\x59\xc4\x12\x04\xd8\x4a\x71\x46" "\xaf\xdc\x01\xaf\x62\x91\x1f\x68\xc0\x66\x8d\x75\x5a\xfe\x2f\xbd\x53\x7f" "\xc9\x2a\x00\x05\x32\x5b\x87\xbf\x51\xcd\x33\x30\xf0\x69\x48\xf5\xbc\x43" "\xc6\xb9\xe3\x0a\xc6\x68\x25\x0b\x56\x09\x0b\xc5\xb6\x56\x95\xb0\x80\xd7" "\xd3\x7e\x02\x7d\xdb\x0d\x10\x4f\x9a\xe9\xc6\xa9\xfc\x76\xd3\x3d\x5c\x86" "\x3e\xf0\xdc\x11\x74\xa9\xe3\xc2\xe7\x53\xfb\xd8\x27\xb4\x7d\x0e\xad\x75" "\x23\x84\x29\xfb\x41\x35\x31\xcf\xac\x7d\x6a\xdc\x74\x75\xd6\x14\xd9\x98" "\x93\xcf\x59\x12\x7b\x7a\x80\x47\x9d\xcc\xf3\xd0\xef\xb0\xd9\x81\x22\x4b" "\x44\x86\x1d\x17\x67\x69\x65\x7b\x44\x2d\x82\xec\xc5\x2f\x6b\x59\xeb\xed" "\x64\x6e\xac\x24\x8e\xd0\xad\xcf\xdb\xb6\xdf\xbf\x3d\xb5\x34\x27\x3c\x28" "\x17\xd5\xe3\x73\xc9\x1e\x91\xba\xbb\x04\xb9\xe6\x89\x8c\x14\xd3\xa0\xb5" "\xd3\x40\x3e\xe8\xb1\xd7\xb4\x02\x21\x1a\x60\x2a\x16\x91\x1f\xa8\x7c\xcd" "\x47\x2e\x60\xb8\xdf\x22\xa4\x99\x56\x35\x2b\x81\xb7\xdb\xbb\xb9\x4e\x57" "\xdd\x83\x33\x10\x36\x28\x5a\x76\xb8\xbd\x52\x6c\x83\x46\xb8\x98\x87\x2b" "\x2b\xb7\xb9\x13\xce\xef\x55\xf2\x6b\xb6\x27\x34\x06\x36\xf8\x99\xd2\x9e" "\x94\x85\x81\x9d\x9a\x0d\x22\xd5\xc5\x4b\x7e\x17\xbd\xd0\x8a\xa1\xa0\x8d" "\x6a\x51\x78\xa9\xa9\xdb\xc5\x42\x33\x9f\xe4\x23\xd5\xd6\xa3\x0d\x56\x29" "\x93\x8c\xaa\x2c\xe1\x8f\x6f\xe9\x72\x1e\x58\x71\xb8\xc4\xa2\x2c\x87\x15" "\xdf\x27\x82\x75\xb1\xa2\xa0\x4c\x36\x39\x8b\xf5\x0a\x85\x05\x9d\x73\x41" "\x09\xa0\x57\xd6\x94\x39\xed\x16\x56\xae\x7e\xd8\xf5\xd1\xf2\x20\xd2\xb0" "\xb1\xfd\x74\x11\x59\xfa\x86\x77\x48\xd2\x54\xdc\x42\xe8\x66\x73\x76\x86" "\x81\x6a\x73\xb6\x27\x2b\x78\x27\xcc\xbe\x1f\x3b\x01\x86\x19\xf8\x98\xfd" "\xb3\x04\x50\xf0\x68\x2b\x2d\x39\x6c\xe9\xde\xd5\x52\xba\x41\xbf\x56\x61" "\x89\x11\xab\x14\x0b\x3e\x83\xdd\x23\x0d\x95\xf0\x3d\x57\x2a\x33\x1b\x38" "\x89\xa8\xdd\xbc\x84\x41\xfb\x7e\x6d\x5b\x61\xff\x96\xa5\xf7\xff\x0f\x89" "\xb5\xd7\xc5\xe8\x2f\x79\x23\x85\x63\x61\x57\x37\xd4\xa9\xf5\xc7\xe7\xdd" "\x9c\xd3\x11\x6b\x98\xff\x18\xec\x4b\x70\x20\x90\x11\xf4\x94\x65\x00\x1f" "\xe9\x5b\x27\x27\x64\x9d\x82\x5e\x96\xf0\x1c\x0d\x3b\xc3\x75\xa0\xfb\xea" "\xc4\xaf\x7e\x01\xa5\x9d\x5e\x09\x25\x7d\x1e\xdf\x94\x56\x02\xc4\x99\x12" "\xf3\x85\x41\xa4\x9f\x52\x5a\x0b\xb0\x93\xed\x1b\x0f\x25\x58\xc7\x03\xc4" "\xea\x06\x2a\xdd\x08\x8e\xc3\xa8\xa9\x91\x36\x1b\x8e\xa0\x58\x9d\x40\xb1" "\x34\xc0\x7b\x60\x42\x9e\x95\xdb\x31\xac\x98\xf7\x1b\xee\xe8\xde\xbe\x57" "\x1a\xb6\xbe\x9f\xda\x75\x34\x69\x17\xaa\x05\x4c\x27\xfa\x60\xa0\xcf\x77" "\xed\xa0\xd6\xd4\x44\xf4\x39\x63\x84\x6e\x55\xbe\x8b\x1c\x56\x7a\x78\x94" "\x9b\x4c\x36\xfc\xfd\xb1\x9a\xa7\x3d\xc5\x61\xc8\xf5\x2e\xb5\xf7\x80\x54" "\xb1\xf2\x19\x72\x63\x02\x87\xb4\xf9\xb5\x35\x9c\x51\x1d\x07\x43\xee\x99" "\xcf\xfe\x45\xd3\x38\xa7\xe7\x18\x94\xc1\x1d\x88\x01\xe5\xf4\xe4\x90\xdf" "\x61\xbe\x08\x0a\x0d\x5c\xb5\x1f\x81\xc2\xea\xed\xc1\xb2\x53\x55\x38\x1d" "\xcd\x66\xb1\x23\xfa\x72\xbe\x08\xb5\x57\x1a\x80\x93\xd3\xe1\x1a\x69\x9f" "\xdc\xfe\xfb\x71\xfb\xd8\x95\xac\xf6\x79\x8d\x1b\xd0\x84\x84\xbf\xa1\x39" "\x35\x41\x58\x62\x55\x2f\xc4\xa3\xef\xf9\x99\x3d\xf9\xeb\x06\x2d\xbc\x70" "\x41\x67\x24\x3a\x9f\x04\x3b\x87\xb0\xf1\x6e\x6d\xbc\x65\x16\x2f\x0b\xfc" "\xcf\x66\x9b\x2e\x89\xa9\x13\x29\xcd\xed\xb7\x81\xdd\x81\x7c\xe7\xe7\x03" "\x70\xa9\xb9\x9f\x65\x5d\xc1\xe3\x52\x92\x31\x62\xa6\x36\xb4\x78\xca\xcb" "\xe2\x2b\xcd\xae\x89\xfb\x8b\x28\xdf\x6e\xde\x50\x48\xc1\x5b\x4d\x0e\x0a" "\x9e\xb8\xc6\x0c\x20\x8b\x07\x1e\x1f\xe2\x51\x26\x5f\x7e\x49\xee\x59\x38" "\xc0\xe5\x4b\x8b\xf6\xa7\xe1\xfa\x7a\x51\x94\x80\x03\x76\x7a\x4f\xfe\x1e" "\x07\x18\xce\xd2\x73\x11\x0c\x5d\xbb\xec\x02\x9f\xd5\x30\x03\xe0\x0d\x2e" "\x90\x24\x69\x58\x57\xfd\x09\x4b\x2a\x32\xfd\x57\x0d\xea\x43\x0d\xb9\xf0" "\x87\x9b\x69\x60\x98\xb5\x13\xba\x81\x25\x48\xde\x53\xcb\x1a\x6d\xd7\x5e" "\xd3\x45\x97\xe5\x91\xfd\x96\x39\xd9\x2a\xc1\x50\xde\xc9\x28\xfc\x4a\xe9" "\xd2\x5d\x82\x41\x1d\x9e\x44\xf0\x6b\x89\x45\x1c\xd6\xfc\xb0\x83\x5a\xa6" "\x87\x31\x2c\x97\xf7\x94\xff\x18\xe2\xbb\xbc\xf5\x04\xf4\x8d\x18\x88\xe8" "\x8e\x25\x34\x23\x15\x2f\xfc\xf0\x43\xb0\x28\x88\x07\xcb\x7d\x08\xe5\x3b" "\x15\xef\x17\x25\xd0\x50\x4e\x3e\xc1\xfc\x20\x6d\x00\x0f\x86\x44\x3a\xab" "\xeb\x19\x60\x02\xff\x78\x9d\x56\xb6\xdd\x9b\x87\xf7\x4c\x41\x4a\xdb\x6f" "\x59\xe9\xaa\xae\x51\x03\x10\xf2\xbf\x7d\x47\x06\x53\xf8\x7f\x67\x7a\x21" "\x6d\x8f\xd9\xf3\x73\x30\x1f\xc7\x01\x3e\x5d\xe8\x26\x41\x29\xba\x3e\x00" "\x29\xe3\x82\xdd\x04\x1b\x9f\xfc\x03\xb9\xe2\x62\x1b\xe7\x3a\x6b\x1e\xe3" "\xf1\xed\x50\x45\x8c\x25\xe6\x5e\xa5\x80\xef\xc7\x4b\x7b\x23\x5a\x2c\xf4" "\x4d\x27\xf7\xe9\x29\xe7\x9c\x32\x7f\x9c\x84\x20\x02\x3b\x82\x86\xa5\xae" "\x8b\xdb\x96\x56\xd5\x67\x98\x31\x6a\x57\x9a\x75\x3b\x58\x30\x82\x78\x20" "\xed\x5c\x28\x2c\x96\xec\xb2\x08\x68\x0e\x21\x55\xfe\xf5\x25\x17\xd5\xa3" "\x33\x68\x39\x40\xb8\x57\x74\x66\x23\x62\x12\x2e\xf6\xe8\x5d\x37\xc7\x4c" "\x9b\x7c\x99\x31\x2d\x9f\x7c\x26\x55\x6c\x58\xc1\xd6\x7d\x9f\xcf\x2b\x5d" "\x0c\x6d\x39\x05\xf2\x2f\xdd\xad\xec\x7e\x18\x97\x82\xdb\x06\x9d\x69\x03" "\x71\x7e\x52\xea\x07\x87\x8d\x44\x98\xa4\x91\x3b\x00\x33\xbd\xac\xd1\xf4" "\x77\x94\x0a\x0b\xa0\x82\x56\x83\xb0\x55\x92\x5b\x4f\x57\x42\x3b\xf0\x8a" "\xc9\x23\x8f\xcc\xeb\x95\xec\x0b\x5d\xb1\xe8\xc4\x05\xda\x7a\x21\x3e\xe1" "\x0b\x6c\xef\x0f\xa5\x4c\xc1\x22\x6e\x55\x81\xb0\x95\xef\x6c\x45\xe2\xbe" "\xec\x21\xc4\x7f\xdb\x7e\x8b\x01\x5d\x92\x3b\x46\xbd\xfd\x45\x00\x57\x4e" "\xa6\x91\x8e\xdb\xac\x95\x9b\x12\xb5\x64\x47\xf7\x9b\x14\x6d\x04\x1b\x79" "\xda\x39\x2a\x23\xe6\xf3\x73\x07\x04\x00\xe1\x6a\xde\x3a\xe7\x21\xb3\x25" "\x93\xd3\xac\x20\x5d\x0f\xf9\xd5\x9f\x23\xbc\xa4\xf2\x18\xa3\x74\x49\x8f" "\x9b\xe2\x87\xe0\xe7\xea\x82\x86\x10\xed\x8b\x61\xf0\x31\x2e\x70\xb6\xc2" "\x5e\x68\x7b\xfd\x18\x66\x57\xe5\x4d\xb2\x61\x8b\x98\x53\x86\x9d\x69\x0b" "\x30\xb9\xd8\x59\xc8\x4e\xd8\xb3\xe9\x14\x19\x52\x5a\x0a\x1e\xf5\xf8\x95" "\xdf\x39\x03\x40\xef\x59\x8f\x3c\x23\x66\x80\x32\xd9\x04\x80\xcb\xa4\xaf" "\x12\x60\xcb\x13\xd6\x18\x90\x01\x18\xd0\xb4\x32\x6c\xb1\xe6\xbd\xf4\x7e" "\xc3\xcf\x6a\xbb\x5f\xea\x58\x8d\x1e\xc5\x14\xae\xa4\x18\xa7\x21\x08\x95" "\x76\x0d\x57\x86\xbe\xce\x85\xf5\xa6\x57\xfd\xea\x9c\x1f\xb0\x50\xae\x7a" "\xaf\x75\x61\x2c\x6b\x54\x89\xdd\xb8\x91\x25\xa6\xd2\x21\x60\x6a\x8c\x14" "\xaa\xdb\x40\xa2\xc7\x07\x63\xad\x6c\x99\x90\x69\x45\x1a\xf6\xb8\xb8\xda" "\xf0\x04\x45\x4b\x48\xd8\xaa\x3e\x60\x07\x79\x34\x10\xbb\x0a\x9c\xc0\x0c" "\x1f\xd4\x1a\xe4\x97\xb0\x5f\x83\x16\xea\x1e\xb8\x3e\x54\x0d\x17\x31\x89" "\xe4\x26\xaf\x58\xab\x09\x9c\xb1\x7a\x3b\x85\xb8\x38\xc2\x77\xea\x95\x3c" "\x94\x56\x67\x88\x4c\x4b\xd1\xb0\x89\x28\x2b\x3d\x4c\xd6\x1c\xcf\x38\x83" "\x33\x17\x6a\x1e\xe9\x52\xab\xee\xbf\xf1\x10\xea\x3c\xf7\x5a\xf5\x5f\xb8" "\x71\x01\x63\x55\xd0\xcd\x8e\x5d\x1e\x7f\x1a\xda\xcf\xa7\xbe\x53\x1a\xa3" "\xec\xe7\xe6\x51\xc0\x23\x68\xde\x36\xc4\xd0\xec\x5c\xe5\x4b\x9a\xe0\x80" "\x74\xc6\xb5\x1e\xe6\xc2\x04\x6b\x5e\xd7\x4c\xc7\xd4\xcf\x1a\x72\x46\xfa" "\xcd\x88\xd2\x31\xf8\x35\x41\xee\x8f\x01\x6e\x27\x15\x42\x35\xdc\xe8\x23" "\x10\x97\x92\xe2\xf2\xe6\xa2\x0a\x40\xc9\xa8\x41\x4a\x72\x1f\x2a\x49\x0d" "\xf0\x8a\x0d\xb7\xe0\xbb\xda\x22\x94\xb4\x5b\x45\xc4\x01\x59\x64\x9a\x0f" "\xa5\x91\xb0\x42\x6c\xef\xdb\x62\x25\xdb\x13\xc3\x74\xa0\x8a\x3a\x6f\x7c" "\x89\xa1\xc7\xe1\x64\xf2\xfc\xf9\x26\xb5\x78\x1e\x78\xea\x47\xc5\x4c\x46" "\x3d\x60\x83\x17\x83\x83\x82\x6a\x4a\xae\xf4\x8e\x35\x59\x0e\x0c\x61\x19" "\xc1\x00\x7b\xcd\x3d\x52\xd0\xbe\xf0\xc0\xe5\x34\xe5\x2c\xe6\xdf\x4b\x24" "\x58\x34\x01\x46\x70\x9d\x0d\x1f\x55\x49\x0d\x8b\x64\x85\xa2\x4a\xc0\xfc" "\xcc\x9d\xba\x0b\x53\x32\x7c\x19\x8c\x66\x21\x7f\xee\x8f\x37\x91\x3e\x15" "\x9f\xbf\xce\x7d\xcb\x41\x94\xab\x3c\x59\x5e\x4c\x30\xfd\x4d\x42\xcd\x18" "\x6d\xeb\xbf\x45\xab\xfa\xe4\x9b\xa3\x13\xeb\x7a\xb3\xf5\x61\xdc\xa2\x07" "\x64\x24\x8e\x91\xc9\x52\xe2\xef\x2c\x26\x10\xfd\xd3\x1c\x57\x2b\x06\xff" "\x41\x21\xda\xdf\x57\xe5\x05\x65\xbd\xfa\xa2\x01\x3e\x06\xfc\x93\x27\x99" "\xd1\xa5\xa5\x4a\x7a\x21\x97\x7e\x20\xad\xde\x8d\x13\x77\x7d\xea\xc0\xf7" "\x30\x7b\x92\x29\x2a\xfc\x15\x81\xd7\x72\x70\x79\x51\x27\x00\xfe\xf2\x01" "\x65\xba\x01\xd2\x89\xb4\x9c\xd6\x6f\x29\x10\x42\x27\x01\xfa\xc2\x63\x92" "\xec\xe1\xf9\xaf\xba\x4e\x87\xe5\xfe\x46\x7f\x8a\x59\x43\x24\xd2\x52\x07" "\x14\xcc\x94\x01\x77\x98\x19\xd1\xed\x09\x93\x4a\x77\xba\xae\x40\xff\x71" "\xca\xf2\xf4\xf2\x44\x12\xcd\x05\x43\x61\xff\x8f\xe6\x43\x7d\x4c\xf9\x53" "\x88\x47\x30\x72\xb6\xe0\x33\xbf\xfc\x1b\xee\x1f\x4b\x57\x57\x7c\x2a\x36" "\x1e\xdb\x83\x60\xc7\x03\x4a\x5d\x87\x03\x36\xef\x5e\x07\xee\x00\x6c\xe5" "\x25\xf2\x1b\xd9\xd1\x2f\xff\xaa\x03\xb6\x7b\xe4\x3e\xa8\x03\x50\xe7\x46" "\xc9\xa4\xb1\x76\xfa\x16\xf5\x15\xb6\xb4\x41\x5e\xdf\x84\x99\xbc\x0c\x60" "\x18\x46\xf2\x72\xf5\xb7\xf5\xf0\x52\x2c\x69\x3a\xe1\xd1\xf4\x4f\xbc\xa3" "\xe5\xc8\xf2\x58\x51\xf4\x24\x9e\x62\xf5\x15\xc8\x6d\x08\x27\x70\x9f\x14" "\x4a\x30\xc5\xd9\x85\x50\xae\xf1\x14\xda\x54\x5b\xee\xdc\x7f\xf8\x40\xaa" "\xb4\x4c\x46\xc4\x2c\x07\xc6\xda\x0e\xec\x8c\xec\x32\x2f\xd2\xed\x01\xee" "\xdc\x65\x83\x58\x0b\xf8\x98\x96\x39\x12\x7d\xee\x84\x87\x27\xed\x5f\xa7" "\x9d\xc3\x4b\x4c\xe1\x2a\x03\xb2\xe3\x0f\x68\xb5\xea\x73\xe4\x7a\x00\xca" "\x35\x91\xa8\xba\xa4\xbe\x67\x77\xd2\x31\x50\x0f\xf6\xa3\x91\xbb\x45\xea" "\x51\x9d\xf0\x25\xac\x12\xbc\xc5\xab\xf6\xcb\xcf\xe1\x82\x44\x8a\x56\xca" "\x8f\xf1\xf0\x0b\x61\x13\x8a\x89\xf5\x45\x38\x18\xea\x6b\x71\x3f\x94\xe5" "\xf6\xba\xe5\x4b\x90\x64\xee\xd4\x7e\x64\x6c\xcd\x89\x07\x10\x2c\xd8\x94" "\x03\x03\xdd\x29\xc9\x41\xb9\x19\xe1\xe8\x77\x8a\x5c\xcd\x18\xb9\x75\x75" "\x81\x3b\x41\x18\x49\x9e\x99\xcc\x23\x69\x9c\xe5\x3f\xff\xb6\xdd\x3a\x4a" "\x62\xcd\x41\x5e\xa5\x2b\xa1\x11\x75\x69\x87\xd1\x10\x27\x79\x6b\xbf\xcf" "\xbc\x46\x07\xb9\xa6\x77\x1e\x95\x30\x58\x0e\x9e\xc6\x20\x76\xef\xea\x6f" "\x40\xc2\xa8\xef\x7f\xc5\x3a\x6f\xb6\x7f\x4f\x26\x31\xca\xff\xa6\x65\xfd" "\xae\x08\x5a\x3f\xfb\x6a\x91\x6d\xa2\x3d\xb5\x9e\x73\xa6\x9a\x64\xe9\x78" "\xd3\x3e\x0d\x30\x77\xe7\xe7\x86\x4d\x33\xaa\xc4\x0f\xd7\xc9\xe8\xd6\x64" "\xc3\x70\xd2\x3a\xf1\xaa\x0d\x6a\x7c\x95\xd0\x60\xff\xac\x90\xf0\x22\xef" "\x96\x4d\xc9\x0a\x96\x54\x50\x90\x8d\x68\x25\xcf\xe9\x59\x8a\xec\x3a\x25" "\x20\x7d\x08\x68\xcb\xa4\xd7\xf9\x87\xd0\x27\x78\x28\x1d\xae\x52\x04\xf3" "\x2e\xf3\x52\xda\x1c\xa9\x98\x11\x28\x50\xf5\xb1\x27\xd5\xa0\xaa\xb8\x90" "\x74\xe4\x66\xd9\xa5\x94\x34\x57\xb3\xc8\x53\x74\x39\xb4\x34\x84\x35\x5b" "\x0d\x27\xd9\x7e\xc3\x00\x23\x7f\x2e\x13\xf1\xb1\xf5\x0d\xf0\xbb\x61\x9b" "\x70\x5c\x30\x4c\xeb\x93\x0c\x9f\x19\x86\x1d\x1c\xdf\x09\xbe\x8f\xb6\xeb" "\x61\x2b\x63\x16\x68\xc4\xd9\xa3\xdc\x6c\xbe\x3e\x5c\x9c\x49\x1c\x30\x3b" "\x28\xed\x16\xda\x76\x4d\xa2\x1a\x68\xba\x17\xd4\xe9\xdd\x44\x5d\xa0\xa2" "\x6e\x11\x4b\xf1\x64\x52\x5a\x70\xa0\x94\x8e\x86\xfc\x88\xc7\x38\xae\x71" "\x2b\xc2\x2f\x61\x14\xc0\xe8\xff\x6e\xc5\xe4\xc8\x70\x9c\x9e\xa4\x28\xf1" "\x04\xd8\xa1\xaa\x4f\x9a\x03\x1d\x32\xcd\xd5\x2f\xca\xd9\x91\xba\x13\xba" "\x01\xb7\x74\x83\x24\xa8\x7e\x66\x08\xb7\xbb\xb0\xd2\xd8\x6d\x61\x3c\xb6" "\x86\x99\xbd\xab\x24\x48\x5f\x46\xc2\xe9\xe9\xcc\x73\xd3\x79\xf6\x06\x61" "\x68\x33\xd5\x5a\x41\x43\x1f\xd5\xef\xd6\x87\xb9\x18\xd0\xb7\x2a\xb0\x9a" "\x17\xd6\x0e\xc7\x27\x4e\x1f\x30\x52\x11\xbb\x63\xdb\x9a\x04\xb0\x22\x8b" "\x06\x17\x04\x4d\x01\x0b\x68\x76\xd8\xe9\x4d\x99\xc9\x3d\x15\xdb\xcb\x7f" "\xa3\x30\x15\x72\xa9\x71\xa2\xac\x76\xcc\x49\x43\x73\x0d\x41\x1b\x76\x00" "\x46\x29\x91\x91\xe8\x68\xa3\x8a\xb1\xbf\x82\xc8\x65\x3f\xe2\xec\xaf\x25" "\xfa\x67\x81\x88\xbf\xba\x34\x94\x70\xb4\x4f\xf4\x73\x08\xc1\x80\x79\x60" "\x8c\xfb\x36\x1c\x14\x65\x6b\xf6\x2f\xf6\x6d\x2f\x02\xcd\x16\x79\x65\xfb" "\xb4\xfa\x31\xaa\x6e\xad\x3b\x6f\x1a\x34\x8d\x79\x2d\xbb\xe0\x2a\x55\x9f" "\xba\xba\x9e\x44\x3b\xcc\xcc\x52\x38\xbd\x1e\xdd\x36\xf4\xcf\x04\x56\xed" "\xda\x97\xb2\xfb\x1f\x67\xe9\x6c\xf1\x34\xd6\xad\xa4\x69\x72\xda\x02\xf1" "\x70\x5c\x68\x19\x07\x16\xc0\x46\xd4\x9f\xfb\xf7\x5e\x1e\x78\xec\x93\x28" "\x4b\x39\xfb\x21\x08\x68\x7a\xfe\x2c\x5a\x3f\x02\xaa\xda\x83\x56\xe7\x2e" "\x09\x17\xc5\x82\x3d\x0d\x77\xd8\xa1\x14\x49\x0b\x61\xd8\x33\xa7\x02\x5a" "\xfc\xcd\xd3\xe3\xa0\xeb\x0d\x80\x76\x96\x1f\x7d\x2c\x3d\xec\x14\xf0\xb6" "\xff\xd6\x82\xaa\x02\x59\x90\x63\x47\x15\x24\xfd\x33\x4c\x9a\xb4\x32\x1f" "\x22\xa8\x73\xdd\x9d\x5d\x2c\x51\x6a\x99\x40\xae\xa6\x44\x00\x20\x89\x5d" "\xa2\xcf\x30\x48\x2f\x1d\x65\xed\x6f\x95\x1f\x3d\x80\xfc\x25\x84\x89\x83" "\x75\x5c\xfb\xbd\x97\x54\x73\x32\xd5\x68\x1c\x3e\xe7\xfb\xa2\x23\x7d\x11" "\x46\x5d\xec\x45\x6d\xcb\x10\x1c\x18\x3d\x11\x5f\x44\x1c\x82\x81\x3d\xb8" "\x02\x5d\x86\x93\x5c\x3c\x56\xf8\x40\x6c\x73\x88\x23\x46\x38\x38\x79\xd3" "\x97\xbd\x90\x77\xfd\x52\xe9\xbe\x66\xc5\x84\x92\xa4\xe6\x41\x3d\x12\x58" "\xd4\xc9\xf1\x1a\x64\x5b\xeb\xfd\xbf\xf5\xe2\x6a\x1b\x8d\xac\x0a\x35\xe2" "\x1e\x3c\xf5\x3c\xca\x58\x22\x97\xcb\xea\xc2\x1f\x27\xbc\x6c\x80\x95\xfd" "\xd4\xee\xb1\xe3\x0a\x93\xf5\x63\xa2\x6d\xfd\xf0\x4d\x92\xc1\x9c\xcd\x75" "\x98\x8b\x44\x8e\x60\x06\x70\x59\x1c\x1e\xf0\x26\x90\xe4\xd5\x7e\xe7\x36" "\xda\x26\x70\x9e\x70\x59\xcb\xfd\x24\xb0\x02\x35\x3a\x6b\x53\x8f\x6b\x64" "\x7f\xa0\xc7\x65\xc0\x19\x3d\xe7\x72\x38\x8e\xe2\x45\xa0\x2e\x0e\xf1\xec" "\x1b\xc0\xd2\xe5\x83\x84\xc0\x99\xa9\xc0\xf5\xd2\x50\x72\xf8\x78\xb3\xa9" "\xf5\xa5\x75\x64\x87\xeb\xb7\x89\xc9\x52", 4096); *(uint32_t*)0x20002a58 = 5; *(uint32_t*)0x20002a5c = 2; *(uint32_t*)0x20002a60 = 8; *(uint32_t*)0x20002a64 = 5; *(uint32_t*)0x20002a68 = 0x87; *(uint32_t*)0x20002a6c = 0; *(uint64_t*)0x20002a70 = 0x7f; syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20002a00ul, /*len=*/0x78ul); // write$POST_SEND arguments: [ // fd: fd_rdma (resource) // buf: ptr[inout, post_send_cmd] { // post_send_cmd { // command: const = 0x1c (4 bytes) // in_words: bytesize4 = 0x8 (2 bytes) // out_words: bytesize4 = 0x1 (2 bytes) // response: ptr[out, post_send_resp] { // post_send_resp { // bad_wr: int32 = 0x0 (4 bytes) // } // } // qp_handle: qp_handle (resource) // wr_count: len = 0x0 (4 bytes) // sge_count: len = 0x0 (4 bytes) // wqe_size: const = 0x38 (4 bytes) // send_wr: array[kern_send_wr] { // } // sge: array[ib_uverbs_sge] { // } // } // } // len: len = 0x20 (8 bytes) // ] *(uint32_t*)0x20000980 = 0x1c; *(uint16_t*)0x20000984 = 8; *(uint16_t*)0x20000986 = 1; *(uint64_t*)0x20000988 = 0x200009c0; *(uint32_t*)0x20000990 = r[3]; *(uint32_t*)0x20000994 = 0; *(uint32_t*)0x20000998 = 0; *(uint32_t*)0x2000099c = 0x38; syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000980ul, /*len=*/0x20ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*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=*/0x21000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; do_sandbox_none(); return 0; }