// https://syzkaller.appspot.com/bug?id=b0f266bad8dc92e7dbfaec0227828e168d23f721 // 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 #ifndef __NR_ioctl #define __NR_ioctl 54 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 370 #endif #ifndef __NR_setsockopt #define __NR_setsockopt 366 #endif #ifndef __NR_socket #define __NR_socket 359 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } #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_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; } #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 long syz_open_dev(volatile long a0, volatile long a1, volatile long a2) { if (a0 == 0xc || a0 == 0xb) { char buf[128]; sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2); return open(buf, O_RDWR, 0); } else { unsigned long nb = a1; char buf[1024]; char* hash; strncpy(buf, (char*)a0, sizeof(buf) - 1); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(nb % 10); nb /= 10; } return open(buf, a2 & ~O_CREAT, 0); } } uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x7ffff000, /*len=*/0x1000, /*prot=*/0, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32, /*fd=*/(intptr_t)-1, /*offset=*/0); syscall(__NR_mmap, /*addr=*/0x80000000, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32, /*fd=*/(intptr_t)-1, /*offset=*/0); syscall(__NR_mmap, /*addr=*/0x81000000, /*len=*/0x1000, /*prot=*/0, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32, /*fd=*/(intptr_t)-1, /*offset=*/0); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // socket$nl_route arguments: [ // domain: const = 0x10 (4 bytes) // type: const = 0x3 (4 bytes) // proto: const = 0x0 (4 bytes) // ] // returns sock_nl_route res = syscall(__NR_socket, /*domain=*/0x10, /*type=*/3, /*proto=*/0); if (res != -1) r[0] = res; // setsockopt$netlink_NETLINK_TX_RING arguments: [ // fd: sock_netlink (resource) // level: const = 0x10e (4 bytes) // opt: const = 0xc (4 bytes) // arg: ptr[in, nl_mmap_req] { // nl_mmap_req { // bsize: int32 = 0x200000c0 (4 bytes) // bnumber: int32 = 0xffffffff (4 bytes) // fsize: int32 = 0xfffffff8 (4 bytes) // fnumber: int32 = 0x0 (4 bytes) // } // } // arglen: len = 0x10 (4 bytes) // ] *(uint32_t*)0x80000040 = 0x200000c0; *(uint32_t*)0x80000044 = -1; *(uint32_t*)0x80000048 = 0xfffffff8; *(uint32_t*)0x8000004c = 0; syscall(__NR_setsockopt, /*fd=*/(intptr_t)r[0], /*level=*/0x10e, /*opt=*/0xc, /*arg=*/0x80000040, /*arglen=*/0x10); // sendmsg$nl_route arguments: [ // fd: sock_nl_route (resource) // msg: ptr[in, msghdr_netlink[netlink_msg_route]] { // msghdr_netlink[netlink_msg_route] { // addr: nil // addrlen: len = 0x0 (4 bytes) // vec: ptr[in, iovec[in, netlink_msg_route]] { // iovec[in, netlink_msg_route] { // addr: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {} (length 0x0) // } // } // } // len: len = 0x1c (4 bytes) // } // } // vlen: const = 0x1 (4 bytes) // ctrl: const = 0x0 (4 bytes) // ctrllen: const = 0x0 (4 bytes) // f: send_flags = 0x0 (4 bytes) // } // } // f: send_flags = 0x0 (4 bytes) // ] *(uint32_t*)0x80000000 = 0; *(uint32_t*)0x80000004 = 0; *(uint32_t*)0x80000008 = 0x80000180; *(uint32_t*)0x80000180 = 0x80000500; *(uint32_t*)0x80000184 = 0x1c; *(uint32_t*)0x8000000c = 1; *(uint32_t*)0x80000010 = 0; *(uint32_t*)0x80000014 = 0; *(uint32_t*)0x80000018 = 0; syscall(__NR_sendmsg, /*fd=*/(intptr_t)r[0], /*msg=*/0x80000000, /*f=*/0); // syz_usb_connect arguments: [ // speed: usb_device_speed = 0x0 (4 bytes) // dev_len: len = 0x4b (4 bytes) // dev: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {12 01 00 02 00 00 00 40 48 0b 05 10 00 01 01 02 // 00 01 09 02 39 00 02 01 00 80 32 09 04 00 00 00 00 00 00 00 09 04 // 01 00 00 00 00 00 00 09 04 01 01 03 00 00 00 00 07 05 01 02 40 00 // 00 07 05 81 02 40 00 00 07 05 82} (length 0x47) // } // } // } // conn_descs: nil // ] // returns fd_usb memcpy( (void*)0x80000000, "\x12\x01\x00\x02\x00\x00\x00\x40\x48\x0b\x05\x10\x00\x01\x01\x02\x00\x01" "\x09\x02\x39\x00\x02\x01\x00\x80\x32\x09\x04\x00\x00\x00\x00\x00\x00\x00" "\x09\x04\x01\x00\x00\x00\x00\x00\x00\x09\x04\x01\x01\x03\x00\x00\x00\x00" "\x07\x05\x01\x02\x40\x00\x00\x07\x05\x81\x02\x40\x00\x00\x07\x05\x82", 71); res = -1; res = syz_usb_connect(/*speed=*/0, /*dev_len=*/0x4b, /*dev=*/0x80000000, /*conn_descs=*/0); if (res != -1) r[1] = res; // syz_usb_connect$uac3 arguments: [ // speed: usb_device_speed = 0x4 (4 bytes) // dev_len: len = 0xf6 (4 bytes) // dev: ptr[in, usb_device_descriptor_uac3] { // usb_device_descriptor_uac3 { // inner: usb_device_descriptor_verbose_t[flags[usb_versions, int16], // 0, 0, 0, flags[usb_device_max_packet_sizes, int8], 0x582, 0x582, 64, // array[usb_config_descriptor_uac3, 1]] { // bLength: const = 0x12 (1 bytes) // bDescriptorType: const = 0x1 (1 bytes) // bcdUSB: usb_versions = 0x200 (2 bytes) // bDeviceClass: const = 0x0 (1 bytes) // bDeviceSubClass: const = 0x0 (1 bytes) // bDeviceProtocol: const = 0x0 (1 bytes) // bMaxPacketSize0: usb_device_max_packet_sizes = 0x40 (1 bytes) // idVendor: const = 0x41e (2 bytes) // idProduct: const = 0x3020 (2 bytes) // bcdDevice: const = 0x40 (2 bytes) // iManufacturer: const = 0x1 (1 bytes) // iProduct: const = 0x2 (1 bytes) // iSerialNumber: const = 0x3 (1 bytes) // bNumConfigurations: len = 0x1 (1 bytes) // configs: array[usb_config_descriptor_uac3] { // usb_config_descriptor_uac3 { // inner: usb_config_descriptor_verbose_t[const[1, int8], // const[3, int8], int8, flags[usb_config_attributes, int8], // int8, uac3_interface_assoc_descriptor, // usb_interface_descriptors_uac3] { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x2 (1 bytes) // wTotalLength: len = 0xe4 (2 bytes) // bNumInterfaces: const = 0x3 (1 bytes) // bConfigurationValue: const = 0x1 (1 bytes) // iConfiguration: int8 = 0x1 (1 bytes) // bmAttributes: usb_config_attributes = 0xf0 (1 bytes) // bMaxPower: int8 = 0xaa (1 bytes) // extra: uac3_interface_assoc_descriptor { // bLength: len = 0x8 (1 bytes) // bDescriptorType: const = 0xb (1 bytes) // bFirstInterface: int8 = 0x1 (1 bytes) // bInterfaceCount: int8 = 0x2 (1 bytes) // bFunctionClass: const = 0x1 (1 bytes) // bFunctionSubClass: uac3_all_subclasses = // 0x319615cfd29efd9e (1 bytes) bFunctionProtocol: const = // 0x30 (1 bytes) iFunction: int8 = 0xfc (1 bytes) // } // interfaces: usb_interface_descriptors_uac3 { // inner: usb_interface_descriptors_uac3_inner { // control: usb_interface_descriptor_verbose_t[const[0, // int8], const[0, int8], const[0, int8], // const[USB_CLASS_AUDIO, int8], // const[USB_SUBCLASS_AUDIOCONTROL, int8], // const[UAC_VERSION_3, int8], const[0, int8], // uac3_control_iface_extra_descriptors, void] { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x4 (1 bytes) // bInterfaceNumber: const = 0x0 (1 bytes) // bAlternateSetting: const = 0x0 (1 bytes) // bNumEndpoints: const = 0x0 (1 bytes) // bInterfaceClass: const = 0x1 (1 bytes) // bInterfaceSubClass: const = 0x1 (1 bytes) // bInterfaceProtocol: const = 0x30 (1 bytes) // iInterface: const = 0x0 (1 bytes) // extra: uac3_control_iface_extra_descriptors { // header: uac3_ac_header_descriptor { // bLength: len = 0xa (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x1 (1 bytes) // bCategory: uac3_feature_unit_controls = 0x7 (1 // bytes) wTotalLength: len = 0x22 (2 bytes) // bmControls: int32 = 0x7 (4 bytes) // } // others: array[uac3_control_iface_extra_descriptor] { // union uac3_control_iface_extra_descriptor { // output_terminal: uac3_output_terminal_descriptor // { // bLength: len = 0x13 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubtype: const = 0x3 (1 bytes) // bTerminalID: int8 = 0x1 (1 bytes) // wTerminalType: uac_output_terminal_types = // 0x101 (2 bytes) bAssocTerminal: int8 = 0x1 (1 // bytes) bSourceID: int8 = 0x5 (1 bytes) // bCSourceID: int8 = 0xf (1 bytes) // bmControls: int32 = 0x0 (4 bytes) // wExTerminalDescrID: int16 = 0x9 (2 bytes) // wConnectorsDescrID: int16 = 0x7 (2 bytes) // wTerminalDescrStr: int16 = 0x80 (2 bytes) // } // } // union uac3_control_iface_extra_descriptor { // mixer_unit: uac3_mixer_unit_descriptor { // bLength: len = 0x5 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x5 (1 bytes) // bUnitID: int8 = 0x6 (1 bytes) // bNrInPins: int8 = 0x7 (1 bytes) // baSourceID: buffer: {} (length 0x0) // } // } // } // } // endpoints: buffer: {} (length 0x0) // } // as_out_alt_0: // usb_interface_descriptor_verbose_t[const[1, int8], // const[0, int8], const[0, int8], const[USB_CLASS_AUDIO, // int8], const[USB_SUBCLASS_AUDIOSTREAMING, int8], // const[UAC_VERSION_3, int8], const[0, int8], void, void] // { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x4 (1 bytes) // bInterfaceNumber: const = 0x1 (1 bytes) // bAlternateSetting: const = 0x0 (1 bytes) // bNumEndpoints: const = 0x0 (1 bytes) // bInterfaceClass: const = 0x1 (1 bytes) // bInterfaceSubClass: const = 0x2 (1 bytes) // bInterfaceProtocol: const = 0x30 (1 bytes) // iInterface: const = 0x0 (1 bytes) // extra: buffer: {} (length 0x0) // endpoints: buffer: {} (length 0x0) // } // as_out_alt_1: // usb_interface_descriptor_verbose_t[const[1, int8], // const[1, int8], const[1, int8], const[USB_CLASS_AUDIO, // int8], const[USB_SUBCLASS_AUDIOSTREAMING, int8], // const[UAC_VERSION_3, int8], const[0, int8], // uac3_as_iface_extra_descriptors, // uac3_as_out_endpoint_descriptor] { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x4 (1 bytes) // bInterfaceNumber: const = 0x1 (1 bytes) // bAlternateSetting: const = 0x1 (1 bytes) // bNumEndpoints: const = 0x1 (1 bytes) // bInterfaceClass: const = 0x1 (1 bytes) // bInterfaceSubClass: const = 0x2 (1 bytes) // bInterfaceProtocol: const = 0x30 (1 bytes) // iInterface: const = 0x0 (1 bytes) // extra: uac3_as_iface_extra_descriptors { // others: array[uac3_as_iface_extra_descriptor] { // union uac3_as_iface_extra_descriptor { // format_type_i_descriptor: // uac2_format_type_i_descriptor { // bLength: len = 0x6 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x2 (1 bytes) // bFormatType: const = 0x1 (1 bytes) // bSubslotSize: b_sub_slot_sizes = 0x4 (1 bytes) // bBitResolution: int8 = 0x6 (1 bytes) // } // } // union uac3_as_iface_extra_descriptor { // format_type_i_ext: // uac2_format_type_i_ext_descriptor { // bLength: len = 0x9 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x2 (1 bytes) // bFormatType: const = 0x1 (1 bytes) // bSubslotSize: int8 = 0x3 (1 bytes) // bBitResolution: int8 = 0x3 (1 bytes) // bHeaderLength: int8 = 0x81 (1 bytes) // bControlSize: int8 = 0x6 (1 bytes) // bSideBandProtocol: int8 = 0x5 (1 bytes) // } // } // union uac3_as_iface_extra_descriptor { // format_type_i_ext: // uac2_format_type_i_ext_descriptor { // bLength: len = 0x9 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x2 (1 bytes) // bFormatType: const = 0x1 (1 bytes) // bSubslotSize: int8 = 0x0 (1 bytes) // bBitResolution: int8 = 0x1 (1 bytes) // bHeaderLength: int8 = 0x0 (1 bytes) // bControlSize: int8 = 0xb5 (1 bytes) // bSideBandProtocol: int8 = 0x8 (1 bytes) // } // } // union uac3_as_iface_extra_descriptor { // format_type_i_discrete: // uac_format_type_i_discrete_descriptor { // bLength: len = 0x8 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x2 (1 bytes) // bFormatType: const = 0x1 (1 bytes) // bNrChannels: int8 = 0xd2 (1 bytes) // bSubframeSize: int8 = 0x2 (1 bytes) // bBitResolution: int8 = 0x97 (1 bytes) // bSamFreqType: int8 = 0x0 (1 bytes) // tSamFreq: buffer: {} (length 0x0) // } // } // union uac3_as_iface_extra_descriptor { // format_type_ii_ext: // uac_format_type_ii_ext_descriptor { // bLength: len = 0xa (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x2 (1 bytes) // bFormatType: const = 0x2 (1 bytes) // wMaxBitRate: int16 = 0x3 (2 bytes) // wSamplesPerFrame: int16 = 0x401 (2 bytes) // bHeaderLength: int8 = 0x0 (1 bytes) // bSideBandProtocol: int8 = 0xf9 (1 bytes) // } // } // union uac3_as_iface_extra_descriptor { // as_header: uac3_as_header_descriptor { // bLength: len = 0x17 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x1 (1 bytes) // bTerminalLink: int8 = 0xe (1 bytes) // bmControls: int32 = 0x7c (4 bytes) // wClusterDescrID: int16 = 0x7 (2 bytes) // bmFormats: uac_format_tags = 0x2 (8 bytes) // bSubslotSize: int8 = 0x6 (1 bytes) // bBitResolution: int8 = 0x7 (1 bytes) // bmAuxProtocols: int16 = 0x6 (2 bytes) // bControlSize: int8 = 0x4 (1 bytes) // } // } // } // } // endpoints: uac3_as_out_endpoint_descriptor { // inner: // usb_endpoint_descriptor_verbose_t[const[USB_ENDPOINT_UAC1_AS_OUT_ADDRESS, // int8], const[USB_ENDPOINT_UAC1_AS_ATTRIBUTES, int8], // flags[usb_endpoint_max_packet_sizes, int16], int8, // int8, int8, uac3_iso_endpoint_descriptor] { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x5 (1 bytes) // bEndpointAddress: const = 0x1 (1 bytes) // bmAttributes: const = 0x9 (1 bytes) // wMaxPacketSize: usb_endpoint_max_packet_sizes = // 0x400 (2 bytes) bInterval: int8 = 0x9 (1 bytes) // bRefresh: int8 = 0x6 (1 bytes) // bSynchAddress: int8 = 0x10 (1 bytes) // extra: uac3_iso_endpoint_descriptor { // bLength: len = 0xa (1 bytes) // bDescriptorType: const = 0x25 (1 bytes) // bDescriptorSubType: const = 0x25 (1 bytes) // bmControls: int32 = 0x8 (4 bytes) // bLockDelayUnits: int8 = 0xd (1 bytes) // wLockDelay: int16 = 0x1ff (2 bytes) // } // } // } // } // as_in_alt_0: usb_interface_descriptor_verbose_t[const[2, // int8], const[0, int8], const[0, int8], // const[USB_CLASS_AUDIO, int8], // const[USB_SUBCLASS_AUDIOSTREAMING, int8], // const[UAC_VERSION_3, int8], const[0, int8], void, void] // { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x4 (1 bytes) // bInterfaceNumber: const = 0x2 (1 bytes) // bAlternateSetting: const = 0x0 (1 bytes) // bNumEndpoints: const = 0x0 (1 bytes) // bInterfaceClass: const = 0x1 (1 bytes) // bInterfaceSubClass: const = 0x2 (1 bytes) // bInterfaceProtocol: const = 0x30 (1 bytes) // iInterface: const = 0x0 (1 bytes) // extra: buffer: {} (length 0x0) // endpoints: buffer: {} (length 0x0) // } // as_in_alt_1: usb_interface_descriptor_verbose_t[const[2, // int8], const[1, int8], const[1, int8], // const[USB_CLASS_AUDIO, int8], // const[USB_SUBCLASS_AUDIOSTREAMING, int8], // const[UAC_VERSION_3, int8], const[0, int8], // uac3_as_iface_extra_descriptors, // uac3_as_in_endpoint_descriptor] { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x4 (1 bytes) // bInterfaceNumber: const = 0x2 (1 bytes) // bAlternateSetting: const = 0x1 (1 bytes) // bNumEndpoints: const = 0x1 (1 bytes) // bInterfaceClass: const = 0x1 (1 bytes) // bInterfaceSubClass: const = 0x2 (1 bytes) // bInterfaceProtocol: const = 0x30 (1 bytes) // iInterface: const = 0x0 (1 bytes) // extra: uac3_as_iface_extra_descriptors { // others: array[uac3_as_iface_extra_descriptor] { // union uac3_as_iface_extra_descriptor { // as_header: uac3_as_header_descriptor { // bLength: len = 0x17 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x1 (1 bytes) // bTerminalLink: int8 = 0x4 (1 bytes) // bmControls: int32 = 0xf2 (4 bytes) // wClusterDescrID: int16 = 0x7 (2 bytes) // bmFormats: uac_format_tags = 0x3 (8 bytes) // bSubslotSize: int8 = 0x8 (1 bytes) // bBitResolution: int8 = 0x7 (1 bytes) // bmAuxProtocols: int16 = 0x1292 (2 bytes) // bControlSize: int8 = 0x1 (1 bytes) // } // } // union uac3_as_iface_extra_descriptor { // format_type_i_descriptor: // uac2_format_type_i_descriptor { // bLength: len = 0x6 (1 bytes) // bDescriptorType: const = 0x24 (1 bytes) // bDescriptorSubType: const = 0x2 (1 bytes) // bFormatType: const = 0x1 (1 bytes) // bSubslotSize: b_sub_slot_sizes = 0x1 (1 bytes) // bBitResolution: int8 = 0x7 (1 bytes) // } // } // } // } // endpoints: uac3_as_in_endpoint_descriptor { // inner: // usb_endpoint_descriptor_verbose_t[const[USB_ENDPOINT_UAC1_AS_IN_ADDRESS, // int8], const[USB_ENDPOINT_UAC1_AS_ATTRIBUTES, int8], // flags[usb_endpoint_max_packet_sizes, int16], int8, // int8, int8, uac3_iso_endpoint_descriptor] { // bLength: const = 0x9 (1 bytes) // bDescriptorType: const = 0x5 (1 bytes) // bEndpointAddress: const = 0x82 (1 bytes) // bmAttributes: const = 0x9 (1 bytes) // wMaxPacketSize: usb_endpoint_max_packet_sizes = // 0x200 (2 bytes) bInterval: int8 = 0x20 (1 bytes) // bRefresh: int8 = 0x0 (1 bytes) // bSynchAddress: int8 = 0x7 (1 bytes) // extra: uac3_iso_endpoint_descriptor { // bLength: len = 0xa (1 bytes) // bDescriptorType: const = 0x25 (1 bytes) // bDescriptorSubType: const = 0x25 (1 bytes) // bmControls: int32 = 0xb8a (4 bytes) // bLockDelayUnits: int8 = 0x0 (1 bytes) // wLockDelay: int16 = 0x6 (2 bytes) // } // } // } // } // } // } // } // } // } // } // } // } // conn_descs: ptr[in, vusb_connect_descriptors] { // vusb_connect_descriptors { // qual_len: len = 0xa (4 bytes) // qual: ptr[in, usb_qualifier_descriptor] { // usb_qualifier_descriptor { // bLength: len = 0xa (1 bytes) // bDescriptorType: const = 0x6 (1 bytes) // bcdUSB: usb_versions = 0x300 (2 bytes) // bDeviceClass: int8 = 0x4 (1 bytes) // bDeviceSubClass: int8 = 0x9 (1 bytes) // bDeviceProtocol: int8 = 0x1 (1 bytes) // bMaxPacketSize0: usb_device_max_packet_sizes = 0x40 (1 bytes) // bNumConfigurations: int8 = 0xc (1 bytes) // bRESERVED: const = 0x0 (1 bytes) // } // } // bos_len: len = 0x10 (4 bytes) // bos: ptr[in, usb_bos_descriptor] { // usb_bos_descriptor { // bLength: const = 0x5 (1 bytes) // bDescriptorType: const = 0xf (1 bytes) // wTotalLength: len = 0x10 (2 bytes) // bNumDeviceCaps: len = 0x1 (1 bytes) // caps: array[usb_dev_cap] { // union usb_dev_cap { // wireless: usb_wireless_cap_descriptor { // bLength: len = 0xb (1 bytes) // bDescriptorType: const = 0x10 (1 bytes) // bDevCapabilityType: const = 0x1 (1 bytes) // bmAttributes: usb_wireless_cap_attributes = 0x8 (1 bytes) // wPHYRates: usb_wireless_cap_phyrates = 0x13 (2 bytes) // bmTFITXPowerInfo: int8 = 0x7 (1 bytes) // bmFFITXPowerInfo: int8 = 0x1 (1 bytes) // bmBandGroup: int16 = 0x1 (2 bytes) // bReserved: int8 = 0x2b (1 bytes) // } // } // } // } // } // strs_len: len = 0x1 (4 bytes) // strs: array[vusb_connect_string_descriptor] { // vusb_connect_string_descriptor { // len: len = 0x71 (4 bytes) // str: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {71 03 4b 52 89 83 31 35 a5 2e 53 7f 5b // f4 ae 6c bc 24 7e d0 22 c8 ad 94 83 c1 9c 8f 53 c0 53 ac // e2 68 ee a6 77 04 58 9e c9 10 1a c7 59 3d 55 9d 6e c7 f8 // 42 4b 49 b4 f9 d6 ae 70 ae df e6 f0 56 3e 96 59 91 a3 77 // df fb 18 cc 27 bf 6f 91 59 46 20 d0 cf ca d4 aa d5 b5 c4 // 84 b1 f2 12 b2 0a 0f fd 5c 67 77 61 69 cc 9f d7 a1 fd} // (length 0x6b) // } // } // } // } // } // } // } // ] // returns fd_usb_uac3 *(uint8_t*)0x80000080 = 0x12; *(uint8_t*)0x80000081 = 1; *(uint16_t*)0x80000082 = 0x200; *(uint8_t*)0x80000084 = 0; *(uint8_t*)0x80000085 = 0; *(uint8_t*)0x80000086 = 0; *(uint8_t*)0x80000087 = 0x40; *(uint16_t*)0x80000088 = 0x41e; *(uint16_t*)0x8000008a = 0x3020; *(uint16_t*)0x8000008c = 0x40; *(uint8_t*)0x8000008e = 1; *(uint8_t*)0x8000008f = 2; *(uint8_t*)0x80000090 = 3; *(uint8_t*)0x80000091 = 1; *(uint8_t*)0x80000092 = 9; *(uint8_t*)0x80000093 = 2; *(uint16_t*)0x80000094 = 0xe4; *(uint8_t*)0x80000096 = 3; *(uint8_t*)0x80000097 = 1; *(uint8_t*)0x80000098 = 1; *(uint8_t*)0x80000099 = 0xf0; *(uint8_t*)0x8000009a = 0xaa; *(uint8_t*)0x8000009b = 8; *(uint8_t*)0x8000009c = 0xb; *(uint8_t*)0x8000009d = 1; *(uint8_t*)0x8000009e = 2; *(uint8_t*)0x8000009f = 1; *(uint8_t*)0x800000a0 = 0x9e; *(uint8_t*)0x800000a1 = 0x30; *(uint8_t*)0x800000a2 = 0xfc; *(uint8_t*)0x800000a3 = 9; *(uint8_t*)0x800000a4 = 4; *(uint8_t*)0x800000a5 = 0; *(uint8_t*)0x800000a6 = 0; *(uint8_t*)0x800000a7 = 0; *(uint8_t*)0x800000a8 = 1; *(uint8_t*)0x800000a9 = 1; *(uint8_t*)0x800000aa = 0x30; *(uint8_t*)0x800000ab = 0; *(uint8_t*)0x800000ac = 0xa; *(uint8_t*)0x800000ad = 0x24; *(uint8_t*)0x800000ae = 1; *(uint8_t*)0x800000af = 7; *(uint16_t*)0x800000b0 = 0x22; *(uint32_t*)0x800000b2 = 7; *(uint8_t*)0x800000b6 = 0x13; *(uint8_t*)0x800000b7 = 0x24; *(uint8_t*)0x800000b8 = 3; *(uint8_t*)0x800000b9 = 1; *(uint16_t*)0x800000ba = 0x101; *(uint8_t*)0x800000bc = 1; *(uint8_t*)0x800000bd = 5; *(uint8_t*)0x800000be = 0xf; *(uint32_t*)0x800000bf = 0; *(uint16_t*)0x800000c3 = 9; *(uint16_t*)0x800000c5 = 7; *(uint16_t*)0x800000c7 = 0x80; *(uint8_t*)0x800000c9 = 5; *(uint8_t*)0x800000ca = 0x24; *(uint8_t*)0x800000cb = 5; *(uint8_t*)0x800000cc = 6; *(uint8_t*)0x800000cd = 7; *(uint8_t*)0x800000ce = 9; *(uint8_t*)0x800000cf = 4; *(uint8_t*)0x800000d0 = 1; *(uint8_t*)0x800000d1 = 0; *(uint8_t*)0x800000d2 = 0; *(uint8_t*)0x800000d3 = 1; *(uint8_t*)0x800000d4 = 2; *(uint8_t*)0x800000d5 = 0x30; *(uint8_t*)0x800000d6 = 0; *(uint8_t*)0x800000d7 = 9; *(uint8_t*)0x800000d8 = 4; *(uint8_t*)0x800000d9 = 1; *(uint8_t*)0x800000da = 1; *(uint8_t*)0x800000db = 1; *(uint8_t*)0x800000dc = 1; *(uint8_t*)0x800000dd = 2; *(uint8_t*)0x800000de = 0x30; *(uint8_t*)0x800000df = 0; *(uint8_t*)0x800000e0 = 6; *(uint8_t*)0x800000e1 = 0x24; *(uint8_t*)0x800000e2 = 2; *(uint8_t*)0x800000e3 = 1; *(uint8_t*)0x800000e4 = 4; *(uint8_t*)0x800000e5 = 6; *(uint8_t*)0x800000e6 = 9; *(uint8_t*)0x800000e7 = 0x24; *(uint8_t*)0x800000e8 = 2; *(uint8_t*)0x800000e9 = 1; *(uint8_t*)0x800000ea = 3; *(uint8_t*)0x800000eb = 3; *(uint8_t*)0x800000ec = 0x81; *(uint8_t*)0x800000ed = 6; *(uint8_t*)0x800000ee = 5; *(uint8_t*)0x800000ef = 9; *(uint8_t*)0x800000f0 = 0x24; *(uint8_t*)0x800000f1 = 2; *(uint8_t*)0x800000f2 = 1; *(uint8_t*)0x800000f3 = 0; *(uint8_t*)0x800000f4 = 1; *(uint8_t*)0x800000f5 = 0; *(uint8_t*)0x800000f6 = 0xb5; *(uint8_t*)0x800000f7 = 8; *(uint8_t*)0x800000f8 = 8; *(uint8_t*)0x800000f9 = 0x24; *(uint8_t*)0x800000fa = 2; *(uint8_t*)0x800000fb = 1; *(uint8_t*)0x800000fc = 0xd2; *(uint8_t*)0x800000fd = 2; *(uint8_t*)0x800000fe = 0x97; *(uint8_t*)0x800000ff = 0; *(uint8_t*)0x80000100 = 0xa; *(uint8_t*)0x80000101 = 0x24; *(uint8_t*)0x80000102 = 2; *(uint8_t*)0x80000103 = 2; *(uint16_t*)0x80000104 = 3; *(uint16_t*)0x80000106 = 0x401; *(uint8_t*)0x80000108 = 0; *(uint8_t*)0x80000109 = 0xf9; *(uint8_t*)0x8000010a = 0x17; *(uint8_t*)0x8000010b = 0x24; *(uint8_t*)0x8000010c = 1; *(uint8_t*)0x8000010d = 0xe; *(uint32_t*)0x8000010e = 0x7c; *(uint16_t*)0x80000112 = 7; *(uint64_t*)0x80000114 = 2; *(uint8_t*)0x8000011c = 6; *(uint8_t*)0x8000011d = 7; *(uint16_t*)0x8000011e = 6; *(uint8_t*)0x80000120 = 4; *(uint8_t*)0x80000121 = 9; *(uint8_t*)0x80000122 = 5; *(uint8_t*)0x80000123 = 1; *(uint8_t*)0x80000124 = 9; *(uint16_t*)0x80000125 = 0x400; *(uint8_t*)0x80000127 = 9; *(uint8_t*)0x80000128 = 6; *(uint8_t*)0x80000129 = 0x10; *(uint8_t*)0x8000012a = 0xa; *(uint8_t*)0x8000012b = 0x25; *(uint8_t*)0x8000012c = 0x25; *(uint32_t*)0x8000012d = 8; *(uint8_t*)0x80000131 = 0xd; *(uint16_t*)0x80000132 = 0x1ff; *(uint8_t*)0x80000134 = 9; *(uint8_t*)0x80000135 = 4; *(uint8_t*)0x80000136 = 2; *(uint8_t*)0x80000137 = 0; *(uint8_t*)0x80000138 = 0; *(uint8_t*)0x80000139 = 1; *(uint8_t*)0x8000013a = 2; *(uint8_t*)0x8000013b = 0x30; *(uint8_t*)0x8000013c = 0; *(uint8_t*)0x8000013d = 9; *(uint8_t*)0x8000013e = 4; *(uint8_t*)0x8000013f = 2; *(uint8_t*)0x80000140 = 1; *(uint8_t*)0x80000141 = 1; *(uint8_t*)0x80000142 = 1; *(uint8_t*)0x80000143 = 2; *(uint8_t*)0x80000144 = 0x30; *(uint8_t*)0x80000145 = 0; *(uint8_t*)0x80000146 = 0x17; *(uint8_t*)0x80000147 = 0x24; *(uint8_t*)0x80000148 = 1; *(uint8_t*)0x80000149 = 4; *(uint32_t*)0x8000014a = 0xf2; *(uint16_t*)0x8000014e = 7; *(uint64_t*)0x80000150 = 3; *(uint8_t*)0x80000158 = 8; *(uint8_t*)0x80000159 = 7; *(uint16_t*)0x8000015a = 0x1292; *(uint8_t*)0x8000015c = 1; *(uint8_t*)0x8000015d = 6; *(uint8_t*)0x8000015e = 0x24; *(uint8_t*)0x8000015f = 2; *(uint8_t*)0x80000160 = 1; *(uint8_t*)0x80000161 = 1; *(uint8_t*)0x80000162 = 7; *(uint8_t*)0x80000163 = 9; *(uint8_t*)0x80000164 = 5; *(uint8_t*)0x80000165 = 0x82; *(uint8_t*)0x80000166 = 9; *(uint16_t*)0x80000167 = 0x200; *(uint8_t*)0x80000169 = 0x20; *(uint8_t*)0x8000016a = 0; *(uint8_t*)0x8000016b = 7; *(uint8_t*)0x8000016c = 0xa; *(uint8_t*)0x8000016d = 0x25; *(uint8_t*)0x8000016e = 0x25; *(uint32_t*)0x8000016f = 0xb8a; *(uint8_t*)0x80000173 = 0; *(uint16_t*)0x80000174 = 6; *(uint32_t*)0x800002c0 = 0xa; *(uint32_t*)0x800002c4 = 0x80000180; *(uint8_t*)0x80000180 = 0xa; *(uint8_t*)0x80000181 = 6; *(uint16_t*)0x80000182 = 0x300; *(uint8_t*)0x80000184 = 4; *(uint8_t*)0x80000185 = 9; *(uint8_t*)0x80000186 = 1; *(uint8_t*)0x80000187 = 0x40; *(uint8_t*)0x80000188 = 0xc; *(uint8_t*)0x80000189 = 0; *(uint32_t*)0x800002c8 = 0x10; *(uint32_t*)0x800002cc = 0x800001c0; *(uint8_t*)0x800001c0 = 5; *(uint8_t*)0x800001c1 = 0xf; *(uint16_t*)0x800001c2 = 0x10; *(uint8_t*)0x800001c4 = 1; *(uint8_t*)0x800001c5 = 0xb; *(uint8_t*)0x800001c6 = 0x10; *(uint8_t*)0x800001c7 = 1; *(uint8_t*)0x800001c8 = 8; *(uint16_t*)0x800001c9 = 0x13; *(uint8_t*)0x800001cb = 7; *(uint8_t*)0x800001cc = 1; *(uint16_t*)0x800001cd = 1; *(uint8_t*)0x800001cf = 0x2b; *(uint32_t*)0x800002d0 = 1; *(uint32_t*)0x800002d4 = 0x71; *(uint32_t*)0x800002d8 = 0x80000240; memcpy( (void*)0x80000240, "\x71\x03\x4b\x52\x89\x83\x31\x35\xa5\x2e\x53\x7f\x5b\xf4\xae\x6c\xbc\x24" "\x7e\xd0\x22\xc8\xad\x94\x83\xc1\x9c\x8f\x53\xc0\x53\xac\xe2\x68\xee\xa6" "\x77\x04\x58\x9e\xc9\x10\x1a\xc7\x59\x3d\x55\x9d\x6e\xc7\xf8\x42\x4b\x49" "\xb4\xf9\xd6\xae\x70\xae\xdf\xe6\xf0\x56\x3e\x96\x59\x91\xa3\x77\xdf\xfb" "\x18\xcc\x27\xbf\x6f\x91\x59\x46\x20\xd0\xcf\xca\xd4\xaa\xd5\xb5\xc4\x84" "\xb1\xf2\x12\xb2\x0a\x0f\xfd\x5c\x67\x77\x61\x69\xcc\x9f\xd7\xa1\xfd", 107); syz_usb_connect(/*speed=USB_SPEED_WIRELESS*/ 4, /*dev_len=*/0xf6, /*dev=*/0x80000080, /*conn_descs=*/0x800002c0); // syz_usb_control_io arguments: [ // fd: fd_usb (resource) // descs: nil // resps: nil // ] syz_usb_control_io(/*fd=*/r[1], /*descs=*/0, /*resps=*/0); // setsockopt$inet_tcp_TCP_CONGESTION arguments: [ // fd: sock_tcp (resource) // level: const = 0x6 (4 bytes) // optname: const = 0xd (4 bytes) // optval: nil // optlen: len = 0x0 (4 bytes) // ] syscall(__NR_setsockopt, /*fd=*/(intptr_t)-1, /*level=*/6, /*optname=*/0xd, /*optval=*/0, /*optlen=*/0); // syz_open_dev$dvb_demux arguments: [ // dev: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 64 76 62 2f 61 64 61 70 74 65 72 23 2f 64 65 // 6d 75 78 23 00} (length 0x19) // } // id: intptr = 0x1 (4 bytes) // flags: open_flags = 0x2 (4 bytes) // ] // returns fd_dvb_demux memcpy((void*)0x80000200, "/dev/dvb/adapter#/demux#\000", 25); res = -1; res = syz_open_dev(/*dev=*/0x80000200, /*id=*/1, /*flags=O_RDWR*/ 2); if (res != -1) r[2] = res; // ioctl$DVB_DEMUX_DMX_SET_PES_FILTER arguments: [ // fd: fd_dvb_demux (resource) // cmd: const = 0x40146f2c (4 bytes) // arg: ptr[in, dmx_pes_filter_params] { // dmx_pes_filter_params { // pid: int16 = 0x100 (2 bytes) // pad = 0x0 (2 bytes) // input: dmx_input = 0x0 (4 bytes) // output: dmx_output = 0x1 (4 bytes) // pes_type: dmx_ts_pes = 0x14 (4 bytes) // flags: dmx_pes_filter_flags = 0x4 (4 bytes) // } // } // ] *(uint16_t*)0x80000300 = 0x100; *(uint32_t*)0x80000304 = 0; *(uint32_t*)0x80000308 = 1; *(uint32_t*)0x8000030c = 0x14; *(uint32_t*)0x80000310 = 4; syscall(__NR_ioctl, /*fd=*/(intptr_t)r[2], /*cmd=*/0x40146f2c, /*arg=*/0x80000300); return 0; }