// https://syzkaller.appspot.com/bug?id=47ca2ff42f9c5d5d353149ecc97f29de7828bbfd // 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 #ifndef SYS_dup3 #define SYS_dup3 454 #endif #ifndef SYS_fchownat #define SYS_fchownat 464 #endif #ifndef SYS_mmap #define SYS_mmap 197 #endif #ifndef SYS_openat #define SYS_openat 468 #endif #ifndef SYS_semctl #define SYS_semctl 442 #endif #ifndef SYS_semget #define SYS_semget 221 #endif 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_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 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; } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { pthread_mutex_t mu; pthread_cond_t cv; int state; } event_t; static void event_init(event_t* ev) { if (pthread_mutex_init(&ev->mu, 0)) exit(1); if (pthread_cond_init(&ev->cv, 0)) exit(1); ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { pthread_mutex_lock(&ev->mu); if (ev->state) exit(1); ev->state = 1; pthread_mutex_unlock(&ev->mu); pthread_cond_broadcast(&ev->cv); } static void event_wait(event_t* ev) { pthread_mutex_lock(&ev->mu); while (!ev->state) pthread_cond_wait(&ev->cv, &ev->mu); pthread_mutex_unlock(&ev->mu); } static int event_isset(event_t* ev) { pthread_mutex_lock(&ev->mu); int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; pthread_mutex_lock(&ev->mu); for (;;) { if (ev->state) break; uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); now = current_time_ms(); if (now - start > timeout) break; } int res = ev->state; pthread_mutex_unlock(&ev->mu); return res; } #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) struct usb_endpoint_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint8_t bEndpointAddress; uint8_t bmAttributes; uint16_t wMaxPacketSize; uint8_t bInterval; uint8_t bRefresh; uint8_t bSynchAddress; } __attribute__((packed)); struct usb_device_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t bcdUSB; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; uint8_t bMaxPacketSize0; uint16_t idVendor; uint16_t idProduct; uint16_t bcdDevice; uint8_t iManufacturer; uint8_t iProduct; uint8_t iSerialNumber; uint8_t bNumConfigurations; } __attribute__((packed)); struct usb_config_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t wTotalLength; uint8_t bNumInterfaces; uint8_t bConfigurationValue; uint8_t iConfiguration; uint8_t bmAttributes; uint8_t bMaxPower; } __attribute__((packed)); struct usb_interface_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bNumEndpoints; uint8_t bInterfaceClass; uint8_t bInterfaceSubClass; uint8_t bInterfaceProtocol; uint8_t iInterface; } __attribute__((packed)); struct usb_ctrlrequest { uint8_t bRequestType; uint8_t bRequest; uint16_t wValue; uint16_t wIndex; uint16_t wLength; } __attribute__((packed)); struct usb_qualifier_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t bcdUSB; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; uint8_t bMaxPacketSize0; uint8_t bNumConfigurations; uint8_t bRESERVED; } __attribute__((packed)); #define USB_TYPE_MASK (0x03 << 5) #define USB_TYPE_STANDARD (0x00 << 5) #define USB_TYPE_CLASS (0x01 << 5) #define USB_TYPE_VENDOR (0x02 << 5) #define USB_TYPE_RESERVED (0x03 << 5) #define USB_DT_DEVICE 0x01 #define USB_DT_CONFIG 0x02 #define USB_DT_STRING 0x03 #define USB_DT_INTERFACE 0x04 #define USB_DT_ENDPOINT 0x05 #define USB_DT_DEVICE_QUALIFIER 0x06 #define USB_DT_OTHER_SPEED_CONFIG 0x07 #define USB_DT_INTERFACE_POWER 0x08 #define USB_DT_OTG 0x09 #define USB_DT_DEBUG 0x0a #define USB_DT_INTERFACE_ASSOCIATION 0x0b #define USB_DT_SECURITY 0x0c #define USB_DT_KEY 0x0d #define USB_DT_ENCRYPTION_TYPE 0x0e #define USB_DT_BOS 0x0f #define USB_DT_DEVICE_CAPABILITY 0x10 #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 #define USB_DT_WIRE_ADAPTER 0x21 #define USB_DT_RPIPE 0x22 #define USB_DT_CS_RADIO_CONTROL 0x23 #define USB_DT_PIPE_USAGE 0x24 #define USB_DT_SS_ENDPOINT_COMP 0x30 #define USB_DT_SSP_ISOC_ENDPOINT_COMP 0x31 #define USB_REQ_GET_STATUS 0x00 #define USB_REQ_CLEAR_FEATURE 0x01 #define USB_REQ_SET_FEATURE 0x03 #define USB_REQ_SET_ADDRESS 0x05 #define USB_REQ_GET_DESCRIPTOR 0x06 #define USB_REQ_SET_DESCRIPTOR 0x07 #define USB_REQ_GET_CONFIGURATION 0x08 #define USB_REQ_SET_CONFIGURATION 0x09 #define USB_REQ_GET_INTERFACE 0x0A #define USB_REQ_SET_INTERFACE 0x0B #define USB_REQ_SYNCH_FRAME 0x0C #define USB_REQ_SET_SEL 0x30 #define USB_REQ_SET_ISOCH_DELAY 0x31 #define USB_REQ_SET_ENCRYPTION 0x0D #define USB_REQ_GET_ENCRYPTION 0x0E #define USB_REQ_RPIPE_ABORT 0x0E #define USB_REQ_SET_HANDSHAKE 0x0F #define USB_REQ_RPIPE_RESET 0x0F #define USB_REQ_GET_HANDSHAKE 0x10 #define USB_REQ_SET_CONNECTION 0x11 #define USB_REQ_SET_SECURITY_DATA 0x12 #define USB_REQ_GET_SECURITY_DATA 0x13 #define USB_REQ_SET_WUSB_DATA 0x14 #define USB_REQ_LOOPBACK_DATA_WRITE 0x15 #define USB_REQ_LOOPBACK_DATA_READ 0x16 #define USB_REQ_SET_INTERFACE_DS 0x17 #define USB_REQ_GET_PARTNER_PDO 20 #define USB_REQ_GET_BATTERY_STATUS 21 #define USB_REQ_SET_PDO 22 #define USB_REQ_GET_VDM 23 #define USB_REQ_SEND_VDM 24 #define USB_MAX_IFACE_NUM 4 #define USB_MAX_EP_NUM 32 #define USB_MAX_FDS 6 struct usb_endpoint_index { struct usb_endpoint_descriptor desc; int handle; }; struct usb_iface_index { struct usb_interface_descriptor* iface; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bInterfaceClass; struct usb_endpoint_index eps[USB_MAX_EP_NUM]; int eps_num; }; struct usb_device_index { struct usb_device_descriptor* dev; struct usb_config_descriptor* config; uint8_t bDeviceClass; uint8_t bMaxPower; int config_length; struct usb_iface_index ifaces[USB_MAX_IFACE_NUM]; int ifaces_num; int iface_cur; }; struct usb_info { int fd; struct usb_device_index index; }; static struct usb_info usb_devices[USB_MAX_FDS]; static int usb_devices_num; static bool parse_usb_descriptor(const char* buffer, size_t length, struct usb_device_index* index) { if (length < sizeof(*index->dev) + sizeof(*index->config)) return false; memset(index, 0, sizeof(*index)); index->dev = (struct usb_device_descriptor*)buffer; index->config = (struct usb_config_descriptor*)(buffer + sizeof(*index->dev)); index->bDeviceClass = index->dev->bDeviceClass; index->bMaxPower = index->config->bMaxPower; index->config_length = length - sizeof(*index->dev); index->iface_cur = -1; size_t offset = 0; while (true) { if (offset + 1 >= length) break; uint8_t desc_length = buffer[offset]; uint8_t desc_type = buffer[offset + 1]; if (desc_length <= 2) break; if (offset + desc_length > length) break; if (desc_type == USB_DT_INTERFACE && index->ifaces_num < USB_MAX_IFACE_NUM) { struct usb_interface_descriptor* iface = (struct usb_interface_descriptor*)(buffer + offset); index->ifaces[index->ifaces_num].iface = iface; index->ifaces[index->ifaces_num].bInterfaceNumber = iface->bInterfaceNumber; index->ifaces[index->ifaces_num].bAlternateSetting = iface->bAlternateSetting; index->ifaces[index->ifaces_num].bInterfaceClass = iface->bInterfaceClass; index->ifaces_num++; } if (desc_type == USB_DT_ENDPOINT && index->ifaces_num > 0) { struct usb_iface_index* iface = &index->ifaces[index->ifaces_num - 1]; if (iface->eps_num < USB_MAX_EP_NUM) { memcpy(&iface->eps[iface->eps_num].desc, buffer + offset, sizeof(iface->eps[iface->eps_num].desc)); iface->eps_num++; } } offset += desc_length; } return true; } static struct usb_device_index* add_usb_index(int fd, const char* dev, size_t dev_len) { int i = __atomic_fetch_add(&usb_devices_num, 1, __ATOMIC_RELAXED); if (i >= USB_MAX_FDS) return NULL; if (!parse_usb_descriptor(dev, dev_len, &usb_devices[i].index)) return NULL; __atomic_store_n(&usb_devices[i].fd, fd, __ATOMIC_RELEASE); return &usb_devices[i].index; } static struct usb_device_index* lookup_usb_index(int fd) { for (int i = 0; i < USB_MAX_FDS; i++) { if (__atomic_load_n(&usb_devices[i].fd, __ATOMIC_ACQUIRE) == fd) return &usb_devices[i].index; } return NULL; } struct vusb_connect_string_descriptor { uint32_t len; char* str; } __attribute__((packed)); struct vusb_connect_descriptors { uint32_t qual_len; char* qual; uint32_t bos_len; char* bos; uint32_t strs_len; struct vusb_connect_string_descriptor strs[0]; } __attribute__((packed)); static const char default_string[] = {8, USB_DT_STRING, 's', 0, 'y', 0, 'z', 0}; static const char default_lang_id[] = {4, USB_DT_STRING, 0x09, 0x04}; static bool lookup_connect_response_in(int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, char** response_data, uint32_t* response_length) { struct usb_device_index* index = lookup_usb_index(fd); uint8_t str_idx; if (!index) return false; switch (ctrl->bRequestType & USB_TYPE_MASK) { case USB_TYPE_STANDARD: switch (ctrl->bRequest) { case USB_REQ_GET_DESCRIPTOR: switch (ctrl->wValue >> 8) { case USB_DT_DEVICE: *response_data = (char*)index->dev; *response_length = sizeof(*index->dev); return true; case USB_DT_CONFIG: *response_data = (char*)index->config; *response_length = index->config_length; return true; case USB_DT_STRING: str_idx = (uint8_t)ctrl->wValue; if (descs && str_idx < descs->strs_len) { *response_data = descs->strs[str_idx].str; *response_length = descs->strs[str_idx].len; return true; } if (str_idx == 0) { *response_data = (char*)&default_lang_id[0]; *response_length = default_lang_id[0]; return true; } *response_data = (char*)&default_string[0]; *response_length = default_string[0]; return true; case USB_DT_BOS: *response_data = descs->bos; *response_length = descs->bos_len; return true; case USB_DT_DEVICE_QUALIFIER: if (!descs->qual) { struct usb_qualifier_descriptor* qual = (struct usb_qualifier_descriptor*)response_data; qual->bLength = sizeof(*qual); qual->bDescriptorType = USB_DT_DEVICE_QUALIFIER; qual->bcdUSB = index->dev->bcdUSB; qual->bDeviceClass = index->dev->bDeviceClass; qual->bDeviceSubClass = index->dev->bDeviceSubClass; qual->bDeviceProtocol = index->dev->bDeviceProtocol; qual->bMaxPacketSize0 = index->dev->bMaxPacketSize0; qual->bNumConfigurations = index->dev->bNumConfigurations; qual->bRESERVED = 0; *response_length = sizeof(*qual); return true; } *response_data = descs->qual; *response_length = descs->qual_len; return true; default: break; } break; default: break; } break; default: break; } return false; } typedef bool (*lookup_connect_out_response_t)( int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, bool* done); static bool lookup_connect_response_out_generic( int fd, const struct vusb_connect_descriptors* descs, const struct usb_ctrlrequest* ctrl, bool* done) { switch (ctrl->bRequestType & USB_TYPE_MASK) { case USB_TYPE_STANDARD: switch (ctrl->bRequest) { case USB_REQ_SET_CONFIGURATION: *done = true; return true; default: break; } break; } return false; } static int vhci_open(void) { char path[1024]; snprintf(path, sizeof(path), "/dev/vhci%llu", procid); return open(path, O_RDWR); } static int vhci_setport(int fd, u_int port) { struct vhci_ioc_set_port args; args.port = port; return ioctl(fd, VHCI_IOC_SET_PORT, &args); } static int vhci_usb_attach(int fd) { return ioctl(fd, VHCI_IOC_USB_ATTACH, NULL); } static int vhci_usb_recv(int fd, void* buf, size_t size) { uint8_t* ptr = (uint8_t*)buf; while (1) { ssize_t done = read(fd, ptr, size); if (done < 0) return -1; if ((size_t)done == size) return 0; size -= done; ptr += done; } } static int vhci_usb_send(int fd, void* buf, size_t size) { uint8_t* ptr = (uint8_t*)buf; while (1) { ssize_t done = write(fd, ptr, size); if (done <= 0) return -1; if ((size_t)done == size) return 0; size -= done; ptr += done; } } static volatile long syz_usb_connect_impl(int fd, uint64_t speed, uint64_t dev_len, const char* dev, const struct vusb_connect_descriptors* descs, lookup_connect_out_response_t lookup_connect_response_out) { struct usb_device_index* index = add_usb_index(fd, dev, dev_len); if (!index) { return -1; } if (vhci_setport(fd, 1)) exit(1); if (vhci_usb_attach(fd)) { return -1; } bool done = false; while (!done) { vhci_request_t req; if (vhci_usb_recv(fd, &req, sizeof(req))) { return -1; } if (req.type != VHCI_REQ_CTRL) { return -1; } char* response_data = NULL; uint32_t response_length = 0; char data[4096]; if (req.u.ctrl.bmRequestType & UE_DIR_IN) { if (!lookup_connect_response_in( fd, descs, (const struct usb_ctrlrequest*)&req.u.ctrl, &response_data, &response_length)) { return -1; } } else { if (!lookup_connect_response_out( fd, descs, (const struct usb_ctrlrequest*)&req.u.ctrl, &done)) { return -1; } response_data = NULL; response_length = UGETW(req.u.ctrl.wLength); } if ((req.u.ctrl.bmRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD && req.u.ctrl.bRequest == USB_REQ_SET_CONFIGURATION) { } if (response_length > sizeof(data)) response_length = 0; if ((uint32_t)UGETW(req.u.ctrl.wLength) < response_length) response_length = UGETW(req.u.ctrl.wLength); if (response_data) memcpy(data, response_data, response_length); else memset(data, 0, response_length); int rv = 0; if (req.u.ctrl.bmRequestType & UE_DIR_IN) { if (response_length > 0) { vhci_response_t res; res.size = response_length; rv = vhci_usb_send(fd, &res, sizeof(res)); if (rv == 0) rv = vhci_usb_send(fd, data, response_length); } } else { rv = vhci_usb_recv(fd, data, response_length); } if (rv < 0) { return -1; } } sleep_ms(200); return fd; } static volatile long syz_usb_connect(volatile long a0, volatile long a1, volatile long a2, volatile long a3) { uint64_t speed = a0; uint64_t dev_len = a1; const char* dev = (const char*)a2; const struct vusb_connect_descriptors* descs = (const struct vusb_connect_descriptors*)a3; if (!dev) { return -1; } int fd = vhci_open(); if (fd < 0) exit(1); long res = syz_usb_connect_impl(fd, speed, dev_len, dev, descs, &lookup_connect_response_out_generic); close(fd); return res; } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 8; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); if (call == 1 || call == 2 || call == 3) break; event_timedwait(&th->done, 50 + (call == 0 ? 3000 : 0) + (call == 1 ? 3000 : 0) + (call == 3 ? 3000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } static void execute_one(void); #define WAIT_FLAGS 0 static void loop(void) { int iter = 0; for (;; iter++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[2] = {0xffffffffffffffff, 0x0}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: NONFAILING(*(uint8_t*)0x20000000 = 0x12); NONFAILING(*(uint8_t*)0x20000001 = 1); NONFAILING(*(uint16_t*)0x20000002 = 0x300); NONFAILING(*(uint8_t*)0x20000004 = 0); NONFAILING(*(uint8_t*)0x20000005 = 0); NONFAILING(*(uint8_t*)0x20000006 = 0); NONFAILING(*(uint8_t*)0x20000007 = -1); NONFAILING(*(uint16_t*)0x20000008 = 0); NONFAILING(*(uint16_t*)0x2000000a = 0); NONFAILING(*(uint16_t*)0x2000000c = 0x40); NONFAILING(*(uint8_t*)0x2000000e = 1); NONFAILING(*(uint8_t*)0x2000000f = 2); NONFAILING(*(uint8_t*)0x20000010 = 3); NONFAILING(*(uint8_t*)0x20000011 = 1); NONFAILING(*(uint8_t*)0x20000012 = 9); NONFAILING(*(uint8_t*)0x20000013 = 2); NONFAILING(*(uint16_t*)0x20000014 = 0x2d); NONFAILING(*(uint8_t*)0x20000016 = 1); NONFAILING(*(uint8_t*)0x20000017 = 1); NONFAILING(*(uint8_t*)0x20000018 = 0x40); NONFAILING(*(uint8_t*)0x20000019 = 0x40); NONFAILING(*(uint8_t*)0x2000001a = 0x82); NONFAILING(*(uint8_t*)0x2000001b = 9); NONFAILING(*(uint8_t*)0x2000001c = 4); NONFAILING(*(uint8_t*)0x2000001d = 0); NONFAILING(*(uint8_t*)0x2000001e = 3); NONFAILING(*(uint8_t*)0x2000001f = 1); NONFAILING(*(uint8_t*)0x20000020 = 3); NONFAILING(*(uint8_t*)0x20000021 = 1); NONFAILING(*(uint8_t*)0x20000022 = 2); NONFAILING(*(uint8_t*)0x20000023 = 0x7f); NONFAILING(*(uint8_t*)0x20000024 = 9); NONFAILING(*(uint8_t*)0x20000025 = 0x21); NONFAILING(*(uint16_t*)0x20000026 = 1); NONFAILING(*(uint8_t*)0x20000028 = 8); NONFAILING(*(uint8_t*)0x20000029 = 1); NONFAILING(*(uint8_t*)0x2000002a = 0x22); NONFAILING(*(uint16_t*)0x2000002b = 0x29b); NONFAILING(*(uint8_t*)0x2000002d = 9); NONFAILING(*(uint8_t*)0x2000002e = 5); NONFAILING(*(uint8_t*)0x2000002f = 0x81); NONFAILING(*(uint8_t*)0x20000030 = 3); NONFAILING(*(uint16_t*)0x20000031 = 8); NONFAILING(*(uint8_t*)0x20000033 = 0xb3); NONFAILING(*(uint8_t*)0x20000034 = 5); NONFAILING(*(uint8_t*)0x20000035 = 0x6c); NONFAILING(*(uint8_t*)0x20000036 = 9); NONFAILING(*(uint8_t*)0x20000037 = 5); NONFAILING(*(uint8_t*)0x20000038 = 2); NONFAILING(*(uint8_t*)0x20000039 = 3); NONFAILING(*(uint16_t*)0x2000003a = 0x40); NONFAILING(*(uint8_t*)0x2000003c = 0xc1); NONFAILING(*(uint8_t*)0x2000003d = 0x81); NONFAILING(*(uint8_t*)0x2000003e = 8); res = -1; NONFAILING(res = syz_usb_connect(3, 0x3f, 0x20000000, 0)); if (res != -1) r[0] = res; break; case 1: NONFAILING(*(uint8_t*)0x200005c0 = 0x12); NONFAILING(*(uint8_t*)0x200005c1 = 1); NONFAILING(*(uint16_t*)0x200005c2 = 0x300); NONFAILING(*(uint8_t*)0x200005c4 = 2); NONFAILING(*(uint8_t*)0x200005c5 = 0); NONFAILING(*(uint8_t*)0x200005c6 = 0); NONFAILING(*(uint8_t*)0x200005c7 = -1); NONFAILING(*(uint16_t*)0x200005c8 = 0x525); NONFAILING(*(uint16_t*)0x200005ca = 0xa4a1); NONFAILING(*(uint16_t*)0x200005cc = 0x40); NONFAILING(*(uint8_t*)0x200005ce = 1); NONFAILING(*(uint8_t*)0x200005cf = 2); NONFAILING(*(uint8_t*)0x200005d0 = 3); NONFAILING(*(uint8_t*)0x200005d1 = 1); NONFAILING(*(uint8_t*)0x200005d2 = 9); NONFAILING(*(uint8_t*)0x200005d3 = 2); NONFAILING(*(uint16_t*)0x200005d4 = 0x5c); NONFAILING(*(uint8_t*)0x200005d6 = 2); NONFAILING(*(uint8_t*)0x200005d7 = 1); NONFAILING(*(uint8_t*)0x200005d8 = 0x80); NONFAILING(*(uint8_t*)0x200005d9 = 0); NONFAILING(*(uint8_t*)0x200005da = 0x3f); NONFAILING(*(uint8_t*)0x200005db = 9); NONFAILING(*(uint8_t*)0x200005dc = 4); NONFAILING(*(uint8_t*)0x200005dd = 0); NONFAILING(*(uint8_t*)0x200005de = 0); NONFAILING(*(uint8_t*)0x200005df = 1); NONFAILING(*(uint8_t*)0x200005e0 = 2); NONFAILING(*(uint8_t*)0x200005e1 = 0xd); NONFAILING(*(uint8_t*)0x200005e2 = 0); NONFAILING(*(uint8_t*)0x200005e3 = 0); NONFAILING(*(uint8_t*)0x200005e4 = 5); NONFAILING(*(uint8_t*)0x200005e5 = 0x24); NONFAILING(*(uint8_t*)0x200005e6 = 6); NONFAILING(*(uint8_t*)0x200005e7 = 0); NONFAILING(*(uint8_t*)0x200005e8 = 1); NONFAILING(*(uint8_t*)0x200005e9 = 5); NONFAILING(*(uint8_t*)0x200005ea = 0x24); NONFAILING(*(uint8_t*)0x200005eb = 0); NONFAILING(*(uint16_t*)0x200005ec = 3); NONFAILING(*(uint8_t*)0x200005ee = 0xd); NONFAILING(*(uint8_t*)0x200005ef = 0x24); NONFAILING(*(uint8_t*)0x200005f0 = 0xf); NONFAILING(*(uint8_t*)0x200005f1 = 1); NONFAILING(*(uint32_t*)0x200005f2 = 1); NONFAILING(*(uint16_t*)0x200005f6 = 3); NONFAILING(*(uint16_t*)0x200005f8 = 0); NONFAILING(*(uint8_t*)0x200005fa = 4); NONFAILING(*(uint8_t*)0x200005fb = 6); NONFAILING(*(uint8_t*)0x200005fc = 0x24); NONFAILING(*(uint8_t*)0x200005fd = 0x1a); NONFAILING(*(uint16_t*)0x200005fe = 0x7fff); NONFAILING(*(uint8_t*)0x20000600 = 0x2a); NONFAILING(*(uint8_t*)0x20000601 = 9); NONFAILING(*(uint8_t*)0x20000602 = 5); NONFAILING(*(uint8_t*)0x20000603 = 0x81); NONFAILING(*(uint8_t*)0x20000604 = 3); NONFAILING(*(uint16_t*)0x20000605 = 0x20); NONFAILING(*(uint8_t*)0x20000607 = 0x1f); NONFAILING(*(uint8_t*)0x20000608 = 8); NONFAILING(*(uint8_t*)0x20000609 = 0x80); NONFAILING(*(uint8_t*)0x2000060a = 9); NONFAILING(*(uint8_t*)0x2000060b = 4); NONFAILING(*(uint8_t*)0x2000060c = 1); NONFAILING(*(uint8_t*)0x2000060d = 0); NONFAILING(*(uint8_t*)0x2000060e = 0); NONFAILING(*(uint8_t*)0x2000060f = 2); NONFAILING(*(uint8_t*)0x20000610 = 0xd); NONFAILING(*(uint8_t*)0x20000611 = 0); NONFAILING(*(uint8_t*)0x20000612 = 0); NONFAILING(*(uint8_t*)0x20000613 = 9); NONFAILING(*(uint8_t*)0x20000614 = 4); NONFAILING(*(uint8_t*)0x20000615 = 1); NONFAILING(*(uint8_t*)0x20000616 = 1); NONFAILING(*(uint8_t*)0x20000617 = 2); NONFAILING(*(uint8_t*)0x20000618 = 2); NONFAILING(*(uint8_t*)0x20000619 = 0xd); NONFAILING(*(uint8_t*)0x2000061a = 0); NONFAILING(*(uint8_t*)0x2000061b = 0); NONFAILING(*(uint8_t*)0x2000061c = 9); NONFAILING(*(uint8_t*)0x2000061d = 5); NONFAILING(*(uint8_t*)0x2000061e = 0x82); NONFAILING(*(uint8_t*)0x2000061f = 2); NONFAILING(*(uint16_t*)0x20000620 = 0x20); NONFAILING(*(uint8_t*)0x20000622 = 7); NONFAILING(*(uint8_t*)0x20000623 = 0x81); NONFAILING(*(uint8_t*)0x20000624 = 5); NONFAILING(*(uint8_t*)0x20000625 = 9); NONFAILING(*(uint8_t*)0x20000626 = 5); NONFAILING(*(uint8_t*)0x20000627 = 3); NONFAILING(*(uint8_t*)0x20000628 = 2); NONFAILING(*(uint16_t*)0x20000629 = 8); NONFAILING(*(uint8_t*)0x2000062b = 9); NONFAILING(*(uint8_t*)0x2000062c = 0x78); NONFAILING(*(uint8_t*)0x2000062d = 7); NONFAILING(syz_usb_connect(6, 0x6e, 0x200005c0, 0)); break; case 2: syscall(SYS_openat, -1, 0ul, 0x200000ul, 0x10ul); break; case 3: NONFAILING(*(uint8_t*)0x20000b80 = 0x12); NONFAILING(*(uint8_t*)0x20000b81 = 1); NONFAILING(*(uint16_t*)0x20000b82 = 0x240); NONFAILING(*(uint8_t*)0x20000b84 = 0); NONFAILING(*(uint8_t*)0x20000b85 = 0); NONFAILING(*(uint8_t*)0x20000b86 = 0); NONFAILING(*(uint8_t*)0x20000b87 = 0x10); NONFAILING(*(uint16_t*)0x20000b88 = 0x1d6b); NONFAILING(*(uint16_t*)0x20000b8a = 0x101); NONFAILING(*(uint16_t*)0x20000b8c = 0x40); NONFAILING(*(uint8_t*)0x20000b8e = 1); NONFAILING(*(uint8_t*)0x20000b8f = 2); NONFAILING(*(uint8_t*)0x20000b90 = 3); NONFAILING(*(uint8_t*)0x20000b91 = 1); NONFAILING(*(uint8_t*)0x20000b92 = 9); NONFAILING(*(uint8_t*)0x20000b93 = 2); NONFAILING(*(uint16_t*)0x20000b94 = 0xd7); NONFAILING(*(uint8_t*)0x20000b96 = 3); NONFAILING(*(uint8_t*)0x20000b97 = 1); NONFAILING(*(uint8_t*)0x20000b98 = 0); NONFAILING(*(uint8_t*)0x20000b99 = 0x80); NONFAILING(*(uint8_t*)0x20000b9a = 7); NONFAILING(*(uint8_t*)0x20000b9b = 9); NONFAILING(*(uint8_t*)0x20000b9c = 4); NONFAILING(*(uint8_t*)0x20000b9d = 0); NONFAILING(*(uint8_t*)0x20000b9e = 0); NONFAILING(*(uint8_t*)0x20000b9f = 0); NONFAILING(*(uint8_t*)0x20000ba0 = 1); NONFAILING(*(uint8_t*)0x20000ba1 = 1); NONFAILING(*(uint8_t*)0x20000ba2 = 0); NONFAILING(*(uint8_t*)0x20000ba3 = 0); NONFAILING(*(uint8_t*)0x20000ba4 = 0xa); NONFAILING(*(uint8_t*)0x20000ba5 = 0x24); NONFAILING(*(uint8_t*)0x20000ba6 = 1); NONFAILING(*(uint16_t*)0x20000ba7 = 0x4b7); NONFAILING(*(uint8_t*)0x20000ba9 = 6); NONFAILING(*(uint8_t*)0x20000baa = 2); NONFAILING(*(uint8_t*)0x20000bab = 1); NONFAILING(*(uint8_t*)0x20000bac = 2); NONFAILING(*(uint8_t*)0x20000bad = 0x11); NONFAILING(*(uint8_t*)0x20000bae = 0x24); NONFAILING(*(uint8_t*)0x20000baf = 6); NONFAILING(*(uint8_t*)0x20000bb0 = 1); NONFAILING(*(uint8_t*)0x20000bb1 = 1); NONFAILING(*(uint8_t*)0x20000bb2 = 5); NONFAILING(*(uint16_t*)0x20000bb3 = 0); NONFAILING(*(uint16_t*)0x20000bb5 = 9); NONFAILING(*(uint16_t*)0x20000bb7 = 3); NONFAILING(*(uint16_t*)0x20000bb9 = 0xa); NONFAILING(*(uint16_t*)0x20000bbb = 0xa); NONFAILING(*(uint8_t*)0x20000bbd = 4); NONFAILING(*(uint8_t*)0x20000bbe = 7); NONFAILING(*(uint8_t*)0x20000bbf = 0x24); NONFAILING(*(uint8_t*)0x20000bc0 = 8); NONFAILING(*(uint8_t*)0x20000bc1 = 6); NONFAILING(*(uint16_t*)0x20000bc2 = 0x101); NONFAILING(*(uint8_t*)0x20000bc4 = 0x35); NONFAILING(*(uint8_t*)0x20000bc5 = 0xb); NONFAILING(*(uint8_t*)0x20000bc6 = 0x24); NONFAILING(*(uint8_t*)0x20000bc7 = 7); NONFAILING(*(uint8_t*)0x20000bc8 = 5); NONFAILING(*(uint16_t*)0x20000bc9 = 5); NONFAILING(*(uint8_t*)0x20000bcb = 3); NONFAILING(memcpy((void*)0x20000bcc, "\x66\x3f\x03\x3a", 4)); NONFAILING(*(uint8_t*)0x20000bd0 = 5); NONFAILING(*(uint8_t*)0x20000bd1 = 0x24); NONFAILING(*(uint8_t*)0x20000bd2 = 5); NONFAILING(*(uint8_t*)0x20000bd3 = 2); NONFAILING(*(uint8_t*)0x20000bd4 = 0x7f); NONFAILING(*(uint8_t*)0x20000bd5 = 9); NONFAILING(*(uint8_t*)0x20000bd6 = 4); NONFAILING(*(uint8_t*)0x20000bd7 = 1); NONFAILING(*(uint8_t*)0x20000bd8 = 0); NONFAILING(*(uint8_t*)0x20000bd9 = 0); NONFAILING(*(uint8_t*)0x20000bda = 1); NONFAILING(*(uint8_t*)0x20000bdb = 2); NONFAILING(*(uint8_t*)0x20000bdc = 0); NONFAILING(*(uint8_t*)0x20000bdd = 0); NONFAILING(*(uint8_t*)0x20000bde = 9); NONFAILING(*(uint8_t*)0x20000bdf = 4); NONFAILING(*(uint8_t*)0x20000be0 = 1); NONFAILING(*(uint8_t*)0x20000be1 = 1); NONFAILING(*(uint8_t*)0x20000be2 = 1); NONFAILING(*(uint8_t*)0x20000be3 = 1); NONFAILING(*(uint8_t*)0x20000be4 = 2); NONFAILING(*(uint8_t*)0x20000be5 = 0); NONFAILING(*(uint8_t*)0x20000be6 = 0); NONFAILING(*(uint8_t*)0x20000be7 = 7); NONFAILING(*(uint8_t*)0x20000be8 = 0x24); NONFAILING(*(uint8_t*)0x20000be9 = 1); NONFAILING(*(uint8_t*)0x20000bea = 2); NONFAILING(*(uint8_t*)0x20000beb = 0); NONFAILING(*(uint16_t*)0x20000bec = 1); NONFAILING(*(uint8_t*)0x20000bee = 9); NONFAILING(*(uint8_t*)0x20000bef = 0x24); NONFAILING(*(uint8_t*)0x20000bf0 = 2); NONFAILING(*(uint8_t*)0x20000bf1 = 1); NONFAILING(*(uint8_t*)0x20000bf2 = 5); NONFAILING(*(uint8_t*)0x20000bf3 = 4); NONFAILING(*(uint8_t*)0x20000bf4 = 0x80); NONFAILING(*(uint8_t*)0x20000bf5 = 0xe); NONFAILING(memset((void*)0x20000bf6, 90, 1)); NONFAILING(*(uint8_t*)0x20000bf7 = 9); NONFAILING(*(uint8_t*)0x20000bf8 = 5); NONFAILING(*(uint8_t*)0x20000bf9 = 1); NONFAILING(*(uint8_t*)0x20000bfa = 9); NONFAILING(*(uint16_t*)0x20000bfb = 0x200); NONFAILING(*(uint8_t*)0x20000bfd = 0x19); NONFAILING(*(uint8_t*)0x20000bfe = 5); NONFAILING(*(uint8_t*)0x20000bff = 0xfe); NONFAILING(*(uint8_t*)0x20000c00 = 7); NONFAILING(*(uint8_t*)0x20000c01 = 0x25); NONFAILING(*(uint8_t*)0x20000c02 = 1); NONFAILING(*(uint8_t*)0x20000c03 = 1); NONFAILING(*(uint8_t*)0x20000c04 = 0xd7); NONFAILING(*(uint16_t*)0x20000c05 = 0x545e); NONFAILING(*(uint8_t*)0x20000c07 = 9); NONFAILING(*(uint8_t*)0x20000c08 = 4); NONFAILING(*(uint8_t*)0x20000c09 = 2); NONFAILING(*(uint8_t*)0x20000c0a = 0); NONFAILING(*(uint8_t*)0x20000c0b = 0); NONFAILING(*(uint8_t*)0x20000c0c = 1); NONFAILING(*(uint8_t*)0x20000c0d = 2); NONFAILING(*(uint8_t*)0x20000c0e = 0); NONFAILING(*(uint8_t*)0x20000c0f = 0); NONFAILING(*(uint8_t*)0x20000c10 = 9); NONFAILING(*(uint8_t*)0x20000c11 = 4); NONFAILING(*(uint8_t*)0x20000c12 = 2); NONFAILING(*(uint8_t*)0x20000c13 = 1); NONFAILING(*(uint8_t*)0x20000c14 = 1); NONFAILING(*(uint8_t*)0x20000c15 = 1); NONFAILING(*(uint8_t*)0x20000c16 = 2); NONFAILING(*(uint8_t*)0x20000c17 = 0); NONFAILING(*(uint8_t*)0x20000c18 = 0); NONFAILING(*(uint8_t*)0x20000c19 = 7); NONFAILING(*(uint8_t*)0x20000c1a = 0x24); NONFAILING(*(uint8_t*)0x20000c1b = 1); NONFAILING(*(uint8_t*)0x20000c1c = 0x3f); NONFAILING(*(uint8_t*)0x20000c1d = 0x24); NONFAILING(*(uint16_t*)0x20000c1e = 0x1000); NONFAILING(*(uint8_t*)0x20000c20 = 8); NONFAILING(*(uint8_t*)0x20000c21 = 0x24); NONFAILING(*(uint8_t*)0x20000c22 = 2); NONFAILING(*(uint8_t*)0x20000c23 = 1); NONFAILING(*(uint8_t*)0x20000c24 = 0xd9); NONFAILING(*(uint8_t*)0x20000c25 = 2); NONFAILING(*(uint8_t*)0x20000c26 = 2); NONFAILING(*(uint8_t*)0x20000c27 = 4); NONFAILING(*(uint8_t*)0x20000c28 = 0xf); NONFAILING(*(uint8_t*)0x20000c29 = 0x24); NONFAILING(*(uint8_t*)0x20000c2a = 2); NONFAILING(*(uint8_t*)0x20000c2b = 2); NONFAILING(*(uint16_t*)0x20000c2c = 0x81); NONFAILING(*(uint16_t*)0x20000c2e = 0x7fff); NONFAILING(*(uint8_t*)0x20000c30 = 0x1f); NONFAILING(memcpy((void*)0x20000c31, "\x7b\xb7\x6c\x5d\xbb\x60", 6)); NONFAILING(*(uint8_t*)0x20000c37 = 0xd); NONFAILING(*(uint8_t*)0x20000c38 = 0x24); NONFAILING(*(uint8_t*)0x20000c39 = 2); NONFAILING(*(uint8_t*)0x20000c3a = 1); NONFAILING(*(uint8_t*)0x20000c3b = 9); NONFAILING(*(uint8_t*)0x20000c3c = 1); NONFAILING(*(uint8_t*)0x20000c3d = 1); NONFAILING(*(uint8_t*)0x20000c3e = 4); NONFAILING(memcpy((void*)0x20000c3f, "\xd6\x28", 2)); NONFAILING(memcpy((void*)0x20000c41, "\x6c\x07\xa7", 3)); NONFAILING(*(uint8_t*)0x20000c44 = 0xb); NONFAILING(*(uint8_t*)0x20000c45 = 0x24); NONFAILING(*(uint8_t*)0x20000c46 = 2); NONFAILING(*(uint8_t*)0x20000c47 = 1); NONFAILING(*(uint8_t*)0x20000c48 = 1); NONFAILING(*(uint8_t*)0x20000c49 = 2); NONFAILING(*(uint8_t*)0x20000c4a = 0x5b); NONFAILING(*(uint8_t*)0x20000c4b = 9); NONFAILING(memcpy((void*)0x20000c4c, "\x81\x22\x57", 3)); NONFAILING(*(uint8_t*)0x20000c4f = 0xa); NONFAILING(*(uint8_t*)0x20000c50 = 0x24); NONFAILING(*(uint8_t*)0x20000c51 = 2); NONFAILING(*(uint8_t*)0x20000c52 = 1); NONFAILING(*(uint8_t*)0x20000c53 = 0x7f); NONFAILING(*(uint8_t*)0x20000c54 = 4); NONFAILING(*(uint8_t*)0x20000c55 = 7); NONFAILING(*(uint8_t*)0x20000c56 = 0x7f); NONFAILING(memcpy((void*)0x20000c57, "\xa8\x16", 2)); NONFAILING(*(uint8_t*)0x20000c59 = 9); NONFAILING(*(uint8_t*)0x20000c5a = 5); NONFAILING(*(uint8_t*)0x20000c5b = 0x82); NONFAILING(*(uint8_t*)0x20000c5c = 9); NONFAILING(*(uint16_t*)0x20000c5d = 0x10); NONFAILING(*(uint8_t*)0x20000c5f = 8); NONFAILING(*(uint8_t*)0x20000c60 = 0x40); NONFAILING(*(uint8_t*)0x20000c61 = 0xd1); NONFAILING(*(uint8_t*)0x20000c62 = 7); NONFAILING(*(uint8_t*)0x20000c63 = 0x25); NONFAILING(*(uint8_t*)0x20000c64 = 1); NONFAILING(*(uint8_t*)0x20000c65 = 0x80); NONFAILING(*(uint8_t*)0x20000c66 = 0x8e); NONFAILING(*(uint16_t*)0x20000c67 = 0x400); NONFAILING(*(uint32_t*)0x20001300 = 0xa); NONFAILING(*(uint64_t*)0x20001304 = 0x20000c80); NONFAILING(*(uint8_t*)0x20000c80 = 0xa); NONFAILING(*(uint8_t*)0x20000c81 = 6); NONFAILING(*(uint16_t*)0x20000c82 = 0x310); NONFAILING(*(uint8_t*)0x20000c84 = 0x7f); NONFAILING(*(uint8_t*)0x20000c85 = 0x81); NONFAILING(*(uint8_t*)0x20000c86 = 0xce); NONFAILING(*(uint8_t*)0x20000c87 = 0x40); NONFAILING(*(uint8_t*)0x20000c88 = 6); NONFAILING(*(uint8_t*)0x20000c89 = 0); NONFAILING(*(uint32_t*)0x2000130c = 0x31); NONFAILING(*(uint64_t*)0x20001310 = 0x20000cc0); NONFAILING(*(uint8_t*)0x20000cc0 = 5); NONFAILING(*(uint8_t*)0x20000cc1 = 0xf); NONFAILING(*(uint16_t*)0x20000cc2 = 0x31); NONFAILING(*(uint8_t*)0x20000cc4 = 6); NONFAILING(*(uint8_t*)0x20000cc5 = 7); NONFAILING(*(uint8_t*)0x20000cc6 = 0x10); NONFAILING(*(uint8_t*)0x20000cc7 = 2); NONFAILING(STORE_BY_BITMASK(uint32_t, , 0x20000cc8, 0x12, 0, 8)); NONFAILING(STORE_BY_BITMASK(uint32_t, , 0x20000cc9, 0, 0, 4)); NONFAILING(STORE_BY_BITMASK(uint32_t, , 0x20000cc9, 8, 4, 4)); NONFAILING(STORE_BY_BITMASK(uint32_t, , 0x20000cca, 7, 0, 16)); NONFAILING(*(uint8_t*)0x20000ccc = 3); NONFAILING(*(uint8_t*)0x20000ccd = 0x10); NONFAILING(*(uint8_t*)0x20000cce = 3); NONFAILING(*(uint8_t*)0x20000ccf = 0xa); NONFAILING(*(uint8_t*)0x20000cd0 = 0x10); NONFAILING(*(uint8_t*)0x20000cd1 = 3); NONFAILING(*(uint8_t*)0x20000cd2 = 0); NONFAILING(*(uint16_t*)0x20000cd3 = 6); NONFAILING(*(uint8_t*)0x20000cd5 = 1); NONFAILING(*(uint8_t*)0x20000cd6 = 4); NONFAILING(*(uint16_t*)0x20000cd7 = 3); NONFAILING(*(uint8_t*)0x20000cd9 = 3); NONFAILING(*(uint8_t*)0x20000cda = 0x10); NONFAILING(*(uint8_t*)0x20000cdb = 3); NONFAILING(*(uint8_t*)0x20000cdc = 0xa); NONFAILING(*(uint8_t*)0x20000cdd = 0x10); NONFAILING(*(uint8_t*)0x20000cde = 3); NONFAILING(*(uint8_t*)0x20000cdf = 0); NONFAILING(*(uint16_t*)0x20000ce0 = 9); NONFAILING(*(uint8_t*)0x20000ce2 = 6); NONFAILING(*(uint8_t*)0x20000ce3 = 0x20); NONFAILING(*(uint16_t*)0x20000ce4 = 2); NONFAILING(*(uint8_t*)0x20000ce6 = 0xb); NONFAILING(*(uint8_t*)0x20000ce7 = 0x10); NONFAILING(*(uint8_t*)0x20000ce8 = 1); NONFAILING(*(uint8_t*)0x20000ce9 = 0xc); NONFAILING(*(uint16_t*)0x20000cea = 0x84); NONFAILING(*(uint8_t*)0x20000cec = 0x35); NONFAILING(*(uint8_t*)0x20000ced = 7); NONFAILING(*(uint16_t*)0x20000cee = 0x3f); NONFAILING(*(uint8_t*)0x20000cf0 = 5); NONFAILING(*(uint32_t*)0x20001318 = 0xa); NONFAILING(*(uint32_t*)0x2000131c = 4); NONFAILING(*(uint64_t*)0x20001320 = 0x20000e40); NONFAILING(*(uint8_t*)0x20000e40 = 4); NONFAILING(*(uint8_t*)0x20000e41 = 3); NONFAILING(*(uint16_t*)0x20000e42 = 0x401); NONFAILING(*(uint32_t*)0x20001328 = 4); NONFAILING(*(uint64_t*)0x2000132c = 0x20000e80); NONFAILING(*(uint8_t*)0x20000e80 = 4); NONFAILING(*(uint8_t*)0x20000e81 = 3); NONFAILING(*(uint16_t*)0x20000e82 = 0x41e); NONFAILING(*(uint32_t*)0x20001334 = 4); NONFAILING(*(uint64_t*)0x20001338 = 0x20000ec0); NONFAILING(*(uint8_t*)0x20000ec0 = 4); NONFAILING(*(uint8_t*)0x20000ec1 = 3); NONFAILING(*(uint16_t*)0x20000ec2 = 0x427); NONFAILING(*(uint32_t*)0x20001340 = 0); NONFAILING(*(uint64_t*)0x20001344 = 0); NONFAILING(*(uint32_t*)0x2000134c = 0xcd); NONFAILING(*(uint64_t*)0x20001350 = 0x20000f40); NONFAILING(*(uint8_t*)0x20000f40 = 0xcd); NONFAILING(*(uint8_t*)0x20000f41 = 3); NONFAILING(memcpy( (void*)0x20000f42, "\x09\x75\x1d\x4f\x10\x10\xbb\x72\x23\x47\x9d\x99\x9b\xa0\xd3\x64\x81" "\xd5\x1d\x58\x52\x7c\xdc\x4b\x30\x52\x47\xa9\x21\xe8\xcd\xe3\x5a\x35" "\xa6\x29\x1f\xdc\xc3\xd2\x5a\x25\x71\x02\xfd\x46\xfd\xa3\xdb\xef\xd7" "\x10\x4e\x2d\x75\xa6\x83\xa5\x50\xbc\x35\x41\xdc\x59\x10\x75\x38\x81" "\x71\x0a\xb5\x20\xe5\xd8\x32\x08\x54\xd5\xab\xc2\x3d\x28\x79\x70\x1c" "\x28\x0d\xcb\xd2\x0f\x0e\xd2\xc2\x77\xbb\x60\xe9\xe2\xe9\x83\x90\x06" "\xc2\xdf\xac\xf5\x25\xe9\x15\x11\x7b\x89\xed\x2d\x62\xd2\x43\x1e\x63" "\x7e\xfc\x5e\x25\xb8\x83\x3d\x10\x28\x9d\x56\xe8\x91\x9a\x1c\x68\x39" "\x8b\x06\xc0\xd9\xc0\x66\x68\xdf\x7f\x53\x5a\x8c\x09\xb3\x99\xbb\x78" "\x89\xf4\xc4\x8d\x67\x7a\xc8\x6b\x5f\x6a\xd2\x58\xfb\x94\xf1\x74\x8e" "\xb6\x57\x16\xd4\x9c\xd1\x60\x82\x4d\xa1\xa7\xca\xe1\x4e\xf9\x66\xa7" "\xa0\x19\xcc\x10\x51\x0b\x71\x15\x4a\x30\xb8\x44\x42\x69\x61\xcf", 203)); NONFAILING(*(uint32_t*)0x20001358 = 2); NONFAILING(*(uint64_t*)0x2000135c = 0x20001040); NONFAILING(*(uint8_t*)0x20001040 = 2); NONFAILING(*(uint8_t*)0x20001041 = 3); NONFAILING(*(uint32_t*)0x20001364 = 0x80); NONFAILING(*(uint64_t*)0x20001368 = 0x200010c0); NONFAILING(*(uint8_t*)0x200010c0 = 0x80); NONFAILING(*(uint8_t*)0x200010c1 = 3); NONFAILING(memcpy( (void*)0x200010c2, "\xa2\x9e\x6f\x11\x76\xad\x15\x15\x57\xb4\xcb\x54\xb0\xd3\x4e\xac\xaa" "\xb6\x75\x92\x43\x57\xac\x82\xeb\x6a\xb1\x52\xf7\xc3\x70\xa6\x94\x64" "\x66\x04\xf7\x6a\x09\x7f\xd6\x16\xc7\x8b\xdd\x4b\xcf\x35\x48\x25\xc9" "\xb1\xc4\x4c\xf4\xb4\xa5\x00\x22\x4a\x2a\x34\x4a\x43\x67\x7e\x68\xd7" "\x3e\xb1\xa6\x24\x51\x9d\x14\x24\xaf\x99\x0e\x44\x68\x1c\x3b\xd8\x2e" "\x7a\xa0\x67\x94\x9c\x22\x97\xcf\xf0\xfb\xf1\x22\x7f\x63\x2f\x58\xe2" "\x92\x03\x4c\x63\x57\xab\xa7\xf4\xc7\x20\x1f\xdb\x83\x26\xf6\x7f\x79" "\xcf\x48\xb3\xf9\xbd\xa4\x3a", 126)); NONFAILING(*(uint32_t*)0x20001370 = 0); NONFAILING(*(uint64_t*)0x20001374 = 0); NONFAILING(*(uint32_t*)0x2000137c = 2); NONFAILING(*(uint64_t*)0x20001380 = 0x20001180); NONFAILING(*(uint8_t*)0x20001180 = 2); NONFAILING(*(uint8_t*)0x20001181 = 3); NONFAILING(*(uint32_t*)0x20001388 = 0); NONFAILING(*(uint64_t*)0x2000138c = 0); NONFAILING(syz_usb_connect(4, 0xe9, 0x20000b80, 0x20001300)); break; case 4: syscall(SYS_fchownat, r[0], 0ul, 0, 0, 0x200ul); break; case 5: syscall(SYS_dup3, r[0], r[0], 0x1000000ul); break; case 6: res = syscall(SYS_semget, 0ul, 2ul, 0x204ul); if (res != -1) r[1] = res; break; case 7: NONFAILING(*(uint32_t*)0x20001d80 = 8); NONFAILING(*(uint32_t*)0x20001d84 = 0); NONFAILING(*(uint32_t*)0x20001d88 = 0); NONFAILING(*(uint32_t*)0x20001d8c = 0); NONFAILING(*(uint32_t*)0x20001d90 = -1); NONFAILING(*(uint32_t*)0x20001d94 = 0x104); NONFAILING(*(uint16_t*)0x20001d98 = 0xff62); NONFAILING(*(uint16_t*)0x20001d9a = 0); NONFAILING(*(uint64_t*)0x20001da0 = 0); NONFAILING(*(uint64_t*)0x20001da8 = 0); NONFAILING(*(uint64_t*)0x20001db0 = 1); NONFAILING(*(uint64_t*)0x20001db8 = 4); NONFAILING(*(uint64_t*)0x20001dc0 = 8); NONFAILING(*(uint64_t*)0x20001dc8 = 0); NONFAILING(*(uint64_t*)0x20001dd0 = 0); syscall(SYS_semctl, r[1], 0ul, 1ul, 0x20001d80ul); break; } } int main(void) { syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul, 0ul); install_segv_handler(); loop(); return 0; }