// 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 = 0x26; *(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*)0x200005c0 = 0; *(uint8_t*)0x200005c1 = 0; *(uint16_t*)0x200005c2 = htobe16(0xa); memcpy((void*)0x200005c4, "\x2f\x27\xcc\x7e", 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*)0x200007c0 = 0x12; *(uint8_t*)0x200007c1 = 1; *(uint16_t*)0x200007c2 = 0x200; *(uint8_t*)0x200007c4 = 0xad; *(uint8_t*)0x200007c5 = 0x55; *(uint8_t*)0x200007c6 = 0xa6; *(uint8_t*)0x200007c7 = 0x40; *(uint16_t*)0x200007c8 = 0x403; *(uint16_t*)0x200007ca = 0xfb99; *(uint16_t*)0x200007cc = 0x557b; *(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 = 0x3ad; *(uint8_t*)0x200007d6 = 3; *(uint8_t*)0x200007d7 = 0xbd; *(uint8_t*)0x200007d8 = 0x80; *(uint8_t*)0x200007d9 = 0x20; *(uint8_t*)0x200007da = 1; *(uint8_t*)0x200007db = 9; *(uint8_t*)0x200007dc = 4; *(uint8_t*)0x200007dd = 0x33; *(uint8_t*)0x200007de = 0x3e; *(uint8_t*)0x200007df = 0xa; *(uint8_t*)0x200007e0 = 0x46; *(uint8_t*)0x200007e1 = 0x7c; *(uint8_t*)0x200007e2 = 0xb9; *(uint8_t*)0x200007e3 = 4; *(uint8_t*)0x200007e4 = 9; *(uint8_t*)0x200007e5 = 5; *(uint8_t*)0x200007e6 = 3; *(uint8_t*)0x200007e7 = 1; *(uint16_t*)0x200007e8 = 8; *(uint8_t*)0x200007ea = 0x76; *(uint8_t*)0x200007eb = 0; *(uint8_t*)0x200007ec = 8; *(uint8_t*)0x200007ed = 7; *(uint8_t*)0x200007ee = 0x25; *(uint8_t*)0x200007ef = 1; *(uint8_t*)0x200007f0 = 0x83; *(uint8_t*)0x200007f1 = 1; *(uint16_t*)0x200007f2 = 0xfffc; *(uint8_t*)0x200007f4 = 0xf6; *(uint8_t*)0x200007f5 = 0; memcpy( (void*)0x200007f6, "\xa4\xd6\xe3\xf6\xee\xdb\xfd\x10\xf0\x60\xd7\x4b\xa7\xdd\x4d\x3f\x32\xaa" "\xca\x32\xeb\x96\xbe\xb9\x28\x75\xe9\xa7\xd1\xa9\x93\x13\xd4\x56\x23\xfd" "\x8e\xda\xd2\xc6\x80\x59\xaf\x00\x64\x89\x9e\xf5\x5b\xf3\xc8\xe3\x58\x86" "\x3f\x9e\x91\x4c\xfe\x72\x54\xf8\x3c\xb8\xe6\x47\x2e\xf0\xcd\x8c\xed\xa9" "\x6c\xfc\xfd\x1d\xaa\x95\xe7\xb4\xb0\xcf\x96\x12\x40\x6e\x0a\xd2\x2c\xb6" "\x06\x8b\xf5\x08\x99\xc6\x01\x58\x02\x13\x68\xfb\x73\x12\x10\xf9\x64\xe5" "\x5c\xd2\xdc\x47\x07\xb9\x49\x55\x4d\x88\x1b\x64\xec\x06\x6d\x35\xd8\x02" "\xd6\xd0\x98\x76\xc1\x60\x69\x94\x8f\x7f\x49\xba\x75\x8f\xa9\xa4\x0b\x36" "\xab\x57\xd0\x00\x73\x76\xd2\x6b\xe7\xc3\x9e\xce\xd6\x21\x09\x77\x9c\x1d" "\x58\x00\x38\xde\xae\x5b\x28\xff\x54\xe6\x4d\x6f\x1f\x95\x78\x98\xd6\x96" "\x5f\x6f\x61\x13\xd5\xe2\x35\xa0\x91\x1b\x63\xc6\x5c\x3b\x60\xac\xa9\x83" "\x86\x45\x75\xca\x9d\xde\x3b\x31\xfe\xe3\xab\x27\x46\xb3\x21\x78\xcb\x52" "\x37\xb8\xbb\xba\x80\x67\xaa\x97\xed\x5c\x1f\xdc\xa4\x1b\xf0\xdd\x45\xc8" "\xef\x7b\x3b\xc2\xc4\x72\xda\xd0\xa0\x35", 244); *(uint8_t*)0x200008ea = 9; *(uint8_t*)0x200008eb = 5; *(uint8_t*)0x200008ec = 8; *(uint8_t*)0x200008ed = 0x10; *(uint16_t*)0x200008ee = 0x200; *(uint8_t*)0x200008f0 = 0x21; *(uint8_t*)0x200008f1 = 0xef; *(uint8_t*)0x200008f2 = 0xfe; *(uint8_t*)0x200008f3 = 9; *(uint8_t*)0x200008f4 = 5; *(uint8_t*)0x200008f5 = 0x83; *(uint8_t*)0x200008f6 = 1; *(uint16_t*)0x200008f7 = 0x40; *(uint8_t*)0x200008f9 = 0x20; *(uint8_t*)0x200008fa = 6; *(uint8_t*)0x200008fb = 0x40; *(uint8_t*)0x200008fc = 9; *(uint8_t*)0x200008fd = 5; *(uint8_t*)0x200008fe = 0xa; *(uint8_t*)0x200008ff = 0x11; *(uint16_t*)0x20000900 = 0x10; *(uint8_t*)0x20000902 = 0x3f; *(uint8_t*)0x20000903 = 1; *(uint8_t*)0x20000904 = 2; *(uint8_t*)0x20000905 = 2; *(uint8_t*)0x20000906 = 0x28; *(uint8_t*)0x20000907 = 9; *(uint8_t*)0x20000908 = 5; *(uint8_t*)0x20000909 = 5; *(uint8_t*)0x2000090a = 0; *(uint16_t*)0x2000090b = 0x3ff; *(uint8_t*)0x2000090d = 2; *(uint8_t*)0x2000090e = 2; *(uint8_t*)0x2000090f = 2; *(uint8_t*)0x20000910 = 9; *(uint8_t*)0x20000911 = 5; *(uint8_t*)0x20000912 = 4; *(uint8_t*)0x20000913 = 0; *(uint16_t*)0x20000914 = 8; *(uint8_t*)0x20000916 = 3; *(uint8_t*)0x20000917 = 7; *(uint8_t*)0x20000918 = 0x8e; *(uint8_t*)0x20000919 = 9; *(uint8_t*)0x2000091a = 5; *(uint8_t*)0x2000091b = 6; *(uint8_t*)0x2000091c = 0x10; *(uint16_t*)0x2000091d = 0x20; *(uint8_t*)0x2000091f = 7; *(uint8_t*)0x20000920 = 0; *(uint8_t*)0x20000921 = 5; *(uint8_t*)0x20000922 = 7; *(uint8_t*)0x20000923 = 0x25; *(uint8_t*)0x20000924 = 1; *(uint8_t*)0x20000925 = 0x81; *(uint8_t*)0x20000926 = 6; *(uint16_t*)0x20000927 = 6; *(uint8_t*)0x20000929 = 9; *(uint8_t*)0x2000092a = 5; *(uint8_t*)0x2000092b = 0xd; *(uint8_t*)0x2000092c = 0x14; *(uint16_t*)0x2000092d = 8; *(uint8_t*)0x2000092f = 5; *(uint8_t*)0x20000930 = 0x7f; *(uint8_t*)0x20000931 = 0x80; *(uint8_t*)0x20000932 = 9; *(uint8_t*)0x20000933 = 5; *(uint8_t*)0x20000934 = 5; *(uint8_t*)0x20000935 = 1; *(uint16_t*)0x20000936 = 8; *(uint8_t*)0x20000938 = 0x1f; *(uint8_t*)0x20000939 = 0; *(uint8_t*)0x2000093a = -1; *(uint8_t*)0x2000093b = 7; *(uint8_t*)0x2000093c = 0x25; *(uint8_t*)0x2000093d = 1; *(uint8_t*)0x2000093e = 0; *(uint8_t*)0x2000093f = 6; *(uint16_t*)0x20000940 = 6; *(uint8_t*)0x20000942 = 0x57; *(uint8_t*)0x20000943 = 0x30; memcpy((void*)0x20000944, "\x08\x71\x0a\xd5\x65\x06\x51\x02\x4d\xd9\xeb\x75\x96\x87\x5c\xda\x00" "\xba\x1b\x53\x53\xed\x7b\x9c\x86\x2b\x62\xe9\xb1\x9b\x12\x83\x2e\x3c" "\x31\x3c\xd7\x6e\xe7\x00\x5a\xa7\x48\x78\x35\x76\xac\x1f\x0e\xcd\x16" "\x72\x57\x17\x99\x68\xc3\x73\x1e\xfe\x40\x40\x29\x82\x04\xda\xac\x13" "\x25\x46\xcd\xa6\x13\x89\xc3\xc6\xb6\xe7\x5e\x85\xfa\x03\x36\x19\xe2", 85); *(uint8_t*)0x20000999 = 9; *(uint8_t*)0x2000099a = 5; *(uint8_t*)0x2000099b = 0xf; *(uint8_t*)0x2000099c = 0x10; *(uint16_t*)0x2000099d = 8; *(uint8_t*)0x2000099f = 0x80; *(uint8_t*)0x200009a0 = 0x80; *(uint8_t*)0x200009a1 = 0x81; *(uint8_t*)0x200009a2 = 7; *(uint8_t*)0x200009a3 = 0x25; *(uint8_t*)0x200009a4 = 1; *(uint8_t*)0x200009a5 = 0x80; *(uint8_t*)0x200009a6 = 0x7f; *(uint16_t*)0x200009a7 = 0xa5b9; *(uint8_t*)0x200009a9 = 0x50; *(uint8_t*)0x200009aa = 0x31; memcpy((void*)0x200009ab, "\xcb\xc9\xf3\x61\x16\x85\xa1\x62\xb0\x91\x15\x26\x2e\x0e\xa5\x89\xee" "\x12\x57\xc2\x41\x71\xc9\xe3\xd2\x3f\x58\xc1\x49\x89\xb6\xb3\xc3\x7f" "\xb2\xeb\xbc\xfe\xe4\xff\xfe\xea\x64\x20\x77\x7e\xf1\xa8\x9d\x14\x7b" "\x87\x51\xe5\xe6\xfb\x2a\xa1\x95\x47\x79\x0f\x9b\x46\xcf\xf9\x6a\x61" "\x7f\xad\xcf\xb8\x73\x41\xa6\x2f\x28\x4b", 78); *(uint8_t*)0x200009f9 = 9; *(uint8_t*)0x200009fa = 4; *(uint8_t*)0x200009fb = 0x9f; *(uint8_t*)0x200009fc = 0; *(uint8_t*)0x200009fd = 0xb; *(uint8_t*)0x200009fe = 0xd8; *(uint8_t*)0x200009ff = 0x74; *(uint8_t*)0x20000a00 = 0xde; *(uint8_t*)0x20000a01 = 6; *(uint8_t*)0x20000a02 = 9; *(uint8_t*)0x20000a03 = 5; *(uint8_t*)0x20000a04 = 7; *(uint8_t*)0x20000a05 = 0x10; *(uint16_t*)0x20000a06 = 0x20; *(uint8_t*)0x20000a08 = 6; *(uint8_t*)0x20000a09 = 1; *(uint8_t*)0x20000a0a = 0x12; *(uint8_t*)0x20000a0b = 9; *(uint8_t*)0x20000a0c = 5; *(uint8_t*)0x20000a0d = 0xf; *(uint8_t*)0x20000a0e = 0; *(uint16_t*)0x20000a0f = 0x20; *(uint8_t*)0x20000a11 = 3; *(uint8_t*)0x20000a12 = 0x20; *(uint8_t*)0x20000a13 = -1; *(uint8_t*)0x20000a14 = 0x6d; *(uint8_t*)0x20000a15 = 0x22; memcpy( (void*)0x20000a16, "\x8e\x5d\x5a\xc1\x03\xd5\x9a\xa4\x4b\x93\xc4\xed\x26\x8a\x76\x4d\x12\x8e" "\x95\x7b\x07\xc6\xec\xae\xec\x22\x9e\x2e\x90\xdd\x22\x09\xcf\x40\xe0\xf6" "\xc3\xf2\x0d\x09\xb5\x86\x14\xec\xeb\x47\xcb\x2e\x8c\xe5\x8a\xd6\xa9\x73" "\x27\xe4\x48\x47\x41\x7f\xea\x1d\x86\xfc\xa4\x16\xc4\x4c\x87\x34\x13\x32" "\x63\x57\xbb\xf6\x82\xae\x3c\x9f\xad\xc3\x13\x88\x41\xb6\x67\xad\xc7\x03" "\x32\x65\x32\x9d\xf7\x65\xd9\xb7\x20\x3a\x0f\x22\x05\xc5\x2e\x69\x1e", 107); *(uint8_t*)0x20000a81 = 9; *(uint8_t*)0x20000a82 = 5; *(uint8_t*)0x20000a83 = 0; *(uint8_t*)0x20000a84 = 4; *(uint16_t*)0x20000a85 = 0x40; *(uint8_t*)0x20000a87 = 0x3f; *(uint8_t*)0x20000a88 = 4; *(uint8_t*)0x20000a89 = 0xa2; *(uint8_t*)0x20000a8a = 2; *(uint8_t*)0x20000a8b = 0xa; *(uint8_t*)0x20000a8c = 7; *(uint8_t*)0x20000a8d = 0x25; *(uint8_t*)0x20000a8e = 1; *(uint8_t*)0x20000a8f = 2; *(uint8_t*)0x20000a90 = 3; *(uint16_t*)0x20000a91 = 0x55; *(uint8_t*)0x20000a93 = 9; *(uint8_t*)0x20000a94 = 5; *(uint8_t*)0x20000a95 = 0xb; *(uint8_t*)0x20000a96 = 0x10; *(uint16_t*)0x20000a97 = 0x40; *(uint8_t*)0x20000a99 = 3; *(uint8_t*)0x20000a9a = 3; *(uint8_t*)0x20000a9b = 5; *(uint8_t*)0x20000a9c = 7; *(uint8_t*)0x20000a9d = 0x25; *(uint8_t*)0x20000a9e = 1; *(uint8_t*)0x20000a9f = 2; *(uint8_t*)0x20000aa0 = 4; *(uint16_t*)0x20000aa1 = 6; *(uint8_t*)0x20000aa3 = 7; *(uint8_t*)0x20000aa4 = 0x25; *(uint8_t*)0x20000aa5 = 1; *(uint8_t*)0x20000aa6 = 0; *(uint8_t*)0x20000aa7 = 3; *(uint16_t*)0x20000aa8 = 4; *(uint8_t*)0x20000aaa = 9; *(uint8_t*)0x20000aab = 5; *(uint8_t*)0x20000aac = 0xe; *(uint8_t*)0x20000aad = 0xc; *(uint16_t*)0x20000aae = 0x3ff; *(uint8_t*)0x20000ab0 = 0x3f; *(uint8_t*)0x20000ab1 = 8; *(uint8_t*)0x20000ab2 = 9; *(uint8_t*)0x20000ab3 = 9; *(uint8_t*)0x20000ab4 = 5; *(uint8_t*)0x20000ab5 = 0; *(uint8_t*)0x20000ab6 = 0; *(uint16_t*)0x20000ab7 = 0; *(uint8_t*)0x20000ab9 = 0x14; *(uint8_t*)0x20000aba = 6; *(uint8_t*)0x20000abb = 1; *(uint8_t*)0x20000abc = 7; *(uint8_t*)0x20000abd = 0x25; *(uint8_t*)0x20000abe = 1; *(uint8_t*)0x20000abf = 0x81; *(uint8_t*)0x20000ac0 = 8; *(uint16_t*)0x20000ac1 = 7; *(uint8_t*)0x20000ac3 = 9; *(uint8_t*)0x20000ac4 = 5; *(uint8_t*)0x20000ac5 = 0xf; *(uint8_t*)0x20000ac6 = 0; *(uint16_t*)0x20000ac7 = 8; *(uint8_t*)0x20000ac9 = 3; *(uint8_t*)0x20000aca = 0x80; *(uint8_t*)0x20000acb = 0x1f; *(uint8_t*)0x20000acc = 7; *(uint8_t*)0x20000acd = 0x25; *(uint8_t*)0x20000ace = 1; *(uint8_t*)0x20000acf = 3; *(uint8_t*)0x20000ad0 = 0; *(uint16_t*)0x20000ad1 = 8; *(uint8_t*)0x20000ad3 = 9; *(uint8_t*)0x20000ad4 = 5; *(uint8_t*)0x20000ad5 = 0x80; *(uint8_t*)0x20000ad6 = 0x10; *(uint16_t*)0x20000ad7 = 0x400; *(uint8_t*)0x20000ad9 = 0x28; *(uint8_t*)0x20000ada = 0xf7; *(uint8_t*)0x20000adb = 0x80; *(uint8_t*)0x20000adc = 2; *(uint8_t*)0x20000add = 0x22; *(uint8_t*)0x20000ade = 9; *(uint8_t*)0x20000adf = 5; *(uint8_t*)0x20000ae0 = 3; *(uint8_t*)0x20000ae1 = 8; *(uint16_t*)0x20000ae2 = 0x200; *(uint8_t*)0x20000ae4 = 0x7d; *(uint8_t*)0x20000ae5 = 1; *(uint8_t*)0x20000ae6 = 9; *(uint8_t*)0x20000ae7 = 9; *(uint8_t*)0x20000ae8 = 5; *(uint8_t*)0x20000ae9 = 1; *(uint8_t*)0x20000aea = 3; *(uint16_t*)0x20000aeb = 0x40; *(uint8_t*)0x20000aed = 7; *(uint8_t*)0x20000aee = 0x40; *(uint8_t*)0x20000aef = 0xcc; *(uint8_t*)0x20000af0 = 9; *(uint8_t*)0x20000af1 = 5; *(uint8_t*)0x20000af2 = 6; *(uint8_t*)0x20000af3 = 3; *(uint16_t*)0x20000af4 = 0x40; *(uint8_t*)0x20000af6 = 4; *(uint8_t*)0x20000af7 = 2; *(uint8_t*)0x20000af8 = 0; *(uint8_t*)0x20000af9 = 7; *(uint8_t*)0x20000afa = 0x25; *(uint8_t*)0x20000afb = 1; *(uint8_t*)0x20000afc = 0x82; *(uint8_t*)0x20000afd = 0xb0; *(uint16_t*)0x20000afe = 0xfff9; *(uint8_t*)0x20000b00 = 2; *(uint8_t*)0x20000b01 = 0x11; *(uint8_t*)0x20000b02 = 9; *(uint8_t*)0x20000b03 = 4; *(uint8_t*)0x20000b04 = 0xc0; *(uint8_t*)0x20000b05 = 6; *(uint8_t*)0x20000b06 = 0xb; *(uint8_t*)0x20000b07 = 0x92; *(uint8_t*)0x20000b08 = 0x33; *(uint8_t*)0x20000b09 = 0x71; *(uint8_t*)0x20000b0a = 4; *(uint8_t*)0x20000b0b = 2; *(uint8_t*)0x20000b0c = 6; *(uint8_t*)0x20000b0d = 2; *(uint8_t*)0x20000b0e = 0x11; *(uint8_t*)0x20000b0f = 9; *(uint8_t*)0x20000b10 = 5; *(uint8_t*)0x20000b11 = 7; *(uint8_t*)0x20000b12 = 3; *(uint16_t*)0x20000b13 = 0x3ff; *(uint8_t*)0x20000b15 = 8; *(uint8_t*)0x20000b16 = 5; *(uint8_t*)0x20000b17 = 0x2b; *(uint8_t*)0x20000b18 = 9; *(uint8_t*)0x20000b19 = 5; *(uint8_t*)0x20000b1a = 4; *(uint8_t*)0x20000b1b = 0; *(uint16_t*)0x20000b1c = 0x10; *(uint8_t*)0x20000b1e = 0x81; *(uint8_t*)0x20000b1f = 0xb0; *(uint8_t*)0x20000b20 = 0xe2; *(uint8_t*)0x20000b21 = 2; *(uint8_t*)0x20000b22 = 0x31; *(uint8_t*)0x20000b23 = 2; *(uint8_t*)0x20000b24 = 0x31; *(uint8_t*)0x20000b25 = 9; *(uint8_t*)0x20000b26 = 5; *(uint8_t*)0x20000b27 = 7; *(uint8_t*)0x20000b28 = 0xc; *(uint16_t*)0x20000b29 = 0x20; *(uint8_t*)0x20000b2b = 0; *(uint8_t*)0x20000b2c = 0x20; *(uint8_t*)0x20000b2d = 0xc9; *(uint8_t*)0x20000b2e = 9; *(uint8_t*)0x20000b2f = 5; *(uint8_t*)0x20000b30 = 0xb; *(uint8_t*)0x20000b31 = 0x10; *(uint16_t*)0x20000b32 = 0x10; *(uint8_t*)0x20000b34 = 0xfb; *(uint8_t*)0x20000b35 = 1; *(uint8_t*)0x20000b36 = 9; *(uint8_t*)0x20000b37 = 2; *(uint8_t*)0x20000b38 = 2; *(uint8_t*)0x20000b39 = 9; *(uint8_t*)0x20000b3a = 5; *(uint8_t*)0x20000b3b = 0xb; *(uint8_t*)0x20000b3c = 0; *(uint16_t*)0x20000b3d = 0x200; *(uint8_t*)0x20000b3f = 0x20; *(uint8_t*)0x20000b40 = 0xe1; *(uint8_t*)0x20000b41 = 0x73; *(uint8_t*)0x20000b42 = 7; *(uint8_t*)0x20000b43 = 0x25; *(uint8_t*)0x20000b44 = 1; *(uint8_t*)0x20000b45 = 1; *(uint8_t*)0x20000b46 = 0x81; *(uint16_t*)0x20000b47 = 3; *(uint8_t*)0x20000b49 = 9; *(uint8_t*)0x20000b4a = 5; *(uint8_t*)0x20000b4b = 0x6b; *(uint8_t*)0x20000b4c = 0; *(uint16_t*)0x20000b4d = 0x400; *(uint8_t*)0x20000b4f = 0; *(uint8_t*)0x20000b50 = 0xd8; *(uint8_t*)0x20000b51 = 0x1f; *(uint8_t*)0x20000b52 = 9; *(uint8_t*)0x20000b53 = 5; *(uint8_t*)0x20000b54 = 4; *(uint8_t*)0x20000b55 = 8; *(uint16_t*)0x20000b56 = 0x20; *(uint8_t*)0x20000b58 = 0x20; *(uint8_t*)0x20000b59 = 3; *(uint8_t*)0x20000b5a = 4; *(uint8_t*)0x20000b5b = 9; *(uint8_t*)0x20000b5c = 5; *(uint8_t*)0x20000b5d = 3; *(uint8_t*)0x20000b5e = 0xc; *(uint16_t*)0x20000b5f = 0x8706; *(uint8_t*)0x20000b61 = 0x7f; *(uint8_t*)0x20000b62 = 0x83; *(uint8_t*)0x20000b63 = 0x40; *(uint8_t*)0x20000b64 = 9; *(uint8_t*)0x20000b65 = 5; *(uint8_t*)0x20000b66 = 9; *(uint8_t*)0x20000b67 = 2; *(uint16_t*)0x20000b68 = 0x200; *(uint8_t*)0x20000b6a = 2; *(uint8_t*)0x20000b6b = 9; *(uint8_t*)0x20000b6c = 1; *(uint8_t*)0x20000b6d = 9; *(uint8_t*)0x20000b6e = 5; *(uint8_t*)0x20000b6f = 3; *(uint8_t*)0x20000b70 = 0x10; *(uint16_t*)0x20000b71 = 0x10; *(uint8_t*)0x20000b73 = 6; *(uint8_t*)0x20000b74 = 0; *(uint8_t*)0x20000b75 = 0xfd; *(uint8_t*)0x20000b76 = 9; *(uint8_t*)0x20000b77 = 5; *(uint8_t*)0x20000b78 = 0; *(uint8_t*)0x20000b79 = 0; *(uint16_t*)0x20000b7a = 0x40; *(uint8_t*)0x20000b7c = 8; *(uint8_t*)0x20000b7d = 3; *(uint8_t*)0x20000b7e = 0x3d; syz_usb_connect(3, 0x3bf, 0x200007c0, 0); *(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; }