// https://syzkaller.appspot.com/bug?id=c460ff5b3449df3262fc61daa98049537831ce37 // 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 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; }; 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; } #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); } #define MAX_USB_FDS 6 struct usb_info { int fd; struct usb_device_index index; }; static struct usb_info usb_devices[MAX_USB_FDS]; static int usb_devices_num; 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 >= MAX_USB_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 < MAX_USB_FDS; i++) { if (__atomic_load_n(&usb_devices[i].fd, __ATOMIC_ACQUIRE) == fd) { return &usb_devices[i].index; } } return NULL; } 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]; }; 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; } 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; } typedef bool (*lookup_connect_response_t)( int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, bool* done); 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_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); } int main(void) { syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0ul); *(uint8_t*)0x20000000 = 0x12; *(uint8_t*)0x20000001 = 1; *(uint16_t*)0x20000002 = 0x201; *(uint8_t*)0x20000004 = 0x29; *(uint8_t*)0x20000005 = 0x5e; *(uint8_t*)0x20000006 = 0xa0; *(uint8_t*)0x20000007 = 0x40; *(uint16_t*)0x20000008 = 0x4bb; *(uint16_t*)0x2000000a = 0xa0e; *(uint16_t*)0x2000000c = 0x7344; *(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 = 0x49e; *(uint8_t*)0x20000016 = 4; *(uint8_t*)0x20000017 = 0x1f; *(uint8_t*)0x20000018 = 9; *(uint8_t*)0x20000019 = 0x20; *(uint8_t*)0x2000001a = 3; *(uint8_t*)0x2000001b = 9; *(uint8_t*)0x2000001c = 4; *(uint8_t*)0x2000001d = 0x44; *(uint8_t*)0x2000001e = 3; *(uint8_t*)0x2000001f = 0; *(uint8_t*)0x20000020 = 0x68; *(uint8_t*)0x20000021 = 0x80; *(uint8_t*)0x20000022 = 0xfe; *(uint8_t*)0x20000023 = 0xf7; *(uint8_t*)0x20000024 = 9; *(uint8_t*)0x20000025 = 4; *(uint8_t*)0x20000026 = 0xa3; *(uint8_t*)0x20000027 = 3; *(uint8_t*)0x20000028 = 4; *(uint8_t*)0x20000029 = 0xef; *(uint8_t*)0x2000002a = 6; *(uint8_t*)0x2000002b = 0xb7; *(uint8_t*)0x2000002c = 0x9a; *(uint8_t*)0x2000002d = 9; *(uint8_t*)0x2000002e = 5; *(uint8_t*)0x2000002f = 4; *(uint8_t*)0x20000030 = 0xc; *(uint16_t*)0x20000031 = 0; *(uint8_t*)0x20000033 = 3; *(uint8_t*)0x20000034 = 0; *(uint8_t*)0x20000035 = 2; *(uint8_t*)0x20000036 = 7; *(uint8_t*)0x20000037 = 0x25; *(uint8_t*)0x20000038 = 1; *(uint8_t*)0x20000039 = 0x83; *(uint8_t*)0x2000003a = 0x6a; *(uint16_t*)0x2000003b = 6; *(uint8_t*)0x2000003d = 2; *(uint8_t*)0x2000003e = 4; *(uint8_t*)0x2000003f = 9; *(uint8_t*)0x20000040 = 5; *(uint8_t*)0x20000041 = 0xe; *(uint8_t*)0x20000042 = 8; *(uint16_t*)0x20000043 = 0x10; *(uint8_t*)0x20000045 = 2; *(uint8_t*)0x20000046 = 6; *(uint8_t*)0x20000047 = 0x3f; *(uint8_t*)0x20000048 = 2; *(uint8_t*)0x20000049 = 0x10; *(uint8_t*)0x2000004a = 9; *(uint8_t*)0x2000004b = 5; *(uint8_t*)0x2000004c = 0xf; *(uint8_t*)0x2000004d = 0; *(uint16_t*)0x2000004e = 0x400; *(uint8_t*)0x20000050 = 0x1f; *(uint8_t*)0x20000051 = 0x1f; *(uint8_t*)0x20000052 = 1; *(uint8_t*)0x20000053 = 7; *(uint8_t*)0x20000054 = 0x25; *(uint8_t*)0x20000055 = 1; *(uint8_t*)0x20000056 = 0; *(uint8_t*)0x20000057 = -1; *(uint16_t*)0x20000058 = 5; *(uint8_t*)0x2000005a = 9; *(uint8_t*)0x2000005b = 5; *(uint8_t*)0x2000005c = 0xe; *(uint8_t*)0x2000005d = 0; *(uint16_t*)0x2000005e = 0x10; *(uint8_t*)0x20000060 = 0xb; *(uint8_t*)0x20000061 = 0xa3; *(uint8_t*)0x20000062 = 1; *(uint8_t*)0x20000063 = 0x86; *(uint8_t*)0x20000064 = 0x21; memcpy((void*)0x20000065, "\xd5\xdb\x3e\x8f\x02\xef\x1f\x08\x22\xd6\x72\x7d\xae\x82\x65\xe6\xcd" "\xcd\x3c\xbe\xf0\x6f\x1c\xdb\xa3\x6b\x20\x5a\xf7\x2f\x0d\x80\x95\x36" "\x16\xd3\xc9\x81\x35\xf3\x72\xc7\x89\x82\x73\xac\x74\xa1\x72\xa3\x41" "\x85\xa8\xc4\xa5\xe0\xaa\xd2\x9f\xb8\xc8\xbe\x5a\xa6\x93\x53\xc8\xbc" "\x39\x30\x81\xbf\x5e\x88\xd5\xf7\x81\x29\x04\x8f\x2b\xaa\x1e\x8d\xd5" "\xcb\x2a\x45\x7d\x80\x41\xd1\x19\x11\x5b\x6b\xb7\x38\x90\xc8\x8e\xa2" "\x9a\xc4\x7f\xe8\xe9\x2d\xca\x38\xe0\xc1\x29\x08\x4c\x4e\xb5\xb6\x8a" "\x93\x74\x32\x2f\x7c\x5e\xdf\x9f\x72\xf9\x7d\xbc\xab", 132); *(uint8_t*)0x200000e9 = 2; *(uint8_t*)0x200000ea = 9; *(uint8_t*)0x200000eb = 9; *(uint8_t*)0x200000ec = 4; *(uint8_t*)0x200000ed = 0x25; *(uint8_t*)0x200000ee = 8; *(uint8_t*)0x200000ef = 0xd; *(uint8_t*)0x200000f0 = 0xe0; *(uint8_t*)0x200000f1 = 2; *(uint8_t*)0x200000f2 = 1; *(uint8_t*)0x200000f3 = 0x40; *(uint8_t*)0x200000f4 = 8; *(uint8_t*)0x200000f5 = 0x24; *(uint8_t*)0x200000f6 = 2; *(uint8_t*)0x200000f7 = 1; *(uint8_t*)0x200000f8 = 4; *(uint8_t*)0x200000f9 = 3; *(uint8_t*)0x200000fa = 5; *(uint8_t*)0x200000fb = 4; *(uint8_t*)0x200000fc = 8; *(uint8_t*)0x200000fd = 0x24; *(uint8_t*)0x200000fe = 2; *(uint8_t*)0x200000ff = 1; *(uint8_t*)0x20000100 = 0xf7; *(uint8_t*)0x20000101 = 1; *(uint8_t*)0x20000102 = 4; *(uint8_t*)0x20000103 = 0x1f; *(uint8_t*)0x20000104 = 7; *(uint8_t*)0x20000105 = 0x24; *(uint8_t*)0x20000106 = 1; *(uint8_t*)0x20000107 = 0x28; *(uint8_t*)0x20000108 = 5; *(uint16_t*)0x20000109 = 4; *(uint8_t*)0x2000010b = 9; *(uint8_t*)0x2000010c = 5; *(uint8_t*)0x2000010d = 8; *(uint8_t*)0x2000010e = 0; *(uint16_t*)0x2000010f = 0x10; *(uint8_t*)0x20000111 = 5; *(uint8_t*)0x20000112 = 7; *(uint8_t*)0x20000113 = 1; *(uint8_t*)0x20000114 = 0x42; *(uint8_t*)0x20000115 = 0xc; memcpy((void*)0x20000116, "\x95\x03\x12\x81\xea\xcd\x13\x9c\x1a\xef\x62\xd7\x0f\xc2\xd0\xb7\xa9" "\x14\xc8\x69\x78\x6c\xce\x8d\x99\x8e\xc8\x4d\x88\xc3\xb6\x15\x61\x53" "\xfb\x8b\xbc\xe3\xb9\x4f\xf2\x48\xd6\x92\x47\xbc\x2b\xa2\x23\xa8\x29" "\xca\xe0\xfc\xb7\x20\x62\x24\x85\x49\x9b\x74\xad\x68", 64); *(uint8_t*)0x20000156 = 9; *(uint8_t*)0x20000157 = 5; *(uint8_t*)0x20000158 = 0xc; *(uint8_t*)0x20000159 = 0x10; *(uint16_t*)0x2000015a = 0x3ff; *(uint8_t*)0x2000015c = 0; *(uint8_t*)0x2000015d = 0x80; *(uint8_t*)0x2000015e = 6; *(uint8_t*)0x2000015f = 9; *(uint8_t*)0x20000160 = 5; *(uint8_t*)0x20000161 = 8; *(uint8_t*)0x20000162 = 0x10; *(uint16_t*)0x20000163 = 0x10; *(uint8_t*)0x20000165 = 9; *(uint8_t*)0x20000166 = 1; *(uint8_t*)0x20000167 = 0; *(uint8_t*)0x20000168 = 7; *(uint8_t*)0x20000169 = 0x25; *(uint8_t*)0x2000016a = 1; *(uint8_t*)0x2000016b = 0x80; *(uint8_t*)0x2000016c = 9; *(uint16_t*)0x2000016d = 0x800; *(uint8_t*)0x2000016f = 2; *(uint8_t*)0x20000170 = 0xe7; *(uint8_t*)0x20000171 = 9; *(uint8_t*)0x20000172 = 5; *(uint8_t*)0x20000173 = 1; *(uint8_t*)0x20000174 = 0x10; *(uint16_t*)0x20000175 = 0x10; *(uint8_t*)0x20000177 = 4; *(uint8_t*)0x20000178 = 0xd8; *(uint8_t*)0x20000179 = 1; *(uint8_t*)0x2000017a = 9; *(uint8_t*)0x2000017b = 5; *(uint8_t*)0x2000017c = 1; *(uint8_t*)0x2000017d = 1; *(uint16_t*)0x2000017e = 0x40; *(uint8_t*)0x20000180 = 0x20; *(uint8_t*)0x20000181 = 4; *(uint8_t*)0x20000182 = 4; *(uint8_t*)0x20000183 = 7; *(uint8_t*)0x20000184 = 0x25; *(uint8_t*)0x20000185 = 1; *(uint8_t*)0x20000186 = 0x82; *(uint8_t*)0x20000187 = 0; *(uint16_t*)0x20000188 = 0x81; *(uint8_t*)0x2000018a = 2; *(uint8_t*)0x2000018b = 0x24; *(uint8_t*)0x2000018c = 9; *(uint8_t*)0x2000018d = 5; *(uint8_t*)0x2000018e = 2; *(uint8_t*)0x2000018f = 0; *(uint16_t*)0x20000190 = 0x10; *(uint8_t*)0x20000192 = 0x80; *(uint8_t*)0x20000193 = 0; *(uint8_t*)0x20000194 = 8; *(uint8_t*)0x20000195 = 7; *(uint8_t*)0x20000196 = 0x25; *(uint8_t*)0x20000197 = 1; *(uint8_t*)0x20000198 = 2; *(uint8_t*)0x20000199 = 4; *(uint16_t*)0x2000019a = 9; *(uint8_t*)0x2000019c = 7; *(uint8_t*)0x2000019d = 0x25; *(uint8_t*)0x2000019e = 1; *(uint8_t*)0x2000019f = 2; *(uint8_t*)0x200001a0 = 0x7f; *(uint16_t*)0x200001a1 = 0x40; *(uint8_t*)0x200001a3 = 9; *(uint8_t*)0x200001a4 = 5; *(uint8_t*)0x200001a5 = 0xf; *(uint8_t*)0x200001a6 = 1; *(uint16_t*)0x200001a7 = 0x400; *(uint8_t*)0x200001a9 = -1; *(uint8_t*)0x200001aa = 0; *(uint8_t*)0x200001ab = 5; *(uint8_t*)0x200001ac = 9; *(uint8_t*)0x200001ad = 5; *(uint8_t*)0x200001ae = 2; *(uint8_t*)0x200001af = 8; *(uint16_t*)0x200001b0 = 0x3ff; *(uint8_t*)0x200001b2 = 8; *(uint8_t*)0x200001b3 = 6; *(uint8_t*)0x200001b4 = 7; *(uint8_t*)0x200001b5 = 0x86; *(uint8_t*)0x200001b6 = 9; memcpy((void*)0x200001b7, "\x2c\x43\x78\x1a\x3e\xf1\x11\x1f\x93\x96\x70\x87\xdb\xe3\x69\xf7\x45" "\xd3\x74\x6e\x9e\x9c\x8a\x54\xe0\x0b\xe1\x6e\xc4\x12\x09\x63\xb7\x75" "\x44\x22\x29\x36\x30\xd4\x08\x25\xdd\x33\x38\x6a\x71\x1b\xe8\xf7\x92" "\x1c\x75\x0a\xe8\x5e\xf4\x19\xdb\xf0\xcc\x6e\x44\x3e\x05\x6a\x7b\xb4" "\x93\xb5\xfd\x02\x33\xbc\x42\x56\xc9\xed\x5f\x4d\xd3\x7e\x9a\x25\xe7" "\x5f\x85\x3c\x57\x7d\xd4\x99\x7b\xc3\x4c\x63\xbb\x78\x30\xa5\x36\x55" "\xa6\x68\x64\x10\xdd\x59\x1d\x48\xc5\x23\xa7\x97\x59\xe5\xb5\x03\x1c" "\x18\x5f\x48\xc3\x67\x73\x46\x8b\x49\x39\xce\xf9\x88", 132); *(uint8_t*)0x2000023b = 0xb5; *(uint8_t*)0x2000023c = 0xd; memcpy((void*)0x2000023d, "\x85\x41\x91\x0e\xa0\x6c\x91\xc0\xd7\xc6\x2d\x15\x13\xc8\x85\xde\x82" "\xac\xb9\x87\xc0\xf6\xf2\xd4\x0b\x8c\x6c\xd1\xb1\xa7\x7d\xe0\x72\x72" "\xb8\x48\x41\x95\x35\x1e\xf3\x37\x22\xe8\x52\x49\x5e\x50\x1d\x45\xe9" "\x67\x87\x1c\x87\x2a\x5e\x4f\x14\x2e\xa7\xe3\x8b\xb4\x43\x91\xd5\x30" "\xd7\x54\xc2\x6f\xd2\x66\x9d\x03\x7e\xc5\xaa\x73\x67\xc6\xff\x14\x59" "\xd8\xb1\x08\xa5\x18\x02\xad\x37\xbb\x4c\x76\xa3\x2a\x5e\x36\x3c\x9b" "\xb4\x7c\x9a\x07\x7a\x11\x8e\xec\x92\x9a\xbe\x42\x96\xf3\xd9\x79\x5d" "\x64\x04\xc9\xad\x30\xdd\x93\xb0\xc9\xa4\xc0\x4f\x62\x89\x0b\xbb\xa2" "\xe0\x71\x13\x38\x9d\xd5\xac\x40\x40\xe5\x70\xab\xfe\xb8\x1d\x5e\x80" "\x11\xfe\x25\x0d\x8b\x0a\xd3\x38\x7d\xfd\x2f\xfa\x6d\x3a\xe6\xf8\x9e" "\x10\x1b\x6f\x11\x44\x3b\x77\xb5\x19", 179); *(uint8_t*)0x200002f0 = 9; *(uint8_t*)0x200002f1 = 5; *(uint8_t*)0x200002f2 = 2; *(uint8_t*)0x200002f3 = 0x10; *(uint16_t*)0x200002f4 = 0x20; *(uint8_t*)0x200002f6 = 5; *(uint8_t*)0x200002f7 = 8; *(uint8_t*)0x200002f8 = 0x80; *(uint8_t*)0x200002f9 = 7; *(uint8_t*)0x200002fa = 0x25; *(uint8_t*)0x200002fb = 1; *(uint8_t*)0x200002fc = 0x86; *(uint8_t*)0x200002fd = 0x81; *(uint16_t*)0x200002fe = 0xfff9; *(uint8_t*)0x20000300 = 7; *(uint8_t*)0x20000301 = 0x25; *(uint8_t*)0x20000302 = 1; *(uint8_t*)0x20000303 = 2; *(uint8_t*)0x20000304 = 8; *(uint16_t*)0x20000305 = 0x80; *(uint8_t*)0x20000307 = 9; *(uint8_t*)0x20000308 = 5; *(uint8_t*)0x20000309 = 0xc; *(uint8_t*)0x2000030a = 2; *(uint16_t*)0x2000030b = 0x20; *(uint8_t*)0x2000030d = 4; *(uint8_t*)0x2000030e = 7; *(uint8_t*)0x2000030f = 8; *(uint8_t*)0x20000310 = 0xd6; *(uint8_t*)0x20000311 = 0x11; memcpy((void*)0x20000312, "\xe2\x8e\x25\xeb\x5b\xb1\xfb\xb2\xf0\xf2\x40\x80\x98\x81\x30\xfc\xcc" "\xd8\x83\xf7\xa9\xd6\x2c\xa5\xd1\x40\x8b\xcb\x14\x14\x1e\x26\x17\xed" "\x89\x22\xba\xcf\x91\x9d\x43\xe9\xcc\x41\x2b\xad\x91\xbc\x83\x81\x79" "\x98\xad\xcf\xc2\x0f\x31\x19\xec\xcb\xfa\x94\xfa\xce\x69\x38\x71\x95" "\xb3\x33\x58\x82\x91\xbe\x79\xb7\xe2\x41\x9c\x77\x72\xc0\xc9\xd0\xc2" "\x31\xc4\x0c\xa2\xcb\x39\x61\x4b\x5a\xc1\x3c\x0f\x77\x61\xe8\x37\x8a" "\x04\xf9\x09\x8f\x11\x76\xde\x8a\x55\x93\x0d\xd9\x5f\x93\x60\x0d\x8e" "\x1d\x3a\xf2\x69\xcf\x6a\x38\xf8\x9d\x76\xe0\xab\x46\x0d\xbe\x17\xed" "\xbc\x54\xaa\x90\x7f\x17\xdb\x24\x62\x7d\x89\xef\x75\x3b\x04\xd9\xb2" "\xb1\x24\x52\x0c\xe1\x64\x1d\x36\xb2\x71\x7b\x18\x4b\xcf\x68\xe1\xe2" "\x62\xdd\xf3\x07\xa9\x6b\xa0\x27\xb7\x0e\x3b\x01\xf8\x2b\x3f\x9a\x4b" "\x1b\x63\x62\x74\xea\x3a\x7d\x47\xaf\xe5\xbe\x59\x3c\x97\x83\xef\xfe" "\x62\xb4\xa6\x37\x1f\xf3\xbb\x48", 212); *(uint8_t*)0x200003e6 = 7; *(uint8_t*)0x200003e7 = 0x25; *(uint8_t*)0x200003e8 = 1; *(uint8_t*)0x200003e9 = 0; *(uint8_t*)0x200003ea = 9; *(uint16_t*)0x200003eb = 0xb2f; *(uint8_t*)0x200003ed = 9; *(uint8_t*)0x200003ee = 5; *(uint8_t*)0x200003ef = 0xf; *(uint8_t*)0x200003f0 = 0; *(uint16_t*)0x200003f1 = 0x40; *(uint8_t*)0x200003f3 = 0x1f; *(uint8_t*)0x200003f4 = 0x3f; *(uint8_t*)0x200003f5 = 5; *(uint8_t*)0x200003f6 = 7; *(uint8_t*)0x200003f7 = 0x25; *(uint8_t*)0x200003f8 = 1; *(uint8_t*)0x200003f9 = 1; *(uint8_t*)0x200003fa = 5; *(uint16_t*)0x200003fb = 0x7fff; *(uint8_t*)0x200003fd = 2; *(uint8_t*)0x200003fe = 1; *(uint8_t*)0x200003ff = 9; *(uint8_t*)0x20000400 = 5; *(uint8_t*)0x20000401 = 0xc; *(uint8_t*)0x20000402 = 0x10; *(uint16_t*)0x20000403 = 0x40; *(uint8_t*)0x20000405 = 0xc7; *(uint8_t*)0x20000406 = 0x81; *(uint8_t*)0x20000407 = 0xf9; *(uint8_t*)0x20000408 = 7; *(uint8_t*)0x20000409 = 0x25; *(uint8_t*)0x2000040a = 1; *(uint8_t*)0x2000040b = 1; *(uint8_t*)0x2000040c = 2; *(uint16_t*)0x2000040d = 0x1000; *(uint8_t*)0x2000040f = 7; *(uint8_t*)0x20000410 = 0x25; *(uint8_t*)0x20000411 = 1; *(uint8_t*)0x20000412 = 0; *(uint8_t*)0x20000413 = 0x81; *(uint16_t*)0x20000414 = 0xff80; *(uint8_t*)0x20000416 = 9; *(uint8_t*)0x20000417 = 5; *(uint8_t*)0x20000418 = 2; *(uint8_t*)0x20000419 = 1; *(uint16_t*)0x2000041a = 0x20; *(uint8_t*)0x2000041c = 4; *(uint8_t*)0x2000041d = 0; *(uint8_t*)0x2000041e = 5; *(uint8_t*)0x2000041f = 2; *(uint8_t*)0x20000420 = 6; *(uint8_t*)0x20000421 = 2; *(uint8_t*)0x20000422 = 0x21; *(uint8_t*)0x20000423 = 9; *(uint8_t*)0x20000424 = 4; *(uint8_t*)0x20000425 = 0x53; *(uint8_t*)0x20000426 = 2; *(uint8_t*)0x20000427 = 8; *(uint8_t*)0x20000428 = -1; *(uint8_t*)0x20000429 = 1; *(uint8_t*)0x2000042a = 0x3d; *(uint8_t*)0x2000042b = 0x1f; *(uint8_t*)0x2000042c = 8; *(uint8_t*)0x2000042d = 0x24; *(uint8_t*)0x2000042e = 2; *(uint8_t*)0x2000042f = 1; *(uint8_t*)0x20000430 = 3; *(uint8_t*)0x20000431 = 1; *(uint8_t*)0x20000432 = 9; *(uint8_t*)0x20000433 = 0x20; *(uint8_t*)0x20000434 = 8; *(uint8_t*)0x20000435 = 0x24; *(uint8_t*)0x20000436 = 2; *(uint8_t*)0x20000437 = 1; *(uint8_t*)0x20000438 = 2; *(uint8_t*)0x20000439 = 2; *(uint8_t*)0x2000043a = 5; *(uint8_t*)0x2000043b = 2; *(uint8_t*)0x2000043c = 7; *(uint8_t*)0x2000043d = 0x24; *(uint8_t*)0x2000043e = 1; *(uint8_t*)0x2000043f = 2; *(uint8_t*)0x20000440 = 0x91; *(uint16_t*)0x20000441 = 3; *(uint8_t*)0x20000443 = 8; *(uint8_t*)0x20000444 = 0x24; *(uint8_t*)0x20000445 = 2; *(uint8_t*)0x20000446 = 1; *(uint8_t*)0x20000447 = 5; *(uint8_t*)0x20000448 = 4; *(uint8_t*)0x20000449 = 0x40; *(uint8_t*)0x2000044a = 0x1f; *(uint8_t*)0x2000044b = 9; *(uint8_t*)0x2000044c = 0x21; *(uint16_t*)0x2000044d = 0x8be; *(uint8_t*)0x2000044f = 0x21; *(uint8_t*)0x20000450 = 1; *(uint8_t*)0x20000451 = 0x22; *(uint16_t*)0x20000452 = 0xe75; *(uint8_t*)0x20000454 = 9; *(uint8_t*)0x20000455 = 5; *(uint8_t*)0x20000456 = 1; *(uint8_t*)0x20000457 = 4; *(uint16_t*)0x20000458 = 8; *(uint8_t*)0x2000045a = 4; *(uint8_t*)0x2000045b = 0x80; *(uint8_t*)0x2000045c = 5; *(uint8_t*)0x2000045d = 2; *(uint8_t*)0x2000045e = 1; *(uint8_t*)0x2000045f = 9; *(uint8_t*)0x20000460 = 5; *(uint8_t*)0x20000461 = 0xa; *(uint8_t*)0x20000462 = 0; *(uint16_t*)0x20000463 = 0x58; *(uint8_t*)0x20000465 = 0x20; *(uint8_t*)0x20000466 = 7; *(uint8_t*)0x20000467 = 7; *(uint8_t*)0x20000468 = 7; *(uint8_t*)0x20000469 = 0x25; *(uint8_t*)0x2000046a = 1; *(uint8_t*)0x2000046b = 2; *(uint8_t*)0x2000046c = 2; *(uint16_t*)0x2000046d = 1; *(uint8_t*)0x2000046f = 7; *(uint8_t*)0x20000470 = 0x25; *(uint8_t*)0x20000471 = 1; *(uint8_t*)0x20000472 = 0x83; *(uint8_t*)0x20000473 = 6; *(uint16_t*)0x20000474 = 0x1f; *(uint8_t*)0x20000476 = 9; *(uint8_t*)0x20000477 = 5; *(uint8_t*)0x20000478 = 9; *(uint8_t*)0x20000479 = 0x10; *(uint16_t*)0x2000047a = 0x40; *(uint8_t*)0x2000047c = 9; *(uint8_t*)0x2000047d = 0x1f; *(uint8_t*)0x2000047e = 8; *(uint8_t*)0x2000047f = 9; *(uint8_t*)0x20000480 = 5; *(uint8_t*)0x20000481 = 0xb; *(uint8_t*)0x20000482 = 0x13; *(uint16_t*)0x20000483 = 0x200; *(uint8_t*)0x20000485 = 3; *(uint8_t*)0x20000486 = 0x3f; *(uint8_t*)0x20000487 = 0x3f; *(uint8_t*)0x20000488 = 9; *(uint8_t*)0x20000489 = 5; *(uint8_t*)0x2000048a = 0xa; *(uint8_t*)0x2000048b = 0xc; *(uint16_t*)0x2000048c = 0x660; *(uint8_t*)0x2000048e = 0x20; *(uint8_t*)0x2000048f = 0x3f; *(uint8_t*)0x20000490 = 3; *(uint8_t*)0x20000491 = 9; *(uint8_t*)0x20000492 = 5; *(uint8_t*)0x20000493 = 9; *(uint8_t*)0x20000494 = 8; *(uint16_t*)0x20000495 = 8; *(uint8_t*)0x20000497 = 8; *(uint8_t*)0x20000498 = 0xa5; *(uint8_t*)0x20000499 = 0x13; *(uint8_t*)0x2000049a = 9; *(uint8_t*)0x2000049b = 5; *(uint8_t*)0x2000049c = 6; *(uint8_t*)0x2000049d = 0x10; *(uint16_t*)0x2000049e = 8; *(uint8_t*)0x200004a0 = 9; *(uint8_t*)0x200004a1 = -1; *(uint8_t*)0x200004a2 = 0xd7; *(uint8_t*)0x200004a3 = 2; *(uint8_t*)0x200004a4 = 0x21; *(uint8_t*)0x200004a5 = 2; *(uint8_t*)0x200004a6 = 0x21; *(uint8_t*)0x200004a7 = 9; *(uint8_t*)0x200004a8 = 5; *(uint8_t*)0x200004a9 = 2; *(uint8_t*)0x200004aa = 2; *(uint16_t*)0x200004ab = 0x40; *(uint8_t*)0x200004ad = 5; *(uint8_t*)0x200004ae = 5; *(uint8_t*)0x200004af = 4; *(uint32_t*)0x20000a80 = 0xa; *(uint64_t*)0x20000a84 = 0x20000940; *(uint8_t*)0x20000940 = 0xa; *(uint8_t*)0x20000941 = 6; *(uint16_t*)0x20000942 = 0x310; *(uint8_t*)0x20000944 = 0; *(uint8_t*)0x20000945 = 5; *(uint8_t*)0x20000946 = 6; *(uint8_t*)0x20000947 = 0x10; *(uint8_t*)0x20000948 = 8; *(uint8_t*)0x20000949 = 0; *(uint32_t*)0x20000a8c = 0; *(uint64_t*)0x20000a90 = 0; *(uint32_t*)0x20000a98 = 3; *(uint32_t*)0x20000a9c = 0; *(uint64_t*)0x20000aa0 = 0; *(uint32_t*)0x20000aa8 = 0; *(uint64_t*)0x20000aac = 0; *(uint32_t*)0x20000ab4 = 0; *(uint64_t*)0x20000ab8 = 0; syz_usb_connect(2, 0x4b0, 0x20000000, 0x20000a80); return 0; }