// https://syzkaller.appspot.com/bug?id=3543b2daaecd0dd430ea6fe8a8543ac1fd681e25 // 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 #include static unsigned long long procid; static __thread int clone_ongoing; static __thread int skip_segv; static __thread jmp_buf segv_env; static void segv_handler(int sig, siginfo_t* info, void* ctx) { if (__atomic_load_n(&clone_ongoing, __ATOMIC_RELAXED) != 0) { exit(sig); } uintptr_t addr = (uintptr_t)info->si_addr; const uintptr_t prog_start = 1 << 20; const uintptr_t prog_end = 100 << 20; int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; int valid = addr < prog_start || addr > prog_end; if (skip && valid) { _longjmp(segv_env, 1); } exit(sig); } static void install_segv_handler(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8); syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8); memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = segv_handler; sa.sa_flags = SA_NODEFER | SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGBUS, &sa, NULL); } #define NONFAILING(...) \ ({ \ int ok = 1; \ __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ if (_setjmp(segv_env) == 0) { \ __VA_ARGS__; \ } else \ ok = 0; \ __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ ok; \ }) 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 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; } struct vusb_descriptor { uint8_t req_type; uint8_t desc_type; uint32_t len; char data[0]; } __attribute__((packed)); struct vusb_descriptors { uint32_t len; struct vusb_descriptor* generic; struct vusb_descriptor* descs[0]; } __attribute__((packed)); struct vusb_response { uint8_t type; uint8_t req; uint32_t len; char data[0]; } __attribute__((packed)); struct vusb_responses { uint32_t len; struct vusb_response* generic; struct vusb_response* resps[0]; } __attribute__((packed)); static bool lookup_control_response(const struct vusb_descriptors* descs, const struct vusb_responses* resps, struct usb_ctrlrequest* ctrl, char** response_data, uint32_t* response_length) { int descs_num = 0; int resps_num = 0; if (descs) descs_num = (descs->len - offsetof(struct vusb_descriptors, descs)) / sizeof(descs->descs[0]); if (resps) resps_num = (resps->len - offsetof(struct vusb_responses, resps)) / sizeof(resps->resps[0]); uint8_t req = ctrl->bRequest; uint8_t req_type = ctrl->bRequestType & USB_TYPE_MASK; uint8_t desc_type = ctrl->wValue >> 8; if (req == USB_REQ_GET_DESCRIPTOR) { int i; for (i = 0; i < descs_num; i++) { struct vusb_descriptor* desc = descs->descs[i]; if (!desc) continue; if (desc->req_type == req_type && desc->desc_type == desc_type) { *response_length = desc->len; if (*response_length != 0) *response_data = &desc->data[0]; else *response_data = NULL; return true; } } if (descs && descs->generic) { *response_data = &descs->generic->data[0]; *response_length = descs->generic->len; return true; } } else { int i; for (i = 0; i < resps_num; i++) { struct vusb_response* resp = resps->resps[i]; if (!resp) continue; if (resp->type == req_type && resp->req == req) { *response_length = resp->len; if (*response_length != 0) *response_data = &resp->data[0]; else *response_data = NULL; return true; } } if (resps && resps->generic) { *response_data = &resps->generic->data[0]; *response_length = resps->generic->len; return true; } } 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_ep_write(int fd, struct usb_raw_ep_io* io) { return ioctl(fd, USB_RAW_IOCTL_EP_WRITE, io); } 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_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_event_fetch(int fd, struct usb_raw_event* event) { return ioctl(fd, USB_RAW_IOCTL_EVENT_FETCH, event); } 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_ep0_stall(int fd) { return ioctl(fd, USB_RAW_IOCTL_EP0_STALL, 0); } static int lookup_interface(int fd, uint8_t bInterfaceNumber, uint8_t bAlternateSetting) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return -1; for (int i = 0; i < index->ifaces_num; i++) { if (index->ifaces[i].bInterfaceNumber == bInterfaceNumber && index->ifaces[i].bAlternateSetting == bAlternateSetting) return i; } return -1; } static int lookup_endpoint(int fd, uint8_t bEndpointAddress) { struct usb_device_index* index = lookup_usb_index(fd); if (!index) return -1; if (index->iface_cur < 0) return -1; for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++) if (index->ifaces[index->iface_cur].eps[ep].desc.bEndpointAddress == bEndpointAddress) return index->ifaces[index->iface_cur].eps[ep].handle; return -1; } #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 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; } 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; struct usb_qualifier_descriptor qual; if (event.ctrl.bRequestType & USB_DIR_IN) { if (!lookup_connect_response_in(fd, descs, &event.ctrl, &qual, &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 volatile long syz_usb_control_io(volatile long a0, volatile long a1, volatile long a2) { int fd = a0; const struct vusb_descriptors* descs = (const struct vusb_descriptors*)a1; const struct vusb_responses* resps = (const struct vusb_responses*)a2; struct usb_raw_control_event event; event.inner.type = 0; event.inner.length = USB_MAX_PACKET_SIZE; int rv = usb_raw_event_fetch(fd, (struct usb_raw_event*)&event); if (rv < 0) { return rv; } if (event.inner.type != USB_RAW_EVENT_CONTROL) { return -1; } char* response_data = NULL; uint32_t response_length = 0; if ((event.ctrl.bRequestType & USB_DIR_IN) && event.ctrl.wLength) { if (!lookup_control_response(descs, resps, &event.ctrl, &response_data, &response_length)) { usb_raw_ep0_stall(fd); return -1; } } else { if ((event.ctrl.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD || event.ctrl.bRequest == USB_REQ_SET_INTERFACE) { int iface_num = event.ctrl.wIndex; int alt_set = event.ctrl.wValue; int iface_index = lookup_interface(fd, iface_num, alt_set); if (iface_index < 0) { } else { set_interface(fd, iface_index); } } response_length = event.ctrl.wLength; } 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; if ((event.ctrl.bRequestType & USB_DIR_IN) && !event.ctrl.wLength) { response_length = USB_MAX_PACKET_SIZE; } 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) && event.ctrl.wLength) { 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 0; } static volatile long syz_usb_ep_write(volatile long a0, volatile long a1, volatile long a2, volatile long a3) { int fd = a0; uint8_t ep = a1; uint32_t len = a2; char* data = (char*)a3; int ep_handle = lookup_endpoint(fd, ep); if (ep_handle < 0) { return -1; } struct usb_raw_ep_io_data io_data; io_data.inner.ep = ep_handle; io_data.inner.flags = 0; if (len > sizeof(io_data.data)) len = sizeof(io_data.data); io_data.inner.length = len; memcpy(&io_data.data[0], data, len); int rv = usb_raw_ep_write(fd, (struct usb_raw_ep_io*)&io_data); if (rv < 0) { return rv; } sleep_ms(200); return 0; } 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } NONFAILING(*(uint32_t*)0x200008c0 = 0x97c); NONFAILING(memcpy( (void*)0x200008c4, "\xe2\x62\xba\xd1\x00\x2c\xdc\x88\x4d\x08\x1d\xd5\x2d\x36\x90\x58\x42\xc4" "\x59\xca\xf4\x47\x4f\x62\x78\xfd\x43\x5f\xf4\x33\x8d\xb1\xf3\x07\x69\xcf" "\xd6\x92\x9e\xb3\x33\xcc\x7f\xa2\x5e\x72\x67\x2d\xc6\x97\x74\x96\xba\x79" "\x8e\xa6\x7f\xb5\x14\x2e\x76\x1b\x5f\x91\x81\xf0\xe7\x56\x8f\x1a\x52\x1d" "\x70\x07\xec\xad\x00\xf4\x4a\xb9\x20\x41\xa5\xc3\xa8\x0d\x46\x09\x68\x2b" "\x99\x33\x41\xd8\x25\xd3\x54\x8e\x32\x19\x6c\x2b\x8e\x53\xf1\xcd\x6a\x34" "\xa9\x80\x5b\x49\x89\x71\x43\x20\xc5\xc2\xfa\x3d\x80\x36\xe8\xeb\x66\x7a" "\x10\xd3\x36\x35\x30\x0d\x1a\xe1\x73\x9b\x41\x1a\xeb\x56\xd6\x9d\x58\xfd" "\x67\x56\x01\x64\x26\x69\xfa\x36\xfd\x9c\xed\x61\xf6\x3c\x73\xeb\x03\x01" "\x97\x81\x2b\x33\x3c\x4c\x93\xad\x37\x69\xf9\x2e\xf9\xaf\x73\x85\x79\x92" "\x5a\x6f\x9a\x49\x6d\xb2\x36\x87\xb9\x41\xc9\x52\xc1\xb9\xc3\x70\x1c\x41" "\x9d\xca\xd7\x69\xb4\x92\x2e\xb7\x3e\x2e\xd1\xbc\x93\x38\xd9\xc6\xca\x52" "\x25\x29\x99\xc7\xb5\x1d\x84\x5e\xd9\x2c\xbf\x54\x22\x1b\xb6\xdb\x70\xbc" "\xdf\x9f\xba\xf6\xc8\x1a\xde\xdc\x85\x26\xa8\xb8\x8a\xa4\xb7\x03\x2f\xfa" "\x35\x52\x41\x8e\x4f\xb6\x05\x0c\xa4\xfb\xff\x29\x68\x23\x7b\x31\xc5\xa0" "\x39\xa2\x56\x15\x88\x41\x8b\x3c\xbf\xd3\x87\xb2\xf8\x99\x56\x9a\xb8\x01" "\x43\x9a\x63\x37\x85\xea\x61\x5a\xfe\x0d\x99\x0f\x4f\x59\x15\xa3\xe4\xa7" "\x78\xf5\x56\x4a\x23\x1d\xba\xe6\xa4\x58\x72\xcf\xbd\x59\x53\xa6\x85\x38" "\x25\x99\xdc\x55\x71\x53\xdb\x74\x18\x69\x8b\xe7\xce\xeb\x07\x15\x1e\x8b" "\x43\x21\xac\x2c\x9e\xc6\x78\x01\x34\xbc\x05\x89\x2c\xb3\xd7\xe5\x1b\x6f" "\x97\xcd\xc5\x7b\x6a\x1a\x2f\x33\xe9\xe4\x17\x39\x89\x2f\x4a\x11\x0d\xc1" "\x6b\x8c\xbb\x98\x20\xeb\x19\x16\x84\x41\x60\x81\xb6\xa7\x57\x6c\x3e\x27" "\x23\x40\x34\xf5\xe4\xb7\xb2\x90\x74\x53\xe3\x03\xe8\x1e\x9a\x57\x55\x8e" "\x08\x84\xee\xbd\xd9\x0c\x3c\xc0\xe8\xf0\xda\xb6\x3d\xae\xcf\xc2\x3f\xc8" "\x2d\x1b\x26\xc6\xc6\xbe\x82\x02\x41\x7c\x72\xe5\x73\x1b\x6f\x88\xca\xfa" "\x4d\x3b\xe7\x46\x36\x23\xfa\x2d\xf9\x71\xbf\x5f\x02\x12\x7b\xbe\x04\xbf" "\x40\x7f\x12\xb2\xbe\xd2\xf9\xfc\x17\x77\xe5\x95\xfa\x38\xbb\x39\xd4\xe1" "\xb3\xe4\x9a\x31\x82\xd5\xdb\xc0\x5f\xc6\x17\x2e\x12\xe9\x7f\x82\xeb\xc2" "\x6a\x8a\x9a\x52\x1d\x8f\x48\x02\x71\xea\x77\xa4\x1c\xc2\x26\xe3\x66\x0a" "\x91\x75\xa1\x39\x32\xee\x18\x24\xaf\xed\xe0\x3d\xb6\x2a\x17\x1a\xbe\x37" "\x57\x54\xa5\x0c\xff\x6f\x76\x18\x91\x4f\x9a\x14\x7c\xf9\x60\x28\x96\x65" "\x82\x4b\xb7\xca\xc9\x02\xdf\x33\x42\xfb\x6f\x55\x8b\x22\xb2\x33\xa5\xde" "\x0e\x1c\x52\x6e\x25\xd1\x6f\x59\xb2\x52\xb1\x94\xee\x80\xf9\xef\xcf\x63" "\x8d\xe4\x8a\xe2\x3d\x3f\x90\xb4\x39\xf2\xc3\x1f\x64\x6d\x4a\x89\xbc\x08" "\x41\xfb\x13\x91\x2a\xc9\x01\xcc\xfc\x08\x5a\x76\x80\x5e\x54\x21\xfb\x26" "\x48\x93\x6d\xda\x2c\xba\xae\xf8\xcc\x22\x3a\x53\xb4\xed\xcc\x27\xe2\x7e" "\xdd\x8d\x64\xca\xff\x23\xc5\xe7\x83\x8d\xac\x3e\xbb\xef\x27\x35\x5c\x6c" "\x9b\xb4\x43\x83\xd1\xb6\xe5\xcc\x0e\x41\xab\xc6\x71\x53\x0a\xd4\xcb\x9a" "\x4b\xa0\x48\x28\xc6\x94\x81\x81\x1a\x82\xc9\x50\x1b\x74\xe9\x7f\x87\xf4" "\x95\x94\x56\x5f\x35\x92\xf2\x55\x12\x74\xd0\xab\xb1\x1b\x66\xcf\x64\xf9" "\xfa\x0e\x1b\x12\xfd\xe1\x84\xb7\x5a\xe2\x18\x60\xeb\xcf\x32\x39\x47\xac" "\xcb\x1f\xa0\xb4\x1b\x53\xcc\xa9\x29\xcf\x99\x6f\x74\x4d\xeb\xfc\x9d\xe2" "\xa2\xce\x17\xb1\x81\x87\x92\x78\x12\x4f\xab\x63\xc8\xae\xb0\x3d\x1d\xbb" "\xcf\x7f\x6f\xa2\xf3\x94\x80\x17\x3f\xbc\x87\xea\x7c\xd1\x13\xb6\x0c\x93" "\x95\x9c\x92\x4b\xb6\x6b\x8c\xf4\xa7\xdc\x94\xcc\x2e\x7d\x07\x8d\x94\xcb" "\xad\xed\xee\x95\x83\x76\xc8\x92\xa8\x4f\xdf\x5c\xa1\xbf\x3d\x16\xc1\x16" "\x45\x1b\xc3\x5c\x77\x76\x1f\xeb\x1e\x95\x0e\xb2\xb8\x4e\xf4\x46\x18\x7b" "\x4e\x84\xbb\x94\x43\xfa\x26\xb0\x76\x27\x5d\xe1\x4c\xe7\xe6\x2f\x0e\x48" "\xa5\xd4\x70\x31\xdf\x8a\x0b\xa5\x62\x0b\xe6\xfe\x93\xfd\xc1\xba\x83\xd2" "\xca\x47\x44\x00\xce\x9a\x43\x22\x63\x58\x67\xb5\x0a\x9e\x11\xe4\x96\xda" "\x0c\x5c\x81\x46\xa1\x06\xea\x7c\x14\xc3\x9b\xb0\xca\xb3\x49\x0b\x38\xef" "\x44\x9d\x64\x82\xe6\xd6\x9a\xbc\x7c\x19\x8d\x09\xc5\xd1\xd8\x97\x45\x98" "\x88\x38\xe0\xb4\x1d\xcf\x6a\x9f\xa1\xed\xe1\x2d\xcd\xee\xe8\x1d\x80\xa9" "\x9a\x43\x9c\x80\x5c\x4d\xb2\xf2\x47\x58\x66\x36\xf2\x61\x1e\xe1\xef\x54" "\x99\xb6\x28\x7f\x78\x6e\x99\xbe\xc2\x3c\x66\x1f\x36\x3b\x37\x6c\xb4\x86" "\xba\x7d\x0f\x7e\x50\x7c\x94\xb3\x88\xdb\x24\x98\x0a\x3c\xa0\x20\xc5\x17" "\xf1\xf9\x3c\x40\x73\x84\xb8\x03\x72\x67\x00\x7e\x5d\xa1\xf4\x63\x0b\xc5" "\x08\xd9\xa3\x8a\xbf\xf2\x67\xbf\x36\x62\x3a\x52\x17\xd8\x7f\xef\x75\x76" "\xfc\x9f\xbd\x11\xfb\xe2\x87\x67\xaf\xf0\x9f\x09\xb7\xd5\x26\x64\x18\x4a" "\xda\x06\xc0\x8f\x0e\x51\xaa\xb9\x7d\x07\xb3\xac\x9b\xd5\x4c\x41\x30\xc6" "\x60\x8d\xc8\xc4\x64\xd4\x2b\x7d\xae\x83\xcb\x7c\x30\x93\x41\x3c\xf0\xbf" "\xec\x9c\xd7\xa5\xe2\xdb\x8a\x8a\x60\x9e\x6e\x09\x57\x79\x3d\x52\xa1\x12" "\xd6\x61\x7d\xbf\x6e\x32\x38\x5f\xbc\x4c\x93\xdc\x31\xee\x57\xee\x20\x19" "\x1e\x27\x6d\x55\xc1\x51\x6e\x95\xb4\x23\xc0\x21\x43\x3e\x52\x38\x09\xc1" "\x2a\xf9\xeb\x5b\x97\xdf\x14\x4b\x94\xa4\x4b\xf9\xbd\xea\x01\xc1\x68\xdb" "\xe6\x75\x0d\x4f\x58\xf0\x9b\x2d\x29\x9c\xb0\xb9\xa2\xaa\xcd\x1c\x21\x6f" "\xdc\xa7\x49\xf7\xef\x15\x17\xd4\x56\x93\xac\x4c\x7d\x1b\xed\x4f\xb4\x15" "\xd7\xd5\x4d\xc2\x2a\xa4\xd3\x81\x3c\xb5\x29\x5d\xf5\x22\x28\xe0\x80\x12" "\xe7\x81\x76\x97\x4c\xf6\xf6\xdd\xab\x07\x14\x42\x7f\xae\xc9\x5f\x3c\x4b" "\x9c\x9e\x4c\x65\xd9\x62\xd3\x2c\x5b\x65\xe6\xa4\xba\x44\xad\x9a\x05\x37" "\x90\x7a\x6d\x3d\x0b\xbc\xbd\x0c\x6b\xbb\xe9\xe5\x47\xbf\x4c\x4d\xbf\x72" "\xd6\xab\xe3\x00\x3b\xe7\x06\xe4\xd8\xc3\xd8\x3d\x02\x4c\x1f\xa5\xca\xba" "\xf7\x8c\x47\x23\x5c\x6c\xdb\xdb\x66\x51\x3e\xbd\x56\xd0\xe6\x6e\x38\xb4" "\x82\x67\xcb\x0e\x13\x8e\xbc\xac\xfe\xed\x37\x13\xea\x99\x17\xd2\xe8\x23" "\x45\x9c\x01\x35\xe9\xd9\xf0\xfa\x20\xdd\xf2\xc5\xb3\x7f\xcc\x3c\x89\x67" "\x95\xfc\x6f\x89\x5d\x61\x34\xd9\x22\x16\x79\x4c\x66\x6e\x4b\x47\x44\xc2" "\xc4\x83\x38\xfe\xeb\x83\x08\xab\x89\x3a\xc8\x7d\x59\x3e\x89\xc7\x1b\x30" "\xe6\x22\x29\x15\x1d\x05\xaa\xeb\x03\x4b\x16\xc8\xe0\x29\x79\xc3\x3a\x0e" "\x59\xac\x0e\xc5\x04\x01\x22\xf0\xce\x76\x23\x48\xef\x6d\x0e\x31\xd4\xd6" "\xaf\xd1\x53\xd2\x49\xca\xb8\x39\x9e\x52\x61\x55\xba\x90\x15\x81\x46\x79" "\x38\x87\xc7\x04\x0a\x1c\x02\x10\x3f\x90\x73\x42\x18\xfe\x3e\x5d\x3f\x10" "\x16\x47\x1f\x53\xce\xa6\xd8\x3b\xfc\xfd\x04\x65\xdc\x52\x20\xee\x4c\xcd" "\xda\xc0\xbb\x3a\xe1\x33\xc0\xbd\xa1\x95\x3c\xc0\x87\xf3\xa5\x3a\x23\xf7" "\x7b\xc3\x35\x4a\xd9\xde\x4d\x56\x95\x08\xc1\x41\xe1\x21\x9e\x00\xf5\x6b" "\x66\x26\xc8\xb0\x62\xe8\x16\xa3\x15\x1c\x38\x93\x55\x2b\x41\x1e\xc6\x93" "\x70\x9f\xf3\x0c\x94\xfb\x47\xd0\x8e\x95\xa4\xb1\x54\x72\x1d\x28\x73\x6a" "\x1c\x2a\x11\x78\x98\xc4\x2d\x09\xd6\xee\x02\x58\x6c\x72\x81\x9f\xcc\x7c" "\xf3\x7d\xad\x3e\xe5\xae\x59\x4f\xce\xf9\xbd\x56\xa5\xd8\x73\x7e\x50\x5f" "\xdc\xd2\x73\x44\xa3\x31\x2e\x49\xc9\xf4\x19\xb3\x74\xf1\x91\xf9\x17\x67" "\x4e\x7c\xd7\xce\x77\x25\xcd\xf3\x15\x91\x1b\xe6\xf4\xe3\xbf\xef\xbf\x3f" "\xc0\x42\x6b\x07\x63\x70\x08\xba\x03\x28\x3c\x2d\xdc\x82\x25\x09\xf8\x0b" "\x3a\xab\x82\xfa\xe5\x73\x50\x02\x5b\x87\x9a\xfe\xb1\xc4\x1d\x17\x4f\x85" "\xaa\xa2\x98\x96\x12\xc8\x1e\xd5\xda\xd0\x4f\x1c\x95\xf1\xcf\xa1\xb8\x87" "\x14\xe4\xc7\xd7\xb3\xc1\x72\xa0\xd7\x6f\x31\xff\x3c\x84\xd6\xb7\x32\x72" "\x05\xff\x53\x5e\x55\x1f\x4f\x7a\x5d\xf9\x75\x8f\x12\x4d\xf1\x91\x36\xf8" "\x5c\xd1\x03\x98\x26\x35\x0e\x62\x96\x3f\x63\xe0\xa2\x49\xa4\x96\xbe\xac" "\x8f\x77\x70\xd3\x93\xb2\x2f\x00\x95\x30\x29\x1d\x17\x22\x8c\x4a\xa8\xe2" "\x3f\xbb\x62\x8e\xe4\x7b\x5b\x24\x71\x13\xf6\xaa\x56\x66\xba\x73\x4f\x3c" "\x19\x38\x43\x0f\x67\x80\x44\x97\xc8\x4e\x18\xfd\xe4\xa8\xb6\xef\x70\xf7" "\xf0\x90\x98\x90\xc3\x78\x6a\x04\x92\xe3\xbf\x37\x8b\x14\x3b\x9f\x22\x30" "\x34\xdd\x68\xc6\x33\xa0\x59\x12\x16\x34\x20\x43\xab\x7b\x86\xa1\x34\x48" "\xcc\x47\xec\x59\xdf\x3a\xd5\x8e\xe7\x56\xe9\x56\x00\xe9\xd9\xe3\x0a\xcd" "\x96\xc3\x59\x9e\x84\xc1\x80\x64\x5d\x23\xaf\x0a\x45\x59\xf4\xf2\x3d\x4d" "\xe1\x23\x8c\x37\x38\x59\xe8\x5e\x76\xdc\xe3\xcf\x2b\xa9\x2d\xe1\x2f\x9c" "\xb6\xd5\x74\xba\x37\xc1\xb4\xbf\xe4\x1a\x40\xd4\x03\xf2\x91\xd7\xe4\xfb" "\xd7\xc5\x23\x98\x05\x43\x44\x66\xbc\x28\x60\xcd\xe3\x33\xb9\x23\xa6\x82" "\x76\xd4\xe6\xa0\xfc\xc0\xb8\x3c\x43\x36\x71\x94\x3c\x1c\x66\x7c\xd3\x30" "\xa5\x0b\x31\xa9\x90\xcf\xaa\xfc\x62\x35\xa7\xc2\xf4\x95\xb8\x97\x26\xb8" "\x7a\xa9\x82\x35\xc1\xba\x9d\x67\x40\x3e\xdc\x60\xd7\xc7\xfb\xac\x0d\x33" "\x19\x67\x4c\x28\x16\xcd\xaa\xbb\x8d\x9b\xc2\xa2\xbc\x3a\x13\x4a\x4b\xdd" "\x14\x3f\xa3\xe6\x0c\xcb\x15\x7f\x73\x97\x2a\xb1\x6f\x4a\x02\xcb\x5e\xc1" "\x9b\x68\x98\x93\xc3\x86\x9c\x74\xdb\xa9\xc3\xcf\x3e\x83\xc9\x25\xe8\x91" "\x4c\xca\xd3\x0e\x32\x86\xd7\xd4\xe9\x69\x56\x46\xe9\xa5\x7b\xaa\x39\x03" "\x3e\x07\x76\xb7\x8a\xa4\x64\x22\x10\x59\x19\x0f\xc7\x50\x85\xab\xad\xc1" "\x0b\x72\x08\x30\x20\x0c\xd2\xdb\x77\xa8\x62\xd1\xf4\xd6\x7e\xaa\x68\x0a" "\x45\xfb\x6c\x31\xdb\x6c\x2b\x10\xf2\x7a\x00\x63\x01\xfa\x03\x66\xb5\x68" "\xd5\xf5\x06\x6e\xdc\x28\x19\x67\x2e\x7b\xc8\x0a\x4e\x65\x19\x35\x33\xb3" "\xc1\x57\x24\x2b\xcc\x1b\xdf\x66\xe2\x1f\x64\x52\x8f\x15\x30\x0d\x09\x56" "\xdb\x54\xf0\xf6\x3f\xc4\xcb\x8d\x84\x29\x7d\x3c\x70\x53\x6f\x1f\xb6\xc2" "\xdd\x76\x6d\x44\x6a\x18\x6b\x8b\x33\xd1\xe7\x58\x84\x5d\xfe\x15\x6a\x29" "\x9c\x11\x04\xad\xb4\x25\xf1\x72\xb6\xc5\x05\x88\xa4\x54\x4b\x90\x71\x9f" "\xd1\x00\xd2\x44\xce\xa4\xf7\xa2\x98\x2c\xbb\x93\x95\x4d\x66\xaf\x60\x0a" "\xae\x02\x7a\x6f\x00\x4b\x5c\x04\xc1\x3b\xf6\x79\x9d\xf5\x3e\xcb\x63\x30" "\xbc\xf3\xac\x90\x3a\x9d\x1b\xb6\x9e\x5c\x57\x00\x7e\x9d\xa3\x42\xce\x5f" "\x1c\x16\xed\x1c\x90\x88\x55\xf2\x4f\xd0\xc5\x86\xa7\xfc\x4e\x3e\x35\xf9" "\xbd\x9c\xe0\x70\xc7\x3e\xe5\xbd\x90\x33\x97\xc3\x1d\xd5\x54\x08\xe0\x15" "\x94\x7c\x96\x76\x38\xe7\xaf\x59\x78\x6b\x15\x94\x31\xd8\xb4\x05\x5b\x7d" "\xe7\x5a\x31\x23\x3a\x05\x0d\x6e\x0a\xad\x8b\x1c\xdc\x5b\x45\x3d\x03\xd1" "\xc9\x89\x7e\x9b\x01\xeb\x47\x9d\xf2\x56\xb3\x47\x52\x76\xe1\xca\xe8\xab" "\xe1\xbb\x24\xa1\xb1\x6c\x11\xc3\x55\x76\x72\x35\x55\xf2\x49\x64\xa9\x12" "\x5d\x97\x0a\xdb\x2b\x96\x4e\xf2\x8e\xb8\x5b\x9a\x5c\x3f\x1e\x64\x89\xe7" "\xe2\x11\x8c\x47\x08\xfc\x18\x32\x8f\xd4\xda\x7d\xb8\xe1\x43\x91\x75\x81" "\xb6\x77\x4b\x89\xa5\x3c\x28\xb0\xc4\x96\x55\x53\x17\x55\xe2\x27\xa5\xf4" "\x86\x74\x5b\x6e\x38\xb0\x2e\xcb\xd8\x07\x2d\xa6\x5a\xb1\x1a\xd8\x1a\xa3" "\xbf\x0f\xd4\xf4\xab\x8e\x87\x15\x93\xf2\x2d\x68\x19\xb4\x9f\x71", 2428)); syscall(__NR_ioctl, /*fd=*/-1, /*cmd=*/0x90044802, /*arg=*/0x200008c0ul); NONFAILING(memcpy( (void*)0x20000000, "\x12\x01\x00\x00\x00\x00\x00\x40\x26\x09\x33\x33\x40\x00\x00\x00\x00\x01" "\x09\x02\x24\x00\x01\x00\x00\x00\x00\x09\x04\x00\x00\x01\x03\x01\x00\x00" "\x09\x21\x00\x00\x00\x01\x22\x01\x00\x09\x05\x81\x03\x08", 50)); res = -1; NONFAILING(res = syz_usb_connect(/*speed=*/0, /*dev_len=*/0x36, /*dev=*/0x20000000, /*conn_descs=*/0)); if (res != -1) r[0] = res; NONFAILING(syz_usb_control_io(/*fd=*/r[0], /*descs=*/0, /*resps=*/0)); NONFAILING(*(uint32_t*)0x20000080 = 0x2c); NONFAILING(*(uint64_t*)0x20000084 = 0x20000100); NONFAILING(memcpy((void*)0x20000100, "\x00\x00\x02", 3)); NONFAILING(*(uint64_t*)0x2000008c = 0); NONFAILING(*(uint64_t*)0x20000094 = 0); NONFAILING(*(uint64_t*)0x2000009c = 0); NONFAILING(*(uint64_t*)0x200000a4 = 0); NONFAILING( syz_usb_control_io(/*fd=*/r[0], /*descs=*/0x20000080, /*resps=*/0)); NONFAILING(memcpy( (void*)0x200002c0, "\xb9\x42\x5b\x44\x65\x1d\xd2\x32\x41\x96\x35\x99\x00\x00\x00\x11\x00\x00" "\x00\x4a\x16\x94\x1f\xf5\xf4\xb4\xf1\xf0\xad\xd7\xfc\xf2\xb8\x77\xfc\xea" "\xff\xff\xff\xff\xff\xf1\xff\xdf\x4c\xd9\xf5\xd3\x96\x98\x90\x52\x2c\x77" "\x15\x7d\x88\x01\x00\x00\x00\x3a\x5b\xd5\x53\x1d\x45\x9d\xff\xff\x03\x00" "\x00\x00\x00\x00\x91\xff\x00\x00\x00\xe8\xf5\xb3\x37\x1d\xa3\x63\x5b\x8b" "\x4f\xa6\x37\x13\x58\x00\x00\x1f\x65\xe4\xb4\x36\xaa\x9e\x50\xbc\x0f\x19" "\xb7\xd3\x37\x2f\xf9\xeb\xce\xde\x1f\xb5\xe9\x42\x8f\x54\xd5\xd1\xf0\xcc" "\x75\x2c\xf2\x46\xa5\xd2\xda\x34\xa5\xaa\x97\xdc\x14\xa4\x69\xc3\xdd\x3e" "\x26\xb4\x1c\x35\x64\x84\xe4\x6f\xd6\x6e\x3f\x2c\x78\x07\xe8\x77\x3e\xed" "\x7b\x94\xfa\x09\x9a\xb8\x4f\xea\xde\xc2\xea\x95\xf6\x5b\xba\x45\x2e\xae" "\x5b\x09\x00\xf9\x8a\x97\x9a\x88\xc5\x17\xa2\xdc\x36\x0a\x00\x23\x77\x23" "\xe2\xf4\x67\xaf\x70\x6e\xa1\x72\x26\x29\x6b\x3a\x10\xa3\x51\xcb\x47\xab" "\xa2\xc6\xb8\x36\xc9\x06\x79\xb4\xdd\x85\x9d\xdc\x9e\x48\x00\x44\x8a\xab" "\x00\x00\x00\x00\x00\x00\x0d\x75\xf3\x4b\xb5\x0d\x8d\x70\x84", 249)); NONFAILING(syz_usb_ep_write(/*fd=*/r[0], /*ep=*/0x81, /*len=*/0xffffff75, /*data=*/0x200002c0)); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; install_segv_handler(); loop(); return 0; }