// https://syzkaller.appspot.com/bug?id=beab55c4cae03ef184d4417017fbb439403a3597 // 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 static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } #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; } #define ATH9K_FIRMWARE_DOWNLOAD 0x30 #define ATH9K_FIRMWARE_DOWNLOAD_COMP 0x31 static bool lookup_connect_response_out_ath9k( 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: return true; default: break; } break; case USB_TYPE_VENDOR: switch (ctrl->bRequest) { case ATH9K_FIRMWARE_DOWNLOAD: return true; case ATH9K_FIRMWARE_DOWNLOAD_COMP: *done = true; return true; default: break; } break; } 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_write(int fd, struct usb_raw_ep_io* io) { return ioctl(fd, USB_RAW_IOCTL_EP_WRITE, 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_endpoint(int fd, uint8_t bEndpointAddress) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return -1; if (index->iface_cur < 0) return -1; for (int ep = 0; index->ifaces[index->iface_cur].eps_num; ep++) if (index->ifaces[index->iface_cur].eps[ep].desc.bEndpointAddress == bEndpointAddress) return index->ifaces[index->iface_cur].eps[ep].handle; 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_connect_ath9k(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_ath9k); } static volatile long syz_usb_ep_write(volatile long a0, volatile long a1, volatile long a2, volatile long a3) { int fd = a0; uint8_t ep = a1; uint32_t len = a2; char* data = (char*)a3; int ep_handle = lookup_endpoint(fd, ep); if (ep_handle < 0) { return -1; } struct usb_raw_ep_io_data io_data; io_data.inner.ep = ep_handle; io_data.inner.flags = 0; if (len > sizeof(io_data.data)) len = sizeof(io_data.data); io_data.inner.length = len; memcpy(&io_data.data[0], data, len); int rv = usb_raw_ep_write(fd, (struct usb_raw_ep_io*)&io_data); if (rv < 0) { return rv; } sleep_ms(200); return 0; } uint64_t r[1] = {0xffffffffffffffff}; 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); intptr_t res = 0; *(uint8_t*)0x20000740 = 0x12; *(uint8_t*)0x20000741 = 1; *(uint16_t*)0x20000742 = 0x200; *(uint8_t*)0x20000744 = -1; *(uint8_t*)0x20000745 = -1; *(uint8_t*)0x20000746 = -1; *(uint8_t*)0x20000747 = 0x40; *(uint16_t*)0x20000748 = 0xcf3; *(uint16_t*)0x2000074a = 0x9271; *(uint16_t*)0x2000074c = 0x108; *(uint8_t*)0x2000074e = 1; *(uint8_t*)0x2000074f = 2; *(uint8_t*)0x20000750 = 3; *(uint8_t*)0x20000751 = 0x60; *(uint8_t*)0x20000752 = 9; *(uint8_t*)0x20000753 = 2; *(uint16_t*)0x20000754 = 0x48; *(uint8_t*)0x20000756 = 1; *(uint8_t*)0x20000757 = 1; *(uint8_t*)0x20000758 = 0; *(uint8_t*)0x20000759 = 0x80; *(uint8_t*)0x2000075a = 0xfa; *(uint8_t*)0x2000075b = 9; *(uint8_t*)0x2000075c = 4; *(uint8_t*)0x2000075d = 0; *(uint8_t*)0x2000075e = 0; *(uint8_t*)0x2000075f = 6; *(uint8_t*)0x20000760 = -1; *(uint8_t*)0x20000761 = 0; *(uint8_t*)0x20000762 = 0; *(uint8_t*)0x20000763 = 0; *(uint8_t*)0x20000764 = 9; *(uint8_t*)0x20000765 = 5; *(uint8_t*)0x20000766 = 1; *(uint8_t*)0x20000767 = 2; *(uint16_t*)0x20000768 = 0x200; *(uint8_t*)0x2000076a = 0; *(uint8_t*)0x2000076b = 0; *(uint8_t*)0x2000076c = 0; *(uint8_t*)0x2000076d = 9; *(uint8_t*)0x2000076e = 5; *(uint8_t*)0x2000076f = 0x82; *(uint8_t*)0x20000770 = 2; *(uint16_t*)0x20000771 = 0x200; *(uint8_t*)0x20000773 = 0; *(uint8_t*)0x20000774 = 0; *(uint8_t*)0x20000775 = 0; *(uint8_t*)0x20000776 = 9; *(uint8_t*)0x20000777 = 5; *(uint8_t*)0x20000778 = 0x83; *(uint8_t*)0x20000779 = 3; *(uint16_t*)0x2000077a = 0x40; *(uint8_t*)0x2000077c = 1; *(uint8_t*)0x2000077d = 0; *(uint8_t*)0x2000077e = 0; *(uint8_t*)0x2000077f = 9; *(uint8_t*)0x20000780 = 5; *(uint8_t*)0x20000781 = 4; *(uint8_t*)0x20000782 = 3; *(uint16_t*)0x20000783 = 0x40; *(uint8_t*)0x20000785 = 1; *(uint8_t*)0x20000786 = 0; *(uint8_t*)0x20000787 = 0; *(uint8_t*)0x20000788 = 9; *(uint8_t*)0x20000789 = 5; *(uint8_t*)0x2000078a = 5; *(uint8_t*)0x2000078b = 2; *(uint16_t*)0x2000078c = 0x200; *(uint8_t*)0x2000078e = 0; *(uint8_t*)0x2000078f = 0; *(uint8_t*)0x20000790 = 0; *(uint8_t*)0x20000791 = 9; *(uint8_t*)0x20000792 = 5; *(uint8_t*)0x20000793 = 6; *(uint8_t*)0x20000794 = 2; *(uint16_t*)0x20000795 = 0x200; *(uint8_t*)0x20000797 = 0; *(uint8_t*)0x20000798 = 0; *(uint8_t*)0x20000799 = 0; res = -1; res = syz_usb_connect_ath9k(3, 0x5a, 0x20000740, 0); if (res != -1) r[0] = res; *(uint8_t*)0x20000140 = 0; *(uint8_t*)0x20000141 = 0; *(uint16_t*)0x20000142 = htobe16(8); memcpy((void*)0x20000144, "\000Z\000\000", 4); *(uint16_t*)0x20000148 = htobe16(1); *(uint16_t*)0x2000014a = htobe16(0); *(uint16_t*)0x2000014c = htobe16(0); *(uint8_t*)0x2000014e = 0; *(uint8_t*)0x2000014f = 0; syz_usb_ep_write(r[0], 0x83, 0x10, 0x20000140); *(uint8_t*)0x200007c0 = 0x12; *(uint8_t*)0x200007c1 = 1; *(uint16_t*)0x200007c2 = 0x200; *(uint8_t*)0x200007c4 = 0xcb; *(uint8_t*)0x200007c5 = 0xdf; *(uint8_t*)0x200007c6 = 0x68; *(uint8_t*)0x200007c7 = 0x10; *(uint16_t*)0x200007c8 = 0x45e; *(uint16_t*)0x200007ca = 0x4da; *(uint16_t*)0x200007cc = 0x9d72; *(uint8_t*)0x200007ce = 1; *(uint8_t*)0x200007cf = 2; *(uint8_t*)0x200007d0 = 3; *(uint8_t*)0x200007d1 = 1; *(uint8_t*)0x200007d2 = 9; *(uint8_t*)0x200007d3 = 2; *(uint16_t*)0x200007d4 = 0x2d3; *(uint8_t*)0x200007d6 = 1; *(uint8_t*)0x200007d7 = 8; *(uint8_t*)0x200007d8 = 0; *(uint8_t*)0x200007d9 = 0xc0; *(uint8_t*)0x200007da = 4; *(uint8_t*)0x200007db = 9; *(uint8_t*)0x200007dc = 4; *(uint8_t*)0x200007dd = 0x8d; *(uint8_t*)0x200007de = 7; *(uint8_t*)0x200007df = 0xd; *(uint8_t*)0x200007e0 = 0x7a; *(uint8_t*)0x200007e1 = 0xbc; *(uint8_t*)0x200007e2 = 0xde; *(uint8_t*)0x200007e3 = -1; *(uint8_t*)0x200007e4 = 7; *(uint8_t*)0x200007e5 = 0x24; *(uint8_t*)0x200007e6 = 6; *(uint8_t*)0x200007e7 = 0; *(uint8_t*)0x200007e8 = 0; memcpy((void*)0x200007e9, "\x69\xe0", 2); *(uint8_t*)0x200007eb = 5; *(uint8_t*)0x200007ec = 0x24; *(uint8_t*)0x200007ed = 0; *(uint16_t*)0x200007ee = 0; *(uint8_t*)0x200007f0 = 0xd; *(uint8_t*)0x200007f1 = 0x24; *(uint8_t*)0x200007f2 = 0xf; *(uint8_t*)0x200007f3 = 1; *(uint32_t*)0x200007f4 = 1; *(uint16_t*)0x200007f8 = 7; *(uint16_t*)0x200007fa = 0xbb; *(uint8_t*)0x200007fc = 7; *(uint8_t*)0x200007fd = 5; *(uint8_t*)0x200007fe = 0x24; *(uint8_t*)0x200007ff = 1; *(uint8_t*)0x20000800 = 0; *(uint8_t*)0x20000801 = 1; *(uint8_t*)0x20000802 = 0xc; *(uint8_t*)0x20000803 = 0x24; *(uint8_t*)0x20000804 = 0x1b; *(uint16_t*)0x20000805 = 0xff; *(uint16_t*)0x20000807 = 0xfff; *(uint8_t*)0x20000809 = 0x20; *(uint8_t*)0x2000080a = 2; *(uint16_t*)0x2000080b = 7; *(uint8_t*)0x2000080d = 0x78; *(uint8_t*)0x2000080e = 7; *(uint8_t*)0x2000080f = 0x24; *(uint8_t*)0x20000810 = 0xa; *(uint8_t*)0x20000811 = 0xfc; *(uint8_t*)0x20000812 = 4; *(uint8_t*)0x20000813 = 0; *(uint8_t*)0x20000814 = 0x20; *(uint8_t*)0x20000815 = 0xa; *(uint8_t*)0x20000816 = 0x24; *(uint8_t*)0x20000817 = 6; *(uint8_t*)0x20000818 = 0; *(uint8_t*)0x20000819 = 0; memcpy((void*)0x2000081a, "\xd1\x56\x2b\x55\x0b", 5); *(uint8_t*)0x2000081f = 5; *(uint8_t*)0x20000820 = 0x24; *(uint8_t*)0x20000821 = 0; *(uint16_t*)0x20000822 = 2; *(uint8_t*)0x20000824 = 0xd; *(uint8_t*)0x20000825 = 0x24; *(uint8_t*)0x20000826 = 0xf; *(uint8_t*)0x20000827 = 1; *(uint32_t*)0x20000828 = 0x67be; *(uint16_t*)0x2000082c = 0x80; *(uint16_t*)0x2000082e = 5; *(uint8_t*)0x20000830 = 1; *(uint8_t*)0x20000831 = 5; *(uint8_t*)0x20000832 = 0x24; *(uint8_t*)0x20000833 = 1; *(uint8_t*)0x20000834 = 2; *(uint8_t*)0x20000835 = 2; *(uint8_t*)0x20000836 = 4; *(uint8_t*)0x20000837 = 0x24; *(uint8_t*)0x20000838 = 2; *(uint8_t*)0x20000839 = 0; *(uint8_t*)0x2000083a = 5; *(uint8_t*)0x2000083b = 0x24; *(uint8_t*)0x2000083c = 1; *(uint8_t*)0x2000083d = 2; *(uint8_t*)0x2000083e = 2; *(uint8_t*)0x2000083f = 5; *(uint8_t*)0x20000840 = 0x24; *(uint8_t*)0x20000841 = 1; *(uint8_t*)0x20000842 = 2; *(uint8_t*)0x20000843 = 2; *(uint8_t*)0x20000844 = 0xa; *(uint8_t*)0x20000845 = 0x24; *(uint8_t*)0x20000846 = 7; *(uint8_t*)0x20000847 = 1; *(uint16_t*)0x20000848 = 0x1000; *(uint16_t*)0x2000084a = 0xf800; *(uint16_t*)0x2000084c = 0x4a5; *(uint8_t*)0x2000084e = 9; *(uint8_t*)0x2000084f = 5; *(uint8_t*)0x20000850 = 7; *(uint8_t*)0x20000851 = 8; *(uint16_t*)0x20000852 = 0x400; *(uint8_t*)0x20000854 = 8; *(uint8_t*)0x20000855 = 0x7f; *(uint8_t*)0x20000856 = 7; *(uint8_t*)0x20000857 = 7; *(uint8_t*)0x20000858 = 0x25; *(uint8_t*)0x20000859 = 1; *(uint8_t*)0x2000085a = 0; *(uint8_t*)0x2000085b = 0x1f; *(uint16_t*)0x2000085c = 4; *(uint8_t*)0x2000085e = 9; *(uint8_t*)0x2000085f = 5; *(uint8_t*)0x20000860 = 0xe; *(uint8_t*)0x20000861 = 8; *(uint16_t*)0x20000862 = 0x10; *(uint8_t*)0x20000864 = 6; *(uint8_t*)0x20000865 = 9; *(uint8_t*)0x20000866 = 3; *(uint8_t*)0x20000867 = 0x3c; *(uint8_t*)0x20000868 = 0xd; memcpy((void*)0x20000869, "\xa4\xcd\x00\xd5\xfa\x81\xd7\x96\x57\x97\x29\x26\xf0\x99\x9a\xdc\x12" "\x1e\xf0\xc2\xc0\x11\xb2\x82\xca\x72\xa9\xde\x27\x14\xc8\xa5\xa9\xb2" "\xea\xb4\xf0\xb6\x0c\x8f\x75\x2b\x86\x50\xc0\xf0\x2c\x0d\xff\x84\x88" "\xb4\xc3\x27\x04\xea\x60\x94", 58); *(uint8_t*)0x200008a3 = 2; *(uint8_t*)0x200008a4 = 8; *(uint8_t*)0x200008a5 = 9; *(uint8_t*)0x200008a6 = 5; *(uint8_t*)0x200008a7 = 0xb; *(uint8_t*)0x200008a8 = 0; *(uint16_t*)0x200008a9 = 0x400; *(uint8_t*)0x200008ab = 3; *(uint8_t*)0x200008ac = 4; *(uint8_t*)0x200008ad = 9; *(uint8_t*)0x200008ae = 7; *(uint8_t*)0x200008af = 0x25; *(uint8_t*)0x200008b0 = 1; *(uint8_t*)0x200008b1 = 0x80; *(uint8_t*)0x200008b2 = 1; *(uint16_t*)0x200008b3 = 0xff; *(uint8_t*)0x200008b5 = 0x50; *(uint8_t*)0x200008b6 = 0x22; memcpy((void*)0x200008b7, "\x58\xc6\xa7\x4d\xc8\xf4\xe9\xb5\xbc\xb2\xd9\x99\x0a\x4e\x5b\x64\xd6" "\x7e\x7b\xea\x55\x17\x48\xce\x65\x1c\x78\x55\x15\x70\xdd\xcf\x75\xf4" "\x02\x7f\x02\xf2\x94\x93\xf8\x32\x1a\x82\xbd\xf9\xce\x36\x43\x82\x00" "\x4e\xfe\x58\x1f\xe7\xb9\x69\xa5\x55\xa4\xea\xa9\xbd\x99\x9d\xc4\xc5" "\xe5\xa4\x64\xeb\x37\x96\xb1\x9b\x79\x5f", 78); *(uint8_t*)0x20000905 = 9; *(uint8_t*)0x20000906 = 5; *(uint8_t*)0x20000907 = 0; *(uint8_t*)0x20000908 = 0x10; *(uint16_t*)0x20000909 = 0x40; *(uint8_t*)0x2000090b = 8; *(uint8_t*)0x2000090c = 5; *(uint8_t*)0x2000090d = 1; *(uint8_t*)0x2000090e = 0x3a; *(uint8_t*)0x2000090f = 0xb; memcpy((void*)0x20000910, "\x7f\xb5\x5d\x7f\xde\x89\x25\x70\xb1\xc3\xb7\xc8\x6b\xe2\xe7\x85\x4d" "\x87\x53\xc7\xe8\x18\xba\xc4\xd3\x55\x87\x00\xf6\x57\xd6\x42\xf6\x47" "\xff\x42\xbc\xde\x5a\x9c\x6e\xe2\x30\x48\x0f\xec\xef\x64\xe9\xdb\xda" "\x02\xe7\x3e\xf3\xa6", 56); *(uint8_t*)0x20000948 = 9; *(uint8_t*)0x20000949 = 5; *(uint8_t*)0x2000094a = 2; *(uint8_t*)0x2000094b = 0; *(uint16_t*)0x2000094c = 0x10; *(uint8_t*)0x2000094e = 0x15; *(uint8_t*)0x2000094f = 4; *(uint8_t*)0x20000950 = 0x40; *(uint8_t*)0x20000951 = 0xe1; *(uint8_t*)0x20000952 = 0x10; memcpy( (void*)0x20000953, "\x2a\xa2\xbf\x1f\xcb\x32\x72\x30\x9f\x5f\xd0\x3f\x35\x78\x56\xa4\x63\x8e" "\xa6\x96\x11\xe2\x12\x9c\x80\xbb\xee\x13\x43\xc0\x53\xfc\x7b\x75\xc5\xd9" "\x04\x13\x68\x39\x96\x2e\x4a\xa5\xd9\x14\x76\x44\x68\x1f\x65\xb9\x99\xa9" "\xc2\x60\x72\xef\x47\xc6\x99\x09\x8a\xa5\x5d\xff\xbf\x1e\x30\x57\x4f\x3b" "\x96\xb6\x19\x32\x97\x2d\xd9\xa6\xa0\xe1\xfa\xac\xc3\xa9\x5d\x8e\x48\x02" "\xcf\x50\xc4\x7a\x55\xb9\x57\xe6\x1f\x49\x31\xad\x8b\xfa\x11\x38\xa4\xb1" "\xac\xdc\x94\x70\x87\x0b\xcb\xe7\x4f\x00\x23\xf9\xda\xf7\x7e\x10\x01\xce" "\x7b\x95\x83\x44\x9a\xac\xbb\xb5\x88\xa6\xb5\x17\x6e\x02\x08\x5b\x7a\xa0" "\x73\xe5\xf6\xa7\x48\x8f\x3b\x05\x57\xe5\xc8\x11\xcb\x33\x23\xfc\x00\x30" "\x52\xe9\x68\xbd\x97\x0c\x44\xc6\xb1\x21\x97\x21\xe2\x40\x5d\x49\x67\x8d" "\xa1\xf2\x2e\xba\x81\x91\x7f\xc8\x14\x24\x2c\xf2\x6c\x92\xae\xe3\x70\x12" "\xda\xa2\xd1\x03\x8e\xee\xae\x18\x3f\xc3\x79\xd8\xf3\x6d\x15\x1e\x05\x9c" "\x53\x9e\xc5\xd2\xda\xe2\x20", 223); *(uint8_t*)0x20000a32 = 7; *(uint8_t*)0x20000a33 = 0x25; *(uint8_t*)0x20000a34 = 1; *(uint8_t*)0x20000a35 = 2; *(uint8_t*)0x20000a36 = 0x80; *(uint16_t*)0x20000a37 = 1; *(uint8_t*)0x20000a39 = 9; *(uint8_t*)0x20000a3a = 5; *(uint8_t*)0x20000a3b = 9; *(uint8_t*)0x20000a3c = 0; *(uint16_t*)0x20000a3d = 0x10; *(uint8_t*)0x20000a3f = 1; *(uint8_t*)0x20000a40 = 3; *(uint8_t*)0x20000a41 = 0xd3; *(uint8_t*)0x20000a42 = 9; *(uint8_t*)0x20000a43 = 5; *(uint8_t*)0x20000a44 = 0; *(uint8_t*)0x20000a45 = 0; *(uint16_t*)0x20000a46 = 0x10; *(uint8_t*)0x20000a48 = 0x7b; *(uint8_t*)0x20000a49 = 8; *(uint8_t*)0x20000a4a = 0x20; *(uint8_t*)0x20000a4b = 7; *(uint8_t*)0x20000a4c = 0x25; *(uint8_t*)0x20000a4d = 1; *(uint8_t*)0x20000a4e = 0x81; *(uint8_t*)0x20000a4f = 8; *(uint16_t*)0x20000a50 = 1; *(uint8_t*)0x20000a52 = 7; *(uint8_t*)0x20000a53 = 0x25; *(uint8_t*)0x20000a54 = 1; *(uint8_t*)0x20000a55 = 1; *(uint8_t*)0x20000a56 = 0; *(uint16_t*)0x20000a57 = 3; *(uint8_t*)0x20000a59 = 9; *(uint8_t*)0x20000a5a = 5; *(uint8_t*)0x20000a5b = 6; *(uint8_t*)0x20000a5c = 0x10; *(uint16_t*)0x20000a5d = 0; *(uint8_t*)0x20000a5f = 6; *(uint8_t*)0x20000a60 = 0x5d; *(uint8_t*)0x20000a61 = 2; *(uint8_t*)0x20000a62 = 2; *(uint8_t*)0x20000a63 = 0x24; *(uint8_t*)0x20000a64 = 7; *(uint8_t*)0x20000a65 = 0x25; *(uint8_t*)0x20000a66 = 1; *(uint8_t*)0x20000a67 = 1; *(uint8_t*)0x20000a68 = 0x81; *(uint16_t*)0x20000a69 = 0xcc93; *(uint8_t*)0x20000a6b = 9; *(uint8_t*)0x20000a6c = 5; *(uint8_t*)0x20000a6d = 0xc; *(uint8_t*)0x20000a6e = 0x2c; *(uint16_t*)0x20000a6f = 0x200; *(uint8_t*)0x20000a71 = 5; *(uint8_t*)0x20000a72 = -1; *(uint8_t*)0x20000a73 = 0xfb; *(uint8_t*)0x20000a74 = 9; *(uint8_t*)0x20000a75 = 5; *(uint8_t*)0x20000a76 = 3; *(uint8_t*)0x20000a77 = 0x10; *(uint16_t*)0x20000a78 = 0x3ff; *(uint8_t*)0x20000a7a = 0x5a; *(uint8_t*)0x20000a7b = 0x3f; *(uint8_t*)0x20000a7c = 9; *(uint8_t*)0x20000a7d = 9; *(uint8_t*)0x20000a7e = 5; *(uint8_t*)0x20000a7f = 4; *(uint8_t*)0x20000a80 = 0; *(uint16_t*)0x20000a81 = 0x20; *(uint8_t*)0x20000a83 = 0; *(uint8_t*)0x20000a84 = 0x1f; *(uint8_t*)0x20000a85 = 1; *(uint8_t*)0x20000a86 = 2; *(uint8_t*)0x20000a87 = 6; *(uint8_t*)0x20000a88 = 2; *(uint8_t*)0x20000a89 = 0xa; *(uint8_t*)0x20000a8a = 9; *(uint8_t*)0x20000a8b = 5; *(uint8_t*)0x20000a8c = 4; *(uint8_t*)0x20000a8d = 4; *(uint16_t*)0x20000a8e = 0x20; *(uint8_t*)0x20000a90 = 0x68; *(uint8_t*)0x20000a91 = 1; *(uint8_t*)0x20000a92 = 0; *(uint8_t*)0x20000a93 = 9; *(uint8_t*)0x20000a94 = 5; *(uint8_t*)0x20000a95 = 0xb; *(uint8_t*)0x20000a96 = 0; *(uint16_t*)0x20000a97 = 0x400; *(uint8_t*)0x20000a99 = 0; *(uint8_t*)0x20000a9a = 1; *(uint8_t*)0x20000a9b = 0; *(uint8_t*)0x20000a9c = 7; *(uint8_t*)0x20000a9d = 0x25; *(uint8_t*)0x20000a9e = 1; *(uint8_t*)0x20000a9f = 2; *(uint8_t*)0x20000aa0 = 0xb1; *(uint16_t*)0x20000aa1 = 4; *(uint8_t*)0x20000aa3 = 2; *(uint8_t*)0x20000aa4 = 8; syz_usb_connect(3, 0x2e5, 0x200007c0, 0); *(uint8_t*)0x200005c0 = 0; *(uint8_t*)0x200005c1 = 0; *(uint16_t*)0x200005c2 = htobe16(0xa); memcpy((void*)0x200005c4, "\x2f\x65\xcc\x19", 4); *(uint16_t*)0x200005c8 = htobe16(3); *(uint16_t*)0x200005ca = htobe16(0); *(uint8_t*)0x200005cc = 0; *(uint8_t*)0x200005cd = 8; *(uint16_t*)0x200005ce = htobe16(0); *(uint8_t*)0x200005d0 = 0; *(uint8_t*)0x200005d1 = 0; syz_usb_ep_write(r[0], 0x83, 0x12, 0x200005c0); *(uint8_t*)0x20000040 = 0; *(uint8_t*)0x20000041 = 0; *(uint16_t*)0x20000042 = htobe16(0xa); memcpy((void*)0x20000044, "\x07\x12\x70\x6e", 4); *(uint16_t*)0x20000048 = htobe16(3); *(uint16_t*)0x2000004a = htobe16(0x100); *(uint8_t*)0x2000004c = 0; *(uint8_t*)0x2000004d = 0; *(uint16_t*)0x2000004e = htobe16(0); *(uint8_t*)0x20000050 = 0; *(uint8_t*)0x20000051 = 0; syz_usb_ep_write(r[0], 0x83, 0xffffffffffffff9c, 0x20000040); return 0; }