// https://syzkaller.appspot.com/bug?id=1d8a369c2af45bcdebe228d10ac34d0b69606e45 // 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; } /* -------------------------------------------------------------------------- */ /* * Redefinitions to match the linux types used in common_usb.h. */ 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; 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 < 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) { return open("/dev/vhci", 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; ssize_t done; while (1) { 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; ssize_t done; while (1) { 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(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; int portnum, fd, rv; bool done; portnum = procid + 1; if (!dev) { return -1; } if (portnum != 1) { /* For now, we support only one proc. */ return -1; } fd = vhci_open(); if (fd < 0) { return -1; } index = add_usb_index(fd, dev, dev_len); if (!index) { goto err; } rv = vhci_setport(fd, portnum); if (rv != 0) { goto err; } rv = vhci_usb_attach(fd); if (rv != 0) { goto err; } done = false; while (!done) { vhci_request_t req; rv = vhci_usb_recv(fd, &req, sizeof(req)); if (rv != 0) { goto err; } if (req.type != VHCI_REQ_CTRL) { goto err; } char* response_data = NULL; uint32_t response_length = 0; char data[4096]; if (req.u.ctrl.bmRequestType & UE_DIR_IN) { bool response_found = false; response_found = lookup_connect_response_in( fd, descs, (const struct usb_ctrlrequest*)&req.u.ctrl, &response_data, &response_length); if (!response_found) { goto err; } } else { if (!lookup_connect_response_out( fd, descs, (const struct usb_ctrlrequest*)&req.u.ctrl, &done)) { goto err; } 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) { /* TODO: possibly revisit */ } 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) { goto err; } } sleep_ms(200); return fd; err: close(fd); return -1; } 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 void execute_one(void); #define WAIT_FLAGS 0 static void loop(void) { int iter; for (iter = 0;; 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_chdir #define SYS_chdir 12 #endif #ifndef SYS_chroot #define SYS_chroot 61 #endif #ifndef SYS_close #define SYS_close 6 #endif #ifndef SYS_mknodat #define SYS_mknodat 460 #endif #ifndef SYS_mmap #define SYS_mmap 197 #endif #ifndef SYS_sendto #define SYS_sendto 133 #endif void execute_one(void) { *(uint8_t*)0x200000c0 = 0x12; *(uint8_t*)0x200000c1 = 1; *(uint16_t*)0x200000c2 = 0x300; *(uint8_t*)0x200000c4 = 2; *(uint8_t*)0x200000c5 = 0; *(uint8_t*)0x200000c6 = 0; *(uint8_t*)0x200000c7 = 0x10; *(uint16_t*)0x200000c8 = 0x525; *(uint16_t*)0x200000ca = 0xa4a1; *(uint16_t*)0x200000cc = 0x40; *(uint8_t*)0x200000ce = 1; *(uint8_t*)0x200000cf = 2; *(uint8_t*)0x200000d0 = 3; *(uint8_t*)0x200000d1 = 1; *(uint8_t*)0x200000d2 = 9; *(uint8_t*)0x200000d3 = 2; *(uint16_t*)0x200000d4 = 0x86; *(uint8_t*)0x200000d6 = 2; *(uint8_t*)0x200000d7 = 1; *(uint8_t*)0x200000d8 = 2; *(uint8_t*)0x200000d9 = 0x20; *(uint8_t*)0x200000da = 0x20; *(uint8_t*)0x200000db = 9; *(uint8_t*)0x200000dc = 4; *(uint8_t*)0x200000dd = 0; *(uint8_t*)0x200000de = 0; *(uint8_t*)0x200000df = 1; *(uint8_t*)0x200000e0 = 2; *(uint8_t*)0x200000e1 = 0xd; *(uint8_t*)0x200000e2 = 0; *(uint8_t*)0x200000e3 = 0; *(uint8_t*)0x200000e4 = 5; *(uint8_t*)0x200000e5 = 0x24; *(uint8_t*)0x200000e6 = 6; *(uint8_t*)0x200000e7 = 0; *(uint8_t*)0x200000e8 = 1; *(uint8_t*)0x200000e9 = 5; *(uint8_t*)0x200000ea = 0x24; *(uint8_t*)0x200000eb = 0; *(uint16_t*)0x200000ec = 0x1f; *(uint8_t*)0x200000ee = 0xd; *(uint8_t*)0x200000ef = 0x24; *(uint8_t*)0x200000f0 = 0xf; *(uint8_t*)0x200000f1 = 1; *(uint32_t*)0x200000f2 = 8; *(uint16_t*)0x200000f6 = 0xa4a8; *(uint16_t*)0x200000f8 = 8; *(uint8_t*)0x200000fa = 0; *(uint8_t*)0x200000fb = 6; *(uint8_t*)0x200000fc = 0x24; *(uint8_t*)0x200000fd = 0x1a; *(uint16_t*)0x200000fe = 3; *(uint8_t*)0x20000100 = 8; *(uint8_t*)0x20000101 = 0x15; *(uint8_t*)0x20000102 = 0x24; *(uint8_t*)0x20000103 = 0x12; *(uint16_t*)0x20000104 = 5; *(uint64_t*)0x20000106 = 0x14f5e048ba817a3; *(uint64_t*)0x2000010e = 0x2a397ecbffc007a6; *(uint8_t*)0x20000116 = 0x15; *(uint8_t*)0x20000117 = 0x24; *(uint8_t*)0x20000118 = 0x12; *(uint16_t*)0x20000119 = 0x401; *(uint64_t*)0x2000011b = 0x14f5e048ba817a3; *(uint64_t*)0x20000123 = 0x2a397ecbffc007a6; *(uint8_t*)0x2000012b = 9; *(uint8_t*)0x2000012c = 5; *(uint8_t*)0x2000012d = 0x81; *(uint8_t*)0x2000012e = 3; *(uint16_t*)0x2000012f = 0x3ff; *(uint8_t*)0x20000131 = 0xf9; *(uint8_t*)0x20000132 = 6; *(uint8_t*)0x20000133 = 0x40; *(uint8_t*)0x20000134 = 9; *(uint8_t*)0x20000135 = 4; *(uint8_t*)0x20000136 = 1; *(uint8_t*)0x20000137 = 0; *(uint8_t*)0x20000138 = 0; *(uint8_t*)0x20000139 = 2; *(uint8_t*)0x2000013a = 0xd; *(uint8_t*)0x2000013b = 0; *(uint8_t*)0x2000013c = 0; *(uint8_t*)0x2000013d = 9; *(uint8_t*)0x2000013e = 4; *(uint8_t*)0x2000013f = 1; *(uint8_t*)0x20000140 = 1; *(uint8_t*)0x20000141 = 2; *(uint8_t*)0x20000142 = 2; *(uint8_t*)0x20000143 = 0xd; *(uint8_t*)0x20000144 = 0; *(uint8_t*)0x20000145 = 0; *(uint8_t*)0x20000146 = 9; *(uint8_t*)0x20000147 = 5; *(uint8_t*)0x20000148 = 0x82; *(uint8_t*)0x20000149 = 2; *(uint16_t*)0x2000014a = 0x200; *(uint8_t*)0x2000014c = 0; *(uint8_t*)0x2000014d = 5; *(uint8_t*)0x2000014e = 9; *(uint8_t*)0x2000014f = 9; *(uint8_t*)0x20000150 = 5; *(uint8_t*)0x20000151 = 3; *(uint8_t*)0x20000152 = 2; *(uint16_t*)0x20000153 = 0x400; *(uint8_t*)0x20000155 = 0; *(uint8_t*)0x20000156 = 0x20; *(uint8_t*)0x20000157 = 0x1f; syz_usb_connect(5, 0x98, 0x200000c0, 0); *(uint8_t*)0x20000300 = 0x12; *(uint8_t*)0x20000301 = 1; *(uint16_t*)0x20000302 = 0x201; *(uint8_t*)0x20000304 = 0; *(uint8_t*)0x20000305 = 0; *(uint8_t*)0x20000306 = 0; *(uint8_t*)0x20000307 = 0x40; *(uint16_t*)0x20000308 = 0x525; *(uint16_t*)0x2000030a = 0xa4a8; *(uint16_t*)0x2000030c = 0x40; *(uint8_t*)0x2000030e = 1; *(uint8_t*)0x2000030f = 2; *(uint8_t*)0x20000310 = 3; *(uint8_t*)0x20000311 = 1; *(uint8_t*)0x20000312 = 9; *(uint8_t*)0x20000313 = 2; *(uint16_t*)0x20000314 = 0x24; *(uint8_t*)0x20000316 = 1; *(uint8_t*)0x20000317 = 1; *(uint8_t*)0x20000318 = 1; *(uint8_t*)0x20000319 = 0; *(uint8_t*)0x2000031a = 6; *(uint8_t*)0x2000031b = 9; *(uint8_t*)0x2000031c = 4; *(uint8_t*)0x2000031d = 0; *(uint8_t*)0x2000031e = 1; *(uint8_t*)0x2000031f = 1; *(uint8_t*)0x20000320 = 7; *(uint8_t*)0x20000321 = 1; *(uint8_t*)0x20000322 = 1; *(uint8_t*)0x20000323 = 9; *(uint8_t*)0x20000324 = 9; *(uint8_t*)0x20000325 = 5; *(uint8_t*)0x20000326 = 1; *(uint8_t*)0x20000327 = 2; *(uint16_t*)0x20000328 = 0x3ff; *(uint8_t*)0x2000032a = 0x68; *(uint8_t*)0x2000032b = 0x20; *(uint8_t*)0x2000032c = 7; *(uint8_t*)0x2000032d = 9; *(uint8_t*)0x2000032e = 5; *(uint8_t*)0x2000032f = 0x82; *(uint8_t*)0x20000330 = 2; *(uint16_t*)0x20000331 = 0x40; *(uint8_t*)0x20000333 = 7; *(uint8_t*)0x20000334 = 0x81; *(uint8_t*)0x20000335 = 3; syz_usb_connect(1, 0x36, 0x20000300, 0); syscall(SYS_close, -1); syscall(SYS_mknodat, -1, 0ul, 0x10ul, 3); syscall(SYS_sendto, -1, 0ul, 0ul, 0x400ul, 0ul, 0ul); syscall(SYS_chdir, 0ul); *(uint8_t*)0x20001000 = 0x12; *(uint8_t*)0x20001001 = 1; *(uint16_t*)0x20001002 = 0x200; *(uint8_t*)0x20001004 = 0; *(uint8_t*)0x20001005 = 0; *(uint8_t*)0x20001006 = 0; *(uint8_t*)0x20001007 = 8; *(uint16_t*)0x20001008 = 0; *(uint16_t*)0x2000100a = 0; *(uint16_t*)0x2000100c = 0; *(uint8_t*)0x2000100e = 1; *(uint8_t*)0x2000100f = 2; *(uint8_t*)0x20001010 = 3; *(uint8_t*)0x20001011 = 1; *(uint8_t*)0x20001012 = 9; *(uint8_t*)0x20001013 = 2; *(uint16_t*)0x20001014 = 0x174; *(uint8_t*)0x20001016 = 2; *(uint8_t*)0x20001017 = 0; *(uint8_t*)0x20001018 = 4; *(uint8_t*)0x20001019 = 0xc0; *(uint8_t*)0x2000101a = 5; *(uint8_t*)0x2000101b = 9; *(uint8_t*)0x2000101c = 4; *(uint8_t*)0x2000101d = -1; *(uint8_t*)0x2000101e = 6; *(uint8_t*)0x2000101f = 0xc; *(uint8_t*)0x20001020 = 0; *(uint8_t*)0x20001021 = 0; *(uint8_t*)0x20001022 = 0; *(uint8_t*)0x20001023 = 7; *(uint8_t*)0x20001024 = 9; *(uint8_t*)0x20001025 = 5; *(uint8_t*)0x20001026 = 0xa; *(uint8_t*)0x20001027 = 0x10; *(uint16_t*)0x20001028 = 0; *(uint8_t*)0x2000102a = 0x3f; *(uint8_t*)0x2000102b = 2; *(uint8_t*)0x2000102c = 0x30; *(uint8_t*)0x2000102d = 7; *(uint8_t*)0x2000102e = 0x25; *(uint8_t*)0x2000102f = 1; *(uint8_t*)0x20001030 = 0x82; *(uint8_t*)0x20001031 = 6; *(uint16_t*)0x20001032 = 0x200; *(uint8_t*)0x20001034 = 9; *(uint8_t*)0x20001035 = 5; *(uint8_t*)0x20001036 = 8; *(uint8_t*)0x20001037 = 2; *(uint16_t*)0x20001038 = 0x20; *(uint8_t*)0x2000103a = 5; *(uint8_t*)0x2000103b = 7; *(uint8_t*)0x2000103c = 0x80; *(uint8_t*)0x2000103d = 2; *(uint8_t*)0x2000103e = 0x30; *(uint8_t*)0x2000103f = 7; *(uint8_t*)0x20001040 = 0x25; *(uint8_t*)0x20001041 = 1; *(uint8_t*)0x20001042 = 0; *(uint8_t*)0x20001043 = 0x43; *(uint16_t*)0x20001044 = 0x75bf; *(uint8_t*)0x20001046 = 9; *(uint8_t*)0x20001047 = 5; *(uint8_t*)0x20001048 = 2; *(uint8_t*)0x20001049 = 2; *(uint16_t*)0x2000104a = 0x20; *(uint8_t*)0x2000104c = 0x80; *(uint8_t*)0x2000104d = 3; *(uint8_t*)0x2000104e = 8; *(uint8_t*)0x2000104f = 7; *(uint8_t*)0x20001050 = 0x25; *(uint8_t*)0x20001051 = 1; *(uint8_t*)0x20001052 = 0x14; *(uint8_t*)0x20001053 = 0x80; *(uint16_t*)0x20001054 = 7; *(uint8_t*)0x20001056 = 7; *(uint8_t*)0x20001057 = 0x25; *(uint8_t*)0x20001058 = 1; *(uint8_t*)0x20001059 = 0; *(uint8_t*)0x2000105a = 0; *(uint16_t*)0x2000105b = 9; *(uint8_t*)0x2000105d = 9; *(uint8_t*)0x2000105e = 5; *(uint8_t*)0x2000105f = 2; *(uint8_t*)0x20001060 = 0x10; *(uint16_t*)0x20001061 = 0x10; *(uint8_t*)0x20001063 = 8; *(uint8_t*)0x20001064 = 9; *(uint8_t*)0x20001065 = 0x20; *(uint8_t*)0x20001066 = 2; *(uint8_t*)0x20001067 = 1; *(uint8_t*)0x20001068 = 9; *(uint8_t*)0x20001069 = 5; *(uint8_t*)0x2000106a = 0xd; *(uint8_t*)0x2000106b = 3; *(uint16_t*)0x2000106c = 0x3ff; *(uint8_t*)0x2000106e = 2; *(uint8_t*)0x2000106f = 0x8b; *(uint8_t*)0x20001070 = 1; *(uint8_t*)0x20001071 = 7; *(uint8_t*)0x20001072 = 0x25; *(uint8_t*)0x20001073 = 1; *(uint8_t*)0x20001074 = 2; *(uint8_t*)0x20001075 = 4; *(uint16_t*)0x20001076 = 3; *(uint8_t*)0x20001078 = 2; *(uint8_t*)0x20001079 = 7; *(uint8_t*)0x2000107a = 9; *(uint8_t*)0x2000107b = 5; *(uint8_t*)0x2000107c = 3; *(uint8_t*)0x2000107d = 0; *(uint16_t*)0x2000107e = 0x400; *(uint8_t*)0x20001080 = 1; *(uint8_t*)0x20001081 = 1; *(uint8_t*)0x20001082 = 9; *(uint8_t*)0x20001083 = 9; *(uint8_t*)0x20001084 = 5; *(uint8_t*)0x20001085 = 1; *(uint8_t*)0x20001086 = 3; *(uint16_t*)0x20001087 = 8; *(uint8_t*)0x20001089 = 2; *(uint8_t*)0x2000108a = 0; *(uint8_t*)0x2000108b = 8; *(uint8_t*)0x2000108c = 7; *(uint8_t*)0x2000108d = 0x25; *(uint8_t*)0x2000108e = 1; *(uint8_t*)0x2000108f = 2; *(uint8_t*)0x20001090 = 5; *(uint16_t*)0x20001091 = 0x8000; *(uint8_t*)0x20001093 = 9; *(uint8_t*)0x20001094 = 5; *(uint8_t*)0x20001095 = 2; *(uint8_t*)0x20001096 = 0xc; *(uint16_t*)0x20001097 = 0xb92; *(uint8_t*)0x20001099 = -1; *(uint8_t*)0x2000109a = 4; *(uint8_t*)0x2000109b = 0x6f; *(uint8_t*)0x2000109c = 9; *(uint8_t*)0x2000109d = 5; *(uint8_t*)0x2000109e = 0xe; *(uint8_t*)0x2000109f = 2; *(uint16_t*)0x200010a0 = 0x50; *(uint8_t*)0x200010a2 = 0x40; *(uint8_t*)0x200010a3 = 5; *(uint8_t*)0x200010a4 = 7; *(uint8_t*)0x200010a5 = 9; *(uint8_t*)0x200010a6 = 5; *(uint8_t*)0x200010a7 = 2; *(uint8_t*)0x200010a8 = 3; *(uint16_t*)0x200010a9 = 0x200; *(uint8_t*)0x200010ab = 0x1f; *(uint8_t*)0x200010ac = 0x80; *(uint8_t*)0x200010ad = 1; *(uint8_t*)0x200010ae = 9; *(uint8_t*)0x200010af = 5; *(uint8_t*)0x200010b0 = 0xb; *(uint8_t*)0x200010b1 = 0; *(uint16_t*)0x200010b2 = 0x3cf; *(uint8_t*)0x200010b4 = 0x81; *(uint8_t*)0x200010b5 = 6; *(uint8_t*)0x200010b6 = 3; *(uint8_t*)0x200010b7 = 7; *(uint8_t*)0x200010b8 = 0x25; *(uint8_t*)0x200010b9 = 1; *(uint8_t*)0x200010ba = 0x80; *(uint8_t*)0x200010bb = 7; *(uint16_t*)0x200010bc = 0xac; *(uint8_t*)0x200010be = 7; *(uint8_t*)0x200010bf = 0x25; *(uint8_t*)0x200010c0 = 1; *(uint8_t*)0x200010c1 = 3; *(uint8_t*)0x200010c2 = 8; *(uint16_t*)0x200010c3 = 4; *(uint8_t*)0x200010c5 = 9; *(uint8_t*)0x200010c6 = 5; *(uint8_t*)0x200010c7 = 0xa; *(uint8_t*)0x200010c8 = 8; *(uint16_t*)0x200010c9 = 0x10; *(uint8_t*)0x200010cb = 6; *(uint8_t*)0x200010cc = 5; *(uint8_t*)0x200010cd = 5; *(uint8_t*)0x200010ce = 7; *(uint8_t*)0x200010cf = 0x25; *(uint8_t*)0x200010d0 = 1; *(uint8_t*)0x200010d1 = 2; *(uint8_t*)0x200010d2 = 3; *(uint16_t*)0x200010d3 = 0x400; *(uint8_t*)0x200010d5 = 9; *(uint8_t*)0x200010d6 = 4; *(uint8_t*)0x200010d7 = 5; *(uint8_t*)0x200010d8 = 9; *(uint8_t*)0x200010d9 = 0xb; *(uint8_t*)0x200010da = 0; *(uint8_t*)0x200010db = 0; *(uint8_t*)0x200010dc = 0; *(uint8_t*)0x200010dd = 0x81; *(uint8_t*)0x200010de = 5; *(uint8_t*)0x200010df = 0x24; *(uint8_t*)0x200010e0 = 6; *(uint8_t*)0x200010e1 = 0; *(uint8_t*)0x200010e2 = 0; *(uint8_t*)0x200010e3 = 5; *(uint8_t*)0x200010e4 = 0x24; *(uint8_t*)0x200010e5 = 0; *(uint16_t*)0x200010e6 = 9; *(uint8_t*)0x200010e8 = 0xd; *(uint8_t*)0x200010e9 = 0x24; *(uint8_t*)0x200010ea = 0xf; *(uint8_t*)0x200010eb = 1; *(uint32_t*)0x200010ec = 4; *(uint16_t*)0x200010f0 = 6; *(uint16_t*)0x200010f2 = 3; *(uint8_t*)0x200010f4 = 7; *(uint8_t*)0x200010f5 = 9; *(uint8_t*)0x200010f6 = 5; *(uint8_t*)0x200010f7 = 2; *(uint8_t*)0x200010f8 = 4; *(uint16_t*)0x200010f9 = 0x20; *(uint8_t*)0x200010fb = 0x20; *(uint8_t*)0x200010fc = 0xd2; *(uint8_t*)0x200010fd = 2; *(uint8_t*)0x200010fe = 7; *(uint8_t*)0x200010ff = 0x25; *(uint8_t*)0x20001100 = 1; *(uint8_t*)0x20001101 = 2; *(uint8_t*)0x20001102 = 9; *(uint16_t*)0x20001103 = 0xff00; *(uint8_t*)0x20001105 = 9; *(uint8_t*)0x20001106 = 5; *(uint8_t*)0x20001107 = 0xe; *(uint8_t*)0x20001108 = 8; *(uint16_t*)0x20001109 = 0x3ef; *(uint8_t*)0x2000110b = 3; *(uint8_t*)0x2000110c = 9; *(uint8_t*)0x2000110d = 6; *(uint8_t*)0x2000110e = 2; *(uint8_t*)0x2000110f = 0; *(uint8_t*)0x20001110 = 7; *(uint8_t*)0x20001111 = 0x25; *(uint8_t*)0x20001112 = 1; *(uint8_t*)0x20001113 = 3; *(uint8_t*)0x20001114 = 0xf0; *(uint16_t*)0x20001115 = 0x31; *(uint8_t*)0x20001117 = 9; *(uint8_t*)0x20001118 = 5; *(uint8_t*)0x20001119 = 0xf; *(uint8_t*)0x2000111a = 0; *(uint16_t*)0x2000111b = 0x3ff; *(uint8_t*)0x2000111d = 8; *(uint8_t*)0x2000111e = 0x81; *(uint8_t*)0x2000111f = 7; *(uint8_t*)0x20001120 = 2; *(uint8_t*)0x20001121 = 0x11; *(uint8_t*)0x20001122 = 2; *(uint8_t*)0x20001123 = 4; *(uint8_t*)0x20001124 = 9; *(uint8_t*)0x20001125 = 5; *(uint8_t*)0x20001126 = 0xc; *(uint8_t*)0x20001127 = 0; *(uint16_t*)0x20001128 = 0x200; *(uint8_t*)0x2000112a = 0x20; *(uint8_t*)0x2000112b = 6; *(uint8_t*)0x2000112c = 0x74; *(uint8_t*)0x2000112d = 9; *(uint8_t*)0x2000112e = 5; *(uint8_t*)0x2000112f = 0xc; *(uint8_t*)0x20001130 = 2; *(uint16_t*)0x20001131 = 0x400; *(uint8_t*)0x20001133 = 0x7f; *(uint8_t*)0x20001134 = 5; *(uint8_t*)0x20001135 = 3; *(uint8_t*)0x20001136 = 2; *(uint8_t*)0x20001137 = 0x22; *(uint8_t*)0x20001138 = 9; *(uint8_t*)0x20001139 = 5; *(uint8_t*)0x2000113a = 0xd; *(uint8_t*)0x2000113b = 2; *(uint16_t*)0x2000113c = 0x208; *(uint8_t*)0x2000113e = 0x1f; *(uint8_t*)0x2000113f = 0x40; *(uint8_t*)0x20001140 = 1; *(uint8_t*)0x20001141 = 9; *(uint8_t*)0x20001142 = 5; *(uint8_t*)0x20001143 = 0xf; *(uint8_t*)0x20001144 = 1; *(uint16_t*)0x20001145 = 0x9abf; *(uint8_t*)0x20001147 = 0; *(uint8_t*)0x20001148 = 2; *(uint8_t*)0x20001149 = 2; *(uint8_t*)0x2000114a = 2; *(uint8_t*)0x2000114b = 0xe; *(uint8_t*)0x2000114c = 7; *(uint8_t*)0x2000114d = 0x25; *(uint8_t*)0x2000114e = 1; *(uint8_t*)0x2000114f = 0x80; *(uint8_t*)0x20001150 = 0xfb; *(uint16_t*)0x20001151 = 1; *(uint8_t*)0x20001153 = 9; *(uint8_t*)0x20001154 = 5; *(uint8_t*)0x20001155 = 1; *(uint8_t*)0x20001156 = 0; *(uint16_t*)0x20001157 = 0x10; *(uint8_t*)0x20001159 = -1; *(uint8_t*)0x2000115a = 0x93; *(uint8_t*)0x2000115b = 3; *(uint8_t*)0x2000115c = 2; *(uint8_t*)0x2000115d = 6; *(uint8_t*)0x2000115e = 2; *(uint8_t*)0x2000115f = 0xc; *(uint8_t*)0x20001160 = 9; *(uint8_t*)0x20001161 = 5; *(uint8_t*)0x20001162 = 9; *(uint8_t*)0x20001163 = 8; *(uint16_t*)0x20001164 = 0x3ff; *(uint8_t*)0x20001166 = 1; *(uint8_t*)0x20001167 = 8; *(uint8_t*)0x20001168 = 0xe1; *(uint8_t*)0x20001169 = 7; *(uint8_t*)0x2000116a = 0x25; *(uint8_t*)0x2000116b = 1; *(uint8_t*)0x2000116c = 0x83; *(uint8_t*)0x2000116d = 6; *(uint16_t*)0x2000116e = 0xfb; *(uint8_t*)0x20001170 = 2; *(uint8_t*)0x20001171 = 0xa; *(uint8_t*)0x20001172 = 9; *(uint8_t*)0x20001173 = 5; *(uint8_t*)0x20001174 = 0xf; *(uint8_t*)0x20001175 = 0x10; *(uint16_t*)0x20001176 = 0x3ff; *(uint8_t*)0x20001178 = 0; *(uint8_t*)0x20001179 = 6; *(uint8_t*)0x2000117a = 7; *(uint8_t*)0x2000117b = 2; *(uint8_t*)0x2000117c = 4; *(uint8_t*)0x2000117d = 9; *(uint8_t*)0x2000117e = 5; *(uint8_t*)0x2000117f = 9; *(uint8_t*)0x20001180 = 8; *(uint16_t*)0x20001181 = 0x10; *(uint8_t*)0x20001183 = 8; *(uint8_t*)0x20001184 = 6; *(uint8_t*)0x20001185 = 4; syz_usb_connect(3, 0x186, 0x20001000, 0); syscall(SYS_chroot, 0ul); } 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; }