// https://syzkaller.appspot.com/bug?id=3cd92b1d85428b128503bfa7a250294c9ae00bd8 // 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 #include #include 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 bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } #define MAX_FDS 30 #define USB_MAX_IFACE_NUM 4 #define USB_MAX_EP_NUM 32 #define USB_MAX_FDS 6 struct usb_endpoint_index { struct usb_endpoint_descriptor desc; int handle; }; struct usb_iface_index { struct usb_interface_descriptor* iface; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bInterfaceClass; struct usb_endpoint_index eps[USB_MAX_EP_NUM]; int eps_num; }; struct usb_device_index { struct usb_device_descriptor* dev; struct usb_config_descriptor* config; uint8_t bDeviceClass; uint8_t bMaxPower; int config_length; struct usb_iface_index ifaces[USB_MAX_IFACE_NUM]; int ifaces_num; int iface_cur; }; struct usb_info { int fd; struct usb_device_index index; }; static struct usb_info usb_devices[USB_MAX_FDS]; static int usb_devices_num; static bool parse_usb_descriptor(const char* buffer, size_t length, struct usb_device_index* index) { if (length < sizeof(*index->dev) + sizeof(*index->config)) return false; memset(index, 0, sizeof(*index)); index->dev = (struct usb_device_descriptor*)buffer; index->config = (struct usb_config_descriptor*)(buffer + sizeof(*index->dev)); index->bDeviceClass = index->dev->bDeviceClass; index->bMaxPower = index->config->bMaxPower; index->config_length = length - sizeof(*index->dev); index->iface_cur = -1; size_t offset = 0; while (true) { if (offset + 1 >= length) break; uint8_t desc_length = buffer[offset]; uint8_t desc_type = buffer[offset + 1]; if (desc_length <= 2) break; if (offset + desc_length > length) break; if (desc_type == USB_DT_INTERFACE && index->ifaces_num < USB_MAX_IFACE_NUM) { struct usb_interface_descriptor* iface = (struct usb_interface_descriptor*)(buffer + offset); index->ifaces[index->ifaces_num].iface = iface; index->ifaces[index->ifaces_num].bInterfaceNumber = iface->bInterfaceNumber; index->ifaces[index->ifaces_num].bAlternateSetting = iface->bAlternateSetting; index->ifaces[index->ifaces_num].bInterfaceClass = iface->bInterfaceClass; index->ifaces_num++; } if (desc_type == USB_DT_ENDPOINT && index->ifaces_num > 0) { struct usb_iface_index* iface = &index->ifaces[index->ifaces_num - 1]; if (iface->eps_num < USB_MAX_EP_NUM) { memcpy(&iface->eps[iface->eps_num].desc, buffer + offset, sizeof(iface->eps[iface->eps_num].desc)); iface->eps_num++; } } offset += desc_length; } return true; } static struct usb_device_index* add_usb_index(int fd, const char* dev, size_t dev_len) { int i = __atomic_fetch_add(&usb_devices_num, 1, __ATOMIC_RELAXED); if (i >= USB_MAX_FDS) return NULL; if (!parse_usb_descriptor(dev, dev_len, &usb_devices[i].index)) return NULL; __atomic_store_n(&usb_devices[i].fd, fd, __ATOMIC_RELEASE); return &usb_devices[i].index; } static struct usb_device_index* lookup_usb_index(int fd) { for (int i = 0; i < USB_MAX_FDS; i++) { if (__atomic_load_n(&usb_devices[i].fd, __ATOMIC_ACQUIRE) == fd) return &usb_devices[i].index; } return NULL; } struct vusb_connect_string_descriptor { uint32_t len; char* str; } __attribute__((packed)); struct vusb_connect_descriptors { uint32_t qual_len; char* qual; uint32_t bos_len; char* bos; uint32_t strs_len; struct vusb_connect_string_descriptor strs[0]; } __attribute__((packed)); static const char default_string[] = {8, USB_DT_STRING, 's', 0, 'y', 0, 'z', 0}; static const char default_lang_id[] = {4, USB_DT_STRING, 0x09, 0x04}; static bool lookup_connect_response_in(int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, char** response_data, uint32_t* response_length) { struct usb_device_index* index = lookup_usb_index(fd); uint8_t str_idx; if (!index) return false; switch (ctrl->bRequestType & USB_TYPE_MASK) { case USB_TYPE_STANDARD: switch (ctrl->bRequest) { case USB_REQ_GET_DESCRIPTOR: switch (ctrl->wValue >> 8) { case USB_DT_DEVICE: *response_data = (char*)index->dev; *response_length = sizeof(*index->dev); return true; case USB_DT_CONFIG: *response_data = (char*)index->config; *response_length = index->config_length; return true; case USB_DT_STRING: str_idx = (uint8_t)ctrl->wValue; if (descs && str_idx < descs->strs_len) { *response_data = descs->strs[str_idx].str; *response_length = descs->strs[str_idx].len; return true; } if (str_idx == 0) { *response_data = (char*)&default_lang_id[0]; *response_length = default_lang_id[0]; return true; } *response_data = (char*)&default_string[0]; *response_length = default_string[0]; return true; case USB_DT_BOS: *response_data = descs->bos; *response_length = descs->bos_len; return true; case USB_DT_DEVICE_QUALIFIER: if (!descs->qual) { struct usb_qualifier_descriptor* qual = (struct usb_qualifier_descriptor*)response_data; qual->bLength = sizeof(*qual); qual->bDescriptorType = USB_DT_DEVICE_QUALIFIER; qual->bcdUSB = index->dev->bcdUSB; qual->bDeviceClass = index->dev->bDeviceClass; qual->bDeviceSubClass = index->dev->bDeviceSubClass; qual->bDeviceProtocol = index->dev->bDeviceProtocol; qual->bMaxPacketSize0 = index->dev->bMaxPacketSize0; qual->bNumConfigurations = index->dev->bNumConfigurations; qual->bRESERVED = 0; *response_length = sizeof(*qual); return true; } *response_data = descs->qual; *response_length = descs->qual_len; return true; default: break; } break; default: break; } break; default: break; } return false; } typedef bool (*lookup_connect_out_response_t)( int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, bool* done); static bool lookup_connect_response_out_generic( int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, bool* done) { switch (ctrl->bRequestType & USB_TYPE_MASK) { case USB_TYPE_STANDARD: switch (ctrl->bRequest) { case USB_REQ_SET_CONFIGURATION: *done = true; return true; default: break; } break; } return false; } #define UDC_NAME_LENGTH_MAX 128 struct usb_raw_init { __u8 driver_name[UDC_NAME_LENGTH_MAX]; __u8 device_name[UDC_NAME_LENGTH_MAX]; __u8 speed; }; enum usb_raw_event_type { USB_RAW_EVENT_INVALID = 0, USB_RAW_EVENT_CONNECT = 1, USB_RAW_EVENT_CONTROL = 2, }; struct usb_raw_event { __u32 type; __u32 length; __u8 data[0]; }; struct usb_raw_ep_io { __u16 ep; __u16 flags; __u32 length; __u8 data[0]; }; #define USB_RAW_EPS_NUM_MAX 30 #define USB_RAW_EP_NAME_MAX 16 #define USB_RAW_EP_ADDR_ANY 0xff struct usb_raw_ep_caps { __u32 type_control : 1; __u32 type_iso : 1; __u32 type_bulk : 1; __u32 type_int : 1; __u32 dir_in : 1; __u32 dir_out : 1; }; struct usb_raw_ep_limits { __u16 maxpacket_limit; __u16 max_streams; __u32 reserved; }; struct usb_raw_ep_info { __u8 name[USB_RAW_EP_NAME_MAX]; __u32 addr; struct usb_raw_ep_caps caps; struct usb_raw_ep_limits limits; }; struct usb_raw_eps_info { struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX]; }; #define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init) #define USB_RAW_IOCTL_RUN _IO('U', 1) #define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event) #define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io) #define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io) #define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor) #define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32) #define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io) #define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io) #define USB_RAW_IOCTL_CONFIGURE _IO('U', 9) #define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32) #define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info) #define USB_RAW_IOCTL_EP0_STALL _IO('U', 12) #define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32) #define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32) #define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32) static int usb_raw_open() { return open("/dev/raw-gadget", O_RDWR); } static int usb_raw_init(int fd, uint32_t speed, const char* driver, const char* device) { struct usb_raw_init arg; strncpy((char*)&arg.driver_name[0], driver, sizeof(arg.driver_name)); strncpy((char*)&arg.device_name[0], device, sizeof(arg.device_name)); arg.speed = speed; return ioctl(fd, USB_RAW_IOCTL_INIT, &arg); } static int usb_raw_run(int fd) { return ioctl(fd, USB_RAW_IOCTL_RUN, 0); } static int usb_raw_event_fetch(int fd, struct usb_raw_event* event) { return ioctl(fd, USB_RAW_IOCTL_EVENT_FETCH, event); } static int usb_raw_ep0_write(int fd, struct usb_raw_ep_io* io) { return ioctl(fd, USB_RAW_IOCTL_EP0_WRITE, io); } static int usb_raw_ep0_read(int fd, struct usb_raw_ep_io* io) { return ioctl(fd, USB_RAW_IOCTL_EP0_READ, io); } static int usb_raw_ep_enable(int fd, struct usb_endpoint_descriptor* desc) { return ioctl(fd, USB_RAW_IOCTL_EP_ENABLE, desc); } static int usb_raw_ep_disable(int fd, int ep) { return ioctl(fd, USB_RAW_IOCTL_EP_DISABLE, ep); } static int usb_raw_configure(int fd) { return ioctl(fd, USB_RAW_IOCTL_CONFIGURE, 0); } static int usb_raw_vbus_draw(int fd, uint32_t power) { return ioctl(fd, USB_RAW_IOCTL_VBUS_DRAW, power); } static int usb_raw_ep0_stall(int fd) { return ioctl(fd, USB_RAW_IOCTL_EP0_STALL, 0); } static void set_interface(int fd, int n) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return; if (index->iface_cur >= 0 && index->iface_cur < index->ifaces_num) { for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++) { int rv = usb_raw_ep_disable( fd, index->ifaces[index->iface_cur].eps[ep].handle); if (rv < 0) { } else { } } } if (n >= 0 && n < index->ifaces_num) { for (int ep = 0; ep < index->ifaces[n].eps_num; ep++) { int rv = usb_raw_ep_enable(fd, &index->ifaces[n].eps[ep].desc); if (rv < 0) { } else { index->ifaces[n].eps[ep].handle = rv; } } index->iface_cur = n; } } static int configure_device(int fd) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return -1; int rv = usb_raw_vbus_draw(fd, index->bMaxPower); if (rv < 0) { return rv; } rv = usb_raw_configure(fd); if (rv < 0) { return rv; } set_interface(fd, 0); return 0; } #define USB_MAX_PACKET_SIZE 4096 struct usb_raw_control_event { struct usb_raw_event inner; struct usb_ctrlrequest ctrl; char data[USB_MAX_PACKET_SIZE]; }; struct usb_raw_ep_io_data { struct usb_raw_ep_io inner; char data[USB_MAX_PACKET_SIZE]; }; static volatile long syz_usb_connect_impl(uint64_t speed, uint64_t dev_len, const char* dev, const struct vusb_connect_descriptors* descs, lookup_connect_out_response_t lookup_connect_response_out) { if (!dev) { return -1; } int fd = usb_raw_open(); if (fd < 0) { return fd; } if (fd >= MAX_FDS) { close(fd); return -1; } struct usb_device_index* index = add_usb_index(fd, dev, dev_len); if (!index) { return -1; } char device[32]; sprintf(&device[0], "dummy_udc.%llu", procid); int rv = usb_raw_init(fd, speed, "dummy_udc", &device[0]); if (rv < 0) { return rv; } rv = usb_raw_run(fd); if (rv < 0) { return rv; } bool done = false; while (!done) { struct usb_raw_control_event event; event.inner.type = 0; event.inner.length = sizeof(event.ctrl); rv = usb_raw_event_fetch(fd, (struct usb_raw_event*)&event); if (rv < 0) { return rv; } if (event.inner.type != USB_RAW_EVENT_CONTROL) continue; char* response_data = NULL; uint32_t response_length = 0; if (event.ctrl.bRequestType & USB_DIR_IN) { if (!lookup_connect_response_in(fd, descs, &event.ctrl, &response_data, &response_length)) { usb_raw_ep0_stall(fd); continue; } } else { if (!lookup_connect_response_out(fd, descs, &event.ctrl, &done)) { usb_raw_ep0_stall(fd); continue; } response_data = NULL; response_length = event.ctrl.wLength; } if ((event.ctrl.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD && event.ctrl.bRequest == USB_REQ_SET_CONFIGURATION) { rv = configure_device(fd); if (rv < 0) { return rv; } } struct usb_raw_ep_io_data response; response.inner.ep = 0; response.inner.flags = 0; if (response_length > sizeof(response.data)) response_length = 0; if (event.ctrl.wLength < response_length) response_length = event.ctrl.wLength; response.inner.length = response_length; if (response_data) memcpy(&response.data[0], response_data, response_length); else memset(&response.data[0], 0, response_length); if (event.ctrl.bRequestType & USB_DIR_IN) { rv = usb_raw_ep0_write(fd, (struct usb_raw_ep_io*)&response); } else { rv = usb_raw_ep0_read(fd, (struct usb_raw_ep_io*)&response); } if (rv < 0) { return rv; } } sleep_ms(200); return fd; } static volatile long syz_usb_connect(volatile long a0, volatile long a1, volatile long a2, volatile long a3) { uint64_t speed = a0; uint64_t dev_len = a1; const char* dev = (const char*)a2; const struct vusb_connect_descriptors* descs = (const struct vusb_connect_descriptors*)a3; return syz_usb_connect_impl(speed, dev_len, dev, descs, &lookup_connect_response_out_generic); } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { setup_test(); 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 < 5000) continue; kill_and_wait(pid, &status); break; } } } void execute_one(void) { *(uint8_t*)0x20000640 = 0x12; *(uint8_t*)0x20000641 = 1; *(uint16_t*)0x20000642 = 0x201; *(uint8_t*)0x20000644 = 0x1a; *(uint8_t*)0x20000645 = 0x67; *(uint8_t*)0x20000646 = 0xb7; *(uint8_t*)0x20000647 = 0x20; *(uint16_t*)0x20000648 = 0x13d3; *(uint16_t*)0x2000064a = 0x3340; *(uint16_t*)0x2000064c = 0x4fb7; *(uint8_t*)0x2000064e = 1; *(uint8_t*)0x2000064f = 2; *(uint8_t*)0x20000650 = 3; *(uint8_t*)0x20000651 = 1; *(uint8_t*)0x20000652 = 9; *(uint8_t*)0x20000653 = 2; *(uint16_t*)0x20000654 = 0x295; *(uint8_t*)0x20000656 = 4; *(uint8_t*)0x20000657 = 0xfb; *(uint8_t*)0x20000658 = 0x27; *(uint8_t*)0x20000659 = 0x50; *(uint8_t*)0x2000065a = 0; *(uint8_t*)0x2000065b = 9; *(uint8_t*)0x2000065c = 4; *(uint8_t*)0x2000065d = 0xe4; *(uint8_t*)0x2000065e = 8; *(uint8_t*)0x2000065f = 0xc; *(uint8_t*)0x20000660 = 0x8b; *(uint8_t*)0x20000661 = 0x18; *(uint8_t*)0x20000662 = 0xa9; *(uint8_t*)0x20000663 = 6; *(uint8_t*)0x20000664 = 0xa; *(uint8_t*)0x20000665 = 0x24; *(uint8_t*)0x20000666 = 1; *(uint16_t*)0x20000667 = 0x800; *(uint8_t*)0x20000669 = 0x87; *(uint8_t*)0x2000066a = 2; *(uint8_t*)0x2000066b = 1; *(uint8_t*)0x2000066c = 2; *(uint8_t*)0x2000066d = 7; *(uint8_t*)0x2000066e = 0x24; *(uint8_t*)0x2000066f = 7; *(uint8_t*)0x20000670 = 2; *(uint16_t*)0x20000671 = 5; *(uint8_t*)0x20000673 = -1; *(uint8_t*)0x20000674 = 7; *(uint8_t*)0x20000675 = 0x24; *(uint8_t*)0x20000676 = 8; *(uint8_t*)0x20000677 = 6; *(uint16_t*)0x20000678 = 1; *(uint8_t*)0x2000067a = 0x3f; *(uint8_t*)0x2000067b = 7; *(uint8_t*)0x2000067c = 0x24; *(uint8_t*)0x2000067d = 8; *(uint8_t*)0x2000067e = 5; *(uint16_t*)0x2000067f = 0xb9; *(uint8_t*)0x20000681 = 9; *(uint8_t*)0x20000682 = 0xc; *(uint8_t*)0x20000683 = 0x24; *(uint8_t*)0x20000684 = 2; *(uint8_t*)0x20000685 = 6; *(uint16_t*)0x20000686 = 0x1ff; *(uint8_t*)0x20000688 = 5; *(uint8_t*)0x20000689 = 0; *(uint16_t*)0x2000068a = 0xfff; *(uint8_t*)0x2000068c = 0x80; *(uint8_t*)0x2000068d = 0x9d; *(uint8_t*)0x2000068e = 9; *(uint8_t*)0x2000068f = 5; *(uint8_t*)0x20000690 = 0xb; *(uint8_t*)0x20000691 = 0x10; *(uint16_t*)0x20000692 = 0x40; *(uint8_t*)0x20000694 = 0x62; *(uint8_t*)0x20000695 = 2; *(uint8_t*)0x20000696 = 0xca; *(uint8_t*)0x20000697 = 2; *(uint8_t*)0x20000698 = 0; *(uint8_t*)0x20000699 = 9; *(uint8_t*)0x2000069a = 5; *(uint8_t*)0x2000069b = 0xe; *(uint8_t*)0x2000069c = 1; *(uint16_t*)0x2000069d = 0x200; *(uint8_t*)0x2000069f = 9; *(uint8_t*)0x200006a0 = 0x50; *(uint8_t*)0x200006a1 = 5; *(uint8_t*)0x200006a2 = 7; *(uint8_t*)0x200006a3 = 0x25; *(uint8_t*)0x200006a4 = 1; *(uint8_t*)0x200006a5 = 0xc2; *(uint8_t*)0x200006a6 = 3; *(uint16_t*)0x200006a7 = 0; *(uint8_t*)0x200006a9 = 9; *(uint8_t*)0x200006aa = 5; *(uint8_t*)0x200006ab = 0xb; *(uint8_t*)0x200006ac = 0; *(uint16_t*)0x200006ad = 0x40; *(uint8_t*)0x200006af = 5; *(uint8_t*)0x200006b0 = 0xa4; *(uint8_t*)0x200006b1 = 1; *(uint8_t*)0x200006b2 = 2; *(uint8_t*)0x200006b3 = 1; *(uint8_t*)0x200006b4 = 9; *(uint8_t*)0x200006b5 = 5; *(uint8_t*)0x200006b6 = 0xd; *(uint8_t*)0x200006b7 = 2; *(uint16_t*)0x200006b8 = 0x20; *(uint8_t*)0x200006ba = 0x40; *(uint8_t*)0x200006bb = 3; *(uint8_t*)0x200006bc = 6; *(uint8_t*)0x200006bd = 7; *(uint8_t*)0x200006be = 0x25; *(uint8_t*)0x200006bf = 1; *(uint8_t*)0x200006c0 = 1; *(uint8_t*)0x200006c1 = 0x7f; *(uint16_t*)0x200006c2 = 0xffda; *(uint8_t*)0x200006c4 = 9; *(uint8_t*)0x200006c5 = 5; *(uint8_t*)0x200006c6 = 0xe; *(uint8_t*)0x200006c7 = 0; *(uint16_t*)0x200006c8 = 0x200; *(uint8_t*)0x200006ca = 0; *(uint8_t*)0x200006cb = 7; *(uint8_t*)0x200006cc = 0; *(uint8_t*)0x200006cd = 7; *(uint8_t*)0x200006ce = 0x25; *(uint8_t*)0x200006cf = 1; *(uint8_t*)0x200006d0 = 0; *(uint8_t*)0x200006d1 = 6; *(uint16_t*)0x200006d2 = 7; *(uint8_t*)0x200006d4 = 9; *(uint8_t*)0x200006d5 = 5; *(uint8_t*)0x200006d6 = 0xe; *(uint8_t*)0x200006d7 = 0x10; *(uint16_t*)0x200006d8 = 0x200; *(uint8_t*)0x200006da = 0; *(uint8_t*)0x200006db = 8; *(uint8_t*)0x200006dc = 0; *(uint8_t*)0x200006dd = 7; *(uint8_t*)0x200006de = 0x25; *(uint8_t*)0x200006df = 1; *(uint8_t*)0x200006e0 = 0x81; *(uint8_t*)0x200006e1 = 0x8b; *(uint16_t*)0x200006e2 = 0x32; *(uint8_t*)0x200006e4 = 9; *(uint8_t*)0x200006e5 = 5; *(uint8_t*)0x200006e6 = 0x80; *(uint8_t*)0x200006e7 = 0x32; *(uint16_t*)0x200006e8 = 0x20; *(uint8_t*)0x200006ea = 0xf3; *(uint8_t*)0x200006eb = 0; *(uint8_t*)0x200006ec = 0; *(uint8_t*)0x200006ed = 7; *(uint8_t*)0x200006ee = 0x25; *(uint8_t*)0x200006ef = 1; *(uint8_t*)0x200006f0 = 0xc2; *(uint8_t*)0x200006f1 = 2; *(uint16_t*)0x200006f2 = 7; *(uint8_t*)0x200006f4 = 9; *(uint8_t*)0x200006f5 = 5; *(uint8_t*)0x200006f6 = 6; *(uint8_t*)0x200006f7 = 0x10; *(uint16_t*)0x200006f8 = 0x40; *(uint8_t*)0x200006fa = 7; *(uint8_t*)0x200006fb = 1; *(uint8_t*)0x200006fc = 0x80; *(uint8_t*)0x200006fd = 7; *(uint8_t*)0x200006fe = 0x25; *(uint8_t*)0x200006ff = 1; *(uint8_t*)0x20000700 = 2; *(uint8_t*)0x20000701 = 1; *(uint16_t*)0x20000702 = 0x800; *(uint8_t*)0x20000704 = 9; *(uint8_t*)0x20000705 = 5; *(uint8_t*)0x20000706 = 7; *(uint8_t*)0x20000707 = 1; *(uint16_t*)0x20000708 = 0x3ff; *(uint8_t*)0x2000070a = 0; *(uint8_t*)0x2000070b = 0x80; *(uint8_t*)0x2000070c = 8; *(uint8_t*)0x2000070d = 7; *(uint8_t*)0x2000070e = 0x25; *(uint8_t*)0x2000070f = 1; *(uint8_t*)0x20000710 = 0x82; *(uint8_t*)0x20000711 = 0x3f; *(uint16_t*)0x20000712 = 9; *(uint8_t*)0x20000714 = 9; *(uint8_t*)0x20000715 = 5; *(uint8_t*)0x20000716 = 0x80; *(uint8_t*)0x20000717 = 0; *(uint16_t*)0x20000718 = 0x20; *(uint8_t*)0x2000071a = 4; *(uint8_t*)0x2000071b = 0x40; *(uint8_t*)0x2000071c = 5; *(uint8_t*)0x2000071d = 7; *(uint8_t*)0x2000071e = 0x25; *(uint8_t*)0x2000071f = 1; *(uint8_t*)0x20000720 = 6; *(uint8_t*)0x20000721 = 2; *(uint16_t*)0x20000722 = 8; *(uint8_t*)0x20000724 = 7; *(uint8_t*)0x20000725 = 0x25; *(uint8_t*)0x20000726 = 1; *(uint8_t*)0x20000727 = 2; *(uint8_t*)0x20000728 = 0x10; *(uint16_t*)0x20000729 = 2; *(uint8_t*)0x2000072b = 9; *(uint8_t*)0x2000072c = 5; *(uint8_t*)0x2000072d = 0xb; *(uint8_t*)0x2000072e = 0xc; *(uint16_t*)0x2000072f = 0x10; *(uint8_t*)0x20000731 = 0; *(uint8_t*)0x20000732 = 1; *(uint8_t*)0x20000733 = 0x3f; *(uint8_t*)0x20000734 = 2; *(uint8_t*)0x20000735 = 0x1a; *(uint8_t*)0x20000736 = 9; *(uint8_t*)0x20000737 = 5; *(uint8_t*)0x20000738 = 0xa; *(uint8_t*)0x20000739 = 0; *(uint16_t*)0x2000073a = 0x20; *(uint8_t*)0x2000073c = 0x74; *(uint8_t*)0x2000073d = 1; *(uint8_t*)0x2000073e = 3; *(uint8_t*)0x2000073f = 7; *(uint8_t*)0x20000740 = 0x25; *(uint8_t*)0x20000741 = 1; *(uint8_t*)0x20000742 = 0x81; *(uint8_t*)0x20000743 = 0xfa; *(uint16_t*)0x20000744 = 6; *(uint8_t*)0x20000746 = 2; *(uint8_t*)0x20000747 = 0xe; *(uint8_t*)0x20000748 = 9; *(uint8_t*)0x20000749 = 4; *(uint8_t*)0x2000074a = 0x1e; *(uint8_t*)0x2000074b = 0xda; *(uint8_t*)0x2000074c = 5; *(uint8_t*)0x2000074d = 0x65; *(uint8_t*)0x2000074e = 0x95; *(uint8_t*)0x2000074f = 0xbc; *(uint8_t*)0x20000750 = 7; *(uint8_t*)0x20000751 = 0xa; *(uint8_t*)0x20000752 = 0x24; *(uint8_t*)0x20000753 = 1; *(uint16_t*)0x20000754 = 7; *(uint8_t*)0x20000756 = 4; *(uint8_t*)0x20000757 = 2; *(uint8_t*)0x20000758 = 1; *(uint8_t*)0x20000759 = 2; *(uint8_t*)0x2000075a = 9; *(uint8_t*)0x2000075b = 0x24; *(uint8_t*)0x2000075c = 3; *(uint8_t*)0x2000075d = 9; *(uint16_t*)0x2000075e = 0x1ff; *(uint8_t*)0x20000760 = 4; *(uint8_t*)0x20000761 = 3; *(uint8_t*)0x20000762 = 0x1f; *(uint8_t*)0x20000763 = 7; *(uint8_t*)0x20000764 = 0x24; *(uint8_t*)0x20000765 = 7; *(uint8_t*)0x20000766 = 2; *(uint16_t*)0x20000767 = 3; *(uint8_t*)0x20000769 = 1; *(uint8_t*)0x2000076a = 7; *(uint8_t*)0x2000076b = 0x24; *(uint8_t*)0x2000076c = 1; *(uint8_t*)0x2000076d = 0xc3; *(uint8_t*)0x2000076e = 0x80; *(uint16_t*)0x2000076f = 5; *(uint8_t*)0x20000771 = 8; *(uint8_t*)0x20000772 = 0x24; *(uint8_t*)0x20000773 = 2; *(uint8_t*)0x20000774 = 1; *(uint8_t*)0x20000775 = 0x80; *(uint8_t*)0x20000776 = 4; *(uint8_t*)0x20000777 = 4; *(uint8_t*)0x20000778 = 0; *(uint8_t*)0x20000779 = 8; *(uint8_t*)0x2000077a = 0x24; *(uint8_t*)0x2000077b = 2; *(uint8_t*)0x2000077c = 1; *(uint8_t*)0x2000077d = 0x1f; *(uint8_t*)0x2000077e = 3; *(uint8_t*)0x2000077f = 1; *(uint8_t*)0x20000780 = 7; *(uint8_t*)0x20000781 = 8; *(uint8_t*)0x20000782 = 0x24; *(uint8_t*)0x20000783 = 2; *(uint8_t*)0x20000784 = 1; *(uint8_t*)0x20000785 = 0x84; *(uint8_t*)0x20000786 = 3; *(uint8_t*)0x20000787 = 0x80; *(uint8_t*)0x20000788 = 0; *(uint8_t*)0x20000789 = 8; *(uint8_t*)0x2000078a = 0x24; *(uint8_t*)0x2000078b = 2; *(uint8_t*)0x2000078c = 1; *(uint8_t*)0x2000078d = 5; *(uint8_t*)0x2000078e = 4; *(uint8_t*)0x2000078f = 4; *(uint8_t*)0x20000790 = 0x8c; *(uint8_t*)0x20000791 = 8; *(uint8_t*)0x20000792 = 0x24; *(uint8_t*)0x20000793 = 2; *(uint8_t*)0x20000794 = 1; *(uint8_t*)0x20000795 = 0x7f; *(uint8_t*)0x20000796 = 2; *(uint8_t*)0x20000797 = 2; *(uint8_t*)0x20000798 = 0x81; *(uint8_t*)0x20000799 = 9; *(uint8_t*)0x2000079a = 5; *(uint8_t*)0x2000079b = 6; *(uint8_t*)0x2000079c = 0x19; *(uint16_t*)0x2000079d = 0x400; *(uint8_t*)0x2000079f = 0; *(uint8_t*)0x200007a0 = 5; *(uint8_t*)0x200007a1 = 0x3f; *(uint8_t*)0x200007a2 = 2; *(uint8_t*)0x200007a3 = 0xd; *(uint8_t*)0x200007a4 = 9; *(uint8_t*)0x200007a5 = 5; *(uint8_t*)0x200007a6 = 5; *(uint8_t*)0x200007a7 = 1; *(uint16_t*)0x200007a8 = 0x40; *(uint8_t*)0x200007aa = 0xd3; *(uint8_t*)0x200007ab = 8; *(uint8_t*)0x200007ac = 7; *(uint8_t*)0x200007ad = 2; *(uint8_t*)0x200007ae = 4; *(uint8_t*)0x200007af = 7; *(uint8_t*)0x200007b0 = 0x25; *(uint8_t*)0x200007b1 = 1; *(uint8_t*)0x200007b2 = 1; *(uint8_t*)0x200007b3 = 1; *(uint16_t*)0x200007b4 = 0; *(uint8_t*)0x200007b6 = 9; *(uint8_t*)0x200007b7 = 5; *(uint8_t*)0x200007b8 = 0; *(uint8_t*)0x200007b9 = 0; *(uint16_t*)0x200007ba = 0x3ff; *(uint8_t*)0x200007bc = 0x20; *(uint8_t*)0x200007bd = 0x5b; *(uint8_t*)0x200007be = 7; *(uint8_t*)0x200007bf = 7; *(uint8_t*)0x200007c0 = 0x25; *(uint8_t*)0x200007c1 = 1; *(uint8_t*)0x200007c2 = 0x80; *(uint8_t*)0x200007c3 = 1; *(uint16_t*)0x200007c4 = 9; *(uint8_t*)0x200007c6 = 9; *(uint8_t*)0x200007c7 = 5; *(uint8_t*)0x200007c8 = 0xa; *(uint8_t*)0x200007c9 = 2; *(uint16_t*)0x200007ca = 0x400; *(uint8_t*)0x200007cc = 8; *(uint8_t*)0x200007cd = 4; *(uint8_t*)0x200007ce = 0x7f; *(uint8_t*)0x200007cf = 2; *(uint8_t*)0x200007d0 = 0x7d; *(uint8_t*)0x200007d1 = 9; *(uint8_t*)0x200007d2 = 5; *(uint8_t*)0x200007d3 = 8; *(uint8_t*)0x200007d4 = 0; *(uint16_t*)0x200007d5 = 0x200; *(uint8_t*)0x200007d7 = 5; *(uint8_t*)0x200007d8 = 3; *(uint8_t*)0x200007d9 = 7; *(uint8_t*)0x200007da = 2; *(uint8_t*)0x200007db = 3; *(uint8_t*)0x200007dc = 9; *(uint8_t*)0x200007dd = 4; *(uint8_t*)0x200007de = 0x5a; *(uint8_t*)0x200007df = 0; *(uint8_t*)0x200007e0 = 9; *(uint8_t*)0x200007e1 = 0x97; *(uint8_t*)0x200007e2 = 0x28; *(uint8_t*)0x200007e3 = 0xee; *(uint8_t*)0x200007e4 = 7; *(uint8_t*)0x200007e5 = 9; *(uint8_t*)0x200007e6 = 0x21; *(uint16_t*)0x200007e7 = 4; *(uint8_t*)0x200007e9 = 5; *(uint8_t*)0x200007ea = 1; *(uint8_t*)0x200007eb = 0x22; *(uint16_t*)0x200007ec = 0xc64; *(uint8_t*)0x200007ee = 9; *(uint8_t*)0x200007ef = 5; *(uint8_t*)0x200007f0 = 5; *(uint8_t*)0x200007f1 = 0; *(uint16_t*)0x200007f2 = 0x3ff; *(uint8_t*)0x200007f4 = 3; *(uint8_t*)0x200007f5 = 0x5c; *(uint8_t*)0x200007f6 = 0xa0; *(uint8_t*)0x200007f7 = 7; *(uint8_t*)0x200007f8 = 0x25; *(uint8_t*)0x200007f9 = 1; *(uint8_t*)0x200007fa = 2; *(uint8_t*)0x200007fb = 7; *(uint16_t*)0x200007fc = 0x59c; *(uint8_t*)0x200007fe = 9; *(uint8_t*)0x200007ff = 5; *(uint8_t*)0x20000800 = 0xd; *(uint8_t*)0x20000801 = 0; *(uint16_t*)0x20000802 = 0x3ff; *(uint8_t*)0x20000804 = 0x20; *(uint8_t*)0x20000805 = -1; *(uint8_t*)0x20000806 = -1; *(uint8_t*)0x20000807 = 7; *(uint8_t*)0x20000808 = 0x25; *(uint8_t*)0x20000809 = 1; *(uint8_t*)0x2000080a = 3; *(uint8_t*)0x2000080b = 0x7f; *(uint16_t*)0x2000080c = 0x6db; *(uint8_t*)0x2000080e = 9; *(uint8_t*)0x2000080f = 5; *(uint8_t*)0x20000810 = 0xb; *(uint8_t*)0x20000811 = 0; *(uint16_t*)0x20000812 = 0x10; *(uint8_t*)0x20000814 = 8; *(uint8_t*)0x20000815 = 0; *(uint8_t*)0x20000816 = 1; *(uint8_t*)0x20000817 = 2; *(uint8_t*)0x20000818 = 0x31; *(uint8_t*)0x20000819 = 9; *(uint8_t*)0x2000081a = 5; *(uint8_t*)0x2000081b = 7; *(uint8_t*)0x2000081c = 4; *(uint16_t*)0x2000081d = 0x20; *(uint8_t*)0x2000081f = 0x80; *(uint8_t*)0x20000820 = -1; *(uint8_t*)0x20000821 = 4; *(uint8_t*)0x20000822 = 7; *(uint8_t*)0x20000823 = 0x25; *(uint8_t*)0x20000824 = 1; *(uint8_t*)0x20000825 = 0x82; *(uint8_t*)0x20000826 = 8; *(uint16_t*)0x20000827 = 0x400; *(uint8_t*)0x20000829 = 9; *(uint8_t*)0x2000082a = 5; *(uint8_t*)0x2000082b = 0xe; *(uint8_t*)0x2000082c = 3; *(uint16_t*)0x2000082d = 0x48; *(uint8_t*)0x2000082f = 0xe8; *(uint8_t*)0x20000830 = 7; *(uint8_t*)0x20000831 = -1; *(uint8_t*)0x20000832 = 2; *(uint8_t*)0x20000833 = 0x2b; *(uint8_t*)0x20000834 = 9; *(uint8_t*)0x20000835 = 5; *(uint8_t*)0x20000836 = 0x80; *(uint8_t*)0x20000837 = 0; *(uint16_t*)0x20000838 = 0x200; *(uint8_t*)0x2000083a = 7; *(uint8_t*)0x2000083b = 0xbb; *(uint8_t*)0x2000083c = 1; *(uint8_t*)0x2000083d = 7; *(uint8_t*)0x2000083e = 0x25; *(uint8_t*)0x2000083f = 1; *(uint8_t*)0x20000840 = 0; *(uint8_t*)0x20000841 = 7; *(uint16_t*)0x20000842 = 4; *(uint8_t*)0x20000844 = 9; *(uint8_t*)0x20000845 = 5; *(uint8_t*)0x20000846 = 0xe; *(uint8_t*)0x20000847 = 3; *(uint16_t*)0x20000848 = 0x20; *(uint8_t*)0x2000084a = 8; *(uint8_t*)0x2000084b = 0x40; *(uint8_t*)0x2000084c = 4; *(uint8_t*)0x2000084d = 2; *(uint8_t*)0x2000084e = 0x39; *(uint8_t*)0x2000084f = 9; *(uint8_t*)0x20000850 = 5; *(uint8_t*)0x20000851 = 0; *(uint8_t*)0x20000852 = 0; *(uint16_t*)0x20000853 = 0x20; *(uint8_t*)0x20000855 = 0xf7; *(uint8_t*)0x20000856 = 6; *(uint8_t*)0x20000857 = 8; *(uint8_t*)0x20000858 = 7; *(uint8_t*)0x20000859 = 0x25; *(uint8_t*)0x2000085a = 1; *(uint8_t*)0x2000085b = 0x80; *(uint8_t*)0x2000085c = 8; *(uint16_t*)0x2000085d = 7; *(uint8_t*)0x2000085f = 9; *(uint8_t*)0x20000860 = 5; *(uint8_t*)0x20000861 = 9; *(uint8_t*)0x20000862 = 0; *(uint16_t*)0x20000863 = 0x400; *(uint8_t*)0x20000865 = 0; *(uint8_t*)0x20000866 = 0x20; *(uint8_t*)0x20000867 = 0x20; *(uint8_t*)0x20000868 = 7; *(uint8_t*)0x20000869 = 0x25; *(uint8_t*)0x2000086a = 1; *(uint8_t*)0x2000086b = 0; *(uint8_t*)0x2000086c = 2; *(uint16_t*)0x2000086d = 2; *(uint8_t*)0x2000086f = 7; *(uint8_t*)0x20000870 = 0x25; *(uint8_t*)0x20000871 = 1; *(uint8_t*)0x20000872 = 1; *(uint8_t*)0x20000873 = 1; *(uint16_t*)0x20000874 = 1; *(uint8_t*)0x20000876 = 9; *(uint8_t*)0x20000877 = 4; *(uint8_t*)0x20000878 = 0xa7; *(uint8_t*)0x20000879 = 6; *(uint8_t*)0x2000087a = 1; *(uint8_t*)0x2000087b = -1; *(uint8_t*)0x2000087c = 6; *(uint8_t*)0x2000087d = 0x4a; *(uint8_t*)0x2000087e = 8; *(uint8_t*)0x2000087f = 8; *(uint8_t*)0x20000880 = 0x24; *(uint8_t*)0x20000881 = 2; *(uint8_t*)0x20000882 = 1; *(uint8_t*)0x20000883 = 0xfc; *(uint8_t*)0x20000884 = 2; *(uint8_t*)0x20000885 = 0x28; *(uint8_t*)0x20000886 = 0x8a; *(uint8_t*)0x20000887 = 7; *(uint8_t*)0x20000888 = 0x24; *(uint8_t*)0x20000889 = 1; *(uint8_t*)0x2000088a = 1; *(uint8_t*)0x2000088b = 4; *(uint16_t*)0x2000088c = 0; *(uint8_t*)0x2000088e = 8; *(uint8_t*)0x2000088f = 0x24; *(uint8_t*)0x20000890 = 2; *(uint8_t*)0x20000891 = 1; *(uint8_t*)0x20000892 = 1; *(uint8_t*)0x20000893 = 1; *(uint8_t*)0x20000894 = 7; *(uint8_t*)0x20000895 = 0xfe; *(uint8_t*)0x20000896 = 9; *(uint8_t*)0x20000897 = 0x24; *(uint8_t*)0x20000898 = 2; *(uint8_t*)0x20000899 = 2; *(uint16_t*)0x2000089a = 0x6f5; *(uint16_t*)0x2000089c = 0xfd14; *(uint8_t*)0x2000089e = 0xf4; *(uint8_t*)0x2000089f = 9; *(uint8_t*)0x200008a0 = 0x24; *(uint8_t*)0x200008a1 = 2; *(uint8_t*)0x200008a2 = 2; *(uint16_t*)0x200008a3 = 0xfff; *(uint16_t*)0x200008a5 = 0x8001; *(uint8_t*)0x200008a7 = 0x16; *(uint8_t*)0x200008a8 = 8; *(uint8_t*)0x200008a9 = 0x24; *(uint8_t*)0x200008aa = 2; *(uint8_t*)0x200008ab = 1; *(uint8_t*)0x200008ac = 8; *(uint8_t*)0x200008ad = 2; *(uint8_t*)0x200008ae = 5; *(uint8_t*)0x200008af = -1; *(uint8_t*)0x200008b0 = 9; *(uint8_t*)0x200008b1 = 0x24; *(uint8_t*)0x200008b2 = 2; *(uint8_t*)0x200008b3 = 2; *(uint16_t*)0x200008b4 = 0x7ff; *(uint16_t*)0x200008b6 = 3; *(uint8_t*)0x200008b8 = 0x20; *(uint8_t*)0x200008b9 = 8; *(uint8_t*)0x200008ba = 0x24; *(uint8_t*)0x200008bb = 2; *(uint8_t*)0x200008bc = 1; *(uint8_t*)0x200008bd = 7; *(uint8_t*)0x200008be = 2; *(uint8_t*)0x200008bf = 0x7f; *(uint8_t*)0x200008c0 = 7; *(uint8_t*)0x200008c1 = 7; *(uint8_t*)0x200008c2 = 0x24; *(uint8_t*)0x200008c3 = 1; *(uint8_t*)0x200008c4 = 4; *(uint8_t*)0x200008c5 = 0; *(uint16_t*)0x200008c6 = 1; *(uint8_t*)0x200008c8 = 8; *(uint8_t*)0x200008c9 = 0x24; *(uint8_t*)0x200008ca = 2; *(uint8_t*)0x200008cb = 1; *(uint8_t*)0x200008cc = 3; *(uint8_t*)0x200008cd = 4; *(uint8_t*)0x200008ce = 0x80; *(uint8_t*)0x200008cf = 9; *(uint8_t*)0x200008d0 = 9; *(uint8_t*)0x200008d1 = 5; *(uint8_t*)0x200008d2 = 3; *(uint8_t*)0x200008d3 = 1; *(uint16_t*)0x200008d4 = 8; *(uint8_t*)0x200008d6 = -1; *(uint8_t*)0x200008d7 = 0xfd; *(uint8_t*)0x200008d8 = 0; *(uint8_t*)0x200008d9 = 7; *(uint8_t*)0x200008da = 0x25; *(uint8_t*)0x200008db = 1; *(uint8_t*)0x200008dc = 1; *(uint8_t*)0x200008dd = 0xc0; *(uint16_t*)0x200008de = 0x2e2; *(uint8_t*)0x200008e0 = 7; *(uint8_t*)0x200008e1 = 0x25; *(uint8_t*)0x200008e2 = 1; *(uint8_t*)0x200008e3 = 0x80; *(uint8_t*)0x200008e4 = 0; *(uint16_t*)0x200008e5 = 2; *(uint32_t*)0x20000f00 = 0; *(uint64_t*)0x20000f04 = 0; *(uint32_t*)0x20000f0c = 0; *(uint64_t*)0x20000f10 = 0; *(uint32_t*)0x20000f18 = 0xa; *(uint32_t*)0x20000f1c = 0; *(uint64_t*)0x20000f20 = 0; *(uint32_t*)0x20000f28 = 0; *(uint64_t*)0x20000f2c = 0; *(uint32_t*)0x20000f34 = 0; *(uint64_t*)0x20000f38 = 0; *(uint32_t*)0x20000f40 = 0; *(uint64_t*)0x20000f44 = 0; *(uint32_t*)0x20000f4c = 0; *(uint64_t*)0x20000f50 = 0; *(uint32_t*)0x20000f58 = 0; *(uint64_t*)0x20000f5c = 0; *(uint32_t*)0x20000f64 = 0; *(uint64_t*)0x20000f68 = 0; *(uint32_t*)0x20000f70 = 0; *(uint64_t*)0x20000f74 = 0; *(uint32_t*)0x20000f7c = 0; *(uint64_t*)0x20000f80 = 0; *(uint32_t*)0x20000f88 = 0; *(uint64_t*)0x20000f8c = 0; syz_usb_connect(0, 0x2a7, 0x20000640, 0x20000f00); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); loop(); return 0; }