ID Workflow Result Correct Bug Created Started Finished Revision
5fcff94d repro-c Reproduced: ✅ ❓ WARNING in service_outstanding_interrupt/usb_submit_urb (2) 2026/09/11 21:27 2026/09/11 21:27 2026/09/11 23:54 6816f32e
Agent: prod-syz-agent-4
External Bug ID: ---

Inputs:
BaseBranch master
BaseCommit RC
BaseRepository git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
BugTitle WARNING in service_outstanding_interrupt/usb_submit_urb
CrashLogID 4535395158589440
CrashReportID 5661295065432064
KernelCommit 34c9c5517033a74039a54dfab24e7bf767a4e0e4
KernelConfig
Show (282200 bytes)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 syzkaller Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 14.2.0-19) 14.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=140200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24400
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=24400
CONFIG_LLD_VERSION=0
CONFIG_RUSTC_VERSION=109600
CONFIG_RUST_IS_AVAILABLE=y
CONFIG_RUSTC_LLVM_VERSION=220102
CONFIG_RUSTC_LLVM_MAJOR_VERSION=22
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
CONFIG_TOOLS_SUPPORT_RELR=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_ASSUME=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y
CONFIG_RUSTC_HAS_SPAN_FILE=y
CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
CONFIG_RUSTC_HAS_FILE_WITH_NUL=y
CONFIG_RUSTC_HAS_FILE_AS_C_STR=y
CONFIG_PAHOLE_VERSION=130
CONFIG_CONSTRUCTORS=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_HAVE_KERNEL_ZSTD=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
# CONFIG_KERNEL_ZSTD is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y
CONFIG_GENERIC_IRQ_RESERVATION_MODE=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_INIT=y
CONFIG_ARCH_WANTS_CLOCKSOURCE_READ_INLINE=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST_IDLE=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CLOCKEVENTS_COUPLED=y
CONFIG_GENERIC_CLOCKEVENTS_COUPLED_INLINE=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_HRTIMER_REARM_DEFERRED=y
CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_CONTEXT_TRACKING_IDLE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_CONTEXT_TRACKING_USER=y
# CONFIG_CONTEXT_TRACKING_USER_FORCE is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_POSIX_AUX_CLOCKS=y
# end of Timers subsystem

CONFIG_BPF=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y

#
# BPF subsystem
#
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
# CONFIG_BPF_JIT_ALWAYS_ON is not set
CONFIG_BPF_JIT_DEFAULT_ON=y
# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
CONFIG_BPF_PRELOAD=y
CONFIG_BPF_PRELOAD_UMD=y
CONFIG_BPF_LSM=y
# end of BPF subsystem

CONFIG_PREEMPT_BUILD=y
CONFIG_ARCH_HAS_PREEMPT_LAZY=y
CONFIG_PREEMPT=y
# CONFIG_PREEMPT_LAZY is not set
# CONFIG_PREEMPT_RT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_HAS_SEPARATE_PREEMPT_RESCHED_BITS=y
CONFIG_PREEMPTION=y
CONFIG_PREEMPT_DYNAMIC=y
CONFIG_SCHED_CORE=y

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_SCHED_AVG_IRQ=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

CONFIG_CPU_ISOLATION=y

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
CONFIG_PREEMPT_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_TREE_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_NEED_TASKS_RCU=y
CONFIG_TASKS_RCU=y
CONFIG_TASKS_TRACE_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
# end of RCU Subsystem

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
# CONFIG_PRINTK_INDEX is not set
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y

#
# Scheduler features
#
# CONFIG_UCLAMP_TASK is not set
# CONFIG_SCHED_PROXY_EXEC is not set
# end of Scheduler features

CONFIG_ARCH_HAS_PTE_PROTNONE=y
CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
CONFIG_CC_HAS_INT128=y
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
CONFIG_CC_MS_EXTENSIONS="-fms-extensions"
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_CC_NO_ARRAY_BOUNDS=y
CONFIG_GCC_NO_STRINGOP_OVERFLOW=y
CONFIG_CC_NO_STRINGOP_OVERFLOW=y
CONFIG_ARCH_SUPPORTS_INT128=y
CONFIG_NUMA_BALANCING=y
CONFIG_SCHED_CACHE=y
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
CONFIG_SLAB_OBJ_EXT=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
# CONFIG_CGROUP_FAVOR_DYNMODS is not set
CONFIG_MEMCG=y
CONFIG_MEMCG_V1=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_GROUP_SCHED_WEIGHT=y
CONFIG_GROUP_SCHED_BANDWIDTH=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_SCHED_MM_CID=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
# CONFIG_CGROUP_DMEM is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
# CONFIG_CPUSETS_V1 is not set
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
# CONFIG_CGROUP_BPF is not set
CONFIG_CGROUP_MISC=y
CONFIG_CGROUP_DEBUG=y
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_TIME_NS=y
CONFIG_TIME_NS_VDSO=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
# CONFIG_BOOT_CONFIG is not set
CONFIG_ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG=y
CONFIG_CMDLINE_LOG_WRAP_IDEAL_LEN=1021
CONFIG_INITRAMFS_PRESERVE_MTIME=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_LD_ORPHAN_WARN=y
CONFIG_LD_ORPHAN_WARN_LEVEL="warn"
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
# CONFIG_BASE_SMALL is not set
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_FUTEX_PRIVATE_HASH=y
CONFIG_FUTEX_MPOL=y
CONFIG_HAVE_FUTEX_ROBUST_UNLOCK=y
CONFIG_FUTEX_ROBUST_UNLOCK=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_IO_URING_MOCK_FILE=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KCMP=y
CONFIG_RSEQ=y
CONFIG_RSEQ_SLICE_EXTENSION=y
# CONFIG_RSEQ_STATS is not set
# CONFIG_RSEQ_DEBUG_DEFAULT_ENABLE is not set
CONFIG_CACHESTAT_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_SELFTEST is not set
CONFIG_KALLSYMS_ALL=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_GUEST_PERF_EVENTS=y
CONFIG_PERF_GUEST_MEDIATED_PMU=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
# end of Kernel Performance Events And Counters

CONFIG_SYSTEM_DATA_VERIFICATION=y
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y

#
# Kexec and crash features
#
CONFIG_CRASH_RESERVE=y
CONFIG_VMCORE_INFO=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
# CONFIG_KEXEC_FILE is not set
# CONFIG_KEXEC_JUMP is not set
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y
CONFIG_CRASH_MAX_MEMORY_RANGES=8192
# end of Kexec and crash features

#
# Live Update and Kexec HandOver
#
# CONFIG_KEXEC_HANDOVER is not set
# end of Live Update and Kexec HandOver
# end of General setup

CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_AUDIT_ARCH=y
CONFIG_KASAN_SHADOW_OFFSET=0xdffffc0000000000
CONFIG_HAVE_INTEL_TXT=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=5

#
# Processor type and features
#
CONFIG_SMP=y
CONFIG_X86_X2APIC=y
# CONFIG_X86_POSTED_MSI is not set
CONFIG_X86_MPPARSE=y
# CONFIG_X86_CPU_RESCTRL is not set
CONFIG_X86_FRED=y
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_NUMACHIP is not set
# CONFIG_X86_VSMP is not set
# CONFIG_X86_INTEL_MID is not set
# CONFIG_X86_GOLDFISH is not set
# CONFIG_X86_INTEL_LPSS is not set
# CONFIG_X86_AMD_PLATFORM_DEVICE is not set
CONFIG_IOSF_MBI=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_X86_HV_CALLBACK_VECTOR=y
# CONFIG_XEN is not set
CONFIG_KVM_GUEST=y
CONFIG_ARCH_CPUIDLE_HALTPOLL=y
CONFIG_PVH=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_JAILHOUSE_GUEST is not set
# CONFIG_ACRN_GUEST is not set
# CONFIG_BHYVE_GUEST is not set
CONFIG_CC_HAS_MARCH_NATIVE=y
# CONFIG_X86_NATIVE_CPU is not set
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
CONFIG_X86_HAVE_PAE=y
CONFIG_X86_CX8=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_IA32_FEAT_CTL=y
CONFIG_X86_VMX_FEATURE_NAMES=y
CONFIG_PROCESSOR_SELECT=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
# CONFIG_CPU_SUP_HYGON is not set
# CONFIG_CPU_SUP_CENTAUR is not set
# CONFIG_CPU_SUP_ZHAOXIN is not set
CONFIG_BROADCAST_TLB_FLUSH=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
# CONFIG_GART_IOMMU is not set
CONFIG_BOOT_VESA_SUPPORT=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS_RANGE_BEGIN=2
CONFIG_NR_CPUS_RANGE_END=512
CONFIG_NR_CPUS_DEFAULT=64
CONFIG_NR_CPUS=8
CONFIG_SCHED_MC_PRIO=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_ACPI_MADT_WAKEUP=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
# CONFIG_X86_MCELOG_LEGACY is not set
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set

#
# Performance monitoring
#
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_PERF_EVENTS_INTEL_RAPL=y
CONFIG_PERF_EVENTS_INTEL_CSTATE=y
# CONFIG_PERF_EVENTS_AMD_POWER is not set
CONFIG_PERF_EVENTS_AMD_UNCORE=y
# CONFIG_PERF_EVENTS_AMD_BRS is not set
# end of Performance monitoring

CONFIG_X86_16BIT=y
CONFIG_X86_ESPFIX64=y
CONFIG_X86_VSYSCALL_EMULATION=y
CONFIG_X86_IOPL_IOPERM=y
CONFIG_MICROCODE=y
# CONFIG_MICROCODE_LATE_LOADING is not set
# CONFIG_MICROCODE_DBG is not set
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
CONFIG_X86_DIRECT_GBPAGES=y
# CONFIG_X86_CPA_STATISTICS is not set
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
# CONFIG_ARCH_MEMORY_PROBE is not set
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
# CONFIG_X86_PMEM_LEGACY is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_MTRR=y
# CONFIG_MTRR_SANITIZER is not set
CONFIG_X86_PAT=y
CONFIG_X86_UMIP=y
CONFIG_CC_HAS_IBT=y
CONFIG_X86_CET=y
CONFIG_X86_KERNEL_IBT=y
CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y
CONFIG_ARCH_PKEY_BITS=4
# CONFIG_X86_INTEL_TSX_MODE_OFF is not set
CONFIG_X86_INTEL_TSX_MODE_ON=y
# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
CONFIG_X86_SGX=y
CONFIG_X86_USER_SHADOW_STACK=y
# CONFIG_INTEL_TDX_HOST is not set
# CONFIG_EFI is not set
CONFIG_HZ_100=y
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=100
CONFIG_SCHED_HRTICK=y
CONFIG_ARCH_SUPPORTS_KEXEC=y
CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y
CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG_FORCE=y
CONFIG_ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_JUMP=y
CONFIG_ARCH_SUPPORTS_KEXEC_HANDOVER=y
CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y
CONFIG_ARCH_DEFAULT_CRASH_DUMP=y
CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y
CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x200000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
CONFIG_LEGACY_VSYSCALL_XONLY=y
# CONFIG_LEGACY_VSYSCALL_NONE is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlyprintk=serial net.ifnames=0 sysctl.kernel.hung_task_all_cpu_backtrace=1 ima_policy=tcb nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 nf-conntrack-sip.ports=20000 nf-conntrack-irc.ports=20000 nf-conntrack-sane.ports=20000 binder.debug_mask=0 rcupdate.rcu_expedited=1 rcupdate.rcu_cpu_stall_cputime=1 no_hash_pointers page_owner=on sysctl.vm.nr_hugepages=4 sysctl.vm.nr_overcommit_hugepages=4 secretmem.enable=1 sysctl.max_rcu_stall_to_panic=1 msr.allow_writes=off coredump_filter=0xffff root=/dev/sda console=ttyS0 vsyscall=native numa=fake=2 kvm-intel.nested=1 spec_store_bypass_disable=prctl nopcid vivid.n_devs=64 vivid.multiplanar=1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 netrom.nr_ndevs=32 rose.rose_ndevs=32 smp.csd_lock_timeout=100000 watchdog_thresh=55 workqueue.watchdog_thresh=140 sysctl.net.core.netdev_unregister_timeout_secs=140 dummy_hcd.num=32 max_loop=32 nbds_max=32 comedi.comedi_num_legacy_minors=4 panic_on_warn=1"
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_MODIFY_LDT_SYSCALL=y
# CONFIG_STRICT_SIGALTSTACK_SIZE is not set
CONFIG_HAVE_LIVEPATCH=y
CONFIG_HAVE_KLP_BUILD=y
CONFIG_X86_BUS_LOCK_DETECT=y
# end of Processor type and features

CONFIG_CC_HAS_NAMED_AS=y
CONFIG_CC_HAS_NAMED_AS_FIXED_SANITIZERS=y
CONFIG_USE_X86_SEG_SUPPORT=y
CONFIG_CC_HAS_SLS=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_CC_HAS_ENTRY_PADDING=y
CONFIG_FUNCTION_PADDING_CFI=11
CONFIG_FUNCTION_PADDING_BYTES=16
CONFIG_CALL_PADDING=y
CONFIG_HAVE_CALL_THUNKS=y
CONFIG_CALL_THUNKS=y
CONFIG_CPU_MITIGATIONS=y
CONFIG_MITIGATION_PAGE_TABLE_ISOLATION=y
CONFIG_MITIGATION_RETPOLINE=y
CONFIG_MITIGATION_RETHUNK=y
CONFIG_MITIGATION_UNRET_ENTRY=y
CONFIG_MITIGATION_CALL_DEPTH_TRACKING=y
# CONFIG_CALL_THUNKS_DEBUG is not set
CONFIG_MITIGATION_IBPB_ENTRY=y
CONFIG_MITIGATION_IBRS_ENTRY=y
CONFIG_MITIGATION_SRSO=y
# CONFIG_MITIGATION_SLS is not set
CONFIG_MITIGATION_GDS=y
CONFIG_MITIGATION_RFDS=y
CONFIG_MITIGATION_SPECTRE_BHI=y
CONFIG_MITIGATION_MDS=y
CONFIG_MITIGATION_TAA=y
CONFIG_MITIGATION_MMIO_STALE_DATA=y
CONFIG_MITIGATION_L1TF=y
CONFIG_MITIGATION_RETBLEED=y
CONFIG_MITIGATION_SPECTRE_V1=y
CONFIG_MITIGATION_SPECTRE_V2=y
CONFIG_MITIGATION_SRBDS=y
CONFIG_MITIGATION_SSB=y
CONFIG_MITIGATION_ITS=y
CONFIG_MITIGATION_TSA=y
# CONFIG_MITIGATION_VMSCAPE is not set
CONFIG_ARCH_HAS_ADD_PAGES=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_HIBERNATION_SNAPSHOT_DEV=y
CONFIG_HIBERNATION_COMP_LZO=y
# CONFIG_HIBERNATION_COMP_LZ4 is not set
CONFIG_HIBERNATION_DEF_COMP="lzo"
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_USERSPACE_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
# CONFIG_PM_QOS_CPU_SYSTEM_WAKEUP is not set
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_ADVANCED_DEBUG is not set
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_PM_SLEEP_DEBUG=y
# CONFIG_DPM_WATCHDOG is not set
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
CONFIG_PM_CLK=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
# CONFIG_ENERGY_MODEL is not set
CONFIG_ARCH_SUPPORTS_ACPI=y
CONFIG_ACPI=y
CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
CONFIG_ACPI_THERMAL_LIB=y
# CONFIG_ACPI_DEBUGGER is not set
CONFIG_ACPI_SPCR_TABLE=y
# CONFIG_ACPI_FPDT is not set
CONFIG_ACPI_LPIT=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
CONFIG_ACPI_EC=y
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=y
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_TAD is not set
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_ACPI_PROCESSOR_CSTATE=y
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_PLATFORM_PROFILE=y
CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_DEBUG=y
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_HOTPLUG_MEMORY is not set
CONFIG_ACPI_HOTPLUG_IOAPIC=y
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
CONFIG_ACPI_NHLT=y
CONFIG_ACPI_NFIT=y
# CONFIG_NFIT_SECURITY_DEBUG is not set
CONFIG_ACPI_NUMA=y
# CONFIG_ACPI_HMAT is not set
CONFIG_HAVE_ACPI_APEI=y
CONFIG_HAVE_ACPI_APEI_NMI=y
# CONFIG_ACPI_APEI is not set
# CONFIG_ACPI_DPTF is not set
# CONFIG_ACPI_EXTLOG is not set
# CONFIG_ACPI_CONFIGFS is not set
# CONFIG_ACPI_PFRUT is not set
CONFIG_ACPI_PCC=y
# CONFIG_ACPI_FFH is not set
CONFIG_ACPI_MRRM=y
CONFIG_PMIC_OPREGION=y
CONFIG_BXT_WC_PMIC_OPREGION=y
# CONFIG_CHT_WC_PMIC_OPREGION is not set
CONFIG_X86_PM_TIMER=y

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#
# CPU frequency scaling drivers
#
# CONFIG_CPUFREQ_DT is not set
# CONFIG_CPUFREQ_DT_PLATDEV is not set
CONFIG_X86_INTEL_PSTATE=y
# CONFIG_X86_PCC_CPUFREQ is not set
CONFIG_X86_AMD_PSTATE=y
CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3
# CONFIG_X86_AMD_PSTATE_UT is not set
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_CPB=y
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
CONFIG_CPUFREQ_ARCH_CUR_FREQ=y
# end of CPU Frequency scaling

#
# CPU Idle
#
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_CPU_IDLE_GOV_TEO is not set
CONFIG_CPU_IDLE_GOV_HALTPOLL=y
CONFIG_HALTPOLL_CPUIDLE=y
# end of CPU Idle

CONFIG_INTEL_IDLE=y
# end of Power management and ACPI options

#
# Bus options (PCI etc.)
#
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_MMCONF_FAM10H=y
CONFIG_ISA_BUS=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_AMD_NODE=y
# end of Bus options (PCI etc.)

#
# Binary Emulations
#
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_EMULATION_DEFAULT_DISABLED is not set
CONFIG_X86_X32_ABI=y
CONFIG_COMPAT_32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
# end of Binary Emulations

CONFIG_KVM_COMMON=y
CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_DIRTY_RING_TSO=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_READONLY_MEM=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_NO_POLL=y
CONFIG_VIRT_XFER_TO_GUEST_WORK=y
CONFIG_HAVE_KVM_PM_NOTIFIER=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_ELIDE_TLB_FLUSH_IF_YOUNG=y
CONFIG_KVM_MMU_LOCKLESS_AGING=y
CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES=y
CONFIG_KVM_GUEST_MEMFD=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM_X86=y
CONFIG_KVM=y
CONFIG_KVM_SW_PROTECTED_VM=y
CONFIG_KVM_INTEL=y
# CONFIG_KVM_INTEL_PROVE_VE is not set
CONFIG_X86_SGX_KVM=y
CONFIG_KVM_AMD=y
CONFIG_KVM_IOAPIC=y
CONFIG_KVM_SMM=y
CONFIG_KVM_HYPERV=y
CONFIG_KVM_XEN=y
CONFIG_KVM_PROVE_MMU=y
CONFIG_KVM_MAX_NR_VCPUS=1024
CONFIG_X86_REQUIRED_FEATURE_ALWAYS=y
CONFIG_X86_REQUIRED_FEATURE_NOPL=y
CONFIG_X86_REQUIRED_FEATURE_CX8=y
CONFIG_X86_REQUIRED_FEATURE_CMOV=y
CONFIG_X86_REQUIRED_FEATURE_CPUID=y
CONFIG_X86_REQUIRED_FEATURE_FPU=y
CONFIG_X86_REQUIRED_FEATURE_PAE=y
CONFIG_X86_REQUIRED_FEATURE_PSE=y
CONFIG_X86_REQUIRED_FEATURE_PGE=y
CONFIG_X86_REQUIRED_FEATURE_MSR=y
CONFIG_X86_REQUIRED_FEATURE_FXSR=y
CONFIG_X86_REQUIRED_FEATURE_XMM=y
CONFIG_X86_REQUIRED_FEATURE_XMM2=y
CONFIG_X86_REQUIRED_FEATURE_LM=y
CONFIG_X86_DISABLED_FEATURE_VME=y
CONFIG_X86_DISABLED_FEATURE_K6_MTRR=y
CONFIG_X86_DISABLED_FEATURE_CYRIX_ARR=y
CONFIG_X86_DISABLED_FEATURE_CENTAUR_MCR=y
CONFIG_X86_DISABLED_FEATURE_LAM=y
CONFIG_X86_DISABLED_FEATURE_XENPV=y
CONFIG_X86_DISABLED_FEATURE_TDX_GUEST=y
CONFIG_X86_DISABLED_FEATURE_SEV_SNP=y
CONFIG_AS_WRUSS=y
CONFIG_ARCH_CONFIGURES_CPU_MITIGATIONS=y

#
# General architecture-dependent options
#
CONFIG_HOTPLUG_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_CLUSTER=y
CONFIG_ARCH_SUPPORTS_SCHED_MC=y
CONFIG_SCHED_SMT=y
CONFIG_SCHED_CLUSTER=y
CONFIG_SCHED_MC=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
CONFIG_HOTPLUG_CORE_SYNC_FULL=y
CONFIG_HOTPLUG_SPLIT_STARTUP=y
CONFIG_HOTPLUG_PARALLEL=y
CONFIG_GENERIC_IRQ_ENTRY=y
CONFIG_GENERIC_SYSCALL=y
CONFIG_GENERIC_ENTRY=y
CONFIG_ARCH_SUPPORTS_SYSCALL_USER_DISPATCH=y
CONFIG_SYSCALL_USER_DISPATCH=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
# CONFIG_STATIC_KEYS_SELFTEST is not set
# CONFIG_STATIC_CALL_SELFTEST is not set
CONFIG_UPROBES=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_KPROBES_ON_FTRACE=y
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y
CONFIG_HAVE_NMI=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
CONFIG_ARCH_HAS_SET_MEMORY=y
CONFIG_ARCH_HAS_SET_DIRECT_MAP=y
CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y
CONFIG_ARCH_HAS_DELAY_TIMER=y
CONFIG_ARCH_HAS_CPU_PASID=y
CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
CONFIG_ARCH_WANTS_NO_INSTR=y
CONFIG_ARCH_MEMORY_ORDER_TSO=y
CONFIG_HAVE_ASM_MODVERSIONS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_RSEQ=y
CONFIG_HAVE_RUST=y
CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y
CONFIG_UNWIND_USER=y
CONFIG_HAVE_UNWIND_USER_FP=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y
CONFIG_MMU_GATHER_TABLE_FREE=y
CONFIG_MMU_GATHER_RCU_TABLE_FREE=y
CONFIG_MMU_GATHER_MERGE_VMAS=y
CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM=y
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES=y
CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_HAVE_ARCH_SECCOMP=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP=y
CONFIG_SECCOMP_FILTER=y
# CONFIG_SECCOMP_CACHE_DEBUG is not set
CONFIG_HAVE_ARCH_KSTACK_ERASE=y
CONFIG_HAVE_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR_STRONG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y
CONFIG_LTO_NONE=y
CONFIG_ARCH_SUPPORTS_CFI=y
CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y
CONFIG_HAVE_CONTEXT_TRACKING_USER=y
CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_PV_STEAL_CLOCK_GEN=y
CONFIG_HAVE_MOVE_PUD=y
CONFIG_HAVE_MOVE_PMD=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
CONFIG_HAVE_ARCH_HUGE_VMALLOC=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_PMD_MKWRITE=y
CONFIG_HAVE_ARCH_SOFT_DIRTY=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_HAS_EXECMEM_ROX=y
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
CONFIG_SOFTIRQ_ON_OWN_STACK=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_HAVE_EXIT_THREAD=y
CONFIG_ARCH_MMAP_RND_BITS=28
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8
CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y
CONFIG_HAVE_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_PAGE_SHIFT=12
CONFIG_HAVE_OBJTOOL=y
CONFIG_HAVE_JUMP_LABEL_HACK=y
CONFIG_HAVE_NOINSTR_HACK=y
CONFIG_HAVE_NOINSTR_VALIDATION=y
CONFIG_HAVE_UACCESS_VALIDATION=y
CONFIG_HAVE_STACK_VALIDATION=y
CONFIG_HAVE_RELIABLE_STACKTRACE=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_ARCH_SUPPORTS_RT=y
CONFIG_HAVE_ARCH_VMAP_STACK=y
CONFIG_VMAP_STACK=y
CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y
CONFIG_RANDOMIZE_KSTACK_OFFSET=y
# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set
CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
CONFIG_STRICT_KERNEL_RWX=y
CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
CONFIG_STRICT_MODULE_RWX=y
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y
# CONFIG_LOCK_EVENT_COUNTS is not set
CONFIG_ARCH_HAS_MEM_ENCRYPT=y
CONFIG_HAVE_STATIC_CALL=y
CONFIG_HAVE_STATIC_CALL_INLINE=y
CONFIG_HAVE_PREEMPT_DYNAMIC=y
CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y
CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y
CONFIG_ARCH_HAS_ELFCORE_COMPAT=y
CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y
CONFIG_DYNAMIC_SIGFRAME=y
CONFIG_HAVE_ARCH_NODE_DEV_GROUP=y
CONFIG_ARCH_HAS_HW_PTE_YOUNG=y
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y
CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y
CONFIG_HAVE_GENERIC_TIF_BITS=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
# end of GCOV-based kernel profiling

CONFIG_HAVE_GCC_PLUGINS=y
CONFIG_FUNCTION_ALIGNMENT_4B=y
CONFIG_FUNCTION_ALIGNMENT_16B=y
CONFIG_FUNCTION_ALIGNMENT=16
CONFIG_CC_HAS_MIN_FUNCTION_ALIGNMENT=y
CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT=y
CONFIG_ARCH_HAS_CPU_ATTACK_VECTORS=y
# end of General architecture-dependent options

CONFIG_RT_MUTEXES=y
CONFIG_MODULE_SIG_FORMAT=y
CONFIG_MODULES=y
# CONFIG_MODULE_DEBUG is not set
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set
CONFIG_MODVERSIONS=y
# CONFIG_GENKSYMS is not set
CONFIG_GENDWARFKSYMS=y
CONFIG_ASM_MODVERSIONS=y
# CONFIG_EXTENDED_MODVERSIONS is not set
# CONFIG_BASIC_MODVERSIONS is not set
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
# CONFIG_MODULE_SIG_ALL is not set
CONFIG_MODULE_SIG_SHA256=y
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
# CONFIG_MODULE_SIG_SHA3_256 is not set
# CONFIG_MODULE_SIG_SHA3_384 is not set
# CONFIG_MODULE_SIG_SHA3_512 is not set
CONFIG_MODULE_SIG_HASH="sha256"
# CONFIG_MODULE_COMPRESS is not set
# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set
CONFIG_MODPROBE_PATH="/sbin/modprobe"
# CONFIG_TRIM_UNUSED_KSYMS is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_PUNT_BIO=y
CONFIG_BLK_DEV_BSG_COMMON=y
CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_DEV_WRITE_MOUNTED is not set
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_BLK_WBT=y
CONFIG_BLK_WBT_MQ=y
CONFIG_BLK_CGROUP_IOLATENCY=y
# CONFIG_BLK_CGROUP_FC_APPID is not set
CONFIG_BLK_CGROUP_IOCOST=y
CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BLK_DEBUG_FS=y
# CONFIG_BLK_SED_OPAL is not set
CONFIG_BLK_INLINE_ENCRYPTION=y
CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
CONFIG_ACORN_PARTITION_CUMANA=y
CONFIG_ACORN_PARTITION_EESOX=y
CONFIG_ACORN_PARTITION_ICS=y
CONFIG_ACORN_PARTITION_ADFS=y
CONFIG_ACORN_PARTITION_POWERTEC=y
CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_AIX_PARTITION=y
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_SYSV68_PARTITION=y
CONFIG_CMDLINE_PARTITION=y
# CONFIG_OF_PARTITION is not set
# end of Partition Types

CONFIG_BLK_PM=y
CONFIG_BLOCK_HOLDER_DEPRECATED=y
CONFIG_BLK_MQ_STACKING=y
# CONFIG_BLK_ERROR_INJECTION is not set

#
# IO Schedulers
#
CONFIG_MQ_IOSCHED_DEADLINE=y
CONFIG_MQ_IOSCHED_KYBER=y
CONFIG_IOSCHED_BFQ=y
CONFIG_BFQ_GROUP_IOSCHED=y
CONFIG_BFQ_CGROUP_DEBUG=y
# end of IO Schedulers

CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_PADATA=y
CONFIG_ASN1=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
CONFIG_QUEUED_SPINLOCKS=y
# CONFIG_QUEUED_SPINLOCKS_TRACE_CONTENDED_RELEASE is not set
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
CONFIG_FREEZER=y

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ELFCORE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
CONFIG_BINFMT_MISC=y
CONFIG_COREDUMP=y
# end of Executable file formats

#
# Memory Management options
#
CONFIG_SWAP=y
CONFIG_ZSWAP=y
CONFIG_ZSWAP_DEFAULT_ON=y
CONFIG_ZSWAP_SHRINKER_DEFAULT_ON=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT_842=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT="842"
CONFIG_ZSMALLOC=y

#
# Zsmalloc allocator options
#

#
# Zsmalloc is a common backend allocator for zswap & zram
#
# CONFIG_ZSMALLOC_STAT is not set
CONFIG_ZSMALLOC_CHAIN_SIZE=8
# end of Zsmalloc allocator options

#
# Slab allocator options
#
CONFIG_SLUB=y
CONFIG_KVFREE_RCU_BATCHED=y
# CONFIG_SLUB_TINY is not set
CONFIG_SLAB_MERGE_DEFAULT=y
# CONFIG_SLAB_FREELIST_RANDOM is not set
# CONFIG_SLAB_FREELIST_HARDENED is not set
# CONFIG_SLAB_BUCKETS is not set
# CONFIG_SLUB_STATS is not set
# CONFIG_KMALLOC_PARTITION_CACHES is not set
# end of Slab allocator options

# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_SPARSEMEM_VMEMMAP_PREINIT=y
CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=y
CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP=y
CONFIG_ARCH_WANT_HUGETLB_VMEMMAP_PREINIT=y
CONFIG_HAVE_GUP_FAST=y
CONFIG_NUMA_KEEP_MEMINFO=y
CONFIG_MEMORY_ISOLATION=y
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set
CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL is not set
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_MHP_MEMMAP_ON_MEMORY=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
CONFIG_SPLIT_PTE_PTLOCKS=y
CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
CONFIG_SPLIT_PMD_PTLOCKS=y
CONFIG_BALLOON=y
# CONFIG_BALLOON_MIGRATION is not set
CONFIG_COMPACTION=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_PAGE_REPORTING=y
CONFIG_NUMA_MIGRATION=y
CONFIG_MIGRATION=y
CONFIG_DEVICE_MIGRATION=y
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
CONFIG_ARCH_HAS_PMD_SOFTLEAVES=y
CONFIG_CONTIG_ALLOC=y
CONFIG_PCP_BATCH_SCALE_MAX=5
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_MEMORY_FAILURE is not set
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ARCH_WANTS_THP_SWAP=y
# CONFIG_PERSISTENT_HUGE_ZERO_FOLIO is not set
CONFIG_MM_ID=y
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ADVISE=y
CONFIG_THP_SWAP=y
# CONFIG_NO_PAGE_MAPCOUNT is not set
CONFIG_PAGE_MAPCOUNT=y
CONFIG_PGTABLE_HAS_HUGE_LEAVES=y
CONFIG_HAVE_GIGANTIC_FOLIOS=y
CONFIG_ASYNC_KERNEL_PGTABLE_FREE=y
CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PUD_PFNMAP=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_CMA=y
# CONFIG_CMA_DEBUGFS is not set
# CONFIG_CMA_SYSFS is not set
CONFIG_CMA_AREAS=20
CONFIG_PAGE_BLOCK_MAX_ORDER=10
CONFIG_MEM_SOFT_DIRTY=y
CONFIG_GENERIC_EARLY_IOREMAP=y
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
CONFIG_PAGE_IDLE_FLAG=y
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y
CONFIG_ARCH_HAS_ZONE_DMA_SET=y
CONFIG_ZONE_DMA=y
CONFIG_ZONE_DMA32=y
CONFIG_ZONE_DEVICE=y
CONFIG_HMM_MIRROR=y
CONFIG_GET_FREE_REGION=y
CONFIG_DEVICE_PRIVATE=y
CONFIG_VMAP_PFN=y
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
CONFIG_ARCH_HAS_PKEYS=y
CONFIG_ARCH_USES_PG_ARCH_2=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PERCPU_STATS=y
# CONFIG_GUP_TEST is not set
# CONFIG_DMAPOOL_TEST is not set
CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_MAPPING_DIRTY_HELPERS=y
CONFIG_KMAP_LOCAL=y
CONFIG_MEMFD_CREATE=y
CONFIG_SECRETMEM=y
CONFIG_ANON_VMA_NAME=y
CONFIG_HAVE_ARCH_USERFAULTFD_WP=y
CONFIG_HAVE_ARCH_USERFAULTFD_MINOR=y
CONFIG_USERFAULTFD_RWP=y
CONFIG_USERFAULTFD=y
# CONFIG_PTE_MARKER_UFFD_WP is not set
CONFIG_LRU_GEN=y
CONFIG_LRU_GEN_ENABLED=y
# CONFIG_LRU_GEN_STATS is not set
CONFIG_LRU_GEN_WALKS_MMU=y
CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y
CONFIG_PER_VMA_LOCK=y
CONFIG_LOCK_MM_AND_FIND_VMA=y
CONFIG_IOMMU_MM_DATA=y
CONFIG_EXECMEM=y
CONFIG_NUMA_MEMBLKS=y
CONFIG_NUMA_EMU=y
CONFIG_ARCH_HAS_USER_SHADOW_STACK=y
CONFIG_PT_RECLAIM=y

#
# Data Access Monitoring
#
CONFIG_DAMON=y
# CONFIG_DAMON_DEBUG_SANITY is not set
CONFIG_DAMON_VADDR=y
CONFIG_DAMON_PADDR=y
# CONFIG_DAMON_SYSFS is not set
CONFIG_DAMON_RECLAIM=y
# CONFIG_DAMON_LRU_SORT is not set
# CONFIG_DAMON_STAT is not set
# end of Data Access Monitoring
# end of Memory Management options

CONFIG_NET=y
CONFIG_WANT_COMPAT_NETLINK_MESSAGES=y
CONFIG_COMPAT_NETLINK_MESSAGES=y
CONFIG_NET_INGRESS=y
CONFIG_NET_EGRESS=y
CONFIG_NET_XGRESS=y
CONFIG_NET_REDIRECT=y
CONFIG_SKB_DECRYPTED=y
CONFIG_SKB_EXTENSIONS=y
CONFIG_NET_DEVMEM=y
CONFIG_NET_SHAPER=y
CONFIG_NET_CRC32C=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_INET_PSP=y
CONFIG_UNIX=y
CONFIG_AF_UNIX_OOB=y
CONFIG_UNIX_DIAG=y
CONFIG_TLS=y
CONFIG_TLS_DEVICE=y
CONFIG_XFRM=y
CONFIG_XFRM_OFFLOAD=y
CONFIG_XFRM_ALGO=y
CONFIG_XFRM_USER=y
CONFIG_XFRM_USER_COMPAT=y
CONFIG_XFRM_INTERFACE=y
CONFIG_XFRM_SUB_POLICY=y
CONFIG_XFRM_MIGRATE=y
CONFIG_XFRM_STATISTICS=y
CONFIG_XFRM_AH=y
CONFIG_XFRM_ESP=y
CONFIG_XFRM_IPCOMP=y
CONFIG_NET_KEY=y
CONFIG_NET_KEY_MIGRATE=y
CONFIG_XFRM_IPTFS=y
CONFIG_XFRM_ESPINTCP=y
CONFIG_SMC=y
CONFIG_SMC_DIAG=y
# CONFIG_SMC_HS_CTRL_BPF is not set
CONFIG_DIBS=y
CONFIG_DIBS_LO=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_NET_HANDSHAKE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_FIB_TRIE_STATS=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_ROUTE_CLASSID=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IP_TUNNEL=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE_COMMON=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=y
CONFIG_NET_UDP_TUNNEL=y
CONFIG_NET_FOU=y
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_INET_AH=y
CONFIG_INET_ESP=y
CONFIG_INET_ESP_OFFLOAD=y
CONFIG_INET_ESPINTCP=y
CONFIG_INET_IPCOMP=y
CONFIG_INET_TABLE_PERTURB_ORDER=16
CONFIG_INET_XFRM_TUNNEL=y
CONFIG_INET_TUNNEL=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_INET_UDP_DIAG=y
CONFIG_INET_RAW_DIAG=y
CONFIG_INET_DIAG_DESTROY=y
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=y
CONFIG_TCP_CONG_HTCP=y
CONFIG_TCP_CONG_HSTCP=y
CONFIG_TCP_CONG_HYBLA=y
CONFIG_TCP_CONG_VEGAS=y
CONFIG_TCP_CONG_NV=y
CONFIG_TCP_CONG_SCALABLE=y
CONFIG_TCP_CONG_LP=y
CONFIG_TCP_CONG_VENO=y
CONFIG_TCP_CONG_YEAH=y
CONFIG_TCP_CONG_ILLINOIS=y
CONFIG_TCP_CONG_DCTCP=y
CONFIG_TCP_CONG_CDG=y
CONFIG_TCP_CONG_BBR=y
# CONFIG_DEFAULT_BIC is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_HTCP is not set
# CONFIG_DEFAULT_HYBLA is not set
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_VENO is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_DCTCP is not set
# CONFIG_DEFAULT_CDG is not set
# CONFIG_DEFAULT_BBR is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_AO is not set
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=y
CONFIG_INET6_ESP=y
CONFIG_INET6_ESP_OFFLOAD=y
CONFIG_INET6_ESPINTCP=y
CONFIG_INET6_IPCOMP=y
CONFIG_IPV6_MIP6=y
CONFIG_IPV6_ILA=y
CONFIG_INET6_XFRM_TUNNEL=y
CONFIG_INET6_TUNNEL=y
CONFIG_IPV6_VTI=y
CONFIG_IPV6_SIT=y
CONFIG_IPV6_SIT_6RD=y
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=y
CONFIG_IPV6_GRE=y
CONFIG_IPV6_FOU=y
CONFIG_IPV6_FOU_TUNNEL=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_IPV6_SEG6_LWTUNNEL=y
CONFIG_IPV6_SEG6_HMAC=y
CONFIG_IPV6_SEG6_BPF=y
CONFIG_IPV6_RPL_LWTUNNEL=y
# CONFIG_IPV6_IOAM6_LWTUNNEL is not set
CONFIG_NETLABEL=y
CONFIG_MPTCP=y
CONFIG_INET_MPTCP_DIAG=y
CONFIG_MPTCP_IPV6=y
CONFIG_NETWORK_SECMARK=y
CONFIG_NET_PTP_CLASSIFY=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_INGRESS=y
CONFIG_NETFILTER_EGRESS=y
CONFIG_NETFILTER_SKIP_EGRESS=y
CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_FAMILY_BRIDGE=y
CONFIG_NETFILTER_FAMILY_ARP=y
CONFIG_NETFILTER_BPF_LINK=y
# CONFIG_NETFILTER_NETLINK_HOOK is not set
CONFIG_NETFILTER_NETLINK_ACCT=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NETFILTER_NETLINK_OSF=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_LOG_SYSLOG=y
CONFIG_NETFILTER_CONNCOUNT=y
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_ZONES=y
# CONFIG_NF_CONNTRACK_PROCFS is not set
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_TIMEOUT=y
CONFIG_NF_CONNTRACK_TIMESTAMP=y
CONFIG_NF_CONNTRACK_LABELS=y
CONFIG_NF_CONNTRACK_OVS=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NF_CT_PROTO_SCTP=y
CONFIG_NF_CONNTRACK_AMANDA=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_CONNTRACK_H323=y
CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_BROADCAST=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
CONFIG_NF_CONNTRACK_SNMP=y
CONFIG_NF_CONNTRACK_PPTP=y
CONFIG_NF_CONNTRACK_SANE=y
CONFIG_NF_CONNTRACK_SIP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NF_CT_NETLINK_TIMEOUT=y
CONFIG_NF_CT_NETLINK_HELPER=y
CONFIG_NETFILTER_NETLINK_GLUE_CT=y
CONFIG_NF_NAT=y
CONFIG_NF_NAT_AMANDA=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_NAT_IRC=y
CONFIG_NF_NAT_SIP=y
CONFIG_NF_NAT_TFTP=y
CONFIG_NF_NAT_REDIRECT=y
CONFIG_NF_NAT_MASQUERADE=y
CONFIG_NF_NAT_OVS=y
CONFIG_NETFILTER_SYNPROXY=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_NUMGEN=y
CONFIG_NFT_CT=y
CONFIG_NFT_EXTHDR_DCCP=y
CONFIG_NFT_FLOW_OFFLOAD=y
CONFIG_NFT_CONNLIMIT=y
CONFIG_NFT_LOG=y
CONFIG_NFT_LIMIT=y
CONFIG_NFT_MASQ=y
CONFIG_NFT_REDIR=y
CONFIG_NFT_NAT=y
CONFIG_NFT_TUNNEL=y
CONFIG_NFT_QUEUE=y
CONFIG_NFT_QUOTA=y
CONFIG_NFT_REJECT=y
CONFIG_NFT_REJECT_INET=y
CONFIG_NFT_COMPAT=y
CONFIG_NFT_HASH=y
CONFIG_NFT_FIB=y
CONFIG_NFT_FIB_INET=y
CONFIG_NFT_XFRM=y
CONFIG_NFT_SOCKET=y
CONFIG_NFT_OSF=y
CONFIG_NFT_TPROXY=y
CONFIG_NFT_SYNPROXY=y
CONFIG_NF_DUP_NETDEV=y
CONFIG_NFT_DUP_NETDEV=y
CONFIG_NFT_FWD_NETDEV=y
CONFIG_NFT_FIB_NETDEV=y
CONFIG_NFT_REJECT_NETDEV=y
CONFIG_NF_FLOW_TABLE_INET=y
CONFIG_NF_FLOW_TABLE=y
# CONFIG_NF_FLOW_TABLE_PROCFS is not set
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XTABLES_COMPAT=y
CONFIG_NETFILTER_XTABLES_LEGACY=y

#
# Xtables combined modules
#
CONFIG_NETFILTER_XT_MARK=y
CONFIG_NETFILTER_XT_CONNMARK=y
CONFIG_NETFILTER_XT_SET=y

#
# Xtables targets
#
CONFIG_NETFILTER_XT_TARGET_AUDIT=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
CONFIG_NETFILTER_XT_TARGET_CT=y
CONFIG_NETFILTER_XT_TARGET_DSCP=y
CONFIG_NETFILTER_XT_TARGET_HL=y
CONFIG_NETFILTER_XT_TARGET_HMARK=y
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_LED=y
CONFIG_NETFILTER_XT_TARGET_LOG=y
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_NAT=y
CONFIG_NETFILTER_XT_TARGET_NETMAP=y
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
CONFIG_NETFILTER_XT_TARGET_NOTRACK=y
CONFIG_NETFILTER_XT_TARGET_RATEEST=y
CONFIG_NETFILTER_XT_TARGET_REDIRECT=y
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y
CONFIG_NETFILTER_XT_TARGET_TEE=y
CONFIG_NETFILTER_XT_TARGET_TPROXY=y
CONFIG_NETFILTER_XT_TARGET_TRACE=y
CONFIG_NETFILTER_XT_TARGET_SECMARK=y
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=y

#
# Xtables matches
#
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_NETFILTER_XT_MATCH_BPF=y
CONFIG_NETFILTER_XT_MATCH_CGROUP=y
CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=y
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
CONFIG_NETFILTER_XT_MATCH_CPU=y
CONFIG_NETFILTER_XT_MATCH_DCCP=y
CONFIG_NETFILTER_XT_MATCH_DEVGROUP=y
CONFIG_NETFILTER_XT_MATCH_DSCP=y
CONFIG_NETFILTER_XT_MATCH_ECN=y
CONFIG_NETFILTER_XT_MATCH_ESP=y
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NETFILTER_XT_MATCH_HELPER=y
CONFIG_NETFILTER_XT_MATCH_HL=y
CONFIG_NETFILTER_XT_MATCH_IPCOMP=y
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
CONFIG_NETFILTER_XT_MATCH_IPVS=y
CONFIG_NETFILTER_XT_MATCH_L2TP=y
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
CONFIG_NETFILTER_XT_MATCH_MAC=y
CONFIG_NETFILTER_XT_MATCH_MARK=y
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
CONFIG_NETFILTER_XT_MATCH_NFACCT=y
CONFIG_NETFILTER_XT_MATCH_OSF=y
CONFIG_NETFILTER_XT_MATCH_OWNER=y
CONFIG_NETFILTER_XT_MATCH_POLICY=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
CONFIG_NETFILTER_XT_MATCH_RATEEST=y
CONFIG_NETFILTER_XT_MATCH_REALM=y
CONFIG_NETFILTER_XT_MATCH_RECENT=y
CONFIG_NETFILTER_XT_MATCH_SCTP=y
CONFIG_NETFILTER_XT_MATCH_SOCKET=y
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
CONFIG_NETFILTER_XT_MATCH_STRING=y
CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
CONFIG_NETFILTER_XT_MATCH_TIME=y
CONFIG_NETFILTER_XT_MATCH_U32=y
# end of Core Netfilter Configuration

CONFIG_IP_SET=y
CONFIG_IP_SET_MAX=256
CONFIG_IP_SET_BITMAP_IP=y
CONFIG_IP_SET_BITMAP_IPMAC=y
CONFIG_IP_SET_BITMAP_PORT=y
CONFIG_IP_SET_HASH_IP=y
CONFIG_IP_SET_HASH_IPMARK=y
CONFIG_IP_SET_HASH_IPPORT=y
CONFIG_IP_SET_HASH_IPPORTIP=y
CONFIG_IP_SET_HASH_IPPORTNET=y
CONFIG_IP_SET_HASH_IPMAC=y
CONFIG_IP_SET_HASH_MAC=y
CONFIG_IP_SET_HASH_NETPORTNET=y
CONFIG_IP_SET_HASH_NET=y
CONFIG_IP_SET_HASH_NETNET=y
CONFIG_IP_SET_HASH_NETPORT=y
CONFIG_IP_SET_HASH_NETIFACE=y
CONFIG_IP_SET_LIST_SET=y
CONFIG_IP_VS=y
CONFIG_IP_VS_IPV6=y
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_PROTO_SCTP=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
CONFIG_IP_VS_LC=y
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_FO=y
CONFIG_IP_VS_OVF=y
CONFIG_IP_VS_LBLC=y
CONFIG_IP_VS_LBLCR=y
CONFIG_IP_VS_DH=y
CONFIG_IP_VS_SH=y
CONFIG_IP_VS_MH=y
CONFIG_IP_VS_SED=y
CONFIG_IP_VS_NQ=y
CONFIG_IP_VS_TWOS=y

#
# IPVS SH scheduler
#
CONFIG_IP_VS_SH_TAB_BITS=8

#
# IPVS MH scheduler
#
CONFIG_IP_VS_MH_TAB_INDEX=12

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=y
CONFIG_IP_VS_NFCT=y
CONFIG_IP_VS_PE_SIP=y

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_IP_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV4=y
CONFIG_NF_TPROXY_IPV4=y
CONFIG_NF_TABLES_IPV4=y
CONFIG_NFT_REJECT_IPV4=y
CONFIG_NFT_DUP_IPV4=y
CONFIG_NFT_FIB_IPV4=y
CONFIG_NF_TABLES_ARP=y
CONFIG_NF_DUP_IPV4=y
CONFIG_NF_LOG_ARP=y
CONFIG_NF_LOG_IPV4=y
CONFIG_NF_REJECT_IPV4=y
CONFIG_NF_NAT_SNMP_BASIC=y
CONFIG_NF_NAT_PPTP=y
CONFIG_NF_NAT_H323=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_AH=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_RPFILTER=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_SYNPROXY=y
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_TTL=y
CONFIG_IP_NF_RAW=y
CONFIG_IP_NF_SECURITY=y
CONFIG_IP_NF_ARPTABLES=y
CONFIG_NFT_COMPAT_ARP=y
CONFIG_IP_NF_ARPFILTER=y
CONFIG_IP_NF_ARP_MANGLE=y
# end of IP: Netfilter Configuration

#
# IPv6: Netfilter Configuration
#
CONFIG_IP6_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV6=y
CONFIG_NF_TPROXY_IPV6=y
CONFIG_NF_TABLES_IPV6=y
CONFIG_NFT_REJECT_IPV6=y
CONFIG_NFT_DUP_IPV6=y
CONFIG_NFT_FIB_IPV6=y
CONFIG_NF_DUP_IPV6=y
CONFIG_NF_REJECT_IPV6=y
CONFIG_NF_LOG_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
CONFIG_IP6_NF_MATCH_AH=y
CONFIG_IP6_NF_MATCH_EUI64=y
CONFIG_IP6_NF_MATCH_FRAG=y
CONFIG_IP6_NF_MATCH_OPTS=y
CONFIG_IP6_NF_MATCH_HL=y
CONFIG_IP6_NF_MATCH_IPV6HEADER=y
CONFIG_IP6_NF_MATCH_MH=y
CONFIG_IP6_NF_MATCH_RPFILTER=y
CONFIG_IP6_NF_MATCH_RT=y
CONFIG_IP6_NF_MATCH_SRH=y
CONFIG_IP6_NF_TARGET_HL=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_TARGET_SYNPROXY=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_IP6_NF_RAW=y
CONFIG_IP6_NF_SECURITY=y
CONFIG_IP6_NF_NAT=y
CONFIG_IP6_NF_TARGET_MASQUERADE=y
CONFIG_IP6_NF_TARGET_NPT=y
# end of IPv6: Netfilter Configuration

CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_TABLES_BRIDGE=y
CONFIG_NFT_BRIDGE_META=y
CONFIG_NFT_BRIDGE_REJECT=y
CONFIG_NF_CONNTRACK_BRIDGE=y
CONFIG_BRIDGE_NF_EBTABLES_LEGACY=y
CONFIG_BRIDGE_NF_EBTABLES=y
CONFIG_BRIDGE_EBT_BROUTE=y
CONFIG_BRIDGE_EBT_T_FILTER=y
CONFIG_BRIDGE_EBT_T_NAT=y
CONFIG_BRIDGE_EBT_802_3=y
CONFIG_BRIDGE_EBT_AMONG=y
CONFIG_BRIDGE_EBT_ARP=y
CONFIG_BRIDGE_EBT_IP=y
CONFIG_BRIDGE_EBT_IP6=y
CONFIG_BRIDGE_EBT_LIMIT=y
CONFIG_BRIDGE_EBT_MARK=y
CONFIG_BRIDGE_EBT_PKTTYPE=y
CONFIG_BRIDGE_EBT_STP=y
CONFIG_BRIDGE_EBT_VLAN=y
CONFIG_BRIDGE_EBT_ARPREPLY=y
CONFIG_BRIDGE_EBT_DNAT=y
CONFIG_BRIDGE_EBT_MARK_T=y
CONFIG_BRIDGE_EBT_REDIRECT=y
CONFIG_BRIDGE_EBT_SNAT=y
CONFIG_BRIDGE_EBT_LOG=y
CONFIG_BRIDGE_EBT_NFLOG=y
CONFIG_IP_SCTP=y
# CONFIG_SCTP_DBG_OBJCNT is not set
CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA256=y
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set
CONFIG_INET_SCTP_DIAG=y
CONFIG_RDS=y
CONFIG_RDS_RDMA=y
CONFIG_RDS_TCP=y
# CONFIG_RDS_DEBUG is not set
CONFIG_TIPC=y
CONFIG_TIPC_MEDIA_IB=y
CONFIG_TIPC_MEDIA_UDP=y
CONFIG_TIPC_CRYPTO=y
CONFIG_TIPC_DIAG=y
CONFIG_ATM=y
CONFIG_ATM_BR2684=y
# CONFIG_ATM_BR2684_IPFILTER is not set
CONFIG_L2TP=y
# CONFIG_L2TP_DEBUGFS is not set
CONFIG_L2TP_V3=y
CONFIG_L2TP_IP=y
CONFIG_L2TP_ETH=y
CONFIG_STP=y
CONFIG_GARP=y
CONFIG_MRP=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_IGMP_SNOOPING=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_NET_DSA=y
# CONFIG_NET_DSA_TAG_NONE is not set
# CONFIG_NET_DSA_TAG_AR9331 is not set
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
CONFIG_NET_DSA_TAG_BRCM=y
# CONFIG_NET_DSA_TAG_BRCM_LEGACY is not set
# CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS is not set
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
# CONFIG_NET_DSA_TAG_HELLCREEK is not set
# CONFIG_NET_DSA_TAG_GSWIP is not set
# CONFIG_NET_DSA_TAG_DSA is not set
# CONFIG_NET_DSA_TAG_EDSA is not set
# CONFIG_NET_DSA_TAG_MT7628 is not set
CONFIG_NET_DSA_TAG_MTK=y
# CONFIG_NET_DSA_TAG_MXL_862XX is not set
# CONFIG_NET_DSA_TAG_MXL_GSW1XX is not set
# CONFIG_NET_DSA_TAG_KSZ is not set
# CONFIG_NET_DSA_TAG_NETC is not set
# CONFIG_NET_DSA_TAG_OCELOT is not set
# CONFIG_NET_DSA_TAG_OCELOT_8021Q is not set
CONFIG_NET_DSA_TAG_QCA=y
CONFIG_NET_DSA_TAG_RTL4_A=y
# CONFIG_NET_DSA_TAG_RTL8_4 is not set
# CONFIG_NET_DSA_TAG_RZN1_A5PSW is not set
# CONFIG_NET_DSA_TAG_LAN9303 is not set
# CONFIG_NET_DSA_TAG_SJA1105 is not set
# CONFIG_NET_DSA_TAG_TRAILER is not set
# CONFIG_NET_DSA_TAG_VSC73XX_8021Q is not set
# CONFIG_NET_DSA_TAG_XRS700X is not set
# CONFIG_NET_DSA_TAG_YT921X is not set
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC=y
CONFIG_LLC2=y
CONFIG_X25=y
CONFIG_LAPB=y
CONFIG_PHONET=y
CONFIG_6LOWPAN=y
# CONFIG_6LOWPAN_DEBUGFS is not set
CONFIG_6LOWPAN_NHC=y
CONFIG_6LOWPAN_NHC_DEST=y
CONFIG_6LOWPAN_NHC_FRAGMENT=y
CONFIG_6LOWPAN_NHC_HOP=y
CONFIG_6LOWPAN_NHC_IPV6=y
CONFIG_6LOWPAN_NHC_MOBILITY=y
CONFIG_6LOWPAN_NHC_ROUTING=y
CONFIG_6LOWPAN_NHC_UDP=y
CONFIG_6LOWPAN_GHC_EXT_HDR_HOP=y
CONFIG_6LOWPAN_GHC_UDP=y
CONFIG_6LOWPAN_GHC_ICMPV6=y
CONFIG_6LOWPAN_GHC_EXT_HDR_DEST=y
CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG=y
CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE=y
CONFIG_IEEE802154=y
CONFIG_IEEE802154_NL802154_EXPERIMENTAL=y
CONFIG_IEEE802154_SOCKET=y
CONFIG_IEEE802154_6LOWPAN=y
CONFIG_MAC802154=y
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
CONFIG_NET_SCH_HTB=y
CONFIG_NET_SCH_HFSC=y
CONFIG_NET_SCH_PRIO=y
CONFIG_NET_SCH_MULTIQ=y
CONFIG_NET_SCH_RED=y
CONFIG_NET_SCH_SFB=y
CONFIG_NET_SCH_SFQ=y
CONFIG_NET_SCH_TEQL=y
CONFIG_NET_SCH_TBF=y
CONFIG_NET_SCH_CBS=y
CONFIG_NET_SCH_ETF=y
CONFIG_NET_SCH_MQPRIO_LIB=y
CONFIG_NET_SCH_TAPRIO=y
CONFIG_NET_SCH_GRED=y
CONFIG_NET_SCH_NETEM=y
CONFIG_NET_SCH_DRR=y
CONFIG_NET_SCH_MQPRIO=y
CONFIG_NET_SCH_SKBPRIO=y
CONFIG_NET_SCH_CHOKE=y
CONFIG_NET_SCH_QFQ=y
CONFIG_NET_SCH_CODEL=y
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_SCH_CAKE=y
CONFIG_NET_SCH_FQ=y
CONFIG_NET_SCH_HHF=y
CONFIG_NET_SCH_PIE=y
CONFIG_NET_SCH_FQ_PIE=y
CONFIG_NET_SCH_INGRESS=y
CONFIG_NET_SCH_PLUG=y
CONFIG_NET_SCH_ETS=y
# CONFIG_NET_SCH_DUALPI2 is not set
CONFIG_NET_SCH_DEFAULT=y
# CONFIG_DEFAULT_FQ is not set
CONFIG_DEFAULT_CODEL=y
# CONFIG_DEFAULT_FQ_CODEL is not set
# CONFIG_DEFAULT_FQ_PIE is not set
# CONFIG_DEFAULT_SFQ is not set
# CONFIG_DEFAULT_PFIFO_FAST is not set
CONFIG_DEFAULT_NET_SCH="pfifo_fast"

#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_ROUTE4=y
CONFIG_NET_CLS_FW=y
CONFIG_NET_CLS_U32=y
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_FLOW=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NET_CLS_MATCHALL=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=y
CONFIG_NET_EMATCH_NBYTE=y
CONFIG_NET_EMATCH_U32=y
CONFIG_NET_EMATCH_META=y
CONFIG_NET_EMATCH_TEXT=y
CONFIG_NET_EMATCH_CANID=y
CONFIG_NET_EMATCH_IPSET=y
CONFIG_NET_EMATCH_IPT=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=y
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_SAMPLE=y
CONFIG_NET_ACT_NAT=y
CONFIG_NET_ACT_PEDIT=y
CONFIG_NET_ACT_SIMP=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_NET_ACT_CSUM=y
CONFIG_NET_ACT_MPLS=y
CONFIG_NET_ACT_VLAN=y
CONFIG_NET_ACT_BPF=y
CONFIG_NET_ACT_CONNMARK=y
CONFIG_NET_ACT_CTINFO=y
CONFIG_NET_ACT_SKBMOD=y
CONFIG_NET_ACT_IFE=y
CONFIG_NET_ACT_TUNNEL_KEY=y
CONFIG_NET_ACT_CT=y
CONFIG_NET_ACT_GATE=y
CONFIG_NET_IFE_SKBMARK=y
CONFIG_NET_IFE_SKBPRIO=y
CONFIG_NET_IFE_SKBTCINDEX=y
CONFIG_NET_TC_SKB_EXT=y
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=y
CONFIG_BATMAN_ADV=y
CONFIG_BATMAN_ADV_BATMAN_V=y
CONFIG_BATMAN_ADV_BLA=y
CONFIG_BATMAN_ADV_DAT=y
CONFIG_BATMAN_ADV_MCAST=y
# CONFIG_BATMAN_ADV_DEBUG is not set
# CONFIG_BATMAN_ADV_TRACING is not set
CONFIG_OPENVSWITCH=y
CONFIG_VSOCKETS=y
CONFIG_VSOCKETS_DIAG=y
CONFIG_VSOCKETS_LOOPBACK=y
# CONFIG_VMWARE_VMCI_VSOCKETS is not set
CONFIG_VIRTIO_VSOCKETS=y
CONFIG_VIRTIO_VSOCKETS_COMMON=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=y
CONFIG_MPLS_IPTUNNEL=y
CONFIG_NET_NSH=y
CONFIG_HSR=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_QRTR=y
CONFIG_QRTR_TUN=y
# CONFIG_QRTR_MHI is not set
CONFIG_NET_NCSI=y
# CONFIG_NCSI_OEM_CMD_GET_MAC is not set
# CONFIG_NCSI_OEM_CMD_KEEP_PHY is not set
# CONFIG_PCPU_DEV_REFCNT is not set
CONFIG_MAX_SKB_FRAGS=17
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_XPS=y
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NET_DROP_MONITOR=y
# end of Network testing
# end of Networking options

CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
CONFIG_CAN_GW=y
CONFIG_CAN_J1939=y
CONFIG_CAN_ISOTP=y
CONFIG_BT=y
CONFIG_BT_BREDR=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
CONFIG_BT_LE=y
CONFIG_BT_LE_L2CAP_ECRED=y
CONFIG_BT_6LOWPAN=y
CONFIG_BT_LEDS=y
CONFIG_BT_MSFTEXT=y
# CONFIG_BT_AOSPEXT is not set
# CONFIG_BT_DEBUGFS is not set
# CONFIG_BT_SELFTEST is not set

#
# Bluetooth device drivers
#
CONFIG_BT_INTEL=y
CONFIG_BT_BCM=y
CONFIG_BT_RTL=y
CONFIG_BT_QCA=y
CONFIG_BT_MTK=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
CONFIG_BT_HCIBTUSB_POLL_SYNC=y
CONFIG_BT_HCIBTUSB_BCM=y
CONFIG_BT_HCIBTUSB_MTK=y
CONFIG_BT_HCIBTUSB_RTL=y
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_SERDEV=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_NOKIA is not set
CONFIG_BT_HCIUART_BCSP=y
# CONFIG_BT_HCIUART_ATH3K is not set
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
# CONFIG_BT_HCIUART_INTEL is not set
# CONFIG_BT_HCIUART_BCM is not set
# CONFIG_BT_HCIUART_RTL is not set
CONFIG_BT_HCIUART_QCA=y
CONFIG_BT_HCIUART_AG6XX=y
CONFIG_BT_HCIUART_MRVL=y
# CONFIG_BT_HCIUART_AML is not set
CONFIG_BT_HCIBCM203X=y
# CONFIG_BT_HCIBCM4377 is not set
CONFIG_BT_HCIBPA10X=y
CONFIG_BT_HCIBFUSB=y
CONFIG_BT_HCIVHCI=y
CONFIG_BT_MRVL=y
CONFIG_BT_MRVL_SDIO=y
CONFIG_BT_ATH3K=y
CONFIG_BT_MTKSDIO=y
CONFIG_BT_MTKUART=y
# CONFIG_BT_VIRTIO is not set
# CONFIG_BT_NXPUART is not set
# CONFIG_BT_INTEL_PCIE is not set
# end of Bluetooth device drivers

CONFIG_AF_RXRPC=y
CONFIG_AF_RXRPC_IPV6=y
# CONFIG_AF_RXRPC_INJECT_LOSS is not set
# CONFIG_AF_RXRPC_INJECT_RX_DELAY is not set
# CONFIG_AF_RXRPC_DEBUG is not set
CONFIG_RXKAD=y
# CONFIG_RXGK is not set
# CONFIG_RXPERF is not set
CONFIG_AF_KCM=y
CONFIG_STREAM_PARSER=y
CONFIG_MCTP=y
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=y
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y
CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
CONFIG_CFG80211_CRDA_SUPPORT=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_RFKILL_GPIO is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_FD=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_NET_9P_USBG is not set
CONFIG_NET_9P_RDMA=y
# CONFIG_NET_9P_DEBUG is not set
CONFIG_CEPH_LIB=y
# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
CONFIG_CEPH_LIB_USE_DNS_RESOLVER=y
CONFIG_NFC=y
CONFIG_NFC_DIGITAL=y
CONFIG_NFC_NCI=y
# CONFIG_NFC_NCI_SPI is not set
CONFIG_NFC_NCI_UART=y
CONFIG_NFC_HCI=y
CONFIG_NFC_SHDLC=y

#
# Near Field Communication (NFC) devices
#
# CONFIG_NFC_TRF7970A is not set
# CONFIG_NFC_MEI_PHY is not set
CONFIG_NFC_SIM=y
CONFIG_NFC_PORT100=y
CONFIG_NFC_VIRTUAL_NCI=y
CONFIG_NFC_FDP=y
# CONFIG_NFC_FDP_I2C is not set
# CONFIG_NFC_PN544_I2C is not set
CONFIG_NFC_PN533=y
CONFIG_NFC_PN533_USB=y
# CONFIG_NFC_PN533_I2C is not set
# CONFIG_NFC_PN532_UART is not set
# CONFIG_NFC_MICROREAD_I2C is not set
CONFIG_NFC_MRVL=y
CONFIG_NFC_MRVL_USB=y
# CONFIG_NFC_MRVL_UART is not set
# CONFIG_NFC_MRVL_I2C is not set
# CONFIG_NFC_ST21NFCA_I2C is not set
# CONFIG_NFC_ST_NCI_I2C is not set
# CONFIG_NFC_ST_NCI_SPI is not set
# CONFIG_NFC_NXP_NCI is not set
# CONFIG_NFC_S3FWRN5_I2C is not set
# CONFIG_NFC_S3FWRN82_UART is not set
# CONFIG_NFC_ST95HF is not set
# end of Near Field Communication (NFC) devices

CONFIG_PSAMPLE=y
CONFIG_NET_IFE=y
CONFIG_LWTUNNEL=y
CONFIG_LWTUNNEL_BPF=y
CONFIG_DST_CACHE=y
CONFIG_GRO_CELLS=y
CONFIG_SOCK_VALIDATE_XMIT=y
CONFIG_NET_SELFTESTS=y
CONFIG_NET_SOCK_MSG=y
CONFIG_NET_DEVLINK=y
CONFIG_PAGE_POOL=y
# CONFIG_PAGE_POOL_STATS is not set
CONFIG_FAILOVER=y
CONFIG_ETHTOOL_NETLINK=y

#
# Device Drivers
#
CONFIG_HAVE_PCI=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_PCIEAER=y
# CONFIG_PCIEAER_INJECT is not set
# CONFIG_PCIE_ECRC is not set
CONFIG_PCIEASPM=y
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
# CONFIG_PCIE_DPC is not set
# CONFIG_PCIE_PTM is not set
CONFIG_PCI_MSI=y
CONFIG_PCI_QUIRKS=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set
# CONFIG_PCI_STUB is not set
# CONFIG_PCI_PF_STUB is not set
CONFIG_PCI_ATS=y
# CONFIG_PCI_TSM is not set
# CONFIG_PCI_DOE is not set
CONFIG_PCI_ECAM=y
CONFIG_PCI_LOCKLESS_CONFIG=y
CONFIG_PCI_IOV=y
# CONFIG_PCI_NPEM is not set
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
# CONFIG_PCIE_TPH is not set
# CONFIG_PCI_P2PDMA is not set
CONFIG_PCI_LABEL=y
# CONFIG_PCI_DYNAMIC_OF_NODES is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_HOTPLUG_PCI=y
# CONFIG_HOTPLUG_PCI_ACPI is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_OCTEONEP is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set

#
# PCI controller drivers
#
CONFIG_PCI_HOST_COMMON=y
# CONFIG_PCI_FTPCI100 is not set
CONFIG_PCI_HOST_GENERIC=y
# CONFIG_VMD is not set
# CONFIG_PCIE_XILINX is not set

#
# Cadence-based PCIe controllers
#
# CONFIG_PCIE_CADENCE_PLAT_HOST is not set
# CONFIG_PCIE_CADENCE_PLAT_EP is not set
# end of Cadence-based PCIe controllers

#
# DesignWare-based PCIe controllers
#
# CONFIG_PCI_MESON is not set
# CONFIG_PCIE_INTEL_GW is not set
# CONFIG_PCIE_DW_PLAT_HOST is not set
# CONFIG_PCIE_DW_PLAT_EP is not set
# end of DesignWare-based PCIe controllers

#
# Mobiveil-based PCIe controllers
#
# end of Mobiveil-based PCIe controllers

#
# PLDA-based PCIe controllers
#
# CONFIG_PCIE_MICROCHIP_HOST is not set
# end of PLDA-based PCIe controllers
# end of PCI controller drivers

#
# PCI Endpoint
#
CONFIG_PCI_ENDPOINT=y
# CONFIG_PCI_ENDPOINT_CONFIGFS is not set
# CONFIG_PCI_ENDPOINT_MSI_DOORBELL is not set
# CONFIG_PCI_EPF_TEST is not set
# CONFIG_PCI_EPF_NTB is not set
# end of PCI Endpoint

#
# PCI switch controller drivers
#
# CONFIG_PCI_SW_SWITCHTEC is not set
# end of PCI switch controller drivers

# CONFIG_PCI_PWRCTRL_GENERIC is not set
# CONFIG_PCI_PWRCTRL_TC9563 is not set
# CONFIG_CXL_BUS is not set
CONFIG_PCCARD=y
CONFIG_PCMCIA=y
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_CARDBUS=y

#
# PC-card bridges
#
CONFIG_YENTA=y
CONFIG_YENTA_O2=y
CONFIG_YENTA_RICOH=y
CONFIG_YENTA_TI=y
CONFIG_YENTA_ENE_TUNE=y
CONFIG_YENTA_TOSHIBA=y
# CONFIG_PD6729 is not set
CONFIG_PCCARD_NONSTATIC=y
# CONFIG_RAPIDIO is not set
# CONFIG_PC104 is not set

#
# Generic Driver Options
#
CONFIG_AUXILIARY_BUS=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_DEVTMPFS_SAFE is not set
CONFIG_DRIVER_DEFERRED_PROBE_TIMEOUT=10
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y

#
# Firmware loader
#
CONFIG_FW_LOADER=y
# CONFIG_FW_LOADER_DEBUG is not set
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
CONFIG_FW_LOADER_COMPRESS=y
# CONFIG_FW_LOADER_COMPRESS_XZ is not set
# CONFIG_FW_LOADER_COMPRESS_ZSTD is not set
CONFIG_FW_CACHE=y
# CONFIG_FW_UPLOAD is not set
# end of Firmware loader

CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
CONFIG_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
CONFIG_DEBUG_DEVRES=y
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set
CONFIG_GENERIC_CPU_DEVICES=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGMAP_IRQ=y
CONFIG_DMA_SHARED_BUFFER=y
# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set
# end of Generic Driver Options

#
# Bus devices
#
# CONFIG_MOXTET is not set
CONFIG_MHI_BUS=y
# CONFIG_MHI_BUS_DEBUG is not set
# CONFIG_MHI_BUS_PCI_GENERIC is not set
# CONFIG_MHI_BUS_EP is not set
# end of Bus devices

CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y

#
# Firmware Drivers
#

#
# ARM System Control and Management Interface Protocol
#
# end of ARM System Control and Management Interface Protocol

# CONFIG_EDD is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# CONFIG_ISCSI_IBFT is not set
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_SYSFB=y
# CONFIG_SYSFB_SIMPLEFB is not set
CONFIG_GOOGLE_FIRMWARE=y
# CONFIG_GOOGLE_SMI is not set
# CONFIG_GOOGLE_CBMEM is not set
CONFIG_GOOGLE_COREBOOT_TABLE=y
CONFIG_GOOGLE_MEMCONSOLE=y
# CONFIG_GOOGLE_MEMCONSOLE_X86_LEGACY is not set
# CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT is not set
CONFIG_GOOGLE_MEMCONSOLE_COREBOOT=y
CONFIG_GOOGLE_VPD=y

#
# Qualcomm firmware drivers
#
# CONFIG_QCOM_PAS is not set
# CONFIG_QCOM_PAS_TEE is not set
# CONFIG_QCOM_SCM is not set
# end of Qualcomm firmware drivers

#
# Tegra firmware driver
#
# end of Tegra firmware driver
# end of Firmware Drivers

# CONFIG_FWCTL is not set
CONFIG_GNSS=y
# CONFIG_GNSS_MTK_SERIAL is not set
# CONFIG_GNSS_SIRF_SERIAL is not set
# CONFIG_GNSS_UBX_SERIAL is not set
CONFIG_GNSS_USB=y
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set

#
# Partition parsers
#
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_OF_PARTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# end of Partition parsers

#
# User Modules And Translation Layers
#
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

#
# Note that in some cases UBI block is preferred. See MTD_UBI_BLOCK.
#
CONFIG_FTL=y
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_SM_FTL is not set
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_SWAP is not set
# CONFIG_MTD_PARTITIONED_MASTER is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# end of RAM/ROM/Flash chip drivers

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PLATRAM is not set
# end of Mapping drivers for chip access

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_MCHP23K256 is not set
# CONFIG_MTD_MCHP48L640 is not set
# CONFIG_MTD_SST25L is not set
CONFIG_MTD_SLRAM=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTDRAM_TOTAL_SIZE=128
CONFIG_MTDRAM_ERASE_SIZE=4
CONFIG_MTD_BLOCK2MTD=y
# CONFIG_MTD_INTEL_DG is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOCG3 is not set
# end of Self-contained MTD device drivers

#
# NAND
#
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_RAW_NAND is not set
# CONFIG_MTD_SPI_NAND is not set

#
# ECC engine support
#
# CONFIG_MTD_NAND_ECC_SW_HAMMING is not set
# CONFIG_MTD_NAND_ECC_SW_BCH is not set
# CONFIG_MTD_NAND_ECC_MXIC is not set
# end of ECC engine support
# end of NAND

#
# LPDDR & LPDDR2 PCM memory drivers
#
# CONFIG_MTD_LPDDR is not set
# end of LPDDR & LPDDR2 PCM memory drivers

# CONFIG_MTD_SPI_NOR is not set
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_BLOCK is not set
# CONFIG_MTD_UBI_FAULT_INJECTION is not set
# CONFIG_MTD_UBI_NVMEM is not set
# CONFIG_MTD_HYPERBUS is not set
CONFIG_DTC=y
CONFIG_OF=y
# CONFIG_OF_UNITTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_KOBJ=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_RESERVED_MEM=y
# CONFIG_OF_OVERLAY is not set
CONFIG_OF_NUMA=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_PARPORT=y
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_1284 is not set
CONFIG_PARPORT_NOT_PC=y
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION=y
# CONFIG_BLK_DEV_FD is not set
CONFIG_CDROM=y
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
CONFIG_ZRAM=y
# CONFIG_ZRAM_BACKEND_LZ4 is not set
# CONFIG_ZRAM_BACKEND_LZ4HC is not set
# CONFIG_ZRAM_BACKEND_ZSTD is not set
# CONFIG_ZRAM_BACKEND_DEFLATE is not set
# CONFIG_ZRAM_BACKEND_842 is not set
CONFIG_ZRAM_BACKEND_FORCE_LZO=y
CONFIG_ZRAM_BACKEND_LZO=y
# CONFIG_ZRAM_DEF_COMP_LZORLE is not set
CONFIG_ZRAM_DEF_COMP_LZO=y
CONFIG_ZRAM_DEF_COMP="lzo"
# CONFIG_ZRAM_WRITEBACK is not set
# CONFIG_ZRAM_TRACK_ENTRY_ACTIME is not set
# CONFIG_ZRAM_MEMORY_TRACKING is not set
# CONFIG_ZRAM_MULTI_COMP is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_ATA_OVER_ETH=y
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_RBD is not set
CONFIG_BLK_DEV_UBLK=y
CONFIG_BLKDEV_UBLK_LEGACY_OPCODES=y
CONFIG_BLK_DEV_RNBD=y
CONFIG_BLK_DEV_RNBD_CLIENT=y
# CONFIG_BLK_DEV_ZONED_LOOP is not set

#
# NVME Support
#
CONFIG_NVME_CORE=y
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_MULTIPATH=y
# CONFIG_NVME_VERBOSE_ERRORS is not set
# CONFIG_NVME_HWMON is not set
CONFIG_NVME_FABRICS=y
CONFIG_NVME_RDMA=y
CONFIG_NVME_FC=y
CONFIG_NVME_TCP=y
# CONFIG_NVME_TCP_TLS is not set
# CONFIG_NVME_HOST_AUTH is not set
CONFIG_NVME_TARGET=y
# CONFIG_NVME_TARGET_DEBUGFS is not set
# CONFIG_NVME_TARGET_PASSTHRU is not set
CONFIG_NVME_TARGET_LOOP=y
CONFIG_NVME_TARGET_RDMA=y
CONFIG_NVME_TARGET_FC=y
CONFIG_NVME_TARGET_FCLOOP=y
CONFIG_NVME_TARGET_TCP=y
# CONFIG_NVME_TARGET_TCP_TLS is not set
# CONFIG_NVME_TARGET_AUTH is not set
# CONFIG_NVME_TARGET_PCI_EPF is not set
# end of NVME Support

#
# Misc devices
#
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_PHANTOM is not set
# CONFIG_RPMB is not set
# CONFIG_TI_FPC202 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_VMWARE_BALLOON is not set
# CONFIG_LATTICE_ECP3_CONFIG is not set
# CONFIG_SRAM is not set
# CONFIG_DW_XDATA_PCIE is not set
# CONFIG_PCI_ENDPOINT_TEST is not set
# CONFIG_XILINX_SDFEC is not set
CONFIG_MISC_RTSX=y
# CONFIG_OPEN_DICE is not set
# CONFIG_NTSYNC is not set
# CONFIG_VCPU_STALL_DETECTOR is not set
# CONFIG_NSM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_MAX6875 is not set
CONFIG_EEPROM_93CX6=y
# CONFIG_EEPROM_IDT_89HPESX is not set
# end of EEPROM support

# CONFIG_CB710_CORE is not set
# CONFIG_SENSORS_LIS3_I2C is not set
# CONFIG_ALTERA_STAPL is not set
CONFIG_INTEL_MEI=y
CONFIG_INTEL_MEI_ME=y
# CONFIG_INTEL_MEI_TXE is not set
# CONFIG_INTEL_MEI_GSC is not set
# CONFIG_INTEL_MEI_CSC is not set
# CONFIG_INTEL_MEI_VSC_HW is not set
# CONFIG_INTEL_MEI_HDCP is not set
# CONFIG_INTEL_MEI_PXP is not set
# CONFIG_INTEL_MEI_GSC_PROXY is not set
CONFIG_VMWARE_VMCI=y
# CONFIG_GENWQE is not set
# CONFIG_BCM_VK is not set
# CONFIG_MISC_ALCOR_PCI is not set
# CONFIG_MISC_RTSX_PCI is not set
CONFIG_MISC_RTSX_USB=y
# CONFIG_UACCE is not set
# CONFIG_PVPANIC is not set
# CONFIG_GP_PCI1XXXX is not set
# CONFIG_KEBA_CP500 is not set
# CONFIG_MISC_RP1 is not set
# CONFIG_INTEL_SSEI is not set
# end of Misc devices

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
CONFIG_RAID_ATTRS=y
CONFIG_SCSI_COMMON=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=y
CONFIG_SCSI_SAS_ATTRS=y
CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_SCSI_SAS_ATA=y
# CONFIG_SCSI_SAS_HOST_SMP is not set
CONFIG_SCSI_SRP_ATTRS=y
# end of SCSI Transports

CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
CONFIG_SCSI_HPSA=y
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_SCSI_ESAS2R is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT3SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_MPI3MR is not set
# CONFIG_SCSI_LEAPRAID is not set
# CONFIG_SCSI_SMARTPQI is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_MYRB is not set
# CONFIG_SCSI_MYRS is not set
# CONFIG_VMWARE_PVSCSI is not set
# CONFIG_LIBFC is not set
# CONFIG_SCSI_SNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_FDOMAIN_PCI is not set
# CONFIG_SCSI_ISCI is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_EFCT is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_WD719X is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_BFA_FC is not set
CONFIG_SCSI_VIRTIO=y
# CONFIG_SCSI_CHELSIO_FCOE is not set
# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
# CONFIG_SCSI_DH is not set
# end of SCSI device support

CONFIG_ATA=y
CONFIG_SATA_HOST=y
CONFIG_PATA_TIMINGS=y
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_FORCE=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
CONFIG_SATA_MOBILE_LPM_POLICY=3
# CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_AHCI_DWC is not set
# CONFIG_AHCI_CEVA is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_DWC is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
CONFIG_PATA_AMD=y
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
CONFIG_PATA_OLDPIIX=y
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
CONFIG_PATA_SCH=y
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PCMCIA is not set
# CONFIG_PATA_OF_PLATFORM is not set
# CONFIG_PATA_RZ1000 is not set

#
# Generic fallback / legacy drivers
#
# CONFIG_PATA_ACPI is not set
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_BITMAP=y
# CONFIG_MD_LLBITMAP is not set
CONFIG_MD_AUTODETECT=y
CONFIG_MD_BITMAP_FILE=y
# CONFIG_MD_LINEAR is not set
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
CONFIG_MD_RAID10=y
CONFIG_MD_RAID456=y
# CONFIG_MD_CLUSTER is not set
CONFIG_BCACHE=y
# CONFIG_BCACHE_DEBUG is not set
# CONFIG_BCACHE_ASYNC_REGISTRATION is not set
CONFIG_BLK_DEV_DM_BUILTIN=y
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
CONFIG_DM_BUFIO=y
# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set
CONFIG_DM_BIO_PRISON=y
CONFIG_DM_PERSISTENT_DATA=y
# CONFIG_DM_UNSTRIPED is not set
CONFIG_DM_CRYPT=y
# CONFIG_DM_INLINECRYPT is not set
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_THIN_PROVISIONING=y
CONFIG_DM_CACHE=y
CONFIG_DM_CACHE_SMQ=y
CONFIG_DM_WRITECACHE=y
# CONFIG_DM_EBS is not set
# CONFIG_DM_ERA is not set
CONFIG_DM_CLONE=y
CONFIG_DM_MIRROR=y
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_RAID=y
CONFIG_DM_ZERO=y
CONFIG_DM_MULTIPATH=y
CONFIG_DM_MULTIPATH_QL=y
CONFIG_DM_MULTIPATH_ST=y
# CONFIG_DM_MULTIPATH_HST is not set
# CONFIG_DM_MULTIPATH_IOA is not set
# CONFIG_DM_DELAY is not set
# CONFIG_DM_DUST is not set
# CONFIG_DM_INIT is not set
CONFIG_DM_UEVENT=y
CONFIG_DM_FLAKEY=y
CONFIG_DM_VERITY=y
# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set
CONFIG_DM_VERITY_FEC=y
# CONFIG_DM_SWITCH is not set
# CONFIG_DM_LOG_WRITES is not set
CONFIG_DM_INTEGRITY=y
CONFIG_DM_ZONED=y
CONFIG_DM_AUDIT=y
# CONFIG_DM_VDO is not set
# CONFIG_DM_PCACHE is not set
CONFIG_TARGET_CORE=y
# CONFIG_TCM_IBLOCK is not set
# CONFIG_TCM_FILEIO is not set
# CONFIG_TCM_PSCSI is not set
# CONFIG_LOOPBACK_TARGET is not set
# CONFIG_ISCSI_TARGET is not set
# CONFIG_SBP_TARGET is not set
# CONFIG_REMOTE_TARGET is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
CONFIG_FIREWIRE=y
CONFIG_FIREWIRE_OHCI=y
CONFIG_FIREWIRE_SBP2=y
CONFIG_FIREWIRE_NET=y
# CONFIG_FIREWIRE_NOSY is not set
# end of IEEE 1394 (FireWire) support

# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_WIREGUARD=y
# CONFIG_WIREGUARD_DEBUG is not set
# CONFIG_OVPN is not set
CONFIG_EQUALIZER=y
CONFIG_NET_FC=y
CONFIG_IFB=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_BROADCAST=y
CONFIG_NET_TEAM_MODE_ROUNDROBIN=y
CONFIG_NET_TEAM_MODE_RANDOM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN_L3S=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_GTP=y
# CONFIG_PFCP is not set
# CONFIG_AMT is not set
CONFIG_MACSEC=y
CONFIG_NETCONSOLE=y
# CONFIG_NETCONSOLE_DYNAMIC is not set
# CONFIG_NETCONSOLE_EXTENDED_LOG is not set
CONFIG_NETPOLL=y
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=y
CONFIG_TAP=y
CONFIG_TUN_VNET_CROSS_LE=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
# CONFIG_NETKIT is not set
CONFIG_NET_VRF=y
CONFIG_VSOCKMON=y
# CONFIG_MHI_NET is not set
# CONFIG_ARCNET is not set
CONFIG_ATM_DRIVERS=y
# CONFIG_ATM_SOLOS is not set

#
# Distributed Switch Architecture drivers
#
# CONFIG_B53 is not set
# CONFIG_NET_DSA_BCM_SF2 is not set
# CONFIG_NET_DSA_LOOP is not set
# CONFIG_NET_DSA_HIRSCHMANN_HELLCREEK is not set
# CONFIG_NET_DSA_LANTIQ_GSWIP is not set
# CONFIG_NET_DSA_MXL_GSW1XX is not set
# CONFIG_NET_DSA_MT7530 is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON is not set
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MXL862 is not set
# CONFIG_NET_DSA_AR9331 is not set
# CONFIG_NET_DSA_QCA8K is not set
# CONFIG_NET_DSA_SJA1105 is not set
# CONFIG_NET_DSA_XRS700X_I2C is not set
# CONFIG_NET_DSA_XRS700X_MDIO is not set
# CONFIG_NET_DSA_REALTEK is not set
# CONFIG_NET_DSA_KS8995 is not set
# CONFIG_NET_DSA_SMSC_LAN9303_I2C is not set
# CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_SPI is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_PLATFORM is not set
# CONFIG_NET_DSA_YT921X is not set
# end of Distributed Switch Architecture drivers

CONFIG_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
CONFIG_NET_VENDOR_ALIBABA=y
# CONFIG_ALIBABA_EEA is not set
# CONFIG_ALTERA_TSE is not set
CONFIG_NET_VENDOR_AMAZON=y
# CONFIG_ENA_ETHERNET is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
CONFIG_NET_VENDOR_ASIX=y
# CONFIG_SPI_AX88796C is not set
# CONFIG_NET_VENDOR_ATHEROS is not set
# CONFIG_CX_ECAT is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_NET_VENDOR_CORTINA is not set
CONFIG_NET_VENDOR_DAVICOM=y
# CONFIG_DM9051 is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
CONFIG_NET_VENDOR_ENGLEDER=y
# CONFIG_TSNEP is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
CONFIG_NET_VENDOR_FUNGIBLE=y
# CONFIG_FUN_ETH is not set
CONFIG_NET_VENDOR_GOOGLE=y
CONFIG_GVE=y
CONFIG_NET_VENDOR_HISILICON=y
# CONFIG_HIBMCGE is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=y
CONFIG_E1000=y
CONFIG_E1000E=y
CONFIG_E1000E_HWTS=y
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_ICE is not set
# CONFIG_FM10K is not set
# CONFIG_IGC is not set
# CONFIG_IDPF is not set
# CONFIG_IXD is not set
# CONFIG_JME is not set
# CONFIG_NET_VENDOR_ADI is not set
CONFIG_NET_VENDOR_LITEX=y
# CONFIG_LITEX_LITEETH is not set
# CONFIG_NET_VENDOR_MARVELL is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
CONFIG_MLX4_CORE=y
# CONFIG_MLX4_DEBUG is not set
# CONFIG_MLX4_CORE_GEN2 is not set
# CONFIG_MLX5_CORE is not set
# CONFIG_MLXSW_CORE is not set
# CONFIG_MLXFW is not set
CONFIG_NET_VENDOR_META=y
# CONFIG_FBNIC is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
CONFIG_NET_VENDOR_MICROSOFT=y
CONFIG_NET_VENDOR_MUCSE=y
# CONFIG_MGBE is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_FEALNX is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_ETHOC is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RDC is not set
# CONFIG_NET_VENDOR_REALTEK is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
CONFIG_NET_VENDOR_VERTEXCOM=y
# CONFIG_MSE102X is not set
# CONFIG_NET_VENDOR_VIA is not set
CONFIG_NET_VENDOR_WANGXUN=y
# CONFIG_NGBE is not set
# CONFIG_TXGBE is not set
# CONFIG_TXGBEVF is not set
# CONFIG_NGBEVF is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
# CONFIG_NET_VENDOR_XIRCOM is not set
CONFIG_NET_VENDOR_ZTE=y
# CONFIG_DINGHAI is not set
CONFIG_FDDI=y
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
CONFIG_PHYLINK=y
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
CONFIG_PHY_PACKAGE=y
# CONFIG_LED_TRIGGER_PHY is not set
CONFIG_PHYLIB_LEDS=y
CONFIG_FIXED_PHY=y
# CONFIG_SFP is not set

#
# MII PHY device drivers
#
# CONFIG_AS21XXX_PHY is not set
# CONFIG_AIR_AN8801_PHY is not set
# CONFIG_AIR_EN8811H_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_ADIN_PHY is not set
# CONFIG_ADIN1100_PHY is not set
# CONFIG_ADIN1140_PHY is not set
# CONFIG_AQUANTIA_PHY is not set
CONFIG_AX88796B_PHY=y
# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM54140_PHY is not set
# CONFIG_BCM7XXX_PHY is not set
# CONFIG_BCM84881_PHY is not set
# CONFIG_BCM87XX_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_CORTINA_PHY is not set
# CONFIG_DAP8211R_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_INTEL_XWAY_PHY is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_MARVELL_10G_PHY is not set
# CONFIG_MARVELL_88Q2XXX_PHY is not set
# CONFIG_MARVELL_88X2222_PHY is not set
# CONFIG_MAXLINEAR_GPHY is not set
# CONFIG_MAXLINEAR_86110_PHY is not set
# CONFIG_MEDIATEK_GE_PHY is not set
# CONFIG_MICREL_PHY is not set
# CONFIG_MICROCHIP_T1S_PHY is not set
CONFIG_MICROCHIP_PHY=y
# CONFIG_MICROCHIP_T1_PHY is not set
# CONFIG_MICROSEMI_PHY is not set
# CONFIG_MOTORCOMM_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_NXP_CBTX_PHY is not set
# CONFIG_NXP_C45_TJA11XX_PHY is not set
# CONFIG_NXP_TJA11XX_PHY is not set
# CONFIG_NCN26000_PHY is not set
# CONFIG_AT803X_PHY is not set
# CONFIG_QCA83XX_PHY is not set
# CONFIG_QCA808X_PHY is not set
# CONFIG_QCA807X_PHY is not set
# CONFIG_QSEMI_PHY is not set
CONFIG_REALTEK_PHY=y
# CONFIG_REALTEK_PHY_HWMON is not set
# CONFIG_RENESAS_PHY is not set
# CONFIG_ROCKCHIP_PHY is not set
CONFIG_SMSC_PHY=y
# CONFIG_STE10XP is not set
# CONFIG_TERANETICS_PHY is not set
# CONFIG_DP83822_PHY is not set
# CONFIG_DP83TC811_PHY is not set
# CONFIG_DP83848_PHY is not set
# CONFIG_DP83867_PHY is not set
# CONFIG_DP83869_PHY is not set
# CONFIG_DP83TD510_PHY is not set
# CONFIG_DP83TG720_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_XILINX_GMII2RGMII is not set
# CONFIG_PSE_CONTROLLER is not set
CONFIG_CAN_DEV=y
CONFIG_CAN_VCAN=y
CONFIG_CAN_VXCAN=y
CONFIG_CAN_NETLINK=y
CONFIG_CAN_CALC_BITTIMING=y
CONFIG_CAN_RX_OFFLOAD=y
# CONFIG_CAN_CAN327 is not set
# CONFIG_CAN_DUMMY is not set
# CONFIG_CAN_FLEXCAN is not set
# CONFIG_CAN_GRCAN is not set
# CONFIG_CAN_KVASER_PCIEFD is not set
CONFIG_CAN_SLCAN=y
# CONFIG_CAN_VIRTIO_CAN is not set
# CONFIG_CAN_C_CAN is not set
# CONFIG_CAN_CC770 is not set
# CONFIG_CAN_CTUCANFD_PCI is not set
# CONFIG_CAN_CTUCANFD_PLATFORM is not set
# CONFIG_CAN_ESD_402_PCI is not set
CONFIG_CAN_IFI_CANFD=y
# CONFIG_CAN_M_CAN is not set
# CONFIG_CAN_PEAK_PCIEFD is not set
# CONFIG_CAN_SJA1000 is not set
# CONFIG_CAN_SOFTING is not set

#
# CAN SPI interfaces
#
# CONFIG_CAN_HI311X is not set
# CONFIG_CAN_MCP251X is not set
# CONFIG_CAN_MCP251XFD is not set
# end of CAN SPI interfaces

#
# CAN USB interfaces
#
CONFIG_CAN_8DEV_USB=y
CONFIG_CAN_EMS_USB=y
CONFIG_CAN_ESD_USB=y
CONFIG_CAN_ETAS_ES58X=y
CONFIG_CAN_F81604=y
CONFIG_CAN_GS_USB=y
CONFIG_CAN_KVASER_USB=y
CONFIG_CAN_MCBA_USB=y
CONFIG_CAN_PEAK_USB=y
CONFIG_CAN_UCAN=y
# end of CAN USB interfaces

# CONFIG_CAN_DEBUG_DEVICES is not set

#
# MCTP Device Drivers
#
# CONFIG_MCTP_SERIAL is not set
# CONFIG_MCTP_TRANSPORT_I2C is not set
# CONFIG_MCTP_TRANSPORT_USBLIB is not set
# CONFIG_MCTP_TRANSPORT_USB is not set
# end of MCTP Device Drivers

#
# MDIO controller drivers
#
CONFIG_FWNODE_MDIO=y
CONFIG_OF_MDIO=y
CONFIG_ACPI_MDIO=y
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BCM_UNIMAC is not set
# CONFIG_MDIO_HISI_FEMAC is not set
CONFIG_MDIO_MVUSB=y
# CONFIG_MDIO_MSCC_MIIM is not set
# CONFIG_MDIO_OCTEON is not set
# CONFIG_MDIO_IPQ4019 is not set
# CONFIG_MDIO_IPQ8064 is not set
# CONFIG_MDIO_THUNDER is not set

#
# MDIO Multiplexers
#
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
# end of MDIO Multiplexers
# end of MDIO controller drivers

#
# PCS device drivers
#
# CONFIG_PCS_XPCS is not set
# end of PCS device drivers

# CONFIG_PLIP is not set
CONFIG_PPP=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPPOATM=y
CONFIG_PPPOX=y
CONFIG_PPPOE=y
CONFIG_PPPOE_HASH_BITS_1=y
# CONFIG_PPPOE_HASH_BITS_2 is not set
# CONFIG_PPPOE_HASH_BITS_4 is not set
# CONFIG_PPPOE_HASH_BITS_8 is not set
CONFIG_PPPOE_HASH_BITS=1
CONFIG_PPTP=y
CONFIG_PPPOL2TP=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=y
CONFIG_SLIP=y
CONFIG_SLHC=y
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_CATC=y
CONFIG_USB_KAWETH=y
CONFIG_USB_PEGASUS=y
CONFIG_USB_RTL8150=y
CONFIG_USB_RTL8152=y
CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_HUAWEI_CDC_NCM=y
CONFIG_USB_NET_CDC_MBIM=y
CONFIG_USB_NET_DM9601=y
CONFIG_USB_NET_SR9700=y
CONFIG_USB_NET_SR9800=y
CONFIG_USB_NET_SMSC75XX=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB_NET_GL620A=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
CONFIG_USB_NET_RNDIS_HOST=y
CONFIG_USB_NET_CDC_SUBSET_ENABLE=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_NET_CX82310_ETH=y
CONFIG_USB_NET_KALMIA=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_HSO=y
CONFIG_USB_NET_INT51X1=y
CONFIG_USB_CDC_PHONET=y
CONFIG_USB_IPHETH=y
CONFIG_USB_SIERRA_NET=y
CONFIG_USB_VL600=y
CONFIG_USB_NET_CH9200=y
CONFIG_USB_NET_AQC111=y
CONFIG_USB_RTL8153_ECM=y
CONFIG_WLAN=y
CONFIG_WLAN_VENDOR_ADMTEK=y
# CONFIG_ADM8211 is not set
CONFIG_ATH_COMMON=y
CONFIG_WLAN_VENDOR_ATH=y
# CONFIG_ATH_DEBUG is not set
# CONFIG_ATH5K is not set
# CONFIG_ATH5K_PCI is not set
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_COMMON_DEBUG=y
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=y
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_STATION_STATISTICS is not set
CONFIG_ATH9K_DYNACK=y
# CONFIG_ATH9K_WOW is not set
CONFIG_ATH9K_RFKILL=y
CONFIG_ATH9K_CHANNEL_CONTEXT=y
CONFIG_ATH9K_PCOEM=y
# CONFIG_ATH9K_PCI_NO_EEPROM is not set
CONFIG_ATH9K_HTC=y
CONFIG_ATH9K_HTC_DEBUGFS=y
# CONFIG_ATH9K_HWRNG is not set
CONFIG_ATH9K_COMMON_SPECTRAL=y
CONFIG_CARL9170=y
CONFIG_CARL9170_LEDS=y
# CONFIG_CARL9170_DEBUGFS is not set
CONFIG_CARL9170_WPC=y
CONFIG_CARL9170_HWRNG=y
CONFIG_ATH6KL=y
# CONFIG_ATH6KL_SDIO is not set
CONFIG_ATH6KL_USB=y
# CONFIG_ATH6KL_DEBUG is not set
# CONFIG_ATH6KL_TRACING is not set
CONFIG_AR5523=y
# CONFIG_WIL6210 is not set
CONFIG_ATH10K=y
CONFIG_ATH10K_CE=y
CONFIG_ATH10K_PCI=y
# CONFIG_ATH10K_AHB is not set
# CONFIG_ATH10K_SDIO is not set
CONFIG_ATH10K_USB=y
# CONFIG_ATH10K_DEBUG is not set
# CONFIG_ATH10K_DEBUGFS is not set
CONFIG_ATH10K_LEDS=y
# CONFIG_ATH10K_TRACING is not set
# CONFIG_WCN36XX is not set
CONFIG_ATH11K=y
# CONFIG_ATH11K_PCI is not set
# CONFIG_ATH11K_DEBUG is not set
# CONFIG_ATH11K_DEBUGFS is not set
# CONFIG_ATH11K_TRACING is not set
# CONFIG_ATH12K is not set
# CONFIG_WLAN_VENDOR_ATMEL is not set
# CONFIG_WLAN_VENDOR_BROADCOM is not set
# CONFIG_WLAN_VENDOR_INTEL is not set
# CONFIG_WLAN_VENDOR_INTERSIL is not set
# CONFIG_WLAN_VENDOR_MARVELL is not set
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
# CONFIG_WLAN_VENDOR_MICROCHIP is not set
CONFIG_WLAN_VENDOR_MORSEMICRO=y
# CONFIG_MM81X_USB is not set
# CONFIG_MM81X_SDIO is not set
CONFIG_WLAN_VENDOR_NXP=y
# CONFIG_NXPWIFI_SDIO is not set
CONFIG_WLAN_VENDOR_PURELIFI=y
CONFIG_PLFXLC=y
# CONFIG_WLAN_VENDOR_RALINK is not set
# CONFIG_WLAN_VENDOR_REALTEK is not set
# CONFIG_WLAN_VENDOR_RSI is not set
CONFIG_WLAN_VENDOR_SILABS=y
# CONFIG_WFX is not set
# CONFIG_WLAN_VENDOR_ST is not set
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WLAN_VENDOR_ZYDAS is not set
# CONFIG_WLAN_VENDOR_QUANTENNA is not set
CONFIG_MAC80211_HWSIM=y
CONFIG_VIRT_WIFI=y
CONFIG_WAN=y
CONFIG_HDLC=y
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y
CONFIG_HDLC_FR=y
CONFIG_HDLC_PPP=y
CONFIG_HDLC_X25=y
# CONFIG_FRAMER is not set
# CONFIG_PCI200SYN is not set
# CONFIG_WANXL is not set
# CONFIG_PC300TOO is not set
# CONFIG_FARSYNC is not set
CONFIG_LAPBETHER=y
CONFIG_IEEE802154_DRIVERS=y
# CONFIG_IEEE802154_FAKELB is not set
# CONFIG_IEEE802154_AT86RF230 is not set
# CONFIG_IEEE802154_MRF24J40 is not set
# CONFIG_IEEE802154_CC2520 is not set
CONFIG_IEEE802154_ATUSB=y
# CONFIG_IEEE802154_ADF7242 is not set
# CONFIG_IEEE802154_CA8210 is not set
# CONFIG_IEEE802154_MCR20A is not set
CONFIG_IEEE802154_HWSIM=y

#
# Wireless WAN
#
CONFIG_WWAN=y
# CONFIG_WWAN_DEBUGFS is not set
# CONFIG_WWAN_HWSIM is not set
CONFIG_MHI_WWAN_CTRL=y
# CONFIG_MHI_WWAN_MBIM is not set
# CONFIG_IOSM is not set
# CONFIG_MTK_T7XX is not set
# end of Wireless WAN

CONFIG_VMXNET3=y
# CONFIG_FUJITSU_ES is not set
CONFIG_USB4_NET=y
CONFIG_NETDEVSIM=y
CONFIG_NET_FAILOVER=y

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_LEDS=y
CONFIG_INPUT_FF_MEMLESS=y
CONFIG_INPUT_SPARSEKMAP=y
# CONFIG_INPUT_MATRIXKMAP is not set
CONFIG_INPUT_VIVALDIFMAP=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADC is not set
# CONFIG_KEYBOARD_ADP5588 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1050 is not set
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_DLINK_DIR685 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_CHARLIEPLEX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MPR121 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_PINEPHONE is not set
# CONFIG_KEYBOARD_SAMSUNG is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_OMAP4 is not set
# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set
# CONFIG_KEYBOARD_TWL4030 is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_CAP11XX is not set
# CONFIG_KEYBOARD_BCM is not set
# CONFIG_KEYBOARD_CYPRESS_SF is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_BYD=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_PS2_FOCALTECH=y
# CONFIG_MOUSE_PS2_VMMOUSE is not set
CONFIG_MOUSE_PS2_SMBUS=y
# CONFIG_MOUSE_SERIAL is not set
CONFIG_MOUSE_APPLETOUCH=y
CONFIG_MOUSE_BCM5974=y
# CONFIG_MOUSE_CYAPA is not set
# CONFIG_MOUSE_ELAN_I2C is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
CONFIG_MOUSE_SYNAPTICS_USB=y
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADC is not set
# CONFIG_JOYSTICK_ADI is not set
# CONFIG_JOYSTICK_COBRA is not set
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
# CONFIG_JOYSTICK_GRIP_MP is not set
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
# CONFIG_JOYSTICK_TMDC is not set
CONFIG_JOYSTICK_IFORCE=y
CONFIG_JOYSTICK_IFORCE_USB=y
# CONFIG_JOYSTICK_IFORCE_232 is not set
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
# CONFIG_JOYSTICK_STINGER is not set
# CONFIG_JOYSTICK_TWIDJOY is not set
# CONFIG_JOYSTICK_ZHENHUA is not set
# CONFIG_JOYSTICK_DB9 is not set
# CONFIG_JOYSTICK_GAMECON is not set
# CONFIG_JOYSTICK_TURBOGRAFX is not set
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
# CONFIG_JOYSTICK_WALKERA0701 is not set
# CONFIG_JOYSTICK_PSXPAD_SPI is not set
CONFIG_JOYSTICK_PXRC=y
# CONFIG_JOYSTICK_QWIIC is not set
# CONFIG_JOYSTICK_FSIA6B is not set
# CONFIG_JOYSTICK_SENSEHAT is not set
# CONFIG_JOYSTICK_SEESAW is not set
CONFIG_INPUT_TABLET=y
CONFIG_TABLET_USB_ACECAD=y
CONFIG_TABLET_USB_AIPTEK=y
CONFIG_TABLET_USB_HANWANG=y
CONFIG_TABLET_USB_KBTAB=y
CONFIG_TABLET_USB_PEGASUS=y
# CONFIG_TABLET_SERIAL_WACOM4 is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
# CONFIG_TOUCHSCREEN_ADC is not set
# CONFIG_TOUCHSCREEN_AR1021_I2C is not set
# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
# CONFIG_TOUCHSCREEN_BU21013 is not set
# CONFIG_TOUCHSCREEN_BU21029 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8505 is not set
# CONFIG_TOUCHSCREEN_CY8CTMA140 is not set
# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
# CONFIG_TOUCHSCREEN_CYTTSP5 is not set
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_EGALAX is not set
# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set
# CONFIG_TOUCHSCREEN_EXC3000 is not set
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_GOODIX is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI is not set
# CONFIG_TOUCHSCREEN_HIDEEP is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX852X is not set
# CONFIG_TOUCHSCREEN_HYCON_HY46XX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CST816X is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_ILITEK is not set
# CONFIG_TOUCHSCREEN_S6SY761 is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_EKTF2127 is not set
# CONFIG_TOUCHSCREEN_ELAN is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
# CONFIG_TOUCHSCREEN_WACOM_W9000 is not set
# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MMS114 is not set
# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set
# CONFIG_TOUCHSCREEN_MSG2638 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_NOVATEK_NVT_TS is not set
# CONFIG_TOUCHSCREEN_IMAGIS is not set
# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_PIXCIR is not set
# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
CONFIG_TOUCHSCREEN_USB_PANJIT=y
CONFIG_TOUCHSCREEN_USB_3M=y
CONFIG_TOUCHSCREEN_USB_ITM=y
CONFIG_TOUCHSCREEN_USB_ETURBO=y
CONFIG_TOUCHSCREEN_USB_GUNZE=y
CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y
CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
CONFIG_TOUCHSCREEN_USB_IDEALTEK=y
CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
CONFIG_TOUCHSCREEN_USB_GOTOP=y
CONFIG_TOUCHSCREEN_USB_JASTEC=y
CONFIG_TOUCHSCREEN_USB_ELO=y
CONFIG_TOUCHSCREEN_USB_E2I=y
CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_USB_NEXIO=y
CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC_SERIO is not set
# CONFIG_TOUCHSCREEN_TSC2004 is not set
# CONFIG_TOUCHSCREEN_TSC2005 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
# CONFIG_TOUCHSCREEN_RM_TS is not set
# CONFIG_TOUCHSCREEN_SILEAD is not set
# CONFIG_TOUCHSCREEN_SIS_I2C is not set
# CONFIG_TOUCHSCREEN_ST1232 is not set
# CONFIG_TOUCHSCREEN_STMFTS is not set
CONFIG_TOUCHSCREEN_SUR40=y
# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set
# CONFIG_TOUCHSCREEN_SX8654 is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
# CONFIG_TOUCHSCREEN_ZET6223 is not set
# CONFIG_TOUCHSCREEN_ZFORCE is not set
# CONFIG_TOUCHSCREEN_COLIBRI_VF50 is not set
# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set
# CONFIG_TOUCHSCREEN_IQS5XX is not set
# CONFIG_TOUCHSCREEN_IQS7211 is not set
# CONFIG_TOUCHSCREEN_ZINITIX is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX83112B is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
# CONFIG_INPUT_AW86927 is not set
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_E3X0_BUTTON is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_MMA8450 is not set
# CONFIG_INPUT_APANEL is not set
# CONFIG_INPUT_GPIO_BEEPER is not set
# CONFIG_INPUT_GPIO_DECODER is not set
# CONFIG_INPUT_GPIO_VIBRA is not set
# CONFIG_INPUT_ATLAS_BTNS is not set
CONFIG_INPUT_ATI_REMOTE2=y
CONFIG_INPUT_KEYSPAN_REMOTE=y
# CONFIG_INPUT_KXTJ9 is not set
CONFIG_INPUT_POWERMATE=y
CONFIG_INPUT_YEALINK=y
CONFIG_INPUT_CM109=y
# CONFIG_INPUT_REGULATOR_HAPTIC is not set
# CONFIG_INPUT_RETU_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_VIBRA is not set
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_INPUT_DA7280_HAPTICS is not set
# CONFIG_INPUT_ADXL34X is not set
# CONFIG_INPUT_IBM_PANEL is not set
CONFIG_INPUT_IMS_PCU=y
# CONFIG_INPUT_IQS269A is not set
# CONFIG_INPUT_IQS626A is not set
# CONFIG_INPUT_IQS7222 is not set
# CONFIG_INPUT_ISA1200_HAPTIC is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set
# CONFIG_INPUT_AMD_SFH_TABLETMODE is not set
# CONFIG_INPUT_DRV260X_HAPTICS is not set
# CONFIG_INPUT_DRV2665_HAPTICS is not set
# CONFIG_INPUT_DRV2667_HAPTICS is not set
CONFIG_RMI4_CORE=y
# CONFIG_RMI4_I2C is not set
# CONFIG_RMI4_SPI is not set
# CONFIG_RMI4_SMB is not set
CONFIG_RMI4_F03=y
CONFIG_RMI4_F03_SERIO=y
CONFIG_RMI4_2D_SENSOR=y
CONFIG_RMI4_F11=y
CONFIG_RMI4_F12=y
# CONFIG_RMI4_F1A is not set
# CONFIG_RMI4_F21 is not set
CONFIG_RMI4_F30=y
# CONFIG_RMI4_F34 is not set
CONFIG_RMI4_F3A=y
# CONFIG_RMI4_F54 is not set
# CONFIG_RMI4_F55 is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_SERIO_APBPS2 is not set
# CONFIG_SERIO_GPIO_PS2 is not set
CONFIG_USERIO=y
# CONFIG_GAMEPORT is not set
# end of Hardware I/O ports
# end of Input device support

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
CONFIG_LEGACY_TIOCSTI=y
CONFIG_LDISC_AUTOLOAD=y

#
# Serial drivers
#
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_PNP=y
# CONFIG_SERIAL_8250_16550A_VARIANTS is not set
# CONFIG_SERIAL_8250_FINTEK is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCILIB=y
CONFIG_SERIAL_8250_PCI=y
# CONFIG_SERIAL_8250_EXAR is not set
CONFIG_SERIAL_8250_MOXA_PCIE=y
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_MANY_PORTS=y
# CONFIG_SERIAL_8250_PCI1XXXX is not set
# CONFIG_SERIAL_8250_DW is not set
# CONFIG_SERIAL_8250_RT288X is not set
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
CONFIG_SERIAL_8250_PERICOM=y
# CONFIG_SERIAL_8250_NI is not set
# CONFIG_SERIAL_OF_PLATFORM is not set
CONFIG_SERIAL_8250_DWLIB=y

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SERIAL_SIFIVE is not set
# CONFIG_SERIAL_LANTIQ is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_SERIAL_FSL_LINFLEXUART is not set
# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
# CONFIG_SERIAL_SPRD is not set
# end of Serial drivers

CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_MOXA_INTELLIO is not set
# CONFIG_MOXA_SMARTIO is not set
CONFIG_N_HDLC=y
CONFIG_N_GSM=y
CONFIG_NOZOMI=y
CONFIG_NULL_TTY=y
CONFIG_HVC_DRIVER=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_TTY_PRINTK_LEVEL=6
# CONFIG_PRINTER is not set
# CONFIG_PPDEV is not set
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
# CONFIG_SSIF_IPMI_BMC is not set
# CONFIG_IPMB_DEVICE_INTERFACE is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_BA431 is not set
# CONFIG_HW_RANDOM_VIA is not set
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_HW_RANDOM_CCTRNG is not set
# CONFIG_HW_RANDOM_XIPHERA is not set
# CONFIG_DEVMEM is not set
CONFIG_NVRAM=y
# CONFIG_DEVPORT is not set
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_HPET_MMAP_DEFAULT=y
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_TPM2_HMAC is not set
# CONFIG_HW_RANDOM_TPM is not set
CONFIG_TCG_TIS_CORE=y
CONFIG_TCG_TIS=y
# CONFIG_TCG_TIS_SPI is not set
# CONFIG_TCG_TIS_I2C is not set
# CONFIG_TCG_TIS_I2C_CR50 is not set
# CONFIG_TCG_TIS_I2C_ATMEL is not set
# CONFIG_TCG_TIS_I2C_INFINEON is not set
# CONFIG_TCG_TIS_I2C_NUVOTON is not set
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
CONFIG_TCG_CRB=y
# CONFIG_TCG_VTPM_PROXY is not set
# CONFIG_TCG_TIS_ST33ZP24_I2C is not set
# CONFIG_TCG_TIS_ST33ZP24_SPI is not set
# CONFIG_TELCLOCK is not set
CONFIG_XILLYBUS_CLASS=y
# CONFIG_XILLYBUS is not set
CONFIG_XILLYUSB=y
# end of Character devices

#
# I2C support
#
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y

#
# Multiplexer I2C Chip support
#
# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set
# CONFIG_I2C_MUX_GPIO is not set
# CONFIG_I2C_MUX_GPMUX is not set
# CONFIG_I2C_MUX_LTC4306 is not set
# CONFIG_I2C_MUX_PCA9541 is not set
# CONFIG_I2C_MUX_PCA954x is not set
CONFIG_I2C_MUX_REG=y
# CONFIG_I2C_MUX_MLXCPLD is not set
# end of Multiplexer I2C Chip support

CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=y
CONFIG_I2C_ALGOBIT=y

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_AMD_MP2 is not set
CONFIG_I2C_I801=y
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_ISMT is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_CHT_WC is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_NVIDIA_GPU is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_I2C_ZHAOXIN is not set

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_CBUS_GPIO is not set
CONFIG_I2C_DESIGNWARE_CORE=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
# CONFIG_I2C_DESIGNWARE_BAYTRAIL is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EMEV2 is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_RK3X is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_DIOLAN_U2C=y
CONFIG_I2C_DLN2=y
CONFIG_I2C_LJCA=y
CONFIG_I2C_CP2615=y
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PCI1XXXX is not set
CONFIG_I2C_ROBOTFUZZ_OSIF=y
# CONFIG_I2C_TAOS_EVM is not set
CONFIG_I2C_TINY_USB=y
CONFIG_I2C_VIPERBOARD=y

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_MLXCPLD is not set
# CONFIG_I2C_VIRTIO is not set
# end of I2C Hardware Bus support

# CONFIG_I2C_STUB is not set
CONFIG_I2C_SLAVE=y
CONFIG_I2C_SLAVE_EEPROM=y
# CONFIG_I2C_SLAVE_TESTUNIT is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# end of I2C support

# CONFIG_I3C is not set
CONFIG_I3C_OR_I2C=y
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
# CONFIG_SPI_MEM is not set

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AXI_SPI_ENGINE is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_CADENCE_QUADSPI is not set
# CONFIG_SPI_CH341 is not set
# CONFIG_SPI_DESIGNWARE is not set
CONFIG_SPI_DLN2=y
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_FSL_SPI is not set
CONFIG_SPI_LJCA=y
# CONFIG_SPI_MICROCHIP_CORE_QSPI is not set
# CONFIG_SPI_MICROCHIP_CORE_SPI is not set
# CONFIG_SPI_LANTIQ_SSC is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PCI1XXXX is not set
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_SIFIVE is not set
# CONFIG_SPI_MXIC is not set
# CONFIG_SPI_VIRTIO is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set

#
# SPI Multiplexer support
#
# CONFIG_SPI_MUX is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_LOOPBACK_TEST is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_SPI_SLAVE is not set
CONFIG_SPI_DYNAMIC=y
# CONFIG_SPMI is not set
# CONFIG_HSI is not set
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_PARPORT is not set
# CONFIG_PPS_CLIENT_GPIO is not set
# CONFIG_PPS_GENERATOR is not set

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_PTP_1588_CLOCK_KVM=y
CONFIG_PTP_1588_CLOCK_VMCLOCK=y
# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set
# CONFIG_PTP_1588_CLOCK_IDTCM is not set
# CONFIG_PTP_1588_CLOCK_FC3W is not set
# CONFIG_PTP_1588_CLOCK_MOCK is not set
# CONFIG_PTP_1588_CLOCK_VMW is not set
# CONFIG_PTP_1588_CLOCK_OCP is not set
# CONFIG_PTP_NETC_V4_TIMER is not set
# end of PTP clock support

#
# DPLL device support
#
# CONFIG_ZL3073X_I2C is not set
# CONFIG_ZL3073X_SPI is not set
# end of DPLL device support

# CONFIG_PINCTRL is not set
CONFIG_GPIOLIB_LEGACY=y
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
CONFIG_OF_GPIO=y
CONFIG_GPIO_ACPI=y
CONFIG_GPIOLIB_IRQCHIP=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
# CONFIG_GPIO_CDEV is not set

#
# Memory mapped GPIO drivers
#
# CONFIG_GPIO_74XX_MMIO is not set
# CONFIG_GPIO_ALTERA is not set
# CONFIG_GPIO_AMDPT is not set
# CONFIG_GPIO_BY_PINCTRL is not set
# CONFIG_GPIO_CADENCE is not set
# CONFIG_GPIO_DWAPB is not set
# CONFIG_GPIO_FTGPIO010 is not set
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_GRANITERAPIDS is not set
# CONFIG_GPIO_GRGPIO is not set
# CONFIG_GPIO_HLWD is not set
# CONFIG_GPIO_ICH is not set
# CONFIG_GPIO_LOGICVC is not set
# CONFIG_GPIO_MB86S7X is not set
# CONFIG_GPIO_POLARFIRE_SOC is not set
# CONFIG_GPIO_SIFIVE is not set
# CONFIG_GPIO_SYSCON is not set
# CONFIG_GPIO_WAVESHARE_DSI_TOUCH is not set
# CONFIG_GPIO_XILINX is not set
# CONFIG_GPIO_AMD_FCH is not set
# end of Memory mapped GPIO drivers

#
# Port-mapped I/O GPIO drivers
#
# CONFIG_GPIO_VX855 is not set
# CONFIG_GPIO_F7188X is not set
# CONFIG_GPIO_IT87 is not set
# CONFIG_GPIO_NOVALAKE is not set
# CONFIG_GPIO_SCH311X is not set
# CONFIG_GPIO_WINBOND is not set
# CONFIG_GPIO_WS16C48 is not set
# end of Port-mapped I/O GPIO drivers

#
# I2C GPIO expanders
#
# CONFIG_GPIO_ADNP is not set
# CONFIG_GPIO_FXL6408 is not set
# CONFIG_GPIO_DS4520 is not set
# CONFIG_GPIO_GW_PLD is not set
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCA9570 is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_TPIC2810 is not set
# end of I2C GPIO expanders

#
# MFD GPIO expanders
#
CONFIG_GPIO_DLN2=y
CONFIG_GPIO_LJCA=y
# CONFIG_GPIO_TWL4030 is not set
# CONFIG_GPIO_WHISKEY_COVE is not set
# end of MFD GPIO expanders

#
# Auxiliary Bus GPIO drivers
#
# end of Auxiliary Bus GPIO drivers

#
# PCI GPIO expanders
#
# CONFIG_GPIO_AMD8111 is not set
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_PCI_IDIO_16 is not set
# CONFIG_GPIO_PCIE_IDIO_24 is not set
# CONFIG_GPIO_RDC321X is not set
# CONFIG_GPIO_SODAVILLE is not set
# end of PCI GPIO expanders

#
# SPI GPIO expanders
#
# CONFIG_GPIO_74X164 is not set
# CONFIG_GPIO_MAX3191X is not set
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_PISOSR is not set
# CONFIG_GPIO_XRA1403 is not set
# end of SPI GPIO expanders

#
# USB GPIO expanders
#
CONFIG_GPIO_VIPERBOARD=y
# CONFIG_GPIO_MPSSE is not set
# end of USB GPIO expanders

#
# Virtual GPIO drivers
#
# CONFIG_GPIO_AGGREGATOR is not set
# CONFIG_GPIO_LATCH is not set
# CONFIG_GPIO_LINE_MUX is not set
# CONFIG_GPIO_MOCKUP is not set
# CONFIG_GPIO_VIRTIO is not set
# CONFIG_GPIO_SIM is not set
# end of Virtual GPIO drivers

#
# GPIO Debugging utilities
#
# CONFIG_GPIO_SLOPPY_LOGIC_ANALYZER is not set
# CONFIG_GPIO_VIRTUSER is not set
# end of GPIO Debugging utilities

# CONFIG_W1 is not set
# CONFIG_POWER_RESET is not set
# CONFIG_POWER_SEQUENCING is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_POWER_SUPPLY_HWMON=y
# CONFIG_GENERIC_ADC_BATTERY is not set
# CONFIG_IP5XXX_POWER is not set
# CONFIG_TEST_POWER is not set
# CONFIG_CHARGER_ADP5061 is not set
# CONFIG_BATTERY_CHAGALL is not set
# CONFIG_BATTERY_CW2015 is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_SAMSUNG_SDI is not set
# CONFIG_BATTERY_S2MU005 is not set
# CONFIG_BATTERY_SBS is not set
# CONFIG_CHARGER_SBS is not set
# CONFIG_MANAGER_SBS is not set
# CONFIG_BATTERY_BQ27XXX is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
# CONFIG_BATTERY_MAX1720X is not set
CONFIG_CHARGER_ISP1704=y
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_TWL4030 is not set
# CONFIG_CHARGER_TWL6030 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
# CONFIG_CHARGER_MANAGER is not set
# CONFIG_CHARGER_LT3651 is not set
# CONFIG_CHARGER_LTC4162L is not set
# CONFIG_CHARGER_DETECTOR_MAX14656 is not set
# CONFIG_CHARGER_MAX77976 is not set
# CONFIG_CHARGER_MAX8971 is not set
# CONFIG_CHARGER_MT6360 is not set
# CONFIG_CHARGER_MT6370 is not set
# CONFIG_CHARGER_BQ2415X is not set
CONFIG_CHARGER_BQ24190=y
# CONFIG_CHARGER_BQ24257 is not set
# CONFIG_CHARGER_BQ24735 is not set
# CONFIG_CHARGER_BQ2515X is not set
# CONFIG_CHARGER_BQ25890 is not set
# CONFIG_CHARGER_BQ25980 is not set
# CONFIG_CHARGER_BQ25630 is not set
# CONFIG_CHARGER_BQ256XX is not set
# CONFIG_CHARGER_SGM41542 is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_BATTERY_GAUGE_LTC2941 is not set
# CONFIG_BATTERY_GOLDFISH is not set
# CONFIG_BATTERY_RT5033 is not set
# CONFIG_CHARGER_RT9455 is not set
# CONFIG_CHARGER_RT9467 is not set
# CONFIG_CHARGER_RT9471 is not set
# CONFIG_CHARGER_RT9756 is not set
# CONFIG_FUEL_GAUGE_STC3117 is not set
# CONFIG_CHARGER_UCS1002 is not set
# CONFIG_CHARGER_BD99954 is not set
# CONFIG_BATTERY_SURFACE is not set
# CONFIG_CHARGER_SURFACE is not set
# CONFIG_BATTERY_UG3105 is not set
# CONFIG_BATTERY_CHARGER_SURFACE_RT is not set
# CONFIG_FUEL_GAUGE_MM8013 is not set
CONFIG_HWMON=y
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
# CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM1177 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7310 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_AHT10 is not set
CONFIG_SENSORS_AQUACOMPUTER_D5NEXT=y
# CONFIG_SENSORS_AS370 is not set
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set
# CONFIG_SENSORS_AXI_FAN_CONTROL is not set
# CONFIG_SENSORS_K8TEMP is not set
# CONFIG_SENSORS_K10TEMP is not set
# CONFIG_SENSORS_KB9002 is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_APPLESMC is not set
# CONFIG_SENSORS_ARCTIC_FAN_CONTROLLER is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_CHIPCAP2 is not set
CONFIG_SENSORS_CORSAIR_CPRO=y
CONFIG_SENSORS_CORSAIR_PSU=y
# CONFIG_SENSORS_DRIVETEMP is not set
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_DELL_SMM is not set
# CONFIG_SENSORS_I5K_AMB is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_FSCHMD is not set
# CONFIG_SENSORS_FTSTEUTATES is not set
CONFIG_SENSORS_GIGABYTE_WATERFORCE=y
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_GPD is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_SENSORS_HIH6130 is not set
# CONFIG_SENSORS_HS3001 is not set
# CONFIG_SENSORS_HTU31 is not set
# CONFIG_SENSORS_IIO_HWMON is not set
# CONFIG_SENSORS_I5500 is not set
# CONFIG_SENSORS_CORETEMP is not set
# CONFIG_SENSORS_ISL28022 is not set
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_JC42 is not set
CONFIG_SENSORS_POWERZ=y
# CONFIG_SENSORS_POWR1220 is not set
# CONFIG_SENSORS_PROM21_XHCI is not set
# CONFIG_SENSORS_LATTEPANDA_SIGMA_EC is not set
# CONFIG_SENSORS_LENOVO_EC is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LTC2945 is not set
# CONFIG_SENSORS_LTC2947_I2C is not set
# CONFIG_SENSORS_LTC2947_SPI is not set
# CONFIG_SENSORS_LTC2990 is not set
# CONFIG_SENSORS_LTC2991 is not set
# CONFIG_SENSORS_LTC2992 is not set
# CONFIG_SENSORS_LTC4151 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4222 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LTC4260 is not set
# CONFIG_SENSORS_LTC4261 is not set
# CONFIG_SENSORS_LTC4282 is not set
# CONFIG_SENSORS_LTC4283 is not set
# CONFIG_SENSORS_MAX1111 is not set
# CONFIG_SENSORS_MAX127 is not set
# CONFIG_SENSORS_MAX16065 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX31722 is not set
# CONFIG_SENSORS_MAX31730 is not set
# CONFIG_SENSORS_MAX31760 is not set
# CONFIG_MAX31827 is not set
# CONFIG_SENSORS_MAX6620 is not set
# CONFIG_SENSORS_MAX6621 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_MC34VR500 is not set
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_MCP9982 is not set
# CONFIG_SENSORS_TC654 is not set
# CONFIG_SENSORS_TPS23861 is not set
# CONFIG_SENSORS_MR75203 is not set
# CONFIG_SENSORS_ADCXX is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM70 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LM95234 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_LM95245 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
# CONFIG_SENSORS_NCT6683 is not set
# CONFIG_SENSORS_NCT6775 is not set
# CONFIG_SENSORS_NCT6775_I2C is not set
# CONFIG_SENSORS_NCT7363 is not set
# CONFIG_SENSORS_NCT7802 is not set
# CONFIG_SENSORS_NCT7904 is not set
# CONFIG_SENSORS_NPCM7XX is not set
CONFIG_SENSORS_NZXT_KRAKEN2=y
# CONFIG_SENSORS_NZXT_KRAKEN3 is not set
CONFIG_SENSORS_NZXT_SMART2=y
# CONFIG_SENSORS_OCC_P8_I2C is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_PT5161L is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SHT3x is not set
# CONFIG_SENSORS_SHT4x is not set
# CONFIG_SENSORS_SHTC1 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC1812 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC2305 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH5627 is not set
# CONFIG_SENSORS_SCH5636 is not set
# CONFIG_SENSORS_STTS751 is not set
# CONFIG_SENSORS_SURFACE_FAN is not set
# CONFIG_SENSORS_SURFACE_TEMP is not set
# CONFIG_SENSORS_ADC128D818 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
# CONFIG_SENSORS_INA238 is not set
# CONFIG_SENSORS_INA3221 is not set
# CONFIG_SENSORS_SPD5118 is not set
# CONFIG_SENSORS_TC74 is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
# CONFIG_SENSORS_TMP103 is not set
# CONFIG_SENSORS_TMP108 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_TMP464 is not set
# CONFIG_SENSORS_TMP513 is not set
# CONFIG_SENSORS_TSC1641 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83773G is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_XGENE is not set
# CONFIG_SENSORS_YOGAFAN is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
# CONFIG_SENSORS_ASUS_WMI is not set
# CONFIG_SENSORS_ASUS_EC is not set
# CONFIG_SENSORS_HP_WMI is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_NETLINK=y
# CONFIG_THERMAL_STATISTICS is not set
# CONFIG_THERMAL_DEBUGFS is not set
# CONFIG_THERMAL_CORE_TESTING is not set
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
CONFIG_THERMAL_HWMON=y
# CONFIG_THERMAL_OF is not set
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
# CONFIG_THERMAL_GOV_BANG_BANG is not set
# CONFIG_THERMAL_GOV_USER_SPACE is not set
# CONFIG_PCIE_THERMAL is not set
# CONFIG_THERMAL_EMULATION is not set
# CONFIG_THERMAL_MMIO is not set

#
# Intel thermal drivers
#
# CONFIG_INTEL_POWERCLAMP is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_X86_PKG_TEMP_THERMAL is not set
# CONFIG_INTEL_SOC_DTS_THERMAL is not set

#
# ACPI INT340X thermal drivers
#
# CONFIG_INT340X_THERMAL is not set
# end of ACPI INT340X thermal drivers

# CONFIG_INTEL_BXT_PMIC_THERMAL is not set
# CONFIG_INTEL_PCH_THERMAL is not set
# CONFIG_INTEL_TCC_COOLING is not set
# CONFIG_INTEL_HFI_THERMAL is not set
# end of Intel thermal drivers

# CONFIG_GENERIC_ADC_THERMAL is not set
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_CORE is not set
# CONFIG_WATCHDOG_NOWAYOUT is not set
CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y
CONFIG_WATCHDOG_OPEN_TIMEOUT=0
# CONFIG_WATCHDOG_SYSFS is not set
# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set

#
# Watchdog Pretimeout Governors
#

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_GPIO_WATCHDOG is not set
# CONFIG_LENOVO_SE10_WDT is not set
# CONFIG_LENOVO_SE30_WDT is not set
# CONFIG_LENOVO_SE30G2_SE60_WDT is not set
# CONFIG_WDAT_WDT is not set
# CONFIG_XILINX_WATCHDOG is not set
# CONFIG_ZIIRAVE_WATCHDOG is not set
# CONFIG_CADENCE_WATCHDOG is not set
# CONFIG_DW_WATCHDOG is not set
# CONFIG_TWL4030_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_RETU_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
# CONFIG_ADVANTECH_WDT is not set
# CONFIG_ADVANTECH_EC_WDT is not set
# CONFIG_ALIM1535_WDT is not set
# CONFIG_ALIM7101_WDT is not set
# CONFIG_EBC_C384_WDT is not set
# CONFIG_EXAR_WDT is not set
# CONFIG_F71808E_WDT is not set
# CONFIG_SP5100_TCO is not set
# CONFIG_SBC_FITPC2_WATCHDOG is not set
# CONFIG_EUROTECH_WDT is not set
# CONFIG_IB700_WDT is not set
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_IE6XX_WDT is not set
# CONFIG_INTEL_OC_WATCHDOG is not set
# CONFIG_ITCO_WDT is not set
# CONFIG_IT8712F_WDT is not set
# CONFIG_IT87_WDT is not set
# CONFIG_HP_WATCHDOG is not set
# CONFIG_SC1200_WDT is not set
# CONFIG_PC87413_WDT is not set
# CONFIG_NV_TCO is not set
# CONFIG_60XX_WDT is not set
# CONFIG_SMSC_SCH311X_WDT is not set
# CONFIG_SMSC37B787_WDT is not set
# CONFIG_TQMX86_WDT is not set
# CONFIG_VIA_WDT is not set
# CONFIG_W83627HF_WDT is not set
# CONFIG_W83877F_WDT is not set
# CONFIG_W83977F_WDT is not set
# CONFIG_SBC_EPX_C3_WATCHDOG is not set
# CONFIG_INTEL_MEI_WDT is not set
# CONFIG_NI903X_WDT is not set
# CONFIG_NIC7018_WDT is not set
# CONFIG_MEN_A21_WDT is not set

#
# PCI-based Watchdog Cards
#
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
CONFIG_USBPCWATCHDOG=y
CONFIG_SSB_POSSIBLE=y
CONFIG_SSB=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
# CONFIG_SSB_PCIHOST is not set
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
# CONFIG_SSB_SDIOHOST is not set
# CONFIG_SSB_DRIVER_GPIO is not set
CONFIG_BCMA_POSSIBLE=y
CONFIG_BCMA=y
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
# CONFIG_BCMA_HOST_PCI is not set
# CONFIG_BCMA_HOST_SOC is not set
# CONFIG_BCMA_DRIVER_PCI is not set
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DRIVER_GPIO is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_ADP5585 is not set
# CONFIG_MFD_ACT8945A is not set
# CONFIG_MFD_AS3711 is not set
# CONFIG_MFD_SMPRO is not set
# CONFIG_MFD_AS3722 is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_AAT2870_CORE is not set
# CONFIG_MFD_ATMEL_FLEXCOM is not set
# CONFIG_MFD_ATMEL_HLCDC is not set
# CONFIG_MFD_BCM590XX is not set
# CONFIG_MFD_BD9571MWV is not set
# CONFIG_MFD_AXP20X_I2C is not set
# CONFIG_MFD_CGBC is not set
# CONFIG_MFD_CS40L50_I2C is not set
# CONFIG_MFD_CS40L50_SPI is not set
# CONFIG_MFD_CS42L43_I2C is not set
# CONFIG_MFD_CS42L43_SDW is not set
# CONFIG_MFD_LOCHNAGAR is not set
# CONFIG_MFD_MADERA is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9062 is not set
# CONFIG_MFD_DA9063 is not set
# CONFIG_MFD_DA9150 is not set
CONFIG_MFD_DLN2=y
# CONFIG_MFD_GATEWORKS_GSC is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_MFD_MP2629 is not set
# CONFIG_MFD_PF1550 is not set
# CONFIG_MFD_HI6421_PMIC is not set
# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set
CONFIG_LPC_ICH=y
# CONFIG_LPC_SCH is not set
# CONFIG_INTEL_SOC_PMIC is not set
CONFIG_INTEL_SOC_PMIC_BXTWC=y
CONFIG_INTEL_SOC_PMIC_CHTWC=y
# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set
# CONFIG_MFD_INTEL_LPSS_ACPI is not set
# CONFIG_MFD_INTEL_LPSS_PCI is not set
CONFIG_MFD_INTEL_PMC_BXT=y
# CONFIG_MFD_IQS62X is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_88PM886_PMIC is not set
# CONFIG_MFD_MAX5970 is not set
# CONFIG_MFD_MAX14577 is not set
# CONFIG_MFD_MAX77541 is not set
# CONFIG_MFD_MAX77620 is not set
# CONFIG_MFD_MAX77650 is not set
# CONFIG_MFD_MAX77686 is not set
# CONFIG_MFD_MAX77693 is not set
# CONFIG_MFD_MAX77705 is not set
# CONFIG_MFD_MAX77714 is not set
# CONFIG_MFD_MAX77759 is not set
# CONFIG_MFD_MAX77843 is not set
# CONFIG_MFD_MAX8907 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
CONFIG_MFD_MT6360=y
CONFIG_MFD_MT6370=y
# CONFIG_MFD_MT6397 is not set
# CONFIG_MFD_MENF21BMC is not set
# CONFIG_MFD_NCT6694 is not set
# CONFIG_MFD_OCELOT is not set
# CONFIG_MFD_CPCAP is not set
CONFIG_MFD_VIPERBOARD=y
# CONFIG_MFD_NTXEC is not set
CONFIG_MFD_RETU=y
# CONFIG_MFD_SY7636A is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RT4831 is not set
# CONFIG_MFD_RT5033 is not set
# CONFIG_MFD_RT5120 is not set
# CONFIG_MFD_RC5T583 is not set
# CONFIG_MFD_RK8XX_I2C is not set
# CONFIG_MFD_RK8XX_SPI is not set
# CONFIG_MFD_RN5T618 is not set
# CONFIG_MFD_SEC_I2C is not set
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SKY81452 is not set
# CONFIG_MFD_STMPE is not set
CONFIG_MFD_SYSCON=y
# CONFIG_MFD_LP3943 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_TI_LMU is not set
# CONFIG_MFD_BQ257XX is not set
# CONFIG_MFD_PALMAS is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65086 is not set
# CONFIG_MFD_TPS65090 is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TI_LP873X is not set
# CONFIG_MFD_TI_LP87565 is not set
# CONFIG_MFD_TPS65218 is not set
# CONFIG_MFD_TPS65219 is not set
# CONFIG_MFD_TPS6586X is not set
# CONFIG_MFD_TPS65910 is not set
# CONFIG_MFD_TPS65912_I2C is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TPS6594_I2C is not set
# CONFIG_MFD_TPS6594_SPI is not set
CONFIG_TWL4030_CORE=y
# CONFIG_MFD_TWL4030_AUDIO is not set
# CONFIG_TWL6040_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TQMX86 is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X_I2C is not set
# CONFIG_MFD_WM831X_SPI is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_WM8994 is not set
# CONFIG_MFD_ROHM_BD718XX is not set
# CONFIG_MFD_ROHM_BD71828 is not set
# CONFIG_MFD_ROHM_BD957XMUF is not set
# CONFIG_MFD_ROHM_BD96801 is not set
# CONFIG_MFD_STPMIC1 is not set
# CONFIG_MFD_STMFX is not set
# CONFIG_MFD_ATC260X_I2C is not set
# CONFIG_MFD_QCOM_PM8008 is not set
# CONFIG_RAVE_SP_CORE is not set
# CONFIG_MFD_INTEL_M10_BMC_SPI is not set
# CONFIG_MFD_QNAP_MCU is not set
# CONFIG_MFD_RSMU_I2C is not set
# CONFIG_MFD_RSMU_SPI is not set
# CONFIG_MFD_UPBOARD_FPGA is not set
# CONFIG_MFD_MAX7360 is not set
# end of Multifunction device drivers

CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_NETLINK_EVENTS is not set
# CONFIG_REGULATOR_88PG86X is not set
# CONFIG_REGULATOR_ACT8865 is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_ADP5055 is not set
# CONFIG_REGULATOR_AW37503 is not set
# CONFIG_REGULATOR_DA9121 is not set
# CONFIG_REGULATOR_DA9210 is not set
# CONFIG_REGULATOR_DA9211 is not set
# CONFIG_REGULATOR_FAN53555 is not set
# CONFIG_REGULATOR_FAN53880 is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_ISL9305 is not set
# CONFIG_REGULATOR_ISL6271A is not set
# CONFIG_REGULATOR_FP9931 is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
# CONFIG_REGULATOR_LP872X is not set
# CONFIG_REGULATOR_LP8755 is not set
# CONFIG_REGULATOR_LTC3589 is not set
# CONFIG_REGULATOR_LTC3676 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX77503 is not set
# CONFIG_REGULATOR_MAX77675 is not set
# CONFIG_REGULATOR_MAX77857 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8893 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX20086 is not set
# CONFIG_REGULATOR_MAX20411 is not set
# CONFIG_REGULATOR_MAX77826 is not set
# CONFIG_REGULATOR_MAX77838 is not set
# CONFIG_REGULATOR_MCP16502 is not set
# CONFIG_REGULATOR_MP5416 is not set
# CONFIG_REGULATOR_MP8859 is not set
# CONFIG_REGULATOR_MP886X is not set
# CONFIG_REGULATOR_MPQ7920 is not set
# CONFIG_REGULATOR_MT6311 is not set
# CONFIG_REGULATOR_MT6360 is not set
# CONFIG_REGULATOR_MT6370 is not set
# CONFIG_REGULATOR_PCA9450 is not set
# CONFIG_REGULATOR_PF9453 is not set
# CONFIG_REGULATOR_PF0900 is not set
# CONFIG_REGULATOR_PF530X is not set
# CONFIG_REGULATOR_PF8X00 is not set
# CONFIG_REGULATOR_PFUZE100 is not set
# CONFIG_REGULATOR_PV88060 is not set
# CONFIG_REGULATOR_PV88080 is not set
# CONFIG_REGULATOR_PV88090 is not set
# CONFIG_REGULATOR_RAA215300 is not set
# CONFIG_REGULATOR_RT4801 is not set
# CONFIG_REGULATOR_RT4803 is not set
# CONFIG_REGULATOR_RT5133 is not set
# CONFIG_REGULATOR_RT5190A is not set
# CONFIG_REGULATOR_RT5739 is not set
# CONFIG_REGULATOR_RT5759 is not set
# CONFIG_REGULATOR_RT6160 is not set
# CONFIG_REGULATOR_RT6190 is not set
# CONFIG_REGULATOR_RT6245 is not set
# CONFIG_REGULATOR_RT8092 is not set
# CONFIG_REGULATOR_RTQ2134 is not set
# CONFIG_REGULATOR_RTMV20 is not set
# CONFIG_REGULATOR_RTQ6752 is not set
# CONFIG_REGULATOR_RTQ2208 is not set
# CONFIG_REGULATOR_SGM3804 is not set
# CONFIG_REGULATOR_SLG51000 is not set
# CONFIG_REGULATOR_SY8106A is not set
# CONFIG_REGULATOR_SY8824X is not set
# CONFIG_REGULATOR_SY8827N is not set
# CONFIG_REGULATOR_TPS51632 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS6286X is not set
# CONFIG_REGULATOR_TPS6287X is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS65132 is not set
# CONFIG_REGULATOR_TPS65185 is not set
# CONFIG_REGULATOR_TPS6524X is not set
CONFIG_REGULATOR_TWL4030=y
# CONFIG_REGULATOR_VCTRL is not set
CONFIG_RC_CORE=y
# CONFIG_LIRC is not set
# CONFIG_RC_MAP is not set
# CONFIG_RC_DECODERS is not set
CONFIG_RC_DEVICES=y
# CONFIG_IR_ENE is not set
# CONFIG_IR_FINTEK is not set
# CONFIG_IR_GPIO_CIR is not set
# CONFIG_IR_HIX5HD2 is not set
CONFIG_IR_IGORPLUGUSB=y
CONFIG_IR_IGUANA=y
CONFIG_IR_IMON=y
CONFIG_IR_IMON_RAW=y
# CONFIG_IR_ITE_CIR is not set
CONFIG_IR_MCEUSB=y
# CONFIG_IR_NUVOTON is not set
CONFIG_IR_REDRAT3=y
# CONFIG_IR_SERIAL is not set
CONFIG_IR_STREAMZAP=y
CONFIG_IR_TOY=y
CONFIG_IR_TTUSBIR=y
# CONFIG_IR_WINBOND_CIR is not set
CONFIG_RC_ATI_REMOTE=y
# CONFIG_RC_LOOPBACK is not set
CONFIG_RC_XBOX_DVD=y
CONFIG_CEC_CORE=y

#
# CEC support
#
# CONFIG_MEDIA_CEC_RC is not set
CONFIG_MEDIA_CEC_SUPPORT=y
# CONFIG_CEC_CH7322 is not set
# CONFIG_CEC_NXP_TDA9950 is not set
# CONFIG_CEC_GPIO is not set
# CONFIG_CEC_SECO is not set
# CONFIG_USB_EXTRON_DA_HD_4K_PLUS_CEC is not set
CONFIG_USB_PULSE8_CEC=y
CONFIG_USB_RAINSHADOW_CEC=y
# end of CEC support

CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_SUPPORT_FILTER=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set

#
# Media device types
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_SDR_SUPPORT=y
CONFIG_MEDIA_PLATFORM_SUPPORT=y
CONFIG_MEDIA_TEST_SUPPORT=y
# end of Media device types

CONFIG_VIDEO_DEV=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_DVB_CORE=y

#
# Video4Linux options
#
CONFIG_VIDEO_V4L2_I2C=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_TUNER=y
CONFIG_V4L2_MEM2MEM_DEV=y
# end of Video4Linux options

#
# Media controller options
#
CONFIG_MEDIA_CONTROLLER_DVB=y
# end of Media controller options

#
# Digital TV options
#
# CONFIG_DVB_MMAP is not set
# CONFIG_DVB_NET is not set
CONFIG_DVB_MAX_ADAPTERS=16
# CONFIG_DVB_DYNAMIC_MINORS is not set
# CONFIG_DVB_DEMUX_SECTION_LOSS_LOG is not set
# CONFIG_DVB_ULE_DEBUG is not set
# end of Digital TV options

#
# Media drivers
#

#
# Drivers filtered as selected at 'Filter media drivers'
#

#
# Media drivers
#
CONFIG_MEDIA_USB_SUPPORT=y

#
# Webcam devices
#
CONFIG_USB_GSPCA=y
CONFIG_USB_GSPCA_BENQ=y
CONFIG_USB_GSPCA_CONEX=y
CONFIG_USB_GSPCA_CPIA1=y
CONFIG_USB_GSPCA_DTCS033=y
CONFIG_USB_GSPCA_ETOMS=y
CONFIG_USB_GSPCA_FINEPIX=y
CONFIG_USB_GSPCA_JEILINJ=y
CONFIG_USB_GSPCA_JL2005BCD=y
CONFIG_USB_GSPCA_KINECT=y
CONFIG_USB_GSPCA_KONICA=y
CONFIG_USB_GSPCA_MARS=y
CONFIG_USB_GSPCA_MR97310A=y
CONFIG_USB_GSPCA_NW80X=y
CONFIG_USB_GSPCA_OV519=y
CONFIG_USB_GSPCA_OV534=y
CONFIG_USB_GSPCA_OV534_9=y
CONFIG_USB_GSPCA_PAC207=y
CONFIG_USB_GSPCA_PAC7302=y
CONFIG_USB_GSPCA_PAC7311=y
CONFIG_USB_GSPCA_SE401=y
CONFIG_USB_GSPCA_SN9C2028=y
CONFIG_USB_GSPCA_SN9C20X=y
CONFIG_USB_GSPCA_SONIXB=y
CONFIG_USB_GSPCA_SONIXJ=y
CONFIG_USB_GSPCA_SPCA1528=y
CONFIG_USB_GSPCA_SPCA500=y
CONFIG_USB_GSPCA_SPCA501=y
CONFIG_USB_GSPCA_SPCA505=y
CONFIG_USB_GSPCA_SPCA506=y
CONFIG_USB_GSPCA_SPCA508=y
CONFIG_USB_GSPCA_SPCA561=y
CONFIG_USB_GSPCA_SQ905=y
CONFIG_USB_GSPCA_SQ905C=y
CONFIG_USB_GSPCA_SQ930X=y
CONFIG_USB_GSPCA_STK014=y
CONFIG_USB_GSPCA_STK1135=y
CONFIG_USB_GSPCA_STV0680=y
CONFIG_USB_GSPCA_SUNPLUS=y
CONFIG_USB_GSPCA_T613=y
CONFIG_USB_GSPCA_TOPRO=y
CONFIG_USB_GSPCA_TOUPTEK=y
CONFIG_USB_GSPCA_TV8532=y
CONFIG_USB_GSPCA_VC032X=y
CONFIG_USB_GSPCA_VICAM=y
CONFIG_USB_GSPCA_XIRLINK_CIT=y
CONFIG_USB_GSPCA_ZC3XX=y
CONFIG_USB_GL860=y
CONFIG_USB_M5602=y
CONFIG_USB_STV06XX=y
CONFIG_USB_PWC=y
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_S2255=y
CONFIG_VIDEO_USBTV=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

#
# Analog TV USB devices
#
CONFIG_VIDEO_GO7007=y
CONFIG_VIDEO_GO7007_USB=y
CONFIG_VIDEO_GO7007_LOADER=y
CONFIG_VIDEO_GO7007_USB_S2250_BOARD=y
CONFIG_VIDEO_HDPVR=y
CONFIG_VIDEO_PVRUSB2=y
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_VIDEO_PVRUSB2_DVB=y
# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
CONFIG_VIDEO_STK1160=y

#
# Analog/digital TV USB devices
#
CONFIG_VIDEO_AU0828=y
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_AU0828_RC=y
CONFIG_VIDEO_CX231XX=y
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=y
CONFIG_VIDEO_CX231XX_DVB=y

#
# Digital TV USB devices
#
CONFIG_DVB_AS102=y
CONFIG_DVB_B2C2_FLEXCOP_USB=y
# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set
CONFIG_DVB_USB_V2=y
CONFIG_DVB_USB_AF9015=y
CONFIG_DVB_USB_AF9035=y
CONFIG_DVB_USB_ANYSEE=y
CONFIG_DVB_USB_AU6610=y
CONFIG_DVB_USB_AZ6007=y
CONFIG_DVB_USB_CE6230=y
CONFIG_DVB_USB_DVBSKY=y
CONFIG_DVB_USB_EC168=y
CONFIG_DVB_USB_GL861=y
CONFIG_DVB_USB_LME2510=y
CONFIG_DVB_USB_MXL111SF=y
CONFIG_DVB_USB_RTL28XXU=y
CONFIG_DVB_USB_ZD1301=y
CONFIG_DVB_USB=y
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=y
CONFIG_DVB_USB_AF9005=y
CONFIG_DVB_USB_AF9005_REMOTE=y
CONFIG_DVB_USB_AZ6027=y
CONFIG_DVB_USB_CINERGY_T2=y
CONFIG_DVB_USB_CXUSB=y
CONFIG_DVB_USB_CXUSB_ANALOG=y
CONFIG_DVB_USB_DIB0700=y
CONFIG_DVB_USB_DIB3000MC=y
CONFIG_DVB_USB_DIBUSB_MB=y
# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
CONFIG_DVB_USB_DIBUSB_MC=y
CONFIG_DVB_USB_DIGITV=y
CONFIG_DVB_USB_DTT200U=y
CONFIG_DVB_USB_DTV5100=y
CONFIG_DVB_USB_DW2102=y
CONFIG_DVB_USB_GP8PSK=y
CONFIG_DVB_USB_M920X=y
CONFIG_DVB_USB_NOVA_T_USB2=y
CONFIG_DVB_USB_OPERA1=y
CONFIG_DVB_USB_PCTV452E=y
CONFIG_DVB_USB_TECHNISAT_USB2=y
CONFIG_DVB_USB_TTUSB2=y
CONFIG_DVB_USB_UMT_010=y
CONFIG_DVB_USB_VP702X=y
CONFIG_DVB_USB_VP7045=y
CONFIG_SMS_USB_DRV=y
CONFIG_DVB_TTUSB_BUDGET=y
CONFIG_DVB_TTUSB_DEC=y

#
# Webcam, TV (analog/digital) USB devices
#
CONFIG_VIDEO_EM28XX=y
CONFIG_VIDEO_EM28XX_V4L2=y
CONFIG_VIDEO_EM28XX_ALSA=y
CONFIG_VIDEO_EM28XX_DVB=y
CONFIG_VIDEO_EM28XX_RC=y

#
# Software defined radio USB devices
#
CONFIG_USB_AIRSPY=y
CONFIG_USB_HACKRF=y
CONFIG_USB_MSI2500=y
# CONFIG_MEDIA_PCI_SUPPORT is not set
CONFIG_RADIO_ADAPTERS=y
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_SAA7706H is not set
CONFIG_RADIO_SHARK=y
CONFIG_RADIO_SHARK2=y
CONFIG_RADIO_SI4713=y
CONFIG_RADIO_TEA575X=y
# CONFIG_RADIO_TEA5764 is not set
# CONFIG_RADIO_TEF6862 is not set
CONFIG_USB_DSBR=y
CONFIG_USB_KEENE=y
CONFIG_USB_MA901=y
CONFIG_USB_MR800=y
CONFIG_USB_RAREMONO=y
CONFIG_RADIO_SI470X=y
CONFIG_USB_SI470X=y
# CONFIG_I2C_SI470X is not set
CONFIG_USB_SI4713=y
# CONFIG_PLATFORM_SI4713 is not set
CONFIG_I2C_SI4713=y
# CONFIG_MEDIA_PLATFORM_DRIVERS is not set

#
# MMC/SDIO DVB adapters
#
CONFIG_SMS_SDIO_DRV=y
CONFIG_V4L_TEST_DRIVERS=y
CONFIG_VIDEO_VIM2M=y
CONFIG_VIDEO_VICODEC=y
CONFIG_VIDEO_VIMC=y
CONFIG_VIDEO_VIVID=y
CONFIG_VIDEO_VIVID_CEC=y
# CONFIG_VIDEO_VIVID_OSD is not set
CONFIG_VIDEO_VIVID_MAX_DEVS=64
# CONFIG_VIDEO_VISL is not set
CONFIG_DVB_TEST_DRIVERS=y
CONFIG_DVB_VIDTV=y

#
# FireWire (IEEE 1394) Adapters
#
# CONFIG_DVB_FIREDTV is not set
CONFIG_MEDIA_COMMON_OPTIONS=y

#
# common driver options
#
CONFIG_CYPRESS_FIRMWARE=y
CONFIG_TTPCI_EEPROM=y
CONFIG_UVC_COMMON=y
CONFIG_VIDEO_CX2341X=y
CONFIG_VIDEO_TVEEPROM=y
CONFIG_DVB_B2C2_FLEXCOP=y
CONFIG_SMS_SIANO_MDTV=y
CONFIG_SMS_SIANO_RC=y
CONFIG_SMS_SIANO_DEBUGFS=y
CONFIG_VIDEO_V4L2_TPG=y
CONFIG_VIDEOBUF2_CORE=y
CONFIG_VIDEOBUF2_V4L2=y
CONFIG_VIDEOBUF2_MEMOPS=y
CONFIG_VIDEOBUF2_DMA_CONTIG=y
CONFIG_VIDEOBUF2_VMALLOC=y
CONFIG_VIDEOBUF2_DMA_SG=y
# end of Media drivers

#
# Media ancillary drivers
#
CONFIG_MEDIA_ATTACH=y
# CONFIG_VIDEO_IR_I2C is not set
# CONFIG_VIDEO_CAMERA_SENSOR is not set

#
# Camera ISPs
#
# CONFIG_VIDEO_THP7312 is not set
# end of Camera ISPs

# CONFIG_VIDEO_CAMERA_LENS is not set

#
# Flash devices
#
# CONFIG_VIDEO_ADP1653 is not set
# CONFIG_VIDEO_LM3560 is not set
# CONFIG_VIDEO_LM3646 is not set
# end of Flash devices

#
# Audio decoders, processors and mixers
#
# CONFIG_VIDEO_CS3308 is not set
# CONFIG_VIDEO_CS5345 is not set
CONFIG_VIDEO_CS53L32A=y
CONFIG_VIDEO_MSP3400=y
# CONFIG_VIDEO_SONY_BTF_MPX is not set
# CONFIG_VIDEO_TDA1997X is not set
# CONFIG_VIDEO_TDA7432 is not set
# CONFIG_VIDEO_TDA9840 is not set
# CONFIG_VIDEO_TEA6415C is not set
# CONFIG_VIDEO_TEA6420 is not set
# CONFIG_VIDEO_TLV320AIC23B is not set
# CONFIG_VIDEO_TVAUDIO is not set
# CONFIG_VIDEO_UDA1342 is not set
# CONFIG_VIDEO_VP27SMPX is not set
# CONFIG_VIDEO_WM8739 is not set
CONFIG_VIDEO_WM8775=y
# end of Audio decoders, processors and mixers

#
# RDS decoders
#
# CONFIG_VIDEO_SAA6588 is not set
# end of RDS decoders

#
# Video decoders
#
# CONFIG_VIDEO_ADV7180 is not set
# CONFIG_VIDEO_ADV7183 is not set
# CONFIG_VIDEO_ADV748X is not set
# CONFIG_VIDEO_ADV7604 is not set
# CONFIG_VIDEO_ADV7842 is not set
# CONFIG_VIDEO_BT819 is not set
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_ISL7998X is not set
# CONFIG_VIDEO_LT6911UXE is not set
# CONFIG_VIDEO_KS0127 is not set
# CONFIG_VIDEO_MAX9286 is not set
# CONFIG_VIDEO_ML86V7667 is not set
# CONFIG_VIDEO_SAA7110 is not set
CONFIG_VIDEO_SAA711X=y
# CONFIG_VIDEO_TC358743 is not set
# CONFIG_VIDEO_TC358746 is not set
# CONFIG_VIDEO_TVP514X is not set
# CONFIG_VIDEO_TVP5150 is not set
# CONFIG_VIDEO_TVP7002 is not set
# CONFIG_VIDEO_TW2804 is not set
# CONFIG_VIDEO_TW9900 is not set
# CONFIG_VIDEO_TW9903 is not set
# CONFIG_VIDEO_TW9906 is not set
# CONFIG_VIDEO_TW9910 is not set
# CONFIG_VIDEO_VPX3220 is not set

#
# Video and audio decoders
#
# CONFIG_VIDEO_SAA717X is not set
CONFIG_VIDEO_CX25840=y
# end of Video decoders

#
# Video encoders
#
# CONFIG_VIDEO_ADV7170 is not set
# CONFIG_VIDEO_ADV7175 is not set
# CONFIG_VIDEO_ADV7343 is not set
# CONFIG_VIDEO_ADV7393 is not set
# CONFIG_VIDEO_ADV7511 is not set
# CONFIG_VIDEO_AK881X is not set
# CONFIG_VIDEO_SAA7127 is not set
# CONFIG_VIDEO_SAA7185 is not set
# CONFIG_VIDEO_THS8200 is not set
# end of Video encoders

#
# Video improvement chips
#
# CONFIG_VIDEO_UPD64031A is not set
# CONFIG_VIDEO_UPD64083 is not set
# end of Video improvement chips

#
# Audio/Video compression chips
#
# CONFIG_VIDEO_SAA6752HS is not set
# end of Audio/Video compression chips

#
# SDR tuner chips
#
# CONFIG_SDR_MAX2175 is not set
# end of SDR tuner chips

#
# Miscellaneous helper chips
#
# CONFIG_VIDEO_INTEL_CVS is not set
# CONFIG_VIDEO_I2C is not set
# CONFIG_VIDEO_M52790 is not set
# CONFIG_VIDEO_ST_MIPID02 is not set
# CONFIG_VIDEO_THS7303 is not set
# end of Miscellaneous helper chips

#
# Video serializers and deserializers
#
# CONFIG_VIDEO_DS90UB913 is not set
# CONFIG_VIDEO_DS90UB953 is not set
# CONFIG_VIDEO_DS90UB960 is not set
# CONFIG_VIDEO_MAX96714 is not set
# CONFIG_VIDEO_MAX96717 is not set
# end of Video serializers and deserializers

#
# Media SPI Adapters
#
# CONFIG_CXD2880_SPI_DRV is not set
# CONFIG_VIDEO_GS1662 is not set
# end of Media SPI Adapters

CONFIG_MEDIA_TUNER=y

#
# Customize TV tuners
#
# CONFIG_MEDIA_TUNER_E4000 is not set
# CONFIG_MEDIA_TUNER_FC0011 is not set
# CONFIG_MEDIA_TUNER_FC0012 is not set
# CONFIG_MEDIA_TUNER_FC0013 is not set
# CONFIG_MEDIA_TUNER_FC2580 is not set
# CONFIG_MEDIA_TUNER_IT913X is not set
# CONFIG_MEDIA_TUNER_M88RS6000T is not set
# CONFIG_MEDIA_TUNER_MAX2165 is not set
# CONFIG_MEDIA_TUNER_MC44S803 is not set
CONFIG_MEDIA_TUNER_MSI001=y
# CONFIG_MEDIA_TUNER_MT2060 is not set
# CONFIG_MEDIA_TUNER_MT2063 is not set
# CONFIG_MEDIA_TUNER_MT20XX is not set
# CONFIG_MEDIA_TUNER_MT2131 is not set
# CONFIG_MEDIA_TUNER_MT2266 is not set
# CONFIG_MEDIA_TUNER_MXL301RF is not set
# CONFIG_MEDIA_TUNER_MXL5005S is not set
# CONFIG_MEDIA_TUNER_MXL5007T is not set
# CONFIG_MEDIA_TUNER_QM1D1B0004 is not set
# CONFIG_MEDIA_TUNER_QM1D1C0042 is not set
# CONFIG_MEDIA_TUNER_QT1010 is not set
# CONFIG_MEDIA_TUNER_R820T is not set
# CONFIG_MEDIA_TUNER_SI2157 is not set
# CONFIG_MEDIA_TUNER_SIMPLE is not set
# CONFIG_MEDIA_TUNER_TDA18212 is not set
# CONFIG_MEDIA_TUNER_TDA18218 is not set
# CONFIG_MEDIA_TUNER_TDA18250 is not set
# CONFIG_MEDIA_TUNER_TDA18271 is not set
# CONFIG_MEDIA_TUNER_TDA827X is not set
# CONFIG_MEDIA_TUNER_TDA8290 is not set
# CONFIG_MEDIA_TUNER_TDA9887 is not set
# CONFIG_MEDIA_TUNER_TEA5761 is not set
# CONFIG_MEDIA_TUNER_TEA5767 is not set
# CONFIG_MEDIA_TUNER_TUA9001 is not set
# CONFIG_MEDIA_TUNER_XC2028 is not set
# CONFIG_MEDIA_TUNER_XC4000 is not set
# CONFIG_MEDIA_TUNER_XC5000 is not set
# end of Customize TV tuners

#
# Customise DVB Frontends
#

#
# Multistandard (satellite) frontends
#
# CONFIG_DVB_M88DS3103 is not set
# CONFIG_DVB_MXL5XX is not set
# CONFIG_DVB_STB0899 is not set
# CONFIG_DVB_STB6100 is not set
# CONFIG_DVB_STV090x is not set
# CONFIG_DVB_STV0910 is not set
# CONFIG_DVB_STV6110x is not set
# CONFIG_DVB_STV6111 is not set

#
# Multistandard (cable + terrestrial) frontends
#
# CONFIG_DVB_DRXK is not set
# CONFIG_DVB_MN88472 is not set
# CONFIG_DVB_MN88473 is not set
# CONFIG_DVB_SI2165 is not set
# CONFIG_DVB_TDA18271C2DD is not set

#
# DVB-S (satellite) frontends
#
# CONFIG_DVB_CX24110 is not set
# CONFIG_DVB_CX24116 is not set
# CONFIG_DVB_CX24117 is not set
# CONFIG_DVB_CX24120 is not set
# CONFIG_DVB_CX24123 is not set
# CONFIG_DVB_DS3000 is not set
# CONFIG_DVB_MB86A16 is not set
# CONFIG_DVB_MT312 is not set
# CONFIG_DVB_S5H1420 is not set
# CONFIG_DVB_SI21XX is not set
# CONFIG_DVB_STB6000 is not set
# CONFIG_DVB_STV0288 is not set
# CONFIG_DVB_STV0299 is not set
# CONFIG_DVB_STV0900 is not set
# CONFIG_DVB_STV6110 is not set
# CONFIG_DVB_TDA10071 is not set
# CONFIG_DVB_TDA10086 is not set
# CONFIG_DVB_TDA8083 is not set
# CONFIG_DVB_TDA8261 is not set
# CONFIG_DVB_TDA826X is not set
# CONFIG_DVB_TS2020 is not set
# CONFIG_DVB_TUA6100 is not set
# CONFIG_DVB_TUNER_CX24113 is not set
# CONFIG_DVB_TUNER_ITD1000 is not set
# CONFIG_DVB_VES1X93 is not set
# CONFIG_DVB_ZL10036 is not set
# CONFIG_DVB_ZL10039 is not set

#
# DVB-T (terrestrial) frontends
#
CONFIG_DVB_AF9013=y
CONFIG_DVB_AS102_FE=y
# CONFIG_DVB_CX22700 is not set
# CONFIG_DVB_CX22702 is not set
# CONFIG_DVB_CXD2820R is not set
# CONFIG_DVB_CXD2841ER is not set
CONFIG_DVB_DIB3000MB=y
CONFIG_DVB_DIB3000MC=y
# CONFIG_DVB_DIB7000M is not set
# CONFIG_DVB_DIB7000P is not set
# CONFIG_DVB_DIB9000 is not set
# CONFIG_DVB_DRXD is not set
CONFIG_DVB_EC100=y
CONFIG_DVB_GP8PSK_FE=y
# CONFIG_DVB_L64781 is not set
# CONFIG_DVB_MT352 is not set
# CONFIG_DVB_NXT6000 is not set
CONFIG_DVB_RTL2830=y
CONFIG_DVB_RTL2832=y
CONFIG_DVB_RTL2832_SDR=y
# CONFIG_DVB_S5H1432 is not set
# CONFIG_DVB_SI2168 is not set
# CONFIG_DVB_SP887X is not set
# CONFIG_DVB_STV0367 is not set
# CONFIG_DVB_TDA10048 is not set
# CONFIG_DVB_TDA1004X is not set
# CONFIG_DVB_ZD1301_DEMOD is not set
CONFIG_DVB_ZL10353=y
# CONFIG_DVB_CXD2880 is not set

#
# DVB-C (cable) frontends
#
# CONFIG_DVB_STV0297 is not set
# CONFIG_DVB_TDA10021 is not set
# CONFIG_DVB_TDA10023 is not set
# CONFIG_DVB_VES1820 is not set

#
# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
#
# CONFIG_DVB_AU8522_DTV is not set
# CONFIG_DVB_AU8522_V4L is not set
# CONFIG_DVB_BCM3510 is not set
# CONFIG_DVB_LG2160 is not set
# CONFIG_DVB_LGDT3305 is not set
# CONFIG_DVB_LGDT3306A is not set
# CONFIG_DVB_LGDT330X is not set
# CONFIG_DVB_MXL692 is not set
# CONFIG_DVB_NXT200X is not set
# CONFIG_DVB_OR51132 is not set
# CONFIG_DVB_OR51211 is not set
# CONFIG_DVB_S5H1409 is not set
# CONFIG_DVB_S5H1411 is not set

#
# ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_DIB8000 is not set
# CONFIG_DVB_MB86A20S is not set
# CONFIG_DVB_S921 is not set

#
# ISDB-S (satellite) & ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_MN88443X is not set
# CONFIG_DVB_TC90522 is not set

#
# Digital terrestrial only tuners/PLL
#
# CONFIG_DVB_PLL is not set
# CONFIG_DVB_TUNER_DIB0070 is not set
# CONFIG_DVB_TUNER_DIB0090 is not set

#
# SEC control devices for DVB-S
#
# CONFIG_DVB_A8293 is not set
CONFIG_DVB_AF9033=y
# CONFIG_DVB_ASCOT2E is not set
# CONFIG_DVB_ATBM8830 is not set
# CONFIG_DVB_HELENE is not set
# CONFIG_DVB_HORUS3A is not set
# CONFIG_DVB_ISL6405 is not set
# CONFIG_DVB_ISL6421 is not set
# CONFIG_DVB_ISL6423 is not set
# CONFIG_DVB_IX2505V is not set
# CONFIG_DVB_LGS8GL5 is not set
# CONFIG_DVB_LGS8GXX is not set
# CONFIG_DVB_LNBH25 is not set
# CONFIG_DVB_LNBH29 is not set
# CONFIG_DVB_LNBP21 is not set
# CONFIG_DVB_LNBP22 is not set
# CONFIG_DVB_M88RS2000 is not set
# CONFIG_DVB_TDA665x is not set
# CONFIG_DVB_DRX39XYJ is not set

#
# Common Interface (EN50221) controller drivers
#
# CONFIG_DVB_CXD2099 is not set
# CONFIG_DVB_SP2 is not set
# end of Customise DVB Frontends

#
# Tools to develop new frontends
#
# CONFIG_DVB_DUMMY_FE is not set
# end of Media ancillary drivers

#
# Graphics support
#
CONFIG_APERTURE_HELPERS=y
CONFIG_SCREEN_INFO=y
CONFIG_VIDEO=y
# CONFIG_AUXDISPLAY is not set
# CONFIG_PANEL is not set
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
# CONFIG_AGP_SIS is not set
# CONFIG_AGP_VIA is not set
CONFIG_INTEL_GTT=y
# CONFIG_VGA_SWITCHEROO is not set
CONFIG_GPU_BUDDY=y
CONFIG_DRM=y

#
# DRM debugging options
#
# CONFIG_DRM_WERROR is not set
CONFIG_DRM_DEBUG_MM=y
# end of DRM debugging options

CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_KMS_HELPER=y
# CONFIG_DRM_PANIC is not set
# CONFIG_DRM_RAS is not set
# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set
# CONFIG_DRM_DEBUG_MODESET_LOCK is not set
CONFIG_DRM_CLIENT=y
CONFIG_DRM_CLIENT_LIB=y
CONFIG_DRM_CLIENT_SELECTION=y
CONFIG_DRM_CLIENT_SETUP=y

#
# Supported DRM clients
#
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_FBDEV_OVERALLOC=100
# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set
# CONFIG_DRM_CLIENT_LOG is not set
CONFIG_DRM_CLIENT_DEFAULT_FBDEV=y
CONFIG_DRM_CLIENT_DEFAULT="fbdev"
# end of Supported DRM clients

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_DRM_DISPLAY_DP_AUX_BUS=y
CONFIG_DRM_DISPLAY_HELPER=y
# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set
# CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV is not set
CONFIG_DRM_DISPLAY_DP_HELPER=y
CONFIG_DRM_DISPLAY_DSC_HELPER=y
CONFIG_DRM_DISPLAY_HDCP_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_HELPER=y
CONFIG_DRM_TTM=y
CONFIG_DRM_BUDDY=y
CONFIG_DRM_TTM_HELPER=y
CONFIG_DRM_GEM_SHMEM_HELPER=y
# CONFIG_DRM_AMDGPU is not set

#
# ARM devices
#
# CONFIG_DRM_KOMEDA is not set
# end of ARM devices

# CONFIG_DRM_AST is not set
CONFIG_DRM_BRIDGE=y
CONFIG_DRM_PANEL_BRIDGE=y
CONFIG_DRM_AUX_BRIDGE=y
CONFIG_DRM_AUX_HPD_BRIDGE=y

#
# Display Interface Bridges
#
# CONFIG_DRM_CHIPONE_ICN6211 is not set
# CONFIG_DRM_CHRONTEL_CH7033 is not set
# CONFIG_DRM_DISPLAY_CONNECTOR is not set
# CONFIG_DRM_I2C_NXP_TDA998X is not set
# CONFIG_DRM_ITE_IT6263 is not set
# CONFIG_DRM_ITE_IT6505 is not set
# CONFIG_DRM_LONTIUM_LT8912B is not set
# CONFIG_DRM_LONTIUM_LT9211 is not set
# CONFIG_DRM_LONTIUM_LT9611 is not set
# CONFIG_DRM_LONTIUM_LT9611UXC is not set
# CONFIG_DRM_LONTIUM_LT8713SX is not set
# CONFIG_DRM_ITE_IT66121 is not set
# CONFIG_DRM_LVDS_CODEC is not set
# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set
# CONFIG_DRM_NWL_MIPI_DSI is not set
# CONFIG_DRM_NXP_PTN3460 is not set
# CONFIG_DRM_PARADE_PS8622 is not set
# CONFIG_DRM_PARADE_PS8640 is not set
# CONFIG_DRM_SAMSUNG_DSIM is not set
# CONFIG_DRM_SIL_SII8620 is not set
# CONFIG_DRM_SII902X is not set
# CONFIG_DRM_SII9234 is not set
# CONFIG_DRM_SIMPLE_BRIDGE is not set
# CONFIG_DRM_SOLOMON_SSD2825 is not set
# CONFIG_DRM_THINE_THC63LVD1024 is not set
# CONFIG_DRM_TOSHIBA_TC358762 is not set
# CONFIG_DRM_TOSHIBA_TC358764 is not set
# CONFIG_DRM_TOSHIBA_TC358767 is not set
# CONFIG_DRM_TOSHIBA_TC358768 is not set
# CONFIG_DRM_TOSHIBA_TC358775 is not set
# CONFIG_DRM_TI_DLPC3433 is not set
# CONFIG_DRM_TI_TDP158 is not set
# CONFIG_DRM_TI_TFP410 is not set
# CONFIG_DRM_TI_SN65DSI83 is not set
# CONFIG_DRM_TI_SN65DSI86 is not set
# CONFIG_DRM_TI_TPD12S015 is not set
# CONFIG_DRM_WAVESHARE_BRIDGE is not set
# CONFIG_DRM_ANALOGIX_ANX6345 is not set
# CONFIG_DRM_ANALOGIX_ANX78XX is not set
# CONFIG_DRM_ANALOGIX_ANX7625 is not set
# CONFIG_DRM_I2C_ADV7511 is not set
# CONFIG_DRM_CDNS_DSI is not set
# CONFIG_DRM_CDNS_MHDP8546 is not set
# end of Display Interface Bridges

# CONFIG_DRM_ETNAVIV is not set
# CONFIG_DRM_GMA500 is not set
CONFIG_DRM_GUD=y
# CONFIG_DRM_HISI_HIBMC is not set
CONFIG_DRM_I915=y
CONFIG_DRM_I915_FORCE_PROBE=""
CONFIG_DRM_I915_CAPTURE_ERROR=y
CONFIG_DRM_I915_COMPRESS_ERROR=y
CONFIG_DRM_I915_USERPTR=y
# CONFIG_DRM_I915_GVT_KVMGT is not set
# CONFIG_DRM_I915_DP_TUNNEL is not set

#
# drm/i915 Debugging
#
# CONFIG_DRM_I915_WERROR is not set
# CONFIG_DRM_I915_REPLAY_GPU_HANGS_API is not set
# CONFIG_DRM_I915_DEBUG is not set
# CONFIG_DRM_I915_DEBUG_MMIO is not set
# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set
# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set
# CONFIG_DRM_I915_DEBUG_GUC is not set
# CONFIG_DRM_I915_SELFTEST is not set
# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set
# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set
# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set
# CONFIG_DRM_I915_DEBUG_WAKEREF is not set
# end of drm/i915 Debugging

#
# drm/i915 Profile Guided Optimisation
#
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000
CONFIG_DRM_I915_FENCE_TIMEOUT=10000
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250
CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640
CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500
CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000
CONFIG_DRM_I915_STOP_TIMEOUT=100
CONFIG_DRM_I915_TIMESLICE_DURATION=1
# end of drm/i915 Profile Guided Optimisation

# CONFIG_DRM_LOGICVC is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_NOUVEAU is not set
CONFIG_DRM_PANEL=y

#
# Display Panels
#
# CONFIG_DRM_PANEL_ABT_Y030XX067A is not set
# CONFIG_DRM_PANEL_ANBERNIC_TD4310 is not set
# CONFIG_DRM_PANEL_ARM_VERSATILE is not set
# CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set
# CONFIG_DRM_PANEL_AUO_A030JTN01 is not set
# CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0 is not set
# CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set
# CONFIG_DRM_PANEL_BOE_TD4320 is not set
# CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_LL2 is not set
# CONFIG_DRM_PANEL_CHIPONE_ICNA35XX is not set
# CONFIG_DRM_PANEL_CHIPWEALTH_CH13726A is not set
# CONFIG_DRM_PANEL_EBBG_FT8719 is not set
# CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set
# CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set
# CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set
# CONFIG_DRM_PANEL_FOCALTECH_OTA7290B is not set
# CONFIG_DRM_PANEL_DSI_CM is not set
# CONFIG_DRM_PANEL_LVDS is not set
# CONFIG_DRM_PANEL_HIMAX_HX8279 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83102 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112A is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112B is not set
# CONFIG_DRM_PANEL_HIMAX_HX83121A is not set
# CONFIG_DRM_PANEL_HIMAX_HX8394 is not set
# CONFIG_DRM_PANEL_HYDIS_HV101HD1 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI7807S is not set
# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9488 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9805 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E_DSI is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9882T is not set
# CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set
# CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set
# CONFIG_DRM_PANEL_JADARD_JD9365DA_H3 is not set
# CONFIG_DRM_PANEL_JDI_LPM102A188A is not set
# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set
# CONFIG_DRM_PANEL_JDI_R63452 is not set
# CONFIG_DRM_PANEL_KHADAS_TS050 is not set
# CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set
# CONFIG_DRM_PANEL_LINCOLNTECH_LCD197 is not set
# CONFIG_DRM_PANEL_LG_LB035Q02 is not set
# CONFIG_DRM_PANEL_LG_LD070WX3 is not set
# CONFIG_DRM_PANEL_LG_LG4573 is not set
# CONFIG_DRM_PANEL_LG_SW43408 is not set
# CONFIG_DRM_PANEL_LXD_M9189A is not set
# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set
# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set
# CONFIG_DRM_PANEL_MOTOROLA_MOT is not set
# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35532 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36523 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36536 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672E is not set
# CONFIG_DRM_PANEL_NOVATEK_NT37700F is not set
# CONFIG_DRM_PANEL_NOVATEK_NT37801 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set
# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set
# CONFIG_DRM_PANEL_ORISETECH_OTA5601A is not set
# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set
# CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set
# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set
# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM692E5 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM69380 is not set
# CONFIG_DRM_PANEL_RENESAS_R61307 is not set
# CONFIG_DRM_PANEL_RENESAS_R63419 is not set
# CONFIG_DRM_PANEL_RENESAS_R69328 is not set
# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS581VF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS639RQ08 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set
# CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set
# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set
# CONFIG_DRM_PANEL_SAMSUNG_LTL106HL02 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D27A1 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3FC2X01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA5X01_AMS561RA01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8FC0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_SOFEF00 is not set
# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set
# CONFIG_DRM_PANEL_SHARP_LQ079L1SX01 is not set
# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set
# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set
# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set
# CONFIG_DRM_PANEL_SHARP_LS060T1SX01 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set
# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set
# CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set
# CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set
# CONFIG_DRM_PANEL_STARTEK_KD070FHFID015 is not set
CONFIG_DRM_PANEL_EDP=y
# CONFIG_DRM_PANEL_SIMPLE is not set
# CONFIG_DRM_PANEL_SUMMIT is not set
# CONFIG_DRM_PANEL_SYNAPTICS_R63353 is not set
# CONFIG_DRM_PANEL_SYNAPTICS_TDDI is not set
# CONFIG_DRM_PANEL_TDO_TL070WSH30 is not set
# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set
# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set
# CONFIG_DRM_PANEL_TPO_TPG110 is not set
# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
# CONFIG_DRM_PANEL_VISIONOX_G2647FB105 is not set
# CONFIG_DRM_PANEL_VISIONOX_R66451 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM692E5 is not set
# CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set
# CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set
# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set
# end of Display Panels

# CONFIG_DRM_QXL is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_ST7571 is not set
# CONFIG_DRM_ST7586 is not set
# CONFIG_DRM_ST7735R is not set
# CONFIG_DRM_ST7920 is not set
# CONFIG_DRM_SSD130X is not set

#
# Drivers for system framebuffers
#
CONFIG_DRM_SYSFB_HELPER=y
CONFIG_DRM_SIMPLEDRM=y
# CONFIG_DRM_VESADRM is not set
# end of Drivers for system framebuffers

# CONFIG_DRM_APPLETBDRM is not set
# CONFIG_DRM_ARCPGU is not set
CONFIG_DRM_BOCHS=y
CONFIG_DRM_CIRRUS_QEMU=y
CONFIG_DRM_GM12U320=y
# CONFIG_DRM_PANEL_MIPI_DBI is not set
# CONFIG_DRM_PIXPAPER is not set
# CONFIG_TINYDRM_HX8357D is not set
# CONFIG_TINYDRM_ILI9163 is not set
# CONFIG_TINYDRM_ILI9225 is not set
# CONFIG_TINYDRM_ILI9341 is not set
# CONFIG_TINYDRM_ILI9486 is not set
# CONFIG_TINYDRM_MI0283QT is not set
# CONFIG_TINYDRM_REPAPER is not set
# CONFIG_TINYDRM_SHARP_MEMORY is not set
CONFIG_DRM_UDL=y
# CONFIG_DRM_VBOXVIDEO is not set
CONFIG_DRM_VGEM=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
# CONFIG_DRM_VKMS is not set
CONFIG_DRM_VMWGFX=y
# CONFIG_DRM_VMWGFX_MKSSTATS is not set
# CONFIG_DRM_XE is not set
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y

#
# Frame buffer Devices
#
CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_VGA16=y
# CONFIG_FB_UVESA is not set
CONFIG_FB_VESA=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_OPENCORES is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_IBM_GXT4500 is not set
CONFIG_FB_VIRTUAL=y
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_SSD1307 is not set
# CONFIG_FB_SM712 is not set
CONFIG_FB_CORE=y
CONFIG_FB_NOTIFY=y
CONFIG_FB_DEVICE=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYSMEM_FOPS=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_IOMEM_FOPS=y
CONFIG_FB_IOMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y
CONFIG_FB_TILEBLITTING=y
# end of Frame buffer Devices

#
# Backlight & LCD device support
#
CONFIG_LCD_CLASS_DEVICE=y
# CONFIG_LCD_L4F00242T03 is not set
# CONFIG_LCD_LMS283GF05 is not set
# CONFIG_LCD_LTV350QV is not set
# CONFIG_LCD_ILI922X is not set
# CONFIG_LCD_ILI9320 is not set
# CONFIG_LCD_TDO24M is not set
# CONFIG_LCD_VGG2432A4 is not set
# CONFIG_LCD_PLATFORM is not set
# CONFIG_LCD_AMS369FG06 is not set
# CONFIG_LCD_LMS501KF03 is not set
# CONFIG_LCD_HX8357 is not set
# CONFIG_LCD_OTM3225A is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_AW99706 is not set
# CONFIG_BACKLIGHT_KTD253 is not set
# CONFIG_BACKLIGHT_KTD2801 is not set
# CONFIG_BACKLIGHT_KTZ8866 is not set
# CONFIG_BACKLIGHT_SY7758 is not set
# CONFIG_BACKLIGHT_MAX25014 is not set
# CONFIG_BACKLIGHT_MT6370 is not set
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_QCOM_WLED is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_LM3509 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
# CONFIG_BACKLIGHT_PANDORA is not set
# CONFIG_BACKLIGHT_GPIO is not set
# CONFIG_BACKLIGHT_LV5207LP is not set
# CONFIG_BACKLIGHT_BD6107 is not set
# CONFIG_BACKLIGHT_ARCXCNN is not set
# CONFIG_BACKLIGHT_LED is not set
# end of Backlight & LCD device support

CONFIG_VGASTATE=y
CONFIG_VIDEOMODE_HELPERS=y
CONFIG_HDMI=y
# CONFIG_FIRMWARE_EDID is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
# end of Console display driver support

CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_MONO_FILE="drivers/video/logo/logo_linux_mono.pbm"
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_VGA16_FILE="drivers/video/logo/logo_linux_vga16.ppm"
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_TRACE_GPU_MEM is not set
# end of Graphics support

# CONFIG_DRM_ACCEL is not set
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_SEQ_DEVICE=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_UMP=y
CONFIG_SND_UMP_LEGACY_RAWMIDI=y
CONFIG_SND_JACK=y
CONFIG_SND_JACK_INPUT_DEV=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_PCM_TIMER=y
CONFIG_SND_HRTIMER=y
# CONFIG_SND_DYNAMIC_MINORS is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_PROC_FS=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_CTL_FAST_LOOKUP=y
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
CONFIG_SND_PCM_XRUN_DEBUG=y
# CONFIG_SND_CTL_INPUT_VALIDATION is not set
# CONFIG_SND_CTL_DEBUG is not set
# CONFIG_SND_JACK_INJECTION_DEBUG is not set
# CONFIG_SND_UTIMER is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_CTL_LED=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_SEQ_DUMMY=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_SEQ_MIDI_EVENT=y
CONFIG_SND_SEQ_MIDI=y
CONFIG_SND_SEQ_VIRMIDI=y
# CONFIG_SND_SEQ_UMP is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
CONFIG_SND_DUMMY=y
CONFIG_SND_ALOOP=y
# CONFIG_SND_PCMTEST is not set
CONFIG_SND_VIRMIDI=y
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_MTS64 is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_SERIAL_GENERIC is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PORTMAN2X4 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ASIHPI is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SE6X is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set

#
# HD-Audio
#
CONFIG_SND_HDA=y
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDA_CTL_DEV_ID is not set
CONFIG_SND_HDA_PREALLOC_SIZE=0
CONFIG_SND_HDA_INTEL=y
# CONFIG_SND_HDA_ACPI is not set
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
# CONFIG_SND_HDA_CODEC_SENARYTECH is not set
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
# CONFIG_SND_HDA_CODEC_CM9825 is not set
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_CODEC_REALTEK=y
# CONFIG_SND_HDA_CODEC_ALC260 is not set
# CONFIG_SND_HDA_CODEC_ALC262 is not set
# CONFIG_SND_HDA_CODEC_ALC268 is not set
# CONFIG_SND_HDA_CODEC_ALC269 is not set
# CONFIG_SND_HDA_CODEC_ALC662 is not set
# CONFIG_SND_HDA_CODEC_ALC680 is not set
# CONFIG_SND_HDA_CODEC_ALC861 is not set
# CONFIG_SND_HDA_CODEC_ALC861VD is not set
# CONFIG_SND_HDA_CODEC_ALC880 is not set
# CONFIG_SND_HDA_CODEC_ALC882 is not set
CONFIG_SND_HDA_CODEC_CIRRUS=y
# CONFIG_SND_HDA_CODEC_CS420X is not set
# CONFIG_SND_HDA_CODEC_CS421X is not set
# CONFIG_SND_HDA_CODEC_CS8409 is not set
CONFIG_SND_HDA_CODEC_HDMI=y
# CONFIG_SND_HDA_CODEC_HDMI_GENERIC is not set
# CONFIG_SND_HDA_CODEC_HDMI_SIMPLE is not set
# CONFIG_SND_HDA_CODEC_HDMI_INTEL is not set
# CONFIG_SND_HDA_CODEC_HDMI_ATI is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA_MCP is not set
# CONFIG_SND_HDA_CODEC_HDMI_TEGRA is not set
# CONFIG_SND_HDA_SCODEC_AW88399_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_SPI is not set
CONFIG_SND_HDA_CORE=y
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_INTEL_NHLT=y
CONFIG_SND_INTEL_DSP_CONFIG=y
CONFIG_SND_INTEL_SOUNDWIRE_ACPI=y
# end of HD-Audio

# CONFIG_SND_SPI is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_AUDIO_MIDI_V2=y
CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y
CONFIG_SND_USB_UA101=y
CONFIG_SND_USB_USX2Y=y
CONFIG_SND_USB_CAIAQ=y
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_USB_US122L=y
# CONFIG_SND_USB_US144MKII is not set
CONFIG_SND_USB_6FIRE=y
CONFIG_SND_USB_HIFACE=y
CONFIG_SND_BCD2000=y
CONFIG_SND_USB_LINE6=y
CONFIG_SND_USB_POD=y
CONFIG_SND_USB_PODHD=y
CONFIG_SND_USB_TONEPORT=y
CONFIG_SND_USB_VARIAX=y
# CONFIG_SND_FIREWIRE is not set
CONFIG_SND_PCMCIA=y
# CONFIG_SND_VXPOCKET is not set
# CONFIG_SND_PDAUDIOCF is not set
CONFIG_SND_SOC=y
# CONFIG_SND_SOC_USB is not set

#
# Analog Devices
#
# CONFIG_SND_SOC_ADI_AXI_I2S is not set
# CONFIG_SND_SOC_ADI_AXI_SPDIF is not set
# end of Analog Devices

#
# AMD
#
# CONFIG_SND_SOC_AMD_ACP is not set
# CONFIG_SND_SOC_AMD_ACP3x is not set
# CONFIG_SND_SOC_AMD_RENOIR is not set
# CONFIG_SND_SOC_AMD_ACP5x is not set
# CONFIG_SND_SOC_AMD_ACP6x is not set
# CONFIG_SND_AMD_ACP_CONFIG is not set
# CONFIG_SND_SOC_AMD_ACP_COMMON is not set
# end of AMD

#
# Apple
#
# end of Apple

#
# Atmel
#
# CONFIG_SND_SOC_MIKROE_PROTO is not set
# end of Atmel

#
# Au1x
#
# end of Au1x

#
# Broadcom
#
# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set
# end of Broadcom

#
# Cirrus Logic
#
# end of Cirrus Logic

#
# DesignWare
#
# CONFIG_SND_DESIGNWARE_I2S is not set
# end of DesignWare

#
# Freescale
#

#
# Common SoC Audio options for Freescale CPUs:
#
# CONFIG_SND_SOC_FSL_ASRC is not set
# CONFIG_SND_SOC_FSL_SAI is not set
# CONFIG_SND_SOC_FSL_AUDMIX is not set
# CONFIG_SND_SOC_FSL_SSI is not set
# CONFIG_SND_SOC_FSL_SPDIF is not set
# CONFIG_SND_SOC_FSL_ESAI is not set
# CONFIG_SND_SOC_FSL_MICFIL is not set
# CONFIG_SND_SOC_FSL_XCVR is not set
# CONFIG_SND_SOC_IMX_AUDMUX is not set
# end of Freescale

#
# Google
#
# CONFIG_SND_SOC_CHV3_I2S is not set
# end of Google

#
# Hisilicon
#
# CONFIG_SND_I2S_HI6210_I2S is not set
# end of Hisilicon

#
# JZ4740
#
# end of JZ4740

#
# Kirkwood
#
# end of Kirkwood

#
# Loongson
#
# end of Loongson

#
# Intel
#
# CONFIG_SND_SOC_INTEL_SST_TOPLEVEL is not set
# CONFIG_SND_SOC_INTEL_AVS is not set
# end of Intel

#
# Mediatek
#
# CONFIG_SND_SOC_MTK_BTCVSD is not set
# end of Mediatek

#
# PXA
#
# end of PXA

#
# SoundWire (SDCA)
#
# CONFIG_SND_SOC_SDCA is not set
CONFIG_SND_SOC_SDCA_OPTIONAL=y
# end of SoundWire (SDCA)

#
# ST SPEAr
#
# end of ST SPEAr

#
# Spreadtrum
#
# end of Spreadtrum

#
# STMicroelectronics STM32
#
# end of STMicroelectronics STM32

#
# Tegra
#
# end of Tegra

#
# Xilinx
#
# CONFIG_SND_SOC_XILINX_I2S is not set
# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set
# CONFIG_SND_SOC_XILINX_SPDIF is not set
# end of Xilinx

#
# Xtensa
#
# CONFIG_SND_SOC_XTFPGA_I2S is not set
# end of Xtensa

# CONFIG_SND_SOC_SOF_TOPLEVEL is not set
CONFIG_SND_SOC_I2C_AND_SPI=y

#
# CODEC drivers
#
# CONFIG_SND_SOC_AC97_CODEC is not set
# CONFIG_SND_SOC_ADAU1372_I2C is not set
# CONFIG_SND_SOC_ADAU1372_SPI is not set
# CONFIG_SND_SOC_ADAU1373 is not set
# CONFIG_SND_SOC_ADAU1701 is not set
# CONFIG_SND_SOC_ADAU1761_I2C is not set
# CONFIG_SND_SOC_ADAU1761_SPI is not set
# CONFIG_SND_SOC_ADAU7002 is not set
# CONFIG_SND_SOC_ADAU7118_HW is not set
# CONFIG_SND_SOC_ADAU7118_I2C is not set
# CONFIG_SND_SOC_AK4104 is not set
# CONFIG_SND_SOC_AK4118 is not set
# CONFIG_SND_SOC_AK4375 is not set
# CONFIG_SND_SOC_AK4458 is not set
# CONFIG_SND_SOC_AK4554 is not set
# CONFIG_SND_SOC_AK4613 is not set
# CONFIG_SND_SOC_AK4619 is not set
# CONFIG_SND_SOC_AK4642 is not set
# CONFIG_SND_SOC_AK5386 is not set
# CONFIG_SND_SOC_AK5558 is not set
# CONFIG_SND_SOC_ALC5623 is not set
# CONFIG_SND_SOC_AUDIO_IIO_AUX is not set
# CONFIG_SND_SOC_AW8738 is not set
# CONFIG_SND_SOC_AW88395 is not set
# CONFIG_SND_SOC_AW88166 is not set
# CONFIG_SND_SOC_AW88261 is not set
# CONFIG_SND_SOC_AW88081 is not set
# CONFIG_SND_SOC_AW87390 is not set
# CONFIG_SND_SOC_AW88399 is not set
# CONFIG_SND_SOC_BD28623 is not set
# CONFIG_SND_SOC_BT_SCO is not set
# CONFIG_SND_SOC_CHV3_CODEC is not set
# CONFIG_SND_SOC_CS35L32 is not set
# CONFIG_SND_SOC_CS35L33 is not set
# CONFIG_SND_SOC_CS35L34 is not set
# CONFIG_SND_SOC_CS35L35 is not set
# CONFIG_SND_SOC_CS35L36 is not set
# CONFIG_SND_SOC_CS35L41_SPI is not set
# CONFIG_SND_SOC_CS35L41_I2C is not set
# CONFIG_SND_SOC_CS35L45_SPI is not set
# CONFIG_SND_SOC_CS35L45_I2C is not set
# CONFIG_SND_SOC_CS35L56_I2C is not set
# CONFIG_SND_SOC_CS35L56_SPI is not set
# CONFIG_SND_SOC_CS35L56_SDW is not set
# CONFIG_SND_SOC_CS42L42 is not set
# CONFIG_SND_SOC_CS42L42_SDW is not set
# CONFIG_SND_SOC_CS42L51_I2C is not set
# CONFIG_SND_SOC_CS42L52 is not set
# CONFIG_SND_SOC_CS42L56 is not set
# CONFIG_SND_SOC_CS42L73 is not set
# CONFIG_SND_SOC_CS42L83 is not set
# CONFIG_SND_SOC_CS42L84 is not set
# CONFIG_SND_SOC_CS4234 is not set
# CONFIG_SND_SOC_CS4265 is not set
# CONFIG_SND_SOC_CS4270 is not set
# CONFIG_SND_SOC_CS4271_I2C is not set
# CONFIG_SND_SOC_CS4271_SPI is not set
# CONFIG_SND_SOC_CS42XX8_SPI is not set
# CONFIG_SND_SOC_CS42XX8_I2C is not set
# CONFIG_SND_SOC_CS43130 is not set
# CONFIG_SND_SOC_CS4341 is not set
# CONFIG_SND_SOC_CS4349 is not set
# CONFIG_SND_SOC_CS48L32 is not set
# CONFIG_SND_SOC_CS53L30 is not set
# CONFIG_SND_SOC_CS530X_I2C is not set
# CONFIG_SND_SOC_CS530X_SPI is not set
# CONFIG_SND_SOC_CX2072X is not set
# CONFIG_SND_SOC_DA7213 is not set
# CONFIG_SND_SOC_DMIC is not set
# CONFIG_SND_SOC_ES7134 is not set
# CONFIG_SND_SOC_ES7241 is not set
# CONFIG_SND_SOC_ES8311 is not set
# CONFIG_SND_SOC_ES8316 is not set
# CONFIG_SND_SOC_ES8323 is not set
# CONFIG_SND_SOC_ES8326 is not set
# CONFIG_SND_SOC_ES8328_I2C is not set
# CONFIG_SND_SOC_ES8328_SPI is not set
# CONFIG_SND_SOC_ES8375 is not set
# CONFIG_SND_SOC_ES8389 is not set
# CONFIG_SND_SOC_FS210X is not set
# CONFIG_SND_SOC_GTM601 is not set
# CONFIG_SND_SOC_HDA is not set
# CONFIG_SND_SOC_ICS43432 is not set
# CONFIG_SND_SOC_IDT821034 is not set
# CONFIG_SND_SOC_MAX98088 is not set
# CONFIG_SND_SOC_MAX98090 is not set
# CONFIG_SND_SOC_MAX98357A is not set
# CONFIG_SND_SOC_MAX98504 is not set
# CONFIG_SND_SOC_MAX9867 is not set
# CONFIG_SND_SOC_MAX98927 is not set
# CONFIG_SND_SOC_MAX98520 is not set
# CONFIG_SND_SOC_MAX98363 is not set
# CONFIG_SND_SOC_MAX98373_I2C is not set
# CONFIG_SND_SOC_MAX98373_SDW is not set
# CONFIG_SND_SOC_MAX98388 is not set
# CONFIG_SND_SOC_MAX98390 is not set
# CONFIG_SND_SOC_MAX98396 is not set
# CONFIG_SND_SOC_MAX9860 is not set
# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set
# CONFIG_SND_SOC_PCM1681 is not set
# CONFIG_SND_SOC_PCM1754 is not set
# CONFIG_SND_SOC_PCM1789_I2C is not set
# CONFIG_SND_SOC_PCM179X_I2C is not set
# CONFIG_SND_SOC_PCM179X_SPI is not set
# CONFIG_SND_SOC_PCM186X_I2C is not set
# CONFIG_SND_SOC_PCM186X_SPI is not set
# CONFIG_SND_SOC_PCM3060_I2C is not set
# CONFIG_SND_SOC_PCM3060_SPI is not set
# CONFIG_SND_SOC_PCM3168A_I2C is not set
# CONFIG_SND_SOC_PCM3168A_SPI is not set
# CONFIG_SND_SOC_PCM5102A is not set
# CONFIG_SND_SOC_PCM512x_I2C is not set
# CONFIG_SND_SOC_PCM512x_SPI is not set
# CONFIG_SND_SOC_PCM6240 is not set
# CONFIG_SND_SOC_PEB2466 is not set
# CONFIG_SND_SOC_PM4125_SDW is not set
# CONFIG_SND_SOC_RT1017_SDCA_SDW is not set
# CONFIG_SND_SOC_RT1308_SDW is not set
# CONFIG_SND_SOC_RT1316_SDW is not set
# CONFIG_SND_SOC_RT1318_SDW is not set
# CONFIG_SND_SOC_RT1320_SDW is not set
# CONFIG_SND_SOC_RT5575 is not set
# CONFIG_SND_SOC_RT5616 is not set
# CONFIG_SND_SOC_RT5631 is not set
# CONFIG_SND_SOC_RT5640 is not set
# CONFIG_SND_SOC_RT5645 is not set
# CONFIG_SND_SOC_RT5659 is not set
# CONFIG_SND_SOC_RT5677 is not set
# CONFIG_SND_SOC_RT5682_SDW is not set
# CONFIG_SND_SOC_RT700_SDW is not set
# CONFIG_SND_SOC_RT711_SDW is not set
# CONFIG_SND_SOC_RT711_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_DMIC_SDW is not set
# CONFIG_SND_SOC_RT721_SDCA_SDW is not set
# CONFIG_SND_SOC_RT722_SDCA_SDW is not set
# CONFIG_SND_SOC_RT715_SDW is not set
# CONFIG_SND_SOC_RT715_SDCA_SDW is not set
# CONFIG_SND_SOC_RT9120 is not set
# CONFIG_SND_SOC_RT9123 is not set
# CONFIG_SND_SOC_RT9123P is not set
# CONFIG_SND_SOC_RTQ9124 is not set
# CONFIG_SND_SOC_RTQ9128 is not set
# CONFIG_SND_SOC_SDW_MOCKUP is not set
# CONFIG_SND_SOC_SGTL5000 is not set
# CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set
# CONFIG_SND_SOC_SIMPLE_MUX is not set
# CONFIG_SND_SOC_SMA1303 is not set
# CONFIG_SND_SOC_SMA1307 is not set
# CONFIG_SND_SOC_SPDIF is not set
# CONFIG_SND_SOC_SRC4XXX_I2C is not set
# CONFIG_SND_SOC_SSM2305 is not set
# CONFIG_SND_SOC_SSM2518 is not set
# CONFIG_SND_SOC_SSM2602_SPI is not set
# CONFIG_SND_SOC_SSM2602_I2C is not set
# CONFIG_SND_SOC_SSM3515 is not set
# CONFIG_SND_SOC_SSM4567 is not set
# CONFIG_SND_SOC_STA32X is not set
# CONFIG_SND_SOC_STA350 is not set
# CONFIG_SND_SOC_STI_SAS is not set
# CONFIG_SND_SOC_TAS2552 is not set
# CONFIG_SND_SOC_TAS2562 is not set
# CONFIG_SND_SOC_TAS2764 is not set
# CONFIG_SND_SOC_TAS2770 is not set
# CONFIG_SND_SOC_TAS2780 is not set
# CONFIG_SND_SOC_TAS2781_I2C is not set
# CONFIG_SND_SOC_TAS5086 is not set
# CONFIG_SND_SOC_TAS571X is not set
# CONFIG_SND_SOC_TAS5720 is not set
# CONFIG_SND_SOC_TAS5805M is not set
# CONFIG_SND_SOC_TAS6424 is not set
# CONFIG_SND_SOC_TAS675X is not set
# CONFIG_SND_SOC_TDA7419 is not set
# CONFIG_SND_SOC_TFA9879 is not set
# CONFIG_SND_SOC_TFA989X is not set
# CONFIG_SND_SOC_TLV320ADC3XXX is not set
# CONFIG_SND_SOC_TLV320AIC23_I2C is not set
# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
# CONFIG_SND_SOC_TLV320AIC31XX is not set
# CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set
# CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set
# CONFIG_SND_SOC_TLV320AIC3X_I2C is not set
# CONFIG_SND_SOC_TLV320AIC3X_SPI is not set
# CONFIG_SND_SOC_TLV320ADCX140 is not set
# CONFIG_SND_SOC_TS3A227E is not set
# CONFIG_SND_SOC_TSCS42XX is not set
# CONFIG_SND_SOC_TSCS454 is not set
# CONFIG_SND_SOC_UDA1334 is not set
# CONFIG_SND_SOC_UDA1342 is not set
# CONFIG_SND_SOC_UDA1380 is not set
# CONFIG_SND_SOC_WCD937X_SDW is not set
# CONFIG_SND_SOC_WCD938X_SDW is not set
# CONFIG_SND_SOC_WCD939X_SDW is not set
# CONFIG_SND_SOC_WM8510 is not set
# CONFIG_SND_SOC_WM8523 is not set
# CONFIG_SND_SOC_WM8524 is not set
# CONFIG_SND_SOC_WM8580 is not set
# CONFIG_SND_SOC_WM8711 is not set
# CONFIG_SND_SOC_WM8728 is not set
# CONFIG_SND_SOC_WM8731_I2C is not set
# CONFIG_SND_SOC_WM8731_SPI is not set
# CONFIG_SND_SOC_WM8737 is not set
# CONFIG_SND_SOC_WM8741 is not set
# CONFIG_SND_SOC_WM8750 is not set
# CONFIG_SND_SOC_WM8753 is not set
# CONFIG_SND_SOC_WM8770 is not set
# CONFIG_SND_SOC_WM8776 is not set
# CONFIG_SND_SOC_WM8782 is not set
# CONFIG_SND_SOC_WM8804_I2C is not set
# CONFIG_SND_SOC_WM8804_SPI is not set
# CONFIG_SND_SOC_WM8903 is not set
# CONFIG_SND_SOC_WM8904 is not set
# CONFIG_SND_SOC_WM8940 is not set
# CONFIG_SND_SOC_WM8960 is not set
# CONFIG_SND_SOC_WM8961 is not set
# CONFIG_SND_SOC_WM8962 is not set
# CONFIG_SND_SOC_WM8974 is not set
# CONFIG_SND_SOC_WM8978 is not set
# CONFIG_SND_SOC_WM8985 is not set
# CONFIG_SND_SOC_WSA881X is not set
# CONFIG_SND_SOC_WSA883X is not set
# CONFIG_SND_SOC_WSA884X is not set
# CONFIG_SND_SOC_WSA885X is not set
# CONFIG_SND_SOC_ZL38060 is not set
# CONFIG_SND_SOC_MAX9759 is not set
# CONFIG_SND_SOC_MT6351 is not set
# CONFIG_SND_SOC_MT6357 is not set
# CONFIG_SND_SOC_MT6358 is not set
# CONFIG_SND_SOC_MT6660 is not set
# CONFIG_SND_SOC_NAU8315 is not set
# CONFIG_SND_SOC_NAU8325 is not set
# CONFIG_SND_SOC_NAU8540 is not set
# CONFIG_SND_SOC_NAU8810 is not set
# CONFIG_SND_SOC_NAU8821 is not set
# CONFIG_SND_SOC_NAU8822 is not set
# CONFIG_SND_SOC_NAU8824 is not set
# CONFIG_SND_SOC_NTP8918 is not set
# CONFIG_SND_SOC_NTP8835 is not set
# CONFIG_SND_SOC_TPA6130A2 is not set
# CONFIG_SND_SOC_LPASS_WSA_MACRO is not set
# CONFIG_SND_SOC_LPASS_VA_MACRO is not set
# CONFIG_SND_SOC_LPASS_RX_MACRO is not set
# CONFIG_SND_SOC_LPASS_TX_MACRO is not set
# end of CODEC drivers

#
# Generic drivers
#
# CONFIG_SND_SIMPLE_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD2 is not set
# CONFIG_SND_TEST_COMPONENT is not set
# end of Generic drivers

CONFIG_SND_X86=y
# CONFIG_HDMI_LPE_AUDIO is not set
CONFIG_SND_VIRTIO=y
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
CONFIG_UHID=y
CONFIG_HID_GENERIC=y
CONFIG_HID_HAPTIC=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
CONFIG_HID_ACCUTOUCH=y
CONFIG_HID_ACRUX=y
CONFIG_HID_ACRUX_FF=y
CONFIG_HID_APPLE=y
CONFIG_HID_APPLEIR=y
# CONFIG_HID_APPLETB_BL is not set
# CONFIG_HID_APPLETB_KBD is not set
CONFIG_HID_ASUS=y
CONFIG_HID_AUREAL=y
CONFIG_HID_BELKIN=y
CONFIG_HID_BETOP_FF=y
CONFIG_HID_BIGBEN_FF=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
CONFIG_HID_CORSAIR=y
CONFIG_HID_COUGAR=y
CONFIG_HID_MACALLY=y
CONFIG_HID_PRODIKEYS=y
CONFIG_HID_CMEDIA=y
CONFIG_HID_CP2112=y
CONFIG_HID_CREATIVE_SB0540=y
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
CONFIG_DRAGONRISE_FF=y
CONFIG_HID_EMS_FF=y
CONFIG_HID_ELAN=y
CONFIG_HID_ELECOM=y
CONFIG_HID_ELO=y
CONFIG_HID_EVISION=y
CONFIG_HID_EZKEY=y
CONFIG_HID_FT260=y
CONFIG_HID_GEMBIRD=y
CONFIG_HID_GFRM=y
CONFIG_HID_GLORIOUS=y
CONFIG_HID_HOLTEK=y
CONFIG_HOLTEK_FF=y
# CONFIG_HID_HYPERX is not set
CONFIG_HID_VIVALDI_COMMON=y
# CONFIG_HID_GOODIX_SPI is not set
CONFIG_HID_GOOGLE_STADIA_FF=y
CONFIG_HID_VIVALDI=y
CONFIG_HID_GT683R=y
# CONFIG_HID_MSI is not set
CONFIG_HID_KEYTOUCH=y
CONFIG_HID_KYE=y
# CONFIG_HID_KYSONA is not set
CONFIG_HID_UCLOGIC=y
CONFIG_HID_WALTOP=y
CONFIG_HID_VIEWSONIC=y
CONFIG_HID_VRC2=y
CONFIG_HID_XIAOMI=y
CONFIG_HID_GYRATION=y
CONFIG_HID_ICADE=y
CONFIG_HID_ITE=y
CONFIG_HID_JABRA=y
CONFIG_HID_TWINHAN=y
CONFIG_HID_KENSINGTON=y
CONFIG_HID_LCPOWER=y
CONFIG_HID_LED=y
CONFIG_HID_LENOVO=y
# CONFIG_HID_LENOVO_GO is not set
# CONFIG_HID_LENOVO_GO_S is not set
CONFIG_HID_LETSKETCH=y
CONFIG_HID_LOGITECH=y
CONFIG_HID_LOGITECH_DJ=y
CONFIG_HID_LOGITECH_HIDPP=y
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_LOGIG940_FF=y
CONFIG_LOGIWHEELS_FF=y
CONFIG_HID_MAGICMOUSE=y
CONFIG_HID_MALTRON=y
CONFIG_HID_MAYFLASH=y
CONFIG_HID_MEGAWORLD_FF=y
# CONFIG_HID_RAKK is not set
CONFIG_HID_REDRAGON=y
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
CONFIG_HID_MULTITOUCH=y
CONFIG_HID_NINTENDO=y
CONFIG_NINTENDO_FF=y
CONFIG_HID_NTI=y
CONFIG_HID_NTRIG=y
CONFIG_HID_NVIDIA_SHIELD=y
CONFIG_NVIDIA_SHIELD_FF=y
CONFIG_HID_ORTEK=y
# CONFIG_HID_OXP is not set
CONFIG_HID_PANTHERLORD=y
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PENMOUNT=y
CONFIG_HID_PETALYNX=y
CONFIG_HID_PICOLCD=y
CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
CONFIG_HID_PICOLCD_LCD=y
CONFIG_HID_PICOLCD_LEDS=y
CONFIG_HID_PICOLCD_CIR=y
CONFIG_HID_PLANTRONICS=y
CONFIG_HID_PLAYSTATION=y
CONFIG_PLAYSTATION_FF=y
CONFIG_HID_PXRC=y
# CONFIG_HID_RAPOO is not set
CONFIG_HID_RAZER=y
CONFIG_HID_PRIMAX=y
CONFIG_HID_RETRODE=y
CONFIG_HID_ROCCAT=y
CONFIG_HID_SAITEK=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SEMITEK=y
CONFIG_HID_SIGMAMICRO=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_SPEEDLINK=y
CONFIG_HID_STEAM=y
CONFIG_STEAM_FF=y
CONFIG_HID_STEELSERIES=y
CONFIG_HID_SUNPLUS=y
CONFIG_HID_RMI=y
CONFIG_HID_GREENASIA=y
CONFIG_GREENASIA_FF=y
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_SMARTJOYPLUS_FF=y
CONFIG_HID_TIVO=y
CONFIG_HID_TOPSEED=y
CONFIG_HID_TOPRE=y
CONFIG_HID_THINGM=y
CONFIG_HID_THRUSTMASTER=y
CONFIG_THRUSTMASTER_FF=y
CONFIG_HID_UDRAW_PS3=y
CONFIG_HID_U2FZERO=y
# CONFIG_HID_UNIVERSAL_PIDFF is not set
CONFIG_HID_WACOM=y
CONFIG_HID_WIIMOTE=y
# CONFIG_HID_WINWING is not set
CONFIG_HID_XINMO=y
CONFIG_HID_ZEROPLUS=y
CONFIG_ZEROPLUS_FF=y
CONFIG_HID_ZYDACRON=y
CONFIG_HID_SENSOR_HUB=y
CONFIG_HID_SENSOR_CUSTOM_SENSOR=y
CONFIG_HID_ALPS=y
CONFIG_HID_MCP2200=y
CONFIG_HID_MCP2221=y
CONFIG_HID_HUAWEI=y
# end of Special HID drivers

#
# HID-BPF support
#
# end of HID-BPF support

CONFIG_I2C_HID=y
CONFIG_I2C_HID_ACPI=y
CONFIG_I2C_HID_OF=y
# CONFIG_I2C_HID_OF_ELAN is not set
# CONFIG_I2C_HID_OF_GOODIX is not set
CONFIG_I2C_HID_CORE=y

#
# Intel ISH HID support
#
CONFIG_INTEL_ISH_HID=y
CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER=y
# end of Intel ISH HID support

#
# AMD SFH HID Support
#
CONFIG_AMD_SFH_HID=y
# end of AMD SFH HID Support

#
# Surface System Aggregator Module HID support
#
CONFIG_SURFACE_HID=y
CONFIG_SURFACE_KBD=y
# end of Surface System Aggregator Module HID support

CONFIG_SURFACE_HID_CORE=y

#
# Intel THC HID Support
#
# CONFIG_INTEL_THC_HID is not set
# end of Intel THC HID Support

#
# USB HID support
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y
# end of USB HID support

CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_LED_TRIG=y
CONFIG_USB_ULPI_BUS=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_PCI=y
CONFIG_USB_PCI_AMD=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
CONFIG_USB_FEW_INIT_RETRIES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_PRODUCTLIST is not set
# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set
CONFIG_USB_OTG_FSM=y
CONFIG_USB_LEDS_TRIGGER_USBPORT=y
CONFIG_USB_AUTOSUSPEND_DELAY=2
CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1
CONFIG_USB_MON=y

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DBGCAP=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PCI_RENESAS=y
CONFIG_USB_XHCI_PLATFORM=y
# CONFIG_USB_XHCI_SIDEBAND is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_FSL=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OXU210HP_HCD=y
CONFIG_USB_ISP116X_HCD=y
CONFIG_USB_MAX3421_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
# CONFIG_USB_OHCI_HCD_SSB is not set
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_SL811_HCD=y
CONFIG_USB_SL811_HCD_ISO=y
CONFIG_USB_SL811_CS=y
CONFIG_USB_R8A66597_HCD=y
CONFIG_USB_HCD_BCMA=y
CONFIG_USB_HCD_SSB=y
# CONFIG_USB_HCD_TEST_MODE is not set

#
# USB Device Class drivers
#
CONFIG_USB_ACM=y
CONFIG_USB_PRINTER=y
CONFIG_USB_WDM=y
CONFIG_USB_TMC=y

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_REALTEK=y
CONFIG_REALTEK_AUTOPM=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
CONFIG_USB_STORAGE_ONETOUCH=y
CONFIG_USB_STORAGE_KARMA=y
CONFIG_USB_STORAGE_CYPRESS_ATACB=y
CONFIG_USB_STORAGE_ENE_UB6250=y
CONFIG_USB_UAS=y

#
# USB Imaging devices
#
CONFIG_USB_MDC800=y
CONFIG_USB_MICROTEK=y
CONFIG_USBIP_CORE=y
CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_VHCI_HC_PORTS=8
CONFIG_USBIP_VHCI_NR_HCS=16
CONFIG_USBIP_HOST=y
CONFIG_USBIP_VUDC=y
# CONFIG_USBIP_DEBUG is not set

#
# USB dual-mode controller drivers
#
CONFIG_USB_CDNS_SUPPORT=y
CONFIG_USB_CDNS3=y
CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_CDNS3_GADGET=y

#
# Platform glue driver support
#
CONFIG_USB_CDNS3_PCI_WRAP=y
CONFIG_USB_CDNSP_PCI=y
CONFIG_USB_MUSB_HDRC=y
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_GADGET is not set
CONFIG_USB_MUSB_DUAL_ROLE=y

#
# Platform Glue Layer
#

#
# MUSB DMA mode
#
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_ULPI=y
# CONFIG_USB_DWC3_HOST is not set
CONFIG_USB_DWC3_GADGET=y
# CONFIG_USB_DWC3_DUAL_ROLE is not set

#
# Platform Glue Driver Support
#
CONFIG_USB_DWC3_PCI=y
CONFIG_USB_DWC3_HAPS=y
CONFIG_USB_DWC3_OF_SIMPLE=y
CONFIG_USB_DWC3_GENERIC_PLAT=y
# CONFIG_USB_DWC3_GOOGLE is not set
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_HOST=y

#
# Gadget/Dual-role mode requires USB Gadget support to be enabled
#
# CONFIG_USB_DWC2_PERIPHERAL is not set
# CONFIG_USB_DWC2_DUAL_ROLE is not set
CONFIG_USB_DWC2_PCI=y
# CONFIG_USB_DWC2_DEBUG is not set
# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_CHIPIDEA_PCI=y
CONFIG_USB_CHIPIDEA_MSM=y
CONFIG_USB_CHIPIDEA_NPCM=y
# CONFIG_USB_CHIPIDEA_IMX is not set
CONFIG_USB_CHIPIDEA_GENERIC=y
# CONFIG_USB_CHIPIDEA_TEGRA is not set
CONFIG_USB_ISP1760=y
CONFIG_USB_ISP1760_HCD=y
CONFIG_USB_ISP1761_UDC=y
# CONFIG_USB_ISP1760_HOST_ROLE is not set
# CONFIG_USB_ISP1760_GADGET_ROLE is not set
CONFIG_USB_ISP1760_DUAL_ROLE=y

#
# USB port drivers
#
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_SIMPLE=y
CONFIG_USB_SERIAL_AIRCABLE=y
CONFIG_USB_SERIAL_ARK3116=y
CONFIG_USB_SERIAL_BELKIN=y
CONFIG_USB_SERIAL_CH341=y
CONFIG_USB_SERIAL_WHITEHEAT=y
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=y
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_SERIAL_CYPRESS_M8=y
CONFIG_USB_SERIAL_EMPEG=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_VISOR=y
CONFIG_USB_SERIAL_IPAQ=y
CONFIG_USB_SERIAL_IR=y
CONFIG_USB_SERIAL_EDGEPORT=y
CONFIG_USB_SERIAL_EDGEPORT_TI=y
CONFIG_USB_SERIAL_F81232=y
CONFIG_USB_SERIAL_F8153X=y
CONFIG_USB_SERIAL_GARMIN=y
CONFIG_USB_SERIAL_IPW=y
CONFIG_USB_SERIAL_IUU=y
CONFIG_USB_SERIAL_KEYSPAN_PDA=y
CONFIG_USB_SERIAL_KEYSPAN=y
CONFIG_USB_SERIAL_KLSI=y
CONFIG_USB_SERIAL_KOBIL_SCT=y
CONFIG_USB_SERIAL_MCT_U232=y
CONFIG_USB_SERIAL_METRO=y
CONFIG_USB_SERIAL_MOS7720=y
CONFIG_USB_SERIAL_MOS7715_PARPORT=y
CONFIG_USB_SERIAL_MOS7840=y
CONFIG_USB_SERIAL_MXUPORT=y
CONFIG_USB_SERIAL_NAVMAN=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_SERIAL_OTI6858=y
CONFIG_USB_SERIAL_QCAUX=y
CONFIG_USB_SERIAL_QUALCOMM=y
CONFIG_USB_SERIAL_SPCP8X5=y
CONFIG_USB_SERIAL_SAFE=y
# CONFIG_USB_SERIAL_SAFE_PADDED is not set
CONFIG_USB_SERIAL_SIERRAWIRELESS=y
CONFIG_USB_SERIAL_SYMBOL=y
CONFIG_USB_SERIAL_TI=y
CONFIG_USB_SERIAL_CYBERJACK=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y
CONFIG_USB_SERIAL_OMNINET=y
CONFIG_USB_SERIAL_OPTICON=y
CONFIG_USB_SERIAL_XSENS_MT=y
CONFIG_USB_SERIAL_WISHBONE=y
CONFIG_USB_SERIAL_SSU100=y
CONFIG_USB_SERIAL_QT2=y
CONFIG_USB_SERIAL_UPD78F0730=y
CONFIG_USB_SERIAL_XR=y
CONFIG_USB_SERIAL_DEBUG=y

#
# USB Miscellaneous drivers
#
CONFIG_USB_USS720=y
CONFIG_USB_EMI62=y
CONFIG_USB_EMI26=y
CONFIG_USB_ADUTUX=y
CONFIG_USB_SEVSEG=y
CONFIG_USB_LEGOTOWER=y
CONFIG_USB_LCD=y
CONFIG_USB_CYPRESS_CY7C63=y
CONFIG_USB_CYTHERM=y
CONFIG_USB_IDMOUSE=y
CONFIG_USB_APPLEDISPLAY=y
CONFIG_APPLE_MFI_FASTCHARGE=y
CONFIG_USB_LJCA=y
# CONFIG_USB_USBIO is not set
CONFIG_USB_SISUSBVGA=y
CONFIG_USB_LD=y
CONFIG_USB_TRANCEVIBRATOR=y
CONFIG_USB_IOWARRIOR=y
CONFIG_USB_TEST=y
CONFIG_USB_EHSET_TEST_FIXTURE=y
CONFIG_USB_ISIGHTFW=y
CONFIG_USB_YUREX=y
CONFIG_USB_EZUSB_FX2=y
CONFIG_USB_HUB_USB251XB=y
CONFIG_USB_HSIC_USB3503=y
CONFIG_USB_HSIC_USB4604=y
CONFIG_USB_LINK_LAYER_TEST=y
CONFIG_USB_CHAOSKEY=y
# CONFIG_USB_ONBOARD_DEV is not set
CONFIG_USB_ATM=y
CONFIG_USB_SPEEDTOUCH=y
CONFIG_USB_CXACRU=y
CONFIG_USB_UEAGLEATM=y
CONFIG_USB_XUSBATM=y

#
# USB Physical Layer drivers
#
CONFIG_USB_PHY=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_TAHVO_USB=y
CONFIG_TAHVO_USB_HOST_BY_DEFAULT=y
CONFIG_USB_ISP1301=y
# end of USB Physical Layer drivers

CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_U_SERIAL_CONSOLE=y

#
# USB Peripheral Controller
#
CONFIG_USB_GR_UDC=y
CONFIG_USB_R8A66597=y
CONFIG_USB_PXA27X=y
CONFIG_USB_SNP_CORE=y
# CONFIG_USB_SNP_UDC_PLAT is not set
# CONFIG_USB_M66592 is not set
CONFIG_USB_BDC_UDC=y
CONFIG_USB_AMD5536UDC=y
CONFIG_USB_NET2280=y
CONFIG_USB_GOKU=y
CONFIG_USB_EG20T=y
# CONFIG_USB_GADGET_XILINX is not set
CONFIG_USB_MAX3420_UDC=y
CONFIG_USB_CDNS2_UDC=y
CONFIG_USB_DUMMY_HCD=y
# end of USB Peripheral Controller

CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_F_ACM=y
CONFIG_USB_F_SS_LB=y
CONFIG_USB_U_SERIAL=y
CONFIG_USB_U_ETHER=y
CONFIG_USB_U_AUDIO=y
CONFIG_USB_F_SERIAL=y
CONFIG_USB_F_OBEX=y
CONFIG_USB_F_NCM=y
CONFIG_USB_F_ECM=y
CONFIG_USB_F_PHONET=y
CONFIG_USB_F_EEM=y
CONFIG_USB_F_SUBSET=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_FS=y
CONFIG_USB_F_UAC1=y
CONFIG_USB_F_UAC1_LEGACY=y
CONFIG_USB_F_UAC2=y
CONFIG_USB_F_UVC=y
CONFIG_USB_F_MIDI=y
CONFIG_USB_F_MIDI2=y
CONFIG_USB_F_HID=y
CONFIG_USB_F_PRINTER=y
CONFIG_USB_F_TCM=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_PHONET=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_UAC1=y
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_MIDI2=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_CONFIGFS_F_TCM=y

#
# USB Gadget precomposed configurations
#
# CONFIG_USB_ZERO is not set
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_ETH is not set
# CONFIG_USB_G_NCM is not set
CONFIG_USB_GADGETFS=y
# CONFIG_USB_FUNCTIONFS is not set
# CONFIG_USB_MASS_STORAGE is not set
# CONFIG_USB_GADGET_TARGET is not set
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
# CONFIG_USB_CDC_COMPOSITE is not set
# CONFIG_USB_G_NOKIA is not set
# CONFIG_USB_G_ACM_MS is not set
# CONFIG_USB_G_MULTI is not set
# CONFIG_USB_G_HID is not set
# CONFIG_USB_G_DBGP is not set
# CONFIG_USB_G_WEBCAM is not set
CONFIG_USB_RAW_GADGET=y
# end of USB Gadget precomposed configurations

CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_TYPEC_MT6360=y
CONFIG_TYPEC_TCPCI_MT6370=y
CONFIG_TYPEC_TCPCI_MAXIM=y
CONFIG_TYPEC_FUSB302=y
CONFIG_TYPEC_WCOVE=y
CONFIG_TYPEC_UCSI=y
CONFIG_UCSI_CCG=y
CONFIG_UCSI_ACPI=y
CONFIG_UCSI_STM32G0=y
CONFIG_TYPEC_TPS6598X=y
CONFIG_TYPEC_ANX7411=y
CONFIG_TYPEC_RT1719=y
CONFIG_TYPEC_HD3SS3220=y
CONFIG_TYPEC_STUSB160X=y
CONFIG_TYPEC_WUSB3801=y

#
# USB Type-C Multiplexer/DeMultiplexer Switch support
#
CONFIG_TYPEC_MUX_FSA4480=y
CONFIG_TYPEC_MUX_GPIO_SBU=y
CONFIG_TYPEC_MUX_PI3USB30532=y
CONFIG_TYPEC_MUX_INTEL_PMC=y
# CONFIG_TYPEC_MUX_IT5205 is not set
CONFIG_TYPEC_MUX_NB7VPQ904M=y
# CONFIG_TYPEC_MUX_PS883X is not set
CONFIG_TYPEC_MUX_PTN36502=y
# CONFIG_TYPEC_MUX_TUSB1046 is not set
CONFIG_TYPEC_MUX_WCD939X_USBSS=y
# end of USB Type-C Multiplexer/DeMultiplexer Switch support

#
# USB Type-C Alternate Mode drivers
#
CONFIG_TYPEC_DP_ALTMODE=y
CONFIG_TYPEC_NVIDIA_ALTMODE=y
# CONFIG_TYPEC_TBT_ALTMODE is not set
# end of USB Type-C Alternate Mode drivers

CONFIG_USB_ROLE_SWITCH=y
CONFIG_USB_ROLES_INTEL_XHCI=y
CONFIG_MMC=y
# CONFIG_PWRSEQ_EMMC is not set
# CONFIG_PWRSEQ_SD8787 is not set
# CONFIG_PWRSEQ_SIMPLE is not set
# CONFIG_MMC_BLOCK is not set
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set
# CONFIG_MMC_CRYPTO is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_WBSD is not set
# CONFIG_MMC_TIFM_SD is not set
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_SDRICOH_CS is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MMC_VUB300=y
CONFIG_MMC_USHC=y
# CONFIG_MMC_USDHI6ROL0 is not set
CONFIG_MMC_REALTEK_USB=y
# CONFIG_MMC_CQHCI is not set
# CONFIG_MMC_HSQ is not set
# CONFIG_MMC_TOSHIBA_PCI is not set
# CONFIG_MMC_MTK is not set
# CONFIG_SCSI_UFSHCD is not set
CONFIG_MEMSTICK=y
# CONFIG_MEMSTICK_DEBUG is not set

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
# CONFIG_MSPRO_BLOCK is not set
# CONFIG_MS_BLOCK is not set

#
# MemoryStick Host Controller Drivers
#
# CONFIG_MEMSTICK_TIFM_MS is not set
# CONFIG_MEMSTICK_JMICRON_38X is not set
# CONFIG_MEMSTICK_R592 is not set
CONFIG_MEMSTICK_REALTEK_USB=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_CLASS_FLASH is not set
CONFIG_LEDS_CLASS_MULTICOLOR=y
# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set

#
# LED drivers
#
# CONFIG_LEDS_AN30259A is not set
# CONFIG_LEDS_APU is not set
# CONFIG_LEDS_OSRAM_AMS_AS3668 is not set
# CONFIG_LEDS_AW200XX is not set
# CONFIG_LEDS_AW2013 is not set
# CONFIG_LEDS_BCM6328 is not set
# CONFIG_LEDS_BCM6358 is not set
# CONFIG_LEDS_CHT_WCOVE is not set
# CONFIG_LEDS_CR0014114 is not set
# CONFIG_LEDS_EL15203000 is not set
# CONFIG_LEDS_LM3530 is not set
# CONFIG_LEDS_LM3532 is not set
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_LM3692X is not set
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_LP3952 is not set
# CONFIG_LEDS_LP50XX is not set
# CONFIG_LEDS_LP55XX_COMMON is not set
# CONFIG_LEDS_LP8860 is not set
# CONFIG_LEDS_LP8864 is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA963X is not set
# CONFIG_LEDS_PCA995X is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2606MVV is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_TLC591XX is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_IS31FL319X is not set
# CONFIG_LEDS_IS31FL32XX is not set

#
# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
#
# CONFIG_LEDS_BLINKM is not set
# CONFIG_LEDS_SYSCON is not set
# CONFIG_LEDS_MLXCPLD is not set
# CONFIG_LEDS_MLXREG is not set
# CONFIG_LEDS_USER is not set
# CONFIG_LEDS_NIC78BX is not set
# CONFIG_LEDS_SPI_BYTE is not set
# CONFIG_LEDS_LM3697 is not set
# CONFIG_LEDS_ST1202 is not set
# CONFIG_LEDS_LTC3220 is not set
# CONFIG_LEDS_LGM is not set

#
# Flash and Torch LED drivers
#

#
# RGB LED drivers
#
# CONFIG_LEDS_GROUP_MULTICOLOR is not set
# CONFIG_LEDS_KTD202X is not set
# CONFIG_LEDS_LP5812 is not set
# CONFIG_LEDS_LP5860_CORE is not set
# CONFIG_LEDS_LP5860_SPI is not set
# CONFIG_LEDS_NCP5623 is not set
# CONFIG_LEDS_MT6370_RGB is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
# CONFIG_LEDS_TRIGGER_DISK is not set
# CONFIG_LEDS_TRIGGER_MTD is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_CPU is not set
# CONFIG_LEDS_TRIGGER_ACTIVITY is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_LEDS_TRIGGER_PANIC is not set
# CONFIG_LEDS_TRIGGER_NETDEV is not set
# CONFIG_LEDS_TRIGGER_PATTERN is not set
# CONFIG_LEDS_TRIGGER_TTY is not set
# CONFIG_LEDS_TRIGGER_INPUT_EVENTS is not set

#
# Simatic LED drivers
#
# CONFIG_ACCESSIBILITY is not set
CONFIG_INFINIBAND=y
CONFIG_INFINIBAND_USER_MAD=y
CONFIG_INFINIBAND_USER_ACCESS=y
CONFIG_INFINIBAND_USER_ACCESS_CORE=y
CONFIG_INFINIBAND_USER_MEM=y
CONFIG_INFINIBAND_ON_DEMAND_PAGING=y
CONFIG_INFINIBAND_ADDR_TRANS=y
CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y
CONFIG_INFINIBAND_VIRT_DMA=y
# CONFIG_INFINIBAND_EFA is not set
# CONFIG_INFINIBAND_ERDMA is not set
CONFIG_MLX4_INFINIBAND=y
# CONFIG_INFINIBAND_MTHCA is not set
# CONFIG_INFINIBAND_OCRDMA is not set
# CONFIG_INFINIBAND_USNIC is not set
# CONFIG_INFINIBAND_VMWARE_PVRDMA is not set
# CONFIG_INFINIBAND_RDMAVT is not set
CONFIG_RDMA_RXE=y
CONFIG_RDMA_SIW=y
CONFIG_INFINIBAND_IPOIB=y
CONFIG_INFINIBAND_IPOIB_CM=y
CONFIG_INFINIBAND_IPOIB_DEBUG=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
CONFIG_INFINIBAND_SRP=y
# CONFIG_INFINIBAND_SRPT is not set
CONFIG_INFINIBAND_ISER=y
CONFIG_INFINIBAND_RTRS=y
CONFIG_INFINIBAND_RTRS_CLIENT=y
# CONFIG_INFINIBAND_RTRS_SERVER is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EDAC=y
# CONFIG_EDAC_DEBUG is not set
# CONFIG_EDAC_DECODE_MCE is not set
# CONFIG_EDAC_SCRUB is not set
# CONFIG_EDAC_ECS is not set
# CONFIG_EDAC_MEM_REPAIR is not set
# CONFIG_EDAC_E752X is not set
# CONFIG_EDAC_I82975X is not set
# CONFIG_EDAC_I3000 is not set
# CONFIG_EDAC_I3200 is not set
# CONFIG_EDAC_IE31200 is not set
# CONFIG_EDAC_X38 is not set
# CONFIG_EDAC_I5400 is not set
# CONFIG_EDAC_I7CORE is not set
# CONFIG_EDAC_I5100 is not set
# CONFIG_EDAC_I7300 is not set
# CONFIG_EDAC_SBRIDGE is not set
# CONFIG_EDAC_SKX is not set
# CONFIG_EDAC_I10NM is not set
# CONFIG_EDAC_IMH is not set
# CONFIG_EDAC_PND2 is not set
# CONFIG_EDAC_IGEN6 is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_MC146818_LIB=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
# CONFIG_RTC_NVMEM is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_ABB5ZES3 is not set
# CONFIG_RTC_DRV_ABEOZ9 is not set
# CONFIG_RTC_DRV_ABX80X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_HYM8563 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_MAX31335 is not set
# CONFIG_RTC_DRV_NCT3018Y is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_ISL12026 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF85363 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_TWL4030 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8010 is not set
# CONFIG_RTC_DRV_RX8111 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3028 is not set
# CONFIG_RTC_DRV_RV3032 is not set
# CONFIG_RTC_DRV_RV8803 is not set
# CONFIG_RTC_DRV_SD2405AL is not set
# CONFIG_RTC_DRV_SD3078 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1302 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1343 is not set
# CONFIG_RTC_DRV_DS1347 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6916 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RX4581 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_MCP795 is not set
CONFIG_RTC_I2C_AND_SPI=y

#
# SPI and I2C RTC drivers
#
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_PCF2127 is not set
# CONFIG_RTC_DRV_PCF85063 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# CONFIG_RTC_DRV_RX6110 is not set

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_ZYNQMP is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_CADENCE is not set
# CONFIG_RTC_DRV_FTRTC010 is not set
# CONFIG_RTC_DRV_R7301 is not set
# CONFIG_RTC_DRV_GOLDFISH is not set

#
# HID Sensor RTC drivers
#
CONFIG_RTC_DRV_HID_SENSOR_TIME=y
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
CONFIG_DMA_ENGINE=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DMA_ACPI=y
CONFIG_DMA_OF=y
# CONFIG_ALTERA_MSGDMA is not set
# CONFIG_DW_AXI_DMAC is not set
# CONFIG_FSL_EDMA is not set
CONFIG_INTEL_IDMA64=y
# CONFIG_INTEL_IDXD is not set
# CONFIG_INTEL_IDXD_COMPAT is not set
CONFIG_INTEL_IOATDMA=y
# CONFIG_PLX_DMA is not set
# CONFIG_SWITCHTEC_DMA is not set
# CONFIG_XILINX_DMA is not set
# CONFIG_XILINX_XDMA is not set
# CONFIG_XILINX_ZYNQMP_DPDMA is not set
# CONFIG_AMD_PTDMA is not set
# CONFIG_AMD_QDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_HIDMA is not set
CONFIG_DW_DMAC_CORE=y
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
# CONFIG_DW_EDMA is not set
CONFIG_HSU_DMA=y
# CONFIG_SF_PDMA is not set
# CONFIG_INTEL_LDMA is not set

#
# DMA Clients
#
CONFIG_ASYNC_TX_DMA=y
# CONFIG_DMATEST is not set
CONFIG_DMA_ENGINE_RAID=y

#
# DMABUF options
#
CONFIG_SYNC_FILE=y
CONFIG_SW_SYNC=y
CONFIG_UDMABUF=y
# CONFIG_DMABUF_DEBUG is not set
CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_HEAPS_SYSTEM=y
# CONFIG_DMABUF_HEAPS_SYSTEM_CC_SHARED is not set
CONFIG_DMABUF_HEAPS_CMA=y
# end of DMABUF options

CONFIG_DCA=y
# CONFIG_UIO is not set
CONFIG_VFIO=y
CONFIG_VFIO_DEVICE_CDEV=y
# CONFIG_VFIO_GROUP is not set
# CONFIG_VFIO_NOIOMMU is not set
CONFIG_VFIO_VIRQFD=y
# CONFIG_VFIO_DEBUGFS is not set

#
# VFIO support for PCI devices
#
CONFIG_VFIO_PCI_CORE=y
CONFIG_VFIO_PCI_INTX=y
CONFIG_VFIO_PCI=y
# CONFIG_VFIO_PCI_VGA is not set
# CONFIG_VFIO_PCI_IGD is not set
# CONFIG_VIRTIO_VFIO_PCI is not set
# end of VFIO support for PCI devices

CONFIG_IRQ_BYPASS_MANAGER=y
# CONFIG_VIRT_DRIVERS is not set
CONFIG_VIRTIO_ANCHOR=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI_LIB=y
CONFIG_VIRTIO_PCI_LIB_LEGACY=y
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_ADMIN_LEGACY=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_VDPA=y
CONFIG_VIRTIO_PMEM=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MEM=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_DMA_SHARED_BUFFER=y
# CONFIG_VIRTIO_DEBUG is not set
# CONFIG_VIRTIO_RTC is not set
CONFIG_VDPA=y
CONFIG_VDPA_SIM=y
CONFIG_VDPA_SIM_NET=y
CONFIG_VDPA_SIM_BLOCK=y
# CONFIG_VDPA_USER is not set
# CONFIG_IFCVF is not set
# CONFIG_MLX5_VDPA_STEERING_DEBUG is not set
CONFIG_VP_VDPA=y
# CONFIG_ALIBABA_ENI_VDPA is not set
# CONFIG_SNET_VDPA is not set
# CONFIG_OCTEONEP_VDPA is not set
CONFIG_VHOST_IOTLB=y
CONFIG_VHOST_RING=y
CONFIG_VHOST_TASK=y
CONFIG_VHOST=y
CONFIG_VHOST_MENU=y
CONFIG_VHOST_NET=y
# CONFIG_VHOST_SCSI is not set
CONFIG_VHOST_VSOCK=y
CONFIG_VHOST_VDPA=y
CONFIG_VHOST_CROSS_ENDIAN_LEGACY=y
CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set
# end of Microsoft Hyper-V guest support

CONFIG_GREYBUS=y
# CONFIG_GREYBUS_BEAGLEPLAY is not set
CONFIG_GREYBUS_ES2=y
CONFIG_COMEDI=y
# CONFIG_COMEDI_DEBUG is not set
CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
CONFIG_COMEDI_MISC_DRIVERS=y
CONFIG_COMEDI_BOND=y
CONFIG_COMEDI_TEST=y
CONFIG_COMEDI_PARPORT=y
CONFIG_COMEDI_ISA_DRIVERS=y
CONFIG_COMEDI_PCL711=y
CONFIG_COMEDI_PCL724=y
CONFIG_COMEDI_PCL726=y
CONFIG_COMEDI_PCL730=y
CONFIG_COMEDI_PCL812=y
CONFIG_COMEDI_PCL816=y
CONFIG_COMEDI_PCL818=y
CONFIG_COMEDI_PCM3724=y
CONFIG_COMEDI_AMPLC_DIO200_ISA=y
CONFIG_COMEDI_AMPLC_PC236_ISA=y
CONFIG_COMEDI_AMPLC_PC263_ISA=y
CONFIG_COMEDI_RTI800=y
CONFIG_COMEDI_RTI802=y
CONFIG_COMEDI_DAC02=y
CONFIG_COMEDI_DAS16M1=y
CONFIG_COMEDI_DAS08_ISA=y
# CONFIG_COMEDI_DAS16 is not set
CONFIG_COMEDI_DAS800=y
CONFIG_COMEDI_DAS1800=y
CONFIG_COMEDI_DAS6402=y
CONFIG_COMEDI_DT2801=y
CONFIG_COMEDI_DT2811=y
CONFIG_COMEDI_DT2814=y
CONFIG_COMEDI_DT2815=y
CONFIG_COMEDI_DT2817=y
CONFIG_COMEDI_DT282X=y
CONFIG_COMEDI_DMM32AT=y
CONFIG_COMEDI_FL512=y
CONFIG_COMEDI_AIO_AIO12_8=y
CONFIG_COMEDI_AIO_IIRO_16=y
# CONFIG_COMEDI_II_PCI20KC is not set
CONFIG_COMEDI_C6XDIGIO=y
CONFIG_COMEDI_MPC624=y
CONFIG_COMEDI_ADQ12B=y
CONFIG_COMEDI_NI_AT_A2150=y
CONFIG_COMEDI_NI_AT_AO=y
# CONFIG_COMEDI_NI_ATMIO is not set
CONFIG_COMEDI_NI_ATMIO16D=y
CONFIG_COMEDI_NI_LABPC_ISA=y
CONFIG_COMEDI_PCMAD=y
CONFIG_COMEDI_PCMDA12=y
CONFIG_COMEDI_PCMMIO=y
CONFIG_COMEDI_PCMUIO=y
CONFIG_COMEDI_MULTIQ3=y
CONFIG_COMEDI_S526=y
CONFIG_COMEDI_PCI_DRIVERS=y
CONFIG_COMEDI_8255_PCI=y
# CONFIG_COMEDI_ADDI_APCI_1032 is not set
# CONFIG_COMEDI_ADDI_APCI_1500 is not set
# CONFIG_COMEDI_ADDI_APCI_1516 is not set
# CONFIG_COMEDI_ADDI_APCI_1564 is not set
# CONFIG_COMEDI_ADDI_APCI_16XX is not set
# CONFIG_COMEDI_ADDI_APCI_2032 is not set
# CONFIG_COMEDI_ADDI_APCI_2200 is not set
# CONFIG_COMEDI_ADDI_APCI_3120 is not set
# CONFIG_COMEDI_ADDI_APCI_3501 is not set
# CONFIG_COMEDI_ADDI_APCI_3XXX is not set
# CONFIG_COMEDI_ADL_PCI6208 is not set
# CONFIG_COMEDI_ADL_PCI7250 is not set
# CONFIG_COMEDI_ADL_PCI7X3X is not set
# CONFIG_COMEDI_ADL_PCI8164 is not set
# CONFIG_COMEDI_ADL_PCI9111 is not set
CONFIG_COMEDI_ADL_PCI9118=y
# CONFIG_COMEDI_ADV_PCI1710 is not set
# CONFIG_COMEDI_ADV_PCI1720 is not set
# CONFIG_COMEDI_ADV_PCI1723 is not set
# CONFIG_COMEDI_ADV_PCI1724 is not set
# CONFIG_COMEDI_ADV_PCI1760 is not set
# CONFIG_COMEDI_ADV_PCI_DIO is not set
# CONFIG_COMEDI_AMPLC_DIO200_PCI is not set
# CONFIG_COMEDI_AMPLC_PC236_PCI is not set
# CONFIG_COMEDI_AMPLC_PC263_PCI is not set
# CONFIG_COMEDI_AMPLC_PCI224 is not set
# CONFIG_COMEDI_AMPLC_PCI230 is not set
# CONFIG_COMEDI_CONTEC_PCI_DIO is not set
# CONFIG_COMEDI_DAS08_PCI is not set
# CONFIG_COMEDI_DT3000 is not set
# CONFIG_COMEDI_DYNA_PCI10XX is not set
# CONFIG_COMEDI_GSC_HPDI is not set
# CONFIG_COMEDI_MF6X4 is not set
# CONFIG_COMEDI_ICP_MULTI is not set
# CONFIG_COMEDI_DAQBOARD2000 is not set
# CONFIG_COMEDI_JR3_PCI is not set
# CONFIG_COMEDI_KE_COUNTER is not set
# CONFIG_COMEDI_CB_PCIDAS64 is not set
# CONFIG_COMEDI_CB_PCIDAS is not set
# CONFIG_COMEDI_CB_PCIDDA is not set
# CONFIG_COMEDI_CB_PCIMDAS is not set
# CONFIG_COMEDI_CB_PCIMDDA is not set
# CONFIG_COMEDI_ME4000 is not set
# CONFIG_COMEDI_ME_DAQ is not set
# CONFIG_COMEDI_NI_6527 is not set
# CONFIG_COMEDI_NI_65XX is not set
# CONFIG_COMEDI_NI_660X is not set
# CONFIG_COMEDI_NI_670X is not set
CONFIG_COMEDI_NI_LABPC_PCI=y
# CONFIG_COMEDI_NI_PCIDIO is not set
# CONFIG_COMEDI_NI_PCIMIO is not set
# CONFIG_COMEDI_RTD520 is not set
# CONFIG_COMEDI_S626 is not set
CONFIG_COMEDI_PCMCIA_DRIVERS=y
# CONFIG_COMEDI_CB_DAS16_CS is not set
# CONFIG_COMEDI_DAS08_CS is not set
CONFIG_COMEDI_NI_DAQ_700_CS=y
# CONFIG_COMEDI_NI_DAQ_DIO24_CS is not set
CONFIG_COMEDI_NI_LABPC_CS=y
# CONFIG_COMEDI_NI_MIO_CS is not set
# CONFIG_COMEDI_QUATECH_DAQP_CS is not set
CONFIG_COMEDI_USB_DRIVERS=y
CONFIG_COMEDI_DT9812=y
CONFIG_COMEDI_NI_USB6501=y
CONFIG_COMEDI_USBDUX=y
CONFIG_COMEDI_USBDUXFAST=y
CONFIG_COMEDI_USBDUXSIGMA=y
CONFIG_COMEDI_VMK80XX=y
CONFIG_COMEDI_8254=y
CONFIG_COMEDI_8255=y
CONFIG_COMEDI_8255_SA=y
CONFIG_COMEDI_KCOMEDILIB=y
CONFIG_COMEDI_AMPLC_DIO200=y
CONFIG_COMEDI_AMPLC_PC236=y
CONFIG_COMEDI_DAS08=y
CONFIG_COMEDI_ISADMA=y
CONFIG_COMEDI_NI_LABPC=y
CONFIG_COMEDI_NI_LABPC_ISADMA=y
# CONFIG_COMEDI_TESTS is not set
# CONFIG_GPIB is not set
CONFIG_STAGING=y
# CONFIG_RTL8723BS is not set

#
# IIO staging drivers
#

#
# Accelerometers
#
# CONFIG_ADIS16203 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD7816 is not set
# end of Analog to digital converters

#
# Analog digital bi-direction converters
#
# CONFIG_ADT7316 is not set
# end of Analog digital bi-direction converters

#
# Direct Digital Synthesis
#
# CONFIG_AD9832 is not set
# CONFIG_AD9834 is not set
# end of Direct Digital Synthesis

#
# Network Analyzer, Impedance Converters
#
# CONFIG_AD5933 is not set
# end of Network Analyzer, Impedance Converters
# end of IIO staging drivers

# CONFIG_FB_SM750 is not set
# CONFIG_STAGING_MEDIA is not set
# CONFIG_FB_TFT is not set
# CONFIG_MOST_COMPONENTS is not set
# CONFIG_GREYBUS_AUDIO is not set
# CONFIG_GREYBUS_BOOTROM is not set
# CONFIG_GREYBUS_FIRMWARE is not set
CONFIG_GREYBUS_HID=y
# CONFIG_GREYBUS_LOG is not set
# CONFIG_GREYBUS_LOOPBACK is not set
# CONFIG_GREYBUS_POWER is not set
# CONFIG_GREYBUS_RAW is not set
# CONFIG_GREYBUS_VIBRATOR is not set
CONFIG_GREYBUS_BRIDGED_PHY=y
# CONFIG_GREYBUS_GPIO is not set
# CONFIG_GREYBUS_I2C is not set
# CONFIG_GREYBUS_SDIO is not set
# CONFIG_GREYBUS_SPI is not set
# CONFIG_GREYBUS_UART is not set
CONFIG_GREYBUS_USB=y
# CONFIG_XIL_AXIS_FIFO is not set
# CONFIG_VME_BUS is not set
# CONFIG_GOLDFISH is not set
# CONFIG_CHROME_PLATFORMS is not set
# CONFIG_MELLANOX_PLATFORM is not set
CONFIG_SURFACE_PLATFORMS=y
# CONFIG_SURFACE3_WMI is not set
# CONFIG_SURFACE_3_POWER_OPREGION is not set
# CONFIG_SURFACE_ACPI_NOTIFY is not set
# CONFIG_SURFACE_AGGREGATOR_CDEV is not set
# CONFIG_SURFACE_AGGREGATOR_HUB is not set
CONFIG_SURFACE_AGGREGATOR_REGISTRY=y
# CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH is not set
# CONFIG_SURFACE_DTX is not set
# CONFIG_SURFACE_GPE is not set
# CONFIG_SURFACE_HOTPLUG is not set
# CONFIG_SURFACE_PLATFORM_PROFILE is not set
# CONFIG_SURFACE_PRO3_BUTTON is not set
CONFIG_SURFACE_AGGREGATOR=y
CONFIG_SURFACE_AGGREGATOR_BUS=y
CONFIG_X86_PLATFORM_DEVICES=y
CONFIG_WMI_BMOF=y
# CONFIG_HUAWEI_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_UNIWILL is not set
# CONFIG_MXM_WMI is not set
# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set
# CONFIG_XIAOMI_WMI is not set
# CONFIG_REDMI_WMI is not set
# CONFIG_GIGABYTE_WMI is not set
# CONFIG_BITLAND_MIFS_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ACER_WIRELESS is not set
# CONFIG_ACER_WMI is not set

#
# AMD HSMP Driver
#
# CONFIG_AMD_HSMP_ACPI is not set
# CONFIG_AMD_HSMP_PLAT is not set
# end of AMD HSMP Driver

# CONFIG_AMD_PMC is not set
# CONFIG_AMD_HFI is not set
# CONFIG_AMD_3D_VCACHE is not set
# CONFIG_AMD_WBRF is not set
# CONFIG_AMD_HALO_LED is not set
# CONFIG_AMD_ISP_PLATFORM is not set
# CONFIG_ADV_SWBUTTON is not set
# CONFIG_APPLE_GMUX is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_ASUS_WIRELESS is not set
# CONFIG_ASUS_ARMOURY is not set
CONFIG_ASUS_WMI=y
# CONFIG_ASUS_WMI_DEPRECATED_ATTRS is not set
# CONFIG_ASUS_NB_WMI is not set
CONFIG_ASUS_TF103C_DOCK=y
# CONFIG_AYANEO_EC is not set
CONFIG_EEEPC_LAPTOP=y
# CONFIG_EEEPC_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_DELL is not set
# CONFIG_AMILO_RFKILL is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_GPD_POCKET_FAN is not set
# CONFIG_X86_PLATFORM_DRIVERS_HP is not set
# CONFIG_WIRELESS_HOTKEY is not set
# CONFIG_IBM_RTL is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_INTEL_ATOMISP2_PM is not set
# CONFIG_INTEL_IFS is not set
# CONFIG_INTEL_SAR_INT1092 is not set
# CONFIG_INTEL_SKL_INT3472 is not set

#
# Intel Speed Select Technology interface support
#
# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set
# end of Intel Speed Select Technology interface support

# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set
# CONFIG_INTEL_WMI_THUNDERBOLT is not set

#
# Intel Uncore Frequency Control
#
# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set
# end of Intel Uncore Frequency Control

# CONFIG_INTEL_HID_EVENT is not set
# CONFIG_INTEL_VBTN is not set
# CONFIG_INTEL_EHL_PSE_IO is not set
# CONFIG_INTEL_INT0002_VGPIO is not set
# CONFIG_INTEL_OAKTRAIL is not set
# CONFIG_INTEL_BXTWC_PMIC_TMU is not set
CONFIG_INTEL_CHTWC_INT33FE=y
CONFIG_INTEL_ISHTP_ECLITE=y
# CONFIG_INTEL_PUNIT_IPC is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_INTEL_TURBO_MAX_3 is not set
# CONFIG_INTEL_VSEC is not set
# CONFIG_IDEAPAD_LAPTOP is not set
# CONFIG_LENOVO_WMI_HOTKEY_UTILITIES is not set
# CONFIG_LENOVO_WMI_CAMERA is not set
# CONFIG_LENOVO_YB9_KBDOCK is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_THINKPAD_LMI is not set
# CONFIG_YOGABOOK is not set
# CONFIG_YT2_1380 is not set
# CONFIG_LENOVO_WMI_GAMEZONE is not set
# CONFIG_LENOVO_WMI_TUNING is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_MEEGOPAD_ANX7428 is not set
# CONFIG_MSI_EC is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_MSI_WMI is not set
# CONFIG_MSI_WMI_PLATFORM is not set
# CONFIG_PCENGINES_APU2 is not set
# CONFIG_PORTWELL_EC is not set
# CONFIG_BARCO_P50_GPIO is not set
# CONFIG_SAMSUNG_GALAXYBOOK is not set
# CONFIG_SAMSUNG_LAPTOP is not set
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_LG_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
# CONFIG_SYSTEM76_ACPI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_SERIAL_MULTI_INSTANTIATE is not set
# CONFIG_INSPUR_PLATFORM_PROFILE is not set
# CONFIG_DASHARO_ACPI is not set
# CONFIG_INTEL_IPS is not set
CONFIG_INTEL_SCU_IPC=y
# CONFIG_INTEL_SCU_PCI is not set
# CONFIG_INTEL_SCU_PLATFORM is not set
# CONFIG_SIEMENS_SIMATIC_IPC is not set
# CONFIG_SILICOM_PLATFORM is not set
# CONFIG_WINMATE_FM07_KEYS is not set
# CONFIG_OXP_EC is not set
# CONFIG_TUXEDO_NB04_WMI_AB is not set
CONFIG_P2SB=y
CONFIG_ACPI_WMI=y
# CONFIG_ACPI_WMI_LEGACY_DEVICE_NAMES is not set
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y
# CONFIG_LMK04832 is not set
# CONFIG_COMMON_CLK_MAX9485 is not set
# CONFIG_COMMON_CLK_SI5341 is not set
# CONFIG_COMMON_CLK_SI5351 is not set
# CONFIG_COMMON_CLK_SI514 is not set
# CONFIG_COMMON_CLK_SI544 is not set
# CONFIG_COMMON_CLK_SI570 is not set
# CONFIG_COMMON_CLK_CDCE706 is not set
# CONFIG_COMMON_CLK_CDCE925 is not set
# CONFIG_COMMON_CLK_CS2000_CP is not set
# CONFIG_CLK_TWL is not set
# CONFIG_COMMON_CLK_AXI_CLKGEN is not set
# CONFIG_COMMON_CLK_RS9_PCIE is not set
# CONFIG_COMMON_CLK_SI521XX is not set
# CONFIG_COMMON_CLK_VC3 is not set
# CONFIG_COMMON_CLK_VC5 is not set
# CONFIG_COMMON_CLK_VC7 is not set
# CONFIG_COMMON_CLK_FIXED_MMIO is not set

#
# Cixtech Audio Subsystem Clock Driver
#
# end of Cixtech Audio Subsystem Clock Driver

# CONFIG_CLK_LGM_CGU is not set
# CONFIG_XILINX_VCU is not set
# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set
# CONFIG_HWSPINLOCK is not set

#
# Clock Source drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# end of Clock Source drivers

CONFIG_MAILBOX=y
# CONFIG_PLATFORM_MHU is not set
CONFIG_PCC=y
# CONFIG_ALTERA_MBOX is not set
# CONFIG_MAILBOX_TEST is not set
CONFIG_IOMMU_IOVA=y
CONFIG_IOMMU_API=y
CONFIG_IOMMUFD_DRIVER=y
CONFIG_IOMMU_SUPPORT=y

#
# Generic IOMMU Pagetable Support
#
# end of Generic IOMMU Pagetable Support

# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set
CONFIG_IOMMU_DEFAULT_DMA_LAZY=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_OF_IOMMU=y
CONFIG_IOMMU_DMA=y
CONFIG_IOMMU_SVA=y
CONFIG_IOMMU_IOPF=y
CONFIG_AMD_IOMMU=y
# CONFIG_AMD_IOMMU_IOMMUFD is not set
CONFIG_DMAR_TABLE=y
CONFIG_INTEL_IOMMU=y
CONFIG_INTEL_IOMMU_SVM=y
CONFIG_INTEL_IOMMU_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_PERF_EVENTS=y
CONFIG_IOMMUFD_DRIVER_CORE=y
CONFIG_IOMMUFD=y
CONFIG_IOMMUFD_TEST=y
CONFIG_IRQ_REMAP=y
# CONFIG_VIRTIO_IOMMU is not set
CONFIG_GENERIC_PT=y
CONFIG_DEBUG_GENERIC_PT=y
CONFIG_IOMMU_PT=y
CONFIG_IOMMU_PT_AMDV1=y
CONFIG_IOMMU_PT_VTDSS=y
# CONFIG_IOMMU_PT_RISCV64 is not set
CONFIG_IOMMU_PT_X86_64=y

#
# Remoteproc drivers
#
# CONFIG_REMOTEPROC is not set
# end of Remoteproc drivers

#
# Rpmsg drivers
#
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
# CONFIG_RPMSG_VIRTIO is not set
# end of Rpmsg drivers

CONFIG_SOUNDWIRE=y

#
# SoundWire Devices
#
# CONFIG_SOUNDWIRE_AMD is not set
# CONFIG_SOUNDWIRE_INTEL is not set
# CONFIG_SOUNDWIRE_QCOM is not set

#
# SOC (System On Chip) specific Drivers
#

#
# Amlogic SoC drivers
#
# end of Amlogic SoC drivers

#
# Broadcom SoC drivers
#
# end of Broadcom SoC drivers

#
# NXP/Freescale QorIQ SoC drivers
#
# end of NXP/Freescale QorIQ SoC drivers

#
# fujitsu SoC drivers
#
# end of fujitsu SoC drivers

#
# i.MX SoC drivers
#
# end of i.MX SoC drivers

#
# Enable LiteX SoC Builder specific drivers
#
# CONFIG_LITEX_SOC_CONTROLLER is not set
# end of Enable LiteX SoC Builder specific drivers

# CONFIG_WPCM450_SOC is not set
CONFIG_QCOM_QMI_HELPERS=y
# CONFIG_SOC_TI is not set

#
# Xilinx SoC drivers
#
# end of Xilinx SoC drivers
# end of SOC (System On Chip) specific Drivers

#
# PM Domains
#

#
# Amlogic PM Domains
#
# end of Amlogic PM Domains

#
# Broadcom PM Domains
#
# end of Broadcom PM Domains

#
# i.MX PM Domains
#
# end of i.MX PM Domains

#
# Qualcomm PM Domains
#
# end of Qualcomm PM Domains
# end of PM Domains

# CONFIG_PM_DEVFREQ is not set
CONFIG_EXTCON=y

#
# Extcon Device Drivers
#
# CONFIG_EXTCON_ADC_JACK is not set
# CONFIG_EXTCON_FSA9480 is not set
# CONFIG_EXTCON_GPIO is not set
# CONFIG_EXTCON_INTEL_INT3496 is not set
CONFIG_EXTCON_INTEL_CHT_WC=y
# CONFIG_EXTCON_LC824206XA is not set
# CONFIG_EXTCON_MAX3355 is not set
# CONFIG_EXTCON_MAX14526 is not set
CONFIG_EXTCON_PTN5150=y
# CONFIG_EXTCON_RT8973A is not set
# CONFIG_EXTCON_SM5502 is not set
# CONFIG_EXTCON_USB_GPIO is not set
CONFIG_EXTCON_USBC_TUSB320=y
# CONFIG_MEMORY is not set
CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
# CONFIG_IIO_BUFFER_CB is not set
# CONFIG_IIO_BUFFER_DMA is not set
# CONFIG_IIO_BUFFER_DMAENGINE is not set
# CONFIG_IIO_BUFFER_HW_CONSUMER is not set
CONFIG_IIO_KFIFO_BUF=y
CONFIG_IIO_TRIGGERED_BUFFER=y
# CONFIG_IIO_CONFIGFS is not set
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
# CONFIG_IIO_SW_DEVICE is not set
# CONFIG_IIO_SW_TRIGGER is not set
# CONFIG_IIO_TRIGGERED_EVENT is not set

#
# Accelerometers
#
# CONFIG_ADIS16201 is not set
# CONFIG_ADIS16209 is not set
# CONFIG_ADXL313_I2C is not set
# CONFIG_ADXL313_SPI is not set
# CONFIG_ADXL345_I2C is not set
# CONFIG_ADXL345_SPI is not set
# CONFIG_ADXL355_I2C is not set
# CONFIG_ADXL355_SPI is not set
# CONFIG_ADXL367_SPI is not set
# CONFIG_ADXL367_I2C is not set
# CONFIG_ADXL372_SPI is not set
# CONFIG_ADXL372_I2C is not set
# CONFIG_ADXL380_SPI is not set
# CONFIG_ADXL380_I2C is not set
# CONFIG_BMA180 is not set
# CONFIG_BMA220 is not set
# CONFIG_BMA400 is not set
# CONFIG_BMC150_ACCEL is not set
# CONFIG_BMI088_ACCEL is not set
# CONFIG_DA280 is not set
# CONFIG_DA311 is not set
# CONFIG_DMARD06 is not set
# CONFIG_DMARD09 is not set
# CONFIG_DMARD10 is not set
# CONFIG_FXLS8962AF_I2C is not set
# CONFIG_FXLS8962AF_SPI is not set
CONFIG_HID_SENSOR_ACCEL_3D=y
# CONFIG_IIO_ST_ACCEL_3AXIS is not set
# CONFIG_IIO_KX022A_SPI is not set
# CONFIG_IIO_KX022A_I2C is not set
# CONFIG_KXSD9 is not set
# CONFIG_KXCJK1013 is not set
# CONFIG_MC3230 is not set
# CONFIG_MMA7455_I2C is not set
# CONFIG_MMA7455_SPI is not set
# CONFIG_MMA7660 is not set
# CONFIG_MMA8452 is not set
# CONFIG_MMA9551 is not set
# CONFIG_MMA9553 is not set
# CONFIG_MSA311 is not set
# CONFIG_MXC4005 is not set
# CONFIG_MXC6255 is not set
# CONFIG_SCA3000 is not set
# CONFIG_SCA3300 is not set
# CONFIG_STK8312 is not set
# CONFIG_STK8BA50 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD4000 is not set
# CONFIG_AD4080 is not set
# CONFIG_AD4130 is not set
# CONFIG_AD4134 is not set
# CONFIG_AD4170_4 is not set
# CONFIG_AD4691 is not set
# CONFIG_AD4695 is not set
# CONFIG_AD7091R5 is not set
# CONFIG_AD7091R8 is not set
# CONFIG_AD7124 is not set
# CONFIG_AD7173 is not set
# CONFIG_AD7191 is not set
# CONFIG_AD7192 is not set
# CONFIG_AD7266 is not set
# CONFIG_AD7280 is not set
# CONFIG_AD7291 is not set
# CONFIG_AD7292 is not set
# CONFIG_AD7298 is not set
# CONFIG_AD7380 is not set
# CONFIG_AD7476 is not set
# CONFIG_AD7606_IFACE_PARALLEL is not set
# CONFIG_AD7606_IFACE_SPI is not set
# CONFIG_AD7766 is not set
# CONFIG_AD7768_1 is not set
# CONFIG_AD7779 is not set
# CONFIG_AD7780 is not set
# CONFIG_AD7791 is not set
# CONFIG_AD7793 is not set
# CONFIG_AD7887 is not set
# CONFIG_AD7923 is not set
# CONFIG_AD7944 is not set
# CONFIG_AD7949 is not set
# CONFIG_AD799X is not set
# CONFIG_AD9467 is not set
# CONFIG_ADE9000 is not set
# CONFIG_CC10001_ADC is not set
CONFIG_DLN2_ADC=y
# CONFIG_ENVELOPE_DETECTOR is not set
# CONFIG_GEHC_PMC_ADC is not set
# CONFIG_HI8435 is not set
# CONFIG_HX711 is not set
# CONFIG_INA2XX_ADC is not set
# CONFIG_LTC2309 is not set
# CONFIG_LTC2471 is not set
# CONFIG_LTC2485 is not set
# CONFIG_LTC2496 is not set
# CONFIG_LTC2497 is not set
# CONFIG_MAX1027 is not set
# CONFIG_MAX11100 is not set
# CONFIG_MAX1118 is not set
# CONFIG_MAX11205 is not set
# CONFIG_MAX11410 is not set
# CONFIG_MAX1241 is not set
# CONFIG_MAX1363 is not set
# CONFIG_MAX14001 is not set
# CONFIG_MAX34408 is not set
# CONFIG_MAX9611 is not set
# CONFIG_MCP320X is not set
# CONFIG_MCP3422 is not set
# CONFIG_MCP3564 is not set
# CONFIG_MCP3911 is not set
# CONFIG_MEDIATEK_MT6360_ADC is not set
# CONFIG_MEDIATEK_MT6370_ADC is not set
# CONFIG_NAU7802 is not set
# CONFIG_NCT7201 is not set
# CONFIG_PAC1921 is not set
# CONFIG_PAC1934 is not set
# CONFIG_ROHM_BD79112 is not set
# CONFIG_ROHM_BD79124 is not set
# CONFIG_RICHTEK_RTQ6056 is not set
# CONFIG_SD_ADC_MODULATOR is not set
# CONFIG_TI_ADC081C is not set
# CONFIG_TI_ADC0832 is not set
# CONFIG_TI_ADC084S021 is not set
# CONFIG_TI_ADC108S102 is not set
# CONFIG_TI_ADC12138 is not set
# CONFIG_TI_ADC128S052 is not set
# CONFIG_TI_ADC161S626 is not set
# CONFIG_TI_ADS1015 is not set
# CONFIG_TI_ADS1018 is not set
# CONFIG_TI_ADS1100 is not set
# CONFIG_TI_ADS1119 is not set
# CONFIG_TI_ADS112C14 is not set
# CONFIG_TI_ADS124S08 is not set
# CONFIG_TI_ADS1298 is not set
# CONFIG_TI_ADS131E08 is not set
# CONFIG_TI_ADS131M02 is not set
# CONFIG_TI_ADS7138 is not set
# CONFIG_TI_ADS7924 is not set
# CONFIG_TI_ADS7950 is not set
# CONFIG_TI_ADS8344 is not set
# CONFIG_TI_ADS8688 is not set
# CONFIG_TI_LMP92064 is not set
# CONFIG_TI_TLC4541 is not set
# CONFIG_TI_TSC2046 is not set
# CONFIG_TWL4030_MADC is not set
# CONFIG_TWL6030_GPADC is not set
# CONFIG_VERSAL_SYSMON_I2C is not set
# CONFIG_VF610_ADC is not set
CONFIG_VIPERBOARD_ADC=y
# CONFIG_XILINX_XADC is not set
# end of Analog to digital converters

#
# Analog to digital and digital to analog converters
#
# CONFIG_AD74115 is not set
# CONFIG_AD74413R is not set
# end of Analog to digital and digital to analog converters

#
# Analog Front Ends
#
# CONFIG_IIO_RESCALE is not set
# end of Analog Front Ends

#
# Amplifiers
#
# CONFIG_AD8366 is not set
# CONFIG_ADA4250 is not set
# CONFIG_ADL8113 is not set
# CONFIG_HMC425 is not set
# end of Amplifiers

#
# Capacitance to digital converters
#
# CONFIG_AD7150 is not set
# CONFIG_AD7746 is not set
# end of Capacitance to digital converters

#
# Chemical Sensors
#
# CONFIG_AOSONG_AGS02MA is not set
# CONFIG_ATLAS_PH_SENSOR is not set
# CONFIG_ATLAS_EZO_SENSOR is not set
# CONFIG_BME680 is not set
# CONFIG_CCS811 is not set
# CONFIG_ENS160 is not set
# CONFIG_IAQCORE is not set
# CONFIG_MHZ19B is not set
# CONFIG_PMS7003 is not set
# CONFIG_SCD30_CORE is not set
# CONFIG_SCD4X is not set
# CONFIG_SEN0322 is not set
# CONFIG_SENSIRION_SGP30 is not set
# CONFIG_SENSIRION_SGP40 is not set
# CONFIG_SPS30_I2C is not set
# CONFIG_SPS30_SERIAL is not set
# CONFIG_SENSEAIR_SUNRISE_CO2 is not set
# CONFIG_VZ89X is not set
# end of Chemical Sensors

#
# Hid Sensor IIO Common
#
CONFIG_HID_SENSOR_IIO_COMMON=y
CONFIG_HID_SENSOR_IIO_TRIGGER=y
# end of Hid Sensor IIO Common

#
# IIO SCMI Sensors
#
# end of IIO SCMI Sensors

#
# SSP Sensor Common
#
# CONFIG_IIO_SSP_SENSORHUB is not set
# end of SSP Sensor Common

#
# Digital to analog converters
#
# CONFIG_AD3530R is not set
# CONFIG_AD3552R_HS is not set
# CONFIG_AD3552R is not set
# CONFIG_AD5064 is not set
# CONFIG_AD5360 is not set
# CONFIG_AD5380 is not set
# CONFIG_AD5421 is not set
# CONFIG_AD5446_SPI is not set
# CONFIG_AD5446_I2C is not set
# CONFIG_AD5449 is not set
# CONFIG_AD5592R is not set
# CONFIG_AD5593R is not set
# CONFIG_AD5504 is not set
# CONFIG_AD5624R_SPI is not set
# CONFIG_AD5706R is not set
# CONFIG_AD9739A is not set
# CONFIG_LTC2688 is not set
# CONFIG_AD5686_SPI is not set
# CONFIG_AD5696_I2C is not set
# CONFIG_AD5755 is not set
# CONFIG_AD5758 is not set
# CONFIG_AD5761 is not set
# CONFIG_AD5764 is not set
# CONFIG_AD5766 is not set
# CONFIG_AD5770R is not set
# CONFIG_AD5791 is not set
# CONFIG_AD7293 is not set
# CONFIG_AD7303 is not set
# CONFIG_AD8460 is not set
# CONFIG_AD8801 is not set
# CONFIG_BD79703 is not set
# CONFIG_CIO_DAC is not set
# CONFIG_DPOT_DAC is not set
# CONFIG_DS4424 is not set
# CONFIG_LTC1660 is not set
# CONFIG_LTC2632 is not set
# CONFIG_LTC2664 is not set
# CONFIG_M62332 is not set
# CONFIG_MAX517 is not set
# CONFIG_MAX22007 is not set
# CONFIG_MAX5522 is not set
# CONFIG_MAX5821 is not set
# CONFIG_MCP4725 is not set
# CONFIG_MCP4728 is not set
# CONFIG_MCP47A1 is not set
# CONFIG_MCP47FEB02 is not set
# CONFIG_MCP4821 is not set
# CONFIG_MCP4922 is not set
# CONFIG_TI_DAC082S085 is not set
# CONFIG_TI_DAC5571 is not set
# CONFIG_TI_DAC7311 is not set
# CONFIG_TI_DAC7612 is not set
# CONFIG_VF610_DAC is not set
# end of Digital to analog converters

#
# IIO dummy driver
#
# end of IIO dummy driver

#
# Filters
#
# CONFIG_ADMV8818 is not set
# end of Filters

#
# Flow sensors
#
# CONFIG_SENSIRION_SLF3S is not set
# end of Flow sensors

#
# Frequency Synthesizers DDS/PLL
#

#
# Clock Generator/Distribution
#
# CONFIG_AD9523 is not set
# end of Clock Generator/Distribution

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# CONFIG_ADF41513 is not set
# CONFIG_ADF4350 is not set
# CONFIG_ADF4371 is not set
# CONFIG_ADF4377 is not set
# CONFIG_ADMFM2000 is not set
# CONFIG_ADMV1013 is not set
# CONFIG_ADMV1014 is not set
# CONFIG_ADMV4420 is not set
# CONFIG_ADRF6780 is not set
# end of Phase-Locked Loop (PLL) frequency synthesizers
# end of Frequency Synthesizers DDS/PLL

#
# Digital gyroscope sensors
#
# CONFIG_ADIS16080 is not set
# CONFIG_ADIS16130 is not set
# CONFIG_ADIS16136 is not set
# CONFIG_ADIS16260 is not set
# CONFIG_ADXRS290 is not set
# CONFIG_ADXRS450 is not set
# CONFIG_BMG160 is not set
# CONFIG_FXAS21002C is not set
CONFIG_HID_SENSOR_GYRO_3D=y
# CONFIG_MPU3050_I2C is not set
# CONFIG_IIO_ST_GYRO_3AXIS is not set
# CONFIG_ITG3200 is not set
# end of Digital gyroscope sensors

#
# Health Sensors
#

#
# Heart Rate Monitors
#
# CONFIG_AFE4403 is not set
# CONFIG_AFE4404 is not set
# CONFIG_MAX30100 is not set
# CONFIG_MAX30102 is not set
# end of Heart Rate Monitors
# end of Health Sensors

#
# Humidity sensors
#
# CONFIG_AM2315 is not set
# CONFIG_DHT11 is not set
# CONFIG_ENS210 is not set
# CONFIG_HDC100X is not set
# CONFIG_HDC2010 is not set
# CONFIG_HDC3020 is not set
CONFIG_HID_SENSOR_HUMIDITY=y
# CONFIG_HTS221 is not set
# CONFIG_HTU21 is not set
# CONFIG_SI7005 is not set
# CONFIG_SI7020 is not set
# end of Humidity sensors

#
# Inertial measurement units
#
# CONFIG_ADIS16400 is not set
# CONFIG_ADIS16460 is not set
# CONFIG_ADIS16475 is not set
# CONFIG_ADIS16480 is not set
# CONFIG_ADIS16550 is not set
# CONFIG_BMI160_I2C is not set
# CONFIG_BMI160_SPI is not set
# CONFIG_BMI270_I2C is not set
# CONFIG_BMI270_SPI is not set
# CONFIG_BMI323_I2C is not set
# CONFIG_BMI323_SPI is not set
# CONFIG_BOSCH_BNO055_SERIAL is not set
# CONFIG_BOSCH_BNO055_I2C is not set
# CONFIG_FXOS8700_I2C is not set
# CONFIG_FXOS8700_SPI is not set
# CONFIG_KMX61 is not set
# CONFIG_INV_ICM42600_I2C is not set
# CONFIG_INV_ICM42600_SPI is not set
# CONFIG_INV_ICM42607_I2C is not set
# CONFIG_INV_ICM42607_SPI is not set
# CONFIG_INV_ICM45600_I2C is not set
# CONFIG_INV_ICM45600_SPI is not set
# CONFIG_INV_MPU6050_I2C is not set
# CONFIG_INV_MPU6050_SPI is not set
# CONFIG_SMI240 is not set
# CONFIG_SMI330_I2C is not set
# CONFIG_SMI330_SPI is not set
# CONFIG_IIO_ST_LSM6DSX is not set
# CONFIG_IIO_ST_LSM9DS0 is not set
# end of Inertial measurement units

#
# Light sensors
#
# CONFIG_ACPI_ALS is not set
# CONFIG_ADJD_S311 is not set
# CONFIG_ADUX1020 is not set
# CONFIG_AL3000A is not set
# CONFIG_AL3010 is not set
# CONFIG_AL3320A is not set
# CONFIG_APDS9160 is not set
# CONFIG_APDS9300 is not set
# CONFIG_APDS9306 is not set
# CONFIG_APDS9960 is not set
# CONFIG_APDS9999 is not set
# CONFIG_AS73211 is not set
# CONFIG_BH1745 is not set
# CONFIG_BH1750 is not set
# CONFIG_BH1780 is not set
# CONFIG_CM32181 is not set
# CONFIG_CM3232 is not set
# CONFIG_CM3323 is not set
# CONFIG_CM3605 is not set
# CONFIG_CM36651 is not set
# CONFIG_GP2AP002 is not set
# CONFIG_GP2AP020A00F is not set
# CONFIG_SENSORS_ISL29018 is not set
# CONFIG_SENSORS_ISL29028 is not set
# CONFIG_ISL29125 is not set
# CONFIG_ISL76682 is not set
CONFIG_HID_SENSOR_ALS=y
CONFIG_HID_SENSOR_PROX=y
# CONFIG_JSA1212 is not set
# CONFIG_ROHM_BU27034 is not set
# CONFIG_RPR0521 is not set
# CONFIG_LTR390 is not set
# CONFIG_LTR501 is not set
# CONFIG_LTRF216A is not set
# CONFIG_LV0104CS is not set
# CONFIG_MAX44000 is not set
# CONFIG_MAX44009 is not set
# CONFIG_NOA1305 is not set
# CONFIG_OPT3001 is not set
# CONFIG_OPT4001 is not set
# CONFIG_OPT4060 is not set
# CONFIG_PA12203001 is not set
# CONFIG_SI1133 is not set
# CONFIG_SI1145 is not set
# CONFIG_STK3310 is not set
# CONFIG_ST_UVIS25 is not set
# CONFIG_TCS3414 is not set
# CONFIG_TCS3472 is not set
# CONFIG_SENSORS_TSL2563 is not set
# CONFIG_TSL2583 is not set
# CONFIG_TSL2591 is not set
# CONFIG_TSL2772 is not set
# CONFIG_TSL4531 is not set
# CONFIG_US5182D is not set
# CONFIG_VCNL4000 is not set
# CONFIG_VCNL4035 is not set
# CONFIG_VEML3235 is not set
# CONFIG_VEML3328 is not set
# CONFIG_VEML6030 is not set
# CONFIG_VEML6040 is not set
# CONFIG_VEML6046X00 is not set
# CONFIG_VEML6070 is not set
# CONFIG_VEML6075 is not set
# CONFIG_VL6180 is not set
# CONFIG_ZOPT2201 is not set
# end of Light sensors

#
# Magnetometer sensors
#
# CONFIG_AF8133J is not set
# CONFIG_AK8974 is not set
# CONFIG_AK8975 is not set
# CONFIG_AK09911 is not set
# CONFIG_ALS31300 is not set
# CONFIG_BMC150_MAGN_I2C is not set
# CONFIG_BMC150_MAGN_SPI is not set
# CONFIG_MAG3110 is not set
CONFIG_HID_SENSOR_MAGNETOMETER_3D=y
# CONFIG_MMC35240 is not set
# CONFIG_MMC5633 is not set
# CONFIG_MMC5983 is not set
# CONFIG_IIO_ST_MAGN_3AXIS is not set
# CONFIG_INFINEON_TLV493D is not set
# CONFIG_QMC5883L is not set
# CONFIG_QMC6308 is not set
# CONFIG_SENSORS_HMC5843_I2C is not set
# CONFIG_SENSORS_HMC5843_SPI is not set
# CONFIG_SENSORS_RM3100_I2C is not set
# CONFIG_SENSORS_RM3100_SPI is not set
# CONFIG_SI7210 is not set
# CONFIG_TI_TMAG5273 is not set
# CONFIG_YAMAHA_YAS530 is not set
# end of Magnetometer sensors

#
# Multiplexers
#
# CONFIG_IIO_MUX is not set
# end of Multiplexers

#
# Inclinometer sensors
#
CONFIG_HID_SENSOR_INCLINOMETER_3D=y
CONFIG_HID_SENSOR_DEVICE_ROTATION=y
# end of Inclinometer sensors

#
# Triggers - standalone
#
# CONFIG_IIO_SYSFS_TRIGGER is not set
# end of Triggers - standalone

#
# Linear and angular position sensors
#
CONFIG_HID_SENSOR_CUSTOM_INTEL_HINGE=y
# end of Linear and angular position sensors

#
# Digital potentiometers
#
# CONFIG_AD5110 is not set
# CONFIG_AD5272 is not set
# CONFIG_DS1803 is not set
# CONFIG_MAX5432 is not set
# CONFIG_MAX5481 is not set
# CONFIG_MAX5487 is not set
# CONFIG_MCP4018 is not set
# CONFIG_MCP4131 is not set
# CONFIG_MCP4531 is not set
# CONFIG_MCP41010 is not set
# CONFIG_TPL0102 is not set
# CONFIG_X9250 is not set
# end of Digital potentiometers

#
# Digital potentiostats
#
# CONFIG_LMP91000 is not set
# end of Digital potentiostats

#
# Pressure sensors
#
# CONFIG_ABP060MG is not set
# CONFIG_ABP2030PA_I2C is not set
# CONFIG_ABP2030PA_SPI is not set
# CONFIG_ROHM_BM1390 is not set
# CONFIG_BMP280 is not set
# CONFIG_DLHL60D is not set
# CONFIG_DPS310 is not set
CONFIG_HID_SENSOR_PRESS=y
# CONFIG_HP03 is not set
# CONFIG_HSC030PA is not set
# CONFIG_ICP10100 is not set
# CONFIG_MPL115_I2C is not set
# CONFIG_MPL115_SPI is not set
# CONFIG_MPL3115 is not set
# CONFIG_MPRLS0025PA_I2C is not set
# CONFIG_MPRLS0025PA_SPI is not set
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_SDP500 is not set
# CONFIG_IIO_ST_PRESS is not set
# CONFIG_T5403 is not set
# CONFIG_HP206C is not set
# CONFIG_ZPA2326 is not set
# CONFIG_ADP810 is not set
# end of Pressure sensors

#
# Lightning sensors
#
# CONFIG_AS3935 is not set
# end of Lightning sensors

#
# Proximity and distance sensors
#
# CONFIG_D3323AA is not set
# CONFIG_HX9023S is not set
# CONFIG_IRSD200 is not set
# CONFIG_ISL29501 is not set
# CONFIG_LIDAR_LITE_V2 is not set
# CONFIG_MB1232 is not set
# CONFIG_PING is not set
# CONFIG_RFD77402 is not set
# CONFIG_SRF04 is not set
# CONFIG_SX9310 is not set
# CONFIG_SX9324 is not set
# CONFIG_SX9360 is not set
# CONFIG_SX9500 is not set
# CONFIG_SRF08 is not set
# CONFIG_VCNL3020 is not set
# CONFIG_VL53L0X_I2C is not set
# CONFIG_VL53L1X_I2C is not set
# CONFIG_AW96103 is not set
# end of Proximity and distance sensors

#
# Resolver to digital converters
#
# CONFIG_AD2S90 is not set
# CONFIG_AD2S1200 is not set
# CONFIG_AD2S1210 is not set
# end of Resolver to digital converters

#
# Temperature sensors
#
# CONFIG_LTC2983 is not set
# CONFIG_MAXIM_THERMOCOUPLE is not set
CONFIG_HID_SENSOR_TEMP=y
# CONFIG_MLX90614 is not set
# CONFIG_MLX90632 is not set
# CONFIG_MLX90635 is not set
# CONFIG_TMP006 is not set
# CONFIG_TMP007 is not set
# CONFIG_TMP117 is not set
# CONFIG_TSYS01 is not set
# CONFIG_TSYS02D is not set
# CONFIG_MAX30208 is not set
# CONFIG_MAX31856 is not set
# CONFIG_MAX31865 is not set
# CONFIG_MCP9600 is not set
# end of Temperature sensors

# CONFIG_NTB is not set
# CONFIG_PWM is not set

#
# IRQ chip support
#
CONFIG_IRQCHIP=y
CONFIG_IRQ_MSI_LIB=y
# CONFIG_AL_FIC is not set
# CONFIG_XILINX_INTC is not set
# end of IRQ chip support

# CONFIG_IPACK_BUS is not set
CONFIG_RESET_CONTROLLER=y
# CONFIG_RESET_GPIO is not set
# CONFIG_RESET_INTEL_GW is not set
# CONFIG_RESET_SIMPLE is not set
# CONFIG_RESET_TI_SYSCON is not set
# CONFIG_RESET_TI_TPS380X is not set

#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
# CONFIG_PHY_CAN_TRANSCEIVER is not set
CONFIG_PHY_GOOGLE_USB=y
CONFIG_USB_LGM_PHY=y
# CONFIG_PHY_NXP_PTN3222 is not set
# CONFIG_PHY_NXP_TJA1145 is not set

#
# PHY drivers for Broadcom platforms
#
# CONFIG_BCM_KONA_USB2_PHY is not set
# end of PHY drivers for Broadcom platforms

# CONFIG_PHY_CADENCE_TORRENT is not set
# CONFIG_PHY_CADENCE_DPHY is not set
# CONFIG_PHY_CADENCE_DPHY_RX is not set
# CONFIG_PHY_CADENCE_SIERRA is not set
# CONFIG_PHY_CADENCE_SALVO is not set
# CONFIG_PHY_INTEL_LGM_COMBO is not set
# CONFIG_PHY_INTEL_LGM_EMMC is not set
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
CONFIG_PHY_CPCAP_USB=y
# CONFIG_PHY_MAPPHONE_MDM6600 is not set
# CONFIG_PHY_OCELOT_SERDES is not set
CONFIG_PHY_QCOM_USB_HS=y
CONFIG_PHY_QCOM_USB_HSIC=y
CONFIG_PHY_SAMSUNG_USB2=y
# CONFIG_PHY_TI_DS125DF111 is not set
CONFIG_PHY_TUSB1210=y
# end of PHY Subsystem

# CONFIG_POWERCAP is not set
# CONFIG_MCB is not set

#
# Performance monitor support
#
# CONFIG_DWC_PCIE_PMU is not set
# end of Performance monitor support

CONFIG_RAS=y
CONFIG_USB4=y
CONFIG_USB4_CONFIGFS=y
# CONFIG_USB4_DEBUGFS_WRITE is not set
# CONFIG_USB4_DMA_TEST is not set
# CONFIG_USB4_STREAM is not set

#
# Android
#
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder0,binder1"
# end of Android

CONFIG_LIBNVDIMM=y
CONFIG_BLK_DEV_PMEM=y
CONFIG_ND_CLAIM=y
CONFIG_ND_BTT=y
CONFIG_BTT=y
CONFIG_ND_PFN=y
CONFIG_NVDIMM_PFN=y
CONFIG_NVDIMM_DAX=y
CONFIG_OF_PMEM=y
# CONFIG_RAMDAX is not set
CONFIG_NVDIMM_KEYS=y
# CONFIG_NVDIMM_SECURITY_TEST is not set
CONFIG_DAX=y
CONFIG_DEV_DAX=y
# CONFIG_DEV_DAX_PMEM is not set
CONFIG_DEV_DAX_FSDEV=y
# CONFIG_DEV_DAX_KMEM is not set
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y
CONFIG_NVMEM_LAYOUTS=y

#
# Layout Types
#
# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set
# CONFIG_NVMEM_LAYOUT_ONIE_TLV is not set
# CONFIG_NVMEM_LAYOUT_U_BOOT_ENV is not set
# end of Layout Types

# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_EEPROM_EE1004 is not set
# CONFIG_EEPROM_M24LR is not set
# CONFIG_NVMEM_RMEM is not set
# CONFIG_NVMEM_U_BOOT_ENV is not set

#
# HW tracing support
#
# CONFIG_STM is not set
# CONFIG_INTEL_TH is not set
# end of HW tracing support

# CONFIG_FPGA is not set
# CONFIG_FSI is not set
CONFIG_TEE=y
CONFIG_TEE_DMABUF_HEAPS=y
CONFIG_OPTEE_STATIC_PROTMEM_POOL=y
# CONFIG_MUX_CORE is not set
# CONFIG_SIOX is not set
# CONFIG_SLIMBUS is not set
# CONFIG_INTERCONNECT is not set
CONFIG_COUNTER=y
# CONFIG_INTEL_QEP is not set
# CONFIG_INTERRUPT_CNT is not set
CONFIG_MOST=y
CONFIG_MOST_USB_HDM=y
# CONFIG_MOST_CDEV is not set
# CONFIG_MOST_SND is not set
# CONFIG_PECI is not set
# CONFIG_HTE is not set
# end of Device Drivers

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_VALIDATE_FS_PARSER=y
CONFIG_FS_IOMAP=y
CONFIG_FS_STACK=y
CONFIG_BUFFER_HEAD=y
CONFIG_LEGACY_DIRECT_IO=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
CONFIG_JFS_FS=y
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
CONFIG_JFS_DEBUG=y
# CONFIG_JFS_STATISTICS is not set
CONFIG_XFS_FS=y
# CONFIG_XFS_SUPPORT_V4 is not set
# CONFIG_XFS_SUPPORT_ASCII_CI is not set
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
CONFIG_XFS_DRAIN_INTENTS=y
CONFIG_XFS_LIVE_HOOKS=y
CONFIG_XFS_MEMORY_BUFS=y
CONFIG_XFS_BTREE_IN_MEM=y
CONFIG_XFS_ONLINE_SCRUB=y
# CONFIG_XFS_ONLINE_SCRUB_STATS is not set
CONFIG_XFS_ONLINE_REPAIR=y
# CONFIG_XFS_WARN is not set
# CONFIG_XFS_DEBUG is not set
CONFIG_GFS2_FS=y
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=y
CONFIG_OCFS2_FS_O2CB=y
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=y
CONFIG_OCFS2_FS_STATS=y
# CONFIG_OCFS2_DEBUG_MASKLOG is not set
CONFIG_OCFS2_DEBUG_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
CONFIG_BTRFS_ASSERT=y
# CONFIG_BTRFS_EXPERIMENTAL is not set
CONFIG_NILFS2_FS=y
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FAULT_INJECTION=y
CONFIG_F2FS_FS_COMPRESSION=y
CONFIG_F2FS_FS_LZO=y
CONFIG_F2FS_FS_LZORLE=y
CONFIG_F2FS_FS_LZ4=y
CONFIG_F2FS_FS_LZ4HC=y
CONFIG_F2FS_FS_ZSTD=y
# CONFIG_F2FS_IOSTAT is not set
# CONFIG_F2FS_UNFAIR_RWSEM is not set
CONFIG_ZONEFS_FS=y
CONFIG_FS_DAX=y
CONFIG_FS_DAX_PMD=y
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FILE_LOCKING=y
CONFIG_FS_ENCRYPTION=y
CONFIG_FS_ENCRYPTION_ALGS=y
CONFIG_FS_ENCRYPTION_INLINE_CRYPT=y
CONFIG_FS_VERITY=y
CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
CONFIG_VIRTIO_FS=y
CONFIG_FUSE_DAX=y
# CONFIG_FUSE_PASSTHROUGH is not set
CONFIG_FUSE_IO_URING=y
CONFIG_OVERLAY_FS=y
CONFIG_OVERLAY_FS_REDIRECT_DIR=y
CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y
CONFIG_OVERLAY_FS_INDEX=y
# CONFIG_OVERLAY_FS_NFS_EXPORT is not set
# CONFIG_OVERLAY_FS_XINO_AUTO is not set
# CONFIG_OVERLAY_FS_METACOPY is not set
CONFIG_OVERLAY_FS_DEBUG=y

#
# Caches
#
CONFIG_NETFS_SUPPORT=y
# CONFIG_NETFS_STATS is not set
# CONFIG_NETFS_DEBUG is not set
CONFIG_FSCACHE=y
# CONFIG_FSCACHE_STATS is not set
CONFIG_CACHEFILES=y
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_ERROR_INJECTION is not set
# end of Caches

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=y
# end of CD-ROM/DVD Filesystems

#
# DOS/FAT/EXFAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_FAT_DEFAULT_UTF8 is not set
CONFIG_EXFAT_FS=y
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
# CONFIG_NTFS_FS is not set
CONFIG_NTFS3_FS=y
# CONFIG_NTFS3_64BIT_CLUSTER is not set
CONFIG_NTFS3_LZX_XPRESS=y
CONFIG_NTFS3_FS_POSIX_ACL=y
# end of DOS/FAT/EXFAT/NT Filesystems

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set
CONFIG_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_PROC_CHILDREN=y
CONFIG_PROC_PID_ARCH_STATUS=y
CONFIG_KERNFS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
# CONFIG_TMPFS_INODE64 is not set
CONFIG_TMPFS_QUOTA=y
CONFIG_ARCH_SUPPORTS_HUGETLBFS=y
CONFIG_HUGETLBFS=y
# CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set
CONFIG_HUGETLB_PAGE=y
CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
CONFIG_CONFIGFS_FS=y
# end of Pseudo filesystems

CONFIG_MISC_FILESYSTEMS=y
CONFIG_ORANGEFS_FS=y
CONFIG_ADFS_FS=y
# CONFIG_ADFS_FS_RW is not set
CONFIG_AFFS_FS=y
CONFIG_ECRYPT_FS=y
CONFIG_ECRYPT_FS_MESSAGING=y
CONFIG_HFS_FS=y
CONFIG_HFSPLUS_FS=y
CONFIG_BEFS_FS=y
# CONFIG_BEFS_DEBUG is not set
CONFIG_BFS_FS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_RUBIN=y
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
CONFIG_UBIFS_ATIME_SUPPORT=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
# CONFIG_UBIFS_FS_AUTHENTICATION is not set
CONFIG_CRAMFS=y
CONFIG_CRAMFS_BLOCKDEV=y
CONFIG_CRAMFS_MTD=y
CONFIG_SQUASHFS=y
# CONFIG_SQUASHFS_FILE_CACHE is not set
CONFIG_SQUASHFS_FILE_DIRECT=y
CONFIG_SQUASHFS_DECOMP_MULTI=y
# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set
# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set
CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI=y
# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set
# CONFIG_SQUASHFS_MOUNT_DECOMP_THREADS is not set
CONFIG_SQUASHFS_XATTR=y
# CONFIG_SQUASHFS_COMP_CACHE_FULL is not set
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZ4=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_MINIX_FS=y
CONFIG_OMFS_FS=y
CONFIG_HPFS_FS=y
CONFIG_QNX4FS_FS=y
CONFIG_QNX6FS_FS=y
# CONFIG_QNX6FS_DEBUG is not set
CONFIG_ROMFS_FS=y
# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
CONFIG_ROMFS_BACKED_BY_BOTH=y
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_ROMFS_ON_MTD=y
CONFIG_PSTORE=y
CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240
CONFIG_PSTORE_COMPRESS=y
# CONFIG_PSTORE_CONSOLE is not set
# CONFIG_PSTORE_PMSG is not set
# CONFIG_PSTORE_RAM is not set
# CONFIG_PSTORE_BLK is not set
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
# CONFIG_UFS_DEBUG is not set
CONFIG_EROFS_FS=y
# CONFIG_EROFS_FS_DEBUG is not set
CONFIG_EROFS_FS_XATTR=y
CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
# CONFIG_EROFS_FS_BACKED_BY_FILE is not set
CONFIG_EROFS_FS_ZIP=y
# CONFIG_EROFS_FS_ZIP_LZMA is not set
# CONFIG_EROFS_FS_ZIP_DEFLATE is not set
# CONFIG_EROFS_FS_ZIP_ZSTD is not set
# CONFIG_EROFS_FS_ZIP_ACCEL is not set
# CONFIG_EROFS_FS_PCPU_KTHREAD is not set
# CONFIG_EROFS_FS_PAGE_CACHE_SHARE is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
# CONFIG_NFS_V2 is not set
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
CONFIG_NFS_V4_0=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_BLOCK=y
CONFIG_PNFS_FLEXFILE_LAYOUT=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
# CONFIG_NFS_V4_1_MIGRATION is not set
CONFIG_NFS_V4_SECURITY_LABEL=y
CONFIG_ROOT_NFS=y
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_DISABLE_UDP_SUPPORT is not set
CONFIG_NFS_V4_2_READ_PLUS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V2 is not set
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_PNFS=y
CONFIG_NFSD_BLOCKLAYOUT=y
CONFIG_NFSD_SCSILAYOUT=y
CONFIG_NFSD_FLEXFILELAYOUT=y
CONFIG_NFSD_V4_2_INTER_SSC=y
CONFIG_NFSD_V4_SECURITY_LABEL=y
# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
# CONFIG_NFSD_V4_POSIX_ACLS is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
# CONFIG_NFS_LOCALIO is not set
CONFIG_NFS_V4_2_SSC_HELPER=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_BACKCHANNEL=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_SUNRPC_XPRT_RDMA is not set
CONFIG_CEPH_FS=y
CONFIG_CEPH_FSCACHE=y
CONFIG_CEPH_FS_POSIX_ACL=y
# CONFIG_CEPH_FS_SECURITY_LABEL is not set
CONFIG_CIFS=y
# CONFIG_CIFS_STATS2 is not set
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_SWN_UPCALL=y
CONFIG_CIFS_SMB_DIRECT=y
CONFIG_CIFS_FSCACHE=y
# CONFIG_CIFS_ROOT is not set
# CONFIG_CIFS_COMPRESSION is not set
CONFIG_SMB_SERVER=y
# CONFIG_SMB_SERVER_SMBDIRECT is not set
# CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN is not set
# CONFIG_SMB_SERVER_KERBEROS5 is not set
CONFIG_SMBDIRECT=y
CONFIG_SMBFS=y
# CONFIG_CODA_FS is not set
CONFIG_AFS_FS=y
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y
# CONFIG_AFS_DEBUG_CURSOR is not set
CONFIG_9P_FS=y
CONFIG_9P_FSCACHE=y
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_9P_FS_SECURITY=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
CONFIG_NLS_CODEPAGE_864=y
CONFIG_NLS_CODEPAGE_865=y
CONFIG_NLS_CODEPAGE_866=y
CONFIG_NLS_CODEPAGE_869=y
CONFIG_NLS_CODEPAGE_936=y
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=y
CONFIG_NLS_ISO8859_3=y
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
CONFIG_NLS_ISO8859_13=y
CONFIG_NLS_ISO8859_14=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_MAC_ROMAN=y
CONFIG_NLS_MAC_CELTIC=y
CONFIG_NLS_MAC_CENTEURO=y
CONFIG_NLS_MAC_CROATIAN=y
CONFIG_NLS_MAC_CYRILLIC=y
CONFIG_NLS_MAC_GAELIC=y
CONFIG_NLS_MAC_GREEK=y
CONFIG_NLS_MAC_ICELAND=y
CONFIG_NLS_MAC_INUIT=y
CONFIG_NLS_MAC_ROMANIAN=y
CONFIG_NLS_MAC_TURKISH=y
CONFIG_NLS_UTF8=y
CONFIG_NLS_UCS2_UTILS=y
CONFIG_DLM=y
# CONFIG_DLM_DEBUG is not set
CONFIG_UNICODE=y
CONFIG_IO_WQ=y
# end of File systems

#
# Security options
#
CONFIG_KEYS=y
CONFIG_KEYS_REQUEST_CACHE=y
CONFIG_PERSISTENT_KEYRINGS=y
CONFIG_BIG_KEYS=y
CONFIG_TRUSTED_KEYS=y
# CONFIG_TRUSTED_KEYS_TPM is not set
# CONFIG_TRUSTED_KEYS_TEE is not set

#
# No trust source selected!
#
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_USER_DECRYPTED_DATA is not set
CONFIG_KEY_DH_OPERATIONS=y
CONFIG_KEY_NOTIFICATIONS=y
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_PROC_MEM_ALWAYS_FORCE is not set
CONFIG_PROC_MEM_FORCE_PTRACE=y
# CONFIG_PROC_MEM_NO_FORCE is not set
CONFIG_SECURITY=y
CONFIG_HAS_SECURITY_AUDIT=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_INFINIBAND=y
CONFIG_SECURITY_NETWORK_XFRM=y
CONFIG_SECURITY_PATH=y
# CONFIG_INTEL_TXT is not set
CONFIG_LSM_MMAP_MIN_ADDR=65536
# CONFIG_STATIC_USERMODEHELPER is not set
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9
CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256
CONFIG_SECURITY_SELINUX_AVC_HASH_BITS=9
# CONFIG_SECURITY_SELINUX_DEBUG is not set
# CONFIG_SECURITY_SMACK is not set
CONFIG_SECURITY_TOMOYO=y
CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=64
CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=32
CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER=y
CONFIG_SECURITY_TOMOYO_INSECURE_BUILTIN_SETTING=y
# CONFIG_SECURITY_APPARMOR is not set
# CONFIG_SECURITY_LOADPIN is not set
CONFIG_SECURITY_YAMA=y
CONFIG_SECURITY_SAFESETID=y
CONFIG_SECURITY_LOCKDOWN_LSM=y
CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y
# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set
# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set
CONFIG_SECURITY_LANDLOCK=y
CONFIG_SECURITY_LANDLOCK_LOG=y
# CONFIG_SECURITY_IPE is not set
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
CONFIG_INTEGRITY_TRUSTED_KEYRING=y
CONFIG_INTEGRITY_AUDIT=y
CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
CONFIG_IMA_LSM_RULES=y
CONFIG_IMA_NG_TEMPLATE=y
# CONFIG_IMA_SIG_TEMPLATE is not set
CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng"
# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set
CONFIG_IMA_DEFAULT_HASH_SHA256=y
# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set
# CONFIG_IMA_DEFAULT_HASH_WP512 is not set
CONFIG_IMA_DEFAULT_HASH="sha256"
CONFIG_IMA_WRITE_POLICY=y
CONFIG_IMA_READ_POLICY=y
CONFIG_IMA_APPRAISE=y
# CONFIG_IMA_ARCH_POLICY is not set
# CONFIG_IMA_APPRAISE_BUILD_POLICY is not set
# CONFIG_IMA_APPRAISE_BOOTPARAM is not set
CONFIG_IMA_APPRAISE_MODSIG=y
# CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY is not set
# CONFIG_IMA_BLACKLIST_KEYRING is not set
# CONFIG_IMA_LOAD_X509 is not set
CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y
CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y
# CONFIG_IMA_DISABLE_HTABLE is not set
# CONFIG_IMA_STAGING is not set
# CONFIG_IMA_INIT_LATE_SYNC is not set
CONFIG_EVM=y
CONFIG_EVM_ATTR_FSUUID=y
CONFIG_EVM_ADD_XATTRS=y
# CONFIG_EVM_LOAD_X509 is not set
CONFIG_DEFAULT_SECURITY_SELINUX=y
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_LSM="landlock,lockdown,yama,safesetid,integrity,tomoyo,selinux,bpf"

#
# Kernel hardening options
#

#
# Memory initialization
#
CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
# CONFIG_INIT_STACK_NONE is not set
# CONFIG_INIT_STACK_ALL_PATTERN is not set
CONFIG_INIT_STACK_ALL_ZERO=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
# CONFIG_ZERO_CALL_USED_REGS is not set
# end of Memory initialization

#
# Bounds checking
#
CONFIG_FORTIFY_SOURCE=y
CONFIG_HARDENED_USERCOPY=y
# CONFIG_HARDENED_USERCOPY_DEFAULT_ON is not set
# end of Bounds checking

#
# Hardening of kernel data structures
#
CONFIG_LIST_HARDENED=y
CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Hardening of kernel data structures

CONFIG_RANDSTRUCT_NONE=y
# end of Kernel hardening options
# end of Security options

CONFIG_ASYNC_CORE=y
CONFIG_ASYNC_MEMCPY=y
CONFIG_ASYNC_XOR=y
CONFIG_ASYNC_PQ=y
CONFIG_ASYNC_RAID6_RECOV=y
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_SIG=y
CONFIG_CRYPTO_SIG2=y
CONFIG_CRYPTO_SKCIPHER=y
CONFIG_CRYPTO_SKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_AKCIPHER2=y
CONFIG_CRYPTO_AKCIPHER=y
CONFIG_CRYPTO_KPP2=y
CONFIG_CRYPTO_KPP=y
CONFIG_CRYPTO_ACOMP2=y
CONFIG_CRYPTO_ACOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=y
# CONFIG_CRYPTO_SELFTESTS is not set
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_PCRYPT=y
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_AUTHENC=y
CONFIG_CRYPTO_KRB5ENC=y
# CONFIG_CRYPTO_BENCHMARK is not set
CONFIG_CRYPTO_ENGINE=y
# end of Crypto core or helper

#
# Public-key cryptography
#
CONFIG_CRYPTO_RSA=y
CONFIG_CRYPTO_DH=y
# CONFIG_CRYPTO_DH_RFC7919_GROUPS is not set
CONFIG_CRYPTO_ECC=y
CONFIG_CRYPTO_ECDH=y
# CONFIG_CRYPTO_ECDSA is not set
CONFIG_CRYPTO_ECRDSA=y
CONFIG_CRYPTO_MLDSA=y
# end of Public-key cryptography

#
# Block ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_ANUBIS=y
CONFIG_CRYPTO_ARIA=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_BLOWFISH_COMMON=y
CONFIG_CRYPTO_CAMELLIA=y
CONFIG_CRYPTO_CAST_COMMON=y
CONFIG_CRYPTO_CAST5=y
CONFIG_CRYPTO_CAST6=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SEED=y
CONFIG_CRYPTO_SERPENT=y
CONFIG_CRYPTO_SM4=y
CONFIG_CRYPTO_SM4_GENERIC=y
CONFIG_CRYPTO_TEA=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
# end of Block ciphers

#
# Length-preserving ciphers and modes
#
CONFIG_CRYPTO_ADIANTUM=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_CHACHA20=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_HCTR2=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_XCTR=y
CONFIG_CRYPTO_XTS=y
# end of Length-preserving ciphers and modes

#
# AEAD (authenticated encryption with associated data) ciphers
#
CONFIG_CRYPTO_AEGIS128=y
CONFIG_CRYPTO_CHACHA20POLY1305=y
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_GENIV=y
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ESSIV=y
# end of AEAD (authenticated encryption with associated data) ciphers

#
# Hashes, digests, and MACs
#
# CONFIG_CRYPTO_BLAKE2B is not set
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_SHA3=y
# CONFIG_CRYPTO_SM3 is not set
CONFIG_CRYPTO_STREEBOG=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_XCBC=y
# CONFIG_CRYPTO_XXHASH is not set
# end of Hashes, digests, and MACs

#
# CRCs (cyclic redundancy checks)
#
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CRC32 is not set
# end of CRCs (cyclic redundancy checks)

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_842=y
CONFIG_CRYPTO_LZ4=y
CONFIG_CRYPTO_LZ4HC=y
CONFIG_CRYPTO_ZSTD=y
# end of Compression

#
# Random number generation
#
# CONFIG_CRYPTO_DRBG is not set
# CONFIG_CRYPTO_JITTERENTROPY is not set
CONFIG_CRYPTO_KDF800108_CTR=y
# end of Random number generation

#
# Userspace interface (deprecated)
#
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_USER_API_RNG=y
CONFIG_CRYPTO_USER_API_AEAD=y
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
# end of Userspace interface (deprecated)

#
# Accelerated Cryptographic Algorithms for CPU (x86)
#
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_BLOWFISH_X86_64=y
CONFIG_CRYPTO_CAMELLIA_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_CAST5_AVX_X86_64=y
CONFIG_CRYPTO_CAST6_AVX_X86_64=y
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX2_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=y
CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64=y
# CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 is not set
# CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 is not set
CONFIG_CRYPTO_AEGIS128_AESNI_SSE2=y
# end of Accelerated Cryptographic Algorithms for CPU (x86)

CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=y
CONFIG_CRYPTO_DEV_PADLOCK_AES=y
CONFIG_CRYPTO_DEV_PADLOCK_SHA=y
# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set
# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set
CONFIG_CRYPTO_DEV_CCP=y
CONFIG_CRYPTO_DEV_CCP_DD=y
# CONFIG_CRYPTO_DEV_SP_CCP is not set
# CONFIG_CRYPTO_DEV_SP_PSP is not set
# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set
CONFIG_CRYPTO_DEV_QAT=y
CONFIG_CRYPTO_DEV_QAT_DH895xCC=y
CONFIG_CRYPTO_DEV_QAT_C3XXX=y
CONFIG_CRYPTO_DEV_QAT_C62X=y
# CONFIG_CRYPTO_DEV_QAT_4XXX is not set
# CONFIG_CRYPTO_DEV_QAT_420XX is not set
# CONFIG_CRYPTO_DEV_QAT_6XXX is not set
CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=y
CONFIG_CRYPTO_DEV_QAT_C3XXXVF=y
CONFIG_CRYPTO_DEV_QAT_C62XVF=y
# CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION is not set
CONFIG_CRYPTO_DEV_VIRTIO=y
# CONFIG_CRYPTO_DEV_SAFEXCEL is not set
# CONFIG_CRYPTO_DEV_CCREE is not set
# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS8_PRIVATE_KEY_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y
# CONFIG_PKCS7_WAIVE_AUTHATTRS_REJECTION_FOR_MLDSA is not set
CONFIG_PKCS7_TEST_KEY=y
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
# CONFIG_FIPS_SIGNATURE_SELFTEST is not set

#
# Certificates for signature checking
#
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
# CONFIG_MODULE_SIG_KEY_TYPE_RSA is not set
CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_44=y
# CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_65 is not set
# CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_87 is not set
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS=""
# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set
CONFIG_SECONDARY_TRUSTED_KEYRING=y
# CONFIG_SECONDARY_TRUSTED_KEYRING_SIGNED_BY_BUILTIN is not set
# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set
CONFIG_OPENSSL_SUPPORTS_ML_DSA=y
# end of Certificates for signature checking

CONFIG_CRYPTO_KRB5=y
# CONFIG_CRYPTO_KRB5_SELFTESTS is not set
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_LINEAR_RANGES=y
# CONFIG_PACKING is not set
CONFIG_BITREVERSE=y
CONFIG_GENERIC_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
# CONFIG_CORDIC is not set
# CONFIG_PRIME_NUMBERS is not set
CONFIG_RATIONAL=y
CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
CONFIG_ARCH_USE_SYM_ANNOTATIONS=y
CONFIG_CRC8=y
CONFIG_CRC16=y
CONFIG_CRC_CCITT=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_T10DIF_ARCH=y
CONFIG_CRC32=y
CONFIG_CRC32_ARCH=y
CONFIG_CRC64=y
CONFIG_CRC64_ARCH=y
CONFIG_CRC_OPTIMIZATIONS=y
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_AES_ARCH=y
CONFIG_CRYPTO_LIB_AES_CBC=y
CONFIG_CRYPTO_LIB_AES_CBC_MACS=y
CONFIG_CRYPTO_LIB_AES_CCM=y
CONFIG_CRYPTO_LIB_AES_CTR=y
CONFIG_CRYPTO_LIB_AES_ECB=y
CONFIG_CRYPTO_LIB_AES_GCM=y
CONFIG_CRYPTO_LIB_AES_XTS=y
CONFIG_CRYPTO_LIB_ARC4=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_BLAKE2B=y
CONFIG_CRYPTO_LIB_BLAKE2S_ARCH=y
CONFIG_CRYPTO_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CHACHA_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_CURVE25519_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
CONFIG_CRYPTO_LIB_DES=y
CONFIG_CRYPTO_LIB_GF128HASH=y
CONFIG_CRYPTO_LIB_GF128HASH_ARCH=y
CONFIG_CRYPTO_LIB_MD5=y
CONFIG_CRYPTO_LIB_MLDSA=y
CONFIG_CRYPTO_LIB_NH=y
CONFIG_CRYPTO_LIB_NH_ARCH=y
CONFIG_CRYPTO_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_POLY1305_ARCH=y
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_SHA1_ARCH=y
CONFIG_CRYPTO_LIB_SHA256=y
CONFIG_CRYPTO_LIB_SHA256_ARCH=y
CONFIG_CRYPTO_LIB_SHA512=y
CONFIG_CRYPTO_LIB_SHA512_ARCH=y
CONFIG_CRYPTO_LIB_SHA3=y
CONFIG_XOR_BLOCKS=y
CONFIG_XOR_BLOCKS_ARCH=y
CONFIG_RAID6_PQ=y
CONFIG_RAID6_PQ_ARCH=y
# CONFIG_RAID6_PQ_BENCHMARK is not set
CONFIG_XXHASH=y
CONFIG_842_COMPRESS=y
CONFIG_842_DECOMPRESS=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_LZ4_COMPRESS=y
CONFIG_LZ4HC_COMPRESS=y
CONFIG_LZ4_DECOMPRESS=y
CONFIG_ZSTD_COMMON=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_ARM64=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_RISCV=y
# CONFIG_XZ_DEC_MICROLZMA is not set
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_DECOMPRESS_LZ4=y
CONFIG_DECOMPRESS_ZSTD=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_DEC8=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=y
CONFIG_TEXTSEARCH_BM=y
CONFIG_TEXTSEARCH_FSM=y
CONFIG_INTERVAL_TREE=y
CONFIG_INTERVAL_TREE_SPAN_ITER=y
CONFIG_XARRAY_MULTI=y
CONFIG_ASSOCIATIVE_ARRAY=y
CONFIG_CLOSURES=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_DMA_OPS_HELPERS=y
CONFIG_NEED_SG_DMA_FLAGS=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DMA_DECLARE_COHERENT=y
CONFIG_SWIOTLB=y
CONFIG_SWIOTLB_DEFAULT_SIZE_MB=64
# CONFIG_SWIOTLB_DYNAMIC is not set
CONFIG_DMA_NEED_SYNC=y
# CONFIG_DMA_RESTRICTED_POOL is not set
CONFIG_DMA_CMA=y
# CONFIG_DMA_NUMA_CMA is not set

#
# Default contiguous memory area size:
#
CONFIG_CMA_SIZE_MBYTES=0
CONFIG_CMA_SIZE_PERCENTAGE=0
# CONFIG_CMA_SIZE_SEL_MBYTES is not set
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
# CONFIG_CMA_SIZE_SEL_MIN is not set
CONFIG_CMA_SIZE_SEL_MAX=y
CONFIG_CMA_ALIGNMENT=8
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_MAP_BENCHMARK is not set
CONFIG_SGL_ALLOC=y
CONFIG_CHECK_SIGNATURE=y
# CONFIG_CPUMASK_OFFSTACK is not set
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_GLOB=y
CONFIG_NLATTR=y
CONFIG_CLZ_TAB=y
CONFIG_IRQ_POLL=y
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_DIMLIB=y
CONFIG_LIBFDT=y
CONFIG_OID_REGISTRY=y
CONFIG_VDSO_DATASTORE=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT=y
CONFIG_VDSO_GETRANDOM=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_SG_POOL=y
CONFIG_ARCH_HAS_PMEM_API=y
CONFIG_MEMREGION=y
CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION=y
CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y
CONFIG_ARCH_HAS_COPY_MC=y
CONFIG_ARCH_STACKWALK=y
CONFIG_STACKDEPOT=y
CONFIG_STACKDEPOT_ALWAYS_INIT=y
CONFIG_STACKDEPOT_MAX_FRAMES=64
CONFIG_REF_TRACKER=y
CONFIG_SBITMAP=y
# CONFIG_LWQ_TEST is not set
# end of Library routines

CONFIG_FIRMWARE_TABLE=y
CONFIG_UNION_FIND=y

#
# Kernel hacking
#

#
# printk and dmesg options
#
CONFIG_PRINTK_TIME=y
CONFIG_PRINTK_CALLER=y
# CONFIG_STACKTRACE_BUILD_ID is not set
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
CONFIG_CONSOLE_LOGLEVEL_QUIET=4
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_BOOT_PRINTK_DELAY is not set
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DYNAMIC_DEBUG_CORE=y
CONFIG_SYMBOLIC_ERRNAME=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_BUGVERBOSE_DETAILED=y
# end of printk and dmesg options

CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y

#
# Compile-time checks and compiler options
#
CONFIG_DEBUG_INFO=y
CONFIG_AS_HAS_NON_CONST_ULEB128=y
# CONFIG_DEBUG_INFO_NONE is not set
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
CONFIG_DEBUG_INFO_DWARF4=y
# CONFIG_DEBUG_INFO_DWARF5 is not set
# CONFIG_DEBUG_INFO_REDUCED is not set
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
# CONFIG_DEBUG_INFO_COMPRESSED_ZSTD is not set
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_DEBUG_INFO_BTF is not set
CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_HEADERS_INSTALL is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set
CONFIG_OBJTOOL=y
# CONFIG_OBJTOOL_WERROR is not set
CONFIG_NOINSTR_VALIDATION=y
# CONFIG_VMLINUX_MAP is not set
# end of Compile-time checks and compiler options

#
# Generic Kernel Debugging Instruments
#
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_ARCH_HAS_UBSAN=y
CONFIG_UBSAN=y
# CONFIG_UBSAN_TRAP is not set
CONFIG_CC_HAS_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_BOUNDS=y
CONFIG_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_SHIFT=y
# CONFIG_UBSAN_DIV_ZERO is not set
# CONFIG_UBSAN_BOOL is not set
# CONFIG_UBSAN_ENUM is not set
# CONFIG_UBSAN_ALIGNMENT is not set
# CONFIG_TEST_UBSAN is not set
CONFIG_HAVE_ARCH_KCSAN=y
CONFIG_HAVE_KCSAN_COMPILER=y
# end of Generic Kernel Debugging Instruments

#
# Networking Debugging
#
CONFIG_NET_DEV_REFCNT_TRACKER=y
CONFIG_NET_NS_REFCNT_TRACKER=y
CONFIG_DEBUG_NET=y
# CONFIG_DEBUG_NET_SMALL_RTNL is not set
# end of Networking Debugging

#
# Memory Debugging
#
CONFIG_PAGE_EXTENSION=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_SLUB_DEBUG=y
# CONFIG_SLUB_DEBUG_ON is not set
CONFIG_SLUB_RCU_DEBUG=y
CONFIG_PAGE_OWNER=y
CONFIG_PAGE_TABLE_CHECK=y
CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
CONFIG_PAGE_POISONING=y
# CONFIG_DEBUG_PAGE_REF is not set
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_ARCH_HAS_DEBUG_WX=y
CONFIG_DEBUG_WX=y
CONFIG_ARCH_HAS_PTDUMP=y
CONFIG_PTDUMP=y
CONFIG_PTDUMP_DEBUGFS=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_PER_VMA_LOCK_STATS is not set
# CONFIG_MEM_ALLOC_PROFILING is not set
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
CONFIG_DEBUG_OBJECTS_TIMERS=y
CONFIG_DEBUG_OBJECTS_WORK=y
CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
# CONFIG_SHRINKER_DEBUG is not set
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y
CONFIG_DEBUG_VFS=y
CONFIG_DEBUG_VM_IRQSOFF=y
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_VM_MAPLE_TREE=y
CONFIG_DEBUG_VM_RB=y
CONFIG_DEBUG_VM_PGFLAGS=y
CONFIG_DEBUG_VM_PGTABLE=y
CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
CONFIG_DEBUG_VIRTUAL=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_DEBUG_KMAP_LOCAL=y
CONFIG_ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP=y
CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP=y
CONFIG_HAVE_ARCH_KASAN=y
CONFIG_HAVE_ARCH_KASAN_VMALLOC=y
CONFIG_CC_HAS_KASAN_GENERIC=y
CONFIG_CC_HAS_KASAN_SW_TAGS=y
CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y
CONFIG_KASAN=y
CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX=y
CONFIG_KASAN_GENERIC=y
# CONFIG_KASAN_OUTLINE is not set
CONFIG_KASAN_INLINE=y
CONFIG_KASAN_STACK=y
CONFIG_KASAN_VMALLOC=y
# CONFIG_KASAN_EXTRA_INFO is not set
CONFIG_HAVE_ARCH_KFENCE=y
CONFIG_KFENCE=y
CONFIG_KFENCE_SAMPLE_INTERVAL=100
CONFIG_KFENCE_NUM_OBJECTS=255
# CONFIG_KFENCE_DEFERRABLE is not set
CONFIG_KFENCE_STATIC_KEYS=y
CONFIG_KFENCE_STRESS_TEST_FAULTS=0
CONFIG_HAVE_ARCH_KMSAN=y
# end of Memory Debugging

# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Oops, Lockups and Hangs
#
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=86400
CONFIG_LOCKUP_DETECTOR=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=1
CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y
CONFIG_HARDLOCKUP_DETECTOR=y
# CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set
CONFIG_HARDLOCKUP_DETECTOR_PERF=y
# CONFIG_HARDLOCKUP_DETECTOR_BUDDY is not set
# CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set
CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=140
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=1
# CONFIG_DETECT_HUNG_TASK_BLOCKER is not set
CONFIG_WQ_WATCHDOG=y
CONFIG_BOOTPARAM_WQ_STALL_PANIC=0
# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set
# CONFIG_TEST_LOCKUP is not set
# end of Debug Oops, Lockups and Hangs

#
# Scheduler Debugging
#
CONFIG_SCHED_INFO=y
CONFIG_SCHEDSTATS=y
# end of Scheduler Debugging

CONFIG_DEBUG_PREEMPT=y
# CONFIG_DEBUG_ATOMIC is not set

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RAW_LOCK_NESTING=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
CONFIG_DEBUG_RWSEMS=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_LOCKDEP=y
CONFIG_LOCKDEP_BITS=20
CONFIG_LOCKDEP_CHAINS_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
# CONFIG_WW_MUTEX_SELFTEST is not set
# CONFIG_SCF_TORTURE_TEST is not set
CONFIG_CSD_LOCK_WAIT_DEBUG=y
# CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT is not set
# end of Lock Debugging (spinlocks, mutexes, etc...)

CONFIG_TRACE_IRQFLAGS=y
CONFIG_TRACE_IRQFLAGS_NMI=y
CONFIG_NMI_CHECK_CPU=y
CONFIG_DEBUG_IRQFLAGS=y
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_KOBJECT_RELEASE is not set

#
# Debug kernel data structures
#
CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_PLIST=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
# CONFIG_DEBUG_CLOSURES is not set
CONFIG_DEBUG_MAPLE_TREE=y
# end of Debug kernel data structures

#
# RCU Debugging
#
CONFIG_PROVE_RCU=y
# CONFIG_RCU_SCALE_TEST is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_REF_SCALE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=100
CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0
# CONFIG_RCU_CPU_STALL_CPUTIME is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_EQS_DEBUG=y
# end of RCU Debugging

# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
# CONFIG_LATENCYTOP is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_RETHOOK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_REGS_HAVING_PT_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_JMP=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_OBJTOOL_MCOUNT=y
CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_PREEMPTIRQ_TRACEPOINTS=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_TRACEFS_AUTOMOUNT_DEPRECATED=y
# CONFIG_BOOTTIME_TRACING is not set
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_STACK_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_PREEMPT_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_HWLAT_TRACER is not set
# CONFIG_OSNOISE_TRACER is not set
# CONFIG_TIMERLAT_TRACER is not set
# CONFIG_MMIOTRACE is not set
# CONFIG_FTRACE_SYSCALLS is not set
# CONFIG_TRACER_SNAPSHOT is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_PROBE_EVENTS_DUMP_FETCHARG is not set
CONFIG_UPROBE_EVENTS=y
CONFIG_EPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_DYNAMIC_EVENTS=y
CONFIG_PROBE_EVENTS=y
# CONFIG_SYNTH_EVENTS is not set
# CONFIG_USER_EVENTS is not set
# CONFIG_HIST_TRIGGERS is not set
CONFIG_TRACE_EVENT_INJECT=y
# CONFIG_TRACEPOINT_BENCHMARK is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_TRACE_EVAL_MAP_FILE is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS=y
# CONFIG_RING_BUFFER_PERSISTENT_INJECT is not set
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
# CONFIG_RV is not set
# CONFIG_TRACE_REMOTE_TEST is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_SAMPLES is not set
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
# CONFIG_STRICT_DEVMEM is not set

#
# x86 Debugging
#
CONFIG_EARLY_PRINTK_USB=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_EARLY_PRINTK_USB_XDBC is not set
# CONFIG_DEBUG_TLBFLUSH is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEBUG_BOOT_PARAMS=y
# CONFIG_CPA_DEBUG is not set
CONFIG_DEBUG_ENTRY=y
# CONFIG_DEBUG_NMI_SELFTEST is not set
CONFIG_X86_DEBUG_FPU=y
# CONFIG_PUNIT_ATOM_DEBUG is not set
CONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
# end of x86 Debugging

#
# Kernel Testing and Coverage
#
# CONFIG_KUNIT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
CONFIG_FAULT_INJECTION=y
CONFIG_FAILSLAB=y
CONFIG_FAIL_PAGE_ALLOC=y
CONFIG_FAULT_INJECTION_USERCOPY=y
CONFIG_FAIL_MAKE_REQUEST=y
CONFIG_FAIL_IO_TIMEOUT=y
CONFIG_FAIL_FUTEX=y
CONFIG_FAULT_INJECTION_DEBUG_FS=y
# CONFIG_FAIL_MMC_REQUEST is not set
# CONFIG_FAIL_SKB_REALLOC is not set
CONFIG_FAULT_INJECTION_CONFIGFS=y
# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
CONFIG_ARCH_HAS_KCOV=y
CONFIG_KCOV=y
CONFIG_KCOV_ENABLE_COMPARISONS=y
CONFIG_KCOV_INSTRUMENT_ALL=y
CONFIG_KCOV_IRQ_AREA_SIZE=0x40000
# CONFIG_KCOV_SELFTEST is not set
CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_TEST_DHRY is not set
# CONFIG_LKDTM is not set
# CONFIG_TEST_DIV64 is not set
# CONFIG_TEST_MULDIV64 is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_TEST_REF_TRACKER is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_REED_SOLOMON_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_PERCPU_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_BITMAP is not set
# CONFIG_TEST_XARRAY is not set
# CONFIG_TEST_MAPLE_TREE is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_TEST_IDA is not set
# CONFIG_TEST_LKM is not set
# CONFIG_TEST_BITOPS is not set
# CONFIG_TEST_VMALLOC is not set
# CONFIG_TEST_WORKQUEUE is not set
# CONFIG_TEST_BPF is not set
# CONFIG_FIND_BIT_BENCHMARK is not set
# CONFIG_REGION_ALLOC_BENCHMARK is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_SYSCTL is not set
# CONFIG_CONTEXT_ANALYSIS_TEST is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_TEST_STATIC_KEYS is not set
# CONFIG_TEST_DYNAMIC_DEBUG is not set
# CONFIG_TEST_KMOD is not set
# CONFIG_TEST_KALLSYMS is not set
# CONFIG_TEST_DEBUG_VIRTUAL is not set
# CONFIG_TEST_MEMCAT_P is not set
# CONFIG_TEST_MEMINIT is not set
# CONFIG_TEST_HMM is not set
# CONFIG_TEST_FREE_PAGES is not set
# CONFIG_TEST_CLOCKSOURCE_WATCHDOG is not set
# CONFIG_TEST_OBJPOOL is not set
CONFIG_ARCH_USE_MEMTEST=y
# CONFIG_MEMTEST is not set
# end of Kernel Testing and Coverage

#
# Rust hacking
#
# end of Rust hacking
# end of Kernel hacking

CONFIG_IO_URING_ZCRX=y
CONFIG_IO_URING_BPF=y
KernelConfigManager ci-qemu-upstream
KernelRepo https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
ReproCID 0
ReproOpts
ReproSyzID 0
SyzkallerCommit 680aa3e19b52574eca8bcba3c41aa18235367abe
TargetArch amd64
TargetOS linux

Outputs:
Reproduced ✅
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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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;
}
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)

Crash report:
------------[ 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)

Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
deep-reasoning

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
map[OracleFeedback:]

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:
deep-reasoning

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:
gemini-3.1-pro-preview

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:
map[Name:race]

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, &reg) == -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:
gemini-3.1-pro-preview

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:
map[CompilerError:]

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:
deep-reasoning

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:
gemini-3.1-pro-preview

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:
deep-reasoning

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, &notif, 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, &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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
map[Name:race]

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, &reg) == -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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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, &notif, 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, &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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &notif, 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, &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:
gemini-3.1-pro-preview

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:
map[Name:race]

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, &reg) == -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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
gemini-3.1-pro-preview

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
map[CompilerError:]

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:
deep-reasoning

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:
gemini-3.1-pro-preview

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:
deep-reasoning

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, &notif, 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, &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, &notif, 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, &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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[Expression:USB_RAW_IOCTL_EP0_READ PathPrefix:tools/testing/selftests/]

Results:
map[Output:]

185/5 2026/09/11 22:44 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[Expression:struct usb_raw_event { PathPrefix:include/uapi/linux/usb/raw_gadget.h]

Results:
map[Output:]

191/5 2026/09/11 22:45 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
map[Name:race]

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, &reg) == -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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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, &notif, 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, &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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &notif, 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, &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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[ContextFile: Name:raw_setup]

Results:
map[SourceCode: SourceFile:]

230/4 2026/09/11 22:53 llm repro-generator
0m Model:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[Expression:USB_REQ_SET_ADDRESS PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]

Results:
map[Output:]

232/4 2026/09/11 22:53 llm repro-generator
0m Model:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[Expression:set_address PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]

Results:
map[Output:]

234/4 2026/09/11 22:53 llm repro-generator
0m Model:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[ContextFile: Name:raw_setup]

Results:
map[SourceCode: SourceFile:]

240/4 2026/09/11 22:54 llm repro-generator
0m Model:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[Expression:SET_ADDRESS PathPrefix:drivers/usb/gadget/udc/core.c]

Results:
map[Output:]

246/4 2026/09/11 22:55 llm repro-generator
0m Model:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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(&notif2_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(&notif2_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(&notif2_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:
gemini-3.1-pro-preview

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
gemini-3.1-pro-preview

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
map[CompilerError:]

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:
deep-reasoning

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:
gemini-3.1-pro-preview

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:
deep-reasoning

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, &notif, 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, &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, &notif, 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, &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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[Expression:USB_RAW_IOCTL_EP0_WRITE PathPrefix:tools/]

Results:
map[Output:]

290/5 2026/09/11 23:12 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[ContextFile: Name:raw_setup]

Results:
map[SourceCode: SourceFile:]

292/5 2026/09/11 23:13 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

Args:
map[Expression:U16_MAX PathPrefix:drivers/usb/gadget/legacy/raw_gadget.c]

Results:
map[Output:]

328/5 2026/09/11 23:19 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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, &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:
gemini-3.1-pro-preview

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, &notif, 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, &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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &notif, 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, &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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
log-in to see details

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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:
gemini-3.1-pro-preview

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
gemini-3.1-pro-preview

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
map[CompilerError:]

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:
deep-reasoning

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:
gemini-3.1-pro-preview

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:
deep-reasoning

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, &notif, 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, &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, &notif, 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, &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:
gemini-3.1-pro-preview

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, &notif, 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, &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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &notif, 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, &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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
gemini-3.1-pro-preview

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
deep-reasoning

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
gemini-3.1-pro-preview

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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
map[CompilerError:]

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:
deep-reasoning

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:
gemini-3.1-pro-preview

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, &reg) == -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(&notif2_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, &notif, 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(&notif2_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, &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(&notif2_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:
map[]

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)