// https://syzkaller.appspot.com/bug?id=e2c78e97a0d34e40a28e588b476faa964bcfe1af // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static unsigned long long procid; static void kill_and_wait(int pid, int* status) { kill(pid, SIGKILL); while (waitpid(-1, status, 0) != pid) { } } 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; } 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 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; } 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; } int rv = vhci_setport(fd, 1); if (rv != 0) { exit(1); } rv = vhci_usb_attach(fd); if (rv != 0) { return -1; } bool done = false; while (!done) { vhci_request_t req; rv = vhci_usb_recv(fd, &req, sizeof(req)); if (rv != 0) { return -1; } if (req.type != VHCI_REQ_CTRL) { return -1; } char* response_data = NULL; uint32_t response_length = 0; 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, &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); 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; } static void execute_one(void); #define WAIT_FLAGS 0 static void loop(void) { int iter = 0; for (;; iter++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5 * 1000) continue; kill_and_wait(pid, &status); break; } } } #ifndef SYS_fork #define SYS_fork 2 #endif #ifndef SYS_mmap #define SYS_mmap 197 #endif void execute_one(void) { *(uint8_t*)0x20000000 = 0x12; *(uint8_t*)0x20000001 = 1; *(uint16_t*)0x20000002 = 0; *(uint8_t*)0x20000004 = 2; *(uint8_t*)0x20000005 = 0; *(uint8_t*)0x20000006 = 0; *(uint8_t*)0x20000007 = 0; *(uint16_t*)0x20000008 = 0x525; *(uint16_t*)0x2000000a = 0xa4a1; *(uint16_t*)0x2000000c = 0x40; *(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 = 0x24e; *(uint8_t*)0x20000016 = 1; *(uint8_t*)0x20000017 = 1; *(uint8_t*)0x20000018 = 0; *(uint8_t*)0x20000019 = 0; *(uint8_t*)0x2000001a = 0; *(uint8_t*)0x2000001b = 9; *(uint8_t*)0x2000001c = 4; *(uint8_t*)0x2000001d = 0; *(uint8_t*)0x2000001e = 0; *(uint8_t*)0x2000001f = 0; *(uint8_t*)0x20000020 = 2; *(uint8_t*)0x20000021 = 6; *(uint8_t*)0x20000022 = 0; *(uint8_t*)0x20000023 = 0; *(uint8_t*)0x20000024 = 5; *(uint8_t*)0x20000025 = 0x24; *(uint8_t*)0x20000026 = 6; *(uint8_t*)0x20000027 = 0; *(uint8_t*)0x20000028 = 0; *(uint8_t*)0x20000029 = 5; *(uint8_t*)0x2000002a = 0x24; *(uint8_t*)0x2000002b = 0; *(uint16_t*)0x2000002c = 0; *(uint8_t*)0x2000002e = 0xd; *(uint8_t*)0x2000002f = 0x24; *(uint8_t*)0x20000030 = 0xf; *(uint8_t*)0x20000031 = 1; *(uint32_t*)0x20000032 = 0; *(uint16_t*)0x20000036 = 0; *(uint16_t*)0x20000038 = 0; *(uint8_t*)0x2000003a = 0; *(uint8_t*)0x2000003b = 0xf5; *(uint8_t*)0x2000003c = 0x24; *(uint8_t*)0x2000003d = 0x13; *(uint8_t*)0x2000003e = 0; memcpy((void*)0x2000003f, "\x39\xd7\x98\x97\x1d\x96\xe7\x83\xc6\x76\x2c\x39\x63\x4d\xbd\x43\x03" "\xe8\xba\x0d\x89\x51\x31\x12\x22\x1b\x40\x47\x3e\x3e\x36\x99\xb7\xe7" "\x77\x53\xe6\xa2\xd1\x3a\xf6\x50\xdc\xf4\xae\x59\xe6\x90\xb1\x80\xe2" "\xe2\x8e\x7b\x11\xc2\xf9\x57\xa3\xf8\x01\xec\xa5\x90\x65\x48\x2f\xfd" "\x51\xf5\xd6\xfe\x73\x3c\xa9\x0d\x73\x6f\xe1\xe1\xae\x30\xee\xf2\x4b" "\x29\xb9\xbb\x20\x1a\xef\xd4\xbc\xc0\x5d\xea\xcf\x85\x22\x16\xc1\x76" "\x61\xa3\x0f\xd2\xfa\x35\xec\x18\x92\x19\xcf\x30\x99\xef\x84\x05\x3c" "\xce\x4f\xd8\xb6\x1f\x22\x77\x33\x83\xfa\xb3\x53\xcd\x36\x25\x31\x53" "\x81\x55\xf4\x84\xee\x93\x8b\x18\xb6\xbc\x00\xd2\x3c\x95\x42\xc7\x19" "\x61\xe9\x5d\x7b\x1c\x00\xd8\x39\x92\x3b\xd1\x5b\xf5\xf7\x43\xe7\xe0" "\xe8\xcc\xcb\xe4\xcd\xde\x9c\xf8\x00\x45\x9f\xa9\x08\xdb\xcf\x7a\x3f" "\x25\x7b\xb1\x71\x7e\x54\xed\xb0\x00\xa4\x25\x8c\x97\x72\xc3\xf4\x39" "\x91\xb4\x9c\x26\x7e\x06\x2f\x2f\xf0\xac\x1f\x80\xef\xcf\xf3\x66\xcb" "\x93\xc5\x0d\x24\x4c\xc1\x1d\x1d\x88\x3c\xe9\xe8\xd6\x0f\x2e\x7a\x0c" "\xdb\xba\x8a", 241); *(uint8_t*)0x20000130 = 0x5b; *(uint8_t*)0x20000131 = 0x24; *(uint8_t*)0x20000132 = 0x13; *(uint8_t*)0x20000133 = 0x3f; memcpy((void*)0x20000134, "\x69\x85\xeb\x3b\xa5\x0a\x01\x82\xd3\x7c\xed\xfe\x7b\x0d\x0d\x3d\xab" "\xed\xd4\x12\x14\x07\x2a\xae\xa5\x52\x06\x19\x43\xa5\x17\x67\x08\x81" "\x69\x8c\x94\x95\xf7\xea\x4e\x78\xde\x59\xd4\x62\x66\xc3\xff\xe8\xb3" "\x21\xb1\xc4\x21\xe5\xff\x69\x9c\x98\x2e\x80\x8e\xbb\x69\xe1\xf0\xd2" "\x36\xde\x71\x05\xea\xd4\x76\x58\x70\xfe\x0a\x9f\x27\x64\x75\xe0\xb4" "\x31\x30", 87); *(uint8_t*)0x2000018b = 6; *(uint8_t*)0x2000018c = 0x24; *(uint8_t*)0x2000018d = 0x1a; *(uint16_t*)0x2000018e = 0x7f; *(uint8_t*)0x20000190 = 0x11; *(uint8_t*)0x20000191 = 0xb9; *(uint8_t*)0x20000192 = 0x24; *(uint8_t*)0x20000193 = 0x13; *(uint8_t*)0x20000194 = 0xbd; memcpy((void*)0x20000195, "\xea\x4f\xde\x2e\x7e\x59\xbd\xe6\x9b\x77\xdf\xdf\x38\x9e\x89\x9e\x1a" "\xf9\x29\xbb\x6e\xb0\x62\xdd\x22\x88\xd1\x6a\xb4\x84\x05\xa5\xfc\xd4" "\xa5\x34\x3e\xbb\x52\x72\x1b\x39\xde\xac\x73\x85\xf8\x42\xb8\x69\xf7" "\x5c\xa4\x64\x67\x0c\x64\xbf\xe7\x2e\x30\x4d\x78\x18\xa3\xa4\x59\x6a" "\x6f\x09\xa2\x88\xae\x58\xd9\xc2\x51\x8b\x4b\x2f\xd0\x4a\x95\x59\x68" "\x83\x17\x03\x33\x4b\xea\x82\x7a\x11\xf9\x67\x09\xd4\x72\x17\xc5\xe9" "\x82\x43\xbd\xa3\x28\x8a\x20\xe2\x3c\xf6\x9c\x81\xde\xaa\xb5\x30\xec" "\x86\x54\x09\x54\xa6\x7e\x21\x01\x10\x29\x19\x99\x7b\xfb\x7b\x66\x2d" "\x29\x6b\xae\xeb\x03\xf1\xaf\xaa\xb5\xab\x20\x1a\x12\x2b\xe1\xcc\x7f" "\x95\x51\x38\xf6\x2e\xc0\xe5\x88\x8c\x95\xae\x88\xc5\x6a\xd9\xe7\xdc" "\xf7\x27\x02\x91\x1d\x6c\xaf\x0d\x1c\x9d\x60", 181); *(uint8_t*)0x2000024a = 0; *(uint8_t*)0x2000024b = 0x24; *(uint8_t*)0x2000024c = 2; *(uint8_t*)0x2000024d = 1; *(uint8_t*)0x2000024e = 9; *(uint8_t*)0x2000024f = 5; *(uint8_t*)0x20000250 = 0x82; *(uint8_t*)0x20000251 = 2; *(uint16_t*)0x20000252 = 0; *(uint8_t*)0x20000254 = 0; *(uint8_t*)0x20000255 = 0; *(uint8_t*)0x20000256 = 0; *(uint8_t*)0x20000257 = 9; *(uint8_t*)0x20000258 = 5; *(uint8_t*)0x20000259 = 3; *(uint8_t*)0x2000025a = 2; *(uint16_t*)0x2000025b = 0x400; *(uint8_t*)0x2000025d = 0; *(uint8_t*)0x2000025e = 0; *(uint8_t*)0x2000025f = 0; syz_usb_connect(4, 0x260, 0x20000000, 0); *(uint8_t*)0x20001c80 = 0x12; *(uint8_t*)0x20001c81 = 1; *(uint16_t*)0x20001c82 = 0; *(uint8_t*)0x20001c84 = 0; *(uint8_t*)0x20001c85 = 0; *(uint8_t*)0x20001c86 = 0; *(uint8_t*)0x20001c87 = 0; *(uint16_t*)0x20001c88 = 0x1d6b; *(uint16_t*)0x20001c8a = 0x101; *(uint16_t*)0x20001c8c = 0x40; *(uint8_t*)0x20001c8e = 1; *(uint8_t*)0x20001c8f = 2; *(uint8_t*)0x20001c90 = 3; *(uint8_t*)0x20001c91 = 1; *(uint8_t*)0x20001c92 = 9; *(uint8_t*)0x20001c93 = 2; *(uint16_t*)0x20001c94 = 0x5f; *(uint8_t*)0x20001c96 = 3; *(uint8_t*)0x20001c97 = 1; *(uint8_t*)0x20001c98 = 0; *(uint8_t*)0x20001c99 = 0xb0; *(uint8_t*)0x20001c9a = 0; *(uint8_t*)0x20001c9b = 9; *(uint8_t*)0x20001c9c = 4; *(uint8_t*)0x20001c9d = 0; *(uint8_t*)0x20001c9e = 0; *(uint8_t*)0x20001c9f = 0; *(uint8_t*)0x20001ca0 = 1; *(uint8_t*)0x20001ca1 = 1; *(uint8_t*)0x20001ca2 = 0; *(uint8_t*)0x20001ca3 = 0; *(uint8_t*)0x20001ca4 = 0xa; *(uint8_t*)0x20001ca5 = 0x24; *(uint8_t*)0x20001ca6 = 1; *(uint16_t*)0x20001ca7 = 0; *(uint8_t*)0x20001ca9 = 0; *(uint8_t*)0x20001caa = 2; *(uint8_t*)0x20001cab = 1; *(uint8_t*)0x20001cac = 2; *(uint8_t*)0x20001cad = 9; *(uint8_t*)0x20001cae = 4; *(uint8_t*)0x20001caf = 1; *(uint8_t*)0x20001cb0 = 0; *(uint8_t*)0x20001cb1 = 0; *(uint8_t*)0x20001cb2 = 1; *(uint8_t*)0x20001cb3 = 2; *(uint8_t*)0x20001cb4 = 0; *(uint8_t*)0x20001cb5 = 0; *(uint8_t*)0x20001cb6 = 9; *(uint8_t*)0x20001cb7 = 4; *(uint8_t*)0x20001cb8 = 1; *(uint8_t*)0x20001cb9 = 1; *(uint8_t*)0x20001cba = 1; *(uint8_t*)0x20001cbb = 1; *(uint8_t*)0x20001cbc = 2; *(uint8_t*)0x20001cbd = 0; *(uint8_t*)0x20001cbe = 0; *(uint8_t*)0x20001cbf = 9; *(uint8_t*)0x20001cc0 = 5; *(uint8_t*)0x20001cc1 = 1; *(uint8_t*)0x20001cc2 = 9; *(uint16_t*)0x20001cc3 = 0; *(uint8_t*)0x20001cc5 = 0; *(uint8_t*)0x20001cc6 = 0; *(uint8_t*)0x20001cc7 = 0; *(uint8_t*)0x20001cc8 = 7; *(uint8_t*)0x20001cc9 = 0x25; *(uint8_t*)0x20001cca = 1; *(uint8_t*)0x20001ccb = 0; *(uint8_t*)0x20001ccc = 0; *(uint16_t*)0x20001ccd = 0; *(uint8_t*)0x20001ccf = 9; *(uint8_t*)0x20001cd0 = 4; *(uint8_t*)0x20001cd1 = 2; *(uint8_t*)0x20001cd2 = 0; *(uint8_t*)0x20001cd3 = 0; *(uint8_t*)0x20001cd4 = 1; *(uint8_t*)0x20001cd5 = 2; *(uint8_t*)0x20001cd6 = 0; *(uint8_t*)0x20001cd7 = 0; *(uint8_t*)0x20001cd8 = 9; *(uint8_t*)0x20001cd9 = 4; *(uint8_t*)0x20001cda = 2; *(uint8_t*)0x20001cdb = 1; *(uint8_t*)0x20001cdc = 1; *(uint8_t*)0x20001cdd = 1; *(uint8_t*)0x20001cde = 2; *(uint8_t*)0x20001cdf = 0; *(uint8_t*)0x20001ce0 = 0; *(uint8_t*)0x20001ce1 = 9; *(uint8_t*)0x20001ce2 = 5; *(uint8_t*)0x20001ce3 = 0x82; *(uint8_t*)0x20001ce4 = 9; *(uint16_t*)0x20001ce5 = 0; *(uint8_t*)0x20001ce7 = -1; *(uint8_t*)0x20001ce8 = 0; *(uint8_t*)0x20001ce9 = 0; *(uint8_t*)0x20001cea = 7; *(uint8_t*)0x20001ceb = 0x25; *(uint8_t*)0x20001cec = 1; *(uint8_t*)0x20001ced = 0; *(uint8_t*)0x20001cee = 0; *(uint16_t*)0x20001cef = 0; syz_usb_connect(6, 0x71, 0x20001c80, 0); syscall(SYS_fork); } int main(void) { syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul, 0ul); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }