// https://syzkaller.appspot.com/bug?id=d3a08ccf68916f3b12821b5267b3e763244685af // 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 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; } #define MAX_FDS 30 #define USB_MAX_IFACE_NUM 4 #define USB_MAX_EP_NUM 32 #define USB_MAX_FDS 6 struct usb_iface_index { struct usb_interface_descriptor* iface; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bInterfaceClass; struct usb_endpoint_descriptor 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], buffer + offset, sizeof(iface->eps[iface->eps_num])); 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; int rv = 0; rv = parse_usb_descriptor(dev, dev_len, &usb_devices[i].index); if (!rv) 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) { int i; for (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; } exit(1); 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; } exit(1); 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_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) 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 lookup_interface(int fd, uint8_t bInterfaceNumber, uint8_t bAlternateSetting) { struct usb_device_index* index = lookup_usb_index(fd); int i; if (!index) return -1; for (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); int ep; if (!index) return; if (index->iface_cur >= 0 && index->iface_cur < index->ifaces_num) { for (ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++) { int rv = usb_raw_ep_disable(fd, ep); if (rv < 0) { } else { } } } if (n >= 0 && n < index->ifaces_num) { for (ep = 0; ep < index->ifaces[n].eps_num; ep++) { int rv = usb_raw_ep_enable(fd, &index->ifaces[n].eps[ep]); if (rv < 0) { } else { } } 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) { bool response_found = false; response_found = lookup_connect_response_in( fd, descs, &event.ctrl, &response_data, &response_length); if (!response_found) { return -1; } } else { if (!lookup_connect_response_out(fd, descs, &event.ctrl, &done)) { return -1; } 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; } bool response_found = false; char* response_data = NULL; uint32_t response_length = 0; if ((event.ctrl.bRequestType & USB_DIR_IN) && event.ctrl.wLength) { response_found = lookup_control_response(descs, resps, &event.ctrl, &response_data, &response_length); if (!response_found) { 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; } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); int i; for (i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter; for (iter = 0;; 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 (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5 * 1000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy( (void*)0x20000080, "\x12\x01\x00\x00\x8e\x32\xf7\x20\xf0\x0a\x57\xd2\x87\x4e\x00\x00\x00\x01" "\x09\x02\x12\x00\x01\x00\x00\x00\x00\x09\x04\x00\x00\x00\xff\xa5\x2c\x00" "\x5f\x8a\x49\x69\x4a\xdf\x44\xc4\xbb\x91\xca\xa1\x06\xa2\x36\x73\xf0\xd3" "\xac\xf6\x9a\xe9\xa9\x9e\xde\x15\x08\xa0\x45\x25\xc6\xb5\xbd\xe4\xa0\x18" "\xf1\x4d\x7b\xf9\xd5\x6c\x32\xca\x81\xdc\x8e\x32\xf5\x53\x1a\xfc\x61\x26" "\x3e\x65\xf5\xa3\x45\x55\xb9\xd1\x04\x57\x7b\x56\x60\x0a\x5d\xad\xd2\xb7" "\xe9\xf2\x1b\x8d\xd7\xfb\x45\xa3\x33\x3d\xc6\x69\xdb\x13\x57\x49\x15\xa6" "\xe2\x06\xc2\x63\x77\x49\xc0\xbf\x8f\xd1\x30\x39\x50\x5f\x3a\x03\xee\xa5" "\x71\xd9\xdd\xdc\x41\xe6\x90\x6d\xbd\x3f\x8a\x9e\x2c\x43\x8c\x7e\xcb\x52" "\x05\xee\x1c\x8b\xb6\xd7\x8e\xc5\x2d\x6a\x22\x56\x96\xf3\x03\x91\xb4\x2d" "\xee\x9a\xb4\x02\x87\x19\x67\x58\xeb\x9b\x43\xe0\x9b\xd9\x85\x93\xdf\xf5" "\x47\xe1\xb0\x8c\x5d\xb2\x29\x16\x8d\xa7\xd1\xdd\xc0\xd1\x64\xee\x84\xf0" "\x00\x10\x00\x00\x00\x00\x00\x00\xbe\x05\x44\xe8\x1a\x16\x77\x32\xac\xc7" "\xdc\xd1\xe9\x50\xd3\x8c\xfc\x89\xdb\x8a\x7f\xc9\x5e\x04\xa1\x79\xac\xd4" "\x11\x17\x2f\xb1\x02\x8f\x25\xd6\xbb\xf3\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x93\x72\xfc\xdd\x0f\xd2\xe9\x77\x1f\x57" "\xcc\x29\x38\xcc\xa2\x15\x6c\xeb\xa8\x1c\x92\x80\xe7\xd9\x41\x70\x11\xcb" "\xce\xf2\x78\xa1\x29\x67\x5c\xa7\xc3\xc3\x5f\x05\xa5\x13\x00\x2e\x0e\x5a" "\xb6\x9a\x88\x69\xf8\xee\xb9\x24\x86\x47\xdc\x34\x9c\xd6\x4e\xf4\x6d\xbb" "\xef\xc6\x29\x98\xe1\x07\x7f\x8e\xa9\xa0\x70\x87\x2b\x8b\x81\x58\x1f\x8e" "\x19\x59\x68\x84\x93\x2f\x0c\x87\x79\xb7\x0d\xbc\xcb\xbd\x2c\x56\x4f\x3e" "\x87\xae\xd5\x20\x7d\x23\xb9\x52\xb4\xaa\xb6\xd3\x1b\x88\x4d\x21\x16\x1a" "\x9e\x1f\xdc\x59\x4f\x55\x5d\xa7\x05\x5a\x4a\xcf\x7f\xde\x1e\xfc\x55\xca" "\xce\xf0\x87\xa8\xc0\x5c\xdb\x18\x50\x8b\x75\x22\x86\xfb\xb5\x71\xe4\xc5" "\x02\x70\x07\xbf\xd1\xf9\xe9\x4a\xf4\xd7\xde\x1f\xae\x6f\x90\x00\xe7\xfe" "\xfa\x67\x22\xbf\xde\x37\xba\xc1\x5d\xa6\xe5\x15\x0b\xda\x6d\x77\x4d\xaf" "\x43\x8d\x9c\x0a\x4f\x94\xff\x30\x9f\xb8\x83\xe7\x24\x0f\x8b\x86\xf1\x22" "\xd5\x53\xe1\x55\x03\x22\xa0\x12\x7c\xba\xe8\xd1\x85\x68\x97\x30\x01\x73" "\x80\x14\xbd\x65\xb9\xa4\xae\x67\x1d\xcd\x70\xb9\xf5\x7a\xce\x42\x60\x8c" "\x45\xf4\x8c\x5e\xd5\xa3\xcd\xec\x4c\xf6\x42\x07\x1f\x1c\x9a\x48\x79\x71" "\xb2\x6a\xe8\x8a\x32\xb6\xee\xc1\x67\x5f\x04\xc2\x4a\x4d\x5b\x06\x5a\x57" "\xba\x2e\xff\x14\x2a\x0b\x7b\x88\x7f\x51\x46\x70\x6a\xff\xe9\xb7\x12\x29" "\xb1\xe4\x71\xb1\x50\x8b\xc5\xa2\x27\x8f\xaa\x37\xa4\xa7\x30\x12\xc3\x30" "\xfc\xf6\x49\x75\x67\x3b\x63\x18\x30\x83\x66\xcc\x9d\xbe\x9e\x9d\x51\xae" "\x97\xab\xe7\x87\x93\x68\x61\x50\x07\x08\xf8\x31\x59\x82\x24\x67\x41\x45" "\x67\x52\x38\x7b\x03\xb7\x9a\x48\x46\x20\xfe\x63\xe5\x75\x1c\x6b\xef\xc4" "\x49\x98\xae\xb5\x17\xa3\x63\x05\x86\xd6\xbf\x02\x1e\xbc\x96\x60\x1b\xba" "\x3e\x3e\xa5\x29\x09\x07\x6c\x34\x4f\x9e\x21\x1f\x38\x53\xc1\x82\x6c\xe3" "\x4a\x59\x6e\x9e\x31\x54\x2f\xc6\x7c\x15\x9a\x10\xe7\xeb\x83\xa9\x5d\x12" "\xa5\x4d\x9c\x5f\x30\x34\x9b\x26\xd3\x11\xca\xef\x9e\xff\xca\xfa\xa8\xac" "\xe2\x44\x61\x86\x92\x8d\x11\x1a\xd7\xb9\x88\xb4\xf1\x4d\x73\xb6\x66\x54" "\x30\x1f\xa3\x55\xd6\x6e\x4c\xf9\x6c\xa2\x71\x2f\x59\xa1\x12\x6a\x38\x69" "\x83\xfc\x48\xeb\x7f\x81\x1c\x47\xb0\xdb\x42\xf7\xad\x3f\xcf\x8d\x88\xa2" "\x62\x4c\x2a\xd9\xe3\x67\x54\x34\x3d\x46\xf2\xbf\x2d\xcf\x79\x84\x7d\xf8" "\x88\x9b\x32\x14\x48\x8a\x15\x27\xb6\xf2\xd6\x90\xda\xd7\xaa\x6c\x54\xc0" "\xc6\xa8\xd5\x8b\x96\x4d\xd0\xfa\x9b\x9a\xe4\x47\xa0\x05\x99\xde\xe0\xcd" "\xcc\xda\x71\x18\x8a\x61\x0a\xb4\x93\x6e\x4b\x13\x02\x42\x4d\x60\x45\x3a" "\x3d\x76\x91\x50\x76\xb3\xd7\x08\x55\xdc\xc2\xbd\x1d\x98\x64\xe5\xe3\x7b" "\x43\xad\xa3\x81\xb0\x5d\x0e\x59\xc2\xbb\x75\x70\xe6\xa9\x98\xc4\x18\x8b" "\x8d\xd1\x9c\xe8\x07\x09\x3d\x5f\xb0\xa4\xbc\x84\x3b\x48\xbd\xef\x3d\x48" "\x23\xb4\x4c\x0f", 904); res = syz_usb_connect(0, 0x24, 0x20000080, 0); if (res != -1) r[0] = res; *(uint32_t*)0x20000a00 = 0x84; *(uint64_t*)0x20000a04 = 0x20000040; memcpy((void*)0x20000040, "\x00\x00\x11\x00\x00\x00\x09", 7); *(uint64_t*)0x20000a0c = 0; *(uint64_t*)0x20000a14 = 0; *(uint64_t*)0x20000a1c = 0; *(uint64_t*)0x20000a24 = 0; *(uint64_t*)0x20000a2c = 0; *(uint64_t*)0x20000a34 = 0; *(uint64_t*)0x20000a3c = 0; *(uint64_t*)0x20000a44 = 0; *(uint64_t*)0x20000a4c = 0; *(uint64_t*)0x20000a54 = 0; *(uint64_t*)0x20000a5c = 0; *(uint64_t*)0x20000a64 = 0; *(uint64_t*)0x20000a6c = 0; *(uint64_t*)0x20000a74 = 0; *(uint64_t*)0x20000a7c = 0; syz_usb_control_io(r[0], 0, 0x20000a00); syz_usb_connect(4, 0, 0, 0); } int main(void) { syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0ul); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }