// https://syzkaller.appspot.com/bug?id=65e2125dd6c9158bcc1c4b9fddc87c26a51af407 // 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 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; 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 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 void netlink_device_change(struct nlmsg* nlmsg, int sock, const char* name, bool up, const char* master, const void* mac, int macsize, const char* new_name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; hdr.ifi_index = if_nametoindex(name); netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr)); if (new_name) netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex)); } if (macsize) netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static int netlink_add_addr(struct nlmsg* nlmsg, int sock, const char* dev, const void* addr, int addrsize) { struct ifaddrmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ifa_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ifa_prefixlen = addrsize == 4 ? 24 : 120; hdr.ifa_scope = RT_SCOPE_UNIVERSE; hdr.ifa_index = if_nametoindex(dev); netlink_init(nlmsg, RTM_NEWADDR, NLM_F_CREATE | NLM_F_REPLACE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, IFA_LOCAL, addr, addrsize); netlink_attr(nlmsg, IFA_ADDRESS, addr, addrsize); return netlink_send(nlmsg, sock); } static void netlink_add_addr4(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in_addr in_addr; inet_pton(AF_INET, addr, &in_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in_addr, sizeof(in_addr)); if (err < 0) { } } static void netlink_add_addr6(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in6_addr in6_addr; inet_pton(AF_INET6, addr, &in6_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in6_addr, sizeof(in6_addr)); if (err < 0) { } } static void netlink_add_neigh(struct nlmsg* nlmsg, int sock, const char* name, const void* addr, int addrsize, const void* mac, int macsize) { struct ndmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ndm_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ndm_ifindex = if_nametoindex(name); hdr.ndm_state = NUD_PERMANENT; netlink_init(nlmsg, RTM_NEWNEIGH, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, NDA_DST, addr, addrsize); netlink_attr(nlmsg, NDA_LLADDR, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static struct nlmsg nlmsg; static int tunfd = -1; #define TUN_IFACE "syz_tun" #define LOCAL_MAC 0xaaaaaaaaaaaa #define REMOTE_MAC 0xaaaaaaaaaabb #define LOCAL_IPV4 "172.20.20.170" #define REMOTE_IPV4 "172.20.20.187" #define LOCAL_IPV6 "fe80::aa" #define REMOTE_IPV6 "fe80::bb" #define IFF_NAPI 0x0010 static void initialize_tun(void) { tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); if (tunfd == -1) { printf("tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n"); printf("otherwise fuzzing or reproducing might not work as intended\n"); return; } const int kTunFd = 200; if (dup2(tunfd, kTunFd) < 0) exit(1); close(tunfd); tunfd = kTunFd; struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, TUN_IFACE, IFNAMSIZ); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { exit(1); } char sysctl[64]; sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/accept_dad", TUN_IFACE); write_file(sysctl, "0"); sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/router_solicitations", TUN_IFACE); write_file(sysctl, "0"); int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); netlink_add_addr4(&nlmsg, sock, TUN_IFACE, LOCAL_IPV4); netlink_add_addr6(&nlmsg, sock, TUN_IFACE, LOCAL_IPV6); uint64_t macaddr = REMOTE_MAC; struct in_addr in_addr; inet_pton(AF_INET, REMOTE_IPV4, &in_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in_addr, sizeof(in_addr), &macaddr, ETH_ALEN); struct in6_addr in6_addr; inet_pton(AF_INET6, REMOTE_IPV6, &in6_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in6_addr, sizeof(in6_addr), &macaddr, ETH_ALEN); macaddr = LOCAL_MAC; netlink_device_change(&nlmsg, sock, TUN_IFACE, true, 0, &macaddr, ETH_ALEN, NULL); close(sock); } static int read_tun(char* data, int size) { if (tunfd < 0) return -1; int rv = read(tunfd, data, size); if (rv < 0) { if (errno == EAGAIN || errno == EBADFD) return -1; exit(1); } return rv; } static void flush_tun() { char data[1000]; while (read_tun(&data[0], sizeof(data)) != -1) { } } #define MAX_FDS 30 #define XT_TABLE_SIZE 1536 #define XT_MAX_ENTRIES 10 struct xt_counters { uint64_t pcnt, bcnt; }; struct ipt_getinfo { char name[32]; unsigned int valid_hooks; unsigned int hook_entry[5]; unsigned int underflow[5]; unsigned int num_entries; unsigned int size; }; struct ipt_get_entries { char name[32]; unsigned int size; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct ipt_replace { char name[32]; unsigned int valid_hooks; unsigned int num_entries; unsigned int size; unsigned int hook_entry[5]; unsigned int underflow[5]; unsigned int num_counters; struct xt_counters* counters; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct ipt_table_desc { const char* name; struct ipt_getinfo info; struct ipt_replace replace; }; static struct ipt_table_desc ipv4_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, {.name = "raw"}, {.name = "security"}, }; static struct ipt_table_desc ipv6_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, {.name = "raw"}, {.name = "security"}, }; #define IPT_BASE_CTL 64 #define IPT_SO_SET_REPLACE (IPT_BASE_CTL) #define IPT_SO_GET_INFO (IPT_BASE_CTL) #define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) struct arpt_getinfo { char name[32]; unsigned int valid_hooks; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_entries; unsigned int size; }; struct arpt_get_entries { char name[32]; unsigned int size; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_replace { char name[32]; unsigned int valid_hooks; unsigned int num_entries; unsigned int size; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_counters; struct xt_counters* counters; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_table_desc { const char* name; struct arpt_getinfo info; struct arpt_replace replace; }; static struct arpt_table_desc arpt_tables[] = { {.name = "filter"}, }; #define ARPT_BASE_CTL 96 #define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL) #define ARPT_SO_GET_INFO (ARPT_BASE_CTL) #define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1) static void checkpoint_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; table->replace.size = table->info.size; memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry)); memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow)); memcpy(table->replace.entrytable, entries.entrytable, table->info.size); } close(fd); } static void reset_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; if (table->info.valid_hooks == 0) continue; struct ipt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, level, IPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_arptables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; table->replace.size = table->info.size; memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry)); memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow)); memcpy(table->replace.entrytable, entries.entrytable, table->info.size); } close(fd); } static void reset_arptables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; if (table->info.valid_hooks == 0) continue; struct arpt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } else { } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, SOL_IP, ARPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } #define NF_BR_NUMHOOKS 6 #define EBT_TABLE_MAXNAMELEN 32 #define EBT_CHAIN_MAXNAMELEN 32 #define EBT_BASE_CTL 128 #define EBT_SO_SET_ENTRIES (EBT_BASE_CTL) #define EBT_SO_GET_INFO (EBT_BASE_CTL) #define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO + 1) #define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES + 1) #define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO + 1) struct ebt_replace { char name[EBT_TABLE_MAXNAMELEN]; unsigned int valid_hooks; unsigned int nentries; unsigned int entries_size; struct ebt_entries* hook_entry[NF_BR_NUMHOOKS]; unsigned int num_counters; struct ebt_counter* counters; char* entries; }; struct ebt_entries { unsigned int distinguisher; char name[EBT_CHAIN_MAXNAMELEN]; unsigned int counter_offset; int policy; unsigned int nentries; char data[0] __attribute__((aligned(__alignof__(struct ebt_replace)))); }; struct ebt_table_desc { const char* name; struct ebt_replace replace; char entrytable[XT_TABLE_SIZE]; }; static struct ebt_table_desc ebt_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "broute"}, }; static void checkpoint_ebtables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (size_t i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_INFO, &table->replace, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->replace.entries_size > sizeof(table->entrytable)) exit(1); table->replace.num_counters = 0; table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_ENTRIES, &table->replace, &optlen)) exit(1); } close(fd); } static void reset_ebtables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (unsigned i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; if (table->replace.valid_hooks == 0) continue; struct ebt_replace replace; memset(&replace, 0, sizeof(replace)); strcpy(replace.name, table->name); socklen_t optlen = sizeof(replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INFO, &replace, &optlen)) exit(1); replace.num_counters = 0; table->replace.entries = 0; for (unsigned h = 0; h < NF_BR_NUMHOOKS; h++) table->replace.hook_entry[h] = 0; if (memcmp(&table->replace, &replace, sizeof(table->replace)) == 0) { char entrytable[XT_TABLE_SIZE]; memset(&entrytable, 0, sizeof(entrytable)); replace.entries = entrytable; optlen = sizeof(replace) + replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_ENTRIES, &replace, &optlen)) exit(1); if (memcmp(table->entrytable, entrytable, replace.entries_size) == 0) continue; } for (unsigned j = 0, h = 0; h < NF_BR_NUMHOOKS; h++) { if (table->replace.valid_hooks & (1 << h)) { table->replace.hook_entry[h] = (struct ebt_entries*)table->entrytable + j; j++; } } table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (setsockopt(fd, SOL_IP, EBT_SO_SET_ENTRIES, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_net_namespace(void) { checkpoint_ebtables(); checkpoint_arptables(); checkpoint_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); checkpoint_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } static void reset_net_namespace(void) { reset_ebtables(); reset_arptables(); reset_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); reset_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } static void setup_common() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void setup_binderfs() { if (mkdir("/dev/binderfs", 0777)) { } if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) { } if (symlink("/dev/binderfs", "./binderfs")) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); 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 = 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); setup_common(); sandbox_common(); drop_caps(); if (unshare(CLONE_NEWNET)) { } write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535"); initialize_tun(); setup_binderfs(); 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_loop() { checkpoint_net_namespace(); } static void reset_loop() { reset_net_namespace(); } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); flush_tun(); } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } #define USLEEP_FORKED_CHILD (3 * 50 * 1000) static long handle_clone_ret(long ret) { if (ret != 0) { return ret; } usleep(USLEEP_FORKED_CHILD); syscall(__NR_exit, 0); while (1) { } } static long syz_clone(volatile long flags, volatile long stack, volatile long stack_len, volatile long ptid, volatile long ctid, volatile long tls) { long sp = (stack + stack_len) & ~15; long ret = (long)syscall(__NR_clone, flags & ~CLONE_VM, sp, ptid, ctid, tls); return handle_clone_ret(ret); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { setup_loop(); int iter = 0; for (;; iter++) { reset_loop(); 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 (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } void execute_one(void) { memcpy((void*)0x20000200, "\x2a\xd6\x2d\x9c\x24\x13\xe6\xe3\x26\xf5\x96\xc0\xa5\x76\x71\x23\xad" "\xfa\x98\x45\x4e\xa9\x7a\xaf\xdd\x48\x0f\xb2\x5b\x1c\xe0\xa6\xdd\xd1" "\x1f\x7e\x22\x23\xc6\x72\x36\x21\xc4\x40\xb2\x1d\x09\x83\x6e\x19\x08" "\xfa\x09\x58\x05\xe1\x71\x8d\xee\xd5\x80\x91\x1a\xca\x7f\xd7\xee\x78" "\xa4\xf8\x26\xe9\x5e\xa0", 74); syz_clone(/*flags=*/0x40000, /*stack=*/0x200000c0, /*stack_len=*/0, /*parentid=*/0, /*childtid=*/0, /*tls=*/0x20000200); memcpy( (void*)0x200013c0, "\x81\xb3\xaa\x0a\xcb\x13\x8b\x1d\x41\x3c\xa4\xb9\x8a\x37\x94\x0c\x47\xc8" "\xb3\x66\xb6\x2d\xc1\x18\x76\x28\x03\x06\xda\x7c\xd6\xba\x84\x1a\xfa\x63" "\x66\xd2\x3d\x14\x15\x9e\x14\xe8\xe7\xc4\x75\xad\x93\x99\x97\x96\xd3\xc4" "\x72\xd3\x3d\x8e\x0a\xbb\x08\xfc\x56\x3b\x3c\x2c\xbe\x7a\x3b\xd3\x28\x0e" "\x76\xd0\xc4\xcc\x50\xf0\x52\x44\x58\xe0\x74\xd0\xa6\xb5\x02\x4b\xe5\x12" "\xb0\x8b\xa0\xed\x6e\x92\xdf\x8b\x9f\x69\x81\xaf\x57\xa7\x97\xae\x50\xd2" "\x72\xe2\x5e\xda\xab\xc9\x65\x8e\xaa\x94\x5a\x77\x2b\xbe\x3d\xb9\x04\x66" "\x11\xaf\x8b\x53\xdb\xe7\x3b\x6b\x99\xb4\x4b\xe1\x22\x18\x36\x7f\x3d\xeb" "\x40\xbe\x62\x14\x15\x1b\x8e\x13\xa5\x16\xde\xa0\xb8\x01\xeb\x89\x19\xad" "\x7c\x54\x75\xb0\x89\x49\xd8\x5c\x4e\x0d\xe0\x0a\x92\xa0\x70\x2f\x18\xc1" "\xb4\x7e\x64\x5c\x71\x5f\xe2\x3c\x3a\x26\xc8\x00\xe9\xe2\xbe\x20\xaf\x41" "\x1e\xea\x3e\x18\xda\x7f\xa4\xf2\x56\x70\x87\x54\xa6\x18\xa0\xe8\x1b\xb5" "\x4a\xc4\x22\x1d\x49\x2d\xbf\x4f\xc7\x8e\x0d\x82\xa4\x0d\x6e\xc9\x34\xbc" "\x81\x9e\x2d\x2d\xfe\x4d\xf4\xab\x0d\x12\x32\x0e\x2a\xf1\x7e\xc3\x5b\x2f" "\xc5\x29\x9d\x39\xc6\x77\x1e\xc0\xe5\xaf\x75\x00\x87\x87\xf0\x03\xf9\x81" "\xc0\xf2\x57\x12\xeb\x0d\xff\x90\xb9\xa3\x66\x17\xa5\x5b\xbb\x39\x6f\x5c" "\x20\x7e\xdf\x98\xe6\x00\x69\xe4\x9c\x1d\x48\x2e\x10\x3c\x3c\xbb\xaf\x1b" "\x50\xcc\xb5\x5e\xe9\x96\xf5\xef\xff\x2e\x83\xf4\x87\x63\x55\x58\x85\x0c" "\xa8\xf4\x19\xf9\x85\x45\xb0\xed\xb6\xbb\x12\x08\x64\xa9\x52\x44\x0f\x37" "\xd3\xca\xfa\x4d\xcf\x99\x5a\x7e\xd7\x94\xd8\xf7\x57\xcd\x17\x1e\x6a\xe8" "\xb5\xcc\xce\x99\x36\x39\x83\x76\x3f\xce\x92\x0d\xf8\x3d\x4c\x47\x88\xb9" "\xc3\xfd\x6d\xbe\xa5\x4f\x50\x0d\x75\xbf\xf4\xec\xaf\xfe\x76\xaa\x7b\x38" "\x24\x07\xfa\x68\xb9\x4e\x95\x6e\x11\x12\x99\x36\xd9\x5f\xc8\x06\x3e\x2b" "\x15\xfe\x91\xb6\x30\x86\xc1\x10\xb4\xd4\x62\x4e\x90\x8e\x7d\x01\x10\x9e" "\xe5\x36\x8e\x23\x32\x46\xd0\x08\x6b\xfc\x22\xc0\x44\x02\xcf\xd2\x53\x8e" "\x38\x9b\x2f\xce\x86\x5f\x66\xc9\x65\xc3\xae\xc7\x15\x9d\x80\x7a\xfc\x89" "\x9f\x86\x2f\x97\x8f\x37\x3e\xc4\xde\x44\x8f\x16\x24\x3c\xd8\xbf\x1e\xbb" "\x61\x8f\x23\xda\xd4\x2e\x00\xc3\xf6\xa2\xfd\x02\x32\xe3\x92\x47\x16\x42" "\xb7\xb0\xe3\x6e\x1a\xd1\xe1\xe5\x56\x45\xa9\x74\xc7\x8b\xfa\x8d\x0b\x5d" "\x72\x2e\x1e\x31\x9a\xb8\x72\x5d\x91\xe3\x05\xc8\x4a\x71\xa2\xe9\xad\x4d" "\xbd\xd4\xf7\x28\x49\x30\xa9\xc2\x37\xb4\x9e\xc4\x93\x88\x34\xdc\xe0\x39" "\xc4\xc1\x96\x40\xeb\x47\x6e\xbb\x75\xac\x24\x1b\x2f\x69\x0f\x41\xe9\x93" "\x57\xe4\x32\xb5\x73\x60\x61\x0f\xa6\x26\x21\xd7\xdf\xe1\xda\x79\x00\x41" "\xe5\x71\x56\xd4\x8c\x19\x84\xaf\x28\xfd\xf7\x8a\x36\x94\xbb\x0f\xb3\x1d" "\x57\x9a\x55\x14\x07\x9e\x06\x5a\xd1\xef\x8b\x1e\x5c\x8b\x5e\x0d\xfa\xd9" "\x36\xe1\x11\xb9\xd3\xa8\x16\x0d\xf3\x08\x91\x3a\x32\xf8\xe0\x35\x52\x61" "\xe6\x9c\xa2\xab\xc1\xe2\x6b\x38\xe9\xe8\xa4\x49\x83\x67\xc0\xed\x8c\x80" "\x65\x83\x35\x7a\x43\x36\x94\x78\xc9\xd0\x42\x3a\x21\x0f\x06\x9e\x2b\x18" "\xf6\x91\x70\x6d\xdf\x05\x86\xd6\x3b\xc3\x5b\x99\xe7\x13\xda\x31\x7b\xeb" "\x93\xef\x2a\x84\x9f\x0f\xd3\x89\xee\x67\xb7\xbc\xce\x95\xa3\xa2\xdc\x7a" "\x9c\xb9\x1d\xe3\x30\x89\x46\xb2\x1d\xa4\x83\x69\x2a\xbf\x77\xa0\xf1\x5c" "\x61\x38\xf4\x39\x3b\x7b\x79\xb1\x4f\x75\x43\x1c\x30\xcf\xd5\x87\x51\xee" "\xdb\xad\xcf\x06\xa6\x02\x7a\x8c\x2f\xec\x4d\x0f\x50\x7a\x57\xa7\x94\x1c" "\x91\xef\x9f\x06\xbe\xc4\x79\xad\x72\x52\x14\x6f\x06\x5e\xf2\x2b\xe8\x6c" "\xed\xed\x9a\xad\x55\xe6\x31\x83\x9b\x31\x7d\x41\x25\x24\xb3\x89\x89\x7c" "\x69\x52\x40\x13\x44\x7f\x7d\xf0\x49\x49\xaa\x53\x6a\xe9\x89\xb6\xa6\x7d" "\x09\x9f\x88\x8c\x50\xa4\xc2\x8f\x55\xdd\x84\xaa\x69\xa5\xba\x5c\x96\x0d" "\x8f\xde\x3e\x65\xf6\x65\xc3\x9e\x52\xe0\xd2\x01\x55\xe7\x00\x7d\x1b\xa1" "\xf1\x1f\x02\xca\x20\xcc\xd5\x14\xa0\x75\xb3\x21\x7f\xb7\x7c\x8e\xa7\xa6" "\x1d\xb2\xae\x11\x3d\xbb\x2c\xac\xfa\xc2\x93\x41\x4b\xab\x9d\x3c\x24\x45" "\x0e\x64\xbd\xd3\xfe\x5a\xe8\xe3\xe4\x53\xc9\xa3\x23\xe1\x07\xe7\x57\xc9" "\xcc\x47\x51\xe5\xcb\x25\x9f\x49\x45\xc0\x90\x6f\xf4\x4d\x3e\x9d\x60\x45" "\x33\x3c\x6e\x1c\x3e\x48\x83\xa7\xdf\xe6\xbc\xd8\x08\x15\x04\x1b\x5c\xd5" "\x37\x86\x96\xcd\x26\x48\x65\x37\xd3\x9e\xf4\xa5\xac\x11\x66\xb5\xad\x11" "\x6a\xfe\x62\xd3\xbe\xbd\x92\x97\x4c\x1f\xd0\x76\x21\x7a\xba\x3b\x53\x48" "\xf2\x2d\x88\x11\x78\x12\xd0\xe0\x87\xbc\x5c\x99\xdd\xa7\x71\x24\x27\x31" "\xef\x86\xcb\x73\x4a\x8d\x6f\x14\xdb\x41\xb7\x8e\xa0\x59\x1b\xc1\x86\x05" "\x0d\x12\xfe\x8f\x81\x32\x55\x37\x90\xf7\x8e\x3f\x8a\x32\x45\xde\x9d\x8a" "\xee\x64\x24\xfd\xeb\xc1\xc7\x02\xc7\x49\x80\xc5\xe0\x4d\x0b\x36\x2c\x79" "\x8a\x4f\x36\x52\xb1\x48\x75\x6b\x83\xb2\xfd\x98\xba\x1c\xc7\x55\xbb\x42" "\xc0\xc8\x41\x48\x97\xcf\x2a\x69\xbc\x55\xaf\x67\x04\x0c\xe3\x8e\xc3\x5d" "\xe4\xa7\x41\x00\x42\x86\x8f\x82\x88\x55\xd7\x6c\x20\x3c\x5a\x4d\x14\xd5" "\x2d\x78\xf2\xe5\x23\xe8\xd9\xbd\xf0\xbe\x2b\x5d\x3d\x45\x30\x74\x18\x9a" "\x36\x8d\xfe\x82\x02\x07\x93\x6b\x3d\x77\xfe\x4e\xc2\x71\xf6\x76\xe0\xc6" "\xbf\x50\x69\x55\x67\x4d\xd6\xd1\x44\x60\x89\xda\xfb\x58\x02\xe2\xeb\x88" "\x84\x93\x00\x83\x10\xe1\xef\x2d\xc4\xf7\x24\xce\xe7\x20\x87\x56\x97\x7b" "\x48\xb9\xd9\x73\x6e\x72\xbd\xaa\x07\x79\xc2\x46\x02\x76\xe0\x4b\x22\xcb" "\xb6\xe4\xf5\x5c\x3a\x66\xa6\x75\xdd\x3e\xb6\x93\x04\x14\x73\x5e\x29\x0b" "\xba\x63\x2f\x09\x75\x22\xec\x83\xd4\xc4\x45\xce\x77\x2a\x86\xbe\xcb\x39" "\x5d\xc4\x1f\x5d\x06\xf3\x0e\xf0\xb6\x72\xcd\x9f\x81\xb7\x13\xc3\x25\x7c" "\x1e\xbf\x81\xdb\x15\x2c\x5b\xfc\x79\x90\xce\x14\x3d\xc2\x1c\x12\x22\xb4" "\x5b\xbc\xa9\xb8\x56\x0d\xad\x6b\x9d\x75\xb2\x06\x5a\xad\x1f\x11\xc6\xfa" "\xc7\x0d\xdb\x48\xd6\x5a\x29\x69\x45\x30\x68\x0c\xe3\x22\x2e\xb5\xb7\xe5" "\xee\x71\x13\xdc\xcc\xdb\xba\xba\x57\x6a\xa5\xa4\xc3\x1c\x7e\xfe\x31\x3b" "\xbf\x73\x2b\xa8\xf3\xb9\xbb\xdb\x07\xec\x0c\x74\x0e\x5f\xd1\xae\x56\x02" "\xd1\x35\xf4\x0f\x3e\x84\x65\xc8\x9f\xff\xf0\x0d\x43\x8a\x15\xd4\x13\x89" "\x90\x3e\xea\x13\x93\x8e\x0f\x92\x00\xe7\x2a\x1c\x72\x69\x5b\xbf\x42\x19" "\x11\x8e\x82\xa0\xca\x07\x54\x2a\x46\xcb\xe9\xd9\x2a\x18\x4b\xd7\xf3\x85" "\x5a\x49\x1e\xd1\xbe\x7b\xc3\x28\x2b\x46\xf4\xc7\xf4\x68\xa1\x03\x84\x3a" "\xf5\x5d\xb6\x08\x99\x14\xa8\xd1\x37\x5f\x87\xea\xde\x93\x79\x83\xe5\x52" "\x87\xae\x17\xd9\x70\x84\x2e\x79\x87\xa9\x89\x5b\x05\xb4\xac\x25\x85\x7d" "\xbb\x5a\x19\x9b\x99\xac\x74\xc4\x59\xbd\x27\x22\x1b\xb3\x65\x04\x41\x01" "\x17\xf7\xdf\x57\x59\xa8\x7d\xb9\x1e\x23\x03\x84\xe5\xd3\x46\xb2\x26\xb1" "\x19\x55\xb8\xb4\x25\xc3\x4b\xc1\xce\x89\xbf\xf9\x09\x53\x32\x35\xfe\x84" "\x18\xb4\x1d\x42\x17\xe8\x01\x2a\xd5\x15\xd8\x0d\x3c\x9a\xe7\xd2\x9c\xde" "\xe8\xc5\xc6\x64\x80\x12\x4b\x0a\x7a\x99\x99\xd9\xd6\x01\x51\xac\xde\x5b" "\x5a\xa5\x5c\x3b\xa2\x66\x91\x5e\x23\xb1\x87\xf9\x4b\xea\x8d\xf1\x7b\x45" "\x59\x2c\x31\x9b\xab\xd0\xee\x83\x6c\x90\x1e\xf3\x42\xd2\x0b\x45\xf6\xec" "\x72\x49\x7d\x3a\x91\xe4\x53\xed\x56\x75\xf6\xaa\xb3\x97\xd1\x4c\x2e\xf7" "\x10\x01\x1c\x47\x30\x88\x41\xd0\x60\x2d\x00\x2f\x1d\xfb\xfa\xda\xd2\x1c" "\x3c\xc5\x17\xac\x76\xab\x9d\xdf\xdd\x80\x8a\x25\x05\xfe\x20\x42\x1a\x97" "\x06\x68\xc0\x20\x35\x79\x53\x1e\xc0\x54\x71\x9e\x71\x18\x81\x96\x67\x46" "\x81\x0a\x1c\xd9\xd7\x03\x66\xab\x54\x5f\x60\x73\x45\x74\x28\x60\x6b\xfc" "\x1f\x68\xf1\xdd\xfb\x1b\x69\x78\x98\x8b\x7d\xe7\x89\xb4\x90\x35\xb0\x38" "\xd2\xaf\xa3\xb2\xb3\x65\x70\x9e\x20\x8b\x5f\xfb\xbd\x6c\x92\x20\x93\xbb" "\x0a\x74\xd5\x0f\x04\xef\x45\x90\xc0\x89\xc6\x9c\x7e\xb7\xd3\xf8\x9a\xd0" "\x0d\x5e\x3b\xac\x19\x44\xf9\xd7\xf1\xa4\x38\x71\x58\x5d\xb0\x19\x36\x68" "\x0b\xd4\x6c\x54\x6f\xde\xa5\x1c\x19\x73\x2f\xfe\xe9\xc3\xd5\x4e\x28\xad" "\x00\xfc\x82\x5e\xb6\x42\x8f\x20\x1b\x4d\xa3\xb9\x11\x43\x8c\x09\xd6\x43" "\x17\xed\xb2\xdc\xac\x41\x10\xfe\x08\x88\x81\x6c\x90\x21\xc7\x15\x0d\x55" "\x44\x59\x88\xef\x3e\x88\xab\x82\x88\x2b\x55\x9c\x64\x50\xbd\xcb\x5d\x8b" "\x12\x84\xd0\x37\xe3\x12\xce\xa7\x7a\x04\xbd\x4c\xbc\x42\x5d\x7b\xf4\x02" "\x13\x67\xc8\x2e\xf0\x76\x69\x23\xfb\x75\x41\x37\xca\x7b\xb7\x61\x30\x12" "\x38\x04\xdd\x28\xbc\x4b\xda\x12\x9b\x66\xb0\x7c\xf2\x14\x6a\x34\x73\xe7" "\x79\x89\xf3\x89\x91\xea\x5b\x6e\x4b\x5e\xe3\x82\xe1\x5b\xeb\xc6\xb4\x51" "\xe8\x7f\x88\xd9\x3b\xc9\xb3\xd1\x59\xbc\xf0\xa4\x7b\x52\x32\xe1\x46\xf6" "\x9c\x44\x00\x4c\x99\x29\x2d\x18\x9b\x81\xd3\x77\x3a\x5f\x0f\x84\xf5\x4d" "\x72\x21\x01\xd8\x75\xc1\x7d\x9b\x1f\xe5\xa9\x86\x9b\x20\xe6\x71\x1d\x1b" "\x1a\x26\xd8\x27\x54\xfd\x52\x0a\x7b\x3a\x27\xee\x8e\x4e\x1c\x7d\xc4\xce" "\xba\x15\x01\x72\xaf\x94\xbf\xf7\xf0\x85\x73\x33\x15\xf0\x39\xa8\x80\x25" "\xae\xa3\x4e\x0a\x5c\xff\x2b\x76\x58\xa0\x50\x03\xa2\xd8\x2a\x00\x58\x9e" "\xff\xee\xfb\x54\x2a\x25\x85\x44\x5d\x44\xae\xe4\x2a\x92\xbb\x76\x2f\x6f" "\x95\xfa\x90\x36\x1b\x60\x1c\x64\x46\x46\x1f\x9e\xae\x25\x5c\x9f\xcb\x6f" "\x62\xd1\x7f\x37\x5c\x0a\x49\x95\xd5\x09\xa4\x00\xa0\x2a\x68\x29\x1d\xfd" "\x8e\x05\xbd\x9e\x96\x3c\x37\xb1\xf6\xbc\x24\x8e\x06\x3c\xc7\xaa\xbc\x60" "\xc2\x82\x1a\x9e\x17\xb0\x12\x59\x3c\x10\x86\xca\x2c\x6c\x93\x44\xa7\x17" "\x74\xdb\x45\x31\xa7\xd4\xbc\xc8\xe6\x14\x5a\xa1\xb5\xd6\xa2\x75\xf7\x83" "\x3f\x3f\xc4\xe1\xf1\x88\x27\xfa\xca\x9c\x59\xf9\xfa\x59\xec\xe7\xbe\xce" "\x49\x32\x3c\x0e\x1a\xb5\x36\xf9\xe5\xc1\xe4\x38\x44\x99\x41\xb8\x78\xea" "\x47\xbe\xf1\xf3\x22\x8d\x62\x67\xeb\xad\x1a\x29\xb9\x3d\x28\x3e\x96\x8d" "\x2c\x46\xb0\x0b\x31\x0f\xd3\x87\xb4\x40\xc2\xd4\x02\x4a\xd0\xad\xed\xde" "\xb1\x35\x79\x08\xd4\x1f\x3f\xdb\xfc\x38\x5d\x91\x6d\x46\xc1\xb7\x9a\xa0" "\x69\x48\x3b\xc8\x97\xf7\x83\x28\x59\x4f\xe7\x4d\xdc\xb9\x87\xb7\x67\x17" "\xf9\x5e\xec\x7a\x54\xd8\x56\x71\xf8\x4d\xe5\x4d\x57\x64\xb4\xa5\xfb\x93" "\x29\x61\xae\x98\x96\x8b\x98\xb4\x92\xdf\x39\x0b\x1d\x79\x9c\xd5\x11\x6e" "\x21\xd3\x44\x6e\xf8\xc0\xa9\xcd\x18\xac\x0d\xbf\xe7\xd1\x0d\xbe\xb1\x01" "\x04\xbe\x49\x54\x4e\x5b\xc7\x70\x99\xad\xa5\xc8\x41\xce\x4d\x1b\x70\xb7" "\x92\x99\xe7\x2d\x86\x0e\x1e\xa5\x14\xac\x99\xf7\x7f\xf2\x4e\x51\xd7\x10" "\x05\x3c\x0d\x83\x5d\xdf\x32\x1a\x76\xdb\xb5\x69\xc4\xae\x75\x76\x3a\x6d" "\x19\x62\x8e\x4f\x8e\x84\x3a\x15\xf4\x0b\xaa\x90\x8c\x32\xed\x41\xe9\xe0" "\xef\xb6\x37\xb3\x27\x52\x10\x6f\x0e\xc2\x73\x73\x79\x92\x9e\x98\xc1\x02" "\x22\x4c\x33\x8e\x4f\x74\x30\x90\x97\x91\x17\x0f\xc2\x5a\x9d\x38\x34\x58" "\xb7\x86\xa3\x5a\x8d\x68\x9b\x03\xcc\xb4\x03\xa0\xe0\x70\xe6\xac\x36\x98" "\x29\xce\xcd\x52\xba\xbe\x7a\xab\xd7\xfd\x0f\xf3\x16\x29\x92\xcd\x89\x7f" "\x41\x23\x6c\xd0\xea\x47\x8f\x87\xdd\x20\x33\x49\x38\x2d\xae\x8a\x75\x0b" "\x51\x64\x35\xa7\x4b\x6d\x57\xed\x52\x31\x03\xa8\x43\xd5\x3c\xca\x78\xc1" "\x24\x57\x02\xac\xaa\xba\x40\x9e\x9b\xf6\x3d\x2c\x4a\x96\x96\x4b\x6f\x7d" "\x02\x74\xb3\x04\xae\xec\x44\x89\x0b\xed\x5d\xcd\x36\x61\xd6\xcf\x42\x18" "\xa2\xc3\x85\x44\xbd\xcf\xfd\x36\x33\x41\x38\xad\x9e\xcd\xcd\xdf\x3e\xef" "\x6f\xae\x64\x83\x1e\x9e\x3c\x11\xdd\xcb\x95\xd8\xd6\xd6\x4f\x1d\xc6\x35" "\xff\x3e\x87\xbd\x54\x18\xe6\x32\x1f\xb8\x52\x0d\xfa\x7f\xe1\xe8\xa9\x82" "\x80\x2f\x9c\x23\xa3\xf3\xda\xea\x7c\xae\xe1\xb6\xc9\xbf\xef\x19\xf6\xa1" "\x19\xc3\xc2\x0d\xd4\x0f\x1c\x14\x5d\x3a\x23\xd9\x7b\x54\x0c\x80\x65\xfd" "\xe6\x97\x08\xf5\xc1\x81\xb6\x72\xcf\x6c\xc3\xf7\x01\x63\x0c\x13\xb9\xd1" "\x76\x65\xe3\x71\x03\xde\x52\x30\x5c\x65\x16\x4c\xaa\xa9\x7f\x87\x86\x18" "\x66\x6e\x25\x4c\xfb\xe6\x98\x52\xe5\xcc\xe5\x3d\x31\x08\x6e\x09\xc9\xba" "\xf9\xde\x66\x69\x93\x53\x2d\xfd\x9a\x8d\x30\x63\x00\x7a\xe1\x42\x91\xfa" "\x42\x7d\xee\x8d\x8f\x48\x5b\x2d\x93\x04\x2d\xe9\xb1\x92\xa5\x9d\x0f\x7d" "\xe9\x6e\x4a\x1f\x8a\xf1\xe1\xc1\xfa\x42\x55\x94\x5e\xd1\x75\x30\xc8\xa9" "\x7e\x9b\xd9\x7d\x34\xf3\x9a\x16\xb4\x23\xcb\x84\x37\xa7\x25\x7e\x5e\x55" "\x5e\x32\xd4\x37\x79\x8f\x48\x00\x44\xfa\x63\x49\xb4\x42\xe7\x07\xb7\x2d" "\x53\xa0\xbb\xee\xf4\x5b\xa6\xa5\x14\x2c\x86\x59\xc5\x87\x5f\x87\xa5\xb0" "\x01\xa5\x77\xe8\x35\x97\x3c\xf3\x85\x85\x41\x84\xd7\xa4\x8c\x28\x55\xf9" "\x5c\xa5\x80\x8e\x70\x9f\x6e\x76\x0d\x25\x74\xc9\xcf\x65\xf3\x4e\xd8\xfe" "\xee\x12\x77\x23\xef\x26\x58\x21\xe9\x0d\xbf\xcb\xa9\x46\x0e\x50\xde\x24" "\x3d\x06\x11\xfb\x76\xe5\x4f\xc2\x5e\xa7\xe9\xba\x59\xbb\x55\x36\x48\x78" "\xdf\x2c\xab\xda\x7e\x84\x71\x80\xad\x62\xa2\xe3\xc5\xdb\x15\xb5\x39\x44" "\xf2\x4c\x13\x12\x10\xa7\x5b\x2b\x74\xd0\xba\x58\xce\x4c\x3a\x29\xec\xa3" "\x0c\xfd\xb1\x78\x77\x41\x01\xdf\xfb\x52\x48\xe0\xda\xe4\xca\x45\xd2\x05" "\xd3\x62\x9f\x8e\x12\xf1\x30\xea\xaf\x60\xef\x0e\x66\x1a\x0b\xf3\xfe\xce" "\xe3\x4d\x88\x00\x1c\xca\x15\x3c\xb5\xe5\x6d\x56\x83\x78\xd6\x19\x36\xf4" "\x18\xe7\x5f\x0e\x8b\x00\x60\x13\x45\x7b\x4f\x72\x9d\x35\x9f\x0e\xfd\x3e" "\x22\xc4\x14\xb9\x59\xa3\xf6\x54\xf7\xd0\xa4\xcd\x71\x46\x4b\x3f\xe1\x34" "\x22\x4a\x92\xdd\x79\xf4\xb0\x17\x23\xce\x03\xe4\x23\x44\x4a\x96\x84\x9c" "\x83\xd9\x19\x8d\x5e\x4d\xf1\xad\x85\x38\xaf\x75\x25\xee\xd1\x6b\x36\x74" "\xf3\x8e\xe6\xf6\xc3\xec\x47\x3c\xe9\xe6\x39\x78\x52\x1a\xd0\x58\x9c\x74" "\x6f\x52\x31\x1f\x54\xbf\x8f\xd4\xcb\x8c\x51\x4b\xc4\xaf\x27\x92\xd9\x19" "\x45\x20\x5b\xd8\xa3\x86\xdc\x4c\xc1\xce\xc0\x0f\x05\x82\xa8\x43\x74\x76" "\x6f\xe4\x80\x3a\xc5\xb4\xd7\xa9\xcc\x1c\x00\x83\x31\xc5\x2e\x04\x0c\x3e" "\xbb\x30\xec\x41\x43\x7a\xcc\x32\xfc\x94\xec\x61\xcf\xe3\x23\xac\xf3\xb9" "\x0b\x1f\xc3\xd8\xfc\x4f\x28\xc0\x7c\xe5\x0d\xcd\x25\xec\x2e\x0c\xc0\x04" "\x22\x8d\x01\xeb\x1a\x08\xa7\xb5\xe5\x47\x4f\xf0\x7a\x44\xa7\x4a\x20\xd2" "\x85\x37\x7a\x25\x8e\x4b\xbf\xae\x74\x29\x0a\xb2\xc0\x29\x07\x33\xd0\x59" "\xc8\x29\xb5\xea\xc8\x47\x51\x4d\x18\x50\xfd\xc1\x88\x47\x1e\x62\xa2\x1e" "\x5e\xb8\x37\xf3\x1b\xf2\x9c\x0c\x70\x12\xd3\x59\xe2\x6f\x3e\x03\x3d\xaf" "\xe7\xd9\xb8\x5f\xfc\x69\xb7\xe5\x89\x05\x55\xab\x87\x87\x19\x45\x85\xaa" "\x29\x52\x09\x76\x22\x83\xe7\x06\x55\x6d\x94\xaa\x78\x35\x09\xa5\x2b\x61" "\x8f\xb4\xb1\xf1\x30\xd7\xb0\x5a\x07\x03\x67\xb1\xa2\x1a\x32\x54\xb7\x4e" "\x1d\x33\x64\x7f\xaf\xa8\x2a\x23\x9e\x2f\x9f\xaa\xe6\x6a\x52\x48\x91\x45" "\x7c\x1d\xee\x69\xa5\xfe\xca\x8f\x55\x5f\xb7\x4f\xf3\xa8\x54\x8c\x57\x65" "\xbe\x63\x72\x8d\x1b\x17\x5a\xc4\x66\x28\x7f\x7b\xe0\x7b\xf6\x41\xa7\x5f" "\xa0\xf7\xa2\x02\x56\x5e\x08\x05\x51\x35\x72\xdb\x0a\x3b\xb9\x0f\xcf\xb2" "\x84\xbb\xdb\x40\x62\xb1\x6d\x01\x57\x51\x7d\x8a\x78\x3f\xaa\xdf\x00\xdd" "\x37\x0f\x8d\x24\x08\x4b\xbf\xfd\x5c\xfc\x27\x2a\x72\x5f\xb5\x05\xfd\xa8" "\x94\x55\x3f\x00\x2a\x4f\x8a\xf8\xbc\xb3\x39\xb3\xc2\x3f\x02\x8b\xd1\x18" "\x07\x99\x5e\x1f\x4b\x49\x31\xc2\xd6\x87\x47\x21\x95\x0f\x73\x9c\xd5\x64" "\xa4\xfd\xf7\xa8\x13\x42\x70\xf1\xad\x33\xdd\x3a\x41\xac\x95\xfb\xd2\x18" "\xe9\x8e\x49\x92\x5c\xef\xef\x5e\xb1\xb3\xfd\x4c\x27\xf9\xc5\x37\x4d\xf6" "\x5a\x28\x7a\xb1\x37\x74\xb6\x72\x8e\x5f\x9d\xf7\x74\x3a\xc7\x9a\x42\x95" "\x47\xf1\xe1\xbc\x5f\x21\xad\x74\xad\xf1\x42\xb9\x8a\xb3\x86\x8d\x49\xbc" "\x87\xae\x2f\x94\x3b\x5a\x43\xc1\x44\xcd\x9b\xc3\x4a\x48\xf7\x9b\x99\x29" "\xec\xe1\xd6\x9d\x23\xc3\xce\xf0\xcf\x22\x30\x41\x10\xa0\xa8\x2a\xad\x80" "\xe7\x2c\x40\x8a\x06\xf9\xd2\x0b\xbc\x7a\x9f\xd9\x08\x3b\x13\x41\xa9\x44" "\x46\xe8\x39\xcd\x93\x53\x8d\x16\xc3\x36\x17\x9c\xfd\x83\xf8\x6f\x6a\x6f" "\x12\xa7\x82\x31\x03\x5c\xbf\x28\x76\xa1\xa9\x8b\x53\xd0\x37\x53\xb7\xdf" "\x8c\xb7\x78\x03\xde\xc1\x00\xb9\x4c\xf9\xd2\x63\x67\xa1\x40\xf5\x35\x50" "\xe5\x9e\xb4\x98\xc8\x47\xcf\xc8\xa4\x54\x44\x32\x69\x94\x25\x9d\x18\x33" "\x03\x7f\xca\xa8\x89\xde\x24\x85\xf5\xb7\x98\xdc\xee\x00\x63\x91\xcc\x08" "\x2c\xf1\x8b\xbd\x47\x3d\x9a\x2e\x39\x90\x68\x92\x71\x1b\xb9\x59\x55\x78" "\xf1\x45\xe5\x7e\x3b\x79\x79\x7d\x6a\x5a\x50\x58\x28\xa9\x06\xf3\x5e\x56" "\x4b\x61\xec\xd3\x26\xaf\x6a\x10\xf9\x58\x55\xb0\xa1\x8c\x41\xf1\xe7\x16" "\x22\xb1\xb1\x66\xcc\xb8\xb7\x18\xc5\x19\x35\x22\xaa\x4d\x1f\xc1\xe7\x5b" "\xb0\xa9\xc2\xb6\xab\x49\x16\x8d\xb4\x1e\x63\xbd\xf1\xb9\x7d\x14\x3a\x09" "\xb2\x1a\x28\x56\xbc\x66\x13\x07\x58\xd9\x1e\x81\x18\xa9\x16\x37\x12\xc4" "\xea\x6b\x56\xc4\xd6\xef\x8a\x85\x0d\xdc\x81\x6e\xf6\x65\x46\x8b\x9f\xa0" "\x96\xf1\x71\x6d\xf6\x7f\x85\xb6\x9e\xeb\x0b\x64\x9f\x20\xfb\xc4\x6d\x86" "\xe6\x58\xd7\x61\x0a\xe0\x50\xe3\xed\xd6\x24\xa0\x7b\xf9\x6b\xc5\x8a\x70" "\x72\xff\xce\xff\x7d\x3e\x4c\x8f\x41\xf1\x6d\x5f\x99\xfd\x91\x40\x2e\x2f" "\x33\x45\x51\xb6\xfa\x0d\x26\x76\xc3\xcc\x19\x00\xe5\xff\x75\xb6\xe3\xf4" "\xd8\x21\x54\x9c\xad\xd8\xdd\x8b\xe4\xd8\x6e\xfc\x4c\xd2\xde\x5c\x46\x59" "\xd6\x9e\xe5\xe1\x24\x0c\xae\x57\xf7\x0a\x5e\x78\x5b\x62\x17\x18\x93\x70" "\xcd\xe5\xaa\xec\xa1\x1b\x49\x6a\x61\x02\x1d\x5c\xa3\x62\x66\xcd\x13\xd4" "\x46\x43\x57\xa1\xae\x69\x52\x70\x48\x77\xcd\x87\xfd\x14\xf9\xdd\x6a\x08" "\x90\x97\x98\x81\x50\x43\x0c\x3b\xe6\xee\xba\x91\xf6\x26\xf5\xe3\xa8\xd4" "\x70\xb0\x3c\x57\x6e\x64\xf9\x1b\xf5\x6f\xbe\x11\xba\xf1\x50\xcb\xab\x5d" "\x52\x67\x5c\x9c\x96\x5f\xae\x30\xeb\x24\x1f\xc8\x0b\xda\x6b\x7c\xcd\xa3" "\xa3\x54\x18\x79\x02\x2e\xf0\x44\xf7\x62\xf7\xc5\xf6\x6c\x31\x37\x71\x28" "\x0d\xa6\x59\x0c\xa6\xea\xe1\x1d\xa9\xcb\x93\xb1\xc7\xf7\x12\x31\xb9\xa7" "\x64\xc5\x01\x6e\xce\x62\x0a\x7f\xa6\x15\x92\x2a\xf1\x26\x1b\x76\xc8\x61" "\x81\x44\x86\xc0\xf2\x9e\xe5\x6c\xfe\xfe\x21\xe3\x41\x25\x6b\xed\x0d\x59" "\xce\x0f\x91\x43\x25\x4f\xa8\x37\x2c\x1b\xb1\x71\x03\xf5\xf3\xe9\xb3\x57" "\xb3\x5d\xe4\x97\x0b\xd5\xae\x32\xd9\x15\x1b\x3a\xcc\x7e\xc8\xf6\xaa\xa3" "\x3a\x41\xe3\x00\x5e\x6c\xf6\xf2\x78\x13\x2a\x84\x86\xb5\x50\x7b\xba\xf1" "\x61\xdb\xa4\xe1\x37\x94\x70\x84\xc0\xad\x04\x0d\x88\xa1\xaf\x14\x94\xb0" "\x10\x27\xb5\x1d\xee\xf0\x60\xf7\x20\xd4\x26\x7d\x01\x5b\xdd\x23\x70\x01" "\x20\x15\x4a\xa6\xc0\x16\x23\x34\xad\x56\x81\xa5\x8b\x45\xa4\x9c\xed\x1e" "\x12\x65\x7c\x8a\x60\x4a\xc6\xaa\x56\x5d\xab\x0b\x47\x63\x44\xdd\x30\xfa" "\x21\xa1\xeb\x09\x79\x6f\x3d\xac\xed\x4b", 4096); syz_clone(/*flags=*/0x20100, /*stack=*/0x200002c0, /*stack_len=*/0, /*parentid=*/0, /*childtid=*/0, /*tls=*/0x200013c0); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { do_sandbox_none(); } } sleep(1000000); return 0; }