// https://syzkaller.appspot.com/bug?id=7460667e2e38fd3c09ade09fea7c1dc0757b757d // 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 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 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 void netlink_add_device_impl(struct nlmsg* nlmsg, const char* type, const char* name, bool up) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; netlink_init(nlmsg, RTM_NEWLINK, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); if (name) netlink_attr(nlmsg, IFLA_IFNAME, name, strlen(name)); netlink_nest(nlmsg, IFLA_LINKINFO); netlink_attr(nlmsg, IFLA_INFO_KIND, type, strlen(type)); } static void netlink_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 struct nlmsg nlmsg; static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2) { if (a0 == 0xc || a0 == 0xb) { char buf[128]; sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2); return open(buf, O_RDWR, 0); } else { unsigned long nb = a1; char buf[1024]; char* hash; strncpy(buf, (char*)a0, sizeof(buf) - 1); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(nb % 10); nb /= 10; } return open(buf, a2, 0); } } 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"); } #define NL802154_CMD_SET_SHORT_ADDR 11 #define NL802154_ATTR_IFINDEX 3 #define NL802154_ATTR_SHORT_ADDR 10 static const char* setup_802154() { const char* error = NULL; int sock_generic = -1; int sock_route = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock_route == -1) { error = "socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE) failed"; goto fail; } sock_generic = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock_generic == -1) { error = "socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC) failed"; goto fail; } { int nl802154_family_id = netlink_query_family_id(&nlmsg, sock_generic, "nl802154", true); if (nl802154_family_id < 0) { error = "netlink_query_family_id failed"; goto fail; } for (int i = 0; i < 2; i++) { char devname[] = "wpan0"; devname[strlen(devname) - 1] += i; uint64_t hwaddr = 0xaaaaaaaaaaaa0002 + (i << 8); uint16_t shortaddr = 0xaaa0 + i; int ifindex = if_nametoindex(devname); struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL802154_CMD_SET_SHORT_ADDR; netlink_init(&nlmsg, nl802154_family_id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, NL802154_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(&nlmsg, NL802154_ATTR_SHORT_ADDR, &shortaddr, sizeof(shortaddr)); if (netlink_send(&nlmsg, sock_generic) < 0) { error = "NL802154_CMD_SET_SHORT_ADDR failed"; goto fail; } netlink_device_change(&nlmsg, sock_route, devname, true, 0, &hwaddr, sizeof(hwaddr), 0); if (i == 0) { netlink_add_device_impl(&nlmsg, "lowpan", "lowpan0", false); netlink_done(&nlmsg); netlink_attr(&nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); if (netlink_send(&nlmsg, sock_route) < 0) { error = "netlink: adding device lowpan0 type lowpan link wpan0"; goto fail; } } } } fail: close(sock_route); close(sock_generic); return error; } 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(); 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_open_dev$evdev arguments: [ // dev: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 69 6e 70 75 74 2f 65 76 65 6e 74 23 00} // (length 0x12) // } // id: intptr = 0x40 (8 bytes) // flags: open_flags = 0x0 (8 bytes) // ] // returns fd_evdev memcpy((void*)0x2000000000c0, "/dev/input/event#\000", 18); res = -1; res = syz_open_dev(/*dev=*/0x2000000000c0, /*id=*/0x40, /*flags=*/0); if (res != -1) r[0] = res; // ioctl$EVIOCSFF arguments: [ // fd: fd_evdev (resource) // cmd: const = 0x40304580 (4 bytes) // arg: ptr[in, ff_effect] { // ff_effect { // type: ff_effect_type = 0x50 (2 bytes) // id: int16 = 0xffff (2 bytes) // dir: int16 = 0x6 (2 bytes) // trigger: ff_trigger { // button: int16 = 0x0 (2 bytes) // interv: int16 = 0x0 (2 bytes) // } // replay: ff_replay { // len: int16 = 0x0 (2 bytes) // delay: int16 = 0x0 (2 bytes) // } // pad = 0x0 (2 bytes) // u: union ff_effect_u { // cond: array[ff_condition_effect] { // ff_condition_effect { // rsatur: int16 = 0x0 (2 bytes) // lsatur: int16 = 0x0 (2 bytes) // rcoeff: int16 = 0x0 (2 bytes) // lcoeff: int16 = 0x0 (2 bytes) // dead: int16 = 0x0 (2 bytes) // center: int16 = 0x0 (2 bytes) // } // ff_condition_effect { // rsatur: int16 = 0x0 (2 bytes) // lsatur: int16 = 0x0 (2 bytes) // rcoeff: int16 = 0x0 (2 bytes) // lcoeff: int16 = 0x0 (2 bytes) // dead: int16 = 0x0 (2 bytes) // center: int16 = 0x0 (2 bytes) // } // } // } // } // } // ] *(uint16_t*)0x200000000300 = 0x50; *(uint16_t*)0x200000000302 = -1; *(uint16_t*)0x200000000304 = 6; *(uint16_t*)0x200000000306 = 0; *(uint16_t*)0x200000000308 = 0; *(uint16_t*)0x20000000030a = 0; *(uint16_t*)0x20000000030c = 0; *(uint16_t*)0x200000000310 = 0; *(uint16_t*)0x200000000312 = 0; *(uint16_t*)0x200000000314 = 0; *(uint16_t*)0x200000000316 = 0; *(uint16_t*)0x200000000318 = 0; *(uint16_t*)0x20000000031a = 0; *(uint16_t*)0x20000000031c = 0; *(uint16_t*)0x20000000031e = 0; *(uint16_t*)0x200000000320 = 0; *(uint16_t*)0x200000000322 = 0; *(uint16_t*)0x200000000324 = 0; *(uint16_t*)0x200000000326 = 0; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x40304580, /*arg=*/0x200000000300ul); // openat$uinput arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 75 69 6e 70 75 74 00} (length 0xc) // } // flags: uinput_open_flags = 0x802 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_uinput memcpy((void*)0x200000000040, "/dev/uinput\000", 12); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000040ul, /*flags=O_RDWR_NONBLOCK*/ 0x802, /*mode=*/0); if (res != -1) r[1] = res; // ioctl$UI_SET_FFBIT arguments: [ // fd: fd_uinput (resource) // cmd: const = 0x4004556b (4 bytes) // arg: intptr = 0x51 (8 bytes) // ] syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x4004556b, /*arg=*/0x51ul); // write$uinput_user_dev arguments: [ // fd: fd_uinput (resource) // data: ptr[in, uinput_user_dev] { // uinput_user_dev { // name: buffer: {73 79 7a 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} (length 0x50) id: // input_id { // bustype: int16 = 0x0 (2 bytes) // vendor: int16 = 0x0 (2 bytes) // product: int16 = 0x0 (2 bytes) // version: int16 = 0x0 (2 bytes) // } // ff_effects_max: int32 = 0x35 (4 bytes) // absmax: array[int32] { // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x1 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x3 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xffffffff (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x6d37 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // } // absmin: array[int32] { // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xfff (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x4 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x800 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xffffffff (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xfffffffe (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x4 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // } // absfuzz: array[int32] { // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x200000 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x7 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xfffffffd (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x20 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xffffffff (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x100 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xfffffffd (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x2000 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x1 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // } // absflat: array[int32] { // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xfffffffe (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x5 (4 bytes) // int32 = 0x7 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x7 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0xfffffffc (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x3 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x2 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // int32 = 0x0 (4 bytes) // } // } // } // len: len = 0x45c (8 bytes) // ] memcpy((void*)0x200000000800, "syz1\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000", 80); *(uint16_t*)0x200000000850 = 0; *(uint16_t*)0x200000000852 = 0; *(uint16_t*)0x200000000854 = 0; *(uint16_t*)0x200000000856 = 0; *(uint32_t*)0x200000000858 = 0x35; *(uint32_t*)0x20000000085c = 0; *(uint32_t*)0x200000000860 = 0; *(uint32_t*)0x200000000864 = 0; *(uint32_t*)0x200000000868 = 0; *(uint32_t*)0x20000000086c = 0; *(uint32_t*)0x200000000870 = 0; *(uint32_t*)0x200000000874 = 0; *(uint32_t*)0x200000000878 = 0; *(uint32_t*)0x20000000087c = 0; *(uint32_t*)0x200000000880 = 0; *(uint32_t*)0x200000000884 = 0; *(uint32_t*)0x200000000888 = 0; *(uint32_t*)0x20000000088c = 0; *(uint32_t*)0x200000000890 = 0; *(uint32_t*)0x200000000894 = 0; *(uint32_t*)0x200000000898 = 0; *(uint32_t*)0x20000000089c = 0; *(uint32_t*)0x2000000008a0 = 0; *(uint32_t*)0x2000000008a4 = 0; *(uint32_t*)0x2000000008a8 = 0; *(uint32_t*)0x2000000008ac = 0; *(uint32_t*)0x2000000008b0 = 0; *(uint32_t*)0x2000000008b4 = 0; *(uint32_t*)0x2000000008b8 = 0; *(uint32_t*)0x2000000008bc = 0; *(uint32_t*)0x2000000008c0 = 0; *(uint32_t*)0x2000000008c4 = 0; *(uint32_t*)0x2000000008c8 = 0; *(uint32_t*)0x2000000008cc = 0; *(uint32_t*)0x2000000008d0 = 0; *(uint32_t*)0x2000000008d4 = 0; *(uint32_t*)0x2000000008d8 = 0; *(uint32_t*)0x2000000008dc = 0; *(uint32_t*)0x2000000008e0 = 1; *(uint32_t*)0x2000000008e4 = 0; *(uint32_t*)0x2000000008e8 = 0; *(uint32_t*)0x2000000008ec = 0; *(uint32_t*)0x2000000008f0 = 0; *(uint32_t*)0x2000000008f4 = 0; *(uint32_t*)0x2000000008f8 = 3; *(uint32_t*)0x2000000008fc = 0; *(uint32_t*)0x200000000900 = 0; *(uint32_t*)0x200000000904 = 0; *(uint32_t*)0x200000000908 = 0; *(uint32_t*)0x20000000090c = 0; *(uint32_t*)0x200000000910 = 0; *(uint32_t*)0x200000000914 = 0; *(uint32_t*)0x200000000918 = 0; *(uint32_t*)0x20000000091c = -1; *(uint32_t*)0x200000000920 = 0; *(uint32_t*)0x200000000924 = 0; *(uint32_t*)0x200000000928 = 0; *(uint32_t*)0x20000000092c = 0; *(uint32_t*)0x200000000930 = 0; *(uint32_t*)0x200000000934 = 0x6d37; *(uint32_t*)0x200000000938 = 0; *(uint32_t*)0x20000000093c = 0; *(uint32_t*)0x200000000940 = 0; *(uint32_t*)0x200000000944 = 0; *(uint32_t*)0x200000000948 = 0; *(uint32_t*)0x20000000094c = 0; *(uint32_t*)0x200000000950 = 0; *(uint32_t*)0x200000000954 = 0; *(uint32_t*)0x200000000958 = 0; *(uint32_t*)0x20000000095c = 0; *(uint32_t*)0x200000000960 = 0; *(uint32_t*)0x200000000964 = 0; *(uint32_t*)0x200000000968 = 0; *(uint32_t*)0x20000000096c = 0xfff; *(uint32_t*)0x200000000970 = 0; *(uint32_t*)0x200000000974 = 0; *(uint32_t*)0x200000000978 = 0; *(uint32_t*)0x20000000097c = 0; *(uint32_t*)0x200000000980 = 0; *(uint32_t*)0x200000000984 = 0; *(uint32_t*)0x200000000988 = 0; *(uint32_t*)0x20000000098c = 0; *(uint32_t*)0x200000000990 = 0; *(uint32_t*)0x200000000994 = 0; *(uint32_t*)0x200000000998 = 0; *(uint32_t*)0x20000000099c = 0; *(uint32_t*)0x2000000009a0 = 0; *(uint32_t*)0x2000000009a4 = 0; *(uint32_t*)0x2000000009a8 = 4; *(uint32_t*)0x2000000009ac = 0; *(uint32_t*)0x2000000009b0 = 0; *(uint32_t*)0x2000000009b4 = 0x800; *(uint32_t*)0x2000000009b8 = 0; *(uint32_t*)0x2000000009bc = -1; *(uint32_t*)0x2000000009c0 = 0; *(uint32_t*)0x2000000009c4 = 0; *(uint32_t*)0x2000000009c8 = 0; *(uint32_t*)0x2000000009cc = 0; *(uint32_t*)0x2000000009d0 = 0; *(uint32_t*)0x2000000009d4 = 0; *(uint32_t*)0x2000000009d8 = 0; *(uint32_t*)0x2000000009dc = 0; *(uint32_t*)0x2000000009e0 = 0; *(uint32_t*)0x2000000009e4 = 0; *(uint32_t*)0x2000000009e8 = 0; *(uint32_t*)0x2000000009ec = 0; *(uint32_t*)0x2000000009f0 = 0; *(uint32_t*)0x2000000009f4 = 0xfffffffe; *(uint32_t*)0x2000000009f8 = 0; *(uint32_t*)0x2000000009fc = 0; *(uint32_t*)0x200000000a00 = 0; *(uint32_t*)0x200000000a04 = 0; *(uint32_t*)0x200000000a08 = 0; *(uint32_t*)0x200000000a0c = 0; *(uint32_t*)0x200000000a10 = 0; *(uint32_t*)0x200000000a14 = 0; *(uint32_t*)0x200000000a18 = 0; *(uint32_t*)0x200000000a1c = 0; *(uint32_t*)0x200000000a20 = 0; *(uint32_t*)0x200000000a24 = 0; *(uint32_t*)0x200000000a28 = 0; *(uint32_t*)0x200000000a2c = 0; *(uint32_t*)0x200000000a30 = 0; *(uint32_t*)0x200000000a34 = 0; *(uint32_t*)0x200000000a38 = 0; *(uint32_t*)0x200000000a3c = 0; *(uint32_t*)0x200000000a40 = 0; *(uint32_t*)0x200000000a44 = 0; *(uint32_t*)0x200000000a48 = 0; *(uint32_t*)0x200000000a4c = 0; *(uint32_t*)0x200000000a50 = 4; *(uint32_t*)0x200000000a54 = 0; *(uint32_t*)0x200000000a58 = 0; *(uint32_t*)0x200000000a5c = 0; *(uint32_t*)0x200000000a60 = 0; *(uint32_t*)0x200000000a64 = 0; *(uint32_t*)0x200000000a68 = 0; *(uint32_t*)0x200000000a6c = 0; *(uint32_t*)0x200000000a70 = 0; *(uint32_t*)0x200000000a74 = 0; *(uint32_t*)0x200000000a78 = 0; *(uint32_t*)0x200000000a7c = 0; *(uint32_t*)0x200000000a80 = 0; *(uint32_t*)0x200000000a84 = 0; *(uint32_t*)0x200000000a88 = 0; *(uint32_t*)0x200000000a8c = 0x200000; *(uint32_t*)0x200000000a90 = 0; *(uint32_t*)0x200000000a94 = 0; *(uint32_t*)0x200000000a98 = 0; *(uint32_t*)0x200000000a9c = 0; *(uint32_t*)0x200000000aa0 = 0; *(uint32_t*)0x200000000aa4 = 7; *(uint32_t*)0x200000000aa8 = 0; *(uint32_t*)0x200000000aac = 0xfffffffd; *(uint32_t*)0x200000000ab0 = 0; *(uint32_t*)0x200000000ab4 = 0; *(uint32_t*)0x200000000ab8 = 0; *(uint32_t*)0x200000000abc = 0x20; *(uint32_t*)0x200000000ac0 = 0; *(uint32_t*)0x200000000ac4 = -1; *(uint32_t*)0x200000000ac8 = 0; *(uint32_t*)0x200000000acc = 0; *(uint32_t*)0x200000000ad0 = 0x100; *(uint32_t*)0x200000000ad4 = 0; *(uint32_t*)0x200000000ad8 = 0; *(uint32_t*)0x200000000adc = 0; *(uint32_t*)0x200000000ae0 = 0; *(uint32_t*)0x200000000ae4 = 0; *(uint32_t*)0x200000000ae8 = 0; *(uint32_t*)0x200000000aec = 0; *(uint32_t*)0x200000000af0 = 0; *(uint32_t*)0x200000000af4 = 0; *(uint32_t*)0x200000000af8 = 0; *(uint32_t*)0x200000000afc = 0xfffffffd; *(uint32_t*)0x200000000b00 = 0; *(uint32_t*)0x200000000b04 = 0; *(uint32_t*)0x200000000b08 = 0x2000; *(uint32_t*)0x200000000b0c = 0; *(uint32_t*)0x200000000b10 = 0; *(uint32_t*)0x200000000b14 = 0; *(uint32_t*)0x200000000b18 = 0; *(uint32_t*)0x200000000b1c = 0; *(uint32_t*)0x200000000b20 = 0; *(uint32_t*)0x200000000b24 = 0; *(uint32_t*)0x200000000b28 = 0; *(uint32_t*)0x200000000b2c = 0; *(uint32_t*)0x200000000b30 = 0; *(uint32_t*)0x200000000b34 = 1; *(uint32_t*)0x200000000b38 = 0; *(uint32_t*)0x200000000b3c = 0; *(uint32_t*)0x200000000b40 = 0; *(uint32_t*)0x200000000b44 = 0; *(uint32_t*)0x200000000b48 = 0; *(uint32_t*)0x200000000b4c = 0; *(uint32_t*)0x200000000b50 = 0; *(uint32_t*)0x200000000b54 = 0; *(uint32_t*)0x200000000b58 = 0; *(uint32_t*)0x200000000b5c = 0; *(uint32_t*)0x200000000b60 = 0; *(uint32_t*)0x200000000b64 = 0; *(uint32_t*)0x200000000b68 = 0; *(uint32_t*)0x200000000b6c = 0; *(uint32_t*)0x200000000b70 = 0; *(uint32_t*)0x200000000b74 = 0; *(uint32_t*)0x200000000b78 = 0; *(uint32_t*)0x200000000b7c = 0; *(uint32_t*)0x200000000b80 = 0; *(uint32_t*)0x200000000b84 = 0; *(uint32_t*)0x200000000b88 = 0xfffffffe; *(uint32_t*)0x200000000b8c = 0; *(uint32_t*)0x200000000b90 = 0; *(uint32_t*)0x200000000b94 = 5; *(uint32_t*)0x200000000b98 = 7; *(uint32_t*)0x200000000b9c = 0; *(uint32_t*)0x200000000ba0 = 0; *(uint32_t*)0x200000000ba4 = 0; *(uint32_t*)0x200000000ba8 = 0; *(uint32_t*)0x200000000bac = 7; *(uint32_t*)0x200000000bb0 = 0; *(uint32_t*)0x200000000bb4 = 0; *(uint32_t*)0x200000000bb8 = 0; *(uint32_t*)0x200000000bbc = 0; *(uint32_t*)0x200000000bc0 = 0; *(uint32_t*)0x200000000bc4 = 0; *(uint32_t*)0x200000000bc8 = 0; *(uint32_t*)0x200000000bcc = 0; *(uint32_t*)0x200000000bd0 = 0; *(uint32_t*)0x200000000bd4 = 0; *(uint32_t*)0x200000000bd8 = 0xfffffffc; *(uint32_t*)0x200000000bdc = 0; *(uint32_t*)0x200000000be0 = 3; *(uint32_t*)0x200000000be4 = 0; *(uint32_t*)0x200000000be8 = 0; *(uint32_t*)0x200000000bec = 0; *(uint32_t*)0x200000000bf0 = 0; *(uint32_t*)0x200000000bf4 = 0; *(uint32_t*)0x200000000bf8 = 0; *(uint32_t*)0x200000000bfc = 0; *(uint32_t*)0x200000000c00 = 0; *(uint32_t*)0x200000000c04 = 0; *(uint32_t*)0x200000000c08 = 0; *(uint32_t*)0x200000000c0c = 0; *(uint32_t*)0x200000000c10 = 0; *(uint32_t*)0x200000000c14 = 0; *(uint32_t*)0x200000000c18 = 0; *(uint32_t*)0x200000000c1c = 2; *(uint32_t*)0x200000000c20 = 0; *(uint32_t*)0x200000000c24 = 0; *(uint32_t*)0x200000000c28 = 0; *(uint32_t*)0x200000000c2c = 0; *(uint32_t*)0x200000000c30 = 0; *(uint32_t*)0x200000000c34 = 0; *(uint32_t*)0x200000000c38 = 0; *(uint32_t*)0x200000000c3c = 0; *(uint32_t*)0x200000000c40 = 0; *(uint32_t*)0x200000000c44 = 0; *(uint32_t*)0x200000000c48 = 0; *(uint32_t*)0x200000000c4c = 0; *(uint32_t*)0x200000000c50 = 0; *(uint32_t*)0x200000000c54 = 0; *(uint32_t*)0x200000000c58 = 0; syscall(__NR_write, /*fd=*/r[1], /*data=*/0x200000000800ul, /*len=*/0x45cul); // ioctl$UI_DEV_CREATE arguments: [ // fd: fd_uinput (resource) // cmd: const = 0x5501 (4 bytes) // ] syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x5501, 0); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; if ((reason = setup_802154())) printf("the reproducer may not work as expected: 802154 injection setup " "failed: %s\n", reason); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }