// https://syzkaller.appspot.com/bug?id=f071ffb57ef8ca3af76ba352e8ea4e6641a69cfa // 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 #ifndef SYS_mmap #define SYS_mmap 197 #endif static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { pthread_mutex_t mu; pthread_cond_t cv; int state; } event_t; static void event_init(event_t* ev) { if (pthread_mutex_init(&ev->mu, 0)) exit(1); if (pthread_cond_init(&ev->cv, 0)) exit(1); ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { pthread_mutex_lock(&ev->mu); if (ev->state) exit(1); ev->state = 1; pthread_mutex_unlock(&ev->mu); pthread_cond_broadcast(&ev->cv); } static void event_wait(event_t* ev) { pthread_mutex_lock(&ev->mu); while (!ev->state) pthread_cond_wait(&ev->cv, &ev->mu); pthread_mutex_unlock(&ev->mu); } static int event_isset(event_t* ev) { pthread_mutex_lock(&ev->mu); int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; pthread_mutex_lock(&ev->mu); for (;;) { if (ev->state) break; uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); now = current_time_ms(); if (now - start > timeout) break; } int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } struct usb_endpoint_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint8_t bEndpointAddress; uint8_t bmAttributes; uint16_t wMaxPacketSize; uint8_t bInterval; uint8_t bRefresh; uint8_t bSynchAddress; } __attribute__((packed)); struct usb_device_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t bcdUSB; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; uint8_t bMaxPacketSize0; uint16_t idVendor; uint16_t idProduct; uint16_t bcdDevice; uint8_t iManufacturer; uint8_t iProduct; uint8_t iSerialNumber; uint8_t bNumConfigurations; } __attribute__((packed)); struct usb_config_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t wTotalLength; uint8_t bNumInterfaces; uint8_t bConfigurationValue; uint8_t iConfiguration; uint8_t bmAttributes; uint8_t bMaxPower; } __attribute__((packed)); struct usb_interface_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bNumEndpoints; uint8_t bInterfaceClass; uint8_t bInterfaceSubClass; uint8_t bInterfaceProtocol; uint8_t iInterface; } __attribute__((packed)); struct usb_ctrlrequest { uint8_t bRequestType; uint8_t bRequest; uint16_t wValue; uint16_t wIndex; uint16_t wLength; } __attribute__((packed)); struct usb_qualifier_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t bcdUSB; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; uint8_t bMaxPacketSize0; uint8_t bNumConfigurations; uint8_t bRESERVED; } __attribute__((packed)); #define USB_TYPE_MASK (0x03 << 5) #define USB_TYPE_STANDARD (0x00 << 5) #define USB_TYPE_CLASS (0x01 << 5) #define USB_TYPE_VENDOR (0x02 << 5) #define USB_TYPE_RESERVED (0x03 << 5) #define USB_DT_DEVICE 0x01 #define USB_DT_CONFIG 0x02 #define USB_DT_STRING 0x03 #define USB_DT_INTERFACE 0x04 #define USB_DT_ENDPOINT 0x05 #define USB_DT_DEVICE_QUALIFIER 0x06 #define USB_DT_OTHER_SPEED_CONFIG 0x07 #define USB_DT_INTERFACE_POWER 0x08 #define USB_DT_OTG 0x09 #define USB_DT_DEBUG 0x0a #define USB_DT_INTERFACE_ASSOCIATION 0x0b #define USB_DT_SECURITY 0x0c #define USB_DT_KEY 0x0d #define USB_DT_ENCRYPTION_TYPE 0x0e #define USB_DT_BOS 0x0f #define USB_DT_DEVICE_CAPABILITY 0x10 #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 #define USB_DT_WIRE_ADAPTER 0x21 #define USB_DT_RPIPE 0x22 #define USB_DT_CS_RADIO_CONTROL 0x23 #define USB_DT_PIPE_USAGE 0x24 #define USB_DT_SS_ENDPOINT_COMP 0x30 #define USB_DT_SSP_ISOC_ENDPOINT_COMP 0x31 #define USB_REQ_GET_STATUS 0x00 #define USB_REQ_CLEAR_FEATURE 0x01 #define USB_REQ_SET_FEATURE 0x03 #define USB_REQ_SET_ADDRESS 0x05 #define USB_REQ_GET_DESCRIPTOR 0x06 #define USB_REQ_SET_DESCRIPTOR 0x07 #define USB_REQ_GET_CONFIGURATION 0x08 #define USB_REQ_SET_CONFIGURATION 0x09 #define USB_REQ_GET_INTERFACE 0x0A #define USB_REQ_SET_INTERFACE 0x0B #define USB_REQ_SYNCH_FRAME 0x0C #define USB_REQ_SET_SEL 0x30 #define USB_REQ_SET_ISOCH_DELAY 0x31 #define USB_REQ_SET_ENCRYPTION 0x0D #define USB_REQ_GET_ENCRYPTION 0x0E #define USB_REQ_RPIPE_ABORT 0x0E #define USB_REQ_SET_HANDSHAKE 0x0F #define USB_REQ_RPIPE_RESET 0x0F #define USB_REQ_GET_HANDSHAKE 0x10 #define USB_REQ_SET_CONNECTION 0x11 #define USB_REQ_SET_SECURITY_DATA 0x12 #define USB_REQ_GET_SECURITY_DATA 0x13 #define USB_REQ_SET_WUSB_DATA 0x14 #define USB_REQ_LOOPBACK_DATA_WRITE 0x15 #define USB_REQ_LOOPBACK_DATA_READ 0x16 #define USB_REQ_SET_INTERFACE_DS 0x17 #define USB_REQ_GET_PARTNER_PDO 20 #define USB_REQ_GET_BATTERY_STATUS 21 #define USB_REQ_SET_PDO 22 #define USB_REQ_GET_VDM 23 #define USB_REQ_SEND_VDM 24 #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 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; } 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; } 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, struct usb_qualifier_descriptor* qual, 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) { 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_data = (char*)qual; *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; } static int vhci_open(void) { char path[1024]; snprintf(path, sizeof(path), "/dev/vhci%llu", procid); return open(path, O_RDWR); } static int vhci_setport(int fd, u_int port) { struct vhci_ioc_set_port args; args.port = port; return ioctl(fd, VHCI_IOC_SET_PORT, &args); } static int vhci_usb_attach(int fd) { return ioctl(fd, VHCI_IOC_USB_ATTACH, NULL); } static int vhci_usb_recv(int fd, void* buf, size_t size) { uint8_t* ptr = (uint8_t*)buf; while (1) { ssize_t done = read(fd, ptr, size); if (done < 0) return -1; if ((size_t)done == size) return 0; size -= done; ptr += done; } } static int vhci_usb_send(int fd, void* buf, size_t size) { uint8_t* ptr = (uint8_t*)buf; while (1) { ssize_t done = write(fd, ptr, size); if (done <= 0) return -1; if ((size_t)done == size) return 0; size -= done; ptr += done; } } static volatile long syz_usb_connect_impl(int fd, 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) { struct usb_device_index* index = add_usb_index(fd, dev, dev_len); if (!index) { return -1; } if (vhci_setport(fd, 1)) exit(1); if (vhci_usb_attach(fd)) { return -1; } bool done = false; while (!done) { vhci_request_t req; if (vhci_usb_recv(fd, &req, sizeof(req))) { return -1; } if (req.type != VHCI_REQ_CTRL) { return -1; } char* response_data = NULL; uint32_t response_length = 0; struct usb_qualifier_descriptor qual; char data[4096]; if (req.u.ctrl.bmRequestType & UE_DIR_IN) { if (!lookup_connect_response_in( fd, descs, (const struct usb_ctrlrequest*)&req.u.ctrl, &qual, &response_data, &response_length)) { return -1; } } else { if (!lookup_connect_response_out( fd, descs, (const struct usb_ctrlrequest*)&req.u.ctrl, &done)) { return -1; } response_data = NULL; response_length = UGETW(req.u.ctrl.wLength); } if ((req.u.ctrl.bmRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD && req.u.ctrl.bRequest == USB_REQ_SET_CONFIGURATION) { } if (response_length > sizeof(data)) response_length = 0; if ((uint32_t)UGETW(req.u.ctrl.wLength) < response_length) response_length = UGETW(req.u.ctrl.wLength); if (response_data) memcpy(data, response_data, response_length); else memset(data, 0, response_length); int rv = 0; if (req.u.ctrl.bmRequestType & UE_DIR_IN) { if (response_length > 0) { vhci_response_t res; res.size = response_length; rv = vhci_usb_send(fd, &res, sizeof(res)); if (rv == 0) rv = vhci_usb_send(fd, data, response_length); } } else { rv = vhci_usb_recv(fd, data, response_length); } if (rv < 0) { return -1; } } 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; if (!dev) { return -1; } int fd = vhci_open(); if (fd < 0) exit(1); long res = syz_usb_connect_impl(fd, speed, dev_len, dev, descs, &lookup_connect_response_out_generic); close(fd); return res; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void loop(void) { int i, call, thread; for (call = 0; call < 3; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); if (call == 1) break; event_timedwait(&th->done, 50 + (call == 0 ? 3000 : 0) + (call == 1 ? 3000 : 0) + (call == 2 ? 3000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } void execute_call(int call) { switch (call) { case 0: *(uint8_t*)0x20000200 = 0x12; *(uint8_t*)0x20000201 = 1; *(uint16_t*)0x20000202 = 0; *(uint8_t*)0x20000204 = 0x76; *(uint8_t*)0x20000205 = 0x41; *(uint8_t*)0x20000206 = 0xc7; *(uint8_t*)0x20000207 = 0x10; *(uint16_t*)0x20000208 = 0x19d2; *(uint16_t*)0x2000020a = 0xff4c; *(uint16_t*)0x2000020c = 0x2a85; *(uint8_t*)0x2000020e = 1; *(uint8_t*)0x2000020f = 2; *(uint8_t*)0x20000210 = 3; *(uint8_t*)0x20000211 = 1; *(uint8_t*)0x20000212 = 9; *(uint8_t*)0x20000213 = 2; *(uint16_t*)0x20000214 = 0x1b; *(uint8_t*)0x20000216 = 1; *(uint8_t*)0x20000217 = 0; *(uint8_t*)0x20000218 = 0; *(uint8_t*)0x20000219 = 0; *(uint8_t*)0x2000021a = 0; *(uint8_t*)0x2000021b = 9; *(uint8_t*)0x2000021c = 4; *(uint8_t*)0x2000021d = 0; *(uint8_t*)0x2000021e = 0; *(uint8_t*)0x2000021f = 1; *(uint8_t*)0x20000220 = -1; *(uint8_t*)0x20000221 = -1; *(uint8_t*)0x20000222 = -1; *(uint8_t*)0x20000223 = 0; *(uint8_t*)0x20000224 = 9; *(uint8_t*)0x20000225 = 5; *(uint8_t*)0x20000226 = 0; *(uint8_t*)0x20000227 = 0; *(uint16_t*)0x20000228 = 0; *(uint8_t*)0x2000022a = 0; *(uint8_t*)0x2000022b = 0; *(uint8_t*)0x2000022c = 0; syz_usb_connect(/*speed=*/0, /*dev_len=*/0x2d, /*dev=*/0x20000200, /*conn_descs=*/0); break; case 1: *(uint8_t*)0x20001140 = 0x12; *(uint8_t*)0x20001141 = 1; *(uint16_t*)0x20001142 = 0x300; *(uint8_t*)0x20001144 = 0; *(uint8_t*)0x20001145 = 0; *(uint8_t*)0x20001146 = 0; *(uint8_t*)0x20001147 = 0x20; *(uint16_t*)0x20001148 = 0; *(uint16_t*)0x2000114a = 0; *(uint16_t*)0x2000114c = 0x40; *(uint8_t*)0x2000114e = 1; *(uint8_t*)0x2000114f = 2; *(uint8_t*)0x20001150 = 3; *(uint8_t*)0x20001151 = 1; *(uint8_t*)0x20001152 = 9; *(uint8_t*)0x20001153 = 2; *(uint16_t*)0x20001154 = 0x2d; *(uint8_t*)0x20001156 = 1; *(uint8_t*)0x20001157 = 1; *(uint8_t*)0x20001158 = 0x1f; *(uint8_t*)0x20001159 = 0x50; *(uint8_t*)0x2000115a = 1; *(uint8_t*)0x2000115b = 9; *(uint8_t*)0x2000115c = 4; *(uint8_t*)0x2000115d = 0; *(uint8_t*)0x2000115e = 0; *(uint8_t*)0x2000115f = 1; *(uint8_t*)0x20001160 = 3; *(uint8_t*)0x20001161 = 1; *(uint8_t*)0x20001162 = 0; *(uint8_t*)0x20001163 = 0x80; *(uint8_t*)0x20001164 = 9; *(uint8_t*)0x20001165 = 0x21; *(uint16_t*)0x20001166 = 2; *(uint8_t*)0x20001168 = 2; *(uint8_t*)0x20001169 = 1; *(uint8_t*)0x2000116a = 0x22; *(uint16_t*)0x2000116b = 0x3e0; *(uint8_t*)0x2000116d = 9; *(uint8_t*)0x2000116e = 5; *(uint8_t*)0x2000116f = 0x81; *(uint8_t*)0x20001170 = 3; *(uint16_t*)0x20001171 = 0x200; *(uint8_t*)0x20001173 = 0xc1; *(uint8_t*)0x20001174 = 0xe0; *(uint8_t*)0x20001175 = 0; *(uint8_t*)0x20001176 = 9; *(uint8_t*)0x20001177 = 5; *(uint8_t*)0x20001178 = 2; *(uint8_t*)0x20001179 = 3; *(uint16_t*)0x2000117a = 0x400; *(uint8_t*)0x2000117c = 1; *(uint8_t*)0x2000117d = 0x50; *(uint8_t*)0x2000117e = 1; syz_usb_connect(/*speed=*/2, /*dev_len=*/0x3f, /*dev=*/0x20001140, /*conn_descs=*/0); break; case 2: *(uint8_t*)0x20000240 = 0x12; *(uint8_t*)0x20000241 = 1; *(uint16_t*)0x20000242 = 0x310; *(uint8_t*)0x20000244 = 0; *(uint8_t*)0x20000245 = 0; *(uint8_t*)0x20000246 = 0; *(uint8_t*)0x20000247 = 0x10; *(uint16_t*)0x20000248 = 0; *(uint16_t*)0x2000024a = 0; *(uint16_t*)0x2000024c = 0; *(uint8_t*)0x2000024e = 1; *(uint8_t*)0x2000024f = 2; *(uint8_t*)0x20000250 = 3; *(uint8_t*)0x20000251 = 1; *(uint8_t*)0x20000252 = 9; *(uint8_t*)0x20000253 = 2; *(uint16_t*)0x20000254 = 0x167; *(uint8_t*)0x20000256 = 3; *(uint8_t*)0x20000257 = 7; *(uint8_t*)0x20000258 = 7; *(uint8_t*)0x20000259 = 0x10; *(uint8_t*)0x2000025a = 0xc0; *(uint8_t*)0x2000025b = 9; *(uint8_t*)0x2000025c = 4; *(uint8_t*)0x2000025d = 7; *(uint8_t*)0x2000025e = 0x3f; *(uint8_t*)0x2000025f = 5; *(uint8_t*)0x20000260 = 0; *(uint8_t*)0x20000261 = 0; *(uint8_t*)0x20000262 = 0; *(uint8_t*)0x20000263 = 1; *(uint8_t*)0x20000264 = 8; *(uint8_t*)0x20000265 = 0x24; *(uint8_t*)0x20000266 = 2; *(uint8_t*)0x20000267 = 1; *(uint8_t*)0x20000268 = 1; *(uint8_t*)0x20000269 = 3; *(uint8_t*)0x2000026a = 3; *(uint8_t*)0x2000026b = 0x1f; *(uint8_t*)0x2000026c = 8; *(uint8_t*)0x2000026d = 0x24; *(uint8_t*)0x2000026e = 2; *(uint8_t*)0x2000026f = 1; *(uint8_t*)0x20000270 = 0x1f; *(uint8_t*)0x20000271 = 2; *(uint8_t*)0x20000272 = 1; *(uint8_t*)0x20000273 = 0xc5; *(uint8_t*)0x20000274 = 8; *(uint8_t*)0x20000275 = 0x24; *(uint8_t*)0x20000276 = 2; *(uint8_t*)0x20000277 = 1; *(uint8_t*)0x20000278 = 0x90; *(uint8_t*)0x20000279 = 1; *(uint8_t*)0x2000027a = 6; *(uint8_t*)0x2000027b = 7; *(uint8_t*)0x2000027c = 8; *(uint8_t*)0x2000027d = 0x24; *(uint8_t*)0x2000027e = 2; *(uint8_t*)0x2000027f = 1; *(uint8_t*)0x20000280 = 1; *(uint8_t*)0x20000281 = 3; *(uint8_t*)0x20000282 = 0x3f; *(uint8_t*)0x20000283 = 6; *(uint8_t*)0x20000284 = 9; *(uint8_t*)0x20000285 = 5; *(uint8_t*)0x20000286 = 8; *(uint8_t*)0x20000287 = 8; *(uint16_t*)0x20000288 = 0x20; *(uint8_t*)0x2000028a = 0xf5; *(uint8_t*)0x2000028b = 0x20; *(uint8_t*)0x2000028c = 0xdc; *(uint8_t*)0x2000028d = 9; *(uint8_t*)0x2000028e = 5; *(uint8_t*)0x2000028f = 0xc; *(uint8_t*)0x20000290 = 4; *(uint16_t*)0x20000291 = 0x400; *(uint8_t*)0x20000293 = 0; *(uint8_t*)0x20000294 = 2; *(uint8_t*)0x20000295 = 2; *(uint8_t*)0x20000296 = 9; *(uint8_t*)0x20000297 = 5; *(uint8_t*)0x20000298 = 7; *(uint8_t*)0x20000299 = 8; *(uint16_t*)0x2000029a = 0x10; *(uint8_t*)0x2000029c = 0xa2; *(uint8_t*)0x2000029d = 8; *(uint8_t*)0x2000029e = 0x62; *(uint8_t*)0x2000029f = 2; *(uint8_t*)0x200002a0 = 0xb; *(uint8_t*)0x200002a1 = 7; *(uint8_t*)0x200002a2 = 0x25; *(uint8_t*)0x200002a3 = 1; *(uint8_t*)0x200002a4 = 2; *(uint8_t*)0x200002a5 = -1; *(uint16_t*)0x200002a6 = 1; *(uint8_t*)0x200002a8 = 9; *(uint8_t*)0x200002a9 = 5; *(uint8_t*)0x200002aa = 9; *(uint8_t*)0x200002ab = 0x10; *(uint16_t*)0x200002ac = 0x200; *(uint8_t*)0x200002ae = 7; *(uint8_t*)0x200002af = 2; *(uint8_t*)0x200002b0 = 0x20; *(uint8_t*)0x200002b1 = 7; *(uint8_t*)0x200002b2 = 0x25; *(uint8_t*)0x200002b3 = 1; *(uint8_t*)0x200002b4 = 0x84; *(uint8_t*)0x200002b5 = 0x20; *(uint16_t*)0x200002b6 = 0; *(uint8_t*)0x200002b8 = 7; *(uint8_t*)0x200002b9 = 0x25; *(uint8_t*)0x200002ba = 1; *(uint8_t*)0x200002bb = 0x81; *(uint8_t*)0x200002bc = 0x3f; *(uint16_t*)0x200002bd = 0xff; *(uint8_t*)0x200002bf = 9; *(uint8_t*)0x200002c0 = 5; *(uint8_t*)0x200002c1 = 0xc; *(uint8_t*)0x200002c2 = 8; *(uint16_t*)0x200002c3 = 0x10; *(uint8_t*)0x200002c5 = 0x81; *(uint8_t*)0x200002c6 = 0x41; *(uint8_t*)0x200002c7 = 9; *(uint8_t*)0x200002c8 = 2; *(uint8_t*)0x200002c9 = 0x10; *(uint8_t*)0x200002ca = 2; *(uint8_t*)0x200002cb = 0x22; *(uint8_t*)0x200002cc = 9; *(uint8_t*)0x200002cd = 4; *(uint8_t*)0x200002ce = 9; *(uint8_t*)0x200002cf = 0; *(uint8_t*)0x200002d0 = 7; *(uint8_t*)0x200002d1 = 0; *(uint8_t*)0x200002d2 = 0; *(uint8_t*)0x200002d3 = 0; *(uint8_t*)0x200002d4 = 3; *(uint8_t*)0x200002d5 = 5; *(uint8_t*)0x200002d6 = 0x24; *(uint8_t*)0x200002d7 = 6; *(uint8_t*)0x200002d8 = 0; *(uint8_t*)0x200002d9 = 1; *(uint8_t*)0x200002da = 5; *(uint8_t*)0x200002db = 0x24; *(uint8_t*)0x200002dc = 0; *(uint16_t*)0x200002dd = 0x3f; *(uint8_t*)0x200002df = 0xd; *(uint8_t*)0x200002e0 = 0x24; *(uint8_t*)0x200002e1 = 0xf; *(uint8_t*)0x200002e2 = 1; *(uint32_t*)0x200002e3 = 0x84a; *(uint16_t*)0x200002e7 = 0x8001; *(uint16_t*)0x200002e9 = 7; *(uint8_t*)0x200002eb = 0; *(uint8_t*)0x200002ec = 6; *(uint8_t*)0x200002ed = 0x24; *(uint8_t*)0x200002ee = 0x1a; *(uint16_t*)0x200002ef = 3; *(uint8_t*)0x200002f1 = 0x3c; *(uint8_t*)0x200002f2 = 0xc; *(uint8_t*)0x200002f3 = 0x24; *(uint8_t*)0x200002f4 = 0x1b; *(uint16_t*)0x200002f5 = 2; *(uint16_t*)0x200002f7 = 0x7f; *(uint8_t*)0x200002f9 = 1; *(uint8_t*)0x200002fa = 8; *(uint16_t*)0x200002fb = 8; *(uint8_t*)0x200002fd = 0x80; *(uint8_t*)0x200002fe = 4; *(uint8_t*)0x200002ff = 0x24; *(uint8_t*)0x20000300 = 0x13; *(uint8_t*)0x20000301 = 0xa8; *(uint8_t*)0x20000302 = 8; *(uint8_t*)0x20000303 = 0x24; *(uint8_t*)0x20000304 = 0x1c; *(uint16_t*)0x20000305 = 0x7f; *(uint8_t*)0x20000307 = -1; *(uint16_t*)0x20000308 = 0xff80; *(uint8_t*)0x2000030a = 5; *(uint8_t*)0x2000030b = 0x24; *(uint8_t*)0x2000030c = 0x15; *(uint16_t*)0x2000030d = 2; *(uint8_t*)0x2000030f = 5; *(uint8_t*)0x20000310 = 0x24; *(uint8_t*)0x20000311 = 1; *(uint8_t*)0x20000312 = 0; *(uint8_t*)0x20000313 = 1; *(uint8_t*)0x20000314 = 0x15; *(uint8_t*)0x20000315 = 0x24; *(uint8_t*)0x20000316 = 0x12; *(uint16_t*)0x20000317 = 8; *(uint64_t*)0x20000319 = 0x14f5e048ba817a3; *(uint64_t*)0x20000321 = 0x2a397ecbffc007a6; *(uint8_t*)0x20000329 = 9; *(uint8_t*)0x2000032a = 5; *(uint8_t*)0x2000032b = 2; *(uint8_t*)0x2000032c = 0; *(uint16_t*)0x2000032d = 8; *(uint8_t*)0x2000032f = 0; *(uint8_t*)0x20000330 = -1; *(uint8_t*)0x20000331 = 0xf8; *(uint8_t*)0x20000332 = 9; *(uint8_t*)0x20000333 = 5; *(uint8_t*)0x20000334 = 0xc; *(uint8_t*)0x20000335 = 0x14; *(uint16_t*)0x20000336 = 0x418; *(uint8_t*)0x20000338 = 9; *(uint8_t*)0x20000339 = 8; *(uint8_t*)0x2000033a = 6; *(uint8_t*)0x2000033b = 2; *(uint8_t*)0x2000033c = 0x23; *(uint8_t*)0x2000033d = 7; *(uint8_t*)0x2000033e = 0x25; *(uint8_t*)0x2000033f = 1; *(uint8_t*)0x20000340 = 0x81; *(uint8_t*)0x20000341 = 4; *(uint16_t*)0x20000342 = 3; *(uint8_t*)0x20000344 = 9; *(uint8_t*)0x20000345 = 5; *(uint8_t*)0x20000346 = 0x80; *(uint8_t*)0x20000347 = 0; *(uint16_t*)0x20000348 = 0x40; *(uint8_t*)0x2000034a = 5; *(uint8_t*)0x2000034b = 3; *(uint8_t*)0x2000034c = 2; *(uint8_t*)0x2000034d = 2; *(uint8_t*)0x2000034e = 0xe; *(uint8_t*)0x2000034f = 2; *(uint8_t*)0x20000350 = 0x23; *(uint8_t*)0x20000351 = 9; *(uint8_t*)0x20000352 = 5; *(uint8_t*)0x20000353 = 5; *(uint8_t*)0x20000354 = 0; *(uint16_t*)0x20000355 = 0x200; *(uint8_t*)0x20000357 = 1; *(uint8_t*)0x20000358 = 1; *(uint8_t*)0x20000359 = 2; *(uint8_t*)0x2000035a = 9; *(uint8_t*)0x2000035b = 5; *(uint8_t*)0x2000035c = 3; *(uint8_t*)0x2000035d = 0x10; *(uint16_t*)0x2000035e = 0x20; *(uint8_t*)0x20000360 = 1; *(uint8_t*)0x20000361 = 5; *(uint8_t*)0x20000362 = 8; *(uint8_t*)0x20000363 = 2; *(uint8_t*)0x20000364 = 7; *(uint8_t*)0x20000365 = 9; *(uint8_t*)0x20000366 = 5; *(uint8_t*)0x20000367 = 0xb; *(uint8_t*)0x20000368 = 0x10; *(uint16_t*)0x20000369 = 0; *(uint8_t*)0x2000036b = 8; *(uint8_t*)0x2000036c = 8; *(uint8_t*)0x2000036d = 4; *(uint8_t*)0x2000036e = 9; *(uint8_t*)0x2000036f = 5; *(uint8_t*)0x20000370 = 2; *(uint8_t*)0x20000371 = 8; *(uint16_t*)0x20000372 = 0x600; *(uint8_t*)0x20000374 = 0x7f; *(uint8_t*)0x20000375 = 0; *(uint8_t*)0x20000376 = 1; *(uint8_t*)0x20000377 = 7; *(uint8_t*)0x20000378 = 0x25; *(uint8_t*)0x20000379 = 1; *(uint8_t*)0x2000037a = 1; *(uint8_t*)0x2000037b = 0x40; *(uint16_t*)0x2000037c = 5; *(uint8_t*)0x2000037e = 9; *(uint8_t*)0x2000037f = 4; *(uint8_t*)0x20000380 = 0; *(uint8_t*)0x20000381 = 5; *(uint8_t*)0x20000382 = 3; *(uint8_t*)0x20000383 = 0; *(uint8_t*)0x20000384 = 0; *(uint8_t*)0x20000385 = 0; *(uint8_t*)0x20000386 = 0x5b; *(uint8_t*)0x20000387 = 9; *(uint8_t*)0x20000388 = 5; *(uint8_t*)0x20000389 = 0xd; *(uint8_t*)0x2000038a = 0x10; *(uint16_t*)0x2000038b = 0x200; *(uint8_t*)0x2000038d = 0x9d; *(uint8_t*)0x2000038e = 0x7f; *(uint8_t*)0x2000038f = 0; *(uint8_t*)0x20000390 = 7; *(uint8_t*)0x20000391 = 0x25; *(uint8_t*)0x20000392 = 1; *(uint8_t*)0x20000393 = 0x82; *(uint8_t*)0x20000394 = 0xeb; *(uint16_t*)0x20000395 = 8; *(uint8_t*)0x20000397 = 9; *(uint8_t*)0x20000398 = 5; *(uint8_t*)0x20000399 = 0xd; *(uint8_t*)0x2000039a = 0; *(uint16_t*)0x2000039b = 0x200; *(uint8_t*)0x2000039d = 4; *(uint8_t*)0x2000039e = 0x40; *(uint8_t*)0x2000039f = 3; *(uint8_t*)0x200003a0 = 7; *(uint8_t*)0x200003a1 = 0x25; *(uint8_t*)0x200003a2 = 1; *(uint8_t*)0x200003a3 = 1; *(uint8_t*)0x200003a4 = 2; *(uint16_t*)0x200003a5 = 0; *(uint8_t*)0x200003a7 = 2; *(uint8_t*)0x200003a8 = 0x11; *(uint8_t*)0x200003a9 = 9; *(uint8_t*)0x200003aa = 5; *(uint8_t*)0x200003ab = 7; *(uint8_t*)0x200003ac = 4; *(uint16_t*)0x200003ad = 0x10; *(uint8_t*)0x200003af = -1; *(uint8_t*)0x200003b0 = 5; *(uint8_t*)0x200003b1 = 0; *(uint8_t*)0x200003b2 = 7; *(uint8_t*)0x200003b3 = 0x25; *(uint8_t*)0x200003b4 = 1; *(uint8_t*)0x200003b5 = 1; *(uint8_t*)0x200003b6 = 0x23; *(uint16_t*)0x200003b7 = 1; syz_usb_connect(/*speed=*/3, /*dev_len=*/0x179, /*dev=*/0x20000240, /*conn_descs=*/0); break; } } int main(void) { syscall(SYS_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/3ul, /*flags=*/0x1012ul, /*fd=*/-1, /*pad=*/0ul, /*offset=*/0ul); loop(); return 0; }