// https://syzkaller.appspot.com/bug?id=f52d486e42ff6af44b01b7ac6cdf3aadaf0418fc // 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 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 void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } 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; } #define MAX_FDS 30 #define USB_MAX_IFACE_NUM 4 #define USB_MAX_EP_NUM 32 #define USB_MAX_FDS 6 struct usb_endpoint_index { struct usb_endpoint_descriptor desc; int handle; }; struct usb_iface_index { struct usb_interface_descriptor* iface; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bInterfaceClass; struct usb_endpoint_index eps[USB_MAX_EP_NUM]; int eps_num; }; struct usb_device_index { struct usb_device_descriptor* dev; struct usb_config_descriptor* config; uint8_t bDeviceClass; uint8_t bMaxPower; int config_length; struct usb_iface_index ifaces[USB_MAX_IFACE_NUM]; int ifaces_num; int iface_cur; }; struct usb_info { int fd; struct usb_device_index index; }; static struct usb_info usb_devices[USB_MAX_FDS]; static int usb_devices_num; static bool parse_usb_descriptor(const char* buffer, size_t length, struct usb_device_index* index) { if (length < sizeof(*index->dev) + sizeof(*index->config)) return false; memset(index, 0, sizeof(*index)); index->dev = (struct usb_device_descriptor*)buffer; index->config = (struct usb_config_descriptor*)(buffer + sizeof(*index->dev)); index->bDeviceClass = index->dev->bDeviceClass; index->bMaxPower = index->config->bMaxPower; index->config_length = length - sizeof(*index->dev); index->iface_cur = -1; size_t offset = 0; while (true) { if (offset + 1 >= length) break; uint8_t desc_length = buffer[offset]; uint8_t desc_type = buffer[offset + 1]; if (desc_length <= 2) break; if (offset + desc_length > length) break; if (desc_type == USB_DT_INTERFACE && index->ifaces_num < USB_MAX_IFACE_NUM) { struct usb_interface_descriptor* iface = (struct usb_interface_descriptor*)(buffer + offset); index->ifaces[index->ifaces_num].iface = iface; index->ifaces[index->ifaces_num].bInterfaceNumber = iface->bInterfaceNumber; index->ifaces[index->ifaces_num].bAlternateSetting = iface->bAlternateSetting; index->ifaces[index->ifaces_num].bInterfaceClass = iface->bInterfaceClass; index->ifaces_num++; } if (desc_type == USB_DT_ENDPOINT && index->ifaces_num > 0) { struct usb_iface_index* iface = &index->ifaces[index->ifaces_num - 1]; if (iface->eps_num < USB_MAX_EP_NUM) { memcpy(&iface->eps[iface->eps_num].desc, buffer + offset, sizeof(iface->eps[iface->eps_num].desc)); iface->eps_num++; } } offset += desc_length; } return true; } static struct usb_device_index* add_usb_index(int fd, const char* dev, size_t dev_len) { int i = __atomic_fetch_add(&usb_devices_num, 1, __ATOMIC_RELAXED); if (i >= USB_MAX_FDS) return NULL; if (!parse_usb_descriptor(dev, dev_len, &usb_devices[i].index)) return NULL; __atomic_store_n(&usb_devices[i].fd, fd, __ATOMIC_RELEASE); return &usb_devices[i].index; } static struct usb_device_index* lookup_usb_index(int fd) { for (int i = 0; i < USB_MAX_FDS; i++) { if (__atomic_load_n(&usb_devices[i].fd, __ATOMIC_ACQUIRE) == fd) return &usb_devices[i].index; } return NULL; } struct vusb_connect_string_descriptor { uint32_t len; char* str; } __attribute__((packed)); struct vusb_connect_descriptors { uint32_t qual_len; char* qual; uint32_t bos_len; char* bos; uint32_t strs_len; struct vusb_connect_string_descriptor strs[0]; } __attribute__((packed)); static const char default_string[] = {8, USB_DT_STRING, 's', 0, 'y', 0, 'z', 0}; static const char default_lang_id[] = {4, USB_DT_STRING, 0x09, 0x04}; static bool lookup_connect_response_in(int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, char** response_data, uint32_t* response_length) { struct usb_device_index* index = lookup_usb_index(fd); uint8_t str_idx; if (!index) return false; switch (ctrl->bRequestType & USB_TYPE_MASK) { case USB_TYPE_STANDARD: switch (ctrl->bRequest) { case USB_REQ_GET_DESCRIPTOR: switch (ctrl->wValue >> 8) { case USB_DT_DEVICE: *response_data = (char*)index->dev; *response_length = sizeof(*index->dev); return true; case USB_DT_CONFIG: *response_data = (char*)index->config; *response_length = index->config_length; return true; case USB_DT_STRING: str_idx = (uint8_t)ctrl->wValue; if (descs && str_idx < descs->strs_len) { *response_data = descs->strs[str_idx].str; *response_length = descs->strs[str_idx].len; return true; } if (str_idx == 0) { *response_data = (char*)&default_lang_id[0]; *response_length = default_lang_id[0]; return true; } *response_data = (char*)&default_string[0]; *response_length = default_string[0]; return true; case USB_DT_BOS: *response_data = descs->bos; *response_length = descs->bos_len; return true; case USB_DT_DEVICE_QUALIFIER: if (!descs->qual) { struct usb_qualifier_descriptor* qual = (struct usb_qualifier_descriptor*)response_data; qual->bLength = sizeof(*qual); qual->bDescriptorType = USB_DT_DEVICE_QUALIFIER; qual->bcdUSB = index->dev->bcdUSB; qual->bDeviceClass = index->dev->bDeviceClass; qual->bDeviceSubClass = index->dev->bDeviceSubClass; qual->bDeviceProtocol = index->dev->bDeviceProtocol; qual->bMaxPacketSize0 = index->dev->bMaxPacketSize0; qual->bNumConfigurations = index->dev->bNumConfigurations; qual->bRESERVED = 0; *response_length = sizeof(*qual); return true; } *response_data = descs->qual; *response_length = descs->qual_len; return true; default: break; } break; default: break; } break; default: break; } return false; } typedef bool (*lookup_connect_out_response_t)( int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, bool* done); static bool lookup_connect_response_out_generic( int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, bool* done) { switch (ctrl->bRequestType & USB_TYPE_MASK) { case USB_TYPE_STANDARD: switch (ctrl->bRequest) { case USB_REQ_SET_CONFIGURATION: *done = true; return true; default: break; } break; } return false; } struct vusb_descriptor { uint8_t req_type; uint8_t desc_type; uint32_t len; char data[0]; } __attribute__((packed)); struct vusb_descriptors { uint32_t len; struct vusb_descriptor* generic; struct vusb_descriptor* descs[0]; } __attribute__((packed)); struct vusb_response { uint8_t type; uint8_t req; uint32_t len; char data[0]; } __attribute__((packed)); struct vusb_responses { uint32_t len; struct vusb_response* generic; struct vusb_response* resps[0]; } __attribute__((packed)); static bool lookup_control_response(const struct vusb_descriptors* descs, const struct vusb_responses* resps, struct usb_ctrlrequest* ctrl, char** response_data, uint32_t* response_length) { int descs_num = 0; int resps_num = 0; if (descs) descs_num = (descs->len - offsetof(struct vusb_descriptors, descs)) / sizeof(descs->descs[0]); if (resps) resps_num = (resps->len - offsetof(struct vusb_responses, resps)) / sizeof(resps->resps[0]); uint8_t req = ctrl->bRequest; uint8_t req_type = ctrl->bRequestType & USB_TYPE_MASK; uint8_t desc_type = ctrl->wValue >> 8; if (req == USB_REQ_GET_DESCRIPTOR) { int i; for (i = 0; i < descs_num; i++) { struct vusb_descriptor* desc = descs->descs[i]; if (!desc) continue; if (desc->req_type == req_type && desc->desc_type == desc_type) { *response_length = desc->len; if (*response_length != 0) *response_data = &desc->data[0]; else *response_data = NULL; return true; } } if (descs && descs->generic) { *response_data = &descs->generic->data[0]; *response_length = descs->generic->len; return true; } } else { int i; for (i = 0; i < resps_num; i++) { struct vusb_response* resp = resps->resps[i]; if (!resp) continue; if (resp->type == req_type && resp->req == req) { *response_length = resp->len; if (*response_length != 0) *response_data = &resp->data[0]; else *response_data = NULL; return true; } } if (resps && resps->generic) { *response_data = &resps->generic->data[0]; *response_length = resps->generic->len; return true; } } return false; } #define UDC_NAME_LENGTH_MAX 128 struct usb_raw_init { __u8 driver_name[UDC_NAME_LENGTH_MAX]; __u8 device_name[UDC_NAME_LENGTH_MAX]; __u8 speed; }; enum usb_raw_event_type { USB_RAW_EVENT_INVALID = 0, USB_RAW_EVENT_CONNECT = 1, USB_RAW_EVENT_CONTROL = 2, }; struct usb_raw_event { __u32 type; __u32 length; __u8 data[0]; }; struct usb_raw_ep_io { __u16 ep; __u16 flags; __u32 length; __u8 data[0]; }; #define USB_RAW_EPS_NUM_MAX 30 #define USB_RAW_EP_NAME_MAX 16 #define USB_RAW_EP_ADDR_ANY 0xff struct usb_raw_ep_caps { __u32 type_control : 1; __u32 type_iso : 1; __u32 type_bulk : 1; __u32 type_int : 1; __u32 dir_in : 1; __u32 dir_out : 1; }; struct usb_raw_ep_limits { __u16 maxpacket_limit; __u16 max_streams; __u32 reserved; }; struct usb_raw_ep_info { __u8 name[USB_RAW_EP_NAME_MAX]; __u32 addr; struct usb_raw_ep_caps caps; struct usb_raw_ep_limits limits; }; struct usb_raw_eps_info { struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX]; }; #define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init) #define USB_RAW_IOCTL_RUN _IO('U', 1) #define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event) #define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io) #define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io) #define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor) #define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32) #define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io) #define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io) #define USB_RAW_IOCTL_CONFIGURE _IO('U', 9) #define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32) #define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info) #define USB_RAW_IOCTL_EP0_STALL _IO('U', 12) #define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32) #define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32) #define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32) static int usb_raw_open() { return open("/dev/raw-gadget", O_RDWR); } static int usb_raw_init(int fd, uint32_t speed, const char* driver, const char* device) { struct usb_raw_init arg; strncpy((char*)&arg.driver_name[0], driver, sizeof(arg.driver_name)); strncpy((char*)&arg.device_name[0], device, sizeof(arg.device_name)); arg.speed = speed; return ioctl(fd, USB_RAW_IOCTL_INIT, &arg); } static int usb_raw_run(int fd) { return ioctl(fd, USB_RAW_IOCTL_RUN, 0); } static int usb_raw_event_fetch(int fd, struct usb_raw_event* event) { return ioctl(fd, USB_RAW_IOCTL_EVENT_FETCH, event); } static int usb_raw_ep0_write(int fd, struct usb_raw_ep_io* io) { return ioctl(fd, USB_RAW_IOCTL_EP0_WRITE, io); } static int usb_raw_ep0_read(int fd, struct usb_raw_ep_io* io) { return ioctl(fd, USB_RAW_IOCTL_EP0_READ, io); } static int usb_raw_ep_enable(int fd, struct usb_endpoint_descriptor* desc) { return ioctl(fd, USB_RAW_IOCTL_EP_ENABLE, desc); } static int usb_raw_ep_disable(int fd, int ep) { return ioctl(fd, USB_RAW_IOCTL_EP_DISABLE, ep); } static int usb_raw_configure(int fd) { return ioctl(fd, USB_RAW_IOCTL_CONFIGURE, 0); } static int usb_raw_vbus_draw(int fd, uint32_t power) { return ioctl(fd, USB_RAW_IOCTL_VBUS_DRAW, power); } static int usb_raw_ep0_stall(int fd) { return ioctl(fd, USB_RAW_IOCTL_EP0_STALL, 0); } static int lookup_interface(int fd, uint8_t bInterfaceNumber, uint8_t bAlternateSetting) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return -1; for (int i = 0; i < index->ifaces_num; i++) { if (index->ifaces[i].bInterfaceNumber == bInterfaceNumber && index->ifaces[i].bAlternateSetting == bAlternateSetting) return i; } return -1; } static void set_interface(int fd, int n) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return; if (index->iface_cur >= 0 && index->iface_cur < index->ifaces_num) { for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++) { int rv = usb_raw_ep_disable( fd, index->ifaces[index->iface_cur].eps[ep].handle); if (rv < 0) { } else { } } } if (n >= 0 && n < index->ifaces_num) { for (int ep = 0; ep < index->ifaces[n].eps_num; ep++) { int rv = usb_raw_ep_enable(fd, &index->ifaces[n].eps[ep].desc); if (rv < 0) { } else { index->ifaces[n].eps[ep].handle = rv; } } index->iface_cur = n; } } static int configure_device(int fd) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return -1; int rv = usb_raw_vbus_draw(fd, index->bMaxPower); if (rv < 0) { return rv; } rv = usb_raw_configure(fd); if (rv < 0) { return rv; } set_interface(fd, 0); return 0; } #define USB_MAX_PACKET_SIZE 4096 struct usb_raw_control_event { struct usb_raw_event inner; struct usb_ctrlrequest ctrl; char data[USB_MAX_PACKET_SIZE]; }; struct usb_raw_ep_io_data { struct usb_raw_ep_io inner; char data[USB_MAX_PACKET_SIZE]; }; static volatile long syz_usb_connect_impl(uint64_t speed, uint64_t dev_len, const char* dev, const struct vusb_connect_descriptors* descs, lookup_connect_out_response_t lookup_connect_response_out) { if (!dev) { return -1; } int fd = usb_raw_open(); if (fd < 0) { return fd; } if (fd >= MAX_FDS) { close(fd); return -1; } struct usb_device_index* index = add_usb_index(fd, dev, dev_len); if (!index) { return -1; } char device[32]; sprintf(&device[0], "dummy_udc.%llu", procid); int rv = usb_raw_init(fd, speed, "dummy_udc", &device[0]); if (rv < 0) { return rv; } rv = usb_raw_run(fd); if (rv < 0) { return rv; } bool done = false; while (!done) { struct usb_raw_control_event event; event.inner.type = 0; event.inner.length = sizeof(event.ctrl); rv = usb_raw_event_fetch(fd, (struct usb_raw_event*)&event); if (rv < 0) { return rv; } if (event.inner.type != USB_RAW_EVENT_CONTROL) continue; char* response_data = NULL; uint32_t response_length = 0; if (event.ctrl.bRequestType & USB_DIR_IN) { if (!lookup_connect_response_in(fd, descs, &event.ctrl, &response_data, &response_length)) { usb_raw_ep0_stall(fd); continue; } } else { if (!lookup_connect_response_out(fd, descs, &event.ctrl, &done)) { usb_raw_ep0_stall(fd); continue; } response_data = NULL; response_length = event.ctrl.wLength; } if ((event.ctrl.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD && event.ctrl.bRequest == USB_REQ_SET_CONFIGURATION) { rv = configure_device(fd); if (rv < 0) { return rv; } } struct usb_raw_ep_io_data response; response.inner.ep = 0; response.inner.flags = 0; if (response_length > sizeof(response.data)) response_length = 0; if (event.ctrl.wLength < response_length) response_length = event.ctrl.wLength; response.inner.length = response_length; if (response_data) memcpy(&response.data[0], response_data, response_length); else memset(&response.data[0], 0, response_length); if (event.ctrl.bRequestType & USB_DIR_IN) { rv = usb_raw_ep0_write(fd, (struct usb_raw_ep_io*)&response); } else { rv = usb_raw_ep0_read(fd, (struct usb_raw_ep_io*)&response); } if (rv < 0) { return rv; } } sleep_ms(200); return fd; } static volatile long syz_usb_connect(volatile long a0, volatile long a1, volatile long a2, volatile long a3) { uint64_t speed = a0; uint64_t dev_len = a1; const char* dev = (const char*)a2; const struct vusb_connect_descriptors* descs = (const struct vusb_connect_descriptors*)a3; return syz_usb_connect_impl(speed, dev_len, dev, descs, &lookup_connect_response_out_generic); } static volatile long syz_usb_control_io(volatile long a0, volatile long a1, volatile long a2) { int fd = a0; const struct vusb_descriptors* descs = (const struct vusb_descriptors*)a1; const struct vusb_responses* resps = (const struct vusb_responses*)a2; struct usb_raw_control_event event; event.inner.type = 0; event.inner.length = USB_MAX_PACKET_SIZE; int rv = usb_raw_event_fetch(fd, (struct usb_raw_event*)&event); if (rv < 0) { return rv; } if (event.inner.type != USB_RAW_EVENT_CONTROL) { return -1; } char* response_data = NULL; uint32_t response_length = 0; if ((event.ctrl.bRequestType & USB_DIR_IN) && event.ctrl.wLength) { if (!lookup_control_response(descs, resps, &event.ctrl, &response_data, &response_length)) { usb_raw_ep0_stall(fd); return -1; } } else { if ((event.ctrl.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD || event.ctrl.bRequest == USB_REQ_SET_INTERFACE) { int iface_num = event.ctrl.wIndex; int alt_set = event.ctrl.wValue; int iface_index = lookup_interface(fd, iface_num, alt_set); if (iface_index < 0) { } else { set_interface(fd, iface_index); } } response_length = event.ctrl.wLength; } struct usb_raw_ep_io_data response; response.inner.ep = 0; response.inner.flags = 0; if (response_length > sizeof(response.data)) response_length = 0; if (event.ctrl.wLength < response_length) response_length = event.ctrl.wLength; if ((event.ctrl.bRequestType & USB_DIR_IN) && !event.ctrl.wLength) { response_length = USB_MAX_PACKET_SIZE; } response.inner.length = response_length; if (response_data) memcpy(&response.data[0], response_data, response_length); else memset(&response.data[0], 0, response_length); if ((event.ctrl.bRequestType & USB_DIR_IN) && event.ctrl.wLength) { rv = usb_raw_ep0_write(fd, (struct usb_raw_ep_io*)&response); } else { rv = usb_raw_ep0_read(fd, (struct usb_raw_ep_io*)&response); } if (rv < 0) { return rv; } sleep_ms(200); return 0; } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; retry: while (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } 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"); if (symlink("/dev/binderfs", "./binderfs")) { } } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); setup_test(); execute_one(); 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; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; *(uint8_t*)0x200011c0 = 0x12; *(uint8_t*)0x200011c1 = 1; *(uint16_t*)0x200011c2 = 0; *(uint8_t*)0x200011c4 = 3; *(uint8_t*)0x200011c5 = 0xea; *(uint8_t*)0x200011c6 = 0xc3; *(uint8_t*)0x200011c7 = 0x40; *(uint16_t*)0x200011c8 = 0x13d3; *(uint16_t*)0x200011ca = 0x3335; *(uint16_t*)0x200011cc = 0xe96f; *(uint8_t*)0x200011ce = 0; *(uint8_t*)0x200011cf = 0; *(uint8_t*)0x200011d0 = 0; *(uint8_t*)0x200011d1 = 1; *(uint8_t*)0x200011d2 = 9; *(uint8_t*)0x200011d3 = 2; *(uint16_t*)0x200011d4 = 0x520; *(uint8_t*)0x200011d6 = 3; *(uint8_t*)0x200011d7 = 0; *(uint8_t*)0x200011d8 = 0; *(uint8_t*)0x200011d9 = 0; *(uint8_t*)0x200011da = 0; *(uint8_t*)0x200011db = 9; *(uint8_t*)0x200011dc = 4; *(uint8_t*)0x200011dd = 0x66; *(uint8_t*)0x200011de = 0x81; *(uint8_t*)0x200011df = 3; *(uint8_t*)0x200011e0 = 0xe1; *(uint8_t*)0x200011e1 = 0x85; *(uint8_t*)0x200011e2 = 0x5b; *(uint8_t*)0x200011e3 = 7; *(uint8_t*)0x200011e4 = 0xa; *(uint8_t*)0x200011e5 = 0x24; *(uint8_t*)0x200011e6 = 1; *(uint16_t*)0x200011e7 = 0x100; *(uint8_t*)0x200011e9 = 0xcb; *(uint8_t*)0x200011ea = 2; *(uint8_t*)0x200011eb = 1; *(uint8_t*)0x200011ec = 2; *(uint8_t*)0x200011ed = 9; *(uint8_t*)0x200011ee = 0x24; *(uint8_t*)0x200011ef = 3; *(uint8_t*)0x200011f0 = 5; *(uint16_t*)0x200011f1 = 0x306; *(uint8_t*)0x200011f3 = 3; *(uint8_t*)0x200011f4 = 2; *(uint8_t*)0x200011f5 = 9; *(uint8_t*)0x200011f6 = 7; *(uint8_t*)0x200011f7 = 0x24; *(uint8_t*)0x200011f8 = 8; *(uint8_t*)0x200011f9 = 2; *(uint16_t*)0x200011fa = 3; *(uint8_t*)0x200011fc = 2; *(uint8_t*)0x200011fd = 0xc; *(uint8_t*)0x200011fe = 0x24; *(uint8_t*)0x200011ff = 2; *(uint8_t*)0x20001200 = 1; *(uint16_t*)0x20001201 = 0x100; *(uint8_t*)0x20001203 = 4; *(uint8_t*)0x20001204 = -1; *(uint16_t*)0x20001205 = 0x20; *(uint8_t*)0x20001207 = 0x86; *(uint8_t*)0x20001208 = 0x88; *(uint8_t*)0x20001209 = 7; *(uint8_t*)0x2000120a = 0x24; *(uint8_t*)0x2000120b = 8; *(uint8_t*)0x2000120c = 5; *(uint16_t*)0x2000120d = 0x80; *(uint8_t*)0x2000120f = 9; *(uint8_t*)0x20001210 = 8; *(uint8_t*)0x20001211 = 0x24; *(uint8_t*)0x20001212 = 6; *(uint8_t*)0x20001213 = 0; *(uint8_t*)0x20001214 = 1; memcpy((void*)0x20001215, "\x89\x4b\xd0", 3); *(uint8_t*)0x20001218 = 5; *(uint8_t*)0x20001219 = 0x24; *(uint8_t*)0x2000121a = 0; *(uint16_t*)0x2000121b = 0; *(uint8_t*)0x2000121d = 0xd; *(uint8_t*)0x2000121e = 0x24; *(uint8_t*)0x2000121f = 0xf; *(uint8_t*)0x20001220 = 1; *(uint32_t*)0x20001221 = 0xff; *(uint16_t*)0x20001225 = 4; *(uint16_t*)0x20001227 = 0x1f; *(uint8_t*)0x20001229 = 0x3f; *(uint8_t*)0x2000122a = 6; *(uint8_t*)0x2000122b = 0x24; *(uint8_t*)0x2000122c = 0x1a; *(uint16_t*)0x2000122d = 7; *(uint8_t*)0x2000122f = 0x28; *(uint8_t*)0x20001230 = 0xc; *(uint8_t*)0x20001231 = 0x24; *(uint8_t*)0x20001232 = 0x1b; *(uint16_t*)0x20001233 = 3; *(uint16_t*)0x20001235 = 0x8001; *(uint8_t*)0x20001237 = 9; *(uint8_t*)0x20001238 = 8; *(uint16_t*)0x20001239 = 0x20; *(uint8_t*)0x2000123b = 8; *(uint8_t*)0x2000123c = 8; *(uint8_t*)0x2000123d = 0x24; *(uint8_t*)0x2000123e = 0x1c; *(uint16_t*)0x2000123f = 7; *(uint8_t*)0x20001241 = 0; *(uint16_t*)0x20001242 = 3; *(uint8_t*)0x20001244 = 5; *(uint8_t*)0x20001245 = 0x24; *(uint8_t*)0x20001246 = 0x15; *(uint16_t*)0x20001247 = 6; *(uint8_t*)0x20001249 = 0xc; *(uint8_t*)0x2000124a = 0x24; *(uint8_t*)0x2000124b = 0x1b; *(uint16_t*)0x2000124c = 0x401; *(uint16_t*)0x2000124e = 7; *(uint8_t*)0x20001250 = 6; *(uint8_t*)0x20001251 = 0x61; *(uint16_t*)0x20001252 = 0xdaf1; *(uint8_t*)0x20001254 = 0; *(uint8_t*)0x20001255 = 9; *(uint8_t*)0x20001256 = 5; *(uint8_t*)0x20001257 = 0; *(uint8_t*)0x20001258 = 0; *(uint16_t*)0x20001259 = 0x400; *(uint8_t*)0x2000125b = 0; *(uint8_t*)0x2000125c = 8; *(uint8_t*)0x2000125d = 0x1f; *(uint8_t*)0x2000125e = 2; *(uint8_t*)0x2000125f = 3; *(uint8_t*)0x20001260 = 9; *(uint8_t*)0x20001261 = 5; *(uint8_t*)0x20001262 = 0xb; *(uint8_t*)0x20001263 = 0; *(uint16_t*)0x20001264 = 0x40; *(uint8_t*)0x20001266 = 5; *(uint8_t*)0x20001267 = 0xc1; *(uint8_t*)0x20001268 = 0; *(uint8_t*)0x20001269 = 0x4c; *(uint8_t*)0x2000126a = 0xd; memcpy((void*)0x2000126b, "\x87\x1b\x3f\xde\xb5\xba\xca\x27\xca\x84\x85\x3e\xc4\xcc\xb7\x3f\x02" "\x22\x59\x0a\x34\x1d\x9e\x93\x67\x5c\x41\x01\xf4\xb1\xd9\x96\xd3\x9d" "\xc8\x57\xc5\x61\x02\x12\x29\xf8\x1d\xb5\xd2\x0a\x55\x61\x20\xd0\x73" "\x38\x90\x2d\x6c\xa0\xfc\xe7\x73\x30\x84\x5d\x30\x90\xee\xcb\x92\x79" "\x79\x5c\x02\x9d\xe3\x70", 74); *(uint8_t*)0x200012b5 = 9; *(uint8_t*)0x200012b6 = 5; *(uint8_t*)0x200012b7 = 2; *(uint8_t*)0x200012b8 = 3; *(uint16_t*)0x200012b9 = 0x3ff; *(uint8_t*)0x200012bb = 0xc1; *(uint8_t*)0x200012bc = 1; *(uint8_t*)0x200012bd = 0; *(uint8_t*)0x200012be = 2; *(uint8_t*)0x200012bf = 9; *(uint8_t*)0x200012c0 = 9; *(uint8_t*)0x200012c1 = 4; *(uint8_t*)0x200012c2 = 0x30; *(uint8_t*)0x200012c3 = 0x67; *(uint8_t*)0x200012c4 = 5; *(uint8_t*)0x200012c5 = 0x4f; *(uint8_t*)0x200012c6 = 0xf2; *(uint8_t*)0x200012c7 = 0x1d; *(uint8_t*)0x200012c8 = 1; *(uint8_t*)0x200012c9 = 9; *(uint8_t*)0x200012ca = 5; *(uint8_t*)0x200012cb = 4; *(uint8_t*)0x200012cc = 0x10; *(uint16_t*)0x200012cd = 0x3ff; *(uint8_t*)0x200012cf = 5; *(uint8_t*)0x200012d0 = 0x66; *(uint8_t*)0x200012d1 = 0x3f; *(uint8_t*)0x200012d2 = 0xda; *(uint8_t*)0x200012d3 = 0xc; memcpy((void*)0x200012d4, "\x1f\xd8\xd5\x10\x39\xe7\xcf\xa0\x4f\x76\xe0\xde\xdf\x5f\x73\xf6\x54" "\x35\x17\x0a\x31\x75\x5e\x03\xc7\x57\xec\xb8\x1c\xf9\x38\x9e\xea\x0d" "\x37\xcb\xcf\x60\x55\xfa\x14\x9b\x43\xc7\xa1\xd2\x25\x3c\xa8\x05\x4a" "\x4a\xc5\x16\xae\xc9\xf5\xe3\xf7\x0d\xcd\xea\x52\xb8\xea\xf4\xa1\xbf" "\xee\xf9\x42\x08\xca\x95\x8f\x97\xfd\x5f\xbd\xa4\x56\xb1\x2c\xe8\xea" "\x72\x95\x3d\xdb\x17\x95\x3e\xca\xb1\x45\x31\xde\xb5\xf3\x07\x4c\x87" "\x03\xf9\x49\x1d\x97\xab\x40\xe5\x53\x62\x1a\x43\x9e\xce\x7f\xb5\x29" "\xe3\xf3\x3e\x88\xd0\x4c\x40\x35\xc9\xf9\x50\x61\xb5\x4e\xde\xbf\xed" "\x33\x56\xcf\x15\x84\x8a\xa9\xef\xd6\xc3\x75\x35\xb5\xee\x8e\x5c\xa0" "\xc4\x46\xcd\xbc\xf5\x1a\x90\x6e\xe4\xa6\x91\x63\x4c\x2c\x19\x52\x85" "\xe3\xc6\x58\xb2\x08\x6d\xaa\x22\x2f\x24\xb6\xaf\x71\xc4\x1d\xd2\xb4" "\x5d\x03\xa1\x41\x86\x3b\x50\xab\xcf\x77\xd4\x93\x37\x76\x5b\x6c\x70" "\xb6\xa5\xf8\x65\xca\x2f\x51\x18\xe3\xf8\xc5\xc1", 216); *(uint8_t*)0x200013ac = 9; *(uint8_t*)0x200013ad = 5; *(uint8_t*)0x200013ae = 0xb; *(uint8_t*)0x200013af = 1; *(uint16_t*)0x200013b0 = 0x218; *(uint8_t*)0x200013b2 = 0xbd; *(uint8_t*)0x200013b3 = 0x81; *(uint8_t*)0x200013b4 = 6; *(uint8_t*)0x200013b5 = 7; *(uint8_t*)0x200013b6 = 0x25; *(uint8_t*)0x200013b7 = 1; *(uint8_t*)0x200013b8 = 0x81; *(uint8_t*)0x200013b9 = 0xf5; *(uint16_t*)0x200013ba = 6; *(uint8_t*)0x200013bc = 2; *(uint8_t*)0x200013bd = 0x21; *(uint8_t*)0x200013be = 9; *(uint8_t*)0x200013bf = 5; *(uint8_t*)0x200013c0 = 6; *(uint8_t*)0x200013c1 = 3; *(uint16_t*)0x200013c2 = 0x20; *(uint8_t*)0x200013c4 = 9; *(uint8_t*)0x200013c5 = 9; *(uint8_t*)0x200013c6 = 0xe; *(uint8_t*)0x200013c7 = 2; *(uint8_t*)0x200013c8 = 3; *(uint8_t*)0x200013c9 = 2; *(uint8_t*)0x200013ca = 1; *(uint8_t*)0x200013cb = 9; *(uint8_t*)0x200013cc = 5; *(uint8_t*)0x200013cd = 4; *(uint8_t*)0x200013ce = 0; *(uint16_t*)0x200013cf = 0x40; *(uint8_t*)0x200013d1 = 0x7f; *(uint8_t*)0x200013d2 = 0x80; *(uint8_t*)0x200013d3 = 0x20; *(uint8_t*)0x200013d4 = 9; *(uint8_t*)0x200013d5 = 5; *(uint8_t*)0x200013d6 = 0xe; *(uint8_t*)0x200013d7 = 0xc; *(uint16_t*)0x200013d8 = 0x79e; *(uint8_t*)0x200013da = 7; *(uint8_t*)0x200013db = 2; *(uint8_t*)0x200013dc = 9; *(uint8_t*)0x200013dd = 7; *(uint8_t*)0x200013de = 0x25; *(uint8_t*)0x200013df = 1; *(uint8_t*)0x200013e0 = 2; *(uint8_t*)0x200013e1 = 0; *(uint16_t*)0x200013e2 = 0x7ff; *(uint8_t*)0x200013e4 = 2; *(uint8_t*)0x200013e5 = 0xa; *(uint8_t*)0x200013e6 = 9; *(uint8_t*)0x200013e7 = 4; *(uint8_t*)0x200013e8 = 0xd6; *(uint8_t*)0x200013e9 = 2; *(uint8_t*)0x200013ea = 0x10; *(uint8_t*)0x200013eb = 0xe1; *(uint8_t*)0x200013ec = 0x16; *(uint8_t*)0x200013ed = 0x61; *(uint8_t*)0x200013ee = 7; *(uint8_t*)0x200013ef = 9; *(uint8_t*)0x200013f0 = 5; *(uint8_t*)0x200013f1 = 0xa; *(uint8_t*)0x200013f2 = 0x10; *(uint16_t*)0x200013f3 = 8; *(uint8_t*)0x200013f5 = 5; *(uint8_t*)0x200013f6 = 8; *(uint8_t*)0x200013f7 = 6; *(uint8_t*)0x200013f8 = 2; *(uint8_t*)0x200013f9 = 0xe; *(uint8_t*)0x200013fa = 9; *(uint8_t*)0x200013fb = 5; *(uint8_t*)0x200013fc = 0; *(uint8_t*)0x200013fd = 4; *(uint16_t*)0x200013fe = 0x10; *(uint8_t*)0x20001400 = 0x3f; *(uint8_t*)0x20001401 = 0x40; *(uint8_t*)0x20001402 = 0x1f; *(uint8_t*)0x20001403 = 7; *(uint8_t*)0x20001404 = 0x25; *(uint8_t*)0x20001405 = 1; *(uint8_t*)0x20001406 = 0; *(uint8_t*)0x20001407 = 0xd; *(uint16_t*)0x20001408 = 0x3ff; *(uint8_t*)0x2000140a = 7; *(uint8_t*)0x2000140b = 0x25; *(uint8_t*)0x2000140c = 1; *(uint8_t*)0x2000140d = 3; *(uint8_t*)0x2000140e = 0x40; *(uint16_t*)0x2000140f = 0; *(uint8_t*)0x20001411 = 9; *(uint8_t*)0x20001412 = 5; *(uint8_t*)0x20001413 = 7; *(uint8_t*)0x20001414 = 0x10; *(uint16_t*)0x20001415 = 0x20; *(uint8_t*)0x20001417 = 0xaa; *(uint8_t*)0x20001418 = 0; *(uint8_t*)0x20001419 = 2; *(uint8_t*)0x2000141a = 7; *(uint8_t*)0x2000141b = 0x25; *(uint8_t*)0x2000141c = 1; *(uint8_t*)0x2000141d = 2; *(uint8_t*)0x2000141e = 0x40; *(uint16_t*)0x2000141f = 1; *(uint8_t*)0x20001421 = 7; *(uint8_t*)0x20001422 = 0x25; *(uint8_t*)0x20001423 = 1; *(uint8_t*)0x20001424 = 0x80; *(uint8_t*)0x20001425 = 2; *(uint16_t*)0x20001426 = 0; *(uint8_t*)0x20001428 = 9; *(uint8_t*)0x20001429 = 5; *(uint8_t*)0x2000142a = 3; *(uint8_t*)0x2000142b = 2; *(uint16_t*)0x2000142c = 0x10; *(uint8_t*)0x2000142e = 5; *(uint8_t*)0x2000142f = 0xf5; *(uint8_t*)0x20001430 = 0; *(uint8_t*)0x20001431 = 9; *(uint8_t*)0x20001432 = 5; *(uint8_t*)0x20001433 = 0xe; *(uint8_t*)0x20001434 = 1; *(uint16_t*)0x20001435 = 0x20; *(uint8_t*)0x20001437 = 0x45; *(uint8_t*)0x20001438 = 3; *(uint8_t*)0x20001439 = 5; *(uint8_t*)0x2000143a = 9; *(uint8_t*)0x2000143b = 5; *(uint8_t*)0x2000143c = 0xa; *(uint8_t*)0x2000143d = 0; *(uint16_t*)0x2000143e = 8; *(uint8_t*)0x20001440 = 0xf0; *(uint8_t*)0x20001441 = 2; *(uint8_t*)0x20001442 = 0; *(uint8_t*)0x20001443 = 7; *(uint8_t*)0x20001444 = 0x25; *(uint8_t*)0x20001445 = 1; *(uint8_t*)0x20001446 = 3; *(uint8_t*)0x20001447 = 0x9f; *(uint16_t*)0x20001448 = 3; *(uint8_t*)0x2000144a = 7; *(uint8_t*)0x2000144b = 0x25; *(uint8_t*)0x2000144c = 1; *(uint8_t*)0x2000144d = 0; *(uint8_t*)0x2000144e = 0x7f; *(uint16_t*)0x2000144f = 1; *(uint8_t*)0x20001451 = 9; *(uint8_t*)0x20001452 = 5; *(uint8_t*)0x20001453 = 0xc; *(uint8_t*)0x20001454 = 8; *(uint16_t*)0x20001455 = 0x200; *(uint8_t*)0x20001457 = 0x7f; *(uint8_t*)0x20001458 = 4; *(uint8_t*)0x20001459 = 0x20; *(uint8_t*)0x2000145a = 9; *(uint8_t*)0x2000145b = 5; *(uint8_t*)0x2000145c = 0xd; *(uint8_t*)0x2000145d = 0xc; *(uint16_t*)0x2000145e = 8; *(uint8_t*)0x20001460 = 6; *(uint8_t*)0x20001461 = 4; *(uint8_t*)0x20001462 = 0xf5; *(uint8_t*)0x20001463 = 9; *(uint8_t*)0x20001464 = 5; *(uint8_t*)0x20001465 = 7; *(uint8_t*)0x20001466 = 3; *(uint16_t*)0x20001467 = 0x20; *(uint8_t*)0x20001469 = 0x40; *(uint8_t*)0x2000146a = 0xc3; *(uint8_t*)0x2000146b = 0xf9; *(uint8_t*)0x2000146c = 0xe9; *(uint8_t*)0x2000146d = 0x21; memcpy( (void*)0x2000146e, "\xc8\x4a\x07\x41\xce\x7f\xb3\x02\x64\x38\xf8\x97\x78\xac\x5a\xb9\x7d\x15" "\x27\x3f\xb5\xc5\x2d\xad\xf8\x62\x47\x4f\x6f\xcb\x09\x7f\xa2\xe2\x3a\x1f" "\x7a\x54\xd2\xd5\x28\x5a\xd6\x54\xe1\x35\xf4\xfa\x82\x3c\xe1\x47\x68\x32" "\xb1\x65\x90\xaf\x08\x39\x20\xff\x24\x7b\xb0\x76\x24\x0e\xfc\xbe\x8a\xc3" "\x5c\x41\x4b\xc7\x2e\xe3\xa5\x67\xe0\x03\xc3\x4d\xa6\xbf\x0e\x86\xa6\x5f" "\xae\xe2\x2c\x11\xa5\xde\x31\x13\xc9\xf0\x2a\xc9\x3f\x42\x4f\xe3\x2f\x1a" "\xe7\xd4\x6a\x1b\xb6\x96\x76\x24\x9e\x5a\xa3\x34\x6f\xd8\x87\x86\xb4\x50" "\xf5\x57\xa1\x7a\x60\x6b\x30\x7d\x0a\xee\x43\x82\xf9\xb8\xe9\xa6\xaf\x43" "\xf5\x34\x33\x21\x8f\xa6\x93\x63\x84\x16\x44\x1a\x1b\xb5\x56\xfe\xd1\xb1" "\x3b\xa2\xec\xf4\xdb\xec\x41\xe5\x1c\x2a\xf8\xb6\x6d\xe4\x03\x6a\x19\xcc" "\xe9\x4a\xcb\x3b\x89\x80\x0b\x52\x35\x1e\x07\xf9\x18\x11\xb7\xa1\xd0\x6a" "\x40\x84\x2b\xeb\x2a\x59\x90\x7d\x0b\xed\xc7\x7a\xa2\x87\xb7\x8c\x4b\xf4" "\x37\x87\xd5\xbb\x3d\x5a\xbe\x57\xf1\xee\x12\xe5\x6e\xd6\x07", 231); *(uint8_t*)0x20001555 = 7; *(uint8_t*)0x20001556 = 0x25; *(uint8_t*)0x20001557 = 1; *(uint8_t*)0x20001558 = 0x80; *(uint8_t*)0x20001559 = 0x1f; *(uint16_t*)0x2000155a = 3; *(uint8_t*)0x2000155c = 9; *(uint8_t*)0x2000155d = 5; *(uint8_t*)0x2000155e = 0xc; *(uint8_t*)0x2000155f = 0x10; *(uint16_t*)0x20001560 = 0x200; *(uint8_t*)0x20001562 = 2; *(uint8_t*)0x20001563 = 4; *(uint8_t*)0x20001564 = 2; *(uint8_t*)0x20001565 = 9; *(uint8_t*)0x20001566 = 5; *(uint8_t*)0x20001567 = 2; *(uint8_t*)0x20001568 = 2; *(uint16_t*)0x20001569 = 0x3cf; *(uint8_t*)0x2000156b = 0; *(uint8_t*)0x2000156c = -1; *(uint8_t*)0x2000156d = 0x13; *(uint8_t*)0x2000156e = 7; *(uint8_t*)0x2000156f = 0x25; *(uint8_t*)0x20001570 = 1; *(uint8_t*)0x20001571 = 0x81; *(uint8_t*)0x20001572 = 9; *(uint16_t*)0x20001573 = 2; *(uint8_t*)0x20001575 = 0xb4; *(uint8_t*)0x20001576 = 0x2a; memcpy( (void*)0x20001577, "\xba\xa6\x7a\x1c\xb8\xc9\xaf\xd6\xf5\xe6\x23\x7e\xe0\xbc\x5b\x07\xb9\xde" "\xa0\x65\xf1\x2a\xd4\xb5\x72\xcb\x39\xd2\xbf\x21\x2e\x28\xb9\x72\x92\xb8" "\xd2\x5b\xce\x59\x2d\xc2\x6e\x19\xf2\x16\x12\xa5\x5b\xdf\xda\xfb\xe7\xb7" "\x1a\xa7\x7d\xeb\xee\x94\x06\x5f\x22\x36\x96\x8f\xfb\x02\x25\x80\x96\x1d" "\xeb\x7a\x14\x19\x93\x9a\x9d\xd3\x76\xa7\x54\xca\x59\xd0\xce\x9f\xde\xcb" "\xbd\x40\x13\xf7\x30\x95\x55\x15\xb8\x7c\xd6\xb1\x51\x14\x6f\x11\x2b\x71" "\x4d\x2d\x48\x63\x7e\x0d\x47\x1e\x03\xeb\xe8\x7c\x47\xe1\xf3\x15\xb3\x47" "\x33\x4f\x77\x7c\x43\xb7\x91\x63\x2e\x9c\xd4\xf6\xdf\x3c\xd8\x66\x8c\x61" "\x1b\x5c\x9a\x8d\xa7\x1f\x0b\xb0\xa1\x88\x09\x6b\x07\xf9\x90\x6d\xb7\x7e" "\x08\xc0\x6d\x65\x4e\xa1\xc4\x98\x88\x4c\x36\x3c\xbc\x7c\x9b\xc2", 178); *(uint8_t*)0x20001629 = 9; *(uint8_t*)0x2000162a = 5; *(uint8_t*)0x2000162b = 1; *(uint8_t*)0x2000162c = 0; *(uint16_t*)0x2000162d = 0x20; *(uint8_t*)0x2000162f = 0x80; *(uint8_t*)0x20001630 = 0x53; *(uint8_t*)0x20001631 = 0xf0; *(uint8_t*)0x20001632 = 9; *(uint8_t*)0x20001633 = 5; *(uint8_t*)0x20001634 = 2; *(uint8_t*)0x20001635 = 0; *(uint16_t*)0x20001636 = 8; *(uint8_t*)0x20001638 = 6; *(uint8_t*)0x20001639 = 9; *(uint8_t*)0x2000163a = 1; *(uint8_t*)0x2000163b = 2; *(uint8_t*)0x2000163c = 0x10; *(uint8_t*)0x2000163d = 0x8f; *(uint8_t*)0x2000163e = 0x11; memcpy( (void*)0x2000163f, "\x48\x2b\x47\xeb\x25\xe3\x25\x4e\xa8\xbb\xd7\x1d\x78\xcc\x5d\x07\x76\xd1" "\x0f\x00\x65\x53\x05\xb7\x55\xd3\xff\x2d\x1d\xb0\xfe\xd9\x79\xef\xdc\xe2" "\x94\x5a\x09\xb4\x55\x87\x5e\x37\xd5\x91\xb3\x42\xf0\x57\x11\x6a\x15\xe2" "\xb8\xba\x07\x06\xa6\x8b\xda\x56\x3d\xc7\xe8\x9a\xf4\x21\x37\x1d\x15\x7f" "\xff\xff\xfe\xe0\x51\x77\x92\xf9\x36\xb6\x2c\x66\xde\x92\x91\xeb\xdb\x05" "\xd9\xae\xb8\xa3\x2c\x52\xfb\xb3\x19\x3a\x85\x12\x51\x3e\x67\xc3\x32\x7b" "\x40\xc1\x77\xb3\x65\x90\xdf\x95\xec\x2c\x92\x00\x3a\xca\xe8\x29\x69\x58" "\x1b\xfa\x01\x5e\xa1\xed\x3f\x5d\xd0\x22\x0b\x89\x04\x7b\xcb", 141); *(uint8_t*)0x200016cc = 9; *(uint8_t*)0x200016cd = 5; *(uint8_t*)0x200016ce = 0xd; *(uint8_t*)0x200016cf = 2; *(uint16_t*)0x200016d0 = 0x400; *(uint8_t*)0x200016d2 = 2; *(uint8_t*)0x200016d3 = 0; *(uint8_t*)0x200016d4 = 0x80; *(uint8_t*)0x200016d5 = 7; *(uint8_t*)0x200016d6 = 0x25; *(uint8_t*)0x200016d7 = 1; *(uint8_t*)0x200016d8 = 0x80; *(uint8_t*)0x200016d9 = 8; *(uint16_t*)0x200016da = 5; *(uint8_t*)0x200016dc = 2; *(uint8_t*)0x200016dd = 0x10; *(uint8_t*)0x200016de = 9; *(uint8_t*)0x200016df = 5; *(uint8_t*)0x200016e0 = 0xd; *(uint8_t*)0x200016e1 = 0x10; *(uint16_t*)0x200016e2 = 0x10; *(uint8_t*)0x200016e4 = 0x10; *(uint8_t*)0x200016e5 = 0x41; *(uint8_t*)0x200016e6 = 5; *(uint8_t*)0x200016e7 = 2; *(uint8_t*)0x200016e8 = 6; *(uint8_t*)0x200016e9 = 9; *(uint8_t*)0x200016ea = 5; *(uint8_t*)0x200016eb = 4; *(uint8_t*)0x200016ec = 0x34; *(uint16_t*)0x200016ed = 0x3ff; *(uint8_t*)0x200016ef = 0xeb; *(uint8_t*)0x200016f0 = 7; *(uint8_t*)0x200016f1 = 1; res = -1; res = syz_usb_connect(3, 0x532, 0x200011c0, 0); if (res != -1) r[0] = res; *(uint8_t*)0x20000000 = 0x12; *(uint8_t*)0x20000001 = 1; *(uint16_t*)0x20000002 = 0x201; *(uint8_t*)0x20000004 = 2; *(uint8_t*)0x20000005 = 0; *(uint8_t*)0x20000006 = 0; *(uint8_t*)0x20000007 = 0x20; *(uint16_t*)0x20000008 = 0x525; *(uint16_t*)0x2000000a = 0xa4a1; *(uint16_t*)0x2000000c = 0x40; *(uint8_t*)0x2000000e = 1; *(uint8_t*)0x2000000f = 2; *(uint8_t*)0x20000010 = 3; *(uint8_t*)0x20000011 = 1; *(uint8_t*)0x20000012 = 9; *(uint8_t*)0x20000013 = 2; *(uint16_t*)0x20000014 = 0x80; *(uint8_t*)0x20000016 = 2; *(uint8_t*)0x20000017 = 1; *(uint8_t*)0x20000018 = 3; *(uint8_t*)0x20000019 = 0x80; *(uint8_t*)0x2000001a = 0xa7; *(uint8_t*)0x2000001b = 9; *(uint8_t*)0x2000001c = 4; *(uint8_t*)0x2000001d = 0; *(uint8_t*)0x2000001e = 0; *(uint8_t*)0x2000001f = 1; *(uint8_t*)0x20000020 = 2; *(uint8_t*)0x20000021 = 0xd; *(uint8_t*)0x20000022 = 0; *(uint8_t*)0x20000023 = 0; *(uint8_t*)0x20000024 = 9; *(uint8_t*)0x20000025 = 0x24; *(uint8_t*)0x20000026 = 6; *(uint8_t*)0x20000027 = 0; *(uint8_t*)0x20000028 = 1; memcpy((void*)0x20000029, "\tLR\"", 4); *(uint8_t*)0x2000002d = 5; *(uint8_t*)0x2000002e = 0x24; *(uint8_t*)0x2000002f = 0; *(uint16_t*)0x20000030 = 1; *(uint8_t*)0x20000032 = 0xd; *(uint8_t*)0x20000033 = 0x24; *(uint8_t*)0x20000034 = 0xf; *(uint8_t*)0x20000035 = 1; *(uint32_t*)0x20000036 = 0x7ff; *(uint16_t*)0x2000003a = 0xff; *(uint16_t*)0x2000003c = 3; *(uint8_t*)0x2000003e = 6; *(uint8_t*)0x2000003f = 6; *(uint8_t*)0x20000040 = 0x24; *(uint8_t*)0x20000041 = 0x1a; *(uint16_t*)0x20000042 = 8; *(uint8_t*)0x20000044 = 0x10; *(uint8_t*)0x20000045 = 7; *(uint8_t*)0x20000046 = 0x24; *(uint8_t*)0x20000047 = 0xa; *(uint8_t*)0x20000048 = 9; *(uint8_t*)0x20000049 = 0x1f; *(uint8_t*)0x2000004a = 0xfd; *(uint8_t*)0x2000004b = 0x20; *(uint8_t*)0x2000004c = 5; *(uint8_t*)0x2000004d = 0x24; *(uint8_t*)0x2000004e = 0x15; *(uint16_t*)0x2000004f = 6; *(uint8_t*)0x20000051 = 5; *(uint8_t*)0x20000052 = 0x24; *(uint8_t*)0x20000053 = 0x15; *(uint16_t*)0x20000054 = 0x1000; *(uint8_t*)0x20000056 = 8; *(uint8_t*)0x20000057 = 0x24; *(uint8_t*)0x20000058 = 0x1c; *(uint16_t*)0x20000059 = 0x8001; *(uint8_t*)0x2000005b = 2; *(uint16_t*)0x2000005c = 0x22; *(uint8_t*)0x2000005e = 7; *(uint8_t*)0x2000005f = 0x24; *(uint8_t*)0x20000060 = 0x14; *(uint16_t*)0x20000061 = 0x800; *(uint16_t*)0x20000063 = 0x3000; *(uint8_t*)0x20000065 = 9; *(uint8_t*)0x20000066 = 5; *(uint8_t*)0x20000067 = 0x81; *(uint8_t*)0x20000068 = 3; *(uint16_t*)0x20000069 = 0x20; *(uint8_t*)0x2000006b = 0x23; *(uint8_t*)0x2000006c = 0; *(uint8_t*)0x2000006d = 1; *(uint8_t*)0x2000006e = 9; *(uint8_t*)0x2000006f = 4; *(uint8_t*)0x20000070 = 1; *(uint8_t*)0x20000071 = 0; *(uint8_t*)0x20000072 = 0; *(uint8_t*)0x20000073 = 2; *(uint8_t*)0x20000074 = 0xd; *(uint8_t*)0x20000075 = 0; *(uint8_t*)0x20000076 = 0; *(uint8_t*)0x20000077 = 9; *(uint8_t*)0x20000078 = 4; *(uint8_t*)0x20000079 = 1; *(uint8_t*)0x2000007a = 1; *(uint8_t*)0x2000007b = 2; *(uint8_t*)0x2000007c = 2; *(uint8_t*)0x2000007d = 0xd; *(uint8_t*)0x2000007e = 0; *(uint8_t*)0x2000007f = 0; *(uint8_t*)0x20000080 = 9; *(uint8_t*)0x20000081 = 5; *(uint8_t*)0x20000082 = 0x82; *(uint8_t*)0x20000083 = 2; *(uint16_t*)0x20000084 = 0x200; *(uint8_t*)0x20000086 = 2; *(uint8_t*)0x20000087 = -1; *(uint8_t*)0x20000088 = 0x3f; *(uint8_t*)0x20000089 = 9; *(uint8_t*)0x2000008a = 5; *(uint8_t*)0x2000008b = 3; *(uint8_t*)0x2000008c = 2; *(uint16_t*)0x2000008d = 8; *(uint8_t*)0x2000008f = 8; *(uint8_t*)0x20000090 = 0; *(uint8_t*)0x20000091 = 4; syz_usb_connect(3, 0x92, 0x20000000, 0); syz_usb_control_io(r[0], 0, 0); syz_usb_control_io(r[0], 0, 0); syz_usb_control_io(r[0], 0, 0); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { use_temporary_dir(); loop(); } } sleep(1000000); return 0; }