ID Workflow Result Correct Bug Created Started Finished Revision
372cefef patching ❓ WARNING in ttusb_dec_start_feed 2026/08/17 20:34 2026/08/17 20:34 2026/08/17 22:10 1e72964b
Agent: prod-syz-agent-1
External Bug ID: ---

Inputs:
BaseBranch master
BaseCommit RC
BaseRepository git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
BugTitle WARNING in ttusb_dec_start_feed
CrashLogID 6476946935906304
CrashReportID 6597906317967360
KernelCommit ba5cc80fd32665ed609037ff30ede8d194f24aab
KernelConfig
Show (259814 bytes)
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 syzkaller Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77)"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=220108
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=220108
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=220108
CONFIG_RUSTC_VERSION=109600
CONFIG_RUST_IS_AVAILABLE=y
CONFIG_RUSTC_LLVM_VERSION=220102
CONFIG_RUSTC_LLVM_MAJOR_VERSION=22
CONFIG_RUSTC_CLANG_LLVM_COMPATIBLE=y
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_CC_HAS_COUNTED_BY=y
CONFIG_CC_HAS_COUNTED_BY_PTR=y
CONFIG_CC_HAS_ALLOC_TOKEN=y
CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=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_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_SHOW_LEVEL=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_IRQ_IPI=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_IRQ_MSI_IOMMU=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
CONFIG_GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD=y
# end of IRQ subsystem

CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_ARCH_HAS_TICK_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=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=y
CONFIG_BPF_JIT_DEFAULT_ON=y
CONFIG_BPF_UNPRIV_DEFAULT_OFF=y
# CONFIG_BPF_PRELOAD is not set
# 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_PREEMPTION=y
# CONFIG_PREEMPT_DYNAMIC is not set
# CONFIG_SCHED_CORE is not set

#
# 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_SCHED_HW_PRESSURE=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
# CONFIG_TASK_DELAY_ACCT is not set
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_GENERIC_SCHED_CLOCK=y

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

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"
CONFIG_CC_MS_EXTENSIONS="-fms-extensions"
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GCC_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=y
# CONFIG_CGROUP_MISC is not set
# CONFIG_CGROUP_DEBUG is not set
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=y
# CONFIG_RELAY is not set
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_CMDLINE_LOG_WRAP_IDEAL_LEN=1021
CONFIG_INITRAMFS_PRESERVE_MTIME=y
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_LD_ORPHAN_WARN=y
CONFIG_LD_ORPHAN_WARN_LEVEL="warn"
CONFIG_SYSCTL=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y
# CONFIG_SGETMASK_SYSCALL is not set
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
# CONFIG_BASE_SMALL is not set
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_FUTEX_PRIVATE_HASH=y
CONFIG_FUTEX_MPOL=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_STATS is not set
# CONFIG_RSEQ_DEBUG_DEFAULT_ENABLE is not set
# CONFIG_DEBUG_RSEQ 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

#
# 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_RUST is not set
CONFIG_TRACEPOINTS=y

#
# Kexec and crash features
#
CONFIG_CRASH_RESERVE=y
CONFIG_VMCORE_INFO=y
CONFIG_KEXEC_CORE=y
CONFIG_HAVE_IMA_KEXEC=y
CONFIG_KEXEC=y
CONFIG_KEXEC_FILE=y
# CONFIG_KEXEC_SIG is not set
CONFIG_CRASH_DUMP=y
# CONFIG_CRASH_DM_CRYPT is not set
# 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_ARM64=y
CONFIG_RUSTC_SUPPORTS_ARM64=y
CONFIG_CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_64BIT=y
CONFIG_MMU=y
CONFIG_ARM64_CONT_PTE_SHIFT=4
CONFIG_ARM64_CONT_PMD_SHIFT=4
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
CONFIG_ARCH_MMAP_RND_BITS_MAX=33
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_SMP=y
CONFIG_KERNEL_MODE_NEON=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=5
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y
CONFIG_KASAN_SHADOW_OFFSET=0xdfff800000000000

#
# Platform selection
#
# CONFIG_ARCH_ACTIONS is not set
# CONFIG_ARCH_AIROHA is not set
# CONFIG_ARCH_SUNXI is not set
# CONFIG_ARCH_ALPINE is not set
# CONFIG_ARCH_APPLE is not set
# CONFIG_ARCH_ASPEED is not set
# CONFIG_ARCH_AXIADO is not set
# CONFIG_ARCH_BCM is not set
# CONFIG_ARCH_BERLIN is not set
# CONFIG_ARCH_BITMAIN is not set
# CONFIG_ARCH_BLAIZE is not set
# CONFIG_ARCH_BST is not set
# CONFIG_ARCH_CIX is not set
# CONFIG_ARCH_EXYNOS is not set
# CONFIG_ARCH_K3 is not set
# CONFIG_ARCH_LG1K is not set
# CONFIG_ARCH_HISI is not set
# CONFIG_ARCH_KEEMBAY is not set
# CONFIG_ARCH_MEDIATEK is not set
# CONFIG_ARCH_MESON is not set
# CONFIG_ARCH_MICROCHIP is not set
# CONFIG_ARCH_MMP is not set
# CONFIG_ARCH_MVEBU is not set
# CONFIG_ARCH_NXP is not set
# CONFIG_ARCH_MA35 is not set
# CONFIG_ARCH_NPCM is not set
# CONFIG_ARCH_PENSANDO is not set
# CONFIG_ARCH_QCOM is not set
# CONFIG_ARCH_REALTEK is not set
# CONFIG_ARCH_RENESAS is not set
# CONFIG_ARCH_ROCKCHIP is not set
# CONFIG_ARCH_SEATTLE is not set
# CONFIG_ARCH_INTEL_SOCFPGA is not set
# CONFIG_ARCH_SOPHGO is not set
# CONFIG_ARCH_STM32 is not set
# CONFIG_ARCH_SYNQUACER is not set
# CONFIG_ARCH_TEGRA is not set
# CONFIG_ARCH_SPRD is not set
# CONFIG_ARCH_THUNDER is not set
# CONFIG_ARCH_THUNDER2 is not set
# CONFIG_ARCH_UNIPHIER is not set
CONFIG_ARCH_VEXPRESS=y
# CONFIG_ARCH_VISCONTI is not set
# CONFIG_ARCH_XGENE is not set
# CONFIG_ARCH_ZYNQMP is not set
# end of Platform selection

#
# Kernel Features
#

#
# ARM errata workarounds via the alternatives framework
#
CONFIG_AMPERE_ERRATUM_AC03_CPU_38=y
CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y
CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
CONFIG_ARM64_ERRATUM_826319=y
CONFIG_ARM64_ERRATUM_827319=y
CONFIG_ARM64_ERRATUM_824069=y
CONFIG_ARM64_ERRATUM_819472=y
CONFIG_ARM64_ERRATUM_832075=y
# CONFIG_ARM64_ERRATUM_834220 is not set
CONFIG_ARM64_ERRATUM_1742098=y
CONFIG_ARM64_ERRATUM_845719=y
CONFIG_ARM64_ERRATUM_843419=y
CONFIG_ARM64_ERRATUM_1024718=y
CONFIG_ARM64_ERRATUM_1418040=y
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y
CONFIG_ARM64_ERRATUM_1165522=y
CONFIG_ARM64_ERRATUM_1319367=y
CONFIG_ARM64_ERRATUM_1530923=y
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI_SYNC=y
# CONFIG_ARM64_ERRATUM_2441007 is not set
# CONFIG_ARM64_ERRATUM_1286807 is not set
CONFIG_ARM64_ERRATUM_1463225=y
# CONFIG_ARM64_ERRATUM_1542419 is not set
CONFIG_ARM64_ERRATUM_1508412=y
CONFIG_ARM64_ERRATUM_2051678=y
CONFIG_ARM64_ERRATUM_2077057=y
CONFIG_ARM64_ERRATUM_2658417=y
CONFIG_ARM64_WORKAROUND_TSB_FLUSH_FAILURE=y
CONFIG_ARM64_ERRATUM_2054223=y
CONFIG_ARM64_ERRATUM_2067961=y
# CONFIG_ARM64_ERRATUM_2441009 is not set
CONFIG_ARM64_ERRATUM_2457168=y
CONFIG_ARM64_ERRATUM_2645198=y
CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD=y
CONFIG_ARM64_ERRATUM_2966298=y
CONFIG_ARM64_ERRATUM_3117295=y
CONFIG_ARM64_ERRATUM_3194386=y
CONFIG_ARM64_ERRATUM_4311569=y
CONFIG_ARM64_ERRATUM_4193714=y
CONFIG_ARM64_ERRATUM_4118414=y
CONFIG_CAVIUM_ERRATUM_22375=y
CONFIG_CAVIUM_ERRATUM_23144=y
CONFIG_CAVIUM_ERRATUM_23154=y
CONFIG_CAVIUM_ERRATUM_27456=y
CONFIG_CAVIUM_ERRATUM_30115=y
CONFIG_CAVIUM_TX2_ERRATUM_219=y
CONFIG_FUJITSU_ERRATUM_010001=y
CONFIG_HISILICON_ERRATUM_161600802=y
CONFIG_HISILICON_ERRATUM_162100801=y
CONFIG_HISILICON_ERRATUM_162100125=y
CONFIG_QCOM_FALKOR_ERRATUM_1003=y
CONFIG_QCOM_FALKOR_ERRATUM_1009=y
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
CONFIG_QCOM_FALKOR_ERRATUM_E1041=y
CONFIG_ARM64_WORKAROUND_DISABLE_CNP=y
CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y
CONFIG_NVIDIA_OLYMPUS_1027_ERRATUM=y
CONFIG_ROCKCHIP_ERRATUM_3568002=y
CONFIG_ROCKCHIP_ERRATUM_3588001=y
CONFIG_SOCIONEXT_SYNQUACER_PREITS=y
# end of ARM errata workarounds via the alternatives framework

CONFIG_ARM64_4K_PAGES=y
# CONFIG_ARM64_16K_PAGES is not set
# CONFIG_ARM64_64K_PAGES is not set
# CONFIG_ARM64_VA_BITS_39 is not set
# CONFIG_ARM64_VA_BITS_48 is not set
CONFIG_ARM64_VA_BITS_52=y
# CONFIG_ARM64_FORCE_52BIT is not set
CONFIG_ARM64_VA_BITS=52
CONFIG_ARM64_PA_BITS_52=y
CONFIG_ARM64_PA_BITS=52
CONFIG_ARM64_LPA2=y
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_NR_CPUS=8
CONFIG_HOTPLUG_CPU=y
CONFIG_NUMA=y
CONFIG_NODES_SHIFT=4
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_SPARSEMEM_ENABLE=y
CONFIG_HW_PERF_EVENTS=y
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_ARCH_SUPPORTS_KEXEC=y
CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y
CONFIG_ARCH_SELECTS_KEXEC_FILE=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_IMAGE_VERIFY_SIG=y
CONFIG_ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_HANDOVER=y
CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y
CONFIG_ARCH_DEFAULT_CRASH_DUMP=y
CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y
CONFIG_TRANS_TABLE=y
# CONFIG_XEN is not set
CONFIG_ARCH_FORCE_MAX_ORDER=10
CONFIG_UNMAP_KERNEL_AT_EL0=y
CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y
# CONFIG_ARM64_SW_TTBR0_PAN is not set
CONFIG_ARM64_TAGGED_ADDR_ABI=y
CONFIG_COMPAT=y
CONFIG_KUSER_HELPERS=y
CONFIG_COMPAT_VDSO=y
CONFIG_THUMB2_COMPAT_VDSO=y
# CONFIG_COMPAT_ALIGNMENT_FIXUPS is not set
# CONFIG_ARMV8_DEPRECATED is not set

#
# ARMv8.1 architectural features
#
CONFIG_ARM64_HW_AFDBM=y
# end of ARMv8.1 architectural features

#
# ARMv8.2 architectural features
#
CONFIG_ARM64_PMEM=y
CONFIG_ARM64_RAS_EXTN=y
CONFIG_ARM64_CNP=y
# end of ARMv8.2 architectural features

#
# ARMv8.3 architectural features
#
CONFIG_ARM64_PTR_AUTH=y
CONFIG_ARM64_PTR_AUTH_KERNEL=y
CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y
CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y
# end of ARMv8.3 architectural features

#
# ARMv8.4 architectural features
#
CONFIG_ARM64_AMU_EXTN=y
CONFIG_ARM64_TLB_RANGE=y
# CONFIG_ARM64_MPAM is not set
# end of ARMv8.4 architectural features

#
# ARMv8.5 architectural features
#
CONFIG_AS_HAS_ARMV8_5=y
CONFIG_ARM64_BTI=y
CONFIG_ARM64_BTI_KERNEL=y
CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI=y
CONFIG_ARM64_E0PD=y
CONFIG_ARM64_AS_HAS_MTE=y
CONFIG_ARM64_MTE=y
# end of ARMv8.5 architectural features

#
# ARMv8.7 architectural features
#
CONFIG_ARM64_EPAN=y
# end of ARMv8.7 architectural features

CONFIG_AS_HAS_MOPS=y

#
# ARMv8.9 architectural features
#
CONFIG_ARM64_POE=y
CONFIG_ARCH_PKEY_BITS=3
CONFIG_ARM64_HAFT=y
# end of ARMv8.9 architectural features

#
# ARMv9.4 architectural features
#
CONFIG_ARM64_GCS=y
# end of ARMv9.4 architectural features

CONFIG_AS_HAS_LSUI=y

#
# ARMv9.6 architectural features
#
CONFIG_ARM64_LSUI=y
# end of ARMv9.6 architectural features

CONFIG_ARM64_SVE=y
CONFIG_AS_HAS_SME=y
CONFIG_ARM64_SME=y
# CONFIG_ARM64_PSEUDO_NMI is not set
# CONFIG_RELOCATABLE is not set
# CONFIG_RANDOMIZE_BASE is not set
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
CONFIG_STACKPROTECTOR_PER_TASK=y
CONFIG_ARM64_CONTPTE=y
# end of Kernel Features

#
# Boot options
#
# CONFIG_ARM64_ACPI_PARKING_PROTOCOL is not set
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/vda console=ttyAMA0 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_FROM_BOOTLOADER=y
# CONFIG_CMDLINE_FORCE is not set
CONFIG_EFI_STUB=y
CONFIG_EFI=y
# CONFIG_COMPRESSED_INSTALL is not set
CONFIG_DMI=y
# end of Boot options

#
# Power management options
#
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_CLK=y
CONFIG_PM_GENERIC_DOMAINS=y
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
CONFIG_PM_GENERIC_DOMAINS_OF=y
CONFIG_CPU_PM=y
CONFIG_ENERGY_MODEL=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# end of Power management options

#
# CPU Power Management
#

#
# CPU Idle
#
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_CPU_IDLE_GOV_TEO is not set
CONFIG_DT_IDLE_STATES=y
CONFIG_DT_IDLE_GENPD=y

#
# ARM CPU Idle Drivers
#
CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y
# end of ARM CPU Idle Drivers
# end of CPU Idle

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
# 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_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#
# CPU frequency scaling drivers
#
CONFIG_CPUFREQ_DT=y
# CONFIG_CPUFREQ_VIRT is not set
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_ARM_SCMI_CPUFREQ=y
CONFIG_ACPI_CPPC_CPUFREQ=y
CONFIG_ACPI_CPPC_CPUFREQ_FIE=y
# end of CPU Frequency scaling
# end of CPU Power Management

CONFIG_ARCH_SUPPORTS_ACPI=y
CONFIG_ACPI=y
CONFIG_ACPI_GENERIC_GSI=y
CONFIG_ACPI_CCA_REQUIRED=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_EC 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_PROCESSOR_IDLE=y
CONFIG_ACPI_MCFG=y
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
# CONFIG_ACPI_IPMI is not set
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_THERMAL=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=y
CONFIG_ACPI_HED=y
# CONFIG_ACPI_BGRT is not set
CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y
# CONFIG_ACPI_NFIT is not set
CONFIG_ACPI_NUMA=y
CONFIG_ACPI_HMAT=y
CONFIG_HAVE_ACPI_APEI=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
CONFIG_ACPI_APEI_PCIEAER=y
CONFIG_ACPI_APEI_SEA=y
CONFIG_ACPI_APEI_MEMORY_FAILURE=y
CONFIG_ACPI_APEI_EINJ=y
# CONFIG_ACPI_APEI_GHES_NVIDIA is not set
# CONFIG_ACPI_APEI_ERST_DEBUG is not set
# CONFIG_ACPI_CONFIGFS is not set
# CONFIG_ACPI_PFRUT is not set
CONFIG_ACPI_IORT=y
CONFIG_ACPI_GTDT=y
# CONFIG_ACPI_AGDI is not set
CONFIG_ACPI_APMT=y
CONFIG_ACPI_PPTT=y
CONFIG_ACPI_PCC=y
# CONFIG_ACPI_FFH is not set
CONFIG_PMIC_OPREGION=y
CONFIG_ACPI_PRMT=y
CONFIG_KVM_COMMON=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_NEED_KVM_DIRTY_RING_WITH_BITMAP=y
CONFIG_KVM_MMIO=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_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE=y
CONFIG_VIRT_XFER_TO_GUEST_WORK=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_GUEST_MEMFD=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
# CONFIG_PTDUMP_STAGE2_DEBUGFS is not set
# CONFIG_NVHE_EL2_DEBUG is not set
CONFIG_HAVE_LIVEPATCH=y
CONFIG_CPU_MITIGATIONS=y

#
# General architecture-dependent options
#
CONFIG_ARCH_HAS_SUBPAGE_FAULTS=y
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_GENERIC_IRQ_ENTRY=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
# CONFIG_STATIC_KEYS_SELFTEST is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=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_GENERIC_IDLE_POLL_SETUP=y
CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
CONFIG_ARCH_HAS_KEEPINITRD=y
CONFIG_ARCH_HAS_SET_MEMORY=y
CONFIG_ARCH_HAS_SET_DIRECT_MAP=y
CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
CONFIG_ARCH_WANTS_NO_INSTR=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_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_LAZY_TLB_REFCOUNT=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=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_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_SHADOW_CALL_STACK=y
# CONFIG_SHADOW_CALL_STACK is not set
CONFIG_ARCH_SUPPORTS_LTO_CLANG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y
CONFIG_HAS_LTO_CLANG=y
CONFIG_LTO_NONE=y
# CONFIG_LTO_CLANG_FULL is not set
# CONFIG_LTO_CLANG_THIN is not set
# CONFIG_LTO_CLANG_THIN_DIST is not set
# CONFIG_AUTOFDO_CLANG is not set
# CONFIG_PROPELLER_CLANG is not set
CONFIG_ARCH_SUPPORTS_CFI=y
# CONFIG_CFI is not set
CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS=y
CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC=y
CONFIG_HAVE_CONTEXT_TRACKING_USER=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_HUGE_VMAP=y
CONFIG_HAVE_ARCH_HUGE_VMALLOC=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_PMD_MKWRITE=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_WANTS_EXECMEM_LATE=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_ARCH_MMAP_RND_BITS=18
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
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_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
CONFIG_HAVE_RELIABLE_STACKTRACE=y
CONFIG_CLONE_BACKWARDS=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_COMPILER_H=y
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y
CONFIG_ARCH_USE_MEMREMAP_PROT=y
# CONFIG_LOCK_EVENT_COUNTS is not set
CONFIG_ARCH_HAS_MEM_ENCRYPT=y
CONFIG_ARCH_HAS_CC_PLATFORM=y
CONFIG_HAVE_PREEMPT_DYNAMIC=y
CONFIG_HAVE_PREEMPT_DYNAMIC_KEY=y
CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y
CONFIG_ARCH_HAVE_TRACE_MMIO_ACCESS=y
CONFIG_ARCH_HAS_HW_PTE_YOUNG=y
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y
CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=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=4
CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT=y
CONFIG_HAVE_ARCH_GET_SECUREBOOT=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_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 is not set
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_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
CONFIG_FREEZER=y

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_STATE=y
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
CONFIG_ARCH_HAVE_ELF_PROT=y
CONFIG_ARCH_USE_GNU_PROPERTY=y
CONFIG_ELFCORE=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
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_HAVE_GUP_FAST=y
CONFIG_ARCH_KEEP_MEMBLOCK=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=y
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_ENABLE_THP_MIGRATION=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=y
# CONFIG_HWPOISON_INJECT is not set
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=y
# 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 is not set
CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER=y
# 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 is not set
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_ARCH_SUPPORTS_HUGE_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PMD_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_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_ARCH_USES_HIGH_VMA_FLAGS=y
CONFIG_ARCH_HAS_PKEYS=y
CONFIG_ARCH_USES_PG_ARCH_2=y
CONFIG_ARCH_USES_PG_ARCH_3=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_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=y
# CONFIG_PTE_MARKER_UFFD_WP is not set
# CONFIG_LRU_GEN is not set
CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y
CONFIG_PER_VMA_LOCK=y
CONFIG_LOCK_MM_AND_FIND_VMA=y
CONFIG_EXECMEM=y
CONFIG_NUMA_MEMBLKS=y
# CONFIG_NUMA_EMU is not set
CONFIG_ARCH_HAS_USER_SHADOW_STACK=y
CONFIG_PT_RECLAIM=y
CONFIG_ARCH_HAS_LAZY_MMU_MODE=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_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_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 is not set
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 is not set
# 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=y
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="bbr"
# 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 is not set
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=y
# 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=y
CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS=y
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_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=y
CONFIG_NET_DSA_TAG_OCELOT_8021Q=y
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_OPENVSWITCH_GRE=y
CONFIG_OPENVSWITCH_VXLAN=y
CONFIG_OPENVSWITCH_GENEVE=y
CONFIG_VSOCKETS=y
CONFIG_VSOCKETS_DIAG=y
CONFIG_VSOCKETS_LOOPBACK=y
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_SMD=y
CONFIG_QRTR_TUN=y
CONFIG_QRTR_MHI=y
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_BPF_STREAM_PARSER is not set
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_DROP_MONITOR is not set
# 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=y
# 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=y
# 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=y
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_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=y
CONFIG_NFC_NXP_NCI_I2C=y
CONFIG_NFC_S3FWRN5=y
CONFIG_NFC_S3FWRN5_I2C=y
# 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=y
CONFIG_FAILOVER=y
CONFIG_ETHTOOL_NETLINK=y

#
# Device Drivers
#
CONFIG_ARM_AMBA=y
CONFIG_HAVE_PCI=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_SYSCALL=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_IOV=y
# CONFIG_PCI_NPEM is not set
# CONFIG_PCI_PRI is not set
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=y
# CONFIG_HOTPLUG_PCI_ACPI_AMPERE_ALTRA is not set
# CONFIG_HOTPLUG_PCI_ACPI_IBM 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_PCIE_ALTERA=y
CONFIG_PCIE_ALTERA_MSI=y
CONFIG_PCI_HOST_THUNDER_PEM=y
CONFIG_PCI_HOST_THUNDER_ECAM=y
# CONFIG_PCI_FTPCI100 is not set
CONFIG_PCI_HOST_GENERIC=y
# CONFIG_PCIE_HISI_ERR is not set
CONFIG_PCI_XGENE=y
CONFIG_PCI_XGENE_MSI=y
CONFIG_PCIE_XILINX=y

#
# 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_PCIE_DW=y
# CONFIG_PCIE_DW_DEBUGFS is not set
CONFIG_PCIE_DW_HOST=y
# CONFIG_PCIE_AL is not set
# CONFIG_PCIE_AMD_MDB is not set
CONFIG_PCI_MESON=y
CONFIG_PCI_HISI=y
CONFIG_PCIE_KIRIN=y
# 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=y
# CONFIG_PCI_ENDPOINT_MSI_DOORBELL is not set
CONFIG_PCI_EPF_TEST=y
# 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=y
CONFIG_PCI_PWRCTRL_GENERIC=y
CONFIG_PCI_PWRCTRL_TC9563=y
# CONFIG_CXL_BUS is not set
CONFIG_PCCARD=y
CONFIG_PCMCIA=y
# CONFIG_PCMCIA_LOAD_CIS is not set
# CONFIG_CARDBUS is not set

#
# PC-card bridges
#
# CONFIG_YENTA is not set
# CONFIG_PD6729 is not set
# 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=y
# 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_HMEM_REPORTING=y
# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set
CONFIG_GENERIC_CPU_DEVICES=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_SOC_BUS=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SLIMBUS=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_SPMI=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGMAP_IRQ=y
CONFIG_DMA_SHARED_BUFFER=y
# CONFIG_DMA_FENCE_TRACE is not set
CONFIG_GENERIC_ARCH_TOPOLOGY=y
CONFIG_GENERIC_ARCH_NUMA=y
# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set
# end of Generic Driver Options

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

# CONFIG_CACHEMAINT_FOR_HOTPLUG is not set
CONFIG_CONNECTOR=y
# CONFIG_PROC_EVENTS is not set

#
# Firmware Drivers
#

#
# ARM System Control and Management Interface Protocol
#
CONFIG_ARM_SCMI_PROTOCOL=y
# CONFIG_ARM_SCMI_RAW_MODE_SUPPORT is not set
# CONFIG_ARM_SCMI_DEBUG_COUNTERS is not set
CONFIG_ARM_SCMI_QUIRKS=y

#
# SCMI Transport Drivers
#
CONFIG_ARM_SCMI_HAVE_TRANSPORT=y
CONFIG_ARM_SCMI_HAVE_SHMEM=y
CONFIG_ARM_SCMI_HAVE_MSG=y
CONFIG_ARM_SCMI_TRANSPORT_MAILBOX=y
CONFIG_ARM_SCMI_TRANSPORT_SMC=y
# CONFIG_ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE is not set
CONFIG_ARM_SCMI_TRANSPORT_OPTEE=y
# CONFIG_ARM_SCMI_TRANSPORT_VIRTIO is not set
# end of SCMI Transport Drivers

#
# ARM SCMI NXP i.MX Vendor Protocols
#
CONFIG_IMX_SCMI_BBM_EXT=y
# end of ARM SCMI NXP i.MX Vendor Protocols

# CONFIG_ARM_SCMI_POWER_CONTROL is not set
# end of ARM System Control and Management Interface Protocol

CONFIG_ARM_SCPI_PROTOCOL=y
CONFIG_ARM_SDE_INTERFACE=y
# CONFIG_ARM_SDEI_NMI is not set
# CONFIG_FIRMWARE_MEMMAP is not set
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
# CONFIG_ISCSI_IBFT is not set
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_SYSFB=y
# CONFIG_SYSFB_SIMPLEFB is not set
# CONFIG_ARM_FFA_TRANSPORT is not set
CONFIG_GOOGLE_FIRMWARE=y
CONFIG_GOOGLE_CBMEM=y
CONFIG_GOOGLE_COREBOOT_TABLE=y
CONFIG_GOOGLE_MEMCONSOLE=y
# CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT is not set
CONFIG_GOOGLE_MEMCONSOLE_COREBOOT=y
CONFIG_GOOGLE_VPD=y

#
# EFI (Extensible Firmware Interface) Support
#
CONFIG_EFI_ESRT=y
CONFIG_EFI_VARS_PSTORE=y
# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set
CONFIG_EFI_SOFT_RESERVE=y
CONFIG_EFI_PARAMS_FROM_FDT=y
CONFIG_EFI_RUNTIME_WRAPPERS=y
CONFIG_EFI_GENERIC_STUB=y
# CONFIG_EFI_ZBOOT is not set
CONFIG_EFI_ARMSTUB_DTB_LOADER=y
# CONFIG_EFI_BOOTLOADER_CONTROL is not set
CONFIG_EFI_CAPSULE_LOADER=y
# CONFIG_EFI_TEST is not set
# CONFIG_RESET_ATTACK_MITIGATION is not set
# CONFIG_EFI_DISABLE_PCI_DMA is not set
CONFIG_EFI_EARLYCON=y
CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y
# CONFIG_EFI_DISABLE_RUNTIME is not set
# CONFIG_EFI_COCO_SECRET is not set
# CONFIG_OVMF_DEBUG_LOG is not set
# end of EFI (Extensible Firmware Interface) Support

CONFIG_UEFI_CPER=y
CONFIG_UEFI_CPER_ARM=y
# CONFIG_TEE_STMM_EFI is not set
CONFIG_ARM_PSCI_FW=y
# CONFIG_ARM_PSCI_CHECKER is not set

#
# Qualcomm firmware drivers
#
# end of Qualcomm firmware drivers

CONFIG_HAVE_ARM_SMCCC=y
CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y
CONFIG_ARM_SMCCC_SOC_ID=y

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

# CONFIG_FWCTL is not set
CONFIG_GNSS=y
CONFIG_GNSS_SERIAL=y
CONFIG_GNSS_MTK_SERIAL=y
# 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=y
# CONFIG_MTD_AFS_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=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_NOSWAP=y
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
# CONFIG_MTD_CFI_GEOMETRY 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_OTP is not set
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_CFI_UTIL=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=y
CONFIG_MTD_PHYSMAP=y
# CONFIG_MTD_PHYSMAP_COMPAT is not set
CONFIG_MTD_PHYSMAP_OF=y
# CONFIG_MTD_PHYSMAP_VERSATILE is not set
# CONFIG_MTD_PHYSMAP_GEMINI is not set
# CONFIG_MTD_PHYSMAP_GPIO_ADDR is not set
# CONFIG_MTD_PCI is not set
# CONFIG_MTD_PCMCIA 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=y
# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
# CONFIG_MTD_DATAFLASH_OTP is not set
# CONFIG_MTD_MCHP23K256 is not set
# CONFIG_MTD_MCHP48L640 is not set
CONFIG_MTD_SST25L=y
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

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

#
# NAND
#
CONFIG_MTD_NAND_CORE=y
# CONFIG_MTD_ONENAND is not set
CONFIG_MTD_RAW_NAND=y

#
# Raw/parallel NAND flash controllers
#
CONFIG_MTD_NAND_DENALI=y
# CONFIG_MTD_NAND_DENALI_PCI is not set
CONFIG_MTD_NAND_DENALI_DT=y
# CONFIG_MTD_NAND_CAFE is not set
CONFIG_MTD_NAND_BRCMNAND=y
# CONFIG_MTD_NAND_BRCMNAND_BCM63XX is not set
CONFIG_MTD_NAND_BRCMNAND_BCMBCA=y
CONFIG_MTD_NAND_BRCMNAND_BRCMSTB=y
CONFIG_MTD_NAND_BRCMNAND_IPROC=y
# CONFIG_MTD_NAND_MXIC is not set
# CONFIG_MTD_NAND_GPIO is not set
# CONFIG_MTD_NAND_PLATFORM is not set
# CONFIG_MTD_NAND_CADENCE is not set
# CONFIG_MTD_NAND_ARASAN is not set
# CONFIG_MTD_NAND_INTEL_LGM is not set

#
# Misc
#
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_RICOH is not set
# CONFIG_MTD_NAND_DISKONCHIP is not set
CONFIG_MTD_SPI_NAND=y

#
# ECC engine support
#
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
# CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC 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=y
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
# CONFIG_MTD_SPI_NOR_SWP_DISABLE is not set
CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE=y
# CONFIG_MTD_SPI_NOR_SWP_KEEP 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=y
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_DYNAMIC=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_RESERVED_MEM=y
CONFIG_OF_RESOLVE=y
CONFIG_OF_OVERLAY=y
CONFIG_OF_NUMA=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_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_HI6421V600_IRQ 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_LATTICE_ECP3_CONFIG is not set
CONFIG_SRAM=y
# CONFIG_DW_XDATA_PCIE is not set
CONFIG_PCI_ENDPOINT_TEST=y
CONFIG_XILINX_SDFEC=y
CONFIG_MISC_RTSX=y
# CONFIG_HISI_HIKEY_USB is not set
# CONFIG_OPEN_DICE is not set
# CONFIG_NTSYNC is not set
# CONFIG_VCPU_STALL_DETECTOR is not set
CONFIG_TPS6594_ESM=y
CONFIG_TPS6594_PFSM=y
# CONFIG_NSM is not set
# CONFIG_MCHP_LAN966X_PCI is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
CONFIG_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
# CONFIG_EEPROM_MAX6875 is not set
CONFIG_EEPROM_93CX6=y
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_EEPROM_IDT_89HPESX is not set
# CONFIG_EEPROM_EE1004 is not set
# CONFIG_EEPROM_M24LR 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_VMWARE_VMCI is not set
# 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=y
# CONFIG_PVPANIC is not set
# CONFIG_GP_PCI1XXXX is not set
# CONFIG_KEBA_CP500 is not set
# CONFIG_AMD_SBRMI_I2C is not set
CONFIG_MISC_RP1=y
# 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 is not set

#
# 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=y
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_HISI_SAS=y
CONFIG_SCSI_HISI_SAS_PCI=y
# CONFIG_SCSI_HISI_SAS_DEBUGFS_DEFAULT_ENABLE 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_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_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_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=y
CONFIG_AHCI_DWC=y
CONFIG_AHCI_CEVA=y
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
CONFIG_SATA_SIL24=y
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_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
# 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 is not set
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_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_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=y
# CONFIG_ARCNET is not set
CONFIG_ATM_DRIVERS=y
# CONFIG_ATM_SOLOS is not set

#
# Distributed Switch Architecture drivers
#
CONFIG_B53=y
# CONFIG_B53_SPI_DRIVER is not set
# CONFIG_B53_MDIO_DRIVER is not set
# CONFIG_B53_MMAP_DRIVER is not set
CONFIG_B53_SRAB_DRIVER=y
# CONFIG_B53_SERDES is not set
CONFIG_NET_DSA_BCM_SF2=y
# 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=y
# 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_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 is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_JME is not set
CONFIG_NET_VENDOR_ADI=y
# CONFIG_ADIN1110 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 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_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_OPEN_ALLIANCE_HELPERS=y
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_AQUANTIA_PHY=y
CONFIG_AX88796B_PHY=y
CONFIG_BROADCOM_PHY=y
CONFIG_BCM54140_PHY=y
CONFIG_BCM7XXX_PHY=y
# CONFIG_BCM84881_PHY is not set
# CONFIG_BCM87XX_PHY is not set
CONFIG_BCM_NET_PHYLIB=y
# CONFIG_CICADA_PHY is not set
# CONFIG_CORTINA_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=y
CONFIG_MARVELL_10G_PHY=y
CONFIG_MARVELL_88Q2XXX_PHY=y
# 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=y
# CONFIG_MICROCHIP_T1S_PHY is not set
CONFIG_MICROCHIP_PHY=y
# CONFIG_MICROCHIP_T1_PHY is not set
CONFIG_MICROSEMI_PHY=y
# 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_QCOM_NET_PHYLIB=y
CONFIG_AT803X_PHY=y
# CONFIG_QCA83XX_PHY is not set
CONFIG_QCA808X_PHY=y
# 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=y
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=y
CONFIG_DP83869_PHY=y
CONFIG_DP83TD510_PHY=y
CONFIG_DP83TG720_PHY=y
CONFIG_VITESSE_PHY=y
CONFIG_XILINX_GMII2RGMII=y
# 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=y
# 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_XILINXCAN=y
# 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=y
# CONFIG_CAN_M_CAN_PCI is not set
CONFIG_CAN_M_CAN_PLATFORM=y
# CONFIG_CAN_M_CAN_TCAN4X5X 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=y
# CONFIG_CAN_MCP251XFD_SANITY 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_USB is not set
# end of MCTP Device Drivers

CONFIG_FWNODE_MDIO=y
CONFIG_OF_MDIO=y
CONFIG_ACPI_MDIO=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_BCM_UNIMAC=y
CONFIG_MDIO_CAVIUM=y
CONFIG_MDIO_GPIO=y
# 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=y

#
# MDIO Multiplexers
#
CONFIG_MDIO_BUS_MUX=y
# CONFIG_MDIO_BUS_MUX_GPIO is not set
CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y
CONFIG_MDIO_BUS_MUX_MMIOREG=y

#
# PCS device drivers
#
CONFIG_PCS_XPCS=y
# 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_WLAN_VENDOR_ATH 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_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=y
# CONFIG_WWAN_HWSIM is not set
CONFIG_MHI_WWAN_CTRL=y
CONFIG_MHI_WWAN_MBIM=y
# CONFIG_RPMSG_WWAN_CTRL 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=y
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=y
# CONFIG_KEYBOARD_ADP5585 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=y
CONFIG_KEYBOARD_GPIO_POLLED=y
# 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_IMX_BBM_SCMI=y
# 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_MTK_PMIC=y
# 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_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_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=y
CONFIG_MOUSE_ELAN_I2C_I2C=y
# CONFIG_MOUSE_ELAN_I2C_SMBUS 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=y
# CONFIG_TOUCHSCREEN_ATMEL_MXT_T37 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=y
CONFIG_TOUCHSCREEN_GOODIX_BERLIN_CORE=y
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C is not set
CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI=y
# 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=y
# 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=y
# 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=y
# 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=y
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
CONFIG_INPUT_AW86927=y
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_E3X0_BUTTON is not set
# CONFIG_INPUT_MMA8450 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_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_TPS65219_PWRBUTTON=y
CONFIG_INPUT_TPS6594_PWRBUTTON=y
# CONFIG_INPUT_AXP20X_PEK 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_PWM_BEEPER=y
CONFIG_INPUT_PWM_VIBRA=y
CONFIG_INPUT_RK805_PWRKEY=y
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_INPUT_DA7280_HAPTICS is not set
CONFIG_INPUT_DA9063_ONKEY=y
# 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_CMA3000 is not set
# CONFIG_INPUT_SOC_BUTTON_ARRAY 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_SERIO_SERPORT=y
# CONFIG_SERIO_PARKBD is not set
CONFIG_SERIO_AMBAKMI=y
# 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=y
# 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_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_FSL=y
CONFIG_SERIAL_8250_DW=y
# CONFIG_SERIAL_8250_RT288X is not set
CONFIG_SERIAL_8250_PERICOM=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_8250_DWLIB=y

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_AMBA_PL010 is not set
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
# CONFIG_SERIAL_EARLYCON_SEMIHOST is not set
# 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_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=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
CONFIG_SERIAL_FSL_LPUART=y
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
CONFIG_SERIAL_FSL_LINFLEXUART=y
CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE=y
# 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_IPWIRELESS is not set
CONFIG_N_GSM=y
CONFIG_NOZOMI=y
CONFIG_NULL_TTY=y
CONFIG_HVC_DRIVER=y
# CONFIG_HVC_DCC is not set
# CONFIG_RPMSG_TTY is not set
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=y
CONFIG_IPMI_DMI_DECODE=y
CONFIG_IPMI_PLAT_DATA=y
# CONFIG_IPMI_PANIC_EVENT is not set
CONFIG_IPMI_DEVICE_INTERFACE=y
CONFIG_IPMI_SI=y
# CONFIG_IPMI_SSIF is not set
# CONFIG_IPMI_IPMB is not set
# CONFIG_IPMI_WATCHDOG is not set
# CONFIG_IPMI_POWEROFF 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_BA431 is not set
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_HW_RANDOM_HISI_TRNG is not set
CONFIG_HW_RANDOM_OPTEE=y
# CONFIG_HW_RANDOM_CCTRNG is not set
# CONFIG_HW_RANDOM_XIPHERA is not set
CONFIG_HW_RANDOM_ARM_SMCCC_TRNG=y
CONFIG_HW_RANDOM_CN10K=y
# CONFIG_DEVMEM is not set
# CONFIG_DEVPORT is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_TPM2_HMAC is not set
CONFIG_HW_RANDOM_TPM=y
CONFIG_TCG_TIS_CORE=y
CONFIG_TCG_TIS=y
CONFIG_TCG_TIS_SPI=y
CONFIG_TCG_TIS_SPI_CR50=y
# CONFIG_TCG_TIS_I2C is not set
CONFIG_TCG_TIS_I2C_CR50=y
# CONFIG_TCG_TIS_I2C_ATMEL is not set
CONFIG_TCG_TIS_I2C_INFINEON=y
# CONFIG_TCG_TIS_I2C_NUVOTON 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_FTPM_TEE is not set
# CONFIG_TCG_TIS_ST33ZP24_I2C is not set
# CONFIG_TCG_TIS_ST33ZP24_SPI 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=y
CONFIG_I2C_MUX_PINCTRL=y
CONFIG_I2C_MUX_REG=y
# CONFIG_I2C_DEMUX_PINCTRL is not set
# CONFIG_I2C_MUX_MLXCPLD is not set
# CONFIG_I2C_MUX_MULE is not set
# end of Multiplexer I2C Chip support

CONFIG_I2C_HELPER_AUTO=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 is not set
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_PIIX4 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_CADENCE=y
# CONFIG_I2C_CBUS_GPIO is not set
CONFIG_I2C_DESIGNWARE_CORE=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EMEV2 is not set
CONFIG_I2C_GPIO=y
# CONFIG_I2C_GPIO_FAULT_INJECTOR is not set
# CONFIG_I2C_HISI is not set
# CONFIG_I2C_NOMADIK is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
CONFIG_I2C_RK3X=y
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_VERSATILE is not set
# CONFIG_I2C_THUNDERX is not set
CONFIG_I2C_XILINX=y

#
# 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=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AXI_SPI_ENGINE is not set
CONFIG_SPI_BITBANG=y
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_CADENCE is not set
CONFIG_SPI_CADENCE_QUADSPI=y
# CONFIG_SPI_CADENCE_XSPI is not set
# CONFIG_SPI_CH341 is not set
CONFIG_SPI_DESIGNWARE=y
CONFIG_SPI_DW_DMA=y
# CONFIG_SPI_DW_PCI is not set
CONFIG_SPI_DW_MMIO=y
CONFIG_SPI_DLN2=y
# CONFIG_SPI_HISI_KUNPENG is not set
# CONFIG_SPI_HISI_SFC_V3XX is not set
# 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_OC_TINY is not set
# CONFIG_SPI_PCI1XXXX is not set
CONFIG_SPI_PL022=y
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_SIFIVE is not set
# CONFIG_SPI_SN_F_OSPI is not set
# CONFIG_SPI_MXIC is not set
# CONFIG_SPI_THUNDERX is not set
# CONFIG_SPI_VIRTIO is not set
# CONFIG_SPI_XCOMM is not set
CONFIG_SPI_XILINX=y
CONFIG_SPI_ZYNQMP_GQSPI=y
# CONFIG_SPI_AMD is not set

#
# SPI Multiplexer support
#
# CONFIG_SPI_MUX is not set

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=y
# 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=y
# CONFIG_SPMI_HISI3670 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_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=y
CONFIG_GENERIC_PINCTRL_GROUPS=y
CONFIG_PINMUX=y
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
CONFIG_PINCONF=y
CONFIG_GENERIC_PINCONF=y
# CONFIG_DEBUG_PINCTRL is not set
# CONFIG_PINCTRL_AMD is not set
# CONFIG_PINCTRL_AXP209 is not set
# CONFIG_PINCTRL_AW9523 is not set
# CONFIG_PINCTRL_CY8C95X0 is not set
CONFIG_PINCTRL_DA9062=y
# CONFIG_PINCTRL_GENERIC_MUX is not set
CONFIG_PINCTRL_MAX77620=y
# CONFIG_PINCTRL_MCP23S08 is not set
# CONFIG_PINCTRL_MICROCHIP_SGPIO is not set
# CONFIG_PINCTRL_OCELOT is not set
CONFIG_PINCTRL_RK805=y
# CONFIG_PINCTRL_SCMI is not set
CONFIG_PINCTRL_SINGLE=y
# CONFIG_PINCTRL_STMFX is not set
CONFIG_PINCTRL_SX150X=y
CONFIG_PINCTRL_TPS6594=y
CONFIG_PINCTRL_RP1=y

#
# Renesas pinctrl drivers
#
# end of Renesas pinctrl drivers

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=y
# CONFIG_GPIO_CDEV_V1 is not set
CONFIG_GPIO_GENERIC=y
CONFIG_GPIO_REGMAP=y

#
# Memory mapped GPIO drivers
#
# CONFIG_GPIO_74XX_MMIO is not set
CONFIG_GPIO_ALTERA=y
# CONFIG_GPIO_AMDPT is not set
# CONFIG_GPIO_BY_PINCTRL is not set
# CONFIG_GPIO_CADENCE is not set
CONFIG_GPIO_DWAPB=y
# CONFIG_GPIO_FTGPIO010 is not set
CONFIG_GPIO_GENERIC_PLATFORM=y
# CONFIG_GPIO_GRGPIO is not set
# CONFIG_GPIO_HISI is not set
# CONFIG_GPIO_HLWD is not set
# CONFIG_GPIO_LOGICVC is not set
CONFIG_GPIO_MB86S7X=y
CONFIG_GPIO_PL061=y
# CONFIG_GPIO_POLARFIRE_SOC is not set
# CONFIG_GPIO_SIFIVE is not set
CONFIG_GPIO_SYSCON=y
# CONFIG_GPIO_WAVESHARE_DSI_TOUCH is not set
CONFIG_GPIO_WCD934X=y
CONFIG_GPIO_XGENE=y
CONFIG_GPIO_XILINX=y
# CONFIG_GPIO_AMD_FCH is not set
# end of Memory mapped 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=y
# CONFIG_GPIO_MAX732X_IRQ is not set
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
# CONFIG_GPIO_PCA9570 is not set
CONFIG_GPIO_PCF857X=y
CONFIG_GPIO_TPIC2810=y
# end of I2C GPIO expanders

#
# MFD GPIO expanders
#
CONFIG_GPIO_ADP5585=y
CONFIG_GPIO_BD9571MWV=y
CONFIG_GPIO_DLN2=y
CONFIG_GPIO_LJCA=y
# CONFIG_GPIO_LP873X is not set
CONFIG_GPIO_MAX77620=y
CONFIG_GPIO_MAX77759=y
CONFIG_GPIO_TPS65219=y
# CONFIG_GPIO_TWL4030 is not set
# CONFIG_GPIO_WM8994 is not set
# end of MFD GPIO expanders

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

#
# PCI GPIO expanders
#
# CONFIG_GPIO_BT8XX 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
# 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=y
# 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=y
CONFIG_POWER_RESET_GPIO=y
CONFIG_POWER_RESET_GPIO_RESTART=y
# CONFIG_POWER_RESET_LTC2952 is not set
# CONFIG_POWER_RESET_MT6323 is not set
# CONFIG_POWER_RESET_REGULATOR is not set
# CONFIG_POWER_RESET_RESTART is not set
# CONFIG_POWER_RESET_VEXPRESS is not set
CONFIG_POWER_RESET_XGENE=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_POWER_RESET_SYSCON_POWEROFF=y
CONFIG_REBOOT_MODE=y
CONFIG_SYSCON_REBOOT_MODE=y
CONFIG_NVMEM_REBOOT_MODE=y
# CONFIG_POWER_RESET_QEMU_VIRT_CTRL is not set
CONFIG_POWER_SEQUENCING=y
CONFIG_POWER_SEQUENCING_QCOM_WCN=y
# CONFIG_POWER_SEQUENCING_PCIE_M2 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_QCOM_BATTMGR=y
# CONFIG_BATTERY_SAMSUNG_SDI is not set
# CONFIG_BATTERY_S2MU005 is not set
CONFIG_BATTERY_SBS=y
# CONFIG_CHARGER_SBS is not set
# CONFIG_MANAGER_SBS is not set
CONFIG_BATTERY_BQ27XXX=y
CONFIG_BATTERY_BQ27XXX_I2C=y
# CONFIG_BATTERY_BQ27XXX_DT_UPDATES_NVM is not set
# CONFIG_AXP20X_POWER is not set
# CONFIG_BATTERY_MAX17040 is not set
CONFIG_BATTERY_MAX17042=y
# 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_MAX77759=y
# CONFIG_CHARGER_MAX77976 is not set
# CONFIG_CHARGER_MAX8971 is not set
CONFIG_CHARGER_MT6360=y
# 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=y
CONFIG_CHARGER_BQ25980=y
# CONFIG_CHARGER_BQ256XX is not set
CONFIG_CHARGER_RK817=y
# 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_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_ARCTIC_FAN_CONTROLLER is not set
CONFIG_SENSORS_ARM_SCMI=y
CONFIG_SENSORS_ARM_SCPI=y
# 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_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_FTSTEUTATES is not set
CONFIG_SENSORS_GIGABYTE_WATERFORCE=y
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
CONFIG_SENSORS_GPIO_FAN=y
# CONFIG_SENSORS_HIH6130 is not set
# CONFIG_SENSORS_HS3001 is not set
# CONFIG_SENSORS_HTU31 is not set
# CONFIG_SENSORS_IBMAEM is not set
# CONFIG_SENSORS_IBMPEX is not set
# CONFIG_SENSORS_IIO_HWMON is not set
# CONFIG_SENSORS_ISL28022 is not set
# CONFIG_SENSORS_IT87 is not set
CONFIG_SENSORS_JC42=y
CONFIG_SENSORS_POWERZ=y
# CONFIG_SENSORS_POWR1220 is not set
# CONFIG_SENSORS_PROM21_XHCI 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=y
# 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=y
# 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_PWM_FAN=y
# CONFIG_SENSORS_SBTSI 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=y
# CONFIG_SENSORS_INA209 is not set
CONFIG_SENSORS_INA2XX=y
# CONFIG_SENSORS_INA238 is not set
CONFIG_SENSORS_INA3221=y
# CONFIG_SENSORS_SPD5118 is not set
# CONFIG_SENSORS_TC74 is not set
# CONFIG_SENSORS_THMC50 is not set
CONFIG_SENSORS_TMP102=y
# 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_VEXPRESS 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_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=y
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_DEFAULT_GOV_POWER_ALLOCATOR 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_THERMAL_GOV_POWER_ALLOCATOR=y
CONFIG_CPU_THERMAL=y
CONFIG_CPU_FREQ_THERMAL=y
CONFIG_DEVFREQ_THERMAL=y
# CONFIG_PCIE_THERMAL is not set
CONFIG_THERMAL_EMULATION=y
# CONFIG_THERMAL_MMIO is not set
# CONFIG_MAX77620_THERMAL is not set
# CONFIG_DA9062_THERMAL is not set
CONFIG_GENERIC_ADC_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
# 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
#
# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_DA9062_WATCHDOG is not set
# CONFIG_GPIO_WATCHDOG is not set
# CONFIG_WDAT_WDT is not set
CONFIG_XILINX_WATCHDOG=y
CONFIG_XILINX_WINDOW_WATCHDOG=y
# CONFIG_ZIIRAVE_WATCHDOG is not set
CONFIG_ARM_SP805_WATCHDOG=y
CONFIG_ARM_SBSA_WATCHDOG=y
# CONFIG_CADENCE_WATCHDOG is not set
CONFIG_DW_WATCHDOG=y
# CONFIG_TWL4030_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_MAX77620_WATCHDOG is not set
# CONFIG_RETU_WATCHDOG is not set
CONFIG_ARM_SMC_WATCHDOG=y
# CONFIG_ALIM7101_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_HP_WATCHDOG 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=y
# 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=y
CONFIG_MFD_AXP20X=y
CONFIG_MFD_AXP20X_I2C=y
# CONFIG_MFD_CS40L50_I2C is not set
# CONFIG_MFD_CS40L50_SPI is not set
# CONFIG_MFD_CS42L43_I2C 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=y
# 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=y
# CONFIG_MFD_HI6421_SPMI is not set
CONFIG_LPC_ICH=y
# CONFIG_LPC_SCH is not set
# 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=y
# 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=y
# 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=y
# 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=y
CONFIG_MFD_RK8XX_I2C=y
CONFIG_MFD_RK8XX_SPI=y
# CONFIG_MFD_RN5T618 is not set
CONFIG_MFD_SEC_CORE=y
CONFIG_MFD_SEC_I2C=y
# 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=y
# CONFIG_MFD_TI_LP87565 is not set
# CONFIG_MFD_TPS65218 is not set
CONFIG_MFD_TPS65219=y
# 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=y
CONFIG_MFD_TPS6594_I2C=y
# 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=y
CONFIG_MFD_ROHM_BD718XX=y
# 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_WCD934X=y
# CONFIG_MFD_ATC260X_I2C is not set
CONFIG_MFD_QCOM_PM8008=y
CONFIG_MFD_VEXPRESS_SYSREG=y
# CONFIG_RAVE_SP_CORE is not set
# CONFIG_MFD_INTEL_M10_BMC_SPI is not set
# CONFIG_MFD_LS2K_BMC_CORE 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_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_ARM_SCMI=y
# CONFIG_REGULATOR_AW37503 is not set
CONFIG_REGULATOR_AXP20X=y
CONFIG_REGULATOR_BD718XX=y
CONFIG_REGULATOR_BD9571MWV=y
# CONFIG_REGULATOR_DA9062 is not set
# CONFIG_REGULATOR_DA9121 is not set
# CONFIG_REGULATOR_DA9210 is not set
CONFIG_REGULATOR_DA9211=y
CONFIG_REGULATOR_FAN53555=y
# CONFIG_REGULATOR_FAN53880 is not set
CONFIG_REGULATOR_GPIO=y
# CONFIG_REGULATOR_HI6421 is not set
CONFIG_REGULATOR_HI6421V530=y
# 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_LP873X=y
# 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_MAX77620=y
# 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_MAX8973=y
# CONFIG_REGULATOR_MAX20086 is not set
CONFIG_REGULATOR_MAX20411=y
# 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=y
# CONFIG_REGULATOR_MP886X is not set
# CONFIG_REGULATOR_MPQ7920 is not set
# CONFIG_REGULATOR_MT6311 is not set
CONFIG_REGULATOR_MT6315=y
# CONFIG_REGULATOR_MT6316 is not set
# CONFIG_REGULATOR_MT6323 is not set
# CONFIG_REGULATOR_MT6331 is not set
# CONFIG_REGULATOR_MT6332 is not set
CONFIG_REGULATOR_MT6357=y
CONFIG_REGULATOR_MT6358=y
CONFIG_REGULATOR_MT6359=y
CONFIG_REGULATOR_MT6360=y
# CONFIG_REGULATOR_MT6363 is not set
# CONFIG_REGULATOR_MT6370 is not set
CONFIG_REGULATOR_MT6397=y
CONFIG_REGULATOR_PCA9450=y
# CONFIG_REGULATOR_PF9453 is not set
# CONFIG_REGULATOR_PF0900 is not set
# CONFIG_REGULATOR_PF530X is not set
CONFIG_REGULATOR_PF8X00=y
CONFIG_REGULATOR_PFUZE100=y
# CONFIG_REGULATOR_PV88060 is not set
# CONFIG_REGULATOR_PV88080 is not set
# CONFIG_REGULATOR_PV88090 is not set
CONFIG_REGULATOR_PWM=y
CONFIG_REGULATOR_QCOM_PM8008=y
CONFIG_REGULATOR_QCOM_SPMI=y
CONFIG_REGULATOR_QCOM_USB_VBUS=y
CONFIG_REGULATOR_RAA215300=y
# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set
# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2 is not set
CONFIG_REGULATOR_RK808=y
CONFIG_REGULATOR_ROHM=y
# 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_S2DOS05 is not set
# CONFIG_REGULATOR_S2MPA01 is not set
CONFIG_REGULATOR_S2MPS11=y
# CONFIG_REGULATOR_S5M8767 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=y
# CONFIG_REGULATOR_TPS65185 is not set
CONFIG_REGULATOR_TPS65219=y
CONFIG_REGULATOR_TPS6594=y
# CONFIG_REGULATOR_TPS6524X is not set
CONFIG_REGULATOR_TWL4030=y
CONFIG_REGULATOR_VCTRL=y
# CONFIG_REGULATOR_VEXPRESS is not set
# CONFIG_REGULATOR_WM8994 is not set
# CONFIG_REGULATOR_QCOM_LABIBB is not set
CONFIG_RC_CORE=y
# CONFIG_LIRC is not set
CONFIG_RC_MAP=y
CONFIG_RC_DECODERS=y
# CONFIG_IR_IMON_DECODER is not set
# CONFIG_IR_JVC_DECODER is not set
# CONFIG_IR_MCE_KBD_DECODER is not set
# CONFIG_IR_NEC_DECODER is not set
# CONFIG_IR_RC5_DECODER is not set
# CONFIG_IR_RC6_DECODER is not set
# CONFIG_IR_RCMM_DECODER is not set
# CONFIG_IR_SANYO_DECODER is not set
# CONFIG_IR_SHARP_DECODER is not set
# CONFIG_IR_SONY_DECODER is not set
# CONFIG_IR_XMP_DECODER is not set
CONFIG_RC_DEVICES=y
# CONFIG_IR_ENE is not set
# CONFIG_IR_FINTEK is not set
CONFIG_IR_GPIO_CIR=y
# 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_RC_ATI_REMOTE=y
# CONFIG_RC_LOOPBACK is not set
CONFIG_RC_XBOX_DVD=y
CONFIG_CEC_CORE=y
CONFIG_CEC_NOTIFIER=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=y
# CONFIG_CEC_GPIO 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
# CONFIG_V4L2_FLASH_LED_CLASS is not set
CONFIG_V4L2_FWNODE=y
CONFIG_V4L2_ASYNC=y
CONFIG_V4L2_CCI=y
CONFIG_V4L2_CCI_I2C=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=y
# 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_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

#
# Analog TV USB devices
#
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_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_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=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_SDR_PLATFORM_DRIVERS=y
# CONFIG_DVB_PLATFORM_DRIVERS is not set
CONFIG_V4L_MEM2MEM_DRIVERS=y
# CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set
# CONFIG_VIDEO_MUX is not set

#
# Allegro DVT media platform drivers
#

#
# Amlogic media platform drivers
#

#
# Amphion drivers
#

#
# ARM media platform drivers
#
# CONFIG_VIDEO_MALI_C55 is not set

#
# Aspeed media platform drivers
#

#
# Atmel media platform drivers
#

#
# Cadence media platform drivers
#
# CONFIG_VIDEO_CADENCE_CSI2RX is not set
# CONFIG_VIDEO_CADENCE_CSI2TX is not set

#
# Chips&Media media platform drivers
#

#
# Intel media platform drivers
#

#
# Marvell media platform drivers
#
# CONFIG_VIDEO_CAFE_CCIC is not set

#
# Mediatek media platform drivers
#

#
# Microchip Technology, Inc. media platform drivers
#

#
# Nuvoton media platform drivers
#

#
# NVidia media platform drivers
#

#
# NXP media platform drivers
#

#
# Qualcomm media platform drivers
#

#
# Raspberry Pi media platform drivers
#
# CONFIG_VIDEO_RP1_CFE is not set

#
# Renesas media platform drivers
#

#
# Rockchip media platform drivers
#

#
# Samsung media platform drivers
#

#
# STMicroelectronics media platform drivers
#

#
# Sunxi media platform drivers
#

#
# Texas Instruments drivers
#

#
# Verisilicon media platform drivers
#

#
# VIA media platform drivers
#

#
# Xilinx media platform drivers
#
# CONFIG_VIDEO_XILINX 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=y
CONFIG_VIDEO_CAMERA_SENSOR=y
# CONFIG_VIDEO_ALVIUM_CSI2 is not set
# CONFIG_VIDEO_AR0521 is not set
# CONFIG_VIDEO_GC0308 is not set
# CONFIG_VIDEO_GC0310 is not set
# CONFIG_VIDEO_GC05A2 is not set
# CONFIG_VIDEO_GC08A3 is not set
# CONFIG_VIDEO_GC2145 is not set
# CONFIG_VIDEO_HI556 is not set
# CONFIG_VIDEO_HI846 is not set
# CONFIG_VIDEO_HI847 is not set
# CONFIG_VIDEO_IMX111 is not set
# CONFIG_VIDEO_IMX208 is not set
# CONFIG_VIDEO_IMX214 is not set
CONFIG_VIDEO_IMX219=y
# CONFIG_VIDEO_IMX258 is not set
# CONFIG_VIDEO_IMX274 is not set
# CONFIG_VIDEO_IMX283 is not set
# CONFIG_VIDEO_IMX290 is not set
# CONFIG_VIDEO_IMX296 is not set
# CONFIG_VIDEO_IMX319 is not set
# CONFIG_VIDEO_IMX334 is not set
# CONFIG_VIDEO_IMX335 is not set
# CONFIG_VIDEO_IMX355 is not set
CONFIG_VIDEO_IMX412=y
# CONFIG_VIDEO_IMX415 is not set
# CONFIG_VIDEO_MT9M001 is not set
# CONFIG_VIDEO_MT9M111 is not set
# CONFIG_VIDEO_MT9M114 is not set
# CONFIG_VIDEO_MT9P031 is not set
# CONFIG_VIDEO_MT9T112 is not set
# CONFIG_VIDEO_MT9V011 is not set
# CONFIG_VIDEO_MT9V032 is not set
# CONFIG_VIDEO_MT9V111 is not set
# CONFIG_VIDEO_OG01A1B is not set
# CONFIG_VIDEO_OG0VE1B is not set
# CONFIG_VIDEO_OS05B10 is not set
# CONFIG_VIDEO_OV01A10 is not set
# CONFIG_VIDEO_OV02A10 is not set
# CONFIG_VIDEO_OV02E10 is not set
# CONFIG_VIDEO_OV02C10 is not set
# CONFIG_VIDEO_OV08D10 is not set
# CONFIG_VIDEO_OV08X40 is not set
# CONFIG_VIDEO_OV13858 is not set
# CONFIG_VIDEO_OV13B10 is not set
# CONFIG_VIDEO_OV2640 is not set
# CONFIG_VIDEO_OV2659 is not set
# CONFIG_VIDEO_OV2680 is not set
# CONFIG_VIDEO_OV2685 is not set
# CONFIG_VIDEO_OV2732 is not set
# CONFIG_VIDEO_OV2735 is not set
# CONFIG_VIDEO_OV2740 is not set
# CONFIG_VIDEO_OV4689 is not set
CONFIG_VIDEO_OV5640=y
CONFIG_VIDEO_OV5645=y
# CONFIG_VIDEO_OV5647 is not set
# CONFIG_VIDEO_OV5648 is not set
# CONFIG_VIDEO_OV5670 is not set
# CONFIG_VIDEO_OV5675 is not set
# CONFIG_VIDEO_OV5693 is not set
# CONFIG_VIDEO_OV5695 is not set
# CONFIG_VIDEO_OV6211 is not set
# CONFIG_VIDEO_OV64A40 is not set
# CONFIG_VIDEO_OV7251 is not set
# CONFIG_VIDEO_OV7640 is not set
# CONFIG_VIDEO_OV7670 is not set
# CONFIG_VIDEO_OV772X is not set
# CONFIG_VIDEO_OV7740 is not set
# CONFIG_VIDEO_OV8856 is not set
# CONFIG_VIDEO_OV8858 is not set
# CONFIG_VIDEO_OV8865 is not set
# CONFIG_VIDEO_OV9282 is not set
# CONFIG_VIDEO_OV9640 is not set
# CONFIG_VIDEO_OV9650 is not set
# CONFIG_VIDEO_OV9734 is not set
# CONFIG_VIDEO_RDACM20 is not set
# CONFIG_VIDEO_RDACM21 is not set
# CONFIG_VIDEO_RJ54N1 is not set
# CONFIG_VIDEO_S5C73M3 is not set
# CONFIG_VIDEO_S5K3M5 is not set
# CONFIG_VIDEO_S5K5BAF is not set
# CONFIG_VIDEO_S5K6A3 is not set
CONFIG_VIDEO_S5KJN1=y
# CONFIG_VIDEO_T4KA3 is not set
# CONFIG_VIDEO_VD55G1 is not set
# CONFIG_VIDEO_VD56G3 is not set
# CONFIG_VIDEO_VGXY61 is not set
# CONFIG_VIDEO_CCS is not set
# CONFIG_VIDEO_ET8EK8 is not set

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

CONFIG_VIDEO_CAMERA_LENS=y
# CONFIG_VIDEO_AD5820 is not set
# CONFIG_VIDEO_AK7375 is not set
# CONFIG_VIDEO_DW9714 is not set
# CONFIG_VIDEO_DW9719 is not set
# CONFIG_VIDEO_DW9768 is not set
# CONFIG_VIDEO_DW9807_VCM 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_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_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=y
CONFIG_MEDIA_TUNER_MSI001=y
# CONFIG_MEDIA_TUNER_MT2060 is not set
# CONFIG_MEDIA_TUNER_MT2063 is not set
CONFIG_MEDIA_TUNER_MT20XX=y
# 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=y
# 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=y
CONFIG_MEDIA_TUNER_TDA827X=y
CONFIG_MEDIA_TUNER_TDA8290=y
CONFIG_MEDIA_TUNER_TDA9887=y
# 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=y
CONFIG_MEDIA_TUNER_XC4000=y
CONFIG_MEDIA_TUNER_XC5000=y
# 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_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_BRIDGE_CONNECTOR=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_AUDIO_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_CEC_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_CEC_NOTIFIER_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_STATE_HELPER=y
CONFIG_DRM_TTM=y
CONFIG_DRM_VRAM_HELPER=y
CONFIG_DRM_TTM_HELPER=y
CONFIG_DRM_GEM_DMA_HELPER=y
CONFIG_DRM_GEM_SHMEM_HELPER=y
# CONFIG_DRM_AMDGPU is not set

#
# ARM devices
#
CONFIG_DRM_HDLCD=y
# CONFIG_DRM_HDLCD_SHOW_UNDERRUN is not set
CONFIG_DRM_MALI_DISPLAY=y
CONFIG_DRM_KOMEDA=y
# 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=y
CONFIG_DRM_I2C_NXP_TDA998X=y
CONFIG_DRM_ITE_IT6263=y
# CONFIG_DRM_ITE_IT6505 is not set
CONFIG_DRM_LONTIUM_LT8912B=y
# CONFIG_DRM_LONTIUM_LT9211 is not set
CONFIG_DRM_LONTIUM_LT9611=y
CONFIG_DRM_LONTIUM_LT9611UXC=y
CONFIG_DRM_LONTIUM_LT8713SX=y
CONFIG_DRM_ITE_IT66121=y
# CONFIG_DRM_LVDS_CODEC is not set
# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set
CONFIG_DRM_NWL_MIPI_DSI=y
# CONFIG_DRM_NXP_PTN3460 is not set
# CONFIG_DRM_PARADE_PS8622 is not set
CONFIG_DRM_PARADE_PS8640=y
CONFIG_DRM_SAMSUNG_DSIM=y
# CONFIG_DRM_SIL_SII8620 is not set
CONFIG_DRM_SII902X=y
# CONFIG_DRM_SII9234 is not set
CONFIG_DRM_SIMPLE_BRIDGE=y
# CONFIG_DRM_SOLOMON_SSD2825 is not set
CONFIG_DRM_THINE_THC63LVD1024=y
# CONFIG_DRM_TOSHIBA_TC358762 is not set
# CONFIG_DRM_TOSHIBA_TC358764 is not set
CONFIG_DRM_TOSHIBA_TC358767=y
CONFIG_DRM_TOSHIBA_TC358768=y
# 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=y
CONFIG_DRM_TI_SN65DSI83=y
CONFIG_DRM_TI_SN65DSI86=y
# 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=y
CONFIG_DRM_I2C_ADV7511=y
CONFIG_DRM_I2C_ADV7511_CEC=y
CONFIG_DRM_CDNS_DSI=y
CONFIG_DRM_CDNS_DSI_J721E=y
CONFIG_DRM_CDNS_MHDP8546=y
# end of Display Interface Bridges

# CONFIG_DRM_ETNAVIV is not set
CONFIG_DRM_GUD=y
CONFIG_DRM_HISI_HIBMC=y
CONFIG_DRM_HISI_KIRIN=y
# CONFIG_DRM_POWERVR is not set
# CONFIG_DRM_LIMA is not set
# 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_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=y
# CONFIG_DRM_PANEL_BOE_TV101WUM_LL2 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=y
CONFIG_DRM_PANEL_HIMAX_HX8279=y
# CONFIG_DRM_PANEL_HIMAX_HX83102 is not set
CONFIG_DRM_PANEL_HIMAX_HX83112A=y
CONFIG_DRM_PANEL_HIMAX_HX83112B=y
# 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_IL9322 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9341 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=y
# 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=y
# 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=y
# 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_NT36672A=y
CONFIG_DRM_PANEL_NOVATEK_NT36672E=y
# CONFIG_DRM_PANEL_NOVATEK_NT37700F is not set
CONFIG_DRM_PANEL_NOVATEK_NT37801=y
# 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=y
# CONFIG_DRM_PANEL_RAYDIUM_RM67200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set
CONFIG_DRM_PANEL_RAYDIUM_RM692E5=y
# CONFIG_DRM_PANEL_RAYDIUM_RM69380 is not set
# CONFIG_DRM_PANEL_RENESAS_R61307 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=y
# 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=y
# 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=y
CONFIG_DRM_PANEL_EDP=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_PANEL_SUMMIT=y
# 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=y
# 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=y
# CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set
# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set
# end of Display Panels

# CONFIG_DRM_PANFROST is not set
# CONFIG_DRM_PANTHOR is not set
CONFIG_DRM_PL111=y
# 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_EFIDRM is not set
CONFIG_DRM_SIMPLEDRM=y
# end of Drivers for system framebuffers

CONFIG_DRM_TIDSS=y
# 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_VGEM=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
CONFIG_DRM_VKMS=y
# CONFIG_DRM_VMWGFX 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_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_UVESA is not set
CONFIG_FB_EFI=y
# 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_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_DMAMEM_HELPERS=y
CONFIG_FB_DMAMEM_HELPERS_DEFERRED=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_PWM=y
# CONFIG_BACKLIGHT_MAX25014 is not set
# CONFIG_BACKLIGHT_MT6370 is not set
CONFIG_BACKLIGHT_QCOM_WLED=y
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_LM3509 is not set
# CONFIG_BACKLIGHT_LM3630A is not set
# CONFIG_BACKLIGHT_LM3639 is not set
CONFIG_BACKLIGHT_LP855X=y
# CONFIG_BACKLIGHT_MP3309C is not set
# CONFIG_BACKLIGHT_PANDORA is not set
CONFIG_BACKLIGHT_GPIO=y
# 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_VIDEOMODE_HELPERS=y
CONFIG_HDMI=y
# CONFIG_FIRMWARE_EDID is not set

#
# Console display driver support
#
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=y
CONFIG_LOGO_LINUX_CLUT224_FILE="drivers/video/logo/logo_linux_clut224.ppm"
CONFIG_TRACE_GPU_MEM=y
# end of Graphics support

# CONFIG_DRM_ACCEL is not set
# CONFIG_SOUND is not set
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_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_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_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_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=y
# CONFIG_I2C_HID_OF_GOODIX is not set
CONFIG_I2C_HID_CORE=y

#
# 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

#
# 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=y
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 is not set

#
# Gadget/Dual-role mode requires USB Gadget support to be enabled
#
# CONFIG_USB_DWC2_PERIPHERAL is not set
CONFIG_USB_DWC2_DUAL_ROLE=y
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=y
CONFIG_USB_CHIPIDEA_GENERIC=y
CONFIG_USB_CHIPIDEA_TEGRA=y
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_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=y
CONFIG_USB_ONBOARD_DEV_USB5744=y
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
CONFIG_USB_ULPI=y
CONFIG_USB_ULPI_VIEWPORT=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=y
# 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_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_UVC=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_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_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_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_UCSI=y
CONFIG_UCSI_CCG=y
CONFIG_UCSI_ACPI=y
CONFIG_UCSI_STM32G0=y
CONFIG_UCSI_PMIC_GLINK=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_IT5205=y
CONFIG_TYPEC_MUX_NB7VPQ904M=y
CONFIG_TYPEC_MUX_PS883X=y
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_MMC=y
CONFIG_PWRSEQ_EMMC=y
# CONFIG_PWRSEQ_SD8787 is not set
CONFIG_PWRSEQ_SIMPLE=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_MINORS=32
# 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_ARMMMCI=y
CONFIG_MMC_STM32_SDMMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
# CONFIG_MMC_SDHCI_PCI is not set
CONFIG_MMC_SDHCI_ACPI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_OF_ARASAN=y
# CONFIG_MMC_SDHCI_OF_AT91 is not set
CONFIG_MMC_SDHCI_OF_DWCMSHC=y
CONFIG_MMC_SDHCI_CADENCE=y
CONFIG_MMC_SDHCI_F_SDH30=y
# CONFIG_MMC_SDHCI_MILBEAUT is not set
# CONFIG_MMC_TIFM_SD is not set
CONFIG_MMC_SPI=y
# CONFIG_MMC_SDRICOH_CS is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MMC_DW=y
CONFIG_MMC_DW_PLTFM=y
# CONFIG_MMC_DW_BLUEFIELD is not set
CONFIG_MMC_DW_EXYNOS=y
CONFIG_MMC_DW_HI3798CV200=y
# CONFIG_MMC_DW_HI3798MV200 is not set
CONFIG_MMC_DW_K3=y
# CONFIG_MMC_DW_PCI 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=y
CONFIG_MMC_HSQ=y
# CONFIG_MMC_TOSHIBA_PCI is not set
CONFIG_MMC_MTK=y
CONFIG_MMC_SDHCI_XENON=y
CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFS_BSG=y
CONFIG_SCSI_UFS_CRYPTO=y
# CONFIG_SCSI_UFS_FAULT_INJECTION is not set
# CONFIG_SCSI_UFS_HWMON is not set
# CONFIG_SCSI_UFSHCD_PCI is not set
CONFIG_SCSI_UFSHCD_PLATFORM=y
CONFIG_SCSI_UFS_CDNS_PLATFORM=y
# CONFIG_SCSI_UFS_DWC_TC_PLATFORM 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=y
CONFIG_LEDS_CLASS_MULTICOLOR=y
# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set

#
# LED drivers
#
# CONFIG_LEDS_AN30259A 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_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=y
# CONFIG_LEDS_MT6323 is not set
CONFIG_LEDS_PCA9532=y
# CONFIG_LEDS_PCA9532_GPIO is not set
CONFIG_LEDS_GPIO=y
# 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_PWM=y
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2606MVV is not set
# CONFIG_LEDS_BD2802 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=y
# CONFIG_LEDS_MLXREG is not set
# CONFIG_LEDS_USER is not set
# CONFIG_LEDS_SPI_BYTE is not set
# CONFIG_LEDS_LM3697 is not set
# CONFIG_LEDS_ST1202 is not set

#
# Flash and Torch LED drivers
#
# CONFIG_LEDS_AAT1290 is not set
# CONFIG_LEDS_AS3645A is not set
# CONFIG_LEDS_KTD2692 is not set
# CONFIG_LEDS_LM3601X is not set
# CONFIG_LEDS_MT6360 is not set
# CONFIG_LEDS_MT6370_FLASH is not set
# CONFIG_LEDS_RT4505 is not set
# CONFIG_LEDS_RT8515 is not set
# CONFIG_LEDS_S2M_FLASH is not set
# CONFIG_LEDS_SGM3140 is not set
# CONFIG_LEDS_SY7802 is not set
# CONFIG_LEDS_TPS6131X is not set

#
# 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_PWM_MULTICOLOR is not set
CONFIG_LEDS_QCOM_LPG=y
# CONFIG_LEDS_S2M_RGB is not set
# CONFIG_LEDS_MT6370_RGB is not set

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

#
# 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=y
# 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 is not set
# CONFIG_INFINIBAND_MTHCA is not set
# CONFIG_INFINIBAND_OCRDMA is not set
# CONFIG_INFINIBAND_VMWARE_PVRDMA 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_SUPPORT=y
CONFIG_EDAC=y
# CONFIG_EDAC_DEBUG is not set
CONFIG_EDAC_GHES=y
# CONFIG_EDAC_SCRUB is not set
# CONFIG_EDAC_ECS is not set
# CONFIG_EDAC_MEM_REPAIR is not set
# CONFIG_EDAC_THUNDERX is not set
# CONFIG_EDAC_XGENE is not set
# CONFIG_EDAC_DMC520 is not set
# CONFIG_EDAC_CORTEX_A72 is not set
CONFIG_RTC_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=y
# CONFIG_RTC_DRV_DS1307_CENTURY is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
CONFIG_RTC_DRV_HYM8563=y
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_MAX31335 is not set
CONFIG_RTC_DRV_MAX77686=y
# CONFIG_RTC_DRV_NCT3018Y is not set
CONFIG_RTC_DRV_RK808=y
# CONFIG_RTC_DRV_RS5C372 is not set
CONFIG_RTC_DRV_ISL1208=y
# 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=y
CONFIG_RTC_DRV_PCF8563=y
# CONFIG_RTC_DRV_PCF8583 is not set
CONFIG_RTC_DRV_M41T80=y
# CONFIG_RTC_DRV_M41T80_WDT is not set
CONFIG_RTC_DRV_BQ32K=y
# CONFIG_RTC_DRV_TWL4030 is not set
CONFIG_RTC_DRV_TPS6594=y
# 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=y
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
CONFIG_RTC_DRV_RV3028=y
# CONFIG_RTC_DRV_RV3032 is not set
CONFIG_RTC_DRV_RV8803=y
CONFIG_RTC_DRV_S5M=y
# 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=y
CONFIG_RTC_DRV_DS3232_HWMON=y
CONFIG_RTC_DRV_PCF2127=y
CONFIG_RTC_DRV_PCF85063=y
# CONFIG_RTC_DRV_RV3029C2 is not set
# CONFIG_RTC_DRV_RX6110 is not set

#
# Platform RTC drivers
#
# 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_DA9063=y
CONFIG_RTC_DRV_EFI=y
# 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_OPTEE is not set
CONFIG_RTC_DRV_ZYNQMP=y

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_PL030 is not set
CONFIG_RTC_DRV_PL031=y
# CONFIG_RTC_DRV_CADENCE is not set
# CONFIG_RTC_DRV_FTRTC010 is not set
CONFIG_RTC_DRV_IMX_BBM_SCMI=y
CONFIG_RTC_DRV_MT6397=y
# 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_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
CONFIG_DMA_ENGINE=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DMA_ACPI=y
CONFIG_DMA_OF=y
# CONFIG_ALTERA_MSGDMA is not set
# CONFIG_AMBA_PL08X is not set
# CONFIG_ARM_DMA350 is not set
CONFIG_BCM_SBA_RAID=y
# CONFIG_DW_AXI_DMAC is not set
CONFIG_FSL_EDMA=y
# CONFIG_FSL_QDMA is not set
# CONFIG_INTEL_IDMA64 is not set
CONFIG_MV_XOR_V2=y
CONFIG_PL330_DMA=y
# CONFIG_PLX_DMA is not set
# CONFIG_SWITCHTEC_DMA is not set
CONFIG_XILINX_DMA=y
# CONFIG_XILINX_XDMA is not set
CONFIG_XILINX_ZYNQMP_DMA=y
CONFIG_XILINX_ZYNQMP_DPDMA=y
# CONFIG_AMD_QDMA is not set
CONFIG_QCOM_HIDMA_MGMT=y
CONFIG_QCOM_HIDMA=y
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
CONFIG_DW_EDMA=y
# CONFIG_DW_EDMA_PCIE is not set
# CONFIG_SF_PDMA 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_UIO is not set
CONFIG_VFIO=y
# CONFIG_VFIO_DEVICE_CDEV is not set
CONFIG_VFIO_GROUP=y
# CONFIG_VFIO_CONTAINER 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_HISI_ACC_VFIO_PCI is not set
# CONFIG_VIRTIO_VFIO_PCI is not set
# CONFIG_NVGRACE_GPU_VFIO_PCI is not set
# end of VFIO support for PCI devices

#
# VFIO support for platform devices
#
# CONFIG_VFIO_PLATFORM is not set
# CONFIG_VFIO_AMBA is not set
# end of VFIO support for platform 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_LEGACY=y
CONFIG_VIRTIO_VDPA=y
CONFIG_VIRTIO_BALLOON=y
# CONFIG_VIRTIO_MEM is not set
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_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=y
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_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_NI_LABPC=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=y
# CONFIG_DVB_AV7110 is not set
CONFIG_VIDEO_MAX96712=y
# CONFIG_STAGING_MEDIA_DEPRECATED is not set
# CONFIG_FB_TFT is not set
# CONFIG_MOST_COMPONENTS is not set
# CONFIG_GREYBUS_BOOTROM is not set
# CONFIG_GREYBUS_FIRMWARE is not set
CONFIG_GREYBUS_HID=y
# CONFIG_GREYBUS_LIGHT is not set
# 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_PWM 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_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_ARM64_PLATFORM_DEVICES=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y

#
# Clock driver for ARM Reference designs
#
# CONFIG_CLK_ICST is not set
# CONFIG_CLK_SP810 is not set
# CONFIG_CLK_VEXPRESS_OSC is not set
# end of Clock driver for ARM Reference designs

# CONFIG_LMK04832 is not set
# CONFIG_COMMON_CLK_MAX77686 is not set
# CONFIG_COMMON_CLK_MAX9485 is not set
# CONFIG_COMMON_CLK_RK808 is not set
# CONFIG_COMMON_CLK_RP1 is not set
CONFIG_COMMON_CLK_SCMI=y
# CONFIG_COMMON_CLK_SCPI 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_COMMON_CLK_S2MPS11 is not set
# CONFIG_CLK_TWL is not set
# CONFIG_COMMON_CLK_AXI_CLKGEN is not set
# CONFIG_COMMON_CLK_XGENE is not set
# CONFIG_COMMON_CLK_PWM 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_BD718XX is not set
# CONFIG_COMMON_CLK_FIXED_MMIO is not set
CONFIG_XILINX_VCU=y
CONFIG_COMMON_CLK_XLNX_CLKWZRD=y
CONFIG_HWSPINLOCK=y

#
# Clock Source drivers
#
CONFIG_TIMER_OF=y
CONFIG_TIMER_ACPI=y
CONFIG_TIMER_PROBE=y
CONFIG_CLKSRC_MMIO=y
CONFIG_ARM_ARCH_TIMER=y
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y
CONFIG_FSL_ERRATUM_A008585=y
CONFIG_HISILICON_ERRATUM_161010101=y
CONFIG_ARM64_ERRATUM_858921=y
CONFIG_ARM_TIMER_SP804=y
# end of Clock Source drivers

CONFIG_MAILBOX=y
CONFIG_ARM_MHU=y
# CONFIG_ARM_MHU_V2 is not set
# CONFIG_ARM_MHU_V3 is not set
CONFIG_PLATFORM_MHU=y
# CONFIG_PL320_MBOX 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
#
CONFIG_IOMMU_IO_PGTABLE=y
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y
# CONFIG_IOMMU_IO_PGTABLE_ARMV7S_SELFTEST is not set
CONFIG_IOMMU_IO_PGTABLE_DART=y
# end of Generic IOMMU Pagetable Support

# CONFIG_IOMMU_DEBUGFS is not set
CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
# CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_OF_IOMMU=y
CONFIG_IOMMU_DMA=y
CONFIG_ARM_SMMU=y
# CONFIG_ARM_SMMU_LEGACY_DT_BINDINGS is not set
CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT=y
CONFIG_ARM_SMMU_MMU_500_CPRE_ERRATA=y
CONFIG_ARM_SMMU_V3=y
# CONFIG_ARM_SMMU_V3_SVA is not set
# CONFIG_ARM_SMMU_V3_IOMMUFD is not set
# CONFIG_TEGRA241_CMDQV is not set
CONFIG_IOMMUFD_DRIVER_CORE=y
CONFIG_IOMMUFD=y
# CONFIG_IOMMUFD_VFIO_CONTAINER is not set
# CONFIG_VIRTIO_IOMMU is not set

#
# Remoteproc drivers
#
CONFIG_REMOTEPROC=y
# CONFIG_REMOTEPROC_CDEV is not set
# end of Remoteproc drivers

#
# Rpmsg drivers
#
CONFIG_RPMSG=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_CTRL=y
CONFIG_RPMSG_NS=y
CONFIG_RPMSG_QCOM_GLINK=y
CONFIG_RPMSG_QCOM_GLINK_RPM=y
CONFIG_RPMSG_VIRTIO=y
# end of Rpmsg drivers

#
# 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
#
# CONFIG_QUICC_ENGINE is not set
CONFIG_FSL_RCPM=y
# end of NXP/Freescale QorIQ SoC drivers

#
# fujitsu SoC drivers
#
# CONFIG_A64FX_DIAG is not set
# 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

#
# Qualcomm SoC drivers
#
CONFIG_QCOM_PDR_HELPERS=y
CONFIG_QCOM_PDR_MSG=y
# CONFIG_QCOM_PMIC_PDCHARGER_ULOG is not set
CONFIG_QCOM_PMIC_GLINK=y
CONFIG_QCOM_QMI_HELPERS=y
CONFIG_QCOM_PBS=y
# end of Qualcomm SoC drivers

CONFIG_SOC_TI=y

#
# 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

CONFIG_ARM_SCMI_PERF_DOMAIN=y
CONFIG_ARM_SCMI_POWER_DOMAIN=y
CONFIG_ARM_SCPI_POWER_DOMAIN=y

#
# 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=y

#
# DEVFREQ Governors
#
CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
# CONFIG_DEVFREQ_GOV_POWERSAVE is not set
CONFIG_DEVFREQ_GOV_USERSPACE=y
CONFIG_DEVFREQ_GOV_PASSIVE=y

#
# DEVFREQ Drivers
#
# CONFIG_ARM_HISI_UNCORE_DEVFREQ is not set
CONFIG_PM_DEVFREQ_EVENT=y
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_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=y
CONFIG_EXTCON_USBC_TUSB320=y
CONFIG_MEMORY=y
# CONFIG_ARM_PL172_MPMC 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_AD4030 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_AD4851 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_AD7625 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_AXP20X_ADC is not set
# CONFIG_AXP288_ADC 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_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=y
# CONFIG_MCP320X is not set
# CONFIG_MCP3422 is not set
# CONFIG_MCP3564 is not set
# CONFIG_MCP3911 is not set
CONFIG_MEDIATEK_MT6359_AUXADC=y
# 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_QCOM_VADC_COMMON=y
# CONFIG_QCOM_SPMI_IADC is not set
CONFIG_QCOM_SPMI_VADC=y
CONFIG_QCOM_SPMI_ADC5=y
# CONFIG_QCOM_SPMI_ADC5_GEN3 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=y
# CONFIG_TI_ADS1018 is not set
# CONFIG_TI_ADS1100 is not set
# CONFIG_TI_ADS1119 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_VF610_ADC is not set
CONFIG_VIPERBOARD_ADC=y
CONFIG_XILINX_XADC=y
# 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
#
# CONFIG_IIO_SCMI is not set
# end of IIO SCMI Sensors

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

CONFIG_IIO_ST_SENSORS_I2C=y
CONFIG_IIO_ST_SENSORS_SPI=y
CONFIG_IIO_ST_SENSORS_CORE=y

#
# 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_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_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

#
# Frequency Synthesizers DDS/PLL
#

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

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# 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_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=y
CONFIG_IIO_ST_LSM6DSX_I2C=y
CONFIG_IIO_ST_LSM6DSX_SPI=y
# 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=y
# 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=y
# 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=y
CONFIG_IIO_ST_MAGN_I2C_3AXIS=y
CONFIG_IIO_ST_MAGN_SPI_3AXIS=y
# CONFIG_INFINEON_TLV493D 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=y
# 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=y
# CONFIG_PWM_DEBUG is not set
# CONFIG_PWM_PROVIDE_GPIO is not set
CONFIG_PWM_ADP5585=y
# CONFIG_PWM_ARGON_FAN_HAT is not set
# CONFIG_PWM_ATMEL_TCB is not set
# CONFIG_PWM_CLK is not set
# CONFIG_PWM_DWC is not set
# CONFIG_PWM_FSL_FTM is not set
# CONFIG_PWM_GPIO is not set
# CONFIG_PWM_MC33XS2410 is not set
# CONFIG_PWM_PCA9685 is not set
# CONFIG_PWM_TWL is not set
# CONFIG_PWM_TWL_LED is not set
CONFIG_PWM_XILINX=y

#
# IRQ chip support
#
CONFIG_IRQCHIP=y
CONFIG_ARM_GIC=y
CONFIG_ARM_GIC_MAX_NR=1
CONFIG_ARM_GIC_V2M=y
CONFIG_ARM_GIC_V3=y
CONFIG_ARM_GIC_ITS_PARENT=y
CONFIG_ARM_GIC_V3_ITS=y
CONFIG_ARM_GIC_V5=y
CONFIG_IRQ_MSI_LIB=y
# CONFIG_AL_FIC is not set
CONFIG_XILINX_INTC=y
# end of IRQ chip support

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

#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
CONFIG_GENERIC_PHY_MIPI_DPHY=y
CONFIG_PHY_CAN_TRANSCEIVER=y
CONFIG_PHY_GOOGLE_USB=y
CONFIG_PHY_NXP_PTN3222=y
# 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=y
CONFIG_PHY_CADENCE_DPHY=y
CONFIG_PHY_CADENCE_DPHY_RX=y
CONFIG_PHY_CADENCE_SIERRA=y
CONFIG_PHY_CADENCE_SALVO=y
# 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_ARM_CCI_PMU=y
CONFIG_ARM_CCI400_PMU=y
CONFIG_ARM_CCI5xx_PMU=y
CONFIG_ARM_CCN=y
CONFIG_ARM_CMN=y
# CONFIG_ARM_NI is not set
CONFIG_ARM_PMU=y
CONFIG_ARM_PMU_ACPI=y
CONFIG_ARM_SMMU_V3_PMU=y
CONFIG_ARM_PMUV3=y
CONFIG_ARM_DSU_PMU=y
# CONFIG_FUJITSU_UNCORE_PMU is not set
CONFIG_ARM_SPE_PMU=y
CONFIG_ARM64_BRBE=y
CONFIG_ARM_DMC620_PMU=y
# CONFIG_ALIBABA_UNCORE_DRW_PMU is not set
CONFIG_HISI_PMU=y
# CONFIG_HISI_PCIE_PMU is not set
# CONFIG_HNS3_PMU is not set
# CONFIG_DWC_PCIE_PMU is not set
CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU=y
CONFIG_NVIDIA_CORESIGHT_PMU_ARCH_SYSTEM_PMU=y
# CONFIG_AMPERE_CORESIGHT_PMU_ARCH_SYSTEM_PMU is not set
# CONFIG_NVIDIA_TEGRA410_CMEM_LATENCY_PMU is not set
# CONFIG_NVIDIA_TEGRA410_C2C_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 is not set
CONFIG_DAX=y
# CONFIG_DEV_DAX is not set
# CONFIG_DEV_DAX_HMEM is not set
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y
CONFIG_NVMEM_LAYOUTS=y

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

CONFIG_NVMEM_MAX77759=y
CONFIG_NVMEM_RMEM=y
CONFIG_NVMEM_SPMI_SDAM=y
# CONFIG_NVMEM_U_BOOT_ENV is not set

#
# HW tracing support
#
CONFIG_STM=y
CONFIG_STM_PROTO_BASIC=y
CONFIG_STM_PROTO_SYS_T=y
# CONFIG_STM_DUMMY is not set
# CONFIG_STM_SOURCE_CONSOLE is not set
# CONFIG_STM_SOURCE_HEARTBEAT is not set
# CONFIG_STM_SOURCE_FTRACE is not set
# CONFIG_INTEL_TH is not set
# CONFIG_HISI_PTT is not set
# end of HW tracing support

CONFIG_FPGA=y
# CONFIG_ALTERA_PR_IP_CORE is not set
# CONFIG_FPGA_MGR_ALTERA_PS_SPI is not set
CONFIG_FPGA_MGR_ALTERA_CVP=y
# CONFIG_FPGA_MGR_XILINX_SELECTMAP is not set
# CONFIG_FPGA_MGR_XILINX_SPI is not set
# CONFIG_FPGA_MGR_ICE40_SPI is not set
# CONFIG_FPGA_MGR_MACHXO2_SPI is not set
CONFIG_FPGA_BRIDGE=y
CONFIG_ALTERA_FREEZE_BRIDGE=y
CONFIG_XILINX_PR_DECOUPLER=y
CONFIG_FPGA_REGION=y
CONFIG_OF_FPGA_REGION=y
# CONFIG_FPGA_DFL is not set
# CONFIG_FPGA_MGR_MICROCHIP_SPI is not set
# CONFIG_FPGA_MGR_LATTICE_SYSCONFIG_SPI is not set
# CONFIG_FPGA_MGR_EFINIX_SPI is not set
# CONFIG_FSI is not set
CONFIG_TEE=y
CONFIG_TEE_DMABUF_HEAPS=y
CONFIG_OPTEE=y
# CONFIG_OPTEE_INSECURE_LOAD_IMAGE is not set
CONFIG_OPTEE_STATIC_PROTMEM_POOL=y
CONFIG_MULTIPLEXER=y
# CONFIG_MUX_CORE is not set

#
# Multiplexer drivers
#
# CONFIG_MUX_ADG792A is not set
# CONFIG_MUX_ADGS1408 is not set
CONFIG_MUX_GPIO=y
CONFIG_MUX_MMIO=y
# end of Multiplexer drivers

CONFIG_PM_OPP=y
# CONFIG_SIOX is not set
CONFIG_SLIMBUS=y
CONFIG_INTERCONNECT=y
CONFIG_COUNTER=y
# CONFIG_INTERRUPT_CNT is not set
CONFIG_MOST=y
CONFIG_MOST_USB_HDM=y
# CONFIG_MOST_CDEV is not set
# CONFIG_PECI is not set
CONFIG_HTE=y
# CONFIG_CDX_BUS 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 is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
# CONFIG_F2FS_FS is not set
# CONFIG_ZONEFS_FS is not set
CONFIG_FS_DAX=y
CONFIG_FS_DAX_PMD=y
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
# CONFIG_EXPORTFS_BLOCK_OPS is not set
CONFIG_FILE_LOCKING=y
CONFIG_FS_ENCRYPTION=y
CONFIG_FS_ENCRYPTION_ALGS=y
# CONFIG_FS_ENCRYPTION_INLINE_CRYPT is not set
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 is not set
CONFIG_FUSE_PASSTHROUGH=y
CONFIG_FUSE_IO_URING=y
CONFIG_OVERLAY_FS=y
# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set
CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y
# CONFIG_OVERLAY_FS_INDEX is not set
# CONFIG_OVERLAY_FS_XINO_AUTO is not set
# CONFIG_OVERLAY_FS_METACOPY is not set
# CONFIG_OVERLAY_FS_DEBUG is not set

#
# Caches
#
CONFIG_NETFS_SUPPORT=y
# CONFIG_NETFS_STATS is not set
# CONFIG_NETFS_DEBUG is not set
# CONFIG_FSCACHE is not set
# end of Caches

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set
# end of CD-ROM/DVD Filesystems

#
# DOS/FAT/EXFAT/NT Filesystems
#
CONFIG_FAT_FS=y
# CONFIG_MSDOS_FS is not set
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 is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS3_FS is not set
# 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_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_PROC_CHILDREN=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=y
CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
CONFIG_CONFIGFS_FS=y
CONFIG_EFIVAR_FS=y
# end of Pseudo filesystems

CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ORANGEFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_ECRYPT_FS=y
CONFIG_ECRYPT_FS_MESSAGING=y
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS2_FS is not set
CONFIG_UBIFS_FS=y
# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
# CONFIG_UBIFS_ATIME_SUPPORT is not set
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
# CONFIG_UBIFS_FS_AUTHENTICATION is not set
# CONFIG_CRAMFS is not set
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_FILE_CACHE=y
# CONFIG_SQUASHFS_FILE_DIRECT is not set
CONFIG_SQUASHFS_DECOMP_SINGLE=y
# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set
CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y
# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set
# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set
# CONFIG_SQUASHFS_XATTR is not set
# CONFIG_SQUASHFS_COMP_CACHE_FULL is not set
CONFIG_SQUASHFS_ZLIB=y
# CONFIG_SQUASHFS_LZ4 is not set
# CONFIG_SQUASHFS_LZO is not set
# CONFIG_SQUASHFS_XZ is not set
# CONFIG_SQUASHFS_ZSTD is not set
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_OMFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX6FS_FS is not set
# CONFIG_ROMFS_FS is not set
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=y
# CONFIG_PSTORE_BLK is not set
# CONFIG_UFS_FS is not set
# CONFIG_EROFS_FS 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 is not set
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 is not set
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
CONFIG_NFS_DISABLE_UDP_SUPPORT=y
CONFIG_NFS_V4_2_READ_PLUS=y
# CONFIG_NFSD is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
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 is not set
# CONFIG_CIFS is not set
# CONFIG_SMB_SERVER is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_9P_FS=y
# CONFIG_9P_FS_POSIX_ACL is not set
# CONFIG_9P_FS_SECURITY is not set
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_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_STATIC_USERMODEHELPER is not set
# CONFIG_SECURITY_SELINUX is not set
CONFIG_SECURITY_SMACK=y
# CONFIG_SECURITY_SMACK_BRINGUP is not set
CONFIG_SECURITY_SMACK_NETFILTER=y
# CONFIG_SECURITY_SMACK_APPEND_SIGNALS 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_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_KEXEC is not set
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_SM3 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_SECURE_AND_OR_TRUSTED_BOOT is not set
# CONFIG_IMA_DISABLE_HTABLE is not set
# CONFIG_IMA_STAGING is not set
CONFIG_EVM=y
CONFIG_EVM_ATTR_FSUUID=y
CONFIG_EVM_EXTRA_SMACK_XATTRS=y
CONFIG_EVM_ADD_XATTRS=y
# CONFIG_EVM_LOAD_X509 is not set
CONFIG_DEFAULT_SECURITY_SMACK=y
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_LSM="landlock,lockdown,yama,safesetid,integrity,tomoyo,smack,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_CC_HAS_SANCOV_STACK_DEPTH_CALLBACK=y
# CONFIG_KSTACK_ERASE is not set
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_CC_HAS_RANDSTRUCT=y
CONFIG_RANDSTRUCT_NONE=y
# CONFIG_RANDSTRUCT_FULL is not set
# 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_ASYNC_TX_DISABLE_PQ_VAL_DMA=y
CONFIG_ASYNC_TX_DISABLE_XOR_VAL_DMA=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_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=y
# CONFIG_CRYPTO_SELFTESTS is not set
# CONFIG_CRYPTO_NULL is not set
CONFIG_CRYPTO_PCRYPT=y
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_AUTHENC=y
CONFIG_CRYPTO_KRB5ENC=y
CONFIG_CRYPTO_BENCHMARK=y
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_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SEED=y
# CONFIG_CRYPTO_SERPENT is not set
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_AEGIS128_SIMD is not set
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=y
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_SHA3=y
CONFIG_CRYPTO_SM3=y
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 (arm64)
#
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
CONFIG_CRYPTO_AES_ARM64_BS=y
CONFIG_CRYPTO_SM4_ARM64_CE=y
CONFIG_CRYPTO_SM4_ARM64_CE_BLK=y
CONFIG_CRYPTO_SM4_ARM64_NEON_BLK=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
# CONFIG_CRYPTO_SM4_ARM64_CE_CCM is not set
# CONFIG_CRYPTO_SM4_ARM64_CE_GCM is not set
# end of Accelerated Cryptographic Algorithms for CPU (arm64)

CONFIG_CRYPTO_HW=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_NITROX_CNN55XX is not set
# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set
# CONFIG_CRYPTO_DEV_QAT_C3XXX is not set
# CONFIG_CRYPTO_DEV_QAT_C62X is not set
# CONFIG_CRYPTO_DEV_QAT_4XXX is not set
# CONFIG_CRYPTO_DEV_QAT_420XX is not set
# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set
# CONFIG_CRYPTO_DEV_QAT_C3XXXVF is not set
# CONFIG_CRYPTO_DEV_QAT_C62XVF is not set
CONFIG_CRYPTO_DEV_VIRTIO=y
# CONFIG_CRYPTO_DEV_SAFEXCEL is not set
CONFIG_CRYPTO_DEV_CCREE=y
# CONFIG_CRYPTO_DEV_HISI_SEC is not set
CONFIG_CRYPTO_DEV_HISI_SEC2=y
CONFIG_CRYPTO_DEV_HISI_QM=y
CONFIG_CRYPTO_DEV_HISI_ZIP=y
CONFIG_CRYPTO_DEV_HISI_HPRE=y
CONFIG_CRYPTO_DEV_AMLOGIC_GXL=y
# CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG 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=y
CONFIG_BITREVERSE=y
CONFIG_HAVE_ARCH_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_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
CONFIG_ARCH_USE_SYM_ANNOTATIONS=y
CONFIG_INDIRECT_PIO=y
# CONFIG_TRACE_MMIO_ACCESS is not set
CONFIG_CRC7=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_MACS=y
CONFIG_CRYPTO_LIB_ARC4=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CHACHA_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519=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=9
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_CRYPTO_LIB_SHA3_ARCH=y
CONFIG_CRYPTO_LIB_SM3=y
CONFIG_CRYPTO_LIB_SM3_ARCH=y
CONFIG_XOR_BLOCKS=y
CONFIG_XOR_BLOCKS_ARCH=y
CONFIG_RAID6_PQ=y
CONFIG_RAID6_PQ_ARCH=y
CONFIG_RAID6_PQ_BENCHMARK=y
CONFIG_XXHASH=y
CONFIG_AUDIT_GENERIC=y
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
CONFIG_AUDIT_COMPAT_GENERIC=y
# CONFIG_RANDOM32_SELFTEST is not set
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_ENC8=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_ARCH_HAS_SETUP_DMA_OPS=y
CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y
CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y
CONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED=y
CONFIG_ARCH_HAS_BATCHED_DMA_SYNC=y
CONFIG_SWIOTLB=y
# CONFIG_SWIOTLB_DYNAMIC is not set
CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y
CONFIG_DMA_NEED_SYNC=y
CONFIG_DMA_RESTRICTED_POOL=y
CONFIG_DMA_NONCOHERENT_MMAP=y
CONFIG_DMA_COHERENT_POOL=y
CONFIG_DMA_DIRECT_REMAP=y
CONFIG_DMA_CMA=y
# CONFIG_DMA_NUMA_CMA is not set

#
# Default contiguous memory area size:
#
CONFIG_CMA_SIZE_MBYTES=32
CONFIG_CMA_SIZE_SEL_MBYTES=y
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
# CONFIG_CMA_SIZE_SEL_MIN is not set
# CONFIG_CMA_SIZE_SEL_MAX is not set
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=y
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_UCS2_STRING=y
CONFIG_HAVE_GENERIC_VDSO=y
CONFIG_GENERIC_GETTIMEOFDAY=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_GENERIC_CPU_CACHE_MAINTENANCE=y
CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=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_GENERIC_IOREMAP=y
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
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_BTF_TAG=y
CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_HEADERS_INSTALL is not set
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_VMLINUX_MAP is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU 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_ARRAY_BOUNDS=y
CONFIG_UBSAN_BOUNDS=y
CONFIG_UBSAN_ARRAY_BOUNDS=y
CONFIG_UBSAN_SHIFT=y
# CONFIG_UBSAN_UNREACHABLE 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_UBSAN_KVM_EL2 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 is not set
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_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 is not set
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_MEM_ALLOC_PROFILING is not set
CONFIG_HAVE_ARCH_KASAN=y
CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y
CONFIG_HAVE_ARCH_KASAN_HW_TAGS=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_SW_TAGS is not set
# CONFIG_KASAN_HW_TAGS is not set
# 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
# 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=0
CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y
# CONFIG_HARDLOCKUP_DETECTOR is not set
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=16
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_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_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y
CONFIG_HAVE_FTRACE_GRAPH_FUNC=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=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_TRACING_SUPPORT=y
CONFIG_FTRACE=y
# CONFIG_TRACEFS_AUTOMOUNT_DEPRECATED is not set
# 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_ENABLE_DEFAULT_TRACERS 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 is not set
# CONFIG_UPROBE_EVENTS is not set
# CONFIG_EPROBE_EVENTS is not set
# CONFIG_SYNTH_EVENTS is not set
# CONFIG_USER_EVENTS is not set
# CONFIG_HIST_TRIGGERS is not set
# CONFIG_TRACE_EVENT_INJECT is not set
# CONFIG_TRACEPOINT_BENCHMARK is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_TRACE_EVAL_MAP_FILE is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set
# 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_SAMPLES is not set
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
# CONFIG_STRICT_DEVMEM is not set

#
# arm64 Debugging
#
# CONFIG_PID_IN_CONTEXTIDR is not set
# CONFIG_DEBUG_EFI is not set
# CONFIG_ARM64_RELOC_TEST is not set
CONFIG_CORESIGHT=y
CONFIG_CORESIGHT_LINKS_AND_SINKS=y
CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
CONFIG_CORESIGHT_CATU=y
CONFIG_CORESIGHT_SINK_TPIU=y
CONFIG_CORESIGHT_SINK_ETBV10=y
# CONFIG_CORESIGHT_SOURCE_ETM4X is not set
CONFIG_CORESIGHT_STM=y
# CONFIG_CORESIGHT_CTCU is not set
CONFIG_CORESIGHT_CPU_DEBUG=y
# CONFIG_CORESIGHT_CPU_DEBUG_DEFAULT_ON is not set
CONFIG_CORESIGHT_CTI=y
# CONFIG_CORESIGHT_CTI_INTEGRATION_REGS is not set
# CONFIG_ULTRASOC_SMB is not set
# CONFIG_CORESIGHT_TPDM is not set
# CONFIG_CORESIGHT_TPDA is not set
# CONFIG_CORESIGHT_DUMMY is not set
# CONFIG_CORESIGHT_TNOC is not set
# end of arm64 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_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_OBJPOOL is not set
CONFIG_ARCH_USE_MEMTEST=y
CONFIG_MEMTEST=y
# 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
KernelRepo git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
ReproCID 6127995758051328
ReproOpts {"procs":1,"slowdown":1,"sandbox":"","sandbox_arg":0,"close_fds":false,"callcomments":true}
ReproSyzID 5540918943285248
SyzkallerCommit 5d63f80b763910b40ae04a96c13dc75d621bea67
TargetArch arm64
TargetOS linux

Current Stage: moderation
Next Stage: upstream

Reporting Stages and Comments:
Stage Source Reported At Ext ID Comments
moderation lore 2026/08/17 22:11 <e78cd021-f23c-4737-b60c-a57001be13c9@mail.kernel.org>
1 Comments
  • syzbot@kernel.org (2026/08/17 22:14):
    The ttusb_dec_send_command() function allocates a 64-byte buffer
    (COMMAND_PACKET_SIZE + 4) for USB communication. After receiving a
    response, it reads the payload length from b[3] (which is fully controlled
    by the USB device) and copies the payload into the caller-provided
    cmd_result buffer. There are two missing bounds checks. First, b[3] can be
    up to 255, exceeding the 60-byte payload capacity of the allocated buffer,
    leading to an out-of-bounds read. Second, the size of cmd_result is not
    passed to the function, so a large b[3] can cause a buffer overflow in the
    destination buffer (e.g., a 4-byte buffer in
    ttusbdecfe_dvbt_read_status()).
    
    This can result in a fortify panic:
    
    memcpy: detected buffer overflow: 75 byte read of buffer size 60
    WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8
    lib/string_helpers.c:1036
    ...
    Call trace:
     __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
     __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
     fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
     ttusb_dec_start_feed+0x0/0x10ac
     drivers/media/usb/ttusb-dec/ttusb_dec.c:372
     ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392
     [inline]
     ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
     ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
    
    Fix this by adding a cmd_result_len parameter to ttusb_dec_send_command()
    and the send_command callback in ttusbdecfe_config. Update all callers to
    pass the correct buffer size. Inside ttusb_dec_send_command(), validate
    param_length, ensure actual_len is at least 4 bytes, and check that b[3]
    does not exceed COMMAND_PACKET_SIZE, actual_len - 4, or cmd_result_len.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Assisted-by: Gemini:gemini-3.6-flash Gemini:gemini-3.1-pro-preview syzbot
    Reported-by: syzbot+e1dbaae5eefaa2dfbc35@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=e1dbaae5eefaa2dfbc35
    Link: https://syzkaller.appspot.com/ai_job?id=372cefef-e134-4934-87ec-0fbe6dfbc958
    To: <linux-media@vger.kernel.org>
    To: "Mauro Carvalho Chehab" <mchehab@kernel.org>
    To: "Linus Torvalds" <torvalds@ppc970.osdl.org>
    Cc: "Kees Cook" <kees@kernel.org>
    Cc: <linux-kernel@vger.kernel.org>
    
    ---
    diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
    index 825a38759..b54b7b4bb 100644
    --- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
    +++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
    @@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
     
     static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
     				  int param_length, const u8 params[],
    -				  int *result_length, u8 cmd_result[])
    +				  int *result_length, u8 cmd_result[],
    +				  int cmd_result_len)
     {
     	int result, actual_len;
     	u8 *b;
     
     	dprintk("%s\n", __func__);
     
    +	if (param_length > COMMAND_PACKET_SIZE)
    +		return -EINVAL;
    +
     	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
     	if (!b)
     		return -ENOMEM;
    @@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
     			       __func__, actual_len, b);
     		}
     
    +		if (actual_len < 4) {
    +			result = -EIO;
    +			goto err_mutex_unlock;
    +		}
    +
    +		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
    +			result = -EIO;
    +			goto err_mutex_unlock;
    +		}
    +
     		if (result_length)
     			*result_length = b[3];
    -		if (cmd_result && b[3] > 0)
    +		if (cmd_result && b[3] > 0) {
    +			if (b[3] > cmd_result_len) {
    +				result = -EIO;
    +				goto err_mutex_unlock;
    +			}
     			memcpy(cmd_result, &b[4], b[3]);
    +		}
     	}
     
     err_mutex_unlock:
    @@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
     
     	dprintk("%s\n", __func__);
     
    -	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
    +	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
    +					sizeof(c));
     	if (result)
     		return result;
     
    @@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
     	memcpy(&b[2], &audio, 2);
     	memcpy(&b[4], &video, 2);
     
    -	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
    +	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
     
     	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
     			       ttusb_dec_audio_pes2ts_cb, dec);
    @@ -902,7 +922,7 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
     			break;
     		case TTUSB_DEC_INTERFACE_IN:
     			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
    -							b, NULL, NULL);
    +							b, NULL, NULL, 0);
     			if (result)
     				return result;
     			result = usb_set_interface(dec->udev, 0, 8);
    @@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
     
     	}
     
    -	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
    +	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
     	if (result)
     		return result;
     
    @@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
     	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
     
     	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
    -					&c_length, c);
    +					&c_length, c, sizeof(c));
     
     	if (!result) {
     		if (c_length == 2) {
    @@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
     	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
     	u8 b0[] = { 0x00 };
     
    -	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
    +	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
     
     	dec->pva_stream_count--;
     
    @@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
     	list_del(&finfo->filter_info_list);
     	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
     	kfree(finfo);
    -	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
    +	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
     
     	dec->filter_stream_count--;
     
    @@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
     	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
     		printk("%s: usb_submit_urb failed\n",__func__);
     	/* enable irq pipe */
    -	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
    +	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);
     
     	return 0;
     }
    @@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
     	firmware_csum_ns = htons(firmware_csum);
     	memcpy(&b0[6], &firmware_csum_ns, 2);
     
    -	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
    +	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
     
     	if (result) {
     		release_firmware(fw_entry);
    @@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
     		}
     	}
     
    -	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
    +	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
     
     	release_firmware(fw_entry);
     	kfree(b);
    @@ -1621,10 +1641,13 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
     
     static int fe_send_command(struct dvb_frontend* fe, const u8 command,
     			   int param_length, const u8 params[],
    -			   int *result_length, u8 cmd_result[])
    +			   int *result_length, u8 cmd_result[],
    +			   int cmd_result_len)
     {
     	struct ttusb_dec* dec = fe->dvb->priv;
    -	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
    +	return ttusb_dec_send_command(dec, command, param_length, params,
    +				      result_length, cmd_result,
    +				      cmd_result_len);
     }
     
     static const struct ttusbdecfe_config fe_config = {
    diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
    index 215221370..b013d6dfc 100644
    --- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
    +++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
    @@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
     
     	*status=0;
     
    -	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
    +	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
    +					  sizeof(result));
     	if(ret)
     		return ret;
     
    @@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
     
     	__be32 freq = htonl(p->frequency / 1000);
     	memcpy(&b[4], &freq, sizeof (u32));
    -	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
    +	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
     
     	return 0;
     }
    @@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
     	lnb_voltage = htonl(state->voltage);
     	memcpy(&b[28], &lnb_voltage, sizeof(u32));
     
    -	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
    +	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
     
     	return 0;
     }
    @@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
     
     	state->config->send_command(fe, 0x72,
     				    sizeof(b) - (6 - cmd->msg_len), b,
    -				    NULL, NULL);
    +				    NULL, NULL, 0);
     
     	return 0;
     }
    diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
    index 73828bb22..96600ad4c 100644
    --- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
    +++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
    @@ -14,7 +14,8 @@ struct ttusbdecfe_config
     {
     	int (*send_command)(struct dvb_frontend* fe, const u8 command,
     			    int param_length, const u8 params[],
    -			    int *result_length, u8 cmd_result[]);
    +			    int *result_length, u8 cmd_result[],
    +			    int cmd_result_len);
     };
     
     extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
    
    
    base-commit: 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
    -- 
    This is an AI-generated patch subject to moderation.
    Reply with '#syz upstream' to Sign-off the patch as a human author
    and send it to the upstream kernel mailing lists.
    Reply with '#syz reject' to reject it ('#syz unreject' to undo).
    
    See https://goo.gle/syzbot-ai-patches for information about AI-generated patches.
    You can comment on the patch as usual, syzbot will try to address
    the comments and send a new version of the patch if necessary.
    syzbot engineers can be reached at syzkaller@googlegroups.com.
    

Outputs:
AckedBy
[]
Fixes
map[AuthorEmail:torvalds@ppc970.osdl.org AuthorName:Linus Torvalds Hash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Title:Linux-2.6.12-rc2]
KernelBranch
master
KernelCommit
8d3ae59288f1e7d58d76558a6ee96d533bc5019f
KernelRepo
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
PatchDescription
media: ttusb-dec: fix buffer overflow in ttusb_dec_send_command()

The ttusb_dec_send_command() function allocates a 64-byte buffer
(COMMAND_PACKET_SIZE + 4) for USB communication. After receiving a
response, it reads the payload length from b[3] (which is fully controlled
by the USB device) and copies the payload into the caller-provided
cmd_result buffer. There are two missing bounds checks. First, b[3] can be
up to 255, exceeding the 60-byte payload capacity of the allocated buffer,
leading to an out-of-bounds read. Second, the size of cmd_result is not
passed to the function, so a large b[3] can cause a buffer overflow in the
destination buffer (e.g., a 4-byte buffer in
ttusbdecfe_dvbt_read_status()).

This can result in a fortify panic:

memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8
lib/string_helpers.c:1036
...
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac
 drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392
 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671

Fix this by adding a cmd_result_len parameter to ttusb_dec_send_command()
and the send_command callback in ttusbdecfe_config. Update all callers to
pass the correct buffer size. Inside ttusb_dec_send_command(), validate
param_length, ensure actual_len is at least 4 bytes, and check that b[3]
does not exceed COMMAND_PACKET_SIZE, actual_len - 4, or cmd_result_len.
PatchDiff
diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..b54b7b4bb 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
@@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
@@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
@@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
@@ -902,7 +922,7 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 			break;
 		case TTUSB_DEC_INTERFACE_IN:
 			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+							b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
@@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
@@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
@@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
@@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
@@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
@@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
@@ -1621,10 +1641,13 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params,
+				      result_length, cmd_result,
+				      cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..b013d6dfc 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					  sizeof(result));
 	if(ret)
 		return ret;
 
@@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -14,7 +14,8 @@ struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
Recipients
[map[Email:kees@kernel.org Name:Kees Cook To:false] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:linux-media@vger.kernel.org Name: To:true] map[Email:mchehab@kernel.org Name:Mauro Carvalho Chehab To:true] map[Email:torvalds@ppc970.osdl.org Name:Linus Torvalds To:true]]
ReportedBy
[]
ReviewedBy
[]
SuggestedBy
[]
TestedBy
[]

Crash report:
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036, CPU#1: kworker/1:3/4388
Modules linked in:
CPU: 1 UID: 0 PID: 4388 Comm: kworker/1:3 Not tainted syzkaller #0 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
lr : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
sp : ffff800094c46d20
x29: ffff800094c46d20 x28: dfff800000000000 x27: ffff700012988db0
x26: 0000000000000000 x25: ffff0000d18d4983 x24: ffff800094c46ea0
x23: 000000000000004b x22: ffff800086cec898 x21: 0000000000000000
x20: 000000000000004b x19: 000000000000003c x18: 1fffe00034bbbe28
x17: 0000000000000003 x16: ffff800088b27000 x15: ffff8000824ebed4
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 96b32e65f1701e00
x8 : 96b32e65f1701e00 x7 : ffff80008048e8f8 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8870
x2 : 0000000100000000 x1 : ffff0000c70e1d40 x0 : 0000000000000000
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9bc/0x11f0 drivers/usb/core/hub.c:2695
 hub_port_connect drivers/usb/core/hub.c:5567 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5707 [inline]
 port_event drivers/usb/core/hub.c:5871 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5953
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:838
irq event stamp: 7958
hardirqs last  enabled at (7957): [<ffff8000868f4e64>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (7957): [<ffff8000868f4e64>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62
hardirqs last disabled at (7958): [<ffff8000868f0d88>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425
softirqs last  enabled at (7892): [<ffff800080310744>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (7892): [<ffff800080310744>] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650
softirqs last disabled at (7883): [<ffff8000800204c0>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kernel BUG at lib/string_helpers.c:1044!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 1 UID: 0 PID: 4388 Comm: kworker/1:3 Tainted: G        W           syzkaller #0 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
lr : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
sp : ffff800094c46d50
x29: ffff800094c46d50 x28: dfff800000000000 x27: ffff700012988db0
x26: 0000000000000000 x25: ffff0000d18d4983 x24: ffff800094c46ea0
x23: 000000000000004b x22: 000000000000004b x21: ffff0000d18d4980
x20: 1fffe0001a31a930 x19: ffff0000dd4bc000 x18: 1fffe00034bbbe28
x17: 0000000000000003 x16: ffff800088b27000 x15: ffff8000824ebed4
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 96b32e65f1701e00
x8 : 96b32e65f1701e00 x7 : ffff80008048e8f8 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8870
x2 : 0000000100000000 x1 : ffff0000c70e1d40 x0 : 0000000000000000
Call trace:
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043 (P)
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9bc/0x11f0 drivers/usb/core/hub.c:2695
 hub_port_connect drivers/usb/core/hub.c:5567 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5707 [inline]
 port_event drivers/usb/core/hub.c:5871 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5953
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:838
Code: d503233f a9bf7bfd 910003fd 94619c95 (d4210000) 
---[ end trace 0000000000000000 ]---

Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/17 20:34 flow patching
1h36m Results:
map[AckedBy:[] Fixes:map[AuthorEmail:torvalds@ppc970.osdl.org AuthorName:Linus Torvalds Hash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Title:Linux-2.6.12-rc2] KernelBranch:master KernelCommit:8d3ae59288f1e7d58d76558a6ee96d533bc5019f KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git PatchDescription:media: ttusb-dec: fix buffer overflow in ttusb_dec_send_command()

The ttusb_dec_send_command() function allocates a 64-byte buffer
(COMMAND_PACKET_SIZE + 4) for USB communication. After receiving a
response, it reads the payload length from b[3] (which is fully controlled
by the USB device) and copies the payload into the caller-provided
cmd_result buffer. There are two missing bounds checks. First, b[3] can be
up to 255, exceeding the 60-byte payload capacity of the allocated buffer,
leading to an out-of-bounds read. Second, the size of cmd_result is not
passed to the function, so a large b[3] can cause a buffer overflow in the
destination buffer (e.g., a 4-byte buffer in
ttusbdecfe_dvbt_read_status()).

This can result in a fortify panic:

memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8
lib/string_helpers.c:1036
...
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac
 drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392
 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671

Fix this by adding a cmd_result_len parameter to ttusb_dec_send_command()
and the send_command callback in ttusbdecfe_config. Update all callers to
pass the correct buffer size. Inside ttusb_dec_send_command(), validate
param_length, ensure actual_len is at least 4 bytes, and check that b[3]
does not exceed COMMAND_PACKET_SIZE, actual_len - 4, or cmd_result_len. PatchDiff:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..b54b7b4bb 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
@@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
@@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
@@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
@@ -902,7 +922,7 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 			break;
 		case TTUSB_DEC_INTERFACE_IN:
 			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+							b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
@@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
@@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
@@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
@@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
@@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
@@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
@@ -1621,10 +1641,13 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params,
+				      result_length, cmd_result,
+				      cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..b013d6dfc 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					  sizeof(result));
 	if(ret)
 		return ret;
 
@@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -14,7 +14,8 @@ struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 Recipients:[map[Email:kees@kernel.org Name:Kees Cook To:false] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:linux-media@vger.kernel.org Name: To:true] map[Email:mchehab@kernel.org Name:Mauro Carvalho Chehab To:true] map[Email:torvalds@ppc970.osdl.org Name:Linus Torvalds To:true]] ReportedBy:[] ReviewedBy:[] SuggestedBy:[] TestedBy:[]]

1/1 2026/08/17 20:34 action base-commit-picker
0m Results:
map[KernelBranch:master KernelCommit:8d3ae59288f1e7d58d76558a6ee96d533bc5019f KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git]

2/1 2026/08/17 20:34 action syz-repro-to-c-repro
0m Results:
map[SimplifiedCRepro:// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE 

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

#include <linux/usb/ch9.h>

#ifndef __NR_mmap
#define __NR_mmap 222
#endif

static unsigned long long procid;

static void sleep_ms(uint64_t ms)
{
	usleep(ms * 1000);
}

#define MAX_FDS 30

#define USB_MAX_IFACE_NUM 4
#define USB_MAX_EP_NUM 32
#define USB_MAX_FDS 6

struct usb_endpoint_index {
	struct usb_endpoint_descriptor desc;
	int handle;
};

struct usb_iface_index {
	struct usb_interface_descriptor* iface;
	uint8_t bInterfaceNumber;
	uint8_t bAlternateSetting;
	uint8_t bInterfaceClass;
	struct usb_endpoint_index eps[USB_MAX_EP_NUM];
	int eps_num;
};

struct usb_device_index {
	struct usb_device_descriptor* dev;
	struct usb_config_descriptor* config;
	uint8_t bDeviceClass;
	uint8_t bMaxPower;
	int config_length;
	struct usb_iface_index ifaces[USB_MAX_IFACE_NUM];
	int ifaces_num;
	int iface_cur;
};

struct usb_info {
	int fd;
	struct usb_device_index index;
};

static struct usb_info usb_devices[USB_MAX_FDS];

static struct usb_device_index* lookup_usb_index(int fd)
{
	for (int i = 0; i < USB_MAX_FDS; i++) {
		if (__atomic_load_n(&usb_devices[i].fd, __ATOMIC_ACQUIRE) == fd)
			return &usb_devices[i].index;
	}
	return NULL;
}

static int usb_devices_num;

static bool parse_usb_descriptor(const char* buffer, size_t length, struct usb_device_index* index)
{
	if (length < sizeof(*index->dev) + sizeof(*index->config))
		return false;
	memset(index, 0, sizeof(*index));
	index->dev = (struct usb_device_descriptor*)buffer;
	index->config = (struct usb_config_descriptor*)(buffer + sizeof(*index->dev));
	index->bDeviceClass = index->dev->bDeviceClass;
	index->bMaxPower = index->config->bMaxPower;
	index->config_length = length - sizeof(*index->dev);
	index->iface_cur = -1;
	size_t offset = 0;
	while (true) {
		if (offset + 1 >= length)
			break;
		uint8_t desc_length = buffer[offset];
		uint8_t desc_type = buffer[offset + 1];
		if (desc_length <= 2)
			break;
		if (offset + desc_length > length)
			break;
		if (desc_type == USB_DT_INTERFACE && index->ifaces_num < USB_MAX_IFACE_NUM) {
			struct usb_interface_descriptor* iface = (struct usb_interface_descriptor*)(buffer + offset);
			index->ifaces[index->ifaces_num].iface = iface;
			index->ifaces[index->ifaces_num].bInterfaceNumber = iface->bInterfaceNumber;
			index->ifaces[index->ifaces_num].bAlternateSetting = iface->bAlternateSetting;
			index->ifaces[index->ifaces_num].bInterfaceClass = iface->bInterfaceClass;
			index->ifaces_num++;
		}
		if (desc_type == USB_DT_ENDPOINT && index->ifaces_num > 0) {
			struct usb_iface_index* iface = &index->ifaces[index->ifaces_num - 1];
			if (iface->eps_num < USB_MAX_EP_NUM) {
				memcpy(&iface->eps[iface->eps_num].desc, buffer + offset, sizeof(iface->eps[iface->eps_num].desc));
				iface->eps_num++;
			}
		}
		offset += desc_length;
	}
	return true;
}

static struct usb_device_index* add_usb_index(int fd, const char* dev, size_t dev_len)
{
	int i = __atomic_fetch_add(&usb_devices_num, 1, __ATOMIC_RELAXED);
	if (i >= USB_MAX_FDS)
		return NULL;
	if (!parse_usb_descriptor(dev, dev_len, &usb_devices[i].index))
		return NULL;
	__atomic_store_n(&usb_devices[i].fd, fd, __ATOMIC_RELEASE);
	return &usb_devices[i].index;
}

struct vusb_connect_string_descriptor {
	uint32_t len;
	char* str;
} __attribute__((packed));

struct vusb_connect_descriptors {
	uint32_t qual_len;
	char* qual;
	uint32_t bos_len;
	char* bos;
	uint32_t strs_len;
	struct vusb_connect_string_descriptor strs[0];
} __attribute__((packed));

static const char default_string[] = {
    8, USB_DT_STRING,
    's', 0, 'y', 0, 'z', 0
};

static const char default_lang_id[] = {
    4, USB_DT_STRING,
    0x09, 0x04
};

static bool lookup_connect_response_in(int fd, const struct vusb_connect_descriptors* descs,
				       const struct usb_ctrlrequest* ctrl,
				       struct usb_qualifier_descriptor* qual,
				       char** response_data, uint32_t* response_length)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	uint8_t str_idx;
	if (!index)
		return false;
	switch (ctrl->bRequestType & USB_TYPE_MASK) {
	case USB_TYPE_STANDARD:
		switch (ctrl->bRequest) {
		case USB_REQ_GET_DESCRIPTOR:
			switch (ctrl->wValue >> 8) {
			case USB_DT_DEVICE:
				*response_data = (char*)index->dev;
				*response_length = sizeof(*index->dev);
				return true;
			case USB_DT_CONFIG:
				*response_data = (char*)index->config;
				*response_length = index->config_length;
				return true;
			case USB_DT_STRING:
				str_idx = (uint8_t)ctrl->wValue;
				if (descs && str_idx < descs->strs_len) {
					*response_data = descs->strs[str_idx].str;
					*response_length = descs->strs[str_idx].len;
					return true;
				}
				if (str_idx == 0) {
					*response_data = (char*)&default_lang_id[0];
					*response_length = default_lang_id[0];
					return true;
				}
				*response_data = (char*)&default_string[0];
				*response_length = default_string[0];
				return true;
			case USB_DT_BOS:
				*response_data = descs->bos;
				*response_length = descs->bos_len;
				return true;
			case USB_DT_DEVICE_QUALIFIER:
				if (!descs->qual) {
					qual->bLength = sizeof(*qual);
					qual->bDescriptorType = USB_DT_DEVICE_QUALIFIER;
					qual->bcdUSB = index->dev->bcdUSB;
					qual->bDeviceClass = index->dev->bDeviceClass;
					qual->bDeviceSubClass = index->dev->bDeviceSubClass;
					qual->bDeviceProtocol = index->dev->bDeviceProtocol;
					qual->bMaxPacketSize0 = index->dev->bMaxPacketSize0;
					qual->bNumConfigurations = index->dev->bNumConfigurations;
					qual->bRESERVED = 0;
					*response_data = (char*)qual;
					*response_length = sizeof(*qual);
					return true;
				}
				*response_data = descs->qual;
				*response_length = descs->qual_len;
				return true;
			default:
				break;
			}
			break;
		default:
			break;
		}
		break;
	default:
		break;
	}
	return false;
}

typedef bool (*lookup_connect_out_response_t)(int fd, const struct vusb_connect_descriptors* descs,
					      const struct usb_ctrlrequest* ctrl, bool* done);

static bool lookup_connect_response_out_generic(int fd, const struct vusb_connect_descriptors* descs,
						const struct usb_ctrlrequest* ctrl, bool* done)
{
	switch (ctrl->bRequestType & USB_TYPE_MASK) {
	case USB_TYPE_STANDARD:
		switch (ctrl->bRequest) {
		case USB_REQ_SET_CONFIGURATION:
			*done = true;
			return true;
		default:
			break;
		}
		break;
	}
	return false;
}

#define UDC_NAME_LENGTH_MAX 128

struct usb_raw_init {
	__u8 driver_name[UDC_NAME_LENGTH_MAX];
	__u8 device_name[UDC_NAME_LENGTH_MAX];
	__u8 speed;
};

enum usb_raw_event_type {
	USB_RAW_EVENT_INVALID = 0,
	USB_RAW_EVENT_CONNECT = 1,
	USB_RAW_EVENT_CONTROL = 2,
};

struct usb_raw_event {
	__u32 type;
	__u32 length;
	__u8 data[0];
};

struct usb_raw_ep_io {
	__u16 ep;
	__u16 flags;
	__u32 length;
	__u8 data[0];
};

#define USB_RAW_EPS_NUM_MAX 30
#define USB_RAW_EP_NAME_MAX 16
#define USB_RAW_EP_ADDR_ANY 0xff

struct usb_raw_ep_caps {
	__u32 type_control : 1;
	__u32 type_iso : 1;
	__u32 type_bulk : 1;
	__u32 type_int : 1;
	__u32 dir_in : 1;
	__u32 dir_out : 1;
};

struct usb_raw_ep_limits {
	__u16 maxpacket_limit;
	__u16 max_streams;
	__u32 reserved;
};

struct usb_raw_ep_info {
	__u8 name[USB_RAW_EP_NAME_MAX];
	__u32 addr;
	struct usb_raw_ep_caps caps;
	struct usb_raw_ep_limits limits;
};

struct usb_raw_eps_info {
	struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX];
};

#define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init)
#define USB_RAW_IOCTL_RUN _IO('U', 1)
#define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
#define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32)
#define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
#define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32)

static int usb_raw_open()
{
	return open("/dev/raw-gadget", O_RDWR);
}

static int usb_raw_init(int fd, uint32_t speed, const char* driver, const char* device)
{
	struct usb_raw_init arg;
	strncpy((char*)&arg.driver_name[0], driver, sizeof(arg.driver_name));
	strncpy((char*)&arg.device_name[0], device, sizeof(arg.device_name));
	arg.speed = speed;
	return ioctl(fd, USB_RAW_IOCTL_INIT, &arg);
}

static int usb_raw_run(int fd)
{
	return ioctl(fd, USB_RAW_IOCTL_RUN, 0);
}

static int usb_raw_ep_write(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_WRITE, io);
}

static int usb_raw_ep_read(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_READ, io);
}

static int usb_raw_configure(int fd)
{
	return ioctl(fd, USB_RAW_IOCTL_CONFIGURE, 0);
}

static int usb_raw_vbus_draw(int fd, uint32_t power)
{
	return ioctl(fd, USB_RAW_IOCTL_VBUS_DRAW, power);
}

static int usb_raw_ep0_write(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP0_WRITE, io);
}

static int usb_raw_ep0_read(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP0_READ, io);
}

static int usb_raw_event_fetch(int fd, struct usb_raw_event* event)
{
	return ioctl(fd, USB_RAW_IOCTL_EVENT_FETCH, event);
}

static int usb_raw_ep_enable(int fd, struct usb_endpoint_descriptor* desc)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_ENABLE, desc);
}

static int usb_raw_ep_disable(int fd, int ep)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_DISABLE, ep);
}

static int usb_raw_ep0_stall(int fd)
{
	return ioctl(fd, USB_RAW_IOCTL_EP0_STALL, 0);
}

static int lookup_endpoint(int fd, uint8_t bEndpointAddress)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	if (!index)
		return -1;
	if (index->iface_cur < 0)
		return -1;
	for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++)
		if (index->ifaces[index->iface_cur].eps[ep].desc.bEndpointAddress == bEndpointAddress)
			return index->ifaces[index->iface_cur].eps[ep].handle;
	return -1;
}

#define USB_MAX_PACKET_SIZE 4096

struct usb_raw_control_event {
	struct usb_raw_event inner;
	struct usb_ctrlrequest ctrl;
	char data[USB_MAX_PACKET_SIZE];
};

struct usb_raw_ep_io_data {
	struct usb_raw_ep_io inner;
	char data[USB_MAX_PACKET_SIZE];
};

static void set_interface(int fd, int n)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	if (!index)
		return;
	if (index->iface_cur >= 0 && index->iface_cur < index->ifaces_num) {
		for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++) {
			int rv = usb_raw_ep_disable(fd, index->ifaces[index->iface_cur].eps[ep].handle);
			if (rv < 0) {
			} else {
			}
		}
	}
	if (n >= 0 && n < index->ifaces_num) {
		for (int ep = 0; ep < index->ifaces[n].eps_num; ep++) {
			int rv = usb_raw_ep_enable(fd, &index->ifaces[n].eps[ep].desc);
			if (rv < 0) {
			} else {
				index->ifaces[n].eps[ep].handle = rv;
			}
		}
		index->iface_cur = n;
	}
}

static int configure_device(int fd)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	if (!index)
		return -1;
	int rv = usb_raw_vbus_draw(fd, index->bMaxPower);
	if (rv < 0) {
		return rv;
	}
	rv = usb_raw_configure(fd);
	if (rv < 0) {
		return rv;
	}
	set_interface(fd, 0);
	return 0;
}

static volatile long syz_usb_connect_impl(uint64_t speed, uint64_t dev_len, const char* dev,
					  const struct vusb_connect_descriptors* descs,
					  lookup_connect_out_response_t lookup_connect_response_out)
{
	if (!dev) {
		return -1;
	}
	int fd = usb_raw_open();
	if (fd < 0) {
		return fd;
	}
	if (fd >= MAX_FDS) {
		close(fd);
		return -1;
	}
	struct usb_device_index* index = add_usb_index(fd, dev, dev_len);
	if (!index) {
		return -1;
	}
	char device[32];
	sprintf(&device[0], "dummy_udc.%llu", procid);
	int rv = usb_raw_init(fd, speed, "dummy_udc", &device[0]);
	if (rv < 0) {
		return rv;
	}
	rv = usb_raw_run(fd);
	if (rv < 0) {
		return rv;
	}
	bool done = false;
	while (!done) {
		struct usb_raw_control_event event;
		event.inner.type = 0;
		event.inner.length = sizeof(event.ctrl);
		rv = usb_raw_event_fetch(fd, (struct usb_raw_event*)&event);
		if (rv < 0) {
			return rv;
		}
		if (event.inner.type != USB_RAW_EVENT_CONTROL)
			continue;
		char* response_data = NULL;
		uint32_t response_length = 0;
		struct usb_qualifier_descriptor qual;
		if (event.ctrl.bRequestType & USB_DIR_IN) {
			if (!lookup_connect_response_in(fd, descs, &event.ctrl, &qual, &response_data, &response_length)) {
				usb_raw_ep0_stall(fd);
				continue;
			}
		} else {
			if (!lookup_connect_response_out(fd, descs, &event.ctrl, &done)) {
				usb_raw_ep0_stall(fd);
				continue;
			}
			response_data = NULL;
			response_length = event.ctrl.wLength;
		}
		if ((event.ctrl.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD &&
		    event.ctrl.bRequest == USB_REQ_SET_CONFIGURATION) {
			rv = configure_device(fd);
			if (rv < 0) {
				return rv;
			}
		}
		struct usb_raw_ep_io_data response;
		response.inner.ep = 0;
		response.inner.flags = 0;
		if (response_length > sizeof(response.data))
			response_length = 0;
		if (event.ctrl.wLength < response_length)
			response_length = event.ctrl.wLength;
		response.inner.length = response_length;
		if (response_data)
			memcpy(&response.data[0], response_data, response_length);
		else
			memset(&response.data[0], 0, response_length);
		if (event.ctrl.bRequestType & USB_DIR_IN) {
			rv = usb_raw_ep0_write(fd, (struct usb_raw_ep_io*)&response);
		} else {
			rv = usb_raw_ep0_read(fd, (struct usb_raw_ep_io*)&response);
		}
		if (rv < 0) {
			return rv;
		}
	}
	sleep_ms(200);
	return fd;
}

static volatile long syz_usb_connect(volatile long a0, volatile long a1, volatile long a2, volatile long a3)
{
	uint64_t speed = a0;
	uint64_t dev_len = a1;
	const char* dev = (const char*)a2;
	const struct vusb_connect_descriptors* descs = (const struct vusb_connect_descriptors*)a3;
	return syz_usb_connect_impl(speed, dev_len, dev, descs, &lookup_connect_response_out_generic);
}

static volatile long syz_usb_ep_write(volatile long a0, volatile long a1, volatile long a2, volatile long a3)
{
	int fd = a0;
	uint8_t ep = a1;
	uint32_t len = a2;
	char* data = (char*)a3;
	int ep_handle = lookup_endpoint(fd, ep);
	if (ep_handle < 0) {
		return -1;
	}
	struct usb_raw_ep_io_data io_data;
	io_data.inner.ep = ep_handle;
	io_data.inner.flags = 0;
	if (len > sizeof(io_data.data))
		len = sizeof(io_data.data);
	io_data.inner.length = len;
	memcpy(&io_data.data[0], data, len);
	int rv = usb_raw_ep_write(fd, (struct usb_raw_ep_io*)&io_data);
	if (rv < 0) {
		return rv;
	}
	sleep_ms(200);
	return 0;
}

static volatile long syz_usb_ep_read(volatile long a0, volatile long a1, volatile long a2, volatile long a3)
{
	int fd = a0;
	uint8_t ep = a1;
	uint32_t len = a2;
	char* data = (char*)a3;
	int ep_handle = lookup_endpoint(fd, ep);
	if (ep_handle < 0) {
		return -1;
	}
	struct usb_raw_ep_io_data io_data;
	io_data.inner.ep = ep_handle;
	io_data.inner.flags = 0;
	if (len > sizeof(io_data.data))
		len = sizeof(io_data.data);
	io_data.inner.length = len;
	int rv = usb_raw_ep_read(fd, (struct usb_raw_ep_io*)&io_data);
	if (rv < 0) {
		return rv;
	}
	memcpy(&data[0], &io_data.data[0], io_data.inner.length);
	sleep_ms(200);
	return 0;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
		syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	const char* reason;
	(void)reason;
				intptr_t res = 0;
	if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
//  syz_usb_connect arguments: [
//    speed: usb_device_speed = 0x3 (8 bytes)
//    dev_len: len = 0x9f (8 bytes)
//    dev: ptr[inout, array[ANYUNION]] {
//      array[ANYUNION] {
//        union ANYUNION {
//          ANYBLOB: buffer: {12 01 00 02 00 00 00 40 48 0b 08 10 00 01 00 00 00 01 09 02 8d 00 01 01 00 80 fa 09 04 00 00 05 ff ff ff 00 07 05 03 02 00 02 00 07 05 84 02 00 02} (length 0x31)
//        }
//      }
//    }
//    conn_descs: nil
//  ]
//  returns fd_usb
memcpy((void*)0x20000000, "... [truncated large byte array] ...", 49);
	res = -1;
res = syz_usb_connect(/*speed=USB_SPEED_HIGH*/3, /*dev_len=*/0x9f, /*dev=*/0x20000000, /*conn_descs=*/0);
	if (res != -1)
		r[0] = res;
//  syz_usb_ep_read arguments: [
//    fd: fd_usb (resource)
//    ep: int8 = 0x3 (1 bytes)
//    len: len = 0x0 (8 bytes)
//    data: nil
//  ]
syz_usb_ep_read(/*fd=*/r[0], /*ep=*/3, /*len=*/0, /*data=*/0);
//  syz_usb_ep_write arguments: [
//    fd: fd_usb (resource)
//    ep: int8 = 0x84 (1 bytes)
//    len: len = 0xc (8 bytes)
//    data: ptr[in, buffer] {
//      buffer: {aa 00 9e 4b 65 1d 00 c4 45 ed b0 6d} (length 0xc)
//    }
//  ]
memcpy((void*)0x20000700, "\xaa\x00\x9e\x4b\x65\x1d\x00\xc4\x45\xed\xb0\x6d", 12);
syz_usb_ep_write(/*fd=*/r[0], /*ep=*/0x84, /*len=*/0xc, /*data=*/0x20000700);
	return 0;
}
]

3/1 2026/08/17 20:34 action kernel-checkouter
0m Results:
map[KernelSrc:/app/workdir/cache/src/b5692495be56e63dd0879dd861d23f69899ae44d]

4/1 2026/08/17 20:34 action kernel-builder
15m Results:
map[KernelObj:/app/workdir/cache/build/cdafb00a1dfb92e70c80cffdb37b69e6b1b280c8]

5/1 2026/08/17 20:49 action crash-reproducer
5m Results:
map[OtherCrashReports:<nil> ReproducedBugTitle:WARNING in ttusb_dec_start_feed ReproducedCrashReport:usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036, CPU#0: kworker/0:4/4798
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
lr : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
sp : ffff800098516d20
x29: ffff800098516d20 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: ffff800086d0a338 x21: 0000000000000000
x20: 000000000000004b x19: 000000000000003c x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
irq event stamp: 16196
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62
hardirqs last disabled at (16196): [<ffff8000868f86e0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425
softirqs last  enabled at (16128): [<ffff80008030ff18>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (16128): [<ffff80008030ff18>] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650
softirqs last disabled at (16119): [<ffff8000800204b0>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kernel BUG at lib/string_helpers.c:1044!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Tainted: G        W           syzkaller #1 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
lr : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
sp : ffff800098516d50
x29: ffff800098516d50 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: 000000000000004b x21: ffff0000d1862680
x20: 1fffe0001a30c4d0 x19: ffff0000c3014000 x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043 (P)
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
Code: d503233f a9bf7bfd 910003fd 94619ee8 (d4210000) 
---[ end trace 0000000000000000 ]---
 ReproducedFaultInjection:]

6/1 2026/08/17 20:55 action codesearch-prepare
11m Results:
map[Index:codesearch-index]

7/1 2026/08/17 21:06 agent debugger
4m Model:
best-expensive

Instruction:
You are an experienced Linux kernel developer tasked with debugging a kernel crash root cause.
You need to provide a detailed explanation of the root cause for another developer to be
able to write a fix for the bug based on your explanation. Include all relevant details
into the response: function/struct/field/etc names, code snippets, line numbers,
macro/enum values, etc.



Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.

Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash is:

usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036, CPU#0: kworker/0:4/4798
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
lr : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
sp : ffff800098516d20
x29: ffff800098516d20 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: ffff800086d0a338 x21: 0000000000000000
x20: 000000000000004b x19: 000000000000003c x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
irq event stamp: 16196
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62
hardirqs last disabled at (16196): [<ffff8000868f86e0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425
softirqs last  enabled at (16128): [<ffff80008030ff18>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (16128): [<ffff80008030ff18>] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650
softirqs last disabled at (16119): [<ffff8000800204b0>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kernel BUG at lib/string_helpers.c:1044!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Tainted: G        W           syzkaller #1 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
lr : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
sp : ffff800098516d50
x29: ffff800098516d50 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: 000000000000004b x21: ffff0000d1862680
x20: 1fffe0001a30c4d0 x19: ffff0000c3014000 x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043 (P)
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
Code: d503233f a9bf7bfd 910003fd 94619ee8 (d4210000) 
---[ end trace 0000000000000000 ]---


The following C code is a draft of the vulnerable syscall sequence. Keep in mind that
it may lack the precise threading, sandboxing, and some arguments of a working reproducer:

// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE 

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

#include <linux/usb/ch9.h>

#ifndef __NR_mmap
#define __NR_mmap 222
#endif

static unsigned long long procid;

static void sleep_ms(uint64_t ms)
{
	usleep(ms * 1000);
}

#define MAX_FDS 30

#define USB_MAX_IFACE_NUM 4
#define USB_MAX_EP_NUM 32
#define USB_MAX_FDS 6

struct usb_endpoint_index {
	struct usb_endpoint_descriptor desc;
	int handle;
};

struct usb_iface_index {
	struct usb_interface_descriptor* iface;
	uint8_t bInterfaceNumber;
	uint8_t bAlternateSetting;
	uint8_t bInterfaceClass;
	struct usb_endpoint_index eps[USB_MAX_EP_NUM];
	int eps_num;
};

struct usb_device_index {
	struct usb_device_descriptor* dev;
	struct usb_config_descriptor* config;
	uint8_t bDeviceClass;
	uint8_t bMaxPower;
	int config_length;
	struct usb_iface_index ifaces[USB_MAX_IFACE_NUM];
	int ifaces_num;
	int iface_cur;
};

struct usb_info {
	int fd;
	struct usb_device_index index;
};

static struct usb_info usb_devices[USB_MAX_FDS];

static struct usb_device_index* lookup_usb_index(int fd)
{
	for (int i = 0; i < USB_MAX_FDS; i++) {
		if (__atomic_load_n(&usb_devices[i].fd, __ATOMIC_ACQUIRE) == fd)
			return &usb_devices[i].index;
	}
	return NULL;
}

static int usb_devices_num;

static bool parse_usb_descriptor(const char* buffer, size_t length, struct usb_device_index* index)
{
	if (length < sizeof(*index->dev) + sizeof(*index->config))
		return false;
	memset(index, 0, sizeof(*index));
	index->dev = (struct usb_device_descriptor*)buffer;
	index->config = (struct usb_config_descriptor*)(buffer + sizeof(*index->dev));
	index->bDeviceClass = index->dev->bDeviceClass;
	index->bMaxPower = index->config->bMaxPower;
	index->config_length = length - sizeof(*index->dev);
	index->iface_cur = -1;
	size_t offset = 0;
	while (true) {
		if (offset + 1 >= length)
			break;
		uint8_t desc_length = buffer[offset];
		uint8_t desc_type = buffer[offset + 1];
		if (desc_length <= 2)
			break;
		if (offset + desc_length > length)
			break;
		if (desc_type == USB_DT_INTERFACE && index->ifaces_num < USB_MAX_IFACE_NUM) {
			struct usb_interface_descriptor* iface = (struct usb_interface_descriptor*)(buffer + offset);
			index->ifaces[index->ifaces_num].iface = iface;
			index->ifaces[index->ifaces_num].bInterfaceNumber = iface->bInterfaceNumber;
			index->ifaces[index->ifaces_num].bAlternateSetting = iface->bAlternateSetting;
			index->ifaces[index->ifaces_num].bInterfaceClass = iface->bInterfaceClass;
			index->ifaces_num++;
		}
		if (desc_type == USB_DT_ENDPOINT && index->ifaces_num > 0) {
			struct usb_iface_index* iface = &index->ifaces[index->ifaces_num - 1];
			if (iface->eps_num < USB_MAX_EP_NUM) {
				memcpy(&iface->eps[iface->eps_num].desc, buffer + offset, sizeof(iface->eps[iface->eps_num].desc));
				iface->eps_num++;
			}
		}
		offset += desc_length;
	}
	return true;
}

static struct usb_device_index* add_usb_index(int fd, const char* dev, size_t dev_len)
{
	int i = __atomic_fetch_add(&usb_devices_num, 1, __ATOMIC_RELAXED);
	if (i >= USB_MAX_FDS)
		return NULL;
	if (!parse_usb_descriptor(dev, dev_len, &usb_devices[i].index))
		return NULL;
	__atomic_store_n(&usb_devices[i].fd, fd, __ATOMIC_RELEASE);
	return &usb_devices[i].index;
}

struct vusb_connect_string_descriptor {
	uint32_t len;
	char* str;
} __attribute__((packed));

struct vusb_connect_descriptors {
	uint32_t qual_len;
	char* qual;
	uint32_t bos_len;
	char* bos;
	uint32_t strs_len;
	struct vusb_connect_string_descriptor strs[0];
} __attribute__((packed));

static const char default_string[] = {
    8, USB_DT_STRING,
    's', 0, 'y', 0, 'z', 0
};

static const char default_lang_id[] = {
    4, USB_DT_STRING,
    0x09, 0x04
};

static bool lookup_connect_response_in(int fd, const struct vusb_connect_descriptors* descs,
				       const struct usb_ctrlrequest* ctrl,
				       struct usb_qualifier_descriptor* qual,
				       char** response_data, uint32_t* response_length)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	uint8_t str_idx;
	if (!index)
		return false;
	switch (ctrl->bRequestType & USB_TYPE_MASK) {
	case USB_TYPE_STANDARD:
		switch (ctrl->bRequest) {
		case USB_REQ_GET_DESCRIPTOR:
			switch (ctrl->wValue >> 8) {
			case USB_DT_DEVICE:
				*response_data = (char*)index->dev;
				*response_length = sizeof(*index->dev);
				return true;
			case USB_DT_CONFIG:
				*response_data = (char*)index->config;
				*response_length = index->config_length;
				return true;
			case USB_DT_STRING:
				str_idx = (uint8_t)ctrl->wValue;
				if (descs && str_idx < descs->strs_len) {
					*response_data = descs->strs[str_idx].str;
					*response_length = descs->strs[str_idx].len;
					return true;
				}
				if (str_idx == 0) {
					*response_data = (char*)&default_lang_id[0];
					*response_length = default_lang_id[0];
					return true;
				}
				*response_data = (char*)&default_string[0];
				*response_length = default_string[0];
				return true;
			case USB_DT_BOS:
				*response_data = descs->bos;
				*response_length = descs->bos_len;
				return true;
			case USB_DT_DEVICE_QUALIFIER:
				if (!descs->qual) {
					qual->bLength = sizeof(*qual);
					qual->bDescriptorType = USB_DT_DEVICE_QUALIFIER;
					qual->bcdUSB = index->dev->bcdUSB;
					qual->bDeviceClass = index->dev->bDeviceClass;
					qual->bDeviceSubClass = index->dev->bDeviceSubClass;
					qual->bDeviceProtocol = index->dev->bDeviceProtocol;
					qual->bMaxPacketSize0 = index->dev->bMaxPacketSize0;
					qual->bNumConfigurations = index->dev->bNumConfigurations;
					qual->bRESERVED = 0;
					*response_data = (char*)qual;
					*response_length = sizeof(*qual);
					return true;
				}
				*response_data = descs->qual;
				*response_length = descs->qual_len;
				return true;
			default:
				break;
			}
			break;
		default:
			break;
		}
		break;
	default:
		break;
	}
	return false;
}

typedef bool (*lookup_connect_out_response_t)(int fd, const struct vusb_connect_descriptors* descs,
					      const struct usb_ctrlrequest* ctrl, bool* done);

static bool lookup_connect_response_out_generic(int fd, const struct vusb_connect_descriptors* descs,
						const struct usb_ctrlrequest* ctrl, bool* done)
{
	switch (ctrl->bRequestType & USB_TYPE_MASK) {
	case USB_TYPE_STANDARD:
		switch (ctrl->bRequest) {
		case USB_REQ_SET_CONFIGURATION:
			*done = true;
			return true;
		default:
			break;
		}
		break;
	}
	return false;
}

#define UDC_NAME_LENGTH_MAX 128

struct usb_raw_init {
	__u8 driver_name[UDC_NAME_LENGTH_MAX];
	__u8 device_name[UDC_NAME_LENGTH_MAX];
	__u8 speed;
};

enum usb_raw_event_type {
	USB_RAW_EVENT_INVALID = 0,
	USB_RAW_EVENT_CONNECT = 1,
	USB_RAW_EVENT_CONTROL = 2,
};

struct usb_raw_event {
	__u32 type;
	__u32 length;
	__u8 data[0];
};

struct usb_raw_ep_io {
	__u16 ep;
	__u16 flags;
	__u32 length;
	__u8 data[0];
};

#define USB_RAW_EPS_NUM_MAX 30
#define USB_RAW_EP_NAME_MAX 16
#define USB_RAW_EP_ADDR_ANY 0xff

struct usb_raw_ep_caps {
	__u32 type_control : 1;
	__u32 type_iso : 1;
	__u32 type_bulk : 1;
	__u32 type_int : 1;
	__u32 dir_in : 1;
	__u32 dir_out : 1;
};

struct usb_raw_ep_limits {
	__u16 maxpacket_limit;
	__u16 max_streams;
	__u32 reserved;
};

struct usb_raw_ep_info {
	__u8 name[USB_RAW_EP_NAME_MAX];
	__u32 addr;
	struct usb_raw_ep_caps caps;
	struct usb_raw_ep_limits limits;
};

struct usb_raw_eps_info {
	struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX];
};

#define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init)
#define USB_RAW_IOCTL_RUN _IO('U', 1)
#define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
#define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
#define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
#define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32)
#define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info)
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
#define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32)

static int usb_raw_open()
{
	return open("/dev/raw-gadget", O_RDWR);
}

static int usb_raw_init(int fd, uint32_t speed, const char* driver, const char* device)
{
	struct usb_raw_init arg;
	strncpy((char*)&arg.driver_name[0], driver, sizeof(arg.driver_name));
	strncpy((char*)&arg.device_name[0], device, sizeof(arg.device_name));
	arg.speed = speed;
	return ioctl(fd, USB_RAW_IOCTL_INIT, &arg);
}

static int usb_raw_run(int fd)
{
	return ioctl(fd, USB_RAW_IOCTL_RUN, 0);
}

static int usb_raw_ep_write(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_WRITE, io);
}

static int usb_raw_ep_read(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_READ, io);
}

static int usb_raw_configure(int fd)
{
	return ioctl(fd, USB_RAW_IOCTL_CONFIGURE, 0);
}

static int usb_raw_vbus_draw(int fd, uint32_t power)
{
	return ioctl(fd, USB_RAW_IOCTL_VBUS_DRAW, power);
}

static int usb_raw_ep0_write(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP0_WRITE, io);
}

static int usb_raw_ep0_read(int fd, struct usb_raw_ep_io* io)
{
	return ioctl(fd, USB_RAW_IOCTL_EP0_READ, io);
}

static int usb_raw_event_fetch(int fd, struct usb_raw_event* event)
{
	return ioctl(fd, USB_RAW_IOCTL_EVENT_FETCH, event);
}

static int usb_raw_ep_enable(int fd, struct usb_endpoint_descriptor* desc)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_ENABLE, desc);
}

static int usb_raw_ep_disable(int fd, int ep)
{
	return ioctl(fd, USB_RAW_IOCTL_EP_DISABLE, ep);
}

static int usb_raw_ep0_stall(int fd)
{
	return ioctl(fd, USB_RAW_IOCTL_EP0_STALL, 0);
}

static int lookup_endpoint(int fd, uint8_t bEndpointAddress)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	if (!index)
		return -1;
	if (index->iface_cur < 0)
		return -1;
	for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++)
		if (index->ifaces[index->iface_cur].eps[ep].desc.bEndpointAddress == bEndpointAddress)
			return index->ifaces[index->iface_cur].eps[ep].handle;
	return -1;
}

#define USB_MAX_PACKET_SIZE 4096

struct usb_raw_control_event {
	struct usb_raw_event inner;
	struct usb_ctrlrequest ctrl;
	char data[USB_MAX_PACKET_SIZE];
};

struct usb_raw_ep_io_data {
	struct usb_raw_ep_io inner;
	char data[USB_MAX_PACKET_SIZE];
};

static void set_interface(int fd, int n)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	if (!index)
		return;
	if (index->iface_cur >= 0 && index->iface_cur < index->ifaces_num) {
		for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++) {
			int rv = usb_raw_ep_disable(fd, index->ifaces[index->iface_cur].eps[ep].handle);
			if (rv < 0) {
			} else {
			}
		}
	}
	if (n >= 0 && n < index->ifaces_num) {
		for (int ep = 0; ep < index->ifaces[n].eps_num; ep++) {
			int rv = usb_raw_ep_enable(fd, &index->ifaces[n].eps[ep].desc);
			if (rv < 0) {
			} else {
				index->ifaces[n].eps[ep].handle = rv;
			}
		}
		index->iface_cur = n;
	}
}

static int configure_device(int fd)
{
	struct usb_device_index* index = lookup_usb_index(fd);
	if (!index)
		return -1;
	int rv = usb_raw_vbus_draw(fd, index->bMaxPower);
	if (rv < 0) {
		return rv;
	}
	rv = usb_raw_configure(fd);
	if (rv < 0) {
		return rv;
	}
	set_interface(fd, 0);
	return 0;
}

static volatile long syz_usb_connect_impl(uint64_t speed, uint64_t dev_len, const char* dev,
					  const struct vusb_connect_descriptors* descs,
					  lookup_connect_out_response_t lookup_connect_response_out)
{
	if (!dev) {
		return -1;
	}
	int fd = usb_raw_open();
	if (fd < 0) {
		return fd;
	}
	if (fd >= MAX_FDS) {
		close(fd);
		return -1;
	}
	struct usb_device_index* index = add_usb_index(fd, dev, dev_len);
	if (!index) {
		return -1;
	}
	char device[32];
	sprintf(&device[0], "dummy_udc.%llu", procid);
	int rv = usb_raw_init(fd, speed, "dummy_udc", &device[0]);
	if (rv < 0) {
		return rv;
	}
	rv = usb_raw_run(fd);
	if (rv < 0) {
		return rv;
	}
	bool done = false;
	while (!done) {
		struct usb_raw_control_event event;
		event.inner.type = 0;
		event.inner.length = sizeof(event.ctrl);
		rv = usb_raw_event_fetch(fd, (struct usb_raw_event*)&event);
		if (rv < 0) {
			return rv;
		}
		if (event.inner.type != USB_RAW_EVENT_CONTROL)
			continue;
		char* response_data = NULL;
		uint32_t response_length = 0;
		struct usb_qualifier_descriptor qual;
		if (event.ctrl.bRequestType & USB_DIR_IN) {
			if (!lookup_connect_response_in(fd, descs, &event.ctrl, &qual, &response_data, &response_length)) {
				usb_raw_ep0_stall(fd);
				continue;
			}
		} else {
			if (!lookup_connect_response_out(fd, descs, &event.ctrl, &done)) {
				usb_raw_ep0_stall(fd);
				continue;
			}
			response_data = NULL;
			response_length = event.ctrl.wLength;
		}
		if ((event.ctrl.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD &&
		    event.ctrl.bRequest == USB_REQ_SET_CONFIGURATION) {
			rv = configure_device(fd);
			if (rv < 0) {
				return rv;
			}
		}
		struct usb_raw_ep_io_data response;
		response.inner.ep = 0;
		response.inner.flags = 0;
		if (response_length > sizeof(response.data))
			response_length = 0;
		if (event.ctrl.wLength < response_length)
			response_length = event.ctrl.wLength;
		response.inner.length = response_length;
		if (response_data)
			memcpy(&response.data[0], response_data, response_length);
		else
			memset(&response.data[0], 0, response_length);
		if (event.ctrl.bRequestType & USB_DIR_IN) {
			rv = usb_raw_ep0_write(fd, (struct usb_raw_ep_io*)&response);
		} else {
			rv = usb_raw_ep0_read(fd, (struct usb_raw_ep_io*)&response);
		}
		if (rv < 0) {
			return rv;
		}
	}
	sleep_ms(200);
	return fd;
}

static volatile long syz_usb_connect(volatile long a0, volatile long a1, volatile long a2, volatile long a3)
{
	uint64_t speed = a0;
	uint64_t dev_len = a1;
	const char* dev = (const char*)a2;
	const struct vusb_connect_descriptors* descs = (const struct vusb_connect_descriptors*)a3;
	return syz_usb_connect_impl(speed, dev_len, dev, descs, &lookup_connect_response_out_generic);
}

static volatile long syz_usb_ep_write(volatile long a0, volatile long a1, volatile long a2, volatile long a3)
{
	int fd = a0;
	uint8_t ep = a1;
	uint32_t len = a2;
	char* data = (char*)a3;
	int ep_handle = lookup_endpoint(fd, ep);
	if (ep_handle < 0) {
		return -1;
	}
	struct usb_raw_ep_io_data io_data;
	io_data.inner.ep = ep_handle;
	io_data.inner.flags = 0;
	if (len > sizeof(io_data.data))
		len = sizeof(io_data.data);
	io_data.inner.length = len;
	memcpy(&io_data.data[0], data, len);
	int rv = usb_raw_ep_write(fd, (struct usb_raw_ep_io*)&io_data);
	if (rv < 0) {
		return rv;
	}
	sleep_ms(200);
	return 0;
}

static volatile long syz_usb_ep_read(volatile long a0, volatile long a1, volatile long a2, volatile long a3)
{
	int fd = a0;
	uint8_t ep = a1;
	uint32_t len = a2;
	char* data = (char*)a3;
	int ep_handle = lookup_endpoint(fd, ep);
	if (ep_handle < 0) {
		return -1;
	}
	struct usb_raw_ep_io_data io_data;
	io_data.inner.ep = ep_handle;
	io_data.inner.flags = 0;
	if (len > sizeof(io_data.data))
		len = sizeof(io_data.data);
	io_data.inner.length = len;
	int rv = usb_raw_ep_read(fd, (struct usb_raw_ep_io*)&io_data);
	if (rv < 0) {
		return rv;
	}
	memcpy(&data[0], &io_data.data[0], io_data.inner.length);
	sleep_ms(200);
	return 0;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
		syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	const char* reason;
	(void)reason;
				intptr_t res = 0;
	if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
//  syz_usb_connect arguments: [
//    speed: usb_device_speed = 0x3 (8 bytes)
//    dev_len: len = 0x9f (8 bytes)
//    dev: ptr[inout, array[ANYUNION]] {
//      array[ANYUNION] {
//        union ANYUNION {
//          ANYBLOB: buffer: {12 01 00 02 00 00 00 40 48 0b 08 10 00 01 00 00 00 01 09 02 8d 00 01 01 00 80 fa 09 04 00 00 05 ff ff ff 00 07 05 03 02 00 02 00 07 05 84 02 00 02} (length 0x31)
//        }
//      }
//    }
//    conn_descs: nil
//  ]
//  returns fd_usb
memcpy((void*)0x20000000, "... [truncated large byte array] ...", 49);
	res = -1;
res = syz_usb_connect(/*speed=USB_SPEED_HIGH*/3, /*dev_len=*/0x9f, /*dev=*/0x20000000, /*conn_descs=*/0);
	if (res != -1)
		r[0] = res;
//  syz_usb_ep_read arguments: [
//    fd: fd_usb (resource)
//    ep: int8 = 0x3 (1 bytes)
//    len: len = 0x0 (8 bytes)
//    data: nil
//  ]
syz_usb_ep_read(/*fd=*/r[0], /*ep=*/3, /*len=*/0, /*data=*/0);
//  syz_usb_ep_write arguments: [
//    fd: fd_usb (resource)
//    ep: int8 = 0x84 (1 bytes)
//    len: len = 0xc (8 bytes)
//    data: ptr[in, buffer] {
//      buffer: {aa 00 9e 4b 65 1d 00 c4 45 ed b0 6d} (length 0xc)
//    }
//  ]
memcpy((void*)0x20000700, "\xaa\x00\x9e\x4b\x65\x1d\x00\xc4\x45\xed\xb0\x6d", 12);
syz_usb_ep_write(/*fd=*/r[0], /*ep=*/0x84, /*len=*/0xc, /*data=*/0x20000700);
	return 0;
}





Reply:
The crash is caused by a buffer overflow (both an out-of-bounds read and an out-of-bounds write) in the `ttusb_dec_send_command()` function, triggered by a malicious or malfunctioning USB device returning an unexpectedly large payload length.

### Detailed Analysis

In `drivers/media/usb/ttusb-dec/ttusb_dec.c`, the `ttusb_dec_send_command()` function allocates a buffer `b` to send a command and receive the response via `usb_bulk_msg()`:

```c
	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
```
Here, `COMMAND_PACKET_SIZE` is defined as `0x3c` (60), so the allocated buffer `b` is exactly 64 bytes.

After receiving the response from the USB device, the driver reads the payload length directly from `b[3]` (which is fully controlled by the USB device) and copies the payload into the caller-provided `cmd_result` buffer:

```c
		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0)
			memcpy(cmd_result, &b[4], b[3]);
```

There are two major flaws in this logic:
1. **No bounds check against the received data or the allocated buffer `b`**: `b[3]` is an 8-bit value and can be up to 255. If the device returns a value greater than `COMMAND_PACKET_SIZE` (60), the `memcpy()` will read past the end of the 64-byte buffer `b`. In the syzkaller crash, `b[3]` was `75`, leading to a 75-byte read from `&b[4]` (which only has 60 bytes allocated). This triggers the `fortify_memcpy_chk` panic (`75 byte read of buffer size 60`).
2. **No bounds check against the destination buffer `cmd_result`**: The size of `cmd_result` is never passed to `ttusb_dec_send_command()`. While callers like `ttusb_dec_get_stb_state()` pass a 60-byte buffer (`u8 c[COMMAND_PACKET_SIZE]`), other callers like `ttusbdecfe_dvbt_read_status()` in `ttusbdecfe.c` pass a much smaller buffer (`u8 result[4]`). If the device returns `b[3] = 60` for the latter, it will result in a severe stack buffer overflow.

### Proposed Fix

To fix this comprehensively, the API needs to be updated to pass the size of the destination buffer, and `ttusb_dec_send_command()` must validate `b[3]` against the received length, the maximum packet size, and the destination buffer size.

**1. Update `ttusbdecfe_config` in `drivers/media/usb/ttusb-dec/ttusbdecfe.h`:**
Add `cmd_result_len` to the `send_command` callback signature.
```c
struct ttusbdecfe_config
{
	int (*send_command)(struct dvb_frontend* fe, const u8 command,
			    int param_length, const u8 params[],
			    int *result_length, u8 cmd_result[],
			    int cmd_result_len);
};
```

**2. Update `ttusb_dec_send_command()` in `ttusb_dec.c`:**
Add `cmd_result_len` to the signature and implement the necessary bounds checks.
```c
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	// ...
	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);

	if (result) {
		printk("%s: result bulk message failed: error %d\n",
		       __func__, result);
		goto err_mutex_unlock;
	} else {
		if (debug) {
			printk(KERN_DEBUG "%s: result: %*ph\n",
			       __func__, actual_len, b);
		}

		/* Ensure we received at least the 4-byte header */
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		/* Ensure the device isn't claiming more data than it sent or than fits in b */
		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];

		if (cmd_result && b[3] > 0) {
			/* Ensure we don't overflow the caller's buffer */
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
	}
	// ...
```

**3. Update all callers:**
You will need to update all callers of `ttusb_dec_send_command()` in `ttusb_dec.c` and `state->config->send_command()` in `ttusbdecfe.c` to pass the correct buffer size. 
For example:
- In `ttusb_dec_get_stb_state()`: pass `sizeof(c)` instead of just `c`.
- In `ttusbdecfe_dvbt_read_status()`: pass `sizeof(result)` instead of just `result`.
- For calls where `cmd_result` is `NULL`, simply pass `0` as the length.

8/2 2026/08/17 21:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15725
							output: 45
							thoughts: 624
						

Thoughts:
**Analyzing a Kernel Crash: USB Buffer Overflow**

Okay, so I've got a kernel crash report here. First things first, it mentions a new USB device being plugged in – nothing unusual there, just standard device enumeration. However, then we get to the core issue: a `memcpy` buffer overflow. The system detected a 75-byte read exceeding a 60-byte buffer. The warning points to `lib/string_helpers.c` and specifically `__fortify_report`, indicating that the `fortify_memcpy_chk` check caught the issue.

Now, let's trace this back. The call stack leads me to `ttusb_dec_start_feed` within the `ttusb-dec` USB driver. The trace shows `ttusb_dec_start_feed` being called directly, but also notes that `ttusb_dec_get_stb_state` and `ttusb_dec_init_stb` are inlined functions within the call stack and lead to `ttusb_dec_probe`. The overflow itself is being caught within `ttusb_dec_start_feed` or possibly, a function that calls `ttusb_dec_start_feed`.

My immediate next step is to examine the code in `drivers/media/usb/ttusb-dec/ttusb_dec.c`. I need to pinpoint the exact `memcpy` call that's causing the problem, identify the source and destination buffers, and understand the data flow to figure out why the read size is exceeding the buffer size. It's likely a simple off-by-one or an unchecked data size assumption. Time to dig in and debug!



9/2 2026/08/17 21:06 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:360 LineCount:50]

Results:
map[Contents: 360:			printk("%s: result bulk message failed: error %d\n",
 361:			       __func__, result);
 362:			goto err_mutex_unlock;
 363:		} else {
 364:			if (debug) {
 365:				printk(KERN_DEBUG "%s: result: %*ph\n",
 366:				       __func__, actual_len, b);
 367:			}
 368:	
 369:			if (result_length)
 370:				*result_length = b[3];
 371:			if (cmd_result && b[3] > 0)
 372:				memcpy(cmd_result, &b[4], b[3]);
 373:		}
 374:	
 375:	err_mutex_unlock:
 376:		mutex_unlock(&dec->usb_mutex);
 377:	err_free:
 378:		kfree(b);
 379:		return result;
 380:	}
 381:	
 382:	static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 383:					    unsigned int *model, unsigned int *version)
 384:	{
 385:		u8 c[COMMAND_PACKET_SIZE];
 386:		int c_length;
 387:		int result;
 388:		__be32 tmp;
 389:	
 390:		dprintk("%s\n", __func__);
 391:	
 392:		result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
 393:		if (result)
 394:			return result;
 395:	
 396:		if (c_length >= 0x0c) {
 397:			if (mode != NULL) {
 398:				memcpy(&tmp, c, 4);
 399:				*mode = ntohl(tmp);
 400:			}
 401:			if (model != NULL) {
 402:				memcpy(&tmp, &c[4], 4);
 403:				*model = ntohl(tmp);
 404:			}
 405:			if (version != NULL) {
 406:				memcpy(&tmp, &c[8], 4);
 407:				*version = ntohl(tmp);
 408:			}
 409:			return 0;
]

10/2 2026/08/17 21:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17459
							output: 45
							thoughts: 137
						

Thoughts:
**Debugging a Tricky USB Decoder Crash**

Okay, so I've got a crash, and the initial report points me to `ttusb_dec.c:372`. The line is a `memcpy`: `memcpy(cmd_result, &b[4], b[3]);`. Classic memory corruption suspect. But hold on, the trace log is a bit... off. It's actually showing `ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372`, but that's *not* the function at that line. It seems the compiler or linker might have put the wrong symbol there, and at line 372 is actually the `ttusb_dec_send_command` function. Time to double-check that function, maybe the issue is there and the backtrace is misleading.



11/2 2026/08/17 21:06 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:300 LineCount:60]

Results:
map[Contents: 300:	}
 301:	
 302:	static u16 crc16(u16 crc, const u8 *buf, size_t len)
 303:	{
 304:		u16 tmp;
 305:	
 306:		while (len--) {
 307:			crc ^= *buf++;
 308:			crc ^= (u8)crc >> 4;
 309:			tmp = (u8)crc;
 310:			crc ^= (tmp ^ (tmp << 1)) << 4;
 311:		}
 312:		return crc;
 313:	}
 314:	
 315:	static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 316:					  int param_length, const u8 params[],
 317:					  int *result_length, u8 cmd_result[])
 318:	{
 319:		int result, actual_len;
 320:		u8 *b;
 321:	
 322:		dprintk("%s\n", __func__);
 323:	
 324:		b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 325:		if (!b)
 326:			return -ENOMEM;
 327:	
 328:		result = mutex_lock_interruptible(&dec->usb_mutex);
 329:		if (result) {
 330:			printk("%s: Failed to lock usb mutex.\n", __func__);
 331:			goto err_free;
 332:		}
 333:	
 334:		b[0] = 0xaa;
 335:		b[1] = ++dec->trans_count;
 336:		b[2] = command;
 337:		b[3] = param_length;
 338:	
 339:		if (params)
 340:			memcpy(&b[4], params, param_length);
 341:	
 342:		if (debug) {
 343:			printk(KERN_DEBUG "%s: command: %*ph\n",
 344:			       __func__, param_length, b);
 345:		}
 346:	
 347:		result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 348:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 349:	
 350:		if (result) {
 351:			printk("%s: command bulk message failed: error %d\n",
 352:			       __func__, result);
 353:			goto err_mutex_unlock;
 354:		}
 355:	
 356:		result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 357:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 358:	
 359:		if (result) {
]

12/2 2026/08/17 21:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18701
							output: 45
							thoughts: 62
						

Thoughts:
**Analyzing a USB Command Allocation**

Okay, so I'm looking at this `ttusb_dec_send_command` function, and it looks like it's allocating memory with `b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);`. The important bit here is `COMMAND_PACKET_SIZE`. My initial gut feel is that `COMMAND_PACKET_SIZE` is likely to be around 60, but I need to confirm that. Gotta double-check the definition of `COMMAND_PACKET_SIZE` to be sure. It's a critical parameter for buffer allocation, so I need the precise value.



13/2 2026/08/17 21:06 tool grepper
0m Args:
map[Expression:#define COMMAND_PACKET_SIZE PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:drivers/media/usb/ttusb-dec/ttusb_dec.c=41=DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-52-
drivers/media/usb/ttusb-dec/ttusb_dec.c:53:#define COMMAND_PACKET_SIZE	0x3c
drivers/media/usb/ttusb-dec/ttusb_dec.c-54-#define ARM_PACKET_SIZE		0x1000
]

14/2 2026/08/17 21:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19094
							output: 73
							thoughts: 599
						

Thoughts:
**Analyzing a Buffer Overflow in `ttusb_dec_send_command`**

Okay, let's break this down. `COMMAND_PACKET_SIZE` is defined as 0x3c, which translates to 60. So, `b` gets allocated with a size of 64 bytes. In the `ttusb_dec_get_stb_state` function, `c` is allocated as `u8 c[COMMAND_PACKET_SIZE]`, meaning 60 bytes. That's our target buffer for this function.

Now, looking at `ttusb_dec_send_command`, the critical section is the `usb_bulk_msg` call. Here, the code reads data from the USB device into `b`. The interesting part is the `memcpy` that follows:

```c
	memcpy(cmd_result, &b[4], b[3]);
```

Here, `b[3]` contains a length value that comes directly from the USB device. The core issue is that the USB device could return any value for `b[3]`. If `b[3]` is greater than `COMMAND_PACKET_SIZE` (60), the `memcpy` will overflow `cmd_result`, which is our 60-byte buffer (`c`). The crash report confirms this: "memcpy: detected buffer overflow: 75 byte read of buffer size 60". So, the device sent a length of 75 in `b[3]`.

The size of `b` is `COMMAND_PACKET_SIZE + 4` = 64 bytes. The `memcpy` tries to read 75 bytes from `&b[4]`, starting 4 bytes into `b`. This means the `memcpy` will read 60 bytes from inside `b` and 15 bytes out of bounds of `b`. And, it will write 75 bytes to `cmd_result`, which is our 60 byte buffer `c`, so it will write out of bounds of `c`. This is a classic buffer overflow scenario. The code is reading out of the `b` buffer to read the command response from the device, which also overflows `c`, the local command response, since the size provided by the device exceeds the intended buffer size.

It is necessary to inspect any other functions which call `ttusb_dec_send_command` to see if there is any place where a smaller buffer might be passed.



15/2 2026/08/17 21:06 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c IncludeSnippetLines:2 Name:ttusb_dec_send_command SourceTreePrefix:drivers/media/usb/ttusb-dec/]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:fe_send_command SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1627 SourceSnippet:1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1357 SourceSnippet:1355:		memcpy(&b0[6], &firmware_csum_ns, 2);
1356:	
1357:		result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
1358:	
1359:		if (result) {
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1398 SourceSnippet:1396:		}
1397:	
1398:		result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
1399:	
1400:		release_firmware(fw_entry);
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_get_stb_state SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:392 SourceSnippet: 390:		dprintk("%s\n", __func__);
 391:	
 392:		result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
 393:		if (result)
 394:			return result;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_interface SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:904 SourceSnippet: 902:				break;
 903:			case TTUSB_DEC_INTERFACE_IN:
 904:				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
 905:								b, NULL, NULL);
 906:				if (result)
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_pids SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:451 SourceSnippet: 449:		memcpy(&b[4], &video, 2);
 450:	
 451:		ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
 452:	
 453:		dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1058 SourceSnippet:1056:		memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
1057:	
1058:		result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
1059:						&c_length, c);
1060:	
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1024 SourceSnippet:1022:		}
1023:	
1024:		result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
1025:		if (result)
1026:			return result;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1138 SourceSnippet:1136:		spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
1137:		kfree(finfo);
1138:		ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
1139:	
1140:		dec->filter_stream_count--;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1117 SourceSnippet:1115:		u8 b0[] = { 0x00 };
1116:	
1117:		ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
1118:	
1119:		dec->pva_stream_count--;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_init_rc SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1241 SourceSnippet:1239:			printk("%s: usb_submit_urb failed\n",__func__);
1240:		/* enable irq pipe */
1241:		ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1242:	
1243:		return 0;
]] TruncatedOutput:false]

16/2 2026/08/17 21:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22022
							output: 46
							thoughts: 16
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, assuming I'm a seasoned professional in the field (likely embedded systems or audio/video processing, given the "ttusb" and "dec" keywords):

**Checking the `ttusb_dec_start_sec_feed` Function**

Alright, time to dig into this. My initial instinct is to go straight for `ttusb_dec_start_sec_feed`. This function name, based on my experience, strongly suggests it's a critical component related to the USB transport (probably related to a specific tuner type that I am familiar with) and the decoding process. The "start" implies an initiation, and "sec_feed" likely hints at the feeding of a secondary data stream, potentially related to section data, tables, or other control information vital for the decoder's operation. I need to understand exactly what this function does: does it initialize a specific data pipe? Does it enable an interrupt? Does it allocate and set up buffers? Is it directly called by the USB driver or is it called from the decoding section? I need to analyze its structure. Now let's see what that function does.



17/2 2026/08/17 21:06 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1040 LineCount:40]

Results:
map[Contents:1040:			    0x00, 0x00, 0x00, 0x00,
1041:			    0x00, 0x00, 0x00, 0x00,
1042:			    0x00 };
1043:		__be16 pid;
1044:		u8 c[COMMAND_PACKET_SIZE];
1045:		int c_length;
1046:		int result;
1047:		struct filter_info *finfo;
1048:		unsigned long flags;
1049:		u8 x = 1;
1050:	
1051:		dprintk("%s\n", __func__);
1052:	
1053:		pid = htons(dvbdmxfeed->pid);
1054:		memcpy(&b0[0], &pid, 2);
1055:		memcpy(&b0[4], &x, 1);
1056:		memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
1057:	
1058:		result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
1059:						&c_length, c);
1060:	
1061:		if (!result) {
1062:			if (c_length == 2) {
1063:				if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC)))
1064:					return -ENOMEM;
1065:	
1066:				finfo->stream_id = c[1];
1067:				finfo->filter = dvbdmxfeed->filter;
1068:	
1069:				spin_lock_irqsave(&dec->filter_info_list_lock, flags);
1070:				list_add_tail(&finfo->filter_info_list,
1071:					      &dec->filter_info_list);
1072:				spin_unlock_irqrestore(&dec->filter_info_list_lock,
1073:						       flags);
1074:	
1075:				dvbdmxfeed->priv = finfo;
1076:	
1077:				dec->filter_stream_count++;
1078:				return ttusb_dec_start_iso_xfer(dec);
1079:			}
]

18/2 2026/08/17 21:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22991
							output: 45
							thoughts: 227
						

Thoughts:
**Analyzing a Potential Heap Buffer Over-Read and Stack Buffer Overflow Vulnerability**

Okay, let me break this down. In the `ttusb_dec_start_sec_feed` function, `c` is defined as a `u8` array, sized `COMMAND_PACKET_SIZE`. And now I'm looking at `ttusb_dec_send_command`, the buffer `b` is allocated with a size of `COMMAND_PACKET_SIZE + 4` bytes. Hmm, that looks like it could be a problem, given the context.

If the device throws back a packet and the value of `b[3]` is *greater* than `COMMAND_PACKET_SIZE`, then it's going to overflow `c`. Wait a minute, hold up! `b[3]` is a `u8`, so it maxes out at 255. That's a good start to pinpoint the problem.

Alright, so if `b[3]` is 255, then `memcpy(cmd_result, &b[4], 255)` is going to read 255 bytes from `&b[4]`. The trouble is, `b` is only 64 bytes! That means the read will be out of bounds of `b` - a heap buffer over-read. Then, it will write out of bounds of `cmd_result`, which I'm assuming is a stack buffer, so...stack buffer overflow.

I should probably double-check `ttusb_dec_send_command` one more time, just to be sure I'm not missing anything.



19/2 2026/08/17 21:06 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:315 LineCount:60]

Results:
map[Contents: 315:	static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 316:					  int param_length, const u8 params[],
 317:					  int *result_length, u8 cmd_result[])
 318:	{
 319:		int result, actual_len;
 320:		u8 *b;
 321:	
 322:		dprintk("%s\n", __func__);
 323:	
 324:		b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 325:		if (!b)
 326:			return -ENOMEM;
 327:	
 328:		result = mutex_lock_interruptible(&dec->usb_mutex);
 329:		if (result) {
 330:			printk("%s: Failed to lock usb mutex.\n", __func__);
 331:			goto err_free;
 332:		}
 333:	
 334:		b[0] = 0xaa;
 335:		b[1] = ++dec->trans_count;
 336:		b[2] = command;
 337:		b[3] = param_length;
 338:	
 339:		if (params)
 340:			memcpy(&b[4], params, param_length);
 341:	
 342:		if (debug) {
 343:			printk(KERN_DEBUG "%s: command: %*ph\n",
 344:			       __func__, param_length, b);
 345:		}
 346:	
 347:		result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 348:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 349:	
 350:		if (result) {
 351:			printk("%s: command bulk message failed: error %d\n",
 352:			       __func__, result);
 353:			goto err_mutex_unlock;
 354:		}
 355:	
 356:		result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 357:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 358:	
 359:		if (result) {
 360:			printk("%s: result bulk message failed: error %d\n",
 361:			       __func__, result);
 362:			goto err_mutex_unlock;
 363:		} else {
 364:			if (debug) {
 365:				printk(KERN_DEBUG "%s: result: %*ph\n",
 366:				       __func__, actual_len, b);
 367:			}
 368:	
 369:			if (result_length)
 370:				*result_length = b[3];
 371:			if (cmd_result && b[3] > 0)
 372:				memcpy(cmd_result, &b[4], b[3]);
 373:		}
 374:	
]

20/2 2026/08/17 21:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24502
							output: 55
							thoughts: 1384
						

Thoughts:
**Analyzing a Potential Buffer Overflow in USB Communication**

Okay, so I'm looking at this USB communication code, and I see a potential vulnerability. It starts with a simple observation: `b[3]` represents the length of the result data. Now, if `b[3]` is larger than `COMMAND_PACKET_SIZE`, we're going to overflow the `cmd_result` buffer, which is allocated to `COMMAND_PACKET_SIZE` bytes, or sometimes passed as `NULL`. There's no check for this initially, which is a red flag.

The `b` buffer itself is allocated as `COMMAND_PACKET_SIZE + 4`. So, `b[3]` *shouldn't* exceed `COMMAND_PACKET_SIZE`, but is this enforced? That's the question. Then I remember that `actual_len` contains the number of bytes actually *received* from the device. The device might not always send the full `COMMAND_PACKET_SIZE + 4` bytes. In that case, the value in `b[3]` could be anything, potentially larger than what the `cmd_result` can handle.

If the device sends `b[3]` > `COMMAND_PACKET_SIZE`, `memcpy` will read and write beyond the bounds of both buffers. The solution is clear: add a check.  We *must* verify if `b[3]` is greater than `COMMAND_PACKET_SIZE` before using it in `memcpy`.

I also have to consider that `actual_len` might be less than `COMMAND_PACKET_SIZE + 4`.  If this happens, the `memcpy` will read from `b` and write to `cmd_result` as though all the data is present which it is not. This needs to be considered. Then it hits me: the `usb_bulk_msg` call receives *up to* `COMMAND_PACKET_SIZE + 4` bytes, but it doesn't clear the buffer. If `actual_len` is less than 4, `b[3]` could contain stale data from the *command* message, which could be a problem. The command message uses `b` as well.

So, I need to check `actual_len` to determine if the header is valid. If it's less than 4, then we've had a short read, and `b[3]` could contain garbage. I'll need to check the function, `ttusb_dec_send_command` more closely.

Looking at `ttusb_dec_send_command`, if `actual_len` < 4, `b[3]` would contain old data from `b`. But `b` is allocated with `kzalloc`, and therefore will be zeroed. Still, a device might send a partial header (less than 4 bytes), which is definitely not valid.

If `actual_len` is less than 4, the device is misbehaving, and the code needs to handle this.  Also, if `b[3] > actual_len - 4`, `memcpy` will read beyond the end of the `b` buffer (although it's initialized, so it's not a security issue). The right check is:
```c
if (b[3] > COMMAND_PACKET_SIZE) {
    /* error */
}
if (b[3] > actual_len - 4 && actual_len >= 4){
    /* error */
}
memcpy(cmd_result, &b[4], min_t(int, b[3], actual_len - 4));
```

So I think the fix boils down to checking if `b[3]` is greater than both `COMMAND_PACKET_SIZE` and `actual_len - 4`, and that we need to ensure that the header length is valid, and the bytes copied is not greater than the available received bytes. I'll search for other similar fixes in the kernel to be certain.



21/2 2026/08/17 21:07 tool git-log
0m Args:
map[CodeRegexp:b\[3\] > COMMAND_PACKET_SIZE Count:5 PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:]

22/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26816
							output: 38
							thoughts: 24
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Investigating Recent Changes in `ttusb_dec.c`**

Alright, before I dive too deep into this issue, a good starting point is always the version control history. I need to get a handle on what's been happening with `ttusb_dec.c` recently. My instinct is that the problem I'm seeing might be related to a recent bug fix or perhaps a refactoring that inadvertently introduced a regression. A quick `git log` should tell the story; a few well-placed `grep`s and some filtering on the commit messages and author information may save me a lot of debugging time. I'll focus on the commits that specifically touch `ttusb_dec.c` and see if anything jumps out. Hopefully, there's a clear culprit I can zero in on, perhaps a particularly tricky commit message or some suspicious code changes. If not, this at least gives me a solid baseline, a starting point to start my investigation.



23/2 2026/08/17 21:07 tool git-log
0m Args:
map[Count:10 PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
1021dd010d21 media: Convert from tasklet to BH workqueue
eff540df5f80 media: usb: remove unnecessary (void*) conversions
517a28133832 media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
36b9d695aa6f media: ttusb-dec: avoid release of non-acquired mutex
dba328bab4c6 media: ttusb-dec: cleanup an error handling logic
c3bf67e80532 media: media/usb:Remove superfluous "breaks" in the ttusb_dec.c
f3b60b066a5b media: ttusb-dec: convert tasklets to use new tasklet_setup() API
f933d160b1e7 media: usb: ttusb-dec: reduce the number of memory reads in ttusb_dec_handle_irq()
]

24/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27392
							output: 73
							thoughts: 192
						

Thoughts:
**Analyzing a Persistent Buffer Overflow**

Okay, so I'm dealing with a buffer overflow, and it's been around for a bit – no recent commits seem to have addressed it. Let's dig in. The crash report says `memcpy` detected a buffer overflow: a 75-byte read from a 60-byte buffer. Right, `b[3]` was the offending value, 75. That's a classic overflow scenario.

Looking at the code, it looks like `cmd_result` is `c` within `ttusb_dec_get_stb_state`. And `c` is, as I recall, defined as `u8 c[COMMAND_PACKET_SIZE];`. Let me just confirm... Yup, `COMMAND_PACKET_SIZE` is 0x3c, or 60. So, the size mismatch is clear – `b[3]` is 75, which blows right past the 60-byte limit.

The fix, logically, seems to be a straightforward bounds check. I need to compare `b[3]` against either `COMMAND_PACKET_SIZE` or, potentially, `actual_len - 4`. But... a thought occurs to me. Is `cmd_result` always *exactly* `COMMAND_PACKET_SIZE` bytes? That's a critical assumption. I need to be absolutely sure.

Okay, I'll need to check *every* single call site of `ttusb_dec_send_command`. Gotta verify how the length information is used there before I commit to a fix. Don't want to introduce a regression by over-simplifying the solution.



25/2 2026/08/17 21:07 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c IncludeSnippetLines:5 Name:ttusb_dec_send_command SourceTreePrefix:drivers/media/usb/ttusb-dec/]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:fe_send_command SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1627 SourceSnippet:1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1357 SourceSnippet:1352:		memcpy(b0, &firmware_size_nl, 4);
1353:		firmware_csum = crc16(~0, firmware, firmware_size) ^ ~0;
1354:		firmware_csum_ns = htons(firmware_csum);
1355:		memcpy(&b0[6], &firmware_csum_ns, 2);
1356:	
1357:		result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
1358:	
1359:		if (result) {
1360:			release_firmware(fw_entry);
1361:			return result;
1362:		}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1398 SourceSnippet:1393:						      j - COMMAND_PACKET_SIZE + size,
1394:						      &actual_len, 100);
1395:			}
1396:		}
1397:	
1398:		result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
1399:	
1400:		release_firmware(fw_entry);
1401:		kfree(b);
1402:	
1403:		return result;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_get_stb_state SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:392 SourceSnippet: 387:		int result;
 388:		__be32 tmp;
 389:	
 390:		dprintk("%s\n", __func__);
 391:	
 392:		result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
 393:		if (result)
 394:			return result;
 395:	
 396:		if (c_length >= 0x0c) {
 397:			if (mode != NULL) {
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_interface SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:904 SourceSnippet: 899:			switch (interface) {
 900:			case TTUSB_DEC_INTERFACE_INITIAL:
 901:				result = usb_set_interface(dec->udev, 0, 0);
 902:				break;
 903:			case TTUSB_DEC_INTERFACE_IN:
 904:				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
 905:								b, NULL, NULL);
 906:				if (result)
 907:					return result;
 908:				result = usb_set_interface(dec->udev, 0, 8);
 909:				break;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_pids SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:451 SourceSnippet: 446:	
 447:		memcpy(&b[0], &pcr, 2);
 448:		memcpy(&b[2], &audio, 2);
 449:		memcpy(&b[4], &video, 2);
 450:	
 451:		ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
 452:	
 453:		dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 454:				       ttusb_dec_audio_pes2ts_cb, dec);
 455:		dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO],
 456:				       ttusb_dec_video_pes2ts_cb, dec);
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1058 SourceSnippet:1053:		pid = htons(dvbdmxfeed->pid);
1054:		memcpy(&b0[0], &pid, 2);
1055:		memcpy(&b0[4], &x, 1);
1056:		memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
1057:	
1058:		result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
1059:						&c_length, c);
1060:	
1061:		if (!result) {
1062:			if (c_length == 2) {
1063:				if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC)))
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1024 SourceSnippet:1019:			dprintk("  pes_type: unknown (%d)\n", dvbdmxfeed->pes_type);
1020:			return -EINVAL;
1021:	
1022:		}
1023:	
1024:		result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
1025:		if (result)
1026:			return result;
1027:	
1028:		dec->pva_stream_count++;
1029:		return ttusb_dec_start_iso_xfer(dec);
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1138 SourceSnippet:1133:		b0[1] = finfo->stream_id;
1134:		spin_lock_irqsave(&dec->filter_info_list_lock, flags);
1135:		list_del(&finfo->filter_info_list);
1136:		spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
1137:		kfree(finfo);
1138:		ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
1139:	
1140:		dec->filter_stream_count--;
1141:	
1142:		ttusb_dec_stop_iso_xfer(dec);
1143:	
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1117 SourceSnippet:1112:	static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
1113:	{
1114:		struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
1115:		u8 b0[] = { 0x00 };
1116:	
1117:		ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
1118:	
1119:		dec->pva_stream_count--;
1120:	
1121:		ttusb_dec_stop_iso_xfer(dec);
1122:	
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_init_rc SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1241 SourceSnippet:1236:	
1237:		dec->rc_input_dev = input_dev;
1238:		if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
1239:			printk("%s: usb_submit_urb failed\n",__func__);
1240:		/* enable irq pipe */
1241:		ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1242:	
1243:		return 0;
1244:	}
]] TruncatedOutput:false]

26/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30761
							output: 46
							thoughts: 37
						

Thoughts:
Here's my take on the thought process:

**Diving into the Function Call**

Okay, hold on a second. I seem to recall `fe_send_command` being invoked from deep within the `ttusb_dec_fe.c` file, or something along those lines. Just need to confirm. I should probably double-check that by looking at the function. That's a good starting point to trace the calling hierarchy. Let's start with `fe_send_command`.



27/2 2026/08/17 21:07 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1620 LineCount:20]

Results:
map[Contents:1620:	}
1621:	
1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
1629:	
1630:	static const struct ttusbdecfe_config fe_config = {
1631:		.send_command = fe_send_command
1632:	};
1633:	
1634:	static int ttusb_dec_probe(struct usb_interface *intf,
1635:				   const struct usb_device_id *id)
1636:	{
1637:		struct usb_device *udev;
1638:		struct ttusb_dec *dec;
1639:		int result;
]

28/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31266
							output: 68
							thoughts: 62
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own mental process, given my expertise:

**Checking `ttusbdecfe_attach` and Command Packet Handling**

Alright, so `fe_config` is being passed into `ttusbdecfe_attach`, got it. That's the starting point. My immediate thought is, "Okay, what's happening *inside* that function, specifically concerning how it interacts with the command results?" I need to confirm something crucial about the command structure.

Right, I need to verify how `cmd_result` is being handled within the `ttusbdecfe.c` driver code, in `drivers/media/usb/ttusb-dec/ttusbdecfe.c`. I need to confirm if the size is consistent. I suspect there may be assumptions or dependencies on `cmd_result` *always* being `COMMAND_PACKET_SIZE` bytes. Any potential deviation from that could cause issues with how results are interpreted, right? So let's crack open that file and make sure there aren't any sneaky assumptions or potential buffer overflows lurking. Gotta be thorough, you know, especially with driver code.



29/2 2026/08/17 21:07 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c IncludeSnippetLines:5 Name:send_command SourceTreePrefix:drivers/media/usb/ttusb-dec/]

Results:
map[References:<nil> TruncatedOutput:false]

30/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31661
							output: 40
							thoughts: 19
						

Thoughts:
Here's my understanding of the thought process, summarized as you requested:

**Navigating Configuration Data Structures**

Okay, let me think this through. I was just working with the `ttusbdecfe_config` structure, and something clicked. *Wait a minute...* I've been staring at this code for a while now, and it just hit me. `send_command` isn't some standalone function call I was imagining. It's actually a *field* within the `ttusbdecfe_config` structure itself! It's right there, embedded within the configuration data. This changes how I approach it.



31/2 2026/08/17 21:07 tool grepper
0m Args:
map[Expression:send_command PathPrefix:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[Output:drivers/media/usb/ttusb-dec/ttusbdecfe.c=36=static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-46-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:47:	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
drivers/media/usb/ttusb-dec/ttusbdecfe.c-48-	if(ret)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=76=static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-87-	memcpy(&b[4], &freq, sizeof (u32));
drivers/media/usb/ttusb-dec/ttusbdecfe.c:88:	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusbdecfe.c-89-
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=103=static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-132-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:133:	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusbdecfe.c-134-
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=138=static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-149-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:150:	state->config->send_command(fe, 0x72,
drivers/media/usb/ttusb-dec/ttusbdecfe.c-151-				    sizeof(b) - (6 - cmd->msg_len), b,
]

32/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 32486
							output: 44
							thoughts: 26
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Analyzing the DVB-T Status Reading Function**

Okay, time to dive in. I need to get a handle on how this DVB-T demodulator status is being read. Let's start by looking closely at the `ttusbdecfe_dvbt_read_status` function within the `ttusbdecfe.c` file. I'm going to need to trace through this and understand the exact sequence of registers being polled, any error handling it implements, and how the data is being interpreted to determine things like signal lock, signal quality, and any other relevant DVB-T parameters. I want to see how robust this code is and if there are any potential areas for improvement or optimization. Hopefully, it's well-commented, and I can quickly get a good grasp of the underlying logic. Let's get to it.



33/2 2026/08/17 21:07 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusbdecfe.c FirstLine:36 LineCount:20]

Results:
map[Contents:  36:	static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
  37:					       enum fe_status *status)
  38:	{
  39:		struct ttusbdecfe_state* state = fe->demodulator_priv;
  40:		u8 b[] = { 0x00, 0x00, 0x00, 0x00,
  41:			   0x00, 0x00, 0x00, 0x00 };
  42:		u8 result[4];
  43:		int len, ret;
  44:	
  45:		*status=0;
  46:	
  47:		ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
  48:		if(ret)
  49:			return ret;
  50:	
  51:		if(len != 4) {
  52:			printk(KERN_ERR "%s: unexpected reply\n", __func__);
  53:			return -EIO;
  54:		}
  55:	
]

34/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33068
							output: 43
							thoughts: 465
						

Thoughts:
**Buffer Overflow Analysis and Proposed Fix**

Okay, so I've spotted it! The `result` buffer is defined as `u8 result[4];`. And if `b[3]` is 75, this `memcpy(cmd_result, &b[4], 75)` is going to overflow `result[4]` by a whopping 71 bytes! This means `cmd_result` isn't always going to be the fixed `COMMAND_PACKET_SIZE` we might have assumed. The killer is that `ttusb_dec_send_command` has no idea about the size of `cmd_result`. It's just blindly copying `b[3]` bytes into it, and that's precisely where the overflow happens. The classic buffer overflow vulnerability.

The fix? We have to pass the actual size of `cmd_result` to `ttusb_dec_send_command`. Looking at the prototype, I think we can modify the function signature. I'm going to add an additional `cmd_result_len` to track the actual size:

```c
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[], int cmd_result_len)
```

But, wait! The `fe_config` struct, the one with `send_command`, is going to need to be changed too. I'll need to update that to reflect the new `send_command` signature. Let's see... I'll check `drivers/media/usb/ttusb-dec/ttusbdecfe.h` to make sure I update the definition there as well.



35/2 2026/08/17 21:07 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusbdecfe.h FirstLine:1 LineCount:20]

Results:
map[Contents:   1:	/* SPDX-License-Identifier: GPL-2.0-or-later */
   2:	/*
   3:	 * TTUSB DEC Driver
   4:	 *
   5:	 * Copyright (C) 2003-2004 Alex Woods <linux-dvb@giblets.org>
   6:	 */
   7:	
   8:	#ifndef TTUSBDECFE_H
   9:	#define TTUSBDECFE_H
  10:	
  11:	#include <linux/dvb/frontend.h>
  12:	
  13:	struct ttusbdecfe_config
  14:	{
  15:		int (*send_command)(struct dvb_frontend* fe, const u8 command,
  16:				    int param_length, const u8 params[],
  17:				    int *result_length, u8 cmd_result[]);
  18:	};
  19:	
  20:	extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
]

36/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 34245
							output: 60
							thoughts: 42
						

Thoughts:
Okay, let me think this through.

**Analyzing the Impact of a Function Modification**

Hmm, so if I'm understanding this correctly, we're talking about modifying the `send_command` function within `ttusbdecfe_config`. That's a pretty low-level function, suggesting it's likely a core component. The first thing that jumps out is the ripple effect. If we're making a change here, we absolutely *have* to meticulously check every single piece of code that calls `ttusbdecfe_config`. We can't just assume it'll be fine.

The next immediate question I have is, are there any *other* drivers using `ttusbdecfe_config`? This isn't just about the immediate implementation. If multiple drivers are relying on this, the scope of impact and the testing required skyrockets. We need to identify all dependencies, and carefully assess how each one interacts with the current command structure, before even thinking of a modification. I need to make sure I haven't missed any.



37/2 2026/08/17 21:07 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.h IncludeSnippetLines:2 Name:ttusbdecfe_config SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:uses ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbs_attach SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:216 SourceSnippet: 216:	struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config)
 217:	{
 218:		struct ttusbdecfe_state* state = NULL;
] map[ReferenceKind:uses ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbt_attach SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:196 SourceSnippet: 196:	struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config)
 197:	{
 198:		struct ttusbdecfe_state* state = NULL;
] map[ReferenceKind:uses ReferencingEntityKind:global_variable ReferencingEntityName:fe_config SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1630 SourceSnippet:1630:	static const struct ttusbdecfe_config fe_config = {
1631:		.send_command = fe_send_command
1632:	};
]] TruncatedOutput:false]

38/2 2026/08/17 21:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 34960
							output: 45
							thoughts: 1694
						

Thoughts:
**Refactoring `ttusb_dec_send_command` for Robustness**

Okay, so the immediate goal here is to introduce a `cmd_result_len` parameter to `ttusbdecfe_config` and ultimately to `ttusb_dec_send_command` in order to provide safer bounds checking on the command result data.  The scope is confined to `ttusb_dec.c` and `ttusbdecfe.c`, so that makes this a fairly isolated change, which is good.

First, I need to revisit the `ttusbdecfe_dvbt_read_status` function, focusing on how it currently handles command results.  Specifically, I see a potential for overflow if the `send_command` function returns more data than the `result` buffer can hold. Currently, the code in `ttusbdecfe_dvbt_read_status` is this:

```c
ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
```

Where `result` is a `u8 result[4];`.

Now, if I change the function signature of `send_command` to include a `cmd_result_len` parameter, things get a bit more interesting. The revised `ttusbdecfe_dvbt_read_status` would call it like this:

```c
	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result, sizeof(result));
```

And then, `fe_send_command` would be modified to call `ttusb_dec_send_command`.  This would allow the callee to know the size of the buffer it is writing into.

The next step is to examine how `ttusb_dec_send_command` would handle the `cmd_result_len` parameter and the return data length (`b[3]`).  I'm concerned about scenarios where the result length reported by the device (`b[3]`) exceeds the allocated buffer size. Should I clip it, return an error, or something else? If the device returns more data than expected, it might indicate a bug or a malicious attempt.

If I were to simply copy `min(b[3], cmd_result_len)` to avoid overflows, what would happen with `*result_length`? The calling code reads `*result_length` and might assume that many bytes were copied into `cmd_result`.

Looking back at the calling code, particularly in `ttusbdecfe_dvbt_read_status`, I realize that the overflow might actually not be as big of a deal as I initially thought since there is a check after the send_command call to make sure the expected data size is returned. The code will return an error if it doesn't receive the expected data size, meaning a read overflow will trigger an error. However, while an error is returned, the overflow could still have happened.

I have to consider the potential for out-of-bounds reads. The code allocates `COMMAND_PACKET_SIZE + 4` bytes.  If `b[3]` contains a value larger than `COMMAND_PACKET_SIZE` it would cause an out of bounds read, and that is very bad!  

The actual number of received bytes is in `actual_len`. I must ensure that I do not read past `actual_len - 4` bytes when copying data from `&b[4]`.

However, the current code checks that.

```c
		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0) {
			int copy_len = b[3];
			if (copy_len > COMMAND_PACKET_SIZE)
				copy_len = COMMAND_PACKET_SIZE;
			if (copy_len > cmd_result_len)
				copy_len = cmd_result_len;
			memcpy(cmd_result, &b[4], copy_len);
		}
```

This code looks like it is already taking care of this overflow.

But what if `actual_len < 4`?  In that case, I might be reading uninitialized data or data from the command itself.  I should check for `actual_len >= 4` before proceeding with any data copying.  In fact, the code *does* check this!

```c
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}
```

Now, the final thing I must consider is that changing the prototype of `ttusb_dec_send_


39/2 2026/08/17 21:08 tool grepper
0m Args:
map[Expression:ttusb_dec_send_command PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:drivers/media/usb/ttusb-dec/ttusb_dec.c=302=static u16 crc16(u16 crc, const u8 *buf, size_t len)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-314-
drivers/media/usb/ttusb-dec/ttusb_dec.c:315:static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
drivers/media/usb/ttusb-dec/ttusb_dec.c-316-				  int param_length, const u8 params[],
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=382=static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-391-
drivers/media/usb/ttusb-dec/ttusb_dec.c:392:	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
drivers/media/usb/ttusb-dec/ttusb_dec.c-393-	if (result)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=435=static void ttusb_dec_set_pids(struct ttusb_dec *dec)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-450-
drivers/media/usb/ttusb-dec/ttusb_dec.c:451:	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-452-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=892=static int ttusb_dec_set_interface(struct ttusb_dec *dec,
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-903-		case TTUSB_DEC_INTERFACE_IN:
drivers/media/usb/ttusb-dec/ttusb_dec.c:904:			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
drivers/media/usb/ttusb-dec/ttusb_dec.c-905-							b, NULL, NULL);
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=964=static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1023-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1024:	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1025-	if (result)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1032=static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1057-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1058:	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
drivers/media/usb/ttusb-dec/ttusb_dec.c-1059-					&c_length, c);
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1112=static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1116-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1117:	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1118-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1126=static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1137-	kfree(finfo);
drivers/media/usb/ttusb-dec/ttusb_dec.c:1138:	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1139-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1207=static int ttusb_init_rc( struct ttusb_dec *dec)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1240-	/* enable irq pipe */
drivers/media/usb/ttusb-dec/ttusb_dec.c:1241:	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1242-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1298=static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1356-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1357:	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1358-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1397-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1398:	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1399-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1622=static int fe_send_command(struct dvb_frontend* fe, const u8 command,
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1626-	struct ttusb_dec* dec = fe->dvb->priv;
drivers/media/usb/ttusb-dec/ttusb_dec.c:1627:	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1628-}
]

40/2 2026/08/17 21:08 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 39571
							output: 40
							thoughts: 301
						

Thoughts:
**Analyzing the `cmd_result` Variable**

Okay, so I'm looking at this `cmd_result` variable, and something's immediately jumping out at me: it's *NULL* in a ton of cases. That's a red flag, right? Let's break this down systematically.

When it *isn't* `NULL`, I see a couple of functions using it where `c` is a `u8 c[COMMAND_PACKET_SIZE];` buffer: `ttusb_dec_get_stb_state` and `ttusb_dec_start_sec_feed`. Another one is `fe_send_command`, which looks like the `cmd_result` is passed from `ttusbdecfe.c`, so it originates from there. That gives me a clue about where to look.

Now, diving into `ttusbdecfe.c`, I see `send_command` is getting called from a few places. Crucially, I see that the `result` is `u8 result[4];` buffer in `ttusbdecfe_dvbt_read_status`, but is *NULL* in all the others. This makes me wonder about the implications of passing `NULL` to this function when it clearly expects a buffer sometimes. In the other cases it is `NULL` in `ttusbdecfe_dvbt_set_frontend`, `ttusbdecfe_dvbs_set_frontend`, `ttusbdecfe_dvbs_diseqc_send_master_cmd`, `ttusbdecfe_dvbs_diseqc_send_burst`, `ttusbdecfe_dvbs_set_tone` and `ttusbdecfe_dvbs_set_voltage`. Does the function handle the `NULL` correctly?

Now I need to take a step back and make sure that there aren't any other callers in this file. It looks like it is a call graph and I need to check the entire breadth of the call graph to be sure.



41/2 2026/08/17 21:08 tool grepper
0m Args:
map[Expression:send_command PathPrefix:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[Output:drivers/media/usb/ttusb-dec/ttusbdecfe.c=36=static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-46-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:47:	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
drivers/media/usb/ttusb-dec/ttusbdecfe.c-48-	if(ret)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=76=static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-87-	memcpy(&b[4], &freq, sizeof (u32));
drivers/media/usb/ttusb-dec/ttusbdecfe.c:88:	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusbdecfe.c-89-
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=103=static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-132-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:133:	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusbdecfe.c-134-
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=138=static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-149-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:150:	state->config->send_command(fe, 0x72,
drivers/media/usb/ttusb-dec/ttusbdecfe.c-151-				    sizeof(b) - (6 - cmd->msg_len), b,
]

42/2 2026/08/17 21:08 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 40973
							output: 44
							thoughts: 3081
						

Thoughts:
**Refining the Command Result Handling in `ttusb_dec`**

Okay, so I've been digging into this `ttusb_dec` code, specifically the `send_command` functionality. The initial concern revolves around how the command results are handled, particularly the `cmd_result` buffer. It appears that only `ttusbdecfe_dvbt_read_status` uses a non-NULL `cmd_result` and passes a 4-byte buffer.

My initial thought was to simply adjust `ttusb_dec_send_command` to take a `cmd_result_len` parameter to ensure safety, but that looked like a bigger change, requiring updates to several call sites, including `ttusbdecfe_config`. Instead, I considered a simpler approach: have `ttusb_dec_send_command` always assume a `COMMAND_PACKET_SIZE` byte buffer for `cmd_result` and fix `ttusbdecfe_dvbt_read_status` to pass a buffer of that size.

I then realized that `COMMAND_PACKET_SIZE` is defined in `ttusb_dec.c`, which `ttusbdecfe.c` doesn't know about. I could just use a 60-byte buffer. But this raised some questions about buffer overflows, specifically, what if the data to be copied (`b[3]`) exceeds the buffer size (even if it's 60 bytes)? And what if `b[3]` is a value larger than 60? It looks like I NEED to add a check in `ttusb_dec_send_command` to prevent that.

Given this, I realized I would need to check for two things: `b[3]` exceeding `COMMAND_PACKET_SIZE` and `b[3]` exceeding `cmd_result_len`. This makes the code robust. But also, this exposes a problem in `ttusbdecfe_dvbt_read_status`. If `b[3]` is 60, it will still overflow the 4-byte buffer. The API should be changed to pass the buffer size.

Let's do this correctly. Changing the API to pass the buffer size is much more robust and kernel-like. I then scoped out the modifications required. It looks like it touches the `ttusbdecfe.h` header, and I'd need to modify the calls in `ttusbdecfe.c` and `ttusb_dec.c` to update the API signature. Quite a bit of churn but the right fix.

However, I started to explore another option. What if I just change `ttusbdecfe_dvbt_read_status` to use a 60-byte buffer and keep it isolated? Since `ttusbdecfe.c` doesn't include `ttusb_dec.h`, the size can be hardcoded. Then, I just need to update `ttusb_dec_send_command` to check that `b[3]` does not exceed `COMMAND_PACKET_SIZE` to prevent any overflows. I would modify `ttusbdecfe_dvbt_read_status` to use a 60-byte buffer, and that's it. This approach offers a significantly lower impact. This is more attractive than changing the function signature.

Is this acceptable? I need to weigh the trade-offs now.



43/2 2026/08/17 21:08 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusbdecfe.c FirstLine:36 LineCount:20]

Results:
map[Contents:  36:	static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
  37:					       enum fe_status *status)
  38:	{
  39:		struct ttusbdecfe_state* state = fe->demodulator_priv;
  40:		u8 b[] = { 0x00, 0x00, 0x00, 0x00,
  41:			   0x00, 0x00, 0x00, 0x00 };
  42:		u8 result[4];
  43:		int len, ret;
  44:	
  45:		*status=0;
  46:	
  47:		ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
  48:		if(ret)
  49:			return ret;
  50:	
  51:		if(len != 4) {
  52:			printk(KERN_ERR "%s: unexpected reply\n", __func__);
  53:			return -EIO;
  54:		}
  55:	
]

44/2 2026/08/17 21:08 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 45137
							output: 45
							thoughts: 233
						

Thoughts:
**Reflecting on a Localized Optimization**

Okay, so I'm looking at this buffer `u8 result[4];` and thinking, "Can we make this bigger without breaking things?" It's clear that bumping it up to `u8 result[60];` will consume 56 more bytes on the stack, which is generally not a concern. But as any good engineer knows, you have to think about the impact of the change.

Wait a moment, I need to consider: Does another driver even *use* `ttusbdecfe_config`? I know we looked at that earlier and confirmed that only `ttusb_dec.c` actually calls it. Right, so we know `cmd_result` is always either `NULL`, or if it's not `NULL`, it's `c` (which is already size 60) in `ttusb_dec.c`, or it's `result` in `ttusbdecfe_dvbt_read_status`.

If we change `result` to size 60, then anytime `cmd_result` is not null, it will *always* be at least 60 bytes. This means that we can then just add a simple check in `ttusb_dec_send_command` like `if (b[3] > COMMAND_PACKET_SIZE)`. This is a pretty focused change, making it a low-risk, easy win.

However, let's just make *absolutely* sure there isn't any other place where `cmd_result` is passed around. I'll need to go back and double check `ttusb_dec.c`.



45/2 2026/08/17 21:08 tool grepper
0m Args:
map[Expression:ttusb_dec_send_command PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:drivers/media/usb/ttusb-dec/ttusb_dec.c=302=static u16 crc16(u16 crc, const u8 *buf, size_t len)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-314-
drivers/media/usb/ttusb-dec/ttusb_dec.c:315:static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
drivers/media/usb/ttusb-dec/ttusb_dec.c-316-				  int param_length, const u8 params[],
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=382=static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-391-
drivers/media/usb/ttusb-dec/ttusb_dec.c:392:	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
drivers/media/usb/ttusb-dec/ttusb_dec.c-393-	if (result)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=435=static void ttusb_dec_set_pids(struct ttusb_dec *dec)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-450-
drivers/media/usb/ttusb-dec/ttusb_dec.c:451:	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-452-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=892=static int ttusb_dec_set_interface(struct ttusb_dec *dec,
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-903-		case TTUSB_DEC_INTERFACE_IN:
drivers/media/usb/ttusb-dec/ttusb_dec.c:904:			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
drivers/media/usb/ttusb-dec/ttusb_dec.c-905-							b, NULL, NULL);
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=964=static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1023-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1024:	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1025-	if (result)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1032=static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1057-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1058:	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
drivers/media/usb/ttusb-dec/ttusb_dec.c-1059-					&c_length, c);
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1112=static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1116-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1117:	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1118-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1126=static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1137-	kfree(finfo);
drivers/media/usb/ttusb-dec/ttusb_dec.c:1138:	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1139-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1207=static int ttusb_init_rc( struct ttusb_dec *dec)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1240-	/* enable irq pipe */
drivers/media/usb/ttusb-dec/ttusb_dec.c:1241:	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1242-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1298=static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1356-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1357:	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1358-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1397-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1398:	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1399-
--
drivers/media/usb/ttusb-dec/ttusb_dec.c=1622=static int fe_send_command(struct dvb_frontend* fe, const u8 command,
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1626-	struct ttusb_dec* dec = fe->dvb->priv;
drivers/media/usb/ttusb-dec/ttusb_dec.c:1627:	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
drivers/media/usb/ttusb-dec/ttusb_dec.c-1628-}
]

46/2 2026/08/17 21:08 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 47617
							output: 26
							thoughts: 436
						

Thoughts:
**Reflecting on Buffer Size Discrepancies**

Okay, so I'm looking at these buffer sizes and how they're being passed around in this driver code. It seems like only `ttusb_dec_get_stb_state` and `ttusb_dec_start_sec_feed` use the `c` buffer, which is a `u8 c[COMMAND_PACKET_SIZE]`. Then, `fe_send_command` uses `cmd_result` that it receives from `ttusbdecfe.c`. Diving into `ttusbdecfe.c`, I see that only `ttusbdecfe_dvbt_read_status` passes the `result` buffer, which is currently defined as `u8 result[4]`.

The problem is, if I simply bump up the size of `result` in `ttusbdecfe.c` to at least 60 bytes—like `u8 result[60];` or, ideally, `u8 result[COMMAND_PACKET_SIZE];` if that macro were accessible there—then all the `cmd_result` buffers would be sufficiently sized. However, wait a minute, `ttusbdecfe.c` doesn't have access to `COMMAND_PACKET_SIZE`.

So, where is `COMMAND_PACKET_SIZE` defined? Ah, it's in `ttusb_dec.c`:

```c
#define COMMAND_PACKET_SIZE	0x3c
```

The simplest fix is to just hardcode `60` in `ttusbdecfe.c`, but that's not the best approach. Really, the *correct* way to handle this, the way that will be most robust and prevent future headaches if someone expands the command set, is to change the API itself. Passing the buffer size explicitly is the "right" kernel way. It's a bit more work, but it future-proofs the code. So, let's go with the API change.

Okay, let's write down what that entails. It shouldn't be too much churn. I'll need to modify:

*   `drivers/media/usb/ttusb-dec/ttusbdecfe.h`
*   `drivers/media/usb/ttusb-dec/ttusbdecfe.c`
*   `drivers/media/usb/ttusb-dec/ttusb_dec.c`

Hold on, I should double-check and make sure that this is the only places that will need modification.



47/2 2026/08/17 21:09 tool grepper
0m Args:
map[Expression:ttusbdecfe_config PathPrefix:]

Results:
map[Output:drivers/media/usb/ttusb-dec/ttusb_dec.c=1622=static int fe_send_command(struct dvb_frontend* fe, const u8 command,
--
drivers/media/usb/ttusb-dec/ttusb_dec.c-1629-
drivers/media/usb/ttusb-dec/ttusb_dec.c:1630:static const struct ttusbdecfe_config fe_config = {
drivers/media/usb/ttusb-dec/ttusb_dec.c-1631-	.send_command = fe_send_command
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=15=struct ttusbdecfe_state {
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c-17-	/* configuration settings */
drivers/media/usb/ttusb-dec/ttusbdecfe.c:18:	const struct ttusbdecfe_config* config;
drivers/media/usb/ttusb-dec/ttusbdecfe.c-19-
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=194=static const struct dvb_frontend_ops ttusbdecfe_dvbt_ops;
drivers/media/usb/ttusb-dec/ttusbdecfe.c-195-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:196:struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config)
drivers/media/usb/ttusb-dec/ttusbdecfe.c-197-{
--
drivers/media/usb/ttusb-dec/ttusbdecfe.c=214=static const struct dvb_frontend_ops ttusbdecfe_dvbs_ops;
drivers/media/usb/ttusb-dec/ttusbdecfe.c-215-
drivers/media/usb/ttusb-dec/ttusbdecfe.c:216:struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config)
drivers/media/usb/ttusb-dec/ttusbdecfe.c-217-{
--
drivers/media/usb/ttusb-dec/ttusbdecfe.h-12-
drivers/media/usb/ttusb-dec/ttusbdecfe.h:13:struct ttusbdecfe_config
drivers/media/usb/ttusb-dec/ttusbdecfe.h-14-{
--
drivers/media/usb/ttusb-dec/ttusbdecfe.h-19-
drivers/media/usb/ttusb-dec/ttusbdecfe.h:20:extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
drivers/media/usb/ttusb-dec/ttusbdecfe.h-21-
drivers/media/usb/ttusb-dec/ttusbdecfe.h:22:extern struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config);
drivers/media/usb/ttusb-dec/ttusbdecfe.h-23-
]

48/2 2026/08/17 21:09 llm debugger
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49421
							output: 1403
							thoughts: 7485
						

Thoughts:
**Summary of Proposed Fix for Potential Buffer Overflow in ttusb-dec Driver**

Okay, so we're looking at a potential buffer overflow vulnerability in the `ttusb-dec` driver. Specifically, it's located in the `ttusb_dec_send_command()` function. The core of the problem stems from the driver not properly validating the size of the data returned by the USB device, which could lead to both an out-of-bounds read and write. We need to address this to prevent crashes and potential security risks.

Here’s the breakdown of what’s happening and the proposed solution:

The `ttusb_dec_send_command` function allocates a buffer, `b`, of size `COMMAND_PACKET_SIZE + 4` (64 bytes). This buffer is used to send commands to the USB device and receive responses via `usb_bulk_msg`. The crucial issue is that the USB device can return a data length in `b[3]` and there aren’t adequate checks in place to prevent a buffer overflow when this data is copied from the response buffer (`&b[4]`) into the provided `cmd_result` buffer. This is handled by a call to `memcpy`.

There are two main vulnerabilities:

1.  **Over-read of the `b` buffer**: The USB device can specify a data length (`b[3]`) larger than `COMMAND_PACKET_SIZE` (60 bytes) - for example 75 bytes. If that happens, then `memcpy` will attempt to read beyond the allocated 60 bytes of usable memory from `&b[4]`. This can cause a crash.
2.  **Over-write of the `cmd_result` buffer**: The caller passes a `cmd_result` buffer. Some callers may pass a buffer smaller than `COMMAND_PACKET_SIZE`, potentially causing a stack buffer overflow. A prime example is `ttusbdecfe_dvbt_read_status` in `ttusbdecfe.c`, where a small 4-byte buffer `result` is used. If `b[3]` is a value greater than 4 (but less than 60), the `memcpy` call will attempt to write more data than the buffer can hold, causing data corruption.

The most robust solution involves changing the API and adding rigorous checks. Here's what needs to be done:

1.  **API Change:** Update the `ttusbdecfe_config` struct in `drivers/media/usb/ttusb-dec/ttusbdecfe.h` by adding `cmd_result_len` to the `send_command` function pointer:
    ```c
    struct ttusbdecfe_config
    {
    	int (*send_command)(struct dvb_frontend* fe, const u8 command,
    			    int param_length, const u8 params[],
    			    int *result_length, u8 cmd_result[],
    			    int cmd_result_len);
    };
    ```

2.  **Modify `ttusb_dec_send_command()` in `ttusb_dec.c`:** Update this function to validate the data length (`b[3]`) and use the provided `cmd_result_len` to avoid buffer overflows. Also validate that a short USB message has not been sent by checking that the number of bytes returned by the USB is at least 4.
    ```c
    static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
    				  int param_length, const u8 params[],
    				  int *result_length, u8 cmd_result[],
    				  int cmd_result_len)
    {
    ...
    	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
    			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);

    	if (result) {
    		printk("%s: result bulk message failed: error %d\n",
    		       __func__, result);
    		goto err_mutex_unlock;
    	} else {
    		if (debug) {
    			printk(KERN_DEBUG "%s: result: %*ph\n",
    			       __func__, actual_len, b);
    		}

    		if (actual_len < 4) {
    			result = -EIO;
    			goto err_mutex_unlock;
    		}

    		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
    			result


49/1 2026/08/17 21:10 agent history-explorer
1m Model:
best-expensive

Instruction:
You are an experienced Linux kernel developer researching prior art for fixing a kernel bug.
You are given a bug explanation. This explanation details the root cause of the bug resulting
from debugging, but does not provide the final fix strategy. Your goal is to explore how
similar bugs were fixed in the past in the same subsystem or files.

CRITICAL: Do NOT attempt to debug the issue further or write a patch for it yourself.
Your ONLY objective is to research and provide the necessary historical context.

Use the git-log tool with the Since parameter set to "3 years" to focus on recent history.
Search for commits that address issues with similar root causes (e.g. similar missing locks,
incorrect refcounting, or similar error path bugs) in the affected files.

Your final reply must summarize your findings: what idioms, locking rules, or common patterns
should be followed when writing a fix for this bug based on how previous similar bugs were addressed.
If you find no relevant past fixes, clearly state that.

Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.

Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash is:

usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036, CPU#0: kworker/0:4/4798
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
lr : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
sp : ffff800098516d20
x29: ffff800098516d20 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: ffff800086d0a338 x21: 0000000000000000
x20: 000000000000004b x19: 000000000000003c x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
irq event stamp: 16196
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62
hardirqs last disabled at (16196): [<ffff8000868f86e0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425
softirqs last  enabled at (16128): [<ffff80008030ff18>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (16128): [<ffff80008030ff18>] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650
softirqs last disabled at (16119): [<ffff8000800204b0>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kernel BUG at lib/string_helpers.c:1044!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Tainted: G        W           syzkaller #1 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
lr : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
sp : ffff800098516d50
x29: ffff800098516d50 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: 000000000000004b x21: ffff0000d1862680
x20: 1fffe0001a30c4d0 x19: ffff0000c3014000 x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043 (P)
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
Code: d503233f a9bf7bfd 910003fd 94619ee8 (d4210000) 
---[ end trace 0000000000000000 ]---


The explanation of the root cause of the bug is:

The crash is caused by a buffer overflow (both an out-of-bounds read and an out-of-bounds write) in the `ttusb_dec_send_command()` function, triggered by a malicious or malfunctioning USB device returning an unexpectedly large payload length.

### Detailed Analysis

In `drivers/media/usb/ttusb-dec/ttusb_dec.c`, the `ttusb_dec_send_command()` function allocates a buffer `b` to send a command and receive the response via `usb_bulk_msg()`:

```c
	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
```
Here, `COMMAND_PACKET_SIZE` is defined as `0x3c` (60), so the allocated buffer `b` is exactly 64 bytes.

After receiving the response from the USB device, the driver reads the payload length directly from `b[3]` (which is fully controlled by the USB device) and copies the payload into the caller-provided `cmd_result` buffer:

```c
		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0)
			memcpy(cmd_result, &b[4], b[3]);
```

There are two major flaws in this logic:
1. **No bounds check against the received data or the allocated buffer `b`**: `b[3]` is an 8-bit value and can be up to 255. If the device returns a value greater than `COMMAND_PACKET_SIZE` (60), the `memcpy()` will read past the end of the 64-byte buffer `b`. In the syzkaller crash, `b[3]` was `75`, leading to a 75-byte read from `&b[4]` (which only has 60 bytes allocated). This triggers the `fortify_memcpy_chk` panic (`75 byte read of buffer size 60`).
2. **No bounds check against the destination buffer `cmd_result`**: The size of `cmd_result` is never passed to `ttusb_dec_send_command()`. While callers like `ttusb_dec_get_stb_state()` pass a 60-byte buffer (`u8 c[COMMAND_PACKET_SIZE]`), other callers like `ttusbdecfe_dvbt_read_status()` in `ttusbdecfe.c` pass a much smaller buffer (`u8 result[4]`). If the device returns `b[3] = 60` for the latter, it will result in a severe stack buffer overflow.

### Proposed Fix

To fix this comprehensively, the API needs to be updated to pass the size of the destination buffer, and `ttusb_dec_send_command()` must validate `b[3]` against the received length, the maximum packet size, and the destination buffer size.

**1. Update `ttusbdecfe_config` in `drivers/media/usb/ttusb-dec/ttusbdecfe.h`:**
Add `cmd_result_len` to the `send_command` callback signature.
```c
struct ttusbdecfe_config
{
	int (*send_command)(struct dvb_frontend* fe, const u8 command,
			    int param_length, const u8 params[],
			    int *result_length, u8 cmd_result[],
			    int cmd_result_len);
};
```

**2. Update `ttusb_dec_send_command()` in `ttusb_dec.c`:**
Add `cmd_result_len` to the signature and implement the necessary bounds checks.
```c
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	// ...
	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);

	if (result) {
		printk("%s: result bulk message failed: error %d\n",
		       __func__, result);
		goto err_mutex_unlock;
	} else {
		if (debug) {
			printk(KERN_DEBUG "%s: result: %*ph\n",
			       __func__, actual_len, b);
		}

		/* Ensure we received at least the 4-byte header */
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		/* Ensure the device isn't claiming more data than it sent or than fits in b */
		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];

		if (cmd_result && b[3] > 0) {
			/* Ensure we don't overflow the caller's buffer */
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
	}
	// ...
```

**3. Update all callers:**
You will need to update all callers of `ttusb_dec_send_command()` in `ttusb_dec.c` and `state->config->send_command()` in `ttusbdecfe.c` to pass the correct buffer size. 
For example:
- In `ttusb_dec_get_stb_state()`: pass `sizeof(c)` instead of just `c`.
- In `ttusbdecfe_dvbt_read_status()`: pass `sizeof(result)` instead of just `result`.
- For calls where `cmd_result` is `NULL`, simply pass `0` as the length.

Reply:
Based on a review of the recent history in the `drivers/media/usb/` and `drivers/usb/` subsystems, there are no recent commits addressing this specific type of bug in the `ttusb-dec` driver itself. However, there is extensive prior art for fixing identical root causes—trusting device-supplied length fields without validation—across other USB media and serial drivers.

### Relevant Prior Art

Similar vulnerabilities where a USB device returns a malicious or unexpectedly large length field have been fixed using the exact same principles you proposed. Notable recent examples include:

1. **`8c6314489550` ("usb: misc: usbio: bound bulk IN response length to the received transfer")**
   - **Issue:** The driver read a length field (`bpkt->len`) from the device and used it in a `memcpy()` without checking if it exceeded the actual received data or the destination buffer size, leading to a slab-out-of-bounds read.
   - **Fix:** Added explicit checks to ensure the device-supplied length did not exceed the actual received length (`act`) minus the header size.

2. **`183c1076eca4` ("USB: serial: io_ti: fix heap overflow in get_manuf_info()")**
   - **Issue:** The driver read a `Size` field from the device's EEPROM and used it to copy data into a fixed-size 10-byte buffer. A malicious device could set `Size` to a large value, causing a heap overflow.
   - **Fix:** Validated the device-provided `Size` against the expected `sizeof(struct edge_ti_manuf_descriptor)` before performing the read.

3. **`b91e6aafe8d3` ("media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100_i2c_msg()")**
   - **Issue:** An untrusted length value (`rlen`) was used in a `memcpy()` to a fixed-size buffer (`st->data`), causing an out-of-bounds write.
   - **Fix:** Added a simple `if (rlen > sizeof(st->data))` check, returning `-EINVAL` if the condition was met.

4. **`782b6a718651` ("media: uvcvideo: Fix 1-byte out-of-bounds read in uvc_parse_format()")**
   - **Issue:** The driver accessed `buffer[3]` without verifying that the actual received buffer length was at least 4 bytes.
   - **Fix:** Added a strict `if (buflen < 4)` check before accessing the payload.

### Common Patterns and Idioms for the Fix

Based on how these similar bugs were addressed, your proposed fix aligns perfectly with kernel best practices. When writing the patch, you should follow these established idioms:

1. **Never Trust Device-Provided Lengths:** Any length field originating from a USB device (in your case, `b[3]`) must be treated as untrusted user input.
2. **Double Bounds Checking:** The untrusted length must be validated against two distinct boundaries:
   - **The Source Boundary:** Ensure `b[3]` does not exceed the actual data received from the USB transfer (`actual_len - 4`). This prevents the out-of-bounds read (the `75 byte read of buffer size 60` panic).
   - **The Destination Boundary:** Ensure `b[3]` does not exceed the size of the caller-provided buffer (`cmd_result_len`). This prevents the out-of-bounds write/stack corruption.
3. **Explicit Buffer Sizing:** Passing the destination buffer size down the call stack (e.g., adding `cmd_result_len` to `ttusb_dec_send_command` and the `send_command` callback) is the standard and correct way to handle dynamic copies where the destination size varies by caller.
4. **Fail Securely:** If any bounds check fails, the driver should immediately abort the operation, unlock any held mutexes, and return an appropriate error code (e.g., `-EIO`, `-EPROTO`, or `-EMSGSIZE`). Logging a rate-limited warning or debug message is also common practice in these error paths.

50/2 2026/08/17 21:10 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9836
							output: 34
							thoughts: 353
						

Thoughts:
**My Analysis of the ttusb-dec USB Driver Bug and Research Plan**

Okay, so I've got a new bug report in `drivers/media/usb/ttusb-dec/ttusb_dec.c`. The core issue is a classic buffer overflow vulnerability in `ttusb_dec_send_command()`. The function reads an 8-bit length value (`b[3]`) from a USB bulk message response and then uses this *unvalidated* length to copy data into a caller-provided buffer (`cmd_result`). This is a huge red flag – we're essentially trusting the USB device to tell us how much data it's sending, without any sanity checks. The fix is straightforward on the surface: add a `cmd_result_len` parameter to validate the length before the copy operation. This would involve changes to `ttusb_dec_send_command` and the corresponding `send_command` callback in the `ttusbdecfe_config` struct. We need to validate `b[3]` against `COMMAND_PACKET_SIZE`, `actual_len - 4`, and `cmd_result_len`.

Now, the important part: Before I just blindly implement this fix, I need to understand the historical context of similar bugs in this part of the kernel. This is where the real work begins. The user is asking me to find "prior art" – similar bugs and their solutions. My plan is to use `git log` to dig through the git history. I'll focus on the `drivers/media/usb/ttusb-dec/` directory, looking back at the last three years of commits. I need to be on the lookout for commits that address the same *kind* of problem, even if they aren't exactly the same. I'm looking for issues related to missing or incorrect bounds checks on USB device responses, which is the crux of the problem. Also, any commits related to locking, refcounting, or other error paths in those files should be useful. That will give me a better understanding of the subsystem, and avoid repeating any fixes that have already been made.



51/2 2026/08/17 21:10 tool git-log
0m Args:
map[PathPrefix:drivers/media/usb/ttusb-dec/ Since:3 years]

Results:
map[Output:bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
1021dd010d21 media: Convert from tasklet to BH workqueue
]

52/2 2026/08/17 21:10 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10762
							output: 51
							thoughts: 126
						

Thoughts:
**USB Media Driver Security Analysis**

Okay, so I'm looking into potential vulnerabilities in the Linux kernel's media drivers, specifically within the USB subsystem. My initial focus is the `drivers/media/usb/ttusb-dec/` directory. Hmm, only three commits in the last three years there... that's a bit concerning, especially when I'm looking for buffer overflow vulnerabilities due to unchecked USB responses. And none of those commits seem to address any bounds checking issues, which is my main area of interest.

Alright, time to broaden the scope. Let's expand the search to `drivers/media/usb/` first, and if that doesn't yield enough, then maybe even the broader `drivers/media/`. The core of the problem here is untrusted data from USB devices – things like length fields, which, if not validated, could lead to a classic buffer overflow. So, I need to look for instances where the driver blindly trusts the device's response.

I'll craft a targeted search query. I need to use keywords like "bounds," "overflow," "length," "usb," "malicious," and "validate" within the `drivers/media/usb/` directory. That should hopefully uncover code sections where these issues are likely to be present. I'm hoping I can find a pattern, something that I can potentially use to automate the search.



53/2 2026/08/17 21:10 tool git-log
0m Args:
map[MessageRegexps:[(bounds|overflow|length|validate|check) usb] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:]

54/2 2026/08/17 21:10 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11244
							output: 37
							thoughts: 34
						

Thoughts:
**Investigating USB Media Driver Issues**

Okay, so I've hit a dead end. No leads from my initial query. Time to narrow the focus. Let's dig deeper into the `drivers/media/usb/` directory. That's where I suspect the problem lies, given the context. And I'm going to leverage `MessageRegexps` – that's the key. I need to be more precise in my search. My gut tells me this is likely a buffer overflow, out-of-bounds access, or a length issue within one of the USB media drivers. I'm going to search specifically for error messages containing "overflow," "bounds," or "length." This should hopefully surface some meaningful results and provide a direction for debugging. Time to refine that search and see what we get.



55/2 2026/08/17 21:10 tool git-log
0m Args:
map[MessageRegexps:[overflow] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:7e40e0bb7789 media: usbtv: Lock resolution while streaming
8deb1e2a392b media: usb: use kmalloc_array() to replace kmalloc()
4510319676bd media: pvrusb2: Use kmemdup_array instead of kmemdup for multiple allocation
8676a5e796fa media: uvcvideo: Fix integer overflow calculating timestamp
1c73d0b29d04 media: dw2102: fix a potential buffer overflow
faa4364bef2e media: stk1160: fix bounds checking in stk1160_copy_video()
]

56/2 2026/08/17 21:10 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11659
							output: 50
							thoughts: 29
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing Potential Code Commit References**

Okay, I need to investigate a couple of potentially relevant commit hashes: `1c73d0b29d04` and `faa4364bef2e`. Based on the context, I'm assuming these are commit identifiers within a version control system like Git. I should probably start by pulling up the associated diffs and logs for each. My initial hypothesis is that these hashes are related to a specific bug, feature implementation, or perhaps a refactoring effort. The next step is to examine the code changes introduced by each to determine their relevance to the task at hand. I'll be looking for keywords, function names, and any patterns in the changes that align with the problem. I'll also check the commit messages for any clues about the intention and context of these commits. It's possible, given the identifiers alone, that these relate to an internal testing environment that would require additional contextual information to assess.



57/2 2026/08/17 21:10 tool git-show
0m Args:
map[Commit:1c73d0b29d04]

Results:
map[Output:commit 1c73d0b29d04bf4082e7beb6a508895e118ee30d
Author: Mauro Carvalho Chehab <mchehab@kernel.org>
Date:   Mon Apr 29 15:15:05 2024 +0100

    media: dw2102: fix a potential buffer overflow
    
    As pointed by smatch:
             drivers/media/usb/dvb-usb/dw2102.c:802 su3000_i2c_transfer() error: __builtin_memcpy() '&state->data[4]' too small (64 vs 67)
    
    That seemss to be due to a wrong copy-and-paste.
    
    Fixes: 0e148a522b84 ("media: dw2102: Don't translate i2c read into write")
    
    Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
    Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
index 03b411ad64bb..79e2ccf974c9 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -789,7 +789,7 @@ static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 
 			if (msg[j].flags & I2C_M_RD) {
 				/* single read */
-				if (1 + msg[j].len > sizeof(state->data)) {
+				if (4 + msg[j].len > sizeof(state->data)) {
 					warn("i2c rd: len=%d is too big!\n", msg[j].len);
 					num = -EOPNOTSUPP;
 					break;
]

58/2 2026/08/17 21:10 tool git-show
0m Args:
map[Commit:faa4364bef2e]

Results:
map[Output:commit faa4364bef2ec0060de381ff028d1d836600a381
Author: Dan Carpenter <error27@gmail.com>
Date:   Mon Apr 22 12:32:44 2024 +0300

    media: stk1160: fix bounds checking in stk1160_copy_video()
    
    The subtract in this condition is reversed.  The ->length is the length
    of the buffer.  The ->bytesused is how many bytes we have copied thus
    far.  When the condition is reversed that means the result of the
    subtraction is always negative but since it's unsigned then the result
    is a very high positive value.  That means the overflow check is never
    true.
    
    Additionally, the ->bytesused doesn't actually work for this purpose
    because we're not writing to "buf->mem + buf->bytesused".  Instead, the
    math to calculate the destination where we are writing is a bit
    involved.  You calculate the number of full lines already written,
    multiply by two, skip a line if necessary so that we start on an odd
    numbered line, and add the offset into the line.
    
    To fix this buffer overflow, just take the actual destination where we
    are writing, if the offset is already out of bounds print an error and
    return.  Otherwise, write up to buf->length bytes.
    
    Fixes: 9cb2173e6ea8 ("[media] media: Add stk1160 new driver (easycap replacement)")
    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

diff --git a/drivers/media/usb/stk1160/stk1160-video.c b/drivers/media/usb/stk1160/stk1160-video.c
index 366f0e4a5dc0..e79c45db60ab 100644
--- a/drivers/media/usb/stk1160/stk1160-video.c
+++ b/drivers/media/usb/stk1160/stk1160-video.c
@@ -99,7 +99,7 @@ void stk1160_buffer_done(struct stk1160 *dev)
 static inline
 void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
 {
-	int linesdone, lineoff, lencopy;
+	int linesdone, lineoff, lencopy, offset;
 	int bytesperline = dev->width * 2;
 	struct stk1160_buffer *buf = dev->isoc_ctl.buf;
 	u8 *dst = buf->mem;
@@ -139,8 +139,13 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
 	 * Check if we have enough space left in the buffer.
 	 * In that case, we force loop exit after copy.
 	 */
-	if (lencopy > buf->bytesused - buf->length) {
-		lencopy = buf->bytesused - buf->length;
+	offset = dst - (u8 *)buf->mem;
+	if (offset > buf->length) {
+		dev_warn_ratelimited(dev->dev, "out of bounds offset\n");
+		return;
+	}
+	if (lencopy > buf->length - offset) {
+		lencopy = buf->length - offset;
 		remain = lencopy;
 	}
 
@@ -182,8 +187,13 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
 		 * Check if we have enough space left in the buffer.
 		 * In that case, we force loop exit after copy.
 		 */
-		if (lencopy > buf->bytesused - buf->length) {
-			lencopy = buf->bytesused - buf->length;
+		offset = dst - (u8 *)buf->mem;
+		if (offset > buf->length) {
+			dev_warn_ratelimited(dev->dev, "offset out of bounds\n");
+			return;
+		}
+		if (lencopy > buf->length - offset) {
+			lencopy = buf->length - offset;
 			remain = lencopy;
 		}
 
]

59/2 2026/08/17 21:10 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13716
							output: 27
							thoughts: 231
						

Thoughts:
**Analyzing the Request and Refining My Search**

Okay, so I'm trying to find commits in related areas that might address similar issues to the ones I'm troubleshooting. The initial thought was to search for overly large lengths returned by USB devices, which are often corrected with `if (len > sizeof(buf))` checks, but that feels a bit too specific, even though it's a good starting point. I considered expanding the search to terms like "buffer overflow," "bounds," or "malicious" within `drivers/media/usb/` and `drivers/usb/`.

Wait a minute, the user's instructions were much more targeted: they want commits addressing *similar root causes* (missing locks, incorrect refcounting, error path bugs) *within the affected files*. Crucially, they specified *affected files* meaning I should not expand the search beyond the specific files in question.

I've already checked the git log for `drivers/media/usb/ttusb-dec/` but only with a three-year window, which didn't turn up anything promising. So, let me double-check the git log *without* that time restriction, just to make sure I haven't missed older, potentially relevant commits. Sometimes those older ones can provide the historical context needed to identify a common pattern or a similar fix implemented in the past. It is critical that I remember the context, and stick to the affected files, even if I start to get broader ideas.



60/2 2026/08/17 21:10 tool git-log
0m Args:
map[PathPrefix:drivers/media/usb/ttusb-dec/]

Results:
map[Output:bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
1021dd010d21 media: Convert from tasklet to BH workqueue
da9b2c59743d media: ttusb-dec: remove unnecessary (void*) conversions
eff540df5f80 media: usb: remove unnecessary (void*) conversions
517a28133832 media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
36b9d695aa6f media: ttusb-dec: avoid release of non-acquired mutex
dba328bab4c6 media: ttusb-dec: cleanup an error handling logic
c3bf67e80532 media: media/usb:Remove superfluous "breaks" in the ttusb_dec.c
f3b60b066a5b media: ttusb-dec: convert tasklets to use new tasklet_setup() API
]

61/2 2026/08/17 21:10 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14564
							output: 45
							thoughts: 37
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing Potential USB Driver Vulnerabilities**

Alright, let's get down to brass tacks. I'm taking a look at the `drivers/media/usb/ttusb-dec/` directory. My immediate concern, as always, is memory safety, specifically in a USB driver. These are often juicy targets for exploits. So, I need to see if there's been any past work done in this area, any previous commits that might have touched upon potential overflow scenarios or bounds checking issues related to data lengths. I'm thinking I need to search through the commit history for that directory. I'll search for mentions of "overflow," "bounds," or "length." This should give me a good starting point for assessing the codebase's current state and identifying any previously addressed problems or, more critically, any potential regressions or lingering vulnerabilities. If I find any, I can then dive deeper into those commits and related code to understand the context and how the issues were addressed or weren't. This quick search is a good way to see if there are any obvious red flags I might otherwise miss.



62/2 2026/08/17 21:10 tool git-log
0m Args:
map[MessageRegexps:[(overflow|bounds|length|validate|check)] PathPrefix:drivers/media/usb/ttusb-dec/]

Results:
map[Output:]

63/2 2026/08/17 21:10 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14905
							output: 47
							thoughts: 292
						

Thoughts:
**My Approach to Bug Analysis**

Okay, so the user wants me to delve into past fixes for similar bugs. Let me make sure I understand the task correctly. It's about finding common patterns, idioms, or locking rules used to resolve issues related to a specific subsystem or files. The core of the exercise is to explore how similar bugs have been fixed in the past to inform how a new bug should be resolved. The user wants me to use `git-log` with a "3 years" time window. The affected file seems to be in `drivers/media/usb/ttusb-dec/`, but I haven't found any relevant past fixes there.

Now, because I found nothing in the target file, I will search the surrounding subsystems: `drivers/media/usb/`, `drivers/media/`, and `drivers/usb/`. Since the user emphasized similar *root causes*, I should look for commits related to things like "buffer overflow," "malicious" input, issues with "bounds" checking, or problems with "length" handling. These seem like likely areas where similar problems could arise. I'll focus on these keywords in my search of the last three years of commit history.



64/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[(overflow|bounds|length|validate|check)] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:]

65/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15509
							output: 74
							thoughts: 105
						

Thoughts:
**Debugging a Code Search Query**

Okay, so I was expecting some results back when I broadened my search, but I'm getting nothing back! That's odd. I initially searched for "overflow" within the `drivers/media/usb/` directory, and that worked fine. Now, I tried a more general regex with `(overflow|bounds|length|validate|check)` and got zilch. Something's clearly wrong with the way I'm constructing this query.

My first thought is that the regex engine in this tool might not support the OR operator, the pipe `|`. Or, perhaps it interprets the list within `MessageRegexps` as AND, rather than OR. That would explain the behavior. The correct syntax might be to have multiple `MessageRegexps` entries, one for each keyword I'm looking for.

I'll try running the searches separately, one for "overflow" and then one for "bounds". That should isolate the issue and confirm whether it is an operator issue.



66/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[bounds] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:7c39f48568e0 media: uvcvideo: Fix bug in error path of uvc_alloc_urb_buffers
b91e6aafe8d3 media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100_i2c_msg()
aef89c0b2417 media: gspca: Add bounds checking to firmware parser
782b6a718651 media: uvcvideo: Fix 1-byte out-of-bounds read in uvc_parse_format()
ecf2b43018da media: uvcvideo: Skip parsing frames of type UVC_VS_UNDEFINED in uvc_parse_format
faa4364bef2e media: stk1160: fix bounds checking in stk1160_copy_video()
099be1822d1f media: gspca: cpia1: shift-out-of-bounds in set_flicker
]

67/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[length] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:f0487a90b2c5 media: uvcvideo: UVC minimum relative pan/tilt/zoom speed fix.
1a31cb278210 media: dvb-usb: pctv452e: move snd/rcv len check before kmalloc
bda2859bff0b media: uvcvideo: Do not mark valid metadata as invalid
aef89c0b2417 media: gspca: Add bounds checking to firmware parser
b5ae5a79825b media: usb: hdpvr: disable zero-length read messages
782b6a718651 media: uvcvideo: Fix 1-byte out-of-bounds read in uvc_parse_format()
53b0b80e5240 media: uvcvideo: Add quirk for HP Webcam HD 2300
8c54e58f94ed media: uvcvideo: Add quirk for Actions UVC05
b2ec92bb5605 media: uvcvideo: Add a quirk for the Kaiweets KTI-W02 infrared camera
8676a5e796fa media: uvcvideo: Fix integer overflow calculating timestamp
]

68/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16456
							output: 51
							thoughts: 31
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing Potential Artifacts**

Okay, so I'm diving into these two identifiers: `b91e6aafe8d3` and `1a31cb278210`. Immediately, my mind starts sifting through possibilities. Are these commit hashes? File identifiers? Object IDs from a database? The format suggests a hexadecimal representation, which is common in a variety of contexts – could be version control, checksums, or cryptographic keys. I need more context to understand their significance, but they're definitely drawing my attention. This is where the real work begins. I'm mentally starting to build a mental map of what system they might be associated with.



69/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:b91e6aafe8d3]

Results:
map[Output:commit b91e6aafe8d356086cc621bc03e35ba2299e4788
Author: Jeongjun Park <aha310510@gmail.com>
Date:   Mon Apr 21 21:52:44 2025 +0900

    media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100_i2c_msg()
    
    rlen value is a user-controlled value, but dtv5100_i2c_msg() does not
    check the size of the rlen value. Therefore, if it is set to a value
    larger than sizeof(st->data), an out-of-bounds vuln occurs for st->data.
    
    Therefore, we need to add proper range checking to prevent this vuln.
    
    Fixes: 60688d5e6e6e ("V4L/DVB (8735): dtv5100: replace dummy frontend by zl10353")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jeongjun Park <aha310510@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

diff --git a/drivers/media/usb/dvb-usb/dtv5100.c b/drivers/media/usb/dvb-usb/dtv5100.c
index 3d85c6f7f6ec..c448e2ebda1a 100644
--- a/drivers/media/usb/dvb-usb/dtv5100.c
+++ b/drivers/media/usb/dvb-usb/dtv5100.c
@@ -55,6 +55,11 @@ static int dtv5100_i2c_msg(struct dvb_usb_device *d, u8 addr,
 	}
 	index = (addr << 8) + wbuf[0];
 
+	if (rlen > sizeof(st->data)) {
+		warn("rlen = %x is too big!\n", rlen);
+		return -EINVAL;
+	}
+
 	memcpy(st->data, rbuf, rlen);
 	msleep(1); /* avoid I2C errors */
 	return usb_control_msg(d->udev, pipe, request,
]

70/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:1a31cb278210]

Results:
map[Output:commit 1a31cb2782104969e48c7ce7e4fc06e403fcb5cf
Author: Edward Adam Davis <eadavis@qq.com>
Date:   Mon Nov 3 19:57:49 2025 +0800

    media: dvb-usb: pctv452e: move snd/rcv len check before kmalloc
    
    syzbot reported a uninit-value in pctv452e_i2c_msg. [1]
    
    When the snd_len or rcv_len check fails and jumps to failed, buf is
    uninitialized, triggering the uninit-value issue.
    
    Move the snd/rcv length check before kmalloc, and return -EINVAL directly
    if the condition is met.
    
    [1]
    BUG: KMSAN: uninit-value in hex_string+0x681/0x740 lib/vsprintf.c:1220
     pctv452e_i2c_msg+0x82a/0x8f0 drivers/media/usb/dvb-usb/pctv452e.c:467
     pctv452e_i2c_xfer+0x2e6/0x4c0 drivers/media/usb/dvb-usb/pctv452e.c:502
    
    Reported-by: syzbot+480edd2cadb85ddb4bbe@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=480edd2cadb85ddb4bbe
    Signed-off-by: Edward Adam Davis <eadavis@qq.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

diff --git a/drivers/media/usb/dvb-usb/pctv452e.c b/drivers/media/usb/dvb-usb/pctv452e.c
index 5094de9a312e..bc7a224d829e 100644
--- a/drivers/media/usb/dvb-usb/pctv452e.c
+++ b/drivers/media/usb/dvb-usb/pctv452e.c
@@ -422,16 +422,15 @@ static int pctv452e_i2c_msg(struct dvb_usb_device *d, u8 addr,
 	u8 id;
 	int ret;
 
+	if (snd_len > 64 - 7 || rcv_len > 64 - 7)
+		return -EINVAL;
+
 	buf = kmalloc(64, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
 
 	id = state->c++;
 
-	ret = -EINVAL;
-	if (snd_len > 64 - 7 || rcv_len > 64 - 7)
-		goto failed;
-
 	buf[0] = SYNC_BYTE_OUT;
 	buf[1] = id;
 	buf[2] = PCTV_CMD_I2C;
]

71/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18142
							output: 78
							thoughts: 42
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating USB Media Driver Command Handling**

Alright, time to dig into this. I'm thinking, "result_length," "cmd_result," and "send_command" – those are pretty common naming conventions in driver code, particularly when dealing with the kind of USB media communication I'm familiar with. I'm going to leverage that by focusing my search within the `drivers/media/usb/` directory. That's the logical place to start looking for other instances of this pattern. The goal is to see how other USB media drivers handle similar command and result processing, looking for established paradigms or potential code reuse that might be helpful or concerning. It's a targeted hunt for relevant code segments to gain broader context for whatever I'm currently working on.



72/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[send_command] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:]

73/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[cmd_result] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:]

74/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18468
							output: 80
							thoughts: 43
						

Thoughts:
Okay, here's my summary, taking on the persona you requested:

**Digging into Potential USB Driver Vulnerabilities**

Alright, time to get my hands dirty. I need to take a look at the `drivers/media/usb/` directory. Given my experience, I'm thinking the best starting point to find potential issues related to length vulnerabilities would be to search for two keywords: `"actual_len"` and `"usb_bulk_msg"`. I'm specifically looking for any instances where `actual_len` – the actual number of bytes transferred in a USB bulk transfer – isn't being properly checked against the expected length or some reasonable bounds. Bulk transfers are a common attack vector, and a missing or improper check on `actual_len` could easily lead to a buffer overflow or other memory corruption issues. It is a reasonable heuristic based on my experience and it is likely a good strategy to start with those keywords. I need to see if any of the drivers in this area are making assumptions or skipping crucial validation steps. Let's see what we can find.



75/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[actual_len] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:]

76/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[usb_bulk_msg] PathPrefix:drivers/media/usb/ Since:3 years]

Results:
map[Output:73fb3b92da84 media: cxusb: no longer judge rbuf when the write fails
2052138b7da5 media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
]

77/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18898
							output: 51
							thoughts: 31
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing Potential Code Components**

Okay, let's dive in. My initial focus is on these two identifiers: `73fb3b92da84` and `2052138b7da5`. Without more context, these strongly suggest either version control commit hashes (highly likely), or perhaps, unique identifiers generated by some system. My immediate instinct is to cross-reference them with the version control history, especially if we have access to the repository. The hexadecimal format certainly supports that assumption.

Depending on the project structure, I will examine the surrounding code context. I'll check for relationships, dependencies, and any significant events tied to these IDs. Are they associated with bug fixes, feature additions, performance improvements, or regressions? Are there any patterns with regard to which components have been altered, and at what points in the project's lifespan? I'll probably start with a `git log -p` or similar, depending on the tooling in place. Understanding the timeline and changes associated with each ID will inform what I do next.



78/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:73fb3b92da84]

Results:
map[Output:commit 73fb3b92da84637e3817580fa205d48065924e15
Author: Edward Adam Davis <eadavis@qq.com>
Date:   Sat Apr 5 19:56:41 2025 +0800

    media: cxusb: no longer judge rbuf when the write fails
    
    syzbot reported a uninit-value in cxusb_i2c_xfer. [1]
    
    Only when the write operation of usb_bulk_msg() in dvb_usb_generic_rw()
    succeeds and rlen is greater than 0, the read operation of usb_bulk_msg()
    will be executed to read rlen bytes of data from the dvb device into the
    rbuf.
    
    In this case, although rlen is 1, the write operation failed which resulted
    in the dvb read operation not being executed, and ultimately variable i was
    not initialized.
    
    [1]
    BUG: KMSAN: uninit-value in cxusb_gpio_tuner drivers/media/usb/dvb-usb/cxusb.c:124 [inline]
    BUG: KMSAN: uninit-value in cxusb_i2c_xfer+0x153a/0x1a60 drivers/media/usb/dvb-usb/cxusb.c:196
     cxusb_gpio_tuner drivers/media/usb/dvb-usb/cxusb.c:124 [inline]
     cxusb_i2c_xfer+0x153a/0x1a60 drivers/media/usb/dvb-usb/cxusb.c:196
     __i2c_transfer+0xe25/0x3150 drivers/i2c/i2c-core-base.c:-1
     i2c_transfer+0x317/0x4a0 drivers/i2c/i2c-core-base.c:2315
     i2c_transfer_buffer_flags+0x125/0x1e0 drivers/i2c/i2c-core-base.c:2343
     i2c_master_send include/linux/i2c.h:109 [inline]
     i2cdev_write+0x210/0x280 drivers/i2c/i2c-dev.c:183
     do_loop_readv_writev fs/read_write.c:848 [inline]
     vfs_writev+0x963/0x14e0 fs/read_write.c:1057
     do_writev+0x247/0x5c0 fs/read_write.c:1101
     __do_sys_writev fs/read_write.c:1169 [inline]
     __se_sys_writev fs/read_write.c:1166 [inline]
     __x64_sys_writev+0x98/0xe0 fs/read_write.c:1166
     x64_sys_call+0x2229/0x3c80 arch/x86/include/generated/asm/syscalls_64.h:21
     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
     do_syscall_64+0xcd/0x1e0 arch/x86/entry/syscall_64.c:94
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Reported-by: syzbot+526bd95c0ec629993bf3@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=526bd95c0ec629993bf3
    Tested-by: syzbot+526bd95c0ec629993bf3@syzkaller.appspotmail.com
    Fixes: 22c6d93a7310 ("[PATCH] dvb: usb: support Medion hybrid USB2.0 DVB-T/analogue box")
    Cc: stable@vger.kernel.org
    Signed-off-by: Edward Adam Davis <eadavis@qq.com>
    Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
index f44529b40989..d0501c1e81d6 100644
--- a/drivers/media/usb/dvb-usb/cxusb.c
+++ b/drivers/media/usb/dvb-usb/cxusb.c
@@ -119,9 +119,8 @@ static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff)
 
 	o[0] = GPIO_TUNER;
 	o[1] = onoff;
-	cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
 
-	if (i != 0x01)
+	if (!cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1) && i != 0x01)
 		dev_info(&d->udev->dev, "gpio_write failed.\n");
 
 	st->gpio_write_state[GPIO_TUNER] = onoff;
]

79/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:2052138b7da5]

Results:
map[Output:commit 2052138b7da52ad5ccaf74f736d00f39a1c9198c
Author: Zheng Yejian <zhengyejian1@huawei.com>
Date:   Thu May 9 20:44:14 2024 +0800

    media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
    
    Infinite log printing occurs during fuzz test:
    
      rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
      ...
      dvb-usb: schedule remote query interval to 100 msecs.
      dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
      dvb-usb: bulk message failed: -22 (1/0)
      dvb-usb: bulk message failed: -22 (1/0)
      dvb-usb: bulk message failed: -22 (1/0)
      ...
      dvb-usb: bulk message failed: -22 (1/0)
    
    Looking into the codes, there is a loop in dvb_usb_read_remote_control(),
    that is in rc_core_dvb_usb_remote_init() create a work that will call
    dvb_usb_read_remote_control(), and this work will reschedule itself at
    'rc_interval' intervals to recursively call dvb_usb_read_remote_control(),
    see following code snippet:
    
      rc_core_dvb_usb_remote_init() {
        ...
        INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control);
        schedule_delayed_work(&d->rc_query_work,
                              msecs_to_jiffies(rc_interval));
        ...
      }
    
      dvb_usb_read_remote_control() {
        ...
        err = d->props.rc.core.rc_query(d);
        if (err)
          err(...)  // Did not return even if query failed
        schedule_delayed_work(&d->rc_query_work,
                              msecs_to_jiffies(rc_interval));
      }
    
    When the infinite log printing occurs, the query callback
    'd->props.rc.core.rc_query' is cxusb_rc_query(). And the log is due to
    the failure of finding a valid 'generic_bulk_ctrl_endpoint'
    in usb_bulk_msg(), see following code snippet:
    
      cxusb_rc_query() {
        cxusb_ctrl_msg() {
          dvb_usb_generic_rw() {
            ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev,
                               d->props.generic_bulk_ctrl_endpoint),...);
            if (ret)
              err("bulk message failed: %d (%d/%d)",ret,wlen,actlen);
              ...
          }
      ...
      }
    
    By analyzing the corresponding USB descriptor, it shows that the
    bNumEndpoints is 0 in its interface descriptor, but
    the 'generic_bulk_ctrl_endpoint' is 1, that means user don't configure
    a valid endpoint for 'generic_bulk_ctrl_endpoint', therefore this
    'invalid' USB device should be rejected before it calls into
    dvb_usb_read_remote_control().
    
    To fix it, we need to add endpoint check for 'generic_bulk_ctrl_endpoint'.
    And as Sean suggested, the same check and clear halts should be done for
    'generic_bulk_ctrl_endpoint_response'. So introduce
    dvb_usb_check_bulk_endpoint() to do it for both of them.
    
    Fixes: 4d43e13f723e ("V4L/DVB (4643): Multi-input patch for DVB-USB device")
    Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
index fbf58012becd..22d83ac18eb7 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
@@ -23,11 +23,40 @@ static int dvb_usb_force_pid_filter_usage;
 module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
 MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
 
+static int dvb_usb_check_bulk_endpoint(struct dvb_usb_device *d, u8 endpoint)
+{
+	if (endpoint) {
+		int ret;
+
+		ret = usb_pipe_type_check(d->udev, usb_sndbulkpipe(d->udev, endpoint));
+		if (ret)
+			return ret;
+		ret = usb_pipe_type_check(d->udev, usb_rcvbulkpipe(d->udev, endpoint));
+		if (ret)
+			return ret;
+	}
+	return 0;
+}
+
+static void dvb_usb_clear_halt(struct dvb_usb_device *d, u8 endpoint)
+{
+	if (endpoint) {
+		usb_clear_halt(d->udev, usb_sndbulkpipe(d->udev, endpoint));
+		usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, endpoint));
+	}
+}
+
 static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
 {
 	struct dvb_usb_adapter *adap;
 	int ret, n, o;
 
+	ret = dvb_usb_check_bulk_endpoint(d, d->props.generic_bulk_ctrl_endpoint);
+	if (ret)
+		return ret;
+	ret = dvb_usb_check_bulk_endpoint(d, d->props.generic_bulk_ctrl_endpoint_response);
+	if (ret)
+		return ret;
 	for (n = 0; n < d->props.num_adapters; n++) {
 		adap = &d->adapter[n];
 		adap->dev = d;
@@ -103,10 +132,8 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
 	 * when reloading the driver w/o replugging the device
 	 * sometimes a timeout occurs, this helps
 	 */
-	if (d->props.generic_bulk_ctrl_endpoint != 0) {
-		usb_clear_halt(d->udev, usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint));
-		usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint));
-	}
+	dvb_usb_clear_halt(d, d->props.generic_bulk_ctrl_endpoint);
+	dvb_usb_clear_halt(d, d->props.generic_bulk_ctrl_endpoint_response);
 
 	return 0;
 
]

80/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22578
							output: 60
							thoughts: 37
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Investigating Potential USB Driver Vulnerabilities**

Alright, I need to expand my search. The recent analysis in `drivers/media/usb/` highlighted some interesting issues related to "bounds" and "overflow," but I'm feeling there might be more to uncover. I'm going to broaden my search in that directory, removing any artificial date restrictions. I want to see a comprehensive picture, not just the last three years. This broader scope should reveal if these problems are isolated incidents or represent a recurring pattern within the USB media driver codebase. The absence of a time limit is crucial for identifying any latent vulnerabilities that might have been present for an extended duration. This comprehensive search could reveal historical issues.



81/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[bounds] PathPrefix:drivers/media/usb/]

Results:
map[Output:7c39f48568e0 media: uvcvideo: Fix bug in error path of uvc_alloc_urb_buffers
b91e6aafe8d3 media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100_i2c_msg()
aef89c0b2417 media: gspca: Add bounds checking to firmware parser
782b6a718651 media: uvcvideo: Fix 1-byte out-of-bounds read in uvc_parse_format()
ecf2b43018da media: uvcvideo: Skip parsing frames of type UVC_VS_UNDEFINED in uvc_parse_format
faa4364bef2e media: stk1160: fix bounds checking in stk1160_copy_video()
099be1822d1f media: gspca: cpia1: shift-out-of-bounds in set_flicker
389b6a226188 media: usb: pwc-uncompress: Use flex array destination for memcpy()
471bec68457a media: pvrusb2: fix array-index-out-of-bounds in pvr2_i2c_core_init
171994e498a0 media: uvcvideo: Silence shift-out-of-bounds warning
]

82/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[overflow] PathPrefix:drivers/media/usb/]

Results:
map[Output:7e40e0bb7789 media: usbtv: Lock resolution while streaming
8deb1e2a392b media: usb: use kmalloc_array() to replace kmalloc()
4510319676bd media: pvrusb2: Use kmemdup_array instead of kmemdup for multiple allocation
8676a5e796fa media: uvcvideo: Fix integer overflow calculating timestamp
1c73d0b29d04 media: dw2102: fix a potential buffer overflow
faa4364bef2e media: stk1160: fix bounds checking in stk1160_copy_video()
b83921298857 media: uvcvideo: Silence memcpy() run-time false positive warnings
1c8af8e93748 media: uvcvideo: Fix bit overflow in uvc_probe_video
dca4f5fdbcd7 media: usb: pwc-uncompress: Use struct_size() helper in pwc_decompress()
f7b77ebe6d2f media: dib0700: fix undefined behavior in tuner shutdown
]

83/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 23476
							output: 53
							thoughts: 32
						

Thoughts:
Here's my take on those thought processes:

**Quick Scan of Those Hashes**

Right, let's just make sure I'm on the right track with this. My immediate thought is to take a look at `aef89c0b2417` and `782b6a718651`. Nothing too in-depth, just a quick visual check. Based on the context and the potential source of these hashes, my expert intuition is that I should be able to deduce the nature of these elements with a little effort. Let's see if they're in the expected form.



84/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:aef89c0b2417]

Results:
map[Output:commit aef89c0b2417da79cb2062a95476288f9f203ab0
Author: Dan Carpenter <error27@gmail.com>
Date:   Wed May 28 23:22:14 2025 +0300

    media: gspca: Add bounds checking to firmware parser
    
    This sd_init() function reads the firmware.  The firmware data holds a
    series of records and the function reads each record and sends the data
    to the device.  The request_ihex_firmware() function
    calls ihex_validate_fw() which ensures that the total length of all the
    records won't read out of bounds of the fw->data[].
    
    However, a potential issue is if there is a single very large
    record (larger than PAGE_SIZE) and that would result in memory
    corruption.  Generally we trust the firmware, but it's always better to
    double check.
    
    Fixes: 49b61ec9b5af ("[media] gspca: Add new vicam subdriver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

diff --git a/drivers/media/usb/gspca/vicam.c b/drivers/media/usb/gspca/vicam.c
index d98343fd33fe..91e177aa8136 100644
--- a/drivers/media/usb/gspca/vicam.c
+++ b/drivers/media/usb/gspca/vicam.c
@@ -227,6 +227,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
 	const struct ihex_binrec *rec;
 	const struct firmware *fw;
 	u8 *firmware_buf;
+	int len;
 
 	ret = request_ihex_firmware(&fw, VICAM_FIRMWARE,
 				    &gspca_dev->dev->dev);
@@ -241,9 +242,14 @@ static int sd_init(struct gspca_dev *gspca_dev)
 		goto exit;
 	}
 	for (rec = (void *)fw->data; rec; rec = ihex_next_binrec(rec)) {
-		memcpy(firmware_buf, rec->data, be16_to_cpu(rec->len));
+		len = be16_to_cpu(rec->len);
+		if (len > PAGE_SIZE) {
+			ret = -EINVAL;
+			break;
+		}
+		memcpy(firmware_buf, rec->data, len);
 		ret = vicam_control_msg(gspca_dev, 0xff, 0, 0, firmware_buf,
-					be16_to_cpu(rec->len));
+					len);
 		if (ret < 0)
 			break;
 	}
]

85/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:782b6a718651]

Results:
map[Output:commit 782b6a718651eda3478b1824b37a8b3185d2740c
Author: Youngjun Lee <yjjuny.lee@samsung.com>
Date:   Tue Jun 10 21:41:07 2025 +0900

    media: uvcvideo: Fix 1-byte out-of-bounds read in uvc_parse_format()
    
    The buffer length check before calling uvc_parse_format() only ensured
    that the buffer has at least 3 bytes (buflen > 2), buf the function
    accesses buffer[3], requiring at least 4 bytes.
    
    This can lead to an out-of-bounds read if the buffer has exactly 3 bytes.
    
    Fix it by checking that the buffer has at least 4 bytes in
    uvc_parse_format().
    
    Signed-off-by: Youngjun Lee <yjjuny.lee@samsung.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Fixes: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver")
    Cc: stable@vger.kernel.org
    Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
    Link: https://lore.kernel.org/r/20250610124107.37360-1-yjjuny.lee@samsung.com
    Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 916c2d13e268..62eb45435d8b 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -344,6 +344,9 @@ static int uvc_parse_format(struct uvc_device *dev,
 	u8 ftype;
 	int ret;
 
+	if (buflen < 4)
+		return -EINVAL;
+
 	format->type = buffer[2];
 	format->index = buffer[3];
 	format->frames = frames;
]

86/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25133
							output: 70
							thoughts: 35
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert in the field:

**Hunting for USB Response Vulnerabilities**

Alright, time to dig into those USB drivers again. I'm thinking, let's zero in on potential vulnerabilities related to handling USB responses. I need to see if we've missed any edge cases. Specifically, I'm going to search the `drivers/usb/` directory. The key terms I'm using as a starting point are "bounds" and "overflow." That should quickly surface instances where developers might have neglected to properly check the sizes of incoming data or the capacity of buffers when processing USB data. I'm hoping to find more examples of patches or fixes that explicitly address missing bounds checks and data overflow issues on the USB response side. A proactive approach here is always better than chasing down obscure crashes later on.



87/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[bounds] PathPrefix:drivers/usb/ Since:3 years]

Results:
map[Output:6b1c8a9403a2 usb: gadget: f_ncm: Use unsigned int for ndp_index
71132cedd1ec usb: atm: ueagle-atm: reject descriptors that confuse probe and disconnect
d5e5cd3654d2 usb: gadget: dummy_hcd: prevent fifo_req reuse during giveback
1febec7e47cd usb: gadget: f_ncm: validate datagram bounds in ncm_unwrap_ntb()
8c6314489550 usb: misc: usbio: bound bulk IN response length to the received transfer
7b681dd5fbf6 usb: typec: tcpm: Validate SVID index in svdm_consume_modes()
96d47e40bf9d USB: serial: kl5kusb105: fix bulk-out buffer overflow
183c1076eca4 USB: serial: io_ti: fix heap overflow in get_manuf_info()
9f9bfc80c67f USB: serial: cypress_m8: validate interrupt packet headers
cff06b03b530 usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control()
]

88/2 2026/08/17 21:11 tool git-log
0m Args:
map[MessageRegexps:[overflow] PathPrefix:drivers/usb/ Since:3 years]

Results:
map[Output:6b1c8a9403a2 usb: gadget: f_ncm: Use unsigned int for ndp_index
96d47e40bf9d USB: serial: kl5kusb105: fix bulk-out buffer overflow
0fd2b00b2d3d USB: serial: io_ti: fix heap overflow in build_i2c_fw_hdr()
183c1076eca4 USB: serial: io_ti: fix heap overflow in get_manuf_info()
727d045d064b usb: core: Fix up Interrupt IN endpoints with bogus wBytesPerInterval
8f993d30b95d usb: gadget: f_ncm: validate minimum block_len in ncm_unwrap_ntb()
c088d5dd2fff usb: gadget: f_phonet: fix skb frags[] overflow in pn_rx_complete()
2ab833a16a82 usbip: validate number_of_packets in usbip_pack_ret_submit()
1897852293fa usb: usbip: fix integer overflow in usbip_recv_iso()
8479891d1f04 usb: gadget: f_mass_storage: Fix potential integer overflow in check_command_size_in_blocks()
]

89/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26061
							output: 52
							thoughts: 31
						

Thoughts:
Okay, let's dive into this. I need to take a look at these two identifiers: `8c6314489550` and `183c1076eca4`. My intuition suggests they're related, probably in close proximity to one another. I need to determine their context and function within the system. I'll need to identify what these might be referencing within the project – might they be database keys, file hashes, commit IDs, object identifiers, or something else entirely? The format suggests some sort of key or identifier, so I'll start with that assumption. I'll need to quickly correlate these with any recent activity or error logs. I'm going to start by pulling up my tools, logs and databases and see what information I can get.



90/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:8c6314489550]

Results:
map[Output:commit 8c6314489550fa81d41723a0ff33f655b5b6c7b6
Author: HE WEI (ギカク) <skyexpoc@gmail.com>
Date:   Wed Jun 24 18:09:52 2026 +0900

    usb: misc: usbio: bound bulk IN response length to the received transfer
    
    usbio_bulk_msg() copies bpkt_len = le16_to_cpu(bpkt->len) bytes out of
    the bulk IN buffer (usbio->rxbuf, allocated with size usbio->rxbuf_len)
    into the caller's buffer.  bpkt_len is fully controlled by the device
    and is only checked against ibuf_len; ibuf_len in turn is checked
    against usbio->txbuf_len, not against rxbuf_len:
    
            if ((obuf_len > (usbio->txbuf_len - sizeof(*bpkt))) ||
                (ibuf_len > (usbio->txbuf_len - sizeof(*bpkt))))
                    return -EMSGSIZE;
    
    txbuf_len and rxbuf_len are taken independently from the bulk OUT and
    bulk IN endpoint wMaxPacketSize in usbio_probe().  A malicious or
    malfunctioning device that advertises a large bulk OUT endpoint and a
    small bulk IN endpoint (e.g. by claiming one of the quirk-free IDs such
    as the Lattice NX33U, 0x2ac1:0x20cb) therefore makes ibuf_len, and
    hence the device-supplied bpkt_len, exceed rxbuf_len.  memcpy() then
    reads up to txbuf_len - rxbuf_len bytes past the end of the rxbuf slab
    object.  The over-read bytes are handed back to the i2c layer and on to
    user space through i2c-dev, disclosing adjacent slab memory; with KASAN
    this is reported as a slab-out-of-bounds read.
    
    The number of bytes actually received is already known: act equals the
    URB actual_length and is bounded by rxbuf_len.  Reject any response
    that claims more payload than was received, mirroring the existing
    "act < sizeof(*bpkt)" check just above.
    
    The control path (usbio_ctrl_msg()) is not affected: it uses a single
    buffer (ctrlbuf) for both directions, so its analogous copy can never
    leave the allocation.
    
    Found by code review.  The out-of-bounds read was confirmed under
    AddressSanitizer with a faithful userspace model of usbio_bulk_msg()'s
    receive path (an rxbuf_len-sized buffer, the same act/ibuf_len/bpkt_len
    checks and the memcpy).  A USB raw-gadget + dummy_hcd reproducer is
    also available.
    
    Fixes: 121a0f839dbb ("usb: misc: Add Intel USBIO bridge driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: HE WEI (ギカク) <skyexpoc@gmail.com>
    Link: https://patch.msgid.link/20260624090952.86439-1-skyexpoc@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

diff --git a/drivers/usb/misc/usbio.c b/drivers/usb/misc/usbio.c
index 02d1e0760f0c..24c4cd0df829 100644
--- a/drivers/usb/misc/usbio.c
+++ b/drivers/usb/misc/usbio.c
@@ -344,6 +344,10 @@ int usbio_bulk_msg(struct auxiliary_device *adev, u8 type, u8 cmd, bool last,
 	if (ibuf_len < bpkt_len)
 		return -ENOSPC;
 
+	/* The device must not claim more payload than it actually sent. */
+	if (bpkt_len > act - sizeof(*bpkt))
+		return -EPROTO;
+
 	memcpy(ibuf, bpkt->data, bpkt_len);
 
 	return bpkt_len;
]

91/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:183c1076eca4]

Results:
map[Output:commit 183c1076eca43bbb3e7bdf597456f91d81c73e74
Author: Adrian Korwel <adriank20047@gmail.com>
Date:   Mon May 25 09:58:31 2026 -0500

    USB: serial: io_ti: fix heap overflow in get_manuf_info()
    
    get_manuf_info() reads le16_to_cpu(rom_desc->Size) bytes from the
    device I2C EEPROM into a buffer allocated with kmalloc_obj(), which
    is sizeof(struct edge_ti_manuf_descriptor) = 10 bytes.
    
    The Size field comes from the device and is only validated (in
    check_i2c_image()) to make sure the descriptor fits within
    TI_MAX_I2C_SIZE (16384 bytes), not against the destination buffer size.
    A malicious USB device can therefore set Size to any value up to 16377,
    causing a heap overflow of up to 16367 bytes when plugged into a host
    running this driver.
    
    valid_csum() is called after read_rom() and also iterates
    buffer[0..Size-1], compounding the out-of-bounds access.
    
    Fix by rejecting descriptors with unexpected length before calling
    read_rom().
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Adrian Korwel <adriank20047@gmail.com>
    [ johan: amend commit message; also check for short descriptors ]
    Signed-off-by: Johan Hovold <johan@kernel.org>

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index cb55370e036f..6e0d4c38911b 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -773,6 +773,12 @@ static int get_manuf_info(struct edgeport_serial *serial, u8 *buffer)
 	}
 
 	/* Read the descriptor data */
+	if (le16_to_cpu(rom_desc->Size) != sizeof(struct edge_ti_manuf_descriptor)) {
+		dev_err(dev, "unexpected Edge descriptor length: %u\n",
+			le16_to_cpu(rom_desc->Size));
+		status = -EINVAL;
+		goto exit;
+	}
 	status = read_rom(serial, start_address+sizeof(struct ti_i2c_desc),
 					le16_to_cpu(rom_desc->Size), buffer);
 	if (status)
]

92/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28125
							output: 52
							thoughts: 195
						

Thoughts:
**Prior Art Confirmation and Validation**

Okay, these two commits, `8c6314489550` and `183c1076eca4`, are hitting the mark *exactly* in terms of the kind of prior art I need. They're demonstrating crucial principles, which I'll summarize to make sure I grasp them completely:

*   First, when we get a length field coming in from a USB device – something like `bpkt_len` or `rom_desc->Size` – it's absolutely vital that we *immediately* validate that against a few things. We need to compare it to the *actual* data we've received (like `act` or `actual_length`), and critically, to the size of the destination buffer. That's our primary defense against overruns.
*   Second, and this is non-negotiable, if that length field *exceeds* what we can safely handle – if it's too big, we **have** to return an error. Not just any error, but the right ones. Something that clearly signals a protocol error like `-EPROTO`, an invalid argument situation like `-EINVAL`, or a message size issue like `-EMSGSIZE`. The goal is to halt the flow, report the problem and stop potentially corrupting the memory.
*   Third, what they've done to *fix* these problems is simple and elegant: add these explicit bounds checks. Right before we `memcpy` data or try to read it, we must verify that the length provided doesn't take us outside the allocated memory space.

Now, let's broaden the scope a little. I need to get some more examples, so let's cross-reference and examine commits `0fd2b00b2d3d` and `96d47e40bf9d` to see if they follow the same patterns or illustrate alternative scenarios of these validations.



93/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:0fd2b00b2d3d]

Results:
map[Output:commit 0fd2b00b2d3d05e3eaa13342b3dfb0fa85c226ae
Author: Adrian Korwel <adriank20047@gmail.com>
Date:   Mon May 25 09:58:32 2026 -0500

    USB: serial: io_ti: fix heap overflow in build_i2c_fw_hdr()
    
    build_i2c_fw_hdr() allocates a fixed-size buffer of
    (16*1024 - 512) + sizeof(struct ti_i2c_firmware_rec) bytes, then
    copies le16_to_cpu(img_header->Length) bytes into it without
    validating that Length fits within the available space after the
    firmware record header.
    
    img_header->Length is a __le16 from the firmware file and can be
    up to 65535. check_fw_sanity() validates the total firmware size
    but not img_header->Length specifically.
    
    Fix by rejecting images where img_header->Length exceeds the
    available destination space.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Adrian Korwel <adriank20047@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 6e0d4c38911b..d48819d785ef 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -844,6 +844,11 @@ static int build_i2c_fw_hdr(u8 *header, const struct firmware *fw)
 	/* Pointer to fw_down memory image */
 	img_header = (struct ti_i2c_image_header *)&fw->data[4];
 
+	if (le16_to_cpu(img_header->Length) >
+			buffer_size - sizeof(struct ti_i2c_firmware_rec)) {
+		kfree(buffer);
+		return -EINVAL;
+	}
 	memcpy(buffer + sizeof(struct ti_i2c_firmware_rec),
 		&fw->data[4 + sizeof(struct ti_i2c_image_header)],
 		le16_to_cpu(img_header->Length));
]

94/2 2026/08/17 21:11 tool git-show
0m Args:
map[Commit:96d47e40bf9d]

Results:
map[Output:commit 96d47e40bf9db4a9efd5c8fb53287a508d165f14
Author: HyeongJun An <sammiee5311@gmail.com>
Date:   Mon Jun 8 18:09:26 2026 +0900

    USB: serial: kl5kusb105: fix bulk-out buffer overflow
    
    klsi_105_prepare_write_buffer() is called by the generic write path
    with the bulk-out buffer and its size (bulk_out_size, 64 bytes). It
    stores a two-byte length header at the start of the buffer and copies
    the payload from the write fifo starting at buf + KLSI_HDR_LEN, but
    passes the full buffer size as the number of bytes to copy:
    
      count = kfifo_out_locked(&port->write_fifo, buf + KLSI_HDR_LEN,
                               size, &port->lock);
    
    When the fifo holds at least size bytes, size bytes are copied starting
    two bytes into the size-byte buffer, writing KLSI_HDR_LEN bytes past its
    end. Copy at most size - KLSI_HDR_LEN bytes instead, leaving room for
    the header as safe_serial already does.
    
    Writing bulk_out_size or more bytes to the tty triggers a slab
    out-of-bounds write, observed with KASAN by emulating the device with
    dummy_hcd and raw-gadget:
    
      BUG: KASAN: slab-out-of-bounds in kfifo_copy_out+0x83/0xc0
      Write of size 64 at addr ffff888112c62202 by task python3
       kfifo_copy_out
       klsi_105_prepare_write_buffer [kl5kusb105]
       usb_serial_generic_write_start [usbserial]
      Allocated by task 139:
       usb_serial_probe [usbserial]
      The buggy address is located 2 bytes inside of allocated 64-byte region
    
    The out-of-bounds write no longer occurs with this change applied.
    
    Fixes: 60b3013cdaf3 ("USB: kl5usb105: reimplement using generic framework")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>

diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index ed8531a64768..e72a0b45a707 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -330,8 +330,8 @@ static int klsi_105_prepare_write_buffer(struct usb_serial_port *port,
 	unsigned char *buf = dest;
 	int count;
 
-	count = kfifo_out_locked(&port->write_fifo, buf + KLSI_HDR_LEN, size,
-								&port->lock);
+	count = kfifo_out_locked(&port->write_fifo, buf + KLSI_HDR_LEN,
+				 size - KLSI_HDR_LEN, &port->lock);
 	put_unaligned_le16(count, buf);
 
 	return count + KLSI_HDR_LEN;
]

95/2 2026/08/17 21:11 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30392
							output: 940
							thoughts: 756
						

Thoughts:
**My Analysis of USB Length Field Vulnerabilities**

Alright, I've got a solid grasp on this. Based on my review of the prior art, here's the pattern that consistently emerges in handling length fields from USB devices:

1.  **Never Trust the Length:** I've seen it time and again – any length field provided by a USB device within its payload (like the `b[3]` in the current scenario, or instances like `bpkt->len` or `rom_desc->Size` in these other examples) *cannot* be blindly trusted. It's user input. It needs to be treated as such.

2.  **Double Validation is Key:** The length field needs to be rigorously validated against *two* critical factors:

    a)  The actual number of bytes *received* from the USB device. This is the `actual_len` we get back from functions like `usb_bulk_msg` or the `act` value returned by something like `usbio_bulk_msg`. We need to make sure we haven't read more bytes than the device indicated.

    b)  The size of the *destination buffer* where the payload will eventually be copied. This is absolutely critical to avoid overflows. This is where something like the proposed `cmd_result_len` comes into play, or the `sizeof(struct edge_ti_manuf_descriptor)` that I saw in a different example.

3.  **Error Out Gracefully:** If either of those validation checks fails, the driver *must* return a suitable error code – things like `-EIO`, `-EPROTO`, `-EINVAL`, or `-EMSGSIZE`. And, critically, the operation must be aborted at that point. We need to prevent any out-of-bounds reads or writes. This is non-negotiable.

4.  **Buffer Size Visibility:** I've noticed that if the size of the destination buffer isn't known within the function responsible for copying the data, the buffer's size needs to be explicitly passed down the call stack. This is exemplified by the proposed addition of `cmd_result_len`. This gives the lower-level function the information it needs to perform the bounds checking correctly.

Let's drill down into the historical record I found that reflects these insights:

*   `8c6314489550` ("usb: misc: usbio: bound bulk IN response length to the received transfer"): This one validates the device-supplied length against both the actual received length *and* the buffer size. This exemplifies the double-check.
*   `183c1076eca4` ("USB: serial: io\_ti: fix heap overflow in get\_manuf\_info()"): It validates device-supplied lengths against the destination buffer size *before* attempting to read any data. This is what we are after.
*   `b91e6aafe8d3` ("media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100\_i2c\_msg()"): Here, they validated user or device-controlled lengths against `sizeof(st->data)`.
*   `1a31cb278210` ("media: dvb-usb: pctv452e: move snd/rcv len check before kmalloc"): They validated the length *before* allocating memory and copying, which is good defensive programming.

While I didn't find any *recent* direct fixes within `drivers/media/usb/ttusb-dec/`, I've seen ample evidence of similar bugs being addressed within the broader `drivers/media/usb/` and `drivers/usb/` subsystems.

In short, there are some clear, consistent patterns. To recap my idioms to follow:

*   **Zero Trust for Device Lengths:** Assume any length received from the USB endpoint is a hostile input.
*   **Two-Pronged Bounds Checking:** Check the length against *both* the actual data received (DMA buffer) and the destination buffer size.
*   **Explicit Buffer Size Propagation:** Pass destination buffer sizes down through the call stack when needed.
*   **Secure Failure:** Return an error code and *do not copy* if the checks fail.

These principles align perfectly with the proposed fix and provides the required historical context. We need to ensure that the code follows these best practices.



96/1 2026/08/17 21:12 action kernel-scratch-checkouter
0m Results:
map[KernelScratchSrc:/app/workdir/cache/tmp/tmp2795212180]

97/1 2026/08/17 21:12 loop
30m
98/2 2026/08/17 21:12 iteration 0
30m
99/3 2026/08/17 21:12 agent patch-generator
5m Model:
best-expensive

Instruction:
You are an experienced Linux kernel developer tasked with creating a fix for a kernel bug.
You will be given a crash report, an initial explanation of the root cause done by another
kernel expert, and a summary of how similar bugs were fixed in the past.

Use the codeeditor tool to do code edits.
Note: you will not see your changes when looking at the code using codesearch tools.
Use the patch-diff tool to review the modifications you applied.

Your final reply should contain explanation of what you did in the patch and why
(details not present in the initial explanation of the bug).

Your fix must not just prevent the given crash, but also be the best fix for the underlying
root cause from the software engineering point of view. There can be several ways to fix the
same bug. Consider alternatives, and pick the best one. For example, additional checks may be
added at different locations/functions, it's usually better to place them earlier in the
execution to avoid multiple checks at various locations later.

Frequently the same coding mistake is done in several locations in the source code.
Check if your fix should be extended/applied to similar cases around to fix other similar bugs.
But don't go too wide, don't try to fix problems kernel-wide, fix similar issues
in the same file only.


If you are changing post-conditions of a function, consider all callers of the functions,
and if they need to be updated to handle new post-conditions. For example, if you make
a function that previously never returned a NULL, return NULL, consider if callers
need to be updated to handle NULL return value.


If you will end up removing the WARN_ON macro because the condition can legitimately happen,
add a pr_err/dev_err/... (whatever is the macro for printing runtime errors used in the file)
call that logs that the unlikely condition has happened. The pr_err/dev_err/... message
must not include "WARNING" nor "BUG" strings.


Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash that corresponds to the bug is:

usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036, CPU#0: kworker/0:4/4798
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
lr : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
sp : ffff800098516d20
x29: ffff800098516d20 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: ffff800086d0a338 x21: 0000000000000000
x20: 000000000000004b x19: 000000000000003c x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
irq event stamp: 16196
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62
hardirqs last disabled at (16196): [<ffff8000868f86e0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425
softirqs last  enabled at (16128): [<ffff80008030ff18>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (16128): [<ffff80008030ff18>] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650
softirqs last disabled at (16119): [<ffff8000800204b0>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kernel BUG at lib/string_helpers.c:1044!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Tainted: G        W           syzkaller #1 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
lr : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
sp : ffff800098516d50
x29: ffff800098516d50 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: 000000000000004b x21: ffff0000d1862680
x20: 1fffe0001a30c4d0 x19: ffff0000c3014000 x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043 (P)
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
Code: d503233f a9bf7bfd 910003fd 94619ee8 (d4210000) 
---[ end trace 0000000000000000 ]---


The explanation of the root cause of the bug is:

The crash is caused by a buffer overflow (both an out-of-bounds read and an out-of-bounds write) in the `ttusb_dec_send_command()` function, triggered by a malicious or malfunctioning USB device returning an unexpectedly large payload length.

### Detailed Analysis

In `drivers/media/usb/ttusb-dec/ttusb_dec.c`, the `ttusb_dec_send_command()` function allocates a buffer `b` to send a command and receive the response via `usb_bulk_msg()`:

```c
	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
```
Here, `COMMAND_PACKET_SIZE` is defined as `0x3c` (60), so the allocated buffer `b` is exactly 64 bytes.

After receiving the response from the USB device, the driver reads the payload length directly from `b[3]` (which is fully controlled by the USB device) and copies the payload into the caller-provided `cmd_result` buffer:

```c
		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0)
			memcpy(cmd_result, &b[4], b[3]);
```

There are two major flaws in this logic:
1. **No bounds check against the received data or the allocated buffer `b`**: `b[3]` is an 8-bit value and can be up to 255. If the device returns a value greater than `COMMAND_PACKET_SIZE` (60), the `memcpy()` will read past the end of the 64-byte buffer `b`. In the syzkaller crash, `b[3]` was `75`, leading to a 75-byte read from `&b[4]` (which only has 60 bytes allocated). This triggers the `fortify_memcpy_chk` panic (`75 byte read of buffer size 60`).
2. **No bounds check against the destination buffer `cmd_result`**: The size of `cmd_result` is never passed to `ttusb_dec_send_command()`. While callers like `ttusb_dec_get_stb_state()` pass a 60-byte buffer (`u8 c[COMMAND_PACKET_SIZE]`), other callers like `ttusbdecfe_dvbt_read_status()` in `ttusbdecfe.c` pass a much smaller buffer (`u8 result[4]`). If the device returns `b[3] = 60` for the latter, it will result in a severe stack buffer overflow.

### Proposed Fix

To fix this comprehensively, the API needs to be updated to pass the size of the destination buffer, and `ttusb_dec_send_command()` must validate `b[3]` against the received length, the maximum packet size, and the destination buffer size.

**1. Update `ttusbdecfe_config` in `drivers/media/usb/ttusb-dec/ttusbdecfe.h`:**
Add `cmd_result_len` to the `send_command` callback signature.
```c
struct ttusbdecfe_config
{
	int (*send_command)(struct dvb_frontend* fe, const u8 command,
			    int param_length, const u8 params[],
			    int *result_length, u8 cmd_result[],
			    int cmd_result_len);
};
```

**2. Update `ttusb_dec_send_command()` in `ttusb_dec.c`:**
Add `cmd_result_len` to the signature and implement the necessary bounds checks.
```c
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	// ...
	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);

	if (result) {
		printk("%s: result bulk message failed: error %d\n",
		       __func__, result);
		goto err_mutex_unlock;
	} else {
		if (debug) {
			printk(KERN_DEBUG "%s: result: %*ph\n",
			       __func__, actual_len, b);
		}

		/* Ensure we received at least the 4-byte header */
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		/* Ensure the device isn't claiming more data than it sent or than fits in b */
		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];

		if (cmd_result && b[3] > 0) {
			/* Ensure we don't overflow the caller's buffer */
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
	}
	// ...
```

**3. Update all callers:**
You will need to update all callers of `ttusb_dec_send_command()` in `ttusb_dec.c` and `state->config->send_command()` in `ttusbdecfe.c` to pass the correct buffer size. 
For example:
- In `ttusb_dec_get_stb_state()`: pass `sizeof(c)` instead of just `c`.
- In `ttusbdecfe_dvbt_read_status()`: pass `sizeof(result)` instead of just `result`.
- For calls where `cmd_result` is `NULL`, simply pass `0` as the length.


Historical context on how similar bugs were fixed in the past:

Based on a review of the recent history in the `drivers/media/usb/` and `drivers/usb/` subsystems, there are no recent commits addressing this specific type of bug in the `ttusb-dec` driver itself. However, there is extensive prior art for fixing identical root causes—trusting device-supplied length fields without validation—across other USB media and serial drivers.

### Relevant Prior Art

Similar vulnerabilities where a USB device returns a malicious or unexpectedly large length field have been fixed using the exact same principles you proposed. Notable recent examples include:

1. **`8c6314489550` ("usb: misc: usbio: bound bulk IN response length to the received transfer")**
   - **Issue:** The driver read a length field (`bpkt->len`) from the device and used it in a `memcpy()` without checking if it exceeded the actual received data or the destination buffer size, leading to a slab-out-of-bounds read.
   - **Fix:** Added explicit checks to ensure the device-supplied length did not exceed the actual received length (`act`) minus the header size.

2. **`183c1076eca4` ("USB: serial: io_ti: fix heap overflow in get_manuf_info()")**
   - **Issue:** The driver read a `Size` field from the device's EEPROM and used it to copy data into a fixed-size 10-byte buffer. A malicious device could set `Size` to a large value, causing a heap overflow.
   - **Fix:** Validated the device-provided `Size` against the expected `sizeof(struct edge_ti_manuf_descriptor)` before performing the read.

3. **`b91e6aafe8d3` ("media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100_i2c_msg()")**
   - **Issue:** An untrusted length value (`rlen`) was used in a `memcpy()` to a fixed-size buffer (`st->data`), causing an out-of-bounds write.
   - **Fix:** Added a simple `if (rlen > sizeof(st->data))` check, returning `-EINVAL` if the condition was met.

4. **`782b6a718651` ("media: uvcvideo: Fix 1-byte out-of-bounds read in uvc_parse_format()")**
   - **Issue:** The driver accessed `buffer[3]` without verifying that the actual received buffer length was at least 4 bytes.
   - **Fix:** Added a strict `if (buflen < 4)` check before accessing the payload.

### Common Patterns and Idioms for the Fix

Based on how these similar bugs were addressed, your proposed fix aligns perfectly with kernel best practices. When writing the patch, you should follow these established idioms:

1. **Never Trust Device-Provided Lengths:** Any length field originating from a USB device (in your case, `b[3]`) must be treated as untrusted user input.
2. **Double Bounds Checking:** The untrusted length must be validated against two distinct boundaries:
   - **The Source Boundary:** Ensure `b[3]` does not exceed the actual data received from the USB transfer (`actual_len - 4`). This prevents the out-of-bounds read (the `75 byte read of buffer size 60` panic).
   - **The Destination Boundary:** Ensure `b[3]` does not exceed the size of the caller-provided buffer (`cmd_result_len`). This prevents the out-of-bounds write/stack corruption.
3. **Explicit Buffer Sizing:** Passing the destination buffer size down the call stack (e.g., adding `cmd_result_len` to `ttusb_dec_send_command` and the `send_command` callback) is the standard and correct way to handle dynamic copies where the destination size varies by caller.
4. **Fail Securely:** If any bounds check fails, the driver should immediately abort the operation, unlock any held mutexes, and return an appropriate error code (e.g., `-EIO`, `-EPROTO`, or `-EMSGSIZE`). Logging a rate-limited warning or debug message is also common practice in these error paths.




Reply:
I have analyzed the root cause and implemented the fix as proposed, with an additional safeguard.

### Changes made:
1. **Updated `ttusbdecfe_config`**: Added `cmd_result_len` to the `send_command` callback signature in `drivers/media/usb/ttusb-dec/ttusbdecfe.h`.
2. **Updated `ttusb_dec_send_command`**: 
   - Added `cmd_result_len` to the function signature.
   - Added a check to ensure `param_length` does not exceed `COMMAND_PACKET_SIZE` before allocating and copying into the buffer `b`. This prevents a potential out-of-bounds write when copying `params` into `b`.
   - Added bounds checks to ensure the received payload length (`b[3]`) does not exceed `COMMAND_PACKET_SIZE`, the actual received data length (`actual_len - 4`), or the caller-provided buffer size (`cmd_result_len`).
   - Added a check to ensure `actual_len` is at least 4 bytes to safely read the header.
3. **Updated all callers**: Updated all invocations of `ttusb_dec_send_command` in `ttusb_dec.c` and `state->config->send_command` in `ttusbdecfe.c` to pass the correct destination buffer size (using `sizeof()`) or `0` when `cmd_result` is `NULL`.

### Why these changes were made:
The primary issue was trusting the device-provided length field (`b[3]`) without validating it against the bounds of the allocated buffer or the caller's destination buffer. By passing the destination buffer size down the call stack and validating `b[3]` against both the source (actual received data) and destination (caller's buffer size) boundaries, we ensure that malicious or malfunctioning USB devices cannot trigger out-of-bounds reads or writes. 

Additionally, I added a check for `param_length > COMMAND_PACKET_SIZE` at the beginning of `ttusb_dec_send_command`. While current callers pass safe values, this prevents future callers from accidentally overflowing the allocated command buffer `b` when copying `params`.

100/4 2026/08/17 21:12 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11315
							output: 36
							thoughts: 284
						

Thoughts:
**My Analysis of the ttusb-dec Driver Vulnerability and Proposed Fix**

Alright, let's break this down. It seems we've got a classic buffer overflow vulnerability lurking in `drivers/media/usb/ttusb-dec/ttusb_dec.c`. The core issue is in `ttusb_dec_send_command()`. It's reading a length from `b[3]`, an untrusted value, and then using that to copy data into `cmd_result` via `memcpy(cmd_result, &b[4], b[3])`. The buffer `b` is only 64 bytes, allocated using `COMMAND_PACKET_SIZE + 4` which I'm assuming, given the context, results in 60 bytes of usable space.

The crux of the matter is that `b[3]` is unchecked. If `b[3]` is greater than 60, we're reading out of bounds from `b`. But even worse, if `b[3]` is larger than the size of `cmd_result`, we're writing past the end of that buffer, leading to a heap-based buffer overflow. That's a serious security risk.

The proposed fix seems reasonable, it is a good plan. The fix involves three steps:

1.  Adding `cmd_result_len` to the `ttusbdecfe_config` structure within `ttusbdecfe.h`. This is the right place to store this value.
2.  Then, inside `ttusb_dec_send_command()`, the code will get the `cmd_result_len` and check that the size of `b[3]` is within the boundaries of `cmd_result_len`. This bounds check will protect the vulnerable memcpy.
3.  Finally, we need to update all the callers of `ttusb_dec_send_command()` and `state->config->send_command()` with the right buffer size. This is a crucial step to make sure the fix is complete.

I'll need to dig into the code, and assess the implementation. I'll check that the bounds checks are robust and handle all edge cases correctly. Also, I'll review all the call sites to ensure that the correct lengths are passed and that no other similar vulnerabilities exist nearby. I will need to be very thorough to minimize the potential for missed conditions, especially when dealing with untrusted lengths and potentially complex data structures.



101/4 2026/08/17 21:12 tool codesearch-file-index
0m Args:
map[SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Entities:[map[Kind:function Name:__check_adapter_nr] map[Kind:function Name:__check_debug] map[Kind:function Name:__check_enable_rc] map[Kind:function Name:__check_output_pva] map[Kind:function Name:crc16] map[Kind:function Name:dvb_filter_pes2ts] map[Kind:function Name:dvb_filter_pes2ts_init] map[Kind:function Name:fe_send_command] map[Kind:function Name:swap_bytes] map[Kind:function Name:ttusb_dec_alloc_iso_urbs] map[Kind:function Name:ttusb_dec_audio_pes2ts_cb] map[Kind:function Name:ttusb_dec_boot_dsp] map[Kind:function Name:ttusb_dec_disconnect] map[Kind:function Name:ttusb_dec_driver_exit] map[Kind:function Name:ttusb_dec_driver_init] map[Kind:function Name:ttusb_dec_exit_bh_work] map[Kind:function Name:ttusb_dec_exit_dvb] map[Kind:function Name:ttusb_dec_exit_filters] map[Kind:function Name:ttusb_dec_exit_rc] map[Kind:function Name:ttusb_dec_exit_usb] map[Kind:function Name:ttusb_dec_free_iso_urbs] map[Kind:function Name:ttusb_dec_get_stb_state] map[Kind:function Name:ttusb_dec_handle_irq] map[Kind:function Name:ttusb_dec_init_bh_work] map[Kind:function Name:ttusb_dec_init_dvb] map[Kind:function Name:ttusb_dec_init_filters] map[Kind:function Name:ttusb_dec_init_stb] map[Kind:function Name:ttusb_dec_init_usb] map[Kind:function Name:ttusb_dec_init_v_pes] map[Kind:function Name:ttusb_dec_probe] map[Kind:function Name:ttusb_dec_process_filter] map[Kind:function Name:ttusb_dec_process_packet] map[Kind:function Name:ttusb_dec_process_pva] map[Kind:function Name:ttusb_dec_process_urb] map[Kind:function Name:ttusb_dec_process_urb_frame] map[Kind:function Name:ttusb_dec_process_urb_frame_list] map[Kind:function Name:ttusb_dec_send_command] map[Kind:function Name:ttusb_dec_set_interface] map[Kind:function Name:ttusb_dec_set_model] map[Kind:function Name:ttusb_dec_set_pids] map[Kind:function Name:ttusb_dec_setup_urbs] map[Kind:function Name:ttusb_dec_start_feed] map[Kind:function Name:ttusb_dec_start_iso_xfer] map[Kind:function Name:ttusb_dec_start_sec_feed] map[Kind:function Name:ttusb_dec_start_ts_feed] map[Kind:function Name:ttusb_dec_stop_feed] map[Kind:function Name:ttusb_dec_stop_iso_xfer] map[Kind:function Name:ttusb_dec_stop_sec_feed] map[Kind:function Name:ttusb_dec_stop_ts_feed] map[Kind:function Name:ttusb_dec_video_pes2ts_cb] map[Kind:function Name:ttusb_init_rc] map[Kind:struct Name:dvb_filter_pes2ts] map[Kind:struct Name:filter_info] map[Kind:struct Name:ttusb_dec] map[Kind:struct Name:urb_frame] map[Kind:global_variable Name:__UNIQUE_ID_addressable_ttusb_dec_driver_init_685] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_676] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_677] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_678] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_679] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_680] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_681] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_682] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_683] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_686] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_687] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_688] map[Kind:global_variable Name:__UNIQUE_ID_modinfo_689] map[Kind:global_variable Name:__exitcall_ttusb_dec_driver_exit] map[Kind:global_variable Name:__mod_device_table__kmod_ttusb_dec__usb__ttusb_dec_table] map[Kind:global_variable Name:__param_adapter_nr] map[Kind:global_variable Name:__param_arr_adapter_nr] map[Kind:global_variable Name:__param_debug] map[Kind:global_variable Name:__param_enable_rc] map[Kind:global_variable Name:__param_output_pva] map[Kind:global_variable Name:__param_str_adapter_nr] map[Kind:global_variable Name:__param_str_debug] map[Kind:global_variable Name:__param_str_enable_rc] map[Kind:global_variable Name:__param_str_output_pva] map[Kind:global_variable Name:adapter_nr] map[Kind:global_variable Name:fe_config] map[Kind:global_variable Name:rc_keys] map[Kind:global_variable Name:ttusb_dec_driver] map[Kind:global_variable Name:ttusb_dec_table] map[Kind:enum Name:ttusb_dec_interface] map[Kind:enum Name:ttusb_dec_model] map[Kind:enum Name:ttusb_dec_packet_type] map[Kind:typedef Name:dvb_filter_pes2ts_cb_t]]]

102/4 2026/08/17 21:12 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13946
							output: 49
							thoughts: 35
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Analyzing the `ttusb_dec_send_command` Function**

Okay, time to dive into the `ttusb_dec_send_command` function. Let's start with where it lives: `drivers/media/usb/ttusb-dec/ttusb_dec.c`. Given what I know about USB media devices and the overall structure of the kernel, I'm already anticipating how it's likely architected. I'll be looking for command queuing, URB management, error handling related to USB communication, and any device-specific quirks. I expect to see data structures related to the USB device itself and likely some low-level control of endpoints. I'll need to figure out what type of commands it's sending, whether it's synchronous or asynchronous, and how it handles potential timeouts or retries. Knowing the context of this function, I'll be able to get to the core of this driver and see how it is interacting with the underlying hardware, how it is exposed to the user space, and any potential security vulnerabilities.



103/4 2026/08/17 21:12 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c Name:ttusb_dec_send_command]

Results:
map[SourceCode: 315:	static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 316:					  int param_length, const u8 params[],
 317:					  int *result_length, u8 cmd_result[])
 318:	{
 319:		int result, actual_len;
 320:		u8 *b;
 321:	
 322:		dprintk("%s\n", __func__);
 323:	
 324:		b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 325:		if (!b)
 326:			return -ENOMEM;
 327:	
 328:		result = mutex_lock_interruptible(&dec->usb_mutex);
 329:		if (result) {
 330:			printk("%s: Failed to lock usb mutex.\n", __func__);
 331:			goto err_free;
 332:		}
 333:	
 334:		b[0] = 0xaa;
 335:		b[1] = ++dec->trans_count;
 336:		b[2] = command;
 337:		b[3] = param_length;
 338:	
 339:		if (params)
 340:			memcpy(&b[4], params, param_length);
 341:	
 342:		if (debug) {
 343:			printk(KERN_DEBUG "%s: command: %*ph\n",
 344:			       __func__, param_length, b);
 345:		}
 346:	
 347:		result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 348:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 349:	
 350:		if (result) {
 351:			printk("%s: command bulk message failed: error %d\n",
 352:			       __func__, result);
 353:			goto err_mutex_unlock;
 354:		}
 355:	
 356:		result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 357:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 358:	
 359:		if (result) {
 360:			printk("%s: result bulk message failed: error %d\n",
 361:			       __func__, result);
 362:			goto err_mutex_unlock;
 363:		} else {
 364:			if (debug) {
 365:				printk(KERN_DEBUG "%s: result: %*ph\n",
 366:				       __func__, actual_len, b);
 367:			}
 368:	
 369:			if (result_length)
 370:				*result_length = b[3];
 371:			if (cmd_result && b[3] > 0)
 372:				memcpy(cmd_result, &b[4], b[3]);
 373:		}
 374:	
 375:	err_mutex_unlock:
 376:		mutex_unlock(&dec->usb_mutex);
 377:	err_free:
 378:		kfree(b);
 379:		return result;
 380:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

104/4 2026/08/17 21:12 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15256
							output: 62
							thoughts: 17
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing `ttusb_dec_send_command` Callers**

Okay, so the immediate goal is to understand the calling contexts of `ttusb_dec_send_command`. I need to figure out how this function is being used. This isn't just about a simple search; I need to understand the *why* behind its invocations.

First, I'll identify all direct callers. A basic grep or find in the code base will get me a list, but that's just the starting point. I need to quickly filter that list to highlight the most important. I'll need to use tools to provide the call graph, to analyze the context of each call.

Then I'll start with the most likely culprits - what subsystems or drivers are likely managing USB-related communication? Anything related to the transport layer, data parsing, or the device control flow will be immediately relevant. The function name itself suggests some interaction with a USB device, likely a decoder of some sort, so I should be looking at the driver source, and how it interacts with the USB device.

I'll be paying close attention to any parameters passed to `ttusb_dec_send_command`. The arguments are going to be key. They'll tell me what kind of commands are being sent and, by extension, what the function's responsibility is. Are we talking about control requests, data transfers, or something else entirely? A quick look at the function's prototype and associated data structures will give me a head start.

Finally, I'm expecting some level of complexity. There might be indirect calls through function pointers or macro expansions. I'll need to be ready to trace through those layers to get the complete picture. The goal is to build a mental map of how `ttusb_dec_send_command` fits into the broader architecture. Essentially, I'm looking for a roadmap of its influence.



105/4 2026/08/17 21:12 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c IncludeSnippetLines:0 Name:ttusb_dec_send_command SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:fe_send_command SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1627] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1357] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1398] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_get_stb_state SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:392] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_interface SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:904] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_pids SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:451] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1058] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1024] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1138] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1117] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_init_rc SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1241]] TruncatedOutput:false]

106/4 2026/08/17 21:12 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16468
							output: 46
							thoughts: 32
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Diving into the `ttusb-dec` Driver**

Alright, time to dig into the `ttusb-dec` driver, specifically that `fe_send_command` function within `ttusb_dec.c`. Let's see what we're working with here. I need to get a clear picture of how this specific function is handling the communication with the front-end. What are the key aspects of its operation? Are there any potential bottlenecks or areas where performance could be optimized? Are there any obvious areas for review that might need extra attention? Let's get to work.



107/4 2026/08/17 21:12 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c Name:fe_send_command]

Results:
map[SourceCode:1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

108/4 2026/08/17 21:12 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16871
							output: 59
							thoughts: 15
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Investigating `fe_send_command` Usage**

Alright, let's dive in. I need to get a clear understanding of how the `fe_send_command` function is being utilized within this system. My immediate instinct is to identify all its call sites. I need to know the context of its calls, the arguments being passed, and the overall control flow surrounding each invocation. This will help me quickly grasp its purpose and potential impact, especially considering its potentially fundamental role, given the naming convention (assuming this is related to a frontend-backend interaction). I'll look for both direct calls and any indirect usage through function pointers or macro expansions. I'll need to consider how to navigate the codebase efficiently to find all instances. I'll have to consider all possible source files in order to do this correctly, whether it requires some clever regex or the appropriate tools.



109/4 2026/08/17 21:12 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c IncludeSnippetLines:0 Name:fe_send_command SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:fe_config SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1631]] TruncatedOutput:false]

110/4 2026/08/17 21:12 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17228
							output: 44
							thoughts: 9
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, keeping in mind I'm speaking to a fellow expert and adopting a first-person perspective:

**Diving into the Configuration**

Alright, let's get down to brass tacks. Time to take a look at the `fe_config`. I need to understand the front-end configuration and how it's structured. We both know that's the bedrock of how everything renders, how the application behaves on the user's end, and quite often, where we find the roots of any behavioral eccentricities. This usually holds the keys to understanding how the application interacts with the user, handles data, and, well, everything. Gotta see how this thing is actually put together. I need to get familiar with every setting within this config file.



111/4 2026/08/17 21:12 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c Name:fe_config]

Results:
map[SourceCode:1630:	static const struct ttusbdecfe_config fe_config = {
1631:		.send_command = fe_send_command
1632:	};
 SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

112/4 2026/08/17 21:12 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17535
							output: 47
							thoughts: 15
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into the `ttusbdecfe_config` Struct**

Okay, let's get down to brass tacks. I need to take a look at the definition of the `ttusbdecfe_config` structure. I'm assuming it's the core configuration data structure for the TechniSat USB DVB demodulator front-end. I'm hoping it's well-documented and reasonably self-explanatory, but you know how these things can go... I need to understand exactly what parameters are configurable, what the data types are, and the ranges/semantics of each field. This struct likely encapsulates everything from the demodulator's carrier frequency and symbol rate to various FEC settings, modulation schemes, and maybe even some driver-specific tuning parameters. I need a clear picture of this structure to understand how to interact with and control the demodulator. The success of my work hinges on a complete understanding of this struct.



113/4 2026/08/17 21:13 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c Name:ttusbdecfe_config]

Results:
map[SourceCode:  13:	struct ttusbdecfe_config
  14:	{
  15:		int (*send_command)(struct dvb_frontend* fe, const u8 command,
  16:				    int param_length, const u8 params[],
  17:				    int *result_length, u8 cmd_result[]);
  18:	};
 SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.h]

114/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17937
							output: 174
							thoughts: 22
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Adding `cmd_result_len` to `ttusbdecfe_config`**

Okay, I'm thinking I need to modify `ttusbdecfe_config`. Specifically, it needs a new member: `int cmd_result_len`. This is crucial because...well, I've got a situation where I'm dealing with command responses and the lengths of those responses are variable. Right now, I'm probably relying on a fixed-size buffer or some other clunky method. That's just asking for trouble with potential buffer overflows or inefficient memory allocation, depending on the implementation. Adding `cmd_result_len` allows the caller to determine and handle the length of the returned result directly and appropriately. Essentially, it centralizes and clarifies how command results' lengths are handled, making the interface more robust and maintainable. This also means I'll likely have to update all functions that interact with `ttusbdecfe_config` to correctly handle the new field. I'll need to double check any assumptions about command response size throughout the codebase. The implementation of that new field, how I use it, and how it is updated by different functions should be clear and consistent.



115/4 2026/08/17 21:13 tool codeeditor
0m Args:
map[CurrentCode:struct ttusbdecfe_config
{
	int (*send_command)(struct dvb_frontend* fe, const u8 command,
			    int param_length, const u8 params[],
			    int *result_length, u8 cmd_result[]);
}; NewCode:struct ttusbdecfe_config
{
	int (*send_command)(struct dvb_frontend* fe, const u8 command,
			    int param_length, const u8 params[],
			    int *result_length, u8 cmd_result[],
			    int cmd_result_len);
}; SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.h]

Results:
map[]

116/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18407
							output: 64
							thoughts: 22
						

Thoughts:
Here's my thought process, as if I were working on this task:

**Locating Callers of `send_command` in `ttusbdecfe.c`**

Okay, so I need to track down every instance where the `send_command` function is called within the `ttusbdecfe.c` file. This is a pretty straightforward task, and depending on the tools available, could be handled in a few different ways. I could use `grep` (or a similar command-line tool) with a pattern search, or if I'm using a decent IDE, it should have a built-in "find all references" or "find usages" feature that would be perfect for this. I'd definitely prefer the IDE approach if it's available; it's generally much faster and can handle more complex cases, such as identifying calls within macros or conditional blocks. If the IDE method is too cumbersome, or if I'm working with a less feature-rich environment, then `grep` would be my go-to. I would start by grepping the file for "send_command" and filter for the name by not picking up other uses of `send_command` such as its definition or comments. That will get me a list of lines with those calls, and from there I can examine them to get the necessary context for my task.



117/4 2026/08/17 21:13 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c IncludeSnippetLines:0 Name:ttusbdecfe_config::send_command SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbs_diseqc_send_master_cmd SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:150] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbs_set_frontend SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:133] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbt_read_status SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:47] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbt_set_frontend SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:88]] TruncatedOutput:false]

118/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19062
							output: 57
							thoughts: 23
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, as if it were my own, assuming I'm an expert in the field:

**Analyzing the `ttusbdecfe_dvbs_diseqc_send_master_cmd` Function**

Alright, let's dive into this `ttusbdecfe_dvbs_diseqc_send_master_cmd` function. My initial thought is to immediately consider the context; this is clearly related to DISEqC control, specifically within a DVB-S system, likely involving a Terratec USB DVB decoder front-end. Given that, I'm expecting to see the low-level interactions with the hardware: probably register manipulation, bit-banging, or interaction with some sort of hardware abstraction layer.

I'm mentally preparing for a fairly low-level view: the function likely deals with formatting the DISEqC command, possibly calculating checksums (though DISEqC checksums can sometimes be handled elsewhere), and then transmitting this command to the relevant hardware component. I’ll be looking for things like:

*   **Data Structures:** What structures are used to represent the DISEqC command? Is it a simple array of bytes, or is there a more complex structure?
*   **Hardware Interface:** How is this function communicating with the actual hardware? Is it through direct memory access, some kind of I2C interface, SPI, or a custom protocol? I'm anticipating some calls to functions related to hardware access.
*   **Timing:** DISEqC has specific timing requirements. I'll be looking for any delays, timing loops, or related code that ensure the command is sent at the correct speed and with the necessary pauses.
*   **Error Handling:** What kind of error checking is implemented? Does it check for transmission errors, timeouts, or hardware failures?

Basically, I'm looking at it to understand the flow of data and control, the low-level details of DISEqC command generation and transmission, and what kind of checks are incorporated to ensure it is handled correctly. Let's see how well it's implemented.



119/4 2026/08/17 21:13 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c Name:ttusbdecfe_dvbs_diseqc_send_master_cmd]

Results:
map[SourceCode: 138:	static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
 139:	{
 140:		struct ttusbdecfe_state *state = fe->demodulator_priv;
 141:		u8 b[] = { 0x00, 0xff, 0x00, 0x00,
 142:			   0x00, 0x00, 0x00, 0x00,
 143:			   0x00, 0x00 };
 144:	
 145:		if (cmd->msg_len > sizeof(b) - 4)
 146:			return -EINVAL;
 147:	
 148:		memcpy(&b[4], cmd->msg, cmd->msg_len);
 149:	
 150:		state->config->send_command(fe, 0x72,
 151:					    sizeof(b) - (6 - cmd->msg_len), b,
 152:					    NULL, NULL);
 153:	
 154:		return 0;
 155:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

120/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19955
							output: 133
							thoughts: 38
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Subtle Improvement in Diseqc Command Sending**

Alright, looking at this `ttusbdecfe_dvbs_diseqc_send_master_cmd` function… the core logic seems sound, but I've spotted a minor, albeit potentially significant, area for improvement. Specifically, the call `NULL, NULL);` needs a second look.

While technically correct in many scenarios, the intended function call is meant to also accommodate a flag parameter. While currently unused, it's good practice to provide a default value for that optional parameter. Setting the third argument of `ttusbdecfe_dvbs_diseqc_send_master_cmd` as `NULL, NULL, 0);` provides some assurance against future regressions when it comes to the function call.

This change is small, but it highlights a commitment to robustness. It's a subtle tweak, but ensuring all parameters, even optional ones, are properly initialized or defaulted to a known good state often heads off headaches down the line, particularly when dealing with low-level hardware interactions like Diseqc commands. It's the kind of thing that makes debugging easier and code maintainability better over time.



121/4 2026/08/17 21:13 tool codeeditor
0m Args:
map[CurrentCode:	state->config->send_command(fe, 0x72,
				    sizeof(b) - (6 - cmd->msg_len), b,
				    NULL, NULL); NewCode:	state->config->send_command(fe, 0x72,
				    sizeof(b) - (6 - cmd->msg_len), b,
				    NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[]

122/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 20396
							output: 52
							thoughts: 18
						

Thoughts:
Okay, let's dive into this `ttusbdecfe_dvbs_set_frontend` function. I need to understand its role within the larger system. My initial thought is to figure out what it's responsible for; is it setting up the demodulator, configuring the tuner, or maybe handling both? The name suggests it's related to DVB-S, so I'll need to remember all the nuances of that modulation scheme. I need to quickly recall the typical parameters involved - symbol rate, FEC, polarization, frequency, and so on.

**Analyzing the Frontend Configuration Function**

From my understanding, I need to immediately consider how this function interacts with the hardware, probably through some low-level drivers or registers. I'm going to quickly look for any hints, like defined structures or enum types, that might suggest the way parameters are passed to the hardware. Hopefully, it's well-documented! I'm hoping it's also designed to handle error conditions gracefully; I don't want any silent failures that will be difficult to debug later. I will want to think through any possible sequences of register writes or commands. Any conditional logic should be of interest. Are there any dependencies? Does this function have an associated lock or critical section? I'll also check if there are any specific initialization routines that need to be called before this function can be used. Ultimately, I'll analyze how effectively this function handles any specific hardware quirks or errata. I need to see how robustly it sets up the frontend to receive a DVB-S signal. I'll need to know whether the function includes any logic for auto-detection or adaptation to different DVB-S configurations. And finally, I must be certain it is thread-safe.



123/4 2026/08/17 21:13 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c Name:ttusbdecfe_dvbs_set_frontend]

Results:
map[SourceCode: 103:	static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 104:	{
 105:		struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 106:		struct ttusbdecfe_state *state = fe->demodulator_priv;
 107:	
 108:		u8 b[] = { 0x00, 0x00, 0x00, 0x01,
 109:			   0x00, 0x00, 0x00, 0x00,
 110:			   0x00, 0x00, 0x00, 0x01,
 111:			   0x00, 0x00, 0x00, 0x00,
 112:			   0x00, 0x00, 0x00, 0x00,
 113:			   0x00, 0x00, 0x00, 0x00,
 114:			   0x00, 0x00, 0x00, 0x00,
 115:			   0x00, 0x00, 0x00, 0x00,
 116:			   0x00, 0x00, 0x00, 0x00,
 117:			   0x00, 0x00, 0x00, 0x00 };
 118:		__be32 freq;
 119:		__be32 sym_rate;
 120:		__be32 band;
 121:		__be32 lnb_voltage;
 122:	
 123:		freq = htonl(p->frequency +
 124:		       (state->hi_band ? LOF_HI : LOF_LO));
 125:		memcpy(&b[4], &freq, sizeof(u32));
 126:		sym_rate = htonl(p->symbol_rate);
 127:		memcpy(&b[12], &sym_rate, sizeof(u32));
 128:		band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 129:		memcpy(&b[24], &band, sizeof(u32));
 130:		lnb_voltage = htonl(state->voltage);
 131:		memcpy(&b[28], &lnb_voltage, sizeof(u32));
 132:	
 133:		state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
 134:	
 135:		return 0;
 136:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

124/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21613
							output: 101
							thoughts: 33
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm the expert and considering the potential implications:

**Refactoring the DVB-S Frontend Initialization**

Right, looking at the `ttusbdecfe_dvbs_set_frontend` function... I need to update the call with a more modern approach. I'm seeing the current initialization of this function as `NULL, NULL);`. The concern is that `0` may be the missing third parameter. The current version may work, but to make this more robust and future-proof, I should change that to `NULL, NULL, 0);`. It's a subtle change, likely related to default values or initialization flags within the DVB-S frontend driver. Making this update will make this better and it is a good idea to perform this update.



125/4 2026/08/17 21:13 tool codeeditor
0m Error:
log-in to see details

Args:
map[CurrentCode:	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL); NewCode:	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[]

126/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21949
							output: 181
							thoughts: 7
						

Thoughts:
Okay, I'm ready. Here's my attempt to summarize the prompt's instructions, adopting a first-person perspective, as if I'm processing them myself:

**Understanding the Task**

Alright, let's break this down. The core request is clear: I'm being asked to summarize a given text, but with a specific twist. The summary needs to represent my *internal thought process* in doing so. This isn't just a simple factual paraphrase; it's about capturing the mental steps, the analytical lens, as I engage with the provided text. I need to convey my interpretive journey, not just the destination.

The user is presumed to be an expert. This informs my approach; I won't need to over-explain basic concepts or definitions. I can assume a higher level of understanding and focus on the nuances, the inferred meanings, and the potentially subtle implications of my analysis. The aim is to create a response that is accurate but also insightful and sophisticated. My goal is to add value, and convey that value with the appropriate level of specificity for an expert.



127/4 2026/08/17 21:13 tool codeeditor
0m Args:
map[CurrentCode:	lnb_voltage = htonl(state->voltage);
	memcpy(&b[28], &lnb_voltage, sizeof(u32));

	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);

	return 0; NewCode:	lnb_voltage = htonl(state->voltage);
	memcpy(&b[28], &lnb_voltage, sizeof(u32));

	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);

	return 0; SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[]

128/4 2026/08/17 21:13 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22372
							output: 52
							thoughts: 18
						

Thoughts:
Okay, let's dive into this `ttusbdecfe_dvbt_read_status` function. I need to understand its role within the larger system. My initial thought is to figure out what it's responsible for; what status information is it reading? Is this related to signal strength, error rates, demodulator lock, or something else entirely? I should probably start by quickly glancing at its definition and any associated documentation, if there is any, to get a handle on its inputs, outputs, and any potential side effects. I'll need to consider the context of the calling function as well to see what's driving this status read. Why is this specific status needed at this point in the program? Finally, I need to know how it handles error conditions. Does it return error codes, throw exceptions, or simply set a global error flag? This is critical for robust error handling further up the line.



129/4 2026/08/17 21:13 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c Name:ttusbdecfe_dvbt_read_status]

Results:
map[SourceCode:  36:	static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
  37:					       enum fe_status *status)
  38:	{
  39:		struct ttusbdecfe_state* state = fe->demodulator_priv;
  40:		u8 b[] = { 0x00, 0x00, 0x00, 0x00,
  41:			   0x00, 0x00, 0x00, 0x00 };
  42:		u8 result[4];
  43:		int len, ret;
  44:	
  45:		*status=0;
  46:	
  47:		ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
  48:		if(ret)
  49:			return ret;
  50:	
  51:		if(len != 4) {
  52:			printk(KERN_ERR "%s: unexpected reply\n", __func__);
  53:			return -EIO;
  54:		}
  55:	
  56:		switch(result[3]) {
  57:			case 1:  /* not tuned yet */
  58:			case 2:  /* no signal/no lock*/
  59:				break;
  60:			case 3:	 /* signal found and locked*/
  61:				*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
  62:				FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
  63:				break;
  64:			case 4:
  65:				*status = FE_TIMEDOUT;
  66:				break;
  67:			default:
  68:				pr_info("%s: returned unknown value: %d\n",
  69:					__func__, result[3]);
  70:				return -EIO;
  71:		}
  72:	
  73:		return 0;
  74:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

130/4 2026/08/17 21:13 llm patch-generator
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 23220
							output: 146
							thoughts: 36
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert in the field:

**Refactoring `ttusbdecfe_dvbt_read_status` for Enhanced Safety**

Alright, I'm looking at this `ttusbdecfe_dvbt_read_status` function, and something's just nagging at me. Specifically, that line: `&len, result);`. I'm immediately thinking, "That's asking for trouble down the line." We're passing the address of `len` and `result` which implies a read and write operation, but what's the buffer size for `result`? Without explicitly providing the size of `result` to the function, we're leaving ourselves open to potential buffer overflows or underruns.

In my experience, omitting that crucial piece of information, the size of `result` has lead to some nasty bugs in the past, hard to track down, and even harder to debug. And let's face it, these sorts of drivers are usually dealing with some pretty tight memory constraints anyway.

So, yeah, it's clear to me: I need to change that line to `&len, result, sizeof(result));`. Passing `sizeof(result)` guarantees that the function knows exactly how much data it can safely write into `result` and ensures that data integrity is maintained. It's a simple, proactive measure, but it's the kind of thing that prevents headaches and strengthens the overall robustness of the code. This will save me from having to revisit this function, or worse, have someone else find a bug from not following this practice.



131/4 2026/08/17 21:15 tool codeeditor
0m Args:
map[CurrentCode:	*status=0;

	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
	if(ret)
		return ret; NewCode:	*status=0;

	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
					sizeof(result));
	if(ret)
		return ret; SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[]

132/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 23751
							output: 52
							thoughts: 18
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing `ttusbdecfe_dvbt_set_frontend`**

Okay, let's dive into this `ttusbdecfe_dvbt_set_frontend` function. My first instinct is to understand its role within the broader DVB-T demodulation flow. It's obviously responsible for configuring the frontend, but I need to quickly establish *what* specific parameters it's setting and how that impacts the overall signal acquisition and demodulation pipeline. Are we talking about tuning frequency, symbol rate, modulation scheme, guard interval, hierarchical modulation... the whole shebang? I need to quickly identify the input parameters and their data types; I need to know the structure it's using to store frontend configuration; a quick glance at the header should tell me.

Next, I need to understand the hardware interaction. Does this function directly interface with registers on the demodulator IC, or is there an abstraction layer or a more complex communication protocol involved? Is it using I2C, SPI, or some other interface? Are there any device-specific quirks I need to keep in mind? Are there any error handling mechanisms, particularly related to the write operations? I'd expect some level of validation on the input parameters to prevent out-of-bounds register writes or unsupported configurations. Are there any timeouts or retry mechanisms for potentially unreliable communication channels?

The return value will be important. I need to understand the error codes returned in case of a problem, and the general way the return codes are implemented in this driver. Are we talking about a simple integer error code, or a more sophisticated error structure that includes more detailed information? Any logging within the function would be helpful in diagnosing potential problems. I hope it’s reasonably well-commented; this is a core piece of the demodulator setup.

Finally, I'm going to have to consider potential side effects. Does this function potentially impact other related components or subsystems? Does it need to handle any interdependencies with other functions in the driver? Are there any resource locks or other considerations for concurrent access? This is going to be my thought process as I start digging into the details.



133/4 2026/08/17 21:15 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c Name:ttusbdecfe_dvbt_set_frontend]

Results:
map[SourceCode:  76:	static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
  77:	{
  78:		struct dtv_frontend_properties *p = &fe->dtv_property_cache;
  79:		struct ttusbdecfe_state *state = fe->demodulator_priv;
  80:		u8 b[] = { 0x00, 0x00, 0x00, 0x03,
  81:			   0x00, 0x00, 0x00, 0x00,
  82:			   0x00, 0x00, 0x00, 0x01,
  83:			   0x00, 0x00, 0x00, 0xff,
  84:			   0x00, 0x00, 0x00, 0xff };
  85:	
  86:		__be32 freq = htonl(p->frequency / 1000);
  87:		memcpy(&b[4], &freq, sizeof (u32));
  88:		state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
  89:	
  90:		return 0;
  91:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

134/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24661
							output: 187
							thoughts: 33
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Refactoring a DVB-T Frontend Initialization**

Right, let me see... I'm looking at the `ttusbdecfe_dvbt_set_frontend` function again. I recall we had a discussion a while back about potential ambiguity in how the frontend is initialized. Specifically, that line, the one with `NULL, NULL);`. My instinct is screaming that we should clarify that call. It's not *wrong* per se, but it lacks explicitness. We're relying on some default behavior, likely in the underlying DVB API, for a third argument. I bet it is related to an initial tuning or parameters, which are currently being defaulted to zero.

So, to enhance clarity and future-proof the code, I'm thinking I'll change that to `NULL, NULL, 0);`. Explicitly stating `0` as the third parameter immediately tells anyone reading the code that we are intentionally not providing any initial tuning/parameter information. This adds a layer of robustness. This change explicitly communicates the default behavior.

It won't likely change the runtime performance at all; I'm pretty sure that the underlying layers are already handling the default of zero if an optional argument is omitted. However, making this change is better for maintainability, and it documents the function call explicitly and more clearly.



135/4 2026/08/17 21:15 tool codeeditor
0m Args:
map[CurrentCode:	__be32 freq = htonl(p->frequency / 1000);
	memcpy(&b[4], &freq, sizeof (u32));
	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);

	return 0; NewCode:	__be32 freq = htonl(p->frequency / 1000);
	memcpy(&b[4], &freq, sizeof (u32));
	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);

	return 0; SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[]

136/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25191
							output: 260
							thoughts: 21
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Updating `fe_send_command` in `ttusb_dec.c`**

Okay, time to get to the core of this. Let's dig into `fe_send_command` within the `ttusb_dec.c` file. I'm already visualizing the structure, the probable calls, and the dependencies. I need to make sure this update is seamless, non-disruptive, and, of course, absolutely correct given the downstream implications within the system. Let's see what needs to be changed and, most importantly, *why*. I'm anticipating potential issues with data flow, command serialization, or even interrupt handling, so a thorough review is a must. No shortcuts here. Let's get to work.



137/4 2026/08/17 21:15 tool codeeditor
0m Args:
map[CurrentCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[])
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
} NewCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[],
			   int cmd_result_len)
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
} SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

138/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25651
							output: 194
							thoughts: 24
						

Thoughts:
Okay, here's my take on those thoughts, framed from my perspective, assuming I'm a seasoned expert:

**Refactoring the `ttusb_dec_send_command` Function**

Alright, time to get my hands dirty. I'm going to revisit `ttusb_dec_send_command` in `ttusb_dec.c`. This function is likely the linchpin for how the driver communicates with the USB device, so it's critical to ensure its reliability and efficiency. I'll need to carefully consider any changes to avoid regressions, particularly in how it handles error conditions and command sequences. I’ll be thinking about:

*   **Concurrency:** Are there any potential race conditions? Does it correctly handle multiple commands sent concurrently or in rapid succession?
*   **Error Handling:** What's the current error reporting like? Does it provide enough diagnostic information for debugging? Does it handle device disconnects gracefully?
*   **Command Structure:** Is the command packet structure optimal? Can it be streamlined or optimized for the specific hardware? Are there redundant fields or inefficient data types?
*   **Performance:** Does this function introduce any significant latency? Can I improve its efficiency through better buffering, more efficient data transfers, or optimized loop constructs? I know this driver intimately, so I know I can identify the bottlenecks.
*   **Clarity and Maintainability:** Can I refactor the code to improve its readability and make it easier to maintain in the future? Maybe some comments here and there would be useful.
*   **Potential Side Effects:** It is critical to ensure that changing this function will not break other functions in the driver or related modules.

Essentially, I need to methodically dissect this function, consider its implications, and make well-informed decisions to improve its robustness and overall performance. No room for guesswork here; this requires a deep understanding of the hardware, the USB protocol, and the existing driver architecture. Let's make this rock-solid.



139/4 2026/08/17 21:15 tool codeeditor
0m Args:
map[CurrentCode:static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[])
{
	int result, actual_len;
	u8 *b; NewCode:static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	int result, actual_len;
	u8 *b; SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

140/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26288
							output: 445
							thoughts: 27
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Refactoring the `ttusb_dec_send_command` Function**

Alright, time to get my hands dirty and refactor `ttusb_dec_send_command` within `ttusb_dec.c`. We're talking about a core function here, likely a bottleneck or a critical point of failure in the entire USB-to-TTL decoding process. I need to be methodical. The goal isn't just to make it work, but to ensure it's robust, efficient, and easily maintainable going forward. Let's make sure it handles error checking properly. There's probably opportunity to improve this function.



141/4 2026/08/17 21:15 tool codeeditor
0m Args:
map[CurrentCode:	if (result) {
		printk("%s: result bulk message failed: error %d\n",
		       __func__, result);
		goto err_mutex_unlock;
	} else {
		if (debug) {
			printk(KERN_DEBUG "%s: result: %*ph\n",
			       __func__, actual_len, b);
		}

		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0)
			memcpy(cmd_result, &b[4], b[3]);
	} NewCode:	if (result) {
		printk("%s: result bulk message failed: error %d\n",
		       __func__, result);
		goto err_mutex_unlock;
	} else {
		if (debug) {
			printk(KERN_DEBUG "%s: result: %*ph\n",
			       __func__, actual_len, b);
		}

		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0) {
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
	} SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

142/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26918
							output: 62
							thoughts: 28
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Refactoring Implications and Call Site Impact**

Alright, so I've just modified `ttusb_dec_send_command` in `ttusb_dec.c`. Now the real work begins. I can't just assume I'm the only one who uses this function; far from it. My immediate concern is updating *every single caller* of `ttusb_dec_send_command` throughout the codebase. I need to methodically identify each instance where this function is called, analyze the context of the call, and determine the necessary adjustments to maintain correct behavior, now that I've changed how `ttusb_dec_send_command` operates. This isn't just a search-and-replace; it's a careful analysis to ensure that the calling code still functions as intended and integrates properly with the broader system after my change.



143/4 2026/08/17 21:15 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c IncludeSnippetLines:2 Name:ttusb_dec_send_command SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:fe_send_command SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1627 SourceSnippet:1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1357 SourceSnippet:1355:		memcpy(&b0[6], &firmware_csum_ns, 2);
1356:	
1357:		result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
1358:	
1359:		if (result) {
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1398 SourceSnippet:1396:		}
1397:	
1398:		result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
1399:	
1400:		release_firmware(fw_entry);
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_get_stb_state SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:392 SourceSnippet: 390:		dprintk("%s\n", __func__);
 391:	
 392:		result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
 393:		if (result)
 394:			return result;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_interface SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:904 SourceSnippet: 902:				break;
 903:			case TTUSB_DEC_INTERFACE_IN:
 904:				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
 905:								b, NULL, NULL);
 906:				if (result)
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_pids SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:451 SourceSnippet: 449:		memcpy(&b[4], &video, 2);
 450:	
 451:		ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
 452:	
 453:		dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1058 SourceSnippet:1056:		memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
1057:	
1058:		result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
1059:						&c_length, c);
1060:	
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1024 SourceSnippet:1022:		}
1023:	
1024:		result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
1025:		if (result)
1026:			return result;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1138 SourceSnippet:1136:		spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
1137:		kfree(finfo);
1138:		ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
1139:	
1140:		dec->filter_stream_count--;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1117 SourceSnippet:1115:		u8 b0[] = { 0x00 };
1116:	
1117:		ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
1118:	
1119:		dec->pva_stream_count--;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_init_rc SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1241 SourceSnippet:1239:			printk("%s: usb_submit_urb failed\n",__func__);
1240:		/* enable irq pipe */
1241:		ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1242:	
1243:		return 0;
]] TruncatedOutput:false]

144/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28933
							output: 46
							thoughts: 54
						

Thoughts:
Okay, here's the summary of those thoughts, tailored for an expert audience, presented in the first person:

**Revisiting `fe_send_command`**

Alright, I need to revisit `fe_send_command` again. Damn it, I thought I'd caught everything, but I'm having a nagging feeling about `cmd_result_len` and its passing to `ttusb_dec_send_command`. Did I account for that correctly? Let me just double-check that `fe_send_command` one more time...I know I went back in there and made changes, but I need to make sure I caught that subtle nuance. I need to be absolutely certain that's correct, or this is going to bite me later.



145/4 2026/08/17 21:15 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c Name:fe_send_command]

Results:
map[SourceCode:1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

146/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29374
							output: 260
							thoughts: 28
						

Thoughts:
Okay, here's my summary, in the first person, as requested:

**Resending the Command**

Right, that `fe_send_command` call didn't seem to go through as expected, or maybe the application wasn't ready for it. No problem; let's give it another shot. It's a common debugging step – assume failure and retry. Time to resend the command and confirm it's now applied. Hopefully the second time's the charm!



147/4 2026/08/17 21:15 tool codeeditor
0m Error:
log-in to see details

Args:
map[CurrentCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[])
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
} NewCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[],
			   int cmd_result_len)
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
} SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

148/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29796
							output: 46
							thoughts: 23
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into `fe_send_command` within `ttusb_dec.c`**

Alright, let's get down to brass tacks. I need to understand the intricacies of how commands are being dispatched from the higher-level framework down to the hardware within this `ttusb_dec.c` module. Specifically, I'm zeroing in on `fe_send_command`. I'm going to want to see how this function handles the raw command construction, how it interacts with the underlying USB transaction layers, and if there are any interesting optimizations or error-handling strategies employed. I'm hoping to get a clear picture of its role in the overall data flow and how it fits within the larger architecture. I'll be looking for potential bottlenecks, race conditions, or areas ripe for further performance tuning or debugging. Understanding the calling context is important, too. Where is this function being invoked from, and what kind of data structures are being passed to it? The devil is always in the details, so let's start digging.



149/4 2026/08/17 21:15 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c Name:fe_send_command]

Results:
map[SourceCode:1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
 SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

150/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30280
							output: 260
							thoughts: 31
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Code Synchronization Concerns**

Hold on a second... I *know* I just patched the `ttusb_dec_send_command` function not long ago, making sure its interactions were aligned. But did I also update the `fe_send_command` function? I need to be absolutely sure that they're both harmonized, given the likely dependencies. The last thing I need is a subtle divergence leading to flaky behavior down the line. To avoid any room for doubt, let's go straight to the code. No room for guesswork on this critical piece. I'll compare the revisions side-by-side to verify everything is in order.



151/4 2026/08/17 21:15 tool codeeditor
0m Error:
log-in to see details

Args:
map[CurrentCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[])
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
} NewCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[],
			   int cmd_result_len)
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
} SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

152/4 2026/08/17 21:15 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30758
							output: 46
							thoughts: 14
						

Thoughts:
Here's the summary, assuming I'm an expert reading the text:

**Focusing on a Specific File Section**

Okay, let's zero in on a particular part of the code, around line 1622 of the file. I need to understand the context, and what's happening at that line. Often, targeted analysis is more effective than broad sweeps, particularly when dealing with complex systems. Identifying this specific area allows me to quickly assess the immediate situation and how it relates to the bigger picture. From my expertise, a focused review will offer insights, saving valuable time.



153/4 2026/08/17 21:16 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1620 LineCount:15]

Results:
map[Contents:1620:	}
1621:	
1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
1629:	
1630:	static const struct ttusbdecfe_config fe_config = {
1631:		.send_command = fe_send_command
1632:	};
1633:	
1634:	static int ttusb_dec_probe(struct usb_interface *intf,
]

154/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31193
							output: 260
							thoughts: 35
						

Thoughts:
Okay, here's my interpretation of those thoughts, framed as an expert's internal monologue:

**Investigating a Discrepancy in Command Handling**

Right, so I'm picking up on something here. I'm noticing a discrepancy in the command sending routines. `ttusb_dec_send_command` has been recently updated, presumably to address some issue or incorporate a new feature. But, the companion function, `fe_send_command`, appears to have been overlooked. This immediately raises a red flag. It's possible that the changes in `ttusb_dec_send_command` introduced an incompatibility, or perhaps a duplicated function, or maybe a missed opportunity. This could cause the system to behave erratically. My next step will be to examine the relationship between those two functions and determine what changes are needed to ensure consistency and prevent regressions. Let's dig in and see if this requires adjustment.



155/4 2026/08/17 21:16 tool codeeditor
0m Error:
log-in to see details

Args:
map[CurrentCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[])
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
} NewCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[],
			   int cmd_result_len)
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
} SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

156/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31814
							output: 63
							thoughts: 38
						

Thoughts:
Okay, here's my interpretation of those thoughts, crafted with the expectation that I'm discussing this with a fellow expert:

**Debugging a Code Discrepancy**

Right, that "CurrentCode snippet does not match anything in the source file" error is seriously throwing me off. I was pretty sure the code was there, so now I'm thinking I must have missed something. I need to take another look at the callers of `ttusb_dec_send_command`. Clearly, something's not lining up, and I need to figure out how the code is *actually* being called in its current context. Maybe there's a version mismatch somewhere, or a preprocessor condition I'm overlooking that's excluding the relevant code path. Time to dive back in and trace those calls.



157/4 2026/08/17 21:16 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusb_dec.c IncludeSnippetLines:2 Name:ttusb_dec_send_command SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:fe_send_command SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1627 SourceSnippet:1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1357 SourceSnippet:1355:		memcpy(&b0[6], &firmware_csum_ns, 2);
1356:	
1357:		result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
1358:	
1359:		if (result) {
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_boot_dsp SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1398 SourceSnippet:1396:		}
1397:	
1398:		result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
1399:	
1400:		release_firmware(fw_entry);
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_get_stb_state SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:392 SourceSnippet: 390:		dprintk("%s\n", __func__);
 391:	
 392:		result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
 393:		if (result)
 394:			return result;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_interface SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:904 SourceSnippet: 902:				break;
 903:			case TTUSB_DEC_INTERFACE_IN:
 904:				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
 905:								b, NULL, NULL);
 906:				if (result)
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_set_pids SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:451 SourceSnippet: 449:		memcpy(&b[4], &video, 2);
 450:	
 451:		ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
 452:	
 453:		dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1058 SourceSnippet:1056:		memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
1057:	
1058:		result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
1059:						&c_length, c);
1060:	
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_start_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1024 SourceSnippet:1022:		}
1023:	
1024:		result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
1025:		if (result)
1026:			return result;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_sec_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1138 SourceSnippet:1136:		spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
1137:		kfree(finfo);
1138:		ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
1139:	
1140:		dec->filter_stream_count--;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_dec_stop_ts_feed SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1117 SourceSnippet:1115:		u8 b0[] = { 0x00 };
1116:	
1117:		ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
1118:	
1119:		dec->pva_stream_count--;
] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ttusb_init_rc SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1241 SourceSnippet:1239:			printk("%s: usb_submit_urb failed\n",__func__);
1240:		/* enable irq pipe */
1241:		ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1242:	
1243:		return 0;
]] TruncatedOutput:false]

158/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33811
							output: 15
							thoughts: 31
						

Thoughts:
Okay, here's my interpretation of those thoughts, summarized from a first-person perspective, assuming I'm deeply familiar with code editors and patch diffing:

**Initial Success & Next Steps**

Right, that's encouraging. My initial attempt at using the `fe_send_command` function within the code editor seems to have worked without a hitch. Good! Now, the next logical step, given that the foundation is sound, is to rigorously test the `patch-diff` functionality. I need to confirm that the changes have been correctly applied and that the diff tool is behaving as expected, considering the successful command execution. This is the critical next point.



159/4 2026/08/17 21:16 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..200a57927 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -307,76 +307,92 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 		crc ^= *buf++;
 		crc ^= (u8)crc >> 4;
 		tmp = (u8)crc;
 		crc ^= (tmp ^ (tmp << 1)) << 4;
 	}
 	return crc;
 }
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
 
 	result = mutex_lock_interruptible(&dec->usb_mutex);
 	if (result) {
 		printk("%s: Failed to lock usb mutex.\n", __func__);
 		goto err_free;
 	}
 
 	b[0] = 0xaa;
 	b[1] = ++dec->trans_count;
 	b[2] = command;
 	b[3] = param_length;
 
 	if (params)
 		memcpy(&b[4], params, param_length);
 
 	if (debug) {
 		printk(KERN_DEBUG "%s: command: %*ph\n",
 		       __func__, param_length, b);
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: command bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: result bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	} else {
 		if (debug) {
 			printk(KERN_DEBUG "%s: result: %*ph\n",
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
 	mutex_unlock(&dec->usb_mutex);
 err_free:
 	kfree(b);
 	return result;
 }
 
 static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
@@ -1614,24 +1630,25 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 	while ((item = dec->filter_info_list.next) != &dec->filter_info_list) {
 		finfo = list_entry(item, struct filter_info, filter_info_list);
 		list_del(&finfo->filter_info_list);
 		kfree(finfo);
 	}
 }
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
 	.send_command = fe_send_command
 };
 
 static int ttusb_dec_probe(struct usb_interface *intf,
 			   const struct usb_device_id *id)
 {
 	struct usb_device *udev;
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..0bd80ade4 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -36,39 +36,40 @@ static int ttusbdecfe_dvbs_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 				       enum fe_status *status)
 {
 	struct ttusbdecfe_state* state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	u8 result[4];
 	int len, ret;
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					sizeof(result));
 	if(ret)
 		return ret;
 
 	if(len != 4) {
 		printk(KERN_ERR "%s: unexpected reply\n", __func__);
 		return -EIO;
 	}
 
 	switch(result[3]) {
 		case 1:  /* not tuned yet */
 		case 2:  /* no signal/no lock*/
 			break;
 		case 3:	 /* signal found and locked*/
 			*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
 			FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
 			break;
 		case 4:
 			*status = FE_TIMEDOUT;
 			break;
 		default:
 			pr_info("%s: returned unknown value: %d\n",
 				__func__, result[3]);
 			return -EIO;
 	}
 
 	return 0;
 }
@@ -76,23 +77,23 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x03,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0xff,
 		   0x00, 0x00, 0x00, 0xff };
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 					struct dvb_frontend_tune_settings* fesettings)
 {
 		fesettings->min_delay_ms = 1500;
 		/* Drift compensation makes no sense for DVB-T */
 		fesettings->step_size = 0;
@@ -103,60 +104,60 @@ static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
 	u8 b[] = { 0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	__be32 freq;
 	__be32 sym_rate;
 	__be32 band;
 	__be32 lnb_voltage;
 
 	freq = htonl(p->frequency +
 	       (state->hi_band ? LOF_HI : LOF_LO));
 	memcpy(&b[4], &freq, sizeof(u32));
 	sym_rate = htonl(p->symbol_rate);
 	memcpy(&b[12], &sym_rate, sizeof(u32));
 	band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 	memcpy(&b[24], &band, sizeof(u32));
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0xff, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00 };
 
 	if (cmd->msg_len > sizeof(b) - 4)
 		return -EINVAL;
 
 	memcpy(&b[4], cmd->msg, cmd->msg_len);
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
 
 
 static int ttusbdecfe_dvbs_set_tone(struct dvb_frontend *fe,
 				    enum fe_sec_tone_mode tone)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -7,18 +7,19 @@
 
 #ifndef TTUSBDECFE_H
 #define TTUSBDECFE_H
 
 #include <linux/dvb/frontend.h>
 
 struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 
 extern struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config);
 
 #endif // TTUSBDECFE_H
]

160/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 37851
							output: 111
							thoughts: 38
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Refactoring Reminder: Don't Forget the Callers!**

Okay, I've got this `ttusb_dec.c` change nailed down, but wait a second... there's that `ttusb_dec_send_command` function. I'm modifying its internals, meaning I absolutely *must* track down *every single* place that calls it. This isn't just a minor tweak; a change here ripples outward. I need to ensure the calling contexts are updated to reflect whatever interface modifications I'm introducing. Right, let's get those cross-references sorted immediately. Time to update those callers and ensure everything still functions as expected. No assumptions, full code review, make sure everything still passes the tests. Gotta be thorough.



161/4 2026/08/17 21:16 tool codeeditor
0m Args:
map[CurrentCode:	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL); NewCode:	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

162/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 38184
							output: 111
							thoughts: 3
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and delivered in the first person:

**Next Caller - Immediate Assessment & Tactical Considerations**

Alright, new caller, let's see what we've got. The immediate focus is on rapid assessment. My brain is already running through a mental checklist: what's the typical range of issues in this queue? What are the key indicators I'll be listening for in the initial greeting and problem description? I'm anticipating the potential areas they might be struggling in, based on the historical data of the type of customers I usually get. My mind will be ready to quickly assess the caller's level of technical understanding, their emotional state, and the potential severity of the issue. Pre-programmed in my mind are the troubleshooting steps that I can use to narrow the field. From there I'll have the tactical considerations: how to explain this in the clearest terms for the caller? What’s the most efficient path to resolution, balancing speed with thoroughness to prevent repeat calls? My experience will tell me whether this call will need to escalate to a specialist, or whether I can quickly resolve this call.



163/4 2026/08/17 21:16 tool codeeditor
0m Args:
map[CurrentCode:	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL); NewCode:	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

164/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 38550
							output: 114
							thoughts: 3
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and delivered in the first person:

**Next Caller - Immediate Assessment & Tactical Considerations**

Alright, new caller, let's see what we've got. The immediate focus is on rapid assessment. My brain is already running through a mental checklist: what's the typical range of issues in this queue? What are the key indicators I'll be listening for in the initial greeting and problem description? I'm anticipating the potential areas they might be struggling in, based on the historical data of the type of customers I usually get. My mind will be ready to quickly assess the caller's level of technical understanding, their emotional state, and the potential severity of the issue. Pre-programmed in my mind are the troubleshooting steps that I can use to narrow the field. From there I'll have the tactical considerations: how to explain this in the clearest terms for the caller? What’s the most efficient path to resolution, balancing speed with thoroughness to prevent repeat calls? My experience will tell me whether this call will need to escalate to a specialist, or whether I can quickly resolve this call.



165/4 2026/08/17 21:16 tool codeeditor
0m Args:
map[CurrentCode:	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c); NewCode:	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
					sizeof(c)); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

166/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 38919
							output: 135
							thoughts: 3
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and delivered in the first person:

**Next Caller - Immediate Assessment & Tactical Considerations**

Alright, new caller, let's see what we've got. The immediate focus is on rapid assessment. My brain is already running through a mental checklist: what's the typical range of issues in this queue? What are the key indicators I'll be listening for in the initial greeting and problem description? I'm anticipating the potential areas they might be struggling in, based on the historical data of the type of customers I usually get. My mind will be ready to quickly assess the caller's level of technical understanding, their emotional state, and the potential severity of the issue. Pre-programmed in my mind are the troubleshooting steps that I can use to narrow the field. From there I'll have the tactical considerations: how to explain this in the clearest terms for the caller? What’s the most efficient path to resolution, balancing speed with thoroughness to prevent repeat calls? My experience will tell me whether this call will need to escalate to a specialist, or whether I can quickly resolve this call.



167/4 2026/08/17 21:16 tool codeeditor
0m Args:
map[CurrentCode:			case TTUSB_DEC_INTERFACE_IN:
				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
								b, NULL, NULL); NewCode:			case TTUSB_DEC_INTERFACE_IN:
				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
								b, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

168/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 39309
							output: 103
							thoughts: 3
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and delivered in the first person:

**Next Caller - Immediate Assessment & Tactical Considerations**

Alright, new caller, let's see what we've got. The immediate focus is on rapid assessment. My brain is already running through a mental checklist: what's the typical range of issues in this queue? What are the key indicators I'll be listening for in the initial greeting and problem description? I'm anticipating the potential areas they might be struggling in, based on the historical data of the type of customers I usually get. My mind will be ready to quickly assess the caller's level of technical understanding, their emotional state, and the potential severity of the issue. Pre-programmed in my mind are the troubleshooting steps that I can use to narrow the field. From there I'll have the tactical considerations: how to explain this in the clearest terms for the caller? What’s the most efficient path to resolution, balancing speed with thoroughness to prevent repeat calls? My experience will tell me whether this call will need to escalate to a specialist, or whether I can quickly resolve this call.



169/4 2026/08/17 21:16 tool codeeditor
0m Args:
map[CurrentCode:	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL); NewCode:	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

170/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 39667
							output: 122
							thoughts: 3
						

Thoughts:
Okay, I'm ready. Let's get this done.
***

**Processing the Next Inquiry**

Alright, new caller coming up. Time to switch gears, assess the situation, and be ready to provide a solid, informed response. I need to be quick, efficient, and address their specific needs. No room for hesitation, I need to listen carefully to the caller's concerns and be prepared to use the right technical jargon to communicate my point effectively. Let's get down to business.



171/4 2026/08/17 21:16 tool codeeditor
0m Args:
map[CurrentCode:	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
					&c_length, c); NewCode:	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
					&c_length, c, sizeof(c)); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

172/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 39904
							output: 111
							thoughts: 3
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and delivered in the first person:

**Next Caller - Immediate Assessment & Tactical Considerations**

Alright, new caller, let's see what we've got. The immediate focus is on rapid assessment. My brain is already running through a mental checklist: what's the typical range of issues in this queue? What are the key indicators I'll be listening for in the initial greeting and problem description? I'm anticipating the potential areas they might be struggling in, based on the historical data of the type of customers I usually get. My mind will be ready to quickly assess the caller's level of technical understanding, their emotional state, and the potential severity of the issue. Pre-programmed in my mind are the troubleshooting steps that I can use to narrow the field. From there I'll have the tactical considerations: how to explain this in the clearest terms for the caller? What’s the most efficient path to resolution, balancing speed with thoroughness to prevent repeat calls? My experience will tell me whether this call will need to escalate to a specialist, or whether I can quickly resolve this call.



173/4 2026/08/17 21:16 tool codeeditor
0m Args:
map[CurrentCode:	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL); NewCode:	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

174/4 2026/08/17 21:16 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 40270
							output: 107
							thoughts: 3
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and delivered in the first person:

**Next Caller - Immediate Assessment & Tactical Considerations**

Alright, new caller, let's see what we've got. The immediate focus is on rapid assessment. My brain is already running through a mental checklist: what's the typical range of issues in this queue? What are the key indicators I'll be listening for in the initial greeting and problem description? I'm anticipating the potential areas they might be struggling in, based on the historical data of the type of customers I usually get. My mind will be ready to quickly assess the caller's level of technical understanding, their emotional state, and the potential severity of the issue. Pre-programmed in my mind are the troubleshooting steps that I can use to narrow the field. From there I'll have the tactical considerations: how to explain this in the clearest terms for the caller? What’s the most efficient path to resolution, balancing speed with thoroughness to prevent repeat calls? My experience will tell me whether this call will need to escalate to a specialist, or whether I can quickly resolve this call.



175/4 2026/08/17 21:17 tool codeeditor
0m Args:
map[CurrentCode:	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL); NewCode:	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

176/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 40632
							output: 107
							thoughts: 3
						

Thoughts:
Okay, I'm ready. Let's get this done.
***

**Processing the Next Inquiry**

Alright, new caller coming up. Time to switch gears, assess the situation, and be ready to provide a solid, informed response. I need to be quick, efficient, and address their specific needs. No room for hesitation, I need to listen carefully to the caller's concerns and be prepared to use the right technical jargon to communicate my point effectively. Let's get down to business.



177/4 2026/08/17 21:17 tool codeeditor
0m Args:
map[CurrentCode:	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL); NewCode:	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

178/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 40854
							output: 98
							thoughts: 3
						

Thoughts:
Okay, I'm ready. Let's get this done.
***

**Processing the Next Inquiry**

Alright, new caller coming up. Time to switch gears, assess the situation, and be ready to provide a solid, informed response. I need to be quick, efficient, and address their specific needs. No room for hesitation, I need to listen carefully to the caller's concerns and be prepared to use the right technical jargon to communicate my point effectively. Let's get down to business.



179/4 2026/08/17 21:17 tool codeeditor
0m Args:
map[CurrentCode:	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL); NewCode:	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

180/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 41067
							output: 15
							thoughts: 11
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Revisiting the Diff**

Alright, time to circle back and give that `patch-diff` another look. There's a nagging feeling that something might be missed, some subtle interaction I'd like to confirm, or perhaps a potential edge case that wasn't immediately apparent. I need to make sure I've accounted for all the nuances, especially given the complexity of the current codebase. Always wise to double-check these things, particularly with changes this intricate. Let's see if a fresh set of eyes reveals anything new. It’s better to be thorough now than to chase down a silent bug later.



181/4 2026/08/17 21:17 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..4aa26e08d 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -307,107 +307,124 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 		crc ^= *buf++;
 		crc ^= (u8)crc >> 4;
 		tmp = (u8)crc;
 		crc ^= (tmp ^ (tmp << 1)) << 4;
 	}
 	return crc;
 }
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
 
 	result = mutex_lock_interruptible(&dec->usb_mutex);
 	if (result) {
 		printk("%s: Failed to lock usb mutex.\n", __func__);
 		goto err_free;
 	}
 
 	b[0] = 0xaa;
 	b[1] = ++dec->trans_count;
 	b[2] = command;
 	b[3] = param_length;
 
 	if (params)
 		memcpy(&b[4], params, param_length);
 
 	if (debug) {
 		printk(KERN_DEBUG "%s: command: %*ph\n",
 		       __func__, param_length, b);
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: command bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: result bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	} else {
 		if (debug) {
 			printk(KERN_DEBUG "%s: result: %*ph\n",
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
 	mutex_unlock(&dec->usb_mutex);
 err_free:
 	kfree(b);
 	return result;
 }
 
 static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 				    unsigned int *model, unsigned int *version)
 {
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	__be32 tmp;
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
 	if (c_length >= 0x0c) {
 		if (mode != NULL) {
 			memcpy(&tmp, c, 4);
 			*mode = ntohl(tmp);
 		}
 		if (model != NULL) {
 			memcpy(&tmp, &c[4], 4);
 			*model = ntohl(tmp);
 		}
 		if (version != NULL) {
 			memcpy(&tmp, &c[8], 4);
 			*version = ntohl(tmp);
 		}
 		return 0;
 	} else {
 		return -ENOENT;
 	}
 }
@@ -435,27 +452,27 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
 static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 {
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0xff, 0xff,
 		   0xff, 0xff, 0xff, 0xff };
 
 	__be16 pcr = htons(dec->pid[DMX_PES_PCR]);
 	__be16 audio = htons(dec->pid[DMX_PES_AUDIO]);
 	__be16 video = htons(dec->pid[DMX_PES_VIDEO]);
 
 	dprintk("%s\n", __func__);
 
 	memcpy(&b[0], &pcr, 2);
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
 	dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO],
 			       ttusb_dec_video_pes2ts_cb, dec);
 	dec->v_pes_length = 0;
 	dec->v_pes_postbytes = 0;
 }
 
 static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
@@ -888,35 +905,35 @@ static void ttusb_dec_stop_iso_xfer(struct ttusb_dec *dec)
 /* Setting the interface of the DEC tends to take down the USB communications
  * for a short period, so it's important not to call this function just before
  * trying to talk to it.
  */
 static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 				   enum ttusb_dec_interface interface)
 {
 	int result = 0;
 	u8 b[] = { 0x05 };
 
 	if (interface != dec->interface) {
 		switch (interface) {
 		case TTUSB_DEC_INTERFACE_INITIAL:
 			result = usb_set_interface(dec->udev, 0, 0);
 			break;
-		case TTUSB_DEC_INTERFACE_IN:
-			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+			case TTUSB_DEC_INTERFACE_IN:
+				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
+								b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
 			break;
 		case TTUSB_DEC_INTERFACE_OUT:
 			result = usb_set_interface(dec->udev, 0, 1);
 			break;
 		}
 
 		if (result)
 			return result;
 
 		dec->interface = interface;
 	}
 
 	return 0;
 }
@@ -964,121 +981,121 @@ static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
 static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
 	struct ttusb_dec *dec = dvbdmx->priv;
 	u8 b0[] = { 0x05 };
 	int result = 0;
 
 	dprintk("%s\n", __func__);
 
 	dprintk("  ts_type:");
 
 	if (dvbdmxfeed->ts_type & TS_DECODER)
 		dprintk(" TS_DECODER");
 
 	if (dvbdmxfeed->ts_type & TS_PACKET)
 		dprintk(" TS_PACKET");
 
 	if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
 		dprintk(" TS_PAYLOAD_ONLY");
 
 	dprintk("\n");
 
 	switch (dvbdmxfeed->pes_type) {
 
 	case DMX_PES_VIDEO:
 		dprintk("  pes_type: DMX_PES_VIDEO\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		dec->pid[DMX_PES_VIDEO] = dvbdmxfeed->pid;
 		dec->video_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_AUDIO:
 		dprintk("  pes_type: DMX_PES_AUDIO\n");
 		dec->pid[DMX_PES_AUDIO] = dvbdmxfeed->pid;
 		dec->audio_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_TELETEXT:
 		dec->pid[DMX_PES_TELETEXT] = dvbdmxfeed->pid;
 		dprintk("  pes_type: DMX_PES_TELETEXT(not supported)\n");
 		return -ENOSYS;
 
 	case DMX_PES_PCR:
 		dprintk("  pes_type: DMX_PES_PCR\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_OTHER:
 		dprintk("  pes_type: DMX_PES_OTHER(not supported)\n");
 		return -ENOSYS;
 
 	default:
 		dprintk("  pes_type: unknown (%d)\n", dvbdmxfeed->pes_type);
 		return -EINVAL;
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
 	dec->pva_stream_count++;
 	return ttusb_dec_start_iso_xfer(dec);
 }
 
 static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x01,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0xff, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00 };
 	__be16 pid;
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	struct filter_info *finfo;
 	unsigned long flags;
 	u8 x = 1;
 
 	dprintk("%s\n", __func__);
 
 	pid = htons(dvbdmxfeed->pid);
 	memcpy(&b0[0], &pid, 2);
 	memcpy(&b0[4], &x, 1);
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
 			if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC)))
 				return -ENOMEM;
 
 			finfo->stream_id = c[1];
 			finfo->filter = dvbdmxfeed->filter;
 
 			spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 			list_add_tail(&finfo->filter_info_list,
 				      &dec->filter_info_list);
 			spin_unlock_irqrestore(&dec->filter_info_list_lock,
 					       flags);
 
 			dvbdmxfeed->priv = finfo;
 
 			dec->filter_stream_count++;
 			return ttusb_dec_start_iso_xfer(dec);
 		}
 
 		return -EAGAIN;
 	} else
 		return result;
 }
@@ -1107,42 +1124,42 @@ static int ttusb_dec_start_feed(struct dvb_demux_feed *dvbdmxfeed)
 		return -EINVAL;
 
 	}
 }
 
 static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00 };
 	struct filter_info *finfo = dvbdmxfeed->priv;
 	unsigned long flags;
 
 	b0[1] = finfo->stream_id;
 	spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
@@ -1207,45 +1224,45 @@ static void ttusb_dec_init_bh_work(struct ttusb_dec *dec)
 static int ttusb_init_rc( struct ttusb_dec *dec)
 {
 	struct input_dev *input_dev;
 	u8 b[] = { 0x00, 0x01 };
 	int i;
 	int err;
 
 	usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
 	strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
 
 	input_dev = input_allocate_device();
 	if (!input_dev)
 		return -ENOMEM;
 
 	input_dev->name = "ttusb_dec remote control";
 	input_dev->phys = dec->rc_phys;
 	input_dev->evbit[0] = BIT_MASK(EV_KEY);
 	input_dev->keycodesize = sizeof(u16);
 	input_dev->keycodemax = 0x1a;
 	input_dev->keycode = rc_keys;
 
 	for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
 		  set_bit(rc_keys[i], input_dev->keybit);
 
 	err = input_register_device(input_dev);
 	if (err) {
 		input_free_device(input_dev);
 		return err;
 	}
 
 	dec->rc_input_dev = input_dev;
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 
 	return 0;
 }
 
 static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
 {
 	dprintk("%s\n", __func__);
 
 	dec->v_pes[0] = 0x00;
 	dec->v_pes[1] = 0x00;
@@ -1298,111 +1315,111 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
 static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 {
 	int i, j, actual_len, result, size, trans_count;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x61, 0x00 };
 	u8 b1[] = { 0x61 };
 	u8 *b;
 	char idstring[21];
 	const u8 *firmware = NULL;
 	size_t firmware_size = 0;
 	u16 firmware_csum = 0;
 	__be16 firmware_csum_ns;
 	__be32 firmware_size_nl;
 	u32 crc32_csum, crc32_check;
 	__be32 tmp;
 	const struct firmware *fw_entry = NULL;
 
 	dprintk("%s\n", __func__);
 
 	result = request_firmware(&fw_entry, dec->firmware_name, &dec->udev->dev);
 	if (result) {
 		printk(KERN_ERR "%s: Firmware (%s) unavailable.\n",
 		       __func__, dec->firmware_name);
 		return result;
 	}
 
 	firmware = fw_entry->data;
 	firmware_size = fw_entry->size;
 
 	if (firmware_size < 60) {
 		printk("%s: firmware size too small for DSP code (%zu < 60).\n",
 			__func__, firmware_size);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 
 	/* a 32 bit checksum over the first 56 bytes of the DSP Code is stored
 	   at offset 56 of file, so use it to check if the firmware file is
 	   valid. */
 	crc32_csum = crc32(~0L, firmware, 56) ^ ~0L;
 	memcpy(&tmp, &firmware[56], 4);
 	crc32_check = ntohl(tmp);
 	if (crc32_csum != crc32_check) {
 		printk("%s: crc32 check of DSP code failed (calculated 0x%08x != 0x%08x in file), file invalid.\n",
 			__func__, crc32_csum, crc32_check);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 	memcpy(idstring, &firmware[36], 20);
 	idstring[20] = '\0';
 	printk(KERN_INFO "ttusb_dec: found DSP code \"%s\".\n", idstring);
 
 	firmware_size_nl = htonl(firmware_size);
 	memcpy(b0, &firmware_size_nl, 4);
 	firmware_csum = crc16(~0, firmware, firmware_size) ^ ~0;
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
 		return result;
 	}
 
 	trans_count = 0;
 	j = 0;
 
 	b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
 	if (b == NULL) {
 		release_firmware(fw_entry);
 		return -ENOMEM;
 	}
 
 	for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
 		size = firmware_size - i;
 		if (size > COMMAND_PACKET_SIZE)
 			size = COMMAND_PACKET_SIZE;
 
 		b[j + 0] = 0xaa;
 		b[j + 1] = trans_count++;
 		b[j + 2] = 0xf0;
 		b[j + 3] = size;
 		memcpy(&b[j + 4], &firmware[i], size);
 
 		j += COMMAND_PACKET_SIZE + 4;
 
 		if (j >= ARM_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      ARM_PACKET_SIZE, &actual_len,
 					      100);
 			j = 0;
 		} else if (size < COMMAND_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      j - COMMAND_PACKET_SIZE + size,
 					      &actual_len, 100);
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
 
 	return result;
 }
 
 static int ttusb_dec_init_stb(struct ttusb_dec *dec)
 {
 	int result;
@@ -1614,24 +1631,25 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 	while ((item = dec->filter_info_list.next) != &dec->filter_info_list) {
 		finfo = list_entry(item, struct filter_info, filter_info_list);
 		list_del(&finfo->filter_info_list);
 		kfree(finfo);
 	}
 }
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
 	.send_command = fe_send_command
 };
 
 static int ttusb_dec_probe(struct usb_interface *intf,
 			   const struct usb_device_id *id)
 {
 	struct usb_device *udev;
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..0bd80ade4 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -36,39 +36,40 @@ static int ttusbdecfe_dvbs_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 				       enum fe_status *status)
 {
 	struct ttusbdecfe_state* state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	u8 result[4];
 	int len, ret;
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					sizeof(result));
 	if(ret)
 		return ret;
 
 	if(len != 4) {
 		printk(KERN_ERR "%s: unexpected reply\n", __func__);
 		return -EIO;
 	}
 
 	switch(result[3]) {
 		case 1:  /* not tuned yet */
 		case 2:  /* no signal/no lock*/
 			break;
 		case 3:	 /* signal found and locked*/
 			*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
 			FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
 			break;
 		case 4:
 			*status = FE_TIMEDOUT;
 			break;
 		default:
 			pr_info("%s: returned unknown value: %d\n",
 				__func__, result[3]);
 			return -EIO;
 	}
 
 	return 0;
 }
@@ -76,23 +77,23 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x03,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0xff,
 		   0x00, 0x00, 0x00, 0xff };
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 					struct dvb_frontend_tune_settings* fesettings)
 {
 		fesettings->min_delay_ms = 1500;
 		/* Drift compensation makes no sense for DVB-T */
 		fesettings->step_size = 0;
@@ -103,60 +104,60 @@ static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
 	u8 b[] = { 0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	__be32 freq;
 	__be32 sym_rate;
 	__be32 band;
 	__be32 lnb_voltage;
 
 	freq = htonl(p->frequency +
 	       (state->hi_band ? LOF_HI : LOF_LO));
 	memcpy(&b[4], &freq, sizeof(u32));
 	sym_rate = htonl(p->symbol_rate);
 	memcpy(&b[12], &sym_rate, sizeof(u32));
 	band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 	memcpy(&b[24], &band, sizeof(u32));
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0xff, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00 };
 
 	if (cmd->msg_len > sizeof(b) - 4)
 		return -EINVAL;
 
 	memcpy(&b[4], cmd->msg, cmd->msg_len);
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
 
 
 static int ttusbdecfe_dvbs_set_tone(struct dvb_frontend *fe,
 				    enum fe_sec_tone_mode tone)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -7,18 +7,19 @@
 
 #ifndef TTUSBDECFE_H
 #define TTUSBDECFE_H
 
 #include <linux/dvb/frontend.h>
 
 struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 
 extern struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config);
 
 #endif // TTUSBDECFE_H
]

182/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 50592
							output: 64
							thoughts: 849
						

Thoughts:
**My Analysis of the `ttusb_dec_send_command` Patch**

Okay, so I've just updated `ttusb_dec_send_command` and its callers to handle the `cmd_result_len` correctly, ensuring we have bounds checks against both `actual_len` and the caller's buffer. I thought I'd better give the logic in `ttusb_dec_send_command` another look.

The code itself seems sound on the surface. We have these checks within the function:

```c
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0) {
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
```

`b[3]` represents the length of the data we're going to read into `cmd_result`.  It's an 8-bit unsigned value, meaning it can be from 0 to 255. `COMMAND_PACKET_SIZE` is defined as 60 (0x3c). `actual_len` is the received length.

The checks are as expected:
1.  We ensure we received at least 4 bytes.
2.  `b[3]` must be less than or equal to both `COMMAND_PACKET_SIZE` (the maximum payload size for a command) and `actual_len - 4` (the remaining length of the received data after the 4-byte header).
3. We check for buffer overflows when copying the data to `cmd_result`.

I did a quick mental check to make sure that the `actual_len - 4` subtraction wouldn't cause an underflow in the case of `b[3]` being a large value and `actual_len` being a small value. We know that the code already checks to ensure that `actual_len` is always >= 4, which means there is no underflow condition.

I need to make sure I've covered all the bases. I've used `codesearch-find-references` to identify all the callers of `ttusb_dec_send_command`.  I found 11 direct calls:

1.  `fe_send_command`
2.  `ttusb_dec_boot_dsp` (2 calls)
3.  `ttusb_dec_get_stb_state`
4.  `ttusb_dec_set_interface`
5.  `ttusb_dec_set_pids`
6.  `ttusb_dec_start_sec_feed`
7.  `ttusb_dec_start_ts_feed`
8.  `ttusb_dec_stop_sec_feed`
9.  `ttusb_dec_stop_ts_feed`
10. `ttusb_init_rc`

And looking at the callers within `ttusbdecfe.c`, I see these calls to `send_command`:

1.  `ttusbdecfe_dvbt_read_status`
2.  `ttusbdecfe_dvbt_set_frontend`
3.  `ttusbdecfe_dvbs_set_frontend`
4.  `ttusbdecfe_dvbs_diseqc_send_master_cmd`

I'm confident I've caught all the places this change could affect. I think this patch is now ready to go.



183/4 2026/08/17 21:17 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c IncludeSnippetLines:0 Name:ttusbdecfe_config::send_command SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbs_diseqc_send_master_cmd SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:150] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbs_set_frontend SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:133] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbt_read_status SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:47] map[ReferenceKind:reads ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbt_set_frontend SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:88]] TruncatedOutput:false]

184/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52664
							output: 60
							thoughts: 27
						

Thoughts:
Here's my take on the thought process:

**Internal Audit - Low Caller Count**

Okay, four callers. That's a surprisingly low number for a function like `ttusbdecfe_config`. I would expect this to be used in more places, especially given its name. It's time to dig deeper. I need to make sure I haven't missed something crucial here. Let's start with a thorough check to confirm that no other implementations of `ttusbdecfe_config` exist within this code base, or any related modules. We can't afford to miss even a single instance.



185/4 2026/08/17 21:17 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c IncludeSnippetLines:0 Name:ttusbdecfe_config SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:uses ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbs_attach SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:216] map[ReferenceKind:uses ReferencingEntityKind:function ReferencingEntityName:ttusbdecfe_dvbt_attach SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c SourceLine:196] map[ReferenceKind:uses ReferencingEntityKind:global_variable ReferencingEntityName:fe_config SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c SourceLine:1630]] TruncatedOutput:false]

186/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53086
							output: 292
							thoughts: 897
						

Thoughts:
**Analyzing Potential Buffer Overflows in `ttusb_dec_send_command`**

Okay, so I'm focusing on the `ttusb_dec.c` file, specifically the `ttusb_dec_send_command` function. My initial thought is to review the changes made to that function, particularly how the `b` buffer is handled. I need to make sure that the length checks are sufficient to prevent any potential buffer overflows.

I've got the code in front of me:
```c
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0) {
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
```
I'm looking for where `b` is accessed beyond those checks, and I see where it's initialized:
```c
	b[0] = 0xaa;
	b[1] = ++dec->trans_count;
	b[2] = command;
	b[3] = param_length;

	if (params)
		memcpy(&b[4], params, param_length);
```

Ah, right. The potentially problematic part is that `memcpy(&b[4], params, param_length)`. `param_length` is a variable that determines how much data is copied into the `b` buffer. The `b` buffer is allocated as `COMMAND_PACKET_SIZE + 4` (that's 64 bytes). If `param_length` is greater than 60, I'd have a buffer overflow. But, is `param_length` checked elsewhere?

The `param_length` variable is also passed to `ttusb_dec_send_command`. So, I need to trace back to where this `param_length` is set to check what the maximum value is. I need to find the callers of `ttusb_dec_send_command`.

Looking at the code, these functions call `ttusb_dec_send_command`, along with the size of the buffer:
1.  `fe_send_command`: `param_length` comes from `ttusbdecfe.c`.
    *   `ttusbdecfe_dvbt_read_status`: `sizeof(b)` which is 8.
    *   `ttusbdecfe_dvbt_set_frontend`: `sizeof(b)` which is 20.
    *   `ttusbdecfe_dvbs_set_frontend`: `sizeof(b)` which is 40.
    *   `ttusbdecfe_dvbs_diseqc_send_master_cmd`: `sizeof(b) - (6 - cmd->msg_len)`. `sizeof(b)` is 10. `cmd->msg_len` is checked against `sizeof(b) - 4` (which is 6). So `param_length` is at most 10.
2.  `ttusb_dec_boot_dsp`: `sizeof(b0)` (10) and `sizeof(b1)` (1).
3.  `ttusb_dec_get_stb_state`: 0.
4.  `ttusb_dec_set_interface`: `sizeof(b)` (1).
5.  `ttusb_dec_set_pids`: `sizeof(b)` (12).
6.  `ttusb_dec_start_sec_feed`: `sizeof(b0)` (29).
7.  `ttusb_dec_start_ts_feed`: `sizeof(b0)` (1).
8.  `ttusb_dec_stop_sec_feed`: `sizeof(b0)` (2).
9.  `ttusb_dec_stop_ts_feed`: `sizeof(b0)` (1).
10. `ttusb_init_rc`: `sizeof(b)` (2).

Okay, after examining all the callers, the maximum value that `param_length` can take is 40 which is far less than 6


187/4 2026/08/17 21:17 tool codeeditor
0m Args:
map[CurrentCode:static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	int result, actual_len;
	u8 *b;

	dprintk("%s\n", __func__);

	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL); NewCode:static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	int result, actual_len;
	u8 *b;

	dprintk("%s\n", __func__);

	if (param_length > COMMAND_PACKET_SIZE)
		return -EINVAL;

	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

188/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 55307
							output: 15
							thoughts: 11
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, keeping in mind I'm speaking to a fellow expert and adopting a first-person perspective:

**Checking That Diff Again...**

Alright, time to revisit that `patch-diff`. I remember going over it, but there's a nagging feeling, a little doubt whispering in the back of my mind. It's that subtle sense you get when you've reviewed something, but you haven't quite *felt* it sink in completely. I need to make absolutely sure everything there aligns with my understanding and the overall architecture we're working with. This project's intricacies demand that level of rigor. Let's make sure there aren't any potential edge cases that I missed on the first pass. No point in pushing something upstream without having absolute confidence. Deep breath, and let's dive back in.



189/4 2026/08/17 21:17 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..a8e7b5b28 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -307,107 +307,127 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 		crc ^= *buf++;
 		crc ^= (u8)crc >> 4;
 		tmp = (u8)crc;
 		crc ^= (tmp ^ (tmp << 1)) << 4;
 	}
 	return crc;
 }
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
 
 	result = mutex_lock_interruptible(&dec->usb_mutex);
 	if (result) {
 		printk("%s: Failed to lock usb mutex.\n", __func__);
 		goto err_free;
 	}
 
 	b[0] = 0xaa;
 	b[1] = ++dec->trans_count;
 	b[2] = command;
 	b[3] = param_length;
 
 	if (params)
 		memcpy(&b[4], params, param_length);
 
 	if (debug) {
 		printk(KERN_DEBUG "%s: command: %*ph\n",
 		       __func__, param_length, b);
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: command bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: result bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	} else {
 		if (debug) {
 			printk(KERN_DEBUG "%s: result: %*ph\n",
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
 	mutex_unlock(&dec->usb_mutex);
 err_free:
 	kfree(b);
 	return result;
 }
 
 static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 				    unsigned int *model, unsigned int *version)
 {
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	__be32 tmp;
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
 	if (c_length >= 0x0c) {
 		if (mode != NULL) {
 			memcpy(&tmp, c, 4);
 			*mode = ntohl(tmp);
 		}
 		if (model != NULL) {
 			memcpy(&tmp, &c[4], 4);
 			*model = ntohl(tmp);
 		}
 		if (version != NULL) {
 			memcpy(&tmp, &c[8], 4);
 			*version = ntohl(tmp);
 		}
 		return 0;
 	} else {
 		return -ENOENT;
 	}
 }
@@ -435,27 +455,27 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
 static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 {
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0xff, 0xff,
 		   0xff, 0xff, 0xff, 0xff };
 
 	__be16 pcr = htons(dec->pid[DMX_PES_PCR]);
 	__be16 audio = htons(dec->pid[DMX_PES_AUDIO]);
 	__be16 video = htons(dec->pid[DMX_PES_VIDEO]);
 
 	dprintk("%s\n", __func__);
 
 	memcpy(&b[0], &pcr, 2);
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
 	dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO],
 			       ttusb_dec_video_pes2ts_cb, dec);
 	dec->v_pes_length = 0;
 	dec->v_pes_postbytes = 0;
 }
 
 static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
@@ -888,35 +908,35 @@ static void ttusb_dec_stop_iso_xfer(struct ttusb_dec *dec)
 /* Setting the interface of the DEC tends to take down the USB communications
  * for a short period, so it's important not to call this function just before
  * trying to talk to it.
  */
 static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 				   enum ttusb_dec_interface interface)
 {
 	int result = 0;
 	u8 b[] = { 0x05 };
 
 	if (interface != dec->interface) {
 		switch (interface) {
 		case TTUSB_DEC_INTERFACE_INITIAL:
 			result = usb_set_interface(dec->udev, 0, 0);
 			break;
-		case TTUSB_DEC_INTERFACE_IN:
-			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+			case TTUSB_DEC_INTERFACE_IN:
+				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
+								b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
 			break;
 		case TTUSB_DEC_INTERFACE_OUT:
 			result = usb_set_interface(dec->udev, 0, 1);
 			break;
 		}
 
 		if (result)
 			return result;
 
 		dec->interface = interface;
 	}
 
 	return 0;
 }
@@ -964,121 +984,121 @@ static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
 static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
 	struct ttusb_dec *dec = dvbdmx->priv;
 	u8 b0[] = { 0x05 };
 	int result = 0;
 
 	dprintk("%s\n", __func__);
 
 	dprintk("  ts_type:");
 
 	if (dvbdmxfeed->ts_type & TS_DECODER)
 		dprintk(" TS_DECODER");
 
 	if (dvbdmxfeed->ts_type & TS_PACKET)
 		dprintk(" TS_PACKET");
 
 	if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
 		dprintk(" TS_PAYLOAD_ONLY");
 
 	dprintk("\n");
 
 	switch (dvbdmxfeed->pes_type) {
 
 	case DMX_PES_VIDEO:
 		dprintk("  pes_type: DMX_PES_VIDEO\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		dec->pid[DMX_PES_VIDEO] = dvbdmxfeed->pid;
 		dec->video_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_AUDIO:
 		dprintk("  pes_type: DMX_PES_AUDIO\n");
 		dec->pid[DMX_PES_AUDIO] = dvbdmxfeed->pid;
 		dec->audio_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_TELETEXT:
 		dec->pid[DMX_PES_TELETEXT] = dvbdmxfeed->pid;
 		dprintk("  pes_type: DMX_PES_TELETEXT(not supported)\n");
 		return -ENOSYS;
 
 	case DMX_PES_PCR:
 		dprintk("  pes_type: DMX_PES_PCR\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_OTHER:
 		dprintk("  pes_type: DMX_PES_OTHER(not supported)\n");
 		return -ENOSYS;
 
 	default:
 		dprintk("  pes_type: unknown (%d)\n", dvbdmxfeed->pes_type);
 		return -EINVAL;
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
 	dec->pva_stream_count++;
 	return ttusb_dec_start_iso_xfer(dec);
 }
 
 static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x01,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0xff, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00 };
 	__be16 pid;
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	struct filter_info *finfo;
 	unsigned long flags;
 	u8 x = 1;
 
 	dprintk("%s\n", __func__);
 
 	pid = htons(dvbdmxfeed->pid);
 	memcpy(&b0[0], &pid, 2);
 	memcpy(&b0[4], &x, 1);
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
 			if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC)))
 				return -ENOMEM;
 
 			finfo->stream_id = c[1];
 			finfo->filter = dvbdmxfeed->filter;
 
 			spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 			list_add_tail(&finfo->filter_info_list,
 				      &dec->filter_info_list);
 			spin_unlock_irqrestore(&dec->filter_info_list_lock,
 					       flags);
 
 			dvbdmxfeed->priv = finfo;
 
 			dec->filter_stream_count++;
 			return ttusb_dec_start_iso_xfer(dec);
 		}
 
 		return -EAGAIN;
 	} else
 		return result;
 }
@@ -1107,42 +1127,42 @@ static int ttusb_dec_start_feed(struct dvb_demux_feed *dvbdmxfeed)
 		return -EINVAL;
 
 	}
 }
 
 static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00 };
 	struct filter_info *finfo = dvbdmxfeed->priv;
 	unsigned long flags;
 
 	b0[1] = finfo->stream_id;
 	spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
@@ -1207,45 +1227,45 @@ static void ttusb_dec_init_bh_work(struct ttusb_dec *dec)
 static int ttusb_init_rc( struct ttusb_dec *dec)
 {
 	struct input_dev *input_dev;
 	u8 b[] = { 0x00, 0x01 };
 	int i;
 	int err;
 
 	usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
 	strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
 
 	input_dev = input_allocate_device();
 	if (!input_dev)
 		return -ENOMEM;
 
 	input_dev->name = "ttusb_dec remote control";
 	input_dev->phys = dec->rc_phys;
 	input_dev->evbit[0] = BIT_MASK(EV_KEY);
 	input_dev->keycodesize = sizeof(u16);
 	input_dev->keycodemax = 0x1a;
 	input_dev->keycode = rc_keys;
 
 	for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
 		  set_bit(rc_keys[i], input_dev->keybit);
 
 	err = input_register_device(input_dev);
 	if (err) {
 		input_free_device(input_dev);
 		return err;
 	}
 
 	dec->rc_input_dev = input_dev;
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 
 	return 0;
 }
 
 static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
 {
 	dprintk("%s\n", __func__);
 
 	dec->v_pes[0] = 0x00;
 	dec->v_pes[1] = 0x00;
@@ -1298,111 +1318,111 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
 static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 {
 	int i, j, actual_len, result, size, trans_count;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x61, 0x00 };
 	u8 b1[] = { 0x61 };
 	u8 *b;
 	char idstring[21];
 	const u8 *firmware = NULL;
 	size_t firmware_size = 0;
 	u16 firmware_csum = 0;
 	__be16 firmware_csum_ns;
 	__be32 firmware_size_nl;
 	u32 crc32_csum, crc32_check;
 	__be32 tmp;
 	const struct firmware *fw_entry = NULL;
 
 	dprintk("%s\n", __func__);
 
 	result = request_firmware(&fw_entry, dec->firmware_name, &dec->udev->dev);
 	if (result) {
 		printk(KERN_ERR "%s: Firmware (%s) unavailable.\n",
 		       __func__, dec->firmware_name);
 		return result;
 	}
 
 	firmware = fw_entry->data;
 	firmware_size = fw_entry->size;
 
 	if (firmware_size < 60) {
 		printk("%s: firmware size too small for DSP code (%zu < 60).\n",
 			__func__, firmware_size);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 
 	/* a 32 bit checksum over the first 56 bytes of the DSP Code is stored
 	   at offset 56 of file, so use it to check if the firmware file is
 	   valid. */
 	crc32_csum = crc32(~0L, firmware, 56) ^ ~0L;
 	memcpy(&tmp, &firmware[56], 4);
 	crc32_check = ntohl(tmp);
 	if (crc32_csum != crc32_check) {
 		printk("%s: crc32 check of DSP code failed (calculated 0x%08x != 0x%08x in file), file invalid.\n",
 			__func__, crc32_csum, crc32_check);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 	memcpy(idstring, &firmware[36], 20);
 	idstring[20] = '\0';
 	printk(KERN_INFO "ttusb_dec: found DSP code \"%s\".\n", idstring);
 
 	firmware_size_nl = htonl(firmware_size);
 	memcpy(b0, &firmware_size_nl, 4);
 	firmware_csum = crc16(~0, firmware, firmware_size) ^ ~0;
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
 		return result;
 	}
 
 	trans_count = 0;
 	j = 0;
 
 	b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
 	if (b == NULL) {
 		release_firmware(fw_entry);
 		return -ENOMEM;
 	}
 
 	for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
 		size = firmware_size - i;
 		if (size > COMMAND_PACKET_SIZE)
 			size = COMMAND_PACKET_SIZE;
 
 		b[j + 0] = 0xaa;
 		b[j + 1] = trans_count++;
 		b[j + 2] = 0xf0;
 		b[j + 3] = size;
 		memcpy(&b[j + 4], &firmware[i], size);
 
 		j += COMMAND_PACKET_SIZE + 4;
 
 		if (j >= ARM_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      ARM_PACKET_SIZE, &actual_len,
 					      100);
 			j = 0;
 		} else if (size < COMMAND_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      j - COMMAND_PACKET_SIZE + size,
 					      &actual_len, 100);
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
 
 	return result;
 }
 
 static int ttusb_dec_init_stb(struct ttusb_dec *dec)
 {
 	int result;
@@ -1614,24 +1634,25 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 	while ((item = dec->filter_info_list.next) != &dec->filter_info_list) {
 		finfo = list_entry(item, struct filter_info, filter_info_list);
 		list_del(&finfo->filter_info_list);
 		kfree(finfo);
 	}
 }
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
 	.send_command = fe_send_command
 };
 
 static int ttusb_dec_probe(struct usb_interface *intf,
 			   const struct usb_device_id *id)
 {
 	struct usb_device *udev;
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..0bd80ade4 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -36,39 +36,40 @@ static int ttusbdecfe_dvbs_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 				       enum fe_status *status)
 {
 	struct ttusbdecfe_state* state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	u8 result[4];
 	int len, ret;
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					sizeof(result));
 	if(ret)
 		return ret;
 
 	if(len != 4) {
 		printk(KERN_ERR "%s: unexpected reply\n", __func__);
 		return -EIO;
 	}
 
 	switch(result[3]) {
 		case 1:  /* not tuned yet */
 		case 2:  /* no signal/no lock*/
 			break;
 		case 3:	 /* signal found and locked*/
 			*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
 			FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
 			break;
 		case 4:
 			*status = FE_TIMEDOUT;
 			break;
 		default:
 			pr_info("%s: returned unknown value: %d\n",
 				__func__, result[3]);
 			return -EIO;
 	}
 
 	return 0;
 }
@@ -76,23 +77,23 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x03,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0xff,
 		   0x00, 0x00, 0x00, 0xff };
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 					struct dvb_frontend_tune_settings* fesettings)
 {
 		fesettings->min_delay_ms = 1500;
 		/* Drift compensation makes no sense for DVB-T */
 		fesettings->step_size = 0;
@@ -103,60 +104,60 @@ static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
 	u8 b[] = { 0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	__be32 freq;
 	__be32 sym_rate;
 	__be32 band;
 	__be32 lnb_voltage;
 
 	freq = htonl(p->frequency +
 	       (state->hi_band ? LOF_HI : LOF_LO));
 	memcpy(&b[4], &freq, sizeof(u32));
 	sym_rate = htonl(p->symbol_rate);
 	memcpy(&b[12], &sym_rate, sizeof(u32));
 	band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 	memcpy(&b[24], &band, sizeof(u32));
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0xff, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00 };
 
 	if (cmd->msg_len > sizeof(b) - 4)
 		return -EINVAL;
 
 	memcpy(&b[4], cmd->msg, cmd->msg_len);
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
 
 
 static int ttusbdecfe_dvbs_set_tone(struct dvb_frontend *fe,
 				    enum fe_sec_tone_mode tone)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -7,18 +7,19 @@
 
 #ifndef TTUSBDECFE_H
 #define TTUSBDECFE_H
 
 #include <linux/dvb/frontend.h>
 
 struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 
 extern struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config);
 
 #endif // TTUSBDECFE_H
]

190/4 2026/08/17 21:17 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 64894
							output: 479
							thoughts: 860
						

Thoughts:
**Code Review and Safety Checks**

Okay, so I've finalized this patch and the initial assessment is positive – everything appears complete and correct. I've gone ahead and updated `ttusbdecfe_config` to include `cmd_result_len`, and, critically, I've updated `ttusb_dec_send_command` to properly incorporate `cmd_result_len` and implemented some crucial bounds checking on the parameters: `param_length`, `actual_len`, and `b[3]`.  Plus, I made sure all the calling functions were passing the appropriate length arguments.

Now, let's dissect the safety considerations I've meticulously worked through.  I had a quick moment of concern – `b[3]` is `u8`, unsigned, while `actual_len` is an `int`. If `actual_len` is less than 4, we're returning `-EIO`, so the expression `actual_len - 4` will always be non-negative. Therefore, `b[3] > actual_len - 4` is safe. The check against `cmd_result_len` is also safe because `cmd_result_len` is `int` and we only check it if `cmd_result` is not NULL, even though I will need to be extremely vigilant as to the value passed in. Returning `-EIO` is desired if `cmd_result_len` is smaller than `b[3]`.

To cement my confidence, I needed to re-examine the key call sites.  In `ttusb_dec_get_stb_state`, the `cmd_result_len` is `sizeof(c)` (which is 60).  If `b[3]` is greater than 60, `ttusb_dec_send_command` will correctly return `-EIO` due to the earlier check in the function.  I confirmed this is the correct flow and that this check is in the right place.

Then, I turned my attention to `ttusbdecfe_dvbt_read_status`. Here, the `cmd_result_len` is 4.  If `b[3]` is greater than 4, `-EIO` will be returned.  Again, the logic checks out.

Finally, I checked `ttusb_dec_start_sec_feed`. Same deal - it uses 60 and the existing checks ensure the safety of the operation.

I also double-checked the `param_length` check – making sure `param_length` is not larger than `COMMAND_PACKET_SIZE` and am confident that this fix is sound. Okay, I've run through everything. Now I am satisfied. Time to submit this.



191/3 2026/08/17 21:17 action test-patch
25m Results:
map[PatchDiff:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..a8e7b5b28 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
@@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
@@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
@@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
@@ -900,9 +920,9 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 		case TTUSB_DEC_INTERFACE_INITIAL:
 			result = usb_set_interface(dec->udev, 0, 0);
 			break;
-		case TTUSB_DEC_INTERFACE_IN:
-			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+			case TTUSB_DEC_INTERFACE_IN:
+				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
+								b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
@@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
@@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
@@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
@@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
@@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 
 	return 0;
 }
@@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
@@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
@@ -1621,10 +1641,11 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..0bd80ade4 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					sizeof(result));
 	if(ret)
 		return ret;
 
@@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -14,7 +14,8 @@ struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 TestError:]

192/1 2026/08/17 21:43 action apply-patch
0m Results:
map[]

193/1 2026/08/17 21:43 action init-style-items
0m Results:
map[StyleItems:<nil>]

194/1 2026/08/17 21:43 loop
15m
195/2 2026/08/17 21:43 iteration 0
15m
196/3 2026/08/17 21:43 agent patch-formatter
1m Model:
good-balanced

Instruction:
You are an expert Linux kernel developer tasked with formatting a kernel patch.
Your objective is purely formatting: you must ensure the patch complies with the kernel's coding style,
conforms to the surrounding code rules, and passes checkpatch.pl, while preserving the code logic exactly as it is.
You should stop once the requested formatting changes are done and checkpatch.pl is happy.
Do not question the requested changes unless they are obviously wrong.
If the code already conforms to the requested changes, surrounding code rules,
and checkpatch.pl is happy, you should just finish your task.

WARNING: The clang-format tool may break the formatting of the surrounding code (like manual alignment).
Use it with caution. We want to make the change fit into the existing formatting as much as possible.

Prefer calling several tools at the same time to save round-trips.

Prompt:
The current patch diff is:

diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..a8e7b5b28 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
@@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
@@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
@@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
@@ -900,9 +920,9 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 		case TTUSB_DEC_INTERFACE_INITIAL:
 			result = usb_set_interface(dec->udev, 0, 0);
 			break;
-		case TTUSB_DEC_INTERFACE_IN:
-			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+			case TTUSB_DEC_INTERFACE_IN:
+				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
+								b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
@@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
@@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
@@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
@@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
@@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 
 	return 0;
 }
@@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
@@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
@@ -1621,10 +1641,11 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..0bd80ade4 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					sizeof(result));
 	if(ret)
 		return ret;
 
@@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -14,7 +14,8 @@ struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);










Use the provided tools to format the patch.

Reply:
I have formatted the patch according to Linux kernel coding style guidelines and fixed all checkpatch.pl issues:

1. Fixed accidental indentation change in `ttusb_dec_set_interface()` switch statement for `case TTUSB_DEC_INTERFACE_IN:`.
2. Added missing spaces after commas in `ttusb_dec_send_command()` call in `ttusb_init_rc()`.
3. Wrapped long function call line in `fe_send_command()` to stay within line length limits.
4. Added required spaces around operator `=` in `ttusbdecfe_dvbt_read_status()`.

The modified patch now passes `checkpatch.pl` with zero errors and zero warnings.

197/4 2026/08/17 21:43 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 7779
							output: 9
							thoughts: 29
						

Thoughts:
Here's your summary:

**Initial Patch Inspection**

Okay, before I even start digging into the meat of this patch, let's establish a baseline. The first thing I'm going to do is run `checkpatch`. I know it's not perfect, but it's a quick and dirty way to identify any obvious style violations or formatting inconsistencies. This command is pretty simple to call, so that's the first step.



198/4 2026/08/17 21:43 tool checkpatch
0m Results:
map[Output:ERROR: space required after that ',' (ctx:VxV)
#124: FILE: drivers/media/usb/ttusb-dec/ttusb_dec.c:1261:
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 	                          ^

ERROR: space required after that ',' (ctx:VxV)
#124: FILE: drivers/media/usb/ttusb-dec/ttusb_dec.c:1261:
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 	                               ^

ERROR: space required after that ',' (ctx:VxV)
#124: FILE: drivers/media/usb/ttusb-dec/ttusb_dec.c:1261:
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 	                                         ^

ERROR: space required after that ',' (ctx:VxV)
#124: FILE: drivers/media/usb/ttusb-dec/ttusb_dec.c:1261:
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 	                                           ^

ERROR: space required after that ',' (ctx:VxV)
#124: FILE: drivers/media/usb/ttusb-dec/ttusb_dec.c:1261:
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 	                                                ^

ERROR: space required after that ',' (ctx:VxV)
#124: FILE: drivers/media/usb/ttusb-dec/ttusb_dec.c:1261:
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 	                                                     ^

WARNING: line length of 117 exceeds 100 columns
#156: FILE: drivers/media/usb/ttusb-dec/ttusb_dec.c:1648:
+	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);

ERROR: spaces required around that '=' (ctx:VxV)
#169: FILE: drivers/media/usb/ttusb-dec/ttusbdecfe.c:47:
+	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
 	   ^

total: 7 errors, 1 warnings, 184 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
]

199/4 2026/08/17 21:43 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 8661
							output: 182
							thoughts: 382
						

Thoughts:
**Analyzing a Potential Indentation Issue**

Okay, let's dive into these `checkpatch` results and see what we've got. The plan is to scrutinize all errors and warnings, and also to take a closer look at the surrounding code for style violations, formatting inconsistencies, or anything that doesn't quite jibe with kernel coding standards. We'll start by reading the patch diff carefully and inspecting the relevant source files.

Right, here we are in `drivers/media/usb/ttusb-dec/ttusb_dec.c`. Looking specifically at lines 900-910, I see a diff:

```diff
-		case TTUSB_DEC_INTERFACE_IN:
-			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+			case TTUSB_DEC_INTERFACE_IN:
+				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
+								b, NULL, NULL, 0);
```

Wait a second... hold on. My eyes are drawn to the indentation of that `case TTUSB_DEC_INTERFACE_IN:` line.  Let's compare to the context:

```c
		case TTUSB_DEC_INTERFACE_INITIAL:
			result = usb_set_interface(dec->udev, 0, 0);
			break;
		case TTUSB_DEC_INTERFACE_IN:
			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
							b, NULL, NULL);
```

Bingo! It looks like an extra tab was introduced on `case TTUSB_DEC_INTERFACE_IN:`. The patch has made that line *more* indented than `case TTUSB_DEC_INTERFACE_INITIAL:`, which is definitely not the correct indentation for a `case` within a `switch` statement! That's a clear violation of our kernel coding style rules.  We need to address this.

Let me now use my usual tools to quickly check surrounding code; either `read-file` or `codesearch-definition-source` should give me the relevant context around line 900 in `ttusb_dec.c`.



200/4 2026/08/17 21:43 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:310 LineCount:80]

Results:
map[Contents: 310:			crc ^= (tmp ^ (tmp << 1)) << 4;
 311:		}
 312:		return crc;
 313:	}
 314:	
 315:	static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 316:					  int param_length, const u8 params[],
 317:					  int *result_length, u8 cmd_result[])
 318:	{
 319:		int result, actual_len;
 320:		u8 *b;
 321:	
 322:		dprintk("%s\n", __func__);
 323:	
 324:		b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 325:		if (!b)
 326:			return -ENOMEM;
 327:	
 328:		result = mutex_lock_interruptible(&dec->usb_mutex);
 329:		if (result) {
 330:			printk("%s: Failed to lock usb mutex.\n", __func__);
 331:			goto err_free;
 332:		}
 333:	
 334:		b[0] = 0xaa;
 335:		b[1] = ++dec->trans_count;
 336:		b[2] = command;
 337:		b[3] = param_length;
 338:	
 339:		if (params)
 340:			memcpy(&b[4], params, param_length);
 341:	
 342:		if (debug) {
 343:			printk(KERN_DEBUG "%s: command: %*ph\n",
 344:			       __func__, param_length, b);
 345:		}
 346:	
 347:		result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 348:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 349:	
 350:		if (result) {
 351:			printk("%s: command bulk message failed: error %d\n",
 352:			       __func__, result);
 353:			goto err_mutex_unlock;
 354:		}
 355:	
 356:		result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 357:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 358:	
 359:		if (result) {
 360:			printk("%s: result bulk message failed: error %d\n",
 361:			       __func__, result);
 362:			goto err_mutex_unlock;
 363:		} else {
 364:			if (debug) {
 365:				printk(KERN_DEBUG "%s: result: %*ph\n",
 366:				       __func__, actual_len, b);
 367:			}
 368:	
 369:			if (result_length)
 370:				*result_length = b[3];
 371:			if (cmd_result && b[3] > 0)
 372:				memcpy(cmd_result, &b[4], b[3]);
 373:		}
 374:	
 375:	err_mutex_unlock:
 376:		mutex_unlock(&dec->usb_mutex);
 377:	err_free:
 378:		kfree(b);
 379:		return result;
 380:	}
 381:	
 382:	static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 383:					    unsigned int *model, unsigned int *version)
 384:	{
 385:		u8 c[COMMAND_PACKET_SIZE];
 386:		int c_length;
 387:		int result;
 388:		__be32 tmp;
 389:	
]

201/4 2026/08/17 21:43 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:900 LineCount:30]

Results:
map[Contents: 900:			case TTUSB_DEC_INTERFACE_INITIAL:
 901:				result = usb_set_interface(dec->udev, 0, 0);
 902:				break;
 903:			case TTUSB_DEC_INTERFACE_IN:
 904:				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
 905:								b, NULL, NULL);
 906:				if (result)
 907:					return result;
 908:				result = usb_set_interface(dec->udev, 0, 8);
 909:				break;
 910:			case TTUSB_DEC_INTERFACE_OUT:
 911:				result = usb_set_interface(dec->udev, 0, 1);
 912:				break;
 913:			}
 914:	
 915:			if (result)
 916:				return result;
 917:	
 918:			dec->interface = interface;
 919:		}
 920:	
 921:		return 0;
 922:	}
 923:	
 924:	static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
 925:	{
 926:		int i, result;
 927:	
 928:		dprintk("%s\n", __func__);
 929:	
]

202/4 2026/08/17 21:43 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1230 LineCount:30]

Results:
map[Contents:1230:	
1231:		err = input_register_device(input_dev);
1232:		if (err) {
1233:			input_free_device(input_dev);
1234:			return err;
1235:		}
1236:	
1237:		dec->rc_input_dev = input_dev;
1238:		if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
1239:			printk("%s: usb_submit_urb failed\n",__func__);
1240:		/* enable irq pipe */
1241:		ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1242:	
1243:		return 0;
1244:	}
1245:	
1246:	static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
1247:	{
1248:		dprintk("%s\n", __func__);
1249:	
1250:		dec->v_pes[0] = 0x00;
1251:		dec->v_pes[1] = 0x00;
1252:		dec->v_pes[2] = 0x01;
1253:		dec->v_pes[3] = 0xe0;
1254:	}
1255:	
1256:	static int ttusb_dec_init_usb(struct ttusb_dec *dec)
1257:	{
1258:		int result;
1259:	
]

203/4 2026/08/17 21:43 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1630 LineCount:30]

Results:
map[Contents:1630:	static const struct ttusbdecfe_config fe_config = {
1631:		.send_command = fe_send_command
1632:	};
1633:	
1634:	static int ttusb_dec_probe(struct usb_interface *intf,
1635:				   const struct usb_device_id *id)
1636:	{
1637:		struct usb_device *udev;
1638:		struct ttusb_dec *dec;
1639:		int result;
1640:	
1641:		dprintk("%s\n", __func__);
1642:	
1643:		udev = interface_to_usbdev(intf);
1644:	
1645:		if (!(dec = kzalloc_obj(struct ttusb_dec))) {
1646:			printk("%s: couldn't allocate memory.\n", __func__);
1647:			return -ENOMEM;
1648:		}
1649:	
1650:		usb_set_intfdata(intf, (void *)dec);
1651:	
1652:		switch (id->idProduct) {
1653:		case 0x1006:
1654:			ttusb_dec_set_model(dec, TTUSB_DEC3000S);
1655:			break;
1656:	
1657:		case 0x1008:
1658:			ttusb_dec_set_model(dec, TTUSB_DEC2000T);
1659:			break;
]

204/4 2026/08/17 21:43 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 12164
							output: 46
							thoughts: 31
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach that:

**Investigating `fe_send_command` in `ttusb_dec.c`**

Alright, I need to get to the heart of what's going on with this `fe_send_command` function. Let's start by zeroing in on where it's defined within the `ttusb_dec.c` file. I'm going to jump to that area, specifically around line 1620. That seems like a reasonable place to start, given its prominence and likely role in this process. Time to start digging!



205/4 2026/08/17 21:43 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1610 LineCount:25]

Results:
map[Contents:1610:	static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
1611:	{
1612:		struct list_head *item;
1613:		struct filter_info *finfo;
1614:	
1615:		while ((item = dec->filter_info_list.next) != &dec->filter_info_list) {
1616:			finfo = list_entry(item, struct filter_info, filter_info_list);
1617:			list_del(&finfo->filter_info_list);
1618:			kfree(finfo);
1619:		}
1620:	}
1621:	
1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
1629:	
1630:	static const struct ttusbdecfe_config fe_config = {
1631:		.send_command = fe_send_command
1632:	};
1633:	
1634:	static int ttusb_dec_probe(struct usb_interface *intf,
]

206/4 2026/08/17 21:43 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 12799
							output: 45
							thoughts: 47
						

Thoughts:
Okay, let's dive into this.

**Examining the ttusbdecfe.c Source**

Right, so to get a handle on this, I need to check `ttusbdecfe.c` thoroughly. I'm going to start by focusing on lines 30 through 160 within the `drivers/media/usb/ttusb-dec/` directory. That section should give me a good baseline to work from and hopefully outline the core functionality that's happening there. I'm especially looking for any initializations, register accesses, or data structure definitions in that range. This should help me to understand how the driver interfaces with the hardware and how its configured. Let's see what we can find.



207/4 2026/08/17 21:43 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusbdecfe.c FirstLine:30 LineCount:130]

Results:
map[Contents:  30:		*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
  31:			FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
  32:		return 0;
  33:	}
  34:	
  35:	
  36:	static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
  37:					       enum fe_status *status)
  38:	{
  39:		struct ttusbdecfe_state* state = fe->demodulator_priv;
  40:		u8 b[] = { 0x00, 0x00, 0x00, 0x00,
  41:			   0x00, 0x00, 0x00, 0x00 };
  42:		u8 result[4];
  43:		int len, ret;
  44:	
  45:		*status=0;
  46:	
  47:		ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
  48:		if(ret)
  49:			return ret;
  50:	
  51:		if(len != 4) {
  52:			printk(KERN_ERR "%s: unexpected reply\n", __func__);
  53:			return -EIO;
  54:		}
  55:	
  56:		switch(result[3]) {
  57:			case 1:  /* not tuned yet */
  58:			case 2:  /* no signal/no lock*/
  59:				break;
  60:			case 3:	 /* signal found and locked*/
  61:				*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
  62:				FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
  63:				break;
  64:			case 4:
  65:				*status = FE_TIMEDOUT;
  66:				break;
  67:			default:
  68:				pr_info("%s: returned unknown value: %d\n",
  69:					__func__, result[3]);
  70:				return -EIO;
  71:		}
  72:	
  73:		return 0;
  74:	}
  75:	
  76:	static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
  77:	{
  78:		struct dtv_frontend_properties *p = &fe->dtv_property_cache;
  79:		struct ttusbdecfe_state *state = fe->demodulator_priv;
  80:		u8 b[] = { 0x00, 0x00, 0x00, 0x03,
  81:			   0x00, 0x00, 0x00, 0x00,
  82:			   0x00, 0x00, 0x00, 0x01,
  83:			   0x00, 0x00, 0x00, 0xff,
  84:			   0x00, 0x00, 0x00, 0xff };
  85:	
  86:		__be32 freq = htonl(p->frequency / 1000);
  87:		memcpy(&b[4], &freq, sizeof (u32));
  88:		state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
  89:	
  90:		return 0;
  91:	}
  92:	
  93:	static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
  94:						struct dvb_frontend_tune_settings* fesettings)
  95:	{
  96:			fesettings->min_delay_ms = 1500;
  97:			/* Drift compensation makes no sense for DVB-T */
  98:			fesettings->step_size = 0;
  99:			fesettings->max_drift = 0;
 100:			return 0;
 101:	}
 102:	
 103:	static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 104:	{
 105:		struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 106:		struct ttusbdecfe_state *state = fe->demodulator_priv;
 107:	
 108:		u8 b[] = { 0x00, 0x00, 0x00, 0x01,
 109:			   0x00, 0x00, 0x00, 0x00,
 110:			   0x00, 0x00, 0x00, 0x01,
 111:			   0x00, 0x00, 0x00, 0x00,
 112:			   0x00, 0x00, 0x00, 0x00,
 113:			   0x00, 0x00, 0x00, 0x00,
 114:			   0x00, 0x00, 0x00, 0x00,
 115:			   0x00, 0x00, 0x00, 0x00,
 116:			   0x00, 0x00, 0x00, 0x00,
 117:			   0x00, 0x00, 0x00, 0x00 };
 118:		__be32 freq;
 119:		__be32 sym_rate;
 120:		__be32 band;
 121:		__be32 lnb_voltage;
 122:	
 123:		freq = htonl(p->frequency +
 124:		       (state->hi_band ? LOF_HI : LOF_LO));
 125:		memcpy(&b[4], &freq, sizeof(u32));
 126:		sym_rate = htonl(p->symbol_rate);
 127:		memcpy(&b[12], &sym_rate, sizeof(u32));
 128:		band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 129:		memcpy(&b[24], &band, sizeof(u32));
]

208/4 2026/08/17 21:43 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 14824
							output: 46
							thoughts: 2013
						

Thoughts:
**Patch Analysis and Code Review**

Okay, let's break down this patch methodically. First, I need to verify all the changes are sound and adhere to kernel coding standards. It's a bit like detective work, but I'm looking for any potential problems before they hit the mainline.

**Issue 1: Commas and Spacing** The first issue flagged concerns line 1261 in `ttusb_dec.c`. The original code `ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL);` has been modified to `ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);`. The `checkpatch` tool is correct. A space is definitely required after each comma for readability. So I'll amend that line to: `ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);`. That's a simple fix.

**Issue 2: Line Length in `ttusb_dec.c`**  This one is a line length issue in `ttusb_dec.c`, line 1648. The proposed fix, which is definitely the right approach, is to break the excessively long `ttusb_dec_send_command` call into multiple lines to keep it within the 80/100 column limit. I'd go with the second version, as it is clearer to read. So, it's now:
```c
	return ttusb_dec_send_command(dec, command, param_length, params,
				      result_length, cmd_result,
				      cmd_result_len);
```

**Issue 3: Spacing Around `=` in `ttusbdecfe.c`** This is about spacing around the assignment operator `=` on line 47 in `ttusbdecfe.c`. The original code `ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);` has been modified to `ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,`. The added `sizeof(result));` triggers the error. Adding spaces to the `ret=` assignment to make it `ret =` fixes it, as does adding the `sizeof(result));`. Now the line looks like:
```c
ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
				   sizeof(result));
```
I also need to check the alignment of the `sizeof(result));` function call with the other arguments. The current patch is fine.

**Indentation and Alignment Check** The code adds a tab to the beginning of the `case TTUSB_DEC_INTERFACE_IN:` block. I need to correct this. This added indentation makes the code harder to read. The fixed version should be:
```c
		case TTUSB_DEC_INTERFACE_IN:
			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
							b, NULL, NULL, 0);
			if (result)
				return result;
```
This aligns with the existing indentation style of the surrounding `case` statements.

**Thorough Review of Code Changes**  Now, I need to examine the new `ttusb_dec.c` file from the beginning and review all changes.  I need to ensure the added function `ttusb_dec_send_command` matches the coding style of the other functions. I also need to make sure `kzalloc` is used correctly.
I need to examine the function signature and the arguments. The alignment looks good:
```c
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
```
The logic within the `ttusb_dec_send_command` function regarding error handling looks standard. I'll read and check the code.

That's the process I'd follow. Now I need to check all changes within `ttusbdecfe.c` and `ttusbdecfe.h`, thoroughly. This includes all changes to ensure they are correct, consistent, and do not introduce any regressions. It's a comprehensive review to maintain code quality.



209/4 2026/08/17 21:44 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:314 LineCount:100]

Results:
map[Contents: 314:	
 315:	static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 316:					  int param_length, const u8 params[],
 317:					  int *result_length, u8 cmd_result[])
 318:	{
 319:		int result, actual_len;
 320:		u8 *b;
 321:	
 322:		dprintk("%s\n", __func__);
 323:	
 324:		b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 325:		if (!b)
 326:			return -ENOMEM;
 327:	
 328:		result = mutex_lock_interruptible(&dec->usb_mutex);
 329:		if (result) {
 330:			printk("%s: Failed to lock usb mutex.\n", __func__);
 331:			goto err_free;
 332:		}
 333:	
 334:		b[0] = 0xaa;
 335:		b[1] = ++dec->trans_count;
 336:		b[2] = command;
 337:		b[3] = param_length;
 338:	
 339:		if (params)
 340:			memcpy(&b[4], params, param_length);
 341:	
 342:		if (debug) {
 343:			printk(KERN_DEBUG "%s: command: %*ph\n",
 344:			       __func__, param_length, b);
 345:		}
 346:	
 347:		result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 348:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 349:	
 350:		if (result) {
 351:			printk("%s: command bulk message failed: error %d\n",
 352:			       __func__, result);
 353:			goto err_mutex_unlock;
 354:		}
 355:	
 356:		result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 357:				      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 358:	
 359:		if (result) {
 360:			printk("%s: result bulk message failed: error %d\n",
 361:			       __func__, result);
 362:			goto err_mutex_unlock;
 363:		} else {
 364:			if (debug) {
 365:				printk(KERN_DEBUG "%s: result: %*ph\n",
 366:				       __func__, actual_len, b);
 367:			}
 368:	
 369:			if (result_length)
 370:				*result_length = b[3];
 371:			if (cmd_result && b[3] > 0)
 372:				memcpy(cmd_result, &b[4], b[3]);
 373:		}
 374:	
 375:	err_mutex_unlock:
 376:		mutex_unlock(&dec->usb_mutex);
 377:	err_free:
 378:		kfree(b);
 379:		return result;
 380:	}
 381:	
 382:	static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 383:					    unsigned int *model, unsigned int *version)
 384:	{
 385:		u8 c[COMMAND_PACKET_SIZE];
 386:		int c_length;
 387:		int result;
 388:		__be32 tmp;
 389:	
 390:		dprintk("%s\n", __func__);
 391:	
 392:		result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
 393:		if (result)
 394:			return result;
 395:	
 396:		if (c_length >= 0x0c) {
 397:			if (mode != NULL) {
 398:				memcpy(&tmp, c, 4);
 399:				*mode = ntohl(tmp);
 400:			}
 401:			if (model != NULL) {
 402:				memcpy(&tmp, &c[4], 4);
 403:				*model = ntohl(tmp);
 404:			}
 405:			if (version != NULL) {
 406:				memcpy(&tmp, &c[8], 4);
 407:				*version = ntohl(tmp);
 408:			}
 409:			return 0;
 410:		} else {
 411:			return -ENOENT;
 412:		}
 413:	}
]

210/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 19309
							output: 137
							thoughts: 2839
						

Thoughts:
**Code Review and Patch Analysis: `ttusb_dec_send_command`**

Alright, let's break this down. The objective here is clear: meticulously review all call sites of `ttusb_dec_send_command` across the `ttusb_dec.c` file and any related files, especially the `ttusbdecfe.c` file, as the patch seems to add a new parameter to this function. This is critical for ensuring the changes are correctly propagated and no regressions are introduced.

First, I'm noting the initial checks within `ttusb_dec.c`:  I'm focusing on the alignment of the new `sizeof()` arguments and the overall formatting. I'm carefully examining indentation levels, which are critical in the Linux kernel style for function calls. I'm mentally calculating column positions to ensure tabs and spaces are used correctly for wrapping and alignment with the opening parenthesis of a multi-line function call. I also make a quick mental note about the correct spacing around the `=` operator (spaces required around the `=`).

The diffs in `ttusb_dec.c` reveal several modifications:  lines 382, 468, 900, 1021, 1056, 1114, 1135, 1238, 1354, and 1395 are all adding a new final argument. I'm verifying that the added `sizeof()` arguments are correct and consistent across all usages. I immediately spot the lack of spaces around the commas in the original code on line 1238, and I know this needs to be fixed to satisfy the checkpatch tooling.

The most important point here is the change in the `fe_send_command` function (line 1621). This is where the function signature is being changed to accept the added argument, `cmd_result_len`. This is the core modification.  I'm now satisfied that the modifications to `ttusb_dec_send_command` are correct: new arguments are added correctly and with proper alignment and spacing. I verify this visually by checking the alignment.

Moving on to `ttusbdecfe.c`, I carefully analyze the `send_command` calls that use the `ttusbdecfe_config` structure. Lines 44, 85, 130 and 149 of the file are impacted by this change. I'm again verifying the alignment using manual tab calculations, accounting for the indentation depth and the opening parenthesis of the function call. In particular, I will need to ensure that the added arguments are properly aligned and that any existing code alignment rules are respected.

Finally, I move to `ttusbdecfe.h` to confirm the function signature change in the `struct ttusbdecfe_config`, specifically adding the `cmd_result_len` parameter to the `send_command` function pointer. This is crucial for the header files to agree with the .c files.

In short: I've verified the changes, ensuring consistency, proper alignment, and correct argument passing throughout both source files.



211/4 2026/08/17 21:44 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:900 LineCount:15]

Results:
map[Contents: 900:			case TTUSB_DEC_INTERFACE_INITIAL:
 901:				result = usb_set_interface(dec->udev, 0, 0);
 902:				break;
 903:			case TTUSB_DEC_INTERFACE_IN:
 904:				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
 905:								b, NULL, NULL);
 906:				if (result)
 907:					return result;
 908:				result = usb_set_interface(dec->udev, 0, 8);
 909:				break;
 910:			case TTUSB_DEC_INTERFACE_OUT:
 911:				result = usb_set_interface(dec->udev, 0, 1);
 912:				break;
 913:			}
 914:	
]

212/4 2026/08/17 21:44 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1235 LineCount:12]

Results:
map[Contents:1235:		}
1236:	
1237:		dec->rc_input_dev = input_dev;
1238:		if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
1239:			printk("%s: usb_submit_urb failed\n",__func__);
1240:		/* enable irq pipe */
1241:		ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1242:	
1243:		return 0;
1244:	}
1245:	
1246:	static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
]

213/4 2026/08/17 21:44 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusb_dec.c FirstLine:1620 LineCount:12]

Results:
map[Contents:1620:	}
1621:	
1622:	static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1623:				   int param_length, const u8 params[],
1624:				   int *result_length, u8 cmd_result[])
1625:	{
1626:		struct ttusb_dec* dec = fe->dvb->priv;
1627:		return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1628:	}
1629:	
1630:	static const struct ttusbdecfe_config fe_config = {
1631:		.send_command = fe_send_command
]

214/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 23605
							output: 10
							thoughts: 58
						

Thoughts:
**Checking the Current State of `ttusb_dec.c`**

Okay, let's just make absolutely sure I'm clear on the `ttusb_dec.c` situation. Need to re-examine the current patch diff against the repo version. No sense going further without that clear picture. Wait a minute! The `patch-diff` tool, that's it! It'll show me *precisely* what edits have been applied to `ttusb_dec.c` so far. Right, time to call `patch-diff`. Let's get this done.



215/4 2026/08/17 21:44 tool patch-diff
0m Error:
log-in to see details

216/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 23816
							output: 15
							thoughts: 14
						

Thoughts:
Here's my summary, as though I'm thinking through this process:

**Analyzing the `patch-diff` Call**

Okay, so I need to examine this proposed action: Let's call `patch-diff` with `File=""`. Immediately, my expert brain kicks in, parsing this directive. A call to `patch-diff` suggests we're dealing with version control or file modifications. The fact that the `File` argument is set to an empty string... that's the interesting bit. This could indicate a few things, each requiring further investigation.

My initial thoughts are:

*   **Global Patch Application:** Could this mean we're intending to apply a patch across *all* files, or to a "null" file, perhaps affecting the root of the file system's perceived state? This is potentially dangerous and I need to consider the context of the environment this command is being run in very carefully. It implies a global operation. This would need absolute precision, as even the slightest error could be catastrophic.
*   **Initialization/Default Behavior:** Maybe `patch-diff` is designed to initialize a patch repository or configure the tool. An empty `File` argument could trigger a default behavior, like creating a new patch file. I need to check the documentation to confirm this, but it seems unlikely.
*   **Debugging/Testing:** Is this call intended for testing the `patch-diff` utility itself? An empty string might be used to force a specific code path within the application, perhaps triggering a default, zero-input, or "no-file" scenario for debugging purposes. If it's for testing, what are the expected results? I need to understand that.
*   **Incorrect Usage:** It's also possible this is simply a syntax error or a misinterpretation of how `patch-diff` works. I need to consider whether the command is being correctly used, or if this is user error or an incomplete command. Are there other flags or arguments that are missing?

I need to quickly determine the true intention. I'd start by:

1.  **Consulting Documentation:** I should immediately check the documentation for `patch-diff`. What is its intended use? How does it handle an empty `File` argument?
2.  **Examining the Context:** What is the surrounding code or script? What is the overall workflow this is part of? This will provide critical clues.
3.  **Considering the Environment:** Where is this command being executed? What is the current working directory? Is there a version control system in use? Are there potential consequences to running this command in the current environment?
4.  **Confirming Expected Behavior:** Do I know what will be returned or changed by such a command?

Ultimately, this `File=""` situation demands immediate scrutiny. Ignoring it could have severe unintended consequences. I need to be sure I understand the intent *before* proceeding any further.



217/4 2026/08/17 21:44 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..a8e7b5b28 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -307,107 +307,127 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 		crc ^= *buf++;
 		crc ^= (u8)crc >> 4;
 		tmp = (u8)crc;
 		crc ^= (tmp ^ (tmp << 1)) << 4;
 	}
 	return crc;
 }
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
 
 	result = mutex_lock_interruptible(&dec->usb_mutex);
 	if (result) {
 		printk("%s: Failed to lock usb mutex.\n", __func__);
 		goto err_free;
 	}
 
 	b[0] = 0xaa;
 	b[1] = ++dec->trans_count;
 	b[2] = command;
 	b[3] = param_length;
 
 	if (params)
 		memcpy(&b[4], params, param_length);
 
 	if (debug) {
 		printk(KERN_DEBUG "%s: command: %*ph\n",
 		       __func__, param_length, b);
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: command bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: result bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	} else {
 		if (debug) {
 			printk(KERN_DEBUG "%s: result: %*ph\n",
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
 	mutex_unlock(&dec->usb_mutex);
 err_free:
 	kfree(b);
 	return result;
 }
 
 static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 				    unsigned int *model, unsigned int *version)
 {
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	__be32 tmp;
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
 	if (c_length >= 0x0c) {
 		if (mode != NULL) {
 			memcpy(&tmp, c, 4);
 			*mode = ntohl(tmp);
 		}
 		if (model != NULL) {
 			memcpy(&tmp, &c[4], 4);
 			*model = ntohl(tmp);
 		}
 		if (version != NULL) {
 			memcpy(&tmp, &c[8], 4);
 			*version = ntohl(tmp);
 		}
 		return 0;
 	} else {
 		return -ENOENT;
 	}
 }
@@ -435,27 +455,27 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
 static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 {
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0xff, 0xff,
 		   0xff, 0xff, 0xff, 0xff };
 
 	__be16 pcr = htons(dec->pid[DMX_PES_PCR]);
 	__be16 audio = htons(dec->pid[DMX_PES_AUDIO]);
 	__be16 video = htons(dec->pid[DMX_PES_VIDEO]);
 
 	dprintk("%s\n", __func__);
 
 	memcpy(&b[0], &pcr, 2);
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
 	dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO],
 			       ttusb_dec_video_pes2ts_cb, dec);
 	dec->v_pes_length = 0;
 	dec->v_pes_postbytes = 0;
 }
 
 static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
@@ -888,35 +908,35 @@ static void ttusb_dec_stop_iso_xfer(struct ttusb_dec *dec)
 /* Setting the interface of the DEC tends to take down the USB communications
  * for a short period, so it's important not to call this function just before
  * trying to talk to it.
  */
 static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 				   enum ttusb_dec_interface interface)
 {
 	int result = 0;
 	u8 b[] = { 0x05 };
 
 	if (interface != dec->interface) {
 		switch (interface) {
 		case TTUSB_DEC_INTERFACE_INITIAL:
 			result = usb_set_interface(dec->udev, 0, 0);
 			break;
-		case TTUSB_DEC_INTERFACE_IN:
-			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+			case TTUSB_DEC_INTERFACE_IN:
+				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
+								b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
 			break;
 		case TTUSB_DEC_INTERFACE_OUT:
 			result = usb_set_interface(dec->udev, 0, 1);
 			break;
 		}
 
 		if (result)
 			return result;
 
 		dec->interface = interface;
 	}
 
 	return 0;
 }
@@ -964,121 +984,121 @@ static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
 static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
 	struct ttusb_dec *dec = dvbdmx->priv;
 	u8 b0[] = { 0x05 };
 	int result = 0;
 
 	dprintk("%s\n", __func__);
 
 	dprintk("  ts_type:");
 
 	if (dvbdmxfeed->ts_type & TS_DECODER)
 		dprintk(" TS_DECODER");
 
 	if (dvbdmxfeed->ts_type & TS_PACKET)
 		dprintk(" TS_PACKET");
 
 	if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
 		dprintk(" TS_PAYLOAD_ONLY");
 
 	dprintk("\n");
 
 	switch (dvbdmxfeed->pes_type) {
 
 	case DMX_PES_VIDEO:
 		dprintk("  pes_type: DMX_PES_VIDEO\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		dec->pid[DMX_PES_VIDEO] = dvbdmxfeed->pid;
 		dec->video_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_AUDIO:
 		dprintk("  pes_type: DMX_PES_AUDIO\n");
 		dec->pid[DMX_PES_AUDIO] = dvbdmxfeed->pid;
 		dec->audio_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_TELETEXT:
 		dec->pid[DMX_PES_TELETEXT] = dvbdmxfeed->pid;
 		dprintk("  pes_type: DMX_PES_TELETEXT(not supported)\n");
 		return -ENOSYS;
 
 	case DMX_PES_PCR:
 		dprintk("  pes_type: DMX_PES_PCR\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_OTHER:
 		dprintk("  pes_type: DMX_PES_OTHER(not supported)\n");
 		return -ENOSYS;
 
 	default:
 		dprintk("  pes_type: unknown (%d)\n", dvbdmxfeed->pes_type);
 		return -EINVAL;
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
 	dec->pva_stream_count++;
 	return ttusb_dec_start_iso_xfer(dec);
 }
 
 static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x01,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0xff, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00 };
 	__be16 pid;
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	struct filter_info *finfo;
 	unsigned long flags;
 	u8 x = 1;
 
 	dprintk("%s\n", __func__);
 
 	pid = htons(dvbdmxfeed->pid);
 	memcpy(&b0[0], &pid, 2);
 	memcpy(&b0[4], &x, 1);
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
 			if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC)))
 				return -ENOMEM;
 
 			finfo->stream_id = c[1];
 			finfo->filter = dvbdmxfeed->filter;
 
 			spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 			list_add_tail(&finfo->filter_info_list,
 				      &dec->filter_info_list);
 			spin_unlock_irqrestore(&dec->filter_info_list_lock,
 					       flags);
 
 			dvbdmxfeed->priv = finfo;
 
 			dec->filter_stream_count++;
 			return ttusb_dec_start_iso_xfer(dec);
 		}
 
 		return -EAGAIN;
 	} else
 		return result;
 }
@@ -1107,42 +1127,42 @@ static int ttusb_dec_start_feed(struct dvb_demux_feed *dvbdmxfeed)
 		return -EINVAL;
 
 	}
 }
 
 static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00 };
 	struct filter_info *finfo = dvbdmxfeed->priv;
 	unsigned long flags;
 
 	b0[1] = finfo->stream_id;
 	spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
@@ -1207,45 +1227,45 @@ static void ttusb_dec_init_bh_work(struct ttusb_dec *dec)
 static int ttusb_init_rc( struct ttusb_dec *dec)
 {
 	struct input_dev *input_dev;
 	u8 b[] = { 0x00, 0x01 };
 	int i;
 	int err;
 
 	usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
 	strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
 
 	input_dev = input_allocate_device();
 	if (!input_dev)
 		return -ENOMEM;
 
 	input_dev->name = "ttusb_dec remote control";
 	input_dev->phys = dec->rc_phys;
 	input_dev->evbit[0] = BIT_MASK(EV_KEY);
 	input_dev->keycodesize = sizeof(u16);
 	input_dev->keycodemax = 0x1a;
 	input_dev->keycode = rc_keys;
 
 	for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
 		  set_bit(rc_keys[i], input_dev->keybit);
 
 	err = input_register_device(input_dev);
 	if (err) {
 		input_free_device(input_dev);
 		return err;
 	}
 
 	dec->rc_input_dev = input_dev;
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);
 
 	return 0;
 }
 
 static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
 {
 	dprintk("%s\n", __func__);
 
 	dec->v_pes[0] = 0x00;
 	dec->v_pes[1] = 0x00;
@@ -1298,111 +1318,111 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
 static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 {
 	int i, j, actual_len, result, size, trans_count;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x61, 0x00 };
 	u8 b1[] = { 0x61 };
 	u8 *b;
 	char idstring[21];
 	const u8 *firmware = NULL;
 	size_t firmware_size = 0;
 	u16 firmware_csum = 0;
 	__be16 firmware_csum_ns;
 	__be32 firmware_size_nl;
 	u32 crc32_csum, crc32_check;
 	__be32 tmp;
 	const struct firmware *fw_entry = NULL;
 
 	dprintk("%s\n", __func__);
 
 	result = request_firmware(&fw_entry, dec->firmware_name, &dec->udev->dev);
 	if (result) {
 		printk(KERN_ERR "%s: Firmware (%s) unavailable.\n",
 		       __func__, dec->firmware_name);
 		return result;
 	}
 
 	firmware = fw_entry->data;
 	firmware_size = fw_entry->size;
 
 	if (firmware_size < 60) {
 		printk("%s: firmware size too small for DSP code (%zu < 60).\n",
 			__func__, firmware_size);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 
 	/* a 32 bit checksum over the first 56 bytes of the DSP Code is stored
 	   at offset 56 of file, so use it to check if the firmware file is
 	   valid. */
 	crc32_csum = crc32(~0L, firmware, 56) ^ ~0L;
 	memcpy(&tmp, &firmware[56], 4);
 	crc32_check = ntohl(tmp);
 	if (crc32_csum != crc32_check) {
 		printk("%s: crc32 check of DSP code failed (calculated 0x%08x != 0x%08x in file), file invalid.\n",
 			__func__, crc32_csum, crc32_check);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 	memcpy(idstring, &firmware[36], 20);
 	idstring[20] = '\0';
 	printk(KERN_INFO "ttusb_dec: found DSP code \"%s\".\n", idstring);
 
 	firmware_size_nl = htonl(firmware_size);
 	memcpy(b0, &firmware_size_nl, 4);
 	firmware_csum = crc16(~0, firmware, firmware_size) ^ ~0;
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
 		return result;
 	}
 
 	trans_count = 0;
 	j = 0;
 
 	b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
 	if (b == NULL) {
 		release_firmware(fw_entry);
 		return -ENOMEM;
 	}
 
 	for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
 		size = firmware_size - i;
 		if (size > COMMAND_PACKET_SIZE)
 			size = COMMAND_PACKET_SIZE;
 
 		b[j + 0] = 0xaa;
 		b[j + 1] = trans_count++;
 		b[j + 2] = 0xf0;
 		b[j + 3] = size;
 		memcpy(&b[j + 4], &firmware[i], size);
 
 		j += COMMAND_PACKET_SIZE + 4;
 
 		if (j >= ARM_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      ARM_PACKET_SIZE, &actual_len,
 					      100);
 			j = 0;
 		} else if (size < COMMAND_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      j - COMMAND_PACKET_SIZE + size,
 					      &actual_len, 100);
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
 
 	return result;
 }
 
 static int ttusb_dec_init_stb(struct ttusb_dec *dec)
 {
 	int result;
@@ -1614,24 +1634,25 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 	while ((item = dec->filter_info_list.next) != &dec->filter_info_list) {
 		finfo = list_entry(item, struct filter_info, filter_info_list);
 		list_del(&finfo->filter_info_list);
 		kfree(finfo);
 	}
 }
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
 	.send_command = fe_send_command
 };
 
 static int ttusb_dec_probe(struct usb_interface *intf,
 			   const struct usb_device_id *id)
 {
 	struct usb_device *udev;
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..0bd80ade4 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -36,39 +36,40 @@ static int ttusbdecfe_dvbs_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 				       enum fe_status *status)
 {
 	struct ttusbdecfe_state* state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	u8 result[4];
 	int len, ret;
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					sizeof(result));
 	if(ret)
 		return ret;
 
 	if(len != 4) {
 		printk(KERN_ERR "%s: unexpected reply\n", __func__);
 		return -EIO;
 	}
 
 	switch(result[3]) {
 		case 1:  /* not tuned yet */
 		case 2:  /* no signal/no lock*/
 			break;
 		case 3:	 /* signal found and locked*/
 			*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
 			FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
 			break;
 		case 4:
 			*status = FE_TIMEDOUT;
 			break;
 		default:
 			pr_info("%s: returned unknown value: %d\n",
 				__func__, result[3]);
 			return -EIO;
 	}
 
 	return 0;
 }
@@ -76,23 +77,23 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x03,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0xff,
 		   0x00, 0x00, 0x00, 0xff };
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 					struct dvb_frontend_tune_settings* fesettings)
 {
 		fesettings->min_delay_ms = 1500;
 		/* Drift compensation makes no sense for DVB-T */
 		fesettings->step_size = 0;
@@ -103,60 +104,60 @@ static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
 	u8 b[] = { 0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	__be32 freq;
 	__be32 sym_rate;
 	__be32 band;
 	__be32 lnb_voltage;
 
 	freq = htonl(p->frequency +
 	       (state->hi_band ? LOF_HI : LOF_LO));
 	memcpy(&b[4], &freq, sizeof(u32));
 	sym_rate = htonl(p->symbol_rate);
 	memcpy(&b[12], &sym_rate, sizeof(u32));
 	band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 	memcpy(&b[24], &band, sizeof(u32));
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0xff, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00 };
 
 	if (cmd->msg_len > sizeof(b) - 4)
 		return -EINVAL;
 
 	memcpy(&b[4], cmd->msg, cmd->msg_len);
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
 
 
 static int ttusbdecfe_dvbs_set_tone(struct dvb_frontend *fe,
 				    enum fe_sec_tone_mode tone)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -7,18 +7,19 @@
 
 #ifndef TTUSBDECFE_H
 #define TTUSBDECFE_H
 
 #include <linux/dvb/frontend.h>
 
 struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 
 extern struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config);
 
 #endif // TTUSBDECFE_H
]

218/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 33836
							output: 138
							thoughts: 415
						

Thoughts:
**My Immediate Assessment and Corrective Action Plan**

Alright, I've got a clear understanding of the situation now. Time to roll up my sleeves and address these issues head-on, using `codeeditor`, of course. This looks like straightforward cleanup. Let's start with the first file, `drivers/media/usb/ttusb-dec/ttusb_dec.c`.

First on the list: an indentation problem in `ttusb_dec_set_interface`. It's a simple fix, just needs the case statement properly indented. Easy peasy, should take seconds to rectify.

Then, there's a cosmetic spacing issue on line 1241. A missing space; `ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0);` needs to become `ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);`. Again, trivial.

Finally, the function call spanning lines 1622-1628 is a bit unwieldy. We need to wrap that call for improved readability and maintainability. `return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);` to be reformatted as:

```c
	return ttusb_dec_send_command(dec, command, param_length, params,
				      result_length, cmd_result,
				      cmd_result_len);
```

Let's get this `codeeditor` fired up and make these changes. Starting with `ttusb_dec.c` and addressing the case indentation issue.



219/4 2026/08/17 21:44 tool codeeditor
0m Args:
map[CurrentCode:			case TTUSB_DEC_INTERFACE_IN:
				result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
								b, NULL, NULL, 0); NewCode:		case TTUSB_DEC_INTERFACE_IN:
			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
							b, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

220/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 34773
							output: 118
							thoughts: 21
						

Thoughts:
Here's my summary, as though I'm thinking it:

**Minor Code Clean-up in `ttusb_dec.c`**

Right, quick note to self: line 1241 in `ttusb_dec.c`. The code's solid, functionality's fine, but I'm just spotting a small, nitpicky style issue. I need to add a space after the comma on that line. That's all. Keep the code consistent. Done. Next!



221/4 2026/08/17 21:44 tool codeeditor
0m Args:
map[CurrentCode:	/* enable irq pipe */
	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL,0); NewCode:	/* enable irq pipe */
	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0); SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

222/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 35027
							output: 282
							thoughts: 26
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in the weeds of `ttusb_dec.c` and a total expert:

**Reflecting on the `fe_send_command` Modification**

Alright, so the next thing on my plate is in `ttusb_dec.c`, line 1627. Looks like I need to revisit the wrapping of the `fe_send_command` function. I'm probably thinking about some potential edge case I missed, a race condition, or perhaps a buffer overflow scenario. I'm likely concerned with the robustness of the error handling around that command. Was there a specific issue reported? Did a recent test highlight a problem? Or am I proactively addressing a potential vulnerability I spotted during a code review or a refactoring effort? Knowing this area of the code so well, the specifics of the wrap are probably top of mind - is it a mutex protection, a timeout, or maybe some form of error checking after the call? I'll need to carefully consider how this change will impact the overall flow of the decoding process and its interaction with the frontend. Let's dig in.



223/4 2026/08/17 21:44 tool codeeditor
0m Args:
map[CurrentCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[],
			   int cmd_result_len)
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result, cmd_result_len);
} NewCode:static int fe_send_command(struct dvb_frontend* fe, const u8 command,
			   int param_length, const u8 params[],
			   int *result_length, u8 cmd_result[],
			   int cmd_result_len)
{
	struct ttusb_dec* dec = fe->dvb->priv;
	return ttusb_dec_send_command(dec, command, param_length, params,
				      result_length, cmd_result,
				      cmd_result_len);
} SourceFile:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[]

224/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 35585
							output: 44
							thoughts: 112
						

Thoughts:
**Analyzing the TTUSB-DEC Driver**

Okay, let's dive into this `ttusbdecfe.c` file, specifically within the `drivers/media/usb/ttusb-dec` directory. I'm seeing this `send_command` call and I need to understand it better:

`ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result, sizeof(result));`

I'm zeroing in on this function call, figuring it's the heart of the communication with the front-end device. Looking at lines 40-52 of the code file. I need to refresh the function call parameters as a reminder:

*   `fe`: I assume this is a pointer to the front-end device structure.
*   `0x73`: This looks like a command code. I'll need to figure out what that specific code does.
*   `sizeof(b)` and `b`: These likely relate to the outgoing command data. `b` is probably a buffer.
*   `&len` and `result`: Here, I see the expected length of the result (likely an output parameter) and the actual result buffer.
*   `sizeof(result)`: And, of course, the size of the result buffer.

Now, I'll review lines 40-52 to get a better handle on the context of this function call. I need to understand the data structures and how this command is being used within the larger scope of the driver. I need to understand how the command is being used.



225/4 2026/08/17 21:44 tool read-file
0m Args:
map[File:drivers/media/usb/ttusb-dec/ttusbdecfe.c FirstLine:40 LineCount:15]

Results:
map[Contents:  40:		u8 b[] = { 0x00, 0x00, 0x00, 0x00,
  41:			   0x00, 0x00, 0x00, 0x00 };
  42:		u8 result[4];
  43:		int len, ret;
  44:	
  45:		*status=0;
  46:	
  47:		ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
  48:		if(ret)
  49:			return ret;
  50:	
  51:		if(len != 4) {
  52:			printk(KERN_ERR "%s: unexpected reply\n", __func__);
  53:			return -EIO;
  54:		}
]

226/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 36327
							output: 117
							thoughts: 838
						

Thoughts:
**Analyzing and Refining Code Alignment in `ttusbdecfe.c`**

Okay, let's dive into this snippet of `ttusbdecfe.c`. I need to ensure the alignment is consistent and conforms to the Linux kernel coding style. Specifically, I'm focusing on line 47, which calls `state->config->send_command()`. I see that the original line is:

`	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,`
`					sizeof(result));`

First, I need to make a minor edit for formatting:

`ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,`
`				   sizeof(result));`

Now, for the alignment! I need to nail down whether it's tabs, spaces, or a combination. The key is adhering to the kernel's coding standards. I quickly check lines 45-48. This confirms the context.

I need to calculate the alignment precisely. The length of `"ret = state->config->send_command("` is 33 characters, after the tab. After one tab (8 spaces), that puts me at column 41. I need to get the `sizeof(result));` under the parenthesis. The line `\tret = state->config->send_command(` is 41 characters. To align it, it would be 5 tabs + 1 space from the beginning of the line. Also, I could use 4 tabs and 9 spaces (32 + 9 = 41).

I recall the kernel coding style; it's quite specific about this. Outside of comments, spaces are *never* used for indentation and when wrapping function calls. We should use tabs up to the tab stop before the parenthesis, then spaces.

So, I need to calculate: Starting with a tab (8 spaces). Then 33 characters. That's a total of 41 spaces. Let's see... 41 / 8 is 5 tabs with a remainder of 1.  So, it should be:  `\t\t\t\t\t`. Then after the fifth tab, it's 1 space. No, this can't be correct, let's see what `checkpatch` thinks!

I'll check both methods and verify the result using `checkpatch`! Finally, I'll apply the edit to `ttusbdecfe.c`.



227/4 2026/08/17 21:44 tool codeeditor
0m Args:
map[CurrentCode:	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
					sizeof(result)); NewCode:	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
					  sizeof(result)); SourceFile:drivers/media/usb/ttusb-dec/ttusbdecfe.c]

Results:
map[]

228/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 37843
							output: 9
							thoughts: 20
						

Thoughts:
Okay, let's see. I've been working diligently on this, but before I consider it truly done, I need to make absolutely sure everything is up to snuff. Let's fire up `checkpatch`. That's the go-to tool for finding those subtle, but potentially critical, coding style issues, remnants of debugging statements, or any other overlooked imperfections that might have slipped through the cracks. It's time to run it and ensure I've dotted all the i's and crossed all the t's before submitting this. I want this to be as flawless as possible.



229/4 2026/08/17 21:44 tool checkpatch
0m Results:
map[Output:total: 0 errors, 0 warnings, 182 lines checked

Your patch has no obvious style problems and is ready for submission.
]

230/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 38039
							output: 15
							thoughts: 72
						

Thoughts:
**Patch Review Confirmed – Ready for Deep Dive**

Okay, so `checkpatch` is giving me the green light – no errors, no warnings, a clean bill of health across 182 lines. That's a great start, and I'm not surprised. I'm usually pretty meticulous about these things. The "ready for submission" message is promising, but I'm not going to get complacent. This is where the real work begins.

Now, let's pull up that `patch-diff`. I need to verify that this entire change is clean, that every line is precisely what it needs to be. I want to be *absolutely* certain that the code logic remains not just intact, but also that it’s demonstrably improved, optimized where applicable, and certainly doesn't introduce any regressions or subtle bugs. And, of course, the code needs to *look* great. Readability and maintainability are paramount. I need to give this change a thorough inspection.



231/4 2026/08/17 21:44 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..b54b7b4bb 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -307,107 +307,127 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 		crc ^= *buf++;
 		crc ^= (u8)crc >> 4;
 		tmp = (u8)crc;
 		crc ^= (tmp ^ (tmp << 1)) << 4;
 	}
 	return crc;
 }
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
 
 	result = mutex_lock_interruptible(&dec->usb_mutex);
 	if (result) {
 		printk("%s: Failed to lock usb mutex.\n", __func__);
 		goto err_free;
 	}
 
 	b[0] = 0xaa;
 	b[1] = ++dec->trans_count;
 	b[2] = command;
 	b[3] = param_length;
 
 	if (params)
 		memcpy(&b[4], params, param_length);
 
 	if (debug) {
 		printk(KERN_DEBUG "%s: command: %*ph\n",
 		       __func__, param_length, b);
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: command bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: result bulk message failed: error %d\n",
 		       __func__, result);
 		goto err_mutex_unlock;
 	} else {
 		if (debug) {
 			printk(KERN_DEBUG "%s: result: %*ph\n",
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
 	mutex_unlock(&dec->usb_mutex);
 err_free:
 	kfree(b);
 	return result;
 }
 
 static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 				    unsigned int *model, unsigned int *version)
 {
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	__be32 tmp;
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
 	if (c_length >= 0x0c) {
 		if (mode != NULL) {
 			memcpy(&tmp, c, 4);
 			*mode = ntohl(tmp);
 		}
 		if (model != NULL) {
 			memcpy(&tmp, &c[4], 4);
 			*model = ntohl(tmp);
 		}
 		if (version != NULL) {
 			memcpy(&tmp, &c[8], 4);
 			*version = ntohl(tmp);
 		}
 		return 0;
 	} else {
 		return -ENOENT;
 	}
 }
@@ -435,27 +455,27 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
 static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 {
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0xff, 0xff,
 		   0xff, 0xff, 0xff, 0xff };
 
 	__be16 pcr = htons(dec->pid[DMX_PES_PCR]);
 	__be16 audio = htons(dec->pid[DMX_PES_AUDIO]);
 	__be16 video = htons(dec->pid[DMX_PES_VIDEO]);
 
 	dprintk("%s\n", __func__);
 
 	memcpy(&b[0], &pcr, 2);
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
 	dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO],
 			       ttusb_dec_video_pes2ts_cb, dec);
 	dec->v_pes_length = 0;
 	dec->v_pes_postbytes = 0;
 }
 
 static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
@@ -888,35 +908,35 @@ static void ttusb_dec_stop_iso_xfer(struct ttusb_dec *dec)
 /* Setting the interface of the DEC tends to take down the USB communications
  * for a short period, so it's important not to call this function just before
  * trying to talk to it.
  */
 static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 				   enum ttusb_dec_interface interface)
 {
 	int result = 0;
 	u8 b[] = { 0x05 };
 
 	if (interface != dec->interface) {
 		switch (interface) {
 		case TTUSB_DEC_INTERFACE_INITIAL:
 			result = usb_set_interface(dec->udev, 0, 0);
 			break;
 		case TTUSB_DEC_INTERFACE_IN:
 			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+							b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
 			break;
 		case TTUSB_DEC_INTERFACE_OUT:
 			result = usb_set_interface(dec->udev, 0, 1);
 			break;
 		}
 
 		if (result)
 			return result;
 
 		dec->interface = interface;
 	}
 
 	return 0;
 }
@@ -964,121 +984,121 @@ static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
 static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
 	struct ttusb_dec *dec = dvbdmx->priv;
 	u8 b0[] = { 0x05 };
 	int result = 0;
 
 	dprintk("%s\n", __func__);
 
 	dprintk("  ts_type:");
 
 	if (dvbdmxfeed->ts_type & TS_DECODER)
 		dprintk(" TS_DECODER");
 
 	if (dvbdmxfeed->ts_type & TS_PACKET)
 		dprintk(" TS_PACKET");
 
 	if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
 		dprintk(" TS_PAYLOAD_ONLY");
 
 	dprintk("\n");
 
 	switch (dvbdmxfeed->pes_type) {
 
 	case DMX_PES_VIDEO:
 		dprintk("  pes_type: DMX_PES_VIDEO\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		dec->pid[DMX_PES_VIDEO] = dvbdmxfeed->pid;
 		dec->video_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_AUDIO:
 		dprintk("  pes_type: DMX_PES_AUDIO\n");
 		dec->pid[DMX_PES_AUDIO] = dvbdmxfeed->pid;
 		dec->audio_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_TELETEXT:
 		dec->pid[DMX_PES_TELETEXT] = dvbdmxfeed->pid;
 		dprintk("  pes_type: DMX_PES_TELETEXT(not supported)\n");
 		return -ENOSYS;
 
 	case DMX_PES_PCR:
 		dprintk("  pes_type: DMX_PES_PCR\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_PES_OTHER:
 		dprintk("  pes_type: DMX_PES_OTHER(not supported)\n");
 		return -ENOSYS;
 
 	default:
 		dprintk("  pes_type: unknown (%d)\n", dvbdmxfeed->pes_type);
 		return -EINVAL;
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
 	dec->pva_stream_count++;
 	return ttusb_dec_start_iso_xfer(dec);
 }
 
 static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x01,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0xff, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00 };
 	__be16 pid;
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	struct filter_info *finfo;
 	unsigned long flags;
 	u8 x = 1;
 
 	dprintk("%s\n", __func__);
 
 	pid = htons(dvbdmxfeed->pid);
 	memcpy(&b0[0], &pid, 2);
 	memcpy(&b0[4], &x, 1);
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
 			if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC)))
 				return -ENOMEM;
 
 			finfo->stream_id = c[1];
 			finfo->filter = dvbdmxfeed->filter;
 
 			spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 			list_add_tail(&finfo->filter_info_list,
 				      &dec->filter_info_list);
 			spin_unlock_irqrestore(&dec->filter_info_list_lock,
 					       flags);
 
 			dvbdmxfeed->priv = finfo;
 
 			dec->filter_stream_count++;
 			return ttusb_dec_start_iso_xfer(dec);
 		}
 
 		return -EAGAIN;
 	} else
 		return result;
 }
@@ -1107,42 +1127,42 @@ static int ttusb_dec_start_feed(struct dvb_demux_feed *dvbdmxfeed)
 		return -EINVAL;
 
 	}
 }
 
 static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00 };
 	struct filter_info *finfo = dvbdmxfeed->priv;
 	unsigned long flags;
 
 	b0[1] = finfo->stream_id;
 	spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
 	ttusb_dec_stop_iso_xfer(dec);
 
 	return 0;
 }
 
 static int ttusb_dec_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
@@ -1207,45 +1227,45 @@ static void ttusb_dec_init_bh_work(struct ttusb_dec *dec)
 static int ttusb_init_rc( struct ttusb_dec *dec)
 {
 	struct input_dev *input_dev;
 	u8 b[] = { 0x00, 0x01 };
 	int i;
 	int err;
 
 	usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
 	strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
 
 	input_dev = input_allocate_device();
 	if (!input_dev)
 		return -ENOMEM;
 
 	input_dev->name = "ttusb_dec remote control";
 	input_dev->phys = dec->rc_phys;
 	input_dev->evbit[0] = BIT_MASK(EV_KEY);
 	input_dev->keycodesize = sizeof(u16);
 	input_dev->keycodemax = 0x1a;
 	input_dev->keycode = rc_keys;
 
 	for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
 		  set_bit(rc_keys[i], input_dev->keybit);
 
 	err = input_register_device(input_dev);
 	if (err) {
 		input_free_device(input_dev);
 		return err;
 	}
 
 	dec->rc_input_dev = input_dev;
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
 {
 	dprintk("%s\n", __func__);
 
 	dec->v_pes[0] = 0x00;
 	dec->v_pes[1] = 0x00;
@@ -1298,111 +1318,111 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
 static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 {
 	int i, j, actual_len, result, size, trans_count;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x61, 0x00 };
 	u8 b1[] = { 0x61 };
 	u8 *b;
 	char idstring[21];
 	const u8 *firmware = NULL;
 	size_t firmware_size = 0;
 	u16 firmware_csum = 0;
 	__be16 firmware_csum_ns;
 	__be32 firmware_size_nl;
 	u32 crc32_csum, crc32_check;
 	__be32 tmp;
 	const struct firmware *fw_entry = NULL;
 
 	dprintk("%s\n", __func__);
 
 	result = request_firmware(&fw_entry, dec->firmware_name, &dec->udev->dev);
 	if (result) {
 		printk(KERN_ERR "%s: Firmware (%s) unavailable.\n",
 		       __func__, dec->firmware_name);
 		return result;
 	}
 
 	firmware = fw_entry->data;
 	firmware_size = fw_entry->size;
 
 	if (firmware_size < 60) {
 		printk("%s: firmware size too small for DSP code (%zu < 60).\n",
 			__func__, firmware_size);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 
 	/* a 32 bit checksum over the first 56 bytes of the DSP Code is stored
 	   at offset 56 of file, so use it to check if the firmware file is
 	   valid. */
 	crc32_csum = crc32(~0L, firmware, 56) ^ ~0L;
 	memcpy(&tmp, &firmware[56], 4);
 	crc32_check = ntohl(tmp);
 	if (crc32_csum != crc32_check) {
 		printk("%s: crc32 check of DSP code failed (calculated 0x%08x != 0x%08x in file), file invalid.\n",
 			__func__, crc32_csum, crc32_check);
 		release_firmware(fw_entry);
 		return -ENOENT;
 	}
 	memcpy(idstring, &firmware[36], 20);
 	idstring[20] = '\0';
 	printk(KERN_INFO "ttusb_dec: found DSP code \"%s\".\n", idstring);
 
 	firmware_size_nl = htonl(firmware_size);
 	memcpy(b0, &firmware_size_nl, 4);
 	firmware_csum = crc16(~0, firmware, firmware_size) ^ ~0;
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
 		return result;
 	}
 
 	trans_count = 0;
 	j = 0;
 
 	b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
 	if (b == NULL) {
 		release_firmware(fw_entry);
 		return -ENOMEM;
 	}
 
 	for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
 		size = firmware_size - i;
 		if (size > COMMAND_PACKET_SIZE)
 			size = COMMAND_PACKET_SIZE;
 
 		b[j + 0] = 0xaa;
 		b[j + 1] = trans_count++;
 		b[j + 2] = 0xf0;
 		b[j + 3] = size;
 		memcpy(&b[j + 4], &firmware[i], size);
 
 		j += COMMAND_PACKET_SIZE + 4;
 
 		if (j >= ARM_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      ARM_PACKET_SIZE, &actual_len,
 					      100);
 			j = 0;
 		} else if (size < COMMAND_PACKET_SIZE) {
 			result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 					      j - COMMAND_PACKET_SIZE + size,
 					      &actual_len, 100);
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
 
 	return result;
 }
 
 static int ttusb_dec_init_stb(struct ttusb_dec *dec)
 {
 	int result;
@@ -1614,24 +1634,27 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 	while ((item = dec->filter_info_list.next) != &dec->filter_info_list) {
 		finfo = list_entry(item, struct filter_info, filter_info_list);
 		list_del(&finfo->filter_info_list);
 		kfree(finfo);
 	}
 }
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params,
+				      result_length, cmd_result,
+				      cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
 	.send_command = fe_send_command
 };
 
 static int ttusb_dec_probe(struct usb_interface *intf,
 			   const struct usb_device_id *id)
 {
 	struct usb_device *udev;
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..b013d6dfc 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -36,39 +36,40 @@ static int ttusbdecfe_dvbs_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 				       enum fe_status *status)
 {
 	struct ttusbdecfe_state* state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	u8 result[4];
 	int len, ret;
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					  sizeof(result));
 	if(ret)
 		return ret;
 
 	if(len != 4) {
 		printk(KERN_ERR "%s: unexpected reply\n", __func__);
 		return -EIO;
 	}
 
 	switch(result[3]) {
 		case 1:  /* not tuned yet */
 		case 2:  /* no signal/no lock*/
 			break;
 		case 3:	 /* signal found and locked*/
 			*status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
 			FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
 			break;
 		case 4:
 			*status = FE_TIMEDOUT;
 			break;
 		default:
 			pr_info("%s: returned unknown value: %d\n",
 				__func__, result[3]);
 			return -EIO;
 	}
 
 	return 0;
 }
@@ -76,23 +77,23 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x03,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0xff,
 		   0x00, 0x00, 0x00, 0xff };
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 					struct dvb_frontend_tune_settings* fesettings)
 {
 		fesettings->min_delay_ms = 1500;
 		/* Drift compensation makes no sense for DVB-T */
 		fesettings->step_size = 0;
@@ -103,60 +104,60 @@ static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
 	u8 b[] = { 0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x01,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00 };
 	__be32 freq;
 	__be32 sym_rate;
 	__be32 band;
 	__be32 lnb_voltage;
 
 	freq = htonl(p->frequency +
 	       (state->hi_band ? LOF_HI : LOF_LO));
 	memcpy(&b[4], &freq, sizeof(u32));
 	sym_rate = htonl(p->symbol_rate);
 	memcpy(&b[12], &sym_rate, sizeof(u32));
 	band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 	memcpy(&b[24], &band, sizeof(u32));
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
 
 static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 	u8 b[] = { 0x00, 0xff, 0x00, 0x00,
 		   0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00 };
 
 	if (cmd->msg_len > sizeof(b) - 4)
 		return -EINVAL;
 
 	memcpy(&b[4], cmd->msg, cmd->msg_len);
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
 
 
 static int ttusbdecfe_dvbs_set_tone(struct dvb_frontend *fe,
 				    enum fe_sec_tone_mode tone)
 {
 	struct ttusbdecfe_state *state = fe->demodulator_priv;
 
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -7,18 +7,19 @@
 
 #ifndef TTUSBDECFE_H
 #define TTUSBDECFE_H
 
 #include <linux/dvb/frontend.h>
 
 struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 
 extern struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config);
 
 #endif // TTUSBDECFE_H
]

232/4 2026/08/17 21:44 llm patch-formatter
0m Model:
gemini-3.6-flash

Tokens:
							input: 47685
							output: 150
							thoughts: 35
						

Thoughts:
Here's my take on the situation:

**Ready to Present**

Okay, so I've meticulously examined the patch diff – everything's looking pristine. It's clean, the changes are well-defined. I've run `checkpatch`, and the output is flawless; no errors, no warnings, which is exactly what I was hoping for. Most importantly, I've confirmed that the logic remains intact, precisely as intended. With all of that confirmed, I'm confident in presenting this result now. We're good to go.



233/3 2026/08/17 21:44 action test-patch-inplace
13m Results:
map[PatchDiff:diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..b54b7b4bb 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
@@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
@@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
@@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
@@ -902,7 +922,7 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 			break;
 		case TTUSB_DEC_INTERFACE_IN:
 			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+							b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
@@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
@@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
@@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
@@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
@@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
@@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
@@ -1621,10 +1641,13 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params,
+				      result_length, cmd_result,
+				      cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..b013d6dfc 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					  sizeof(result));
 	if(ret)
 		return ret;
 
@@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -14,7 +14,8 @@ struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);
 TestError:]

234/3 2026/08/17 21:58 action run-checkpatch
0m Results:
map[CheckpatchOutput:total: 0 errors, 0 warnings, 182 lines checked

Your patch has no obvious style problems and is ready for submission.
 NeedRefinement:false]

235/1 2026/08/17 21:58 agent fixes-finder
11m Model:
best-expensive

Results:
map[FixesHash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2]

Instruction:
You are an experienced Linux kernel developer tasked with identifying the commit
that introduced the bug being fixed. Identifying the correct buggy commit is crucial
for proper kernel maintenance (backporting to stable trees, etc.).

Your investigation strategy:
1. Examine the patch that fixes the bug. Use git tools (like git-log or git-blame)
   to trace the history of the lines or functions modified by the patch.
2. Analyze the stack trace in the crash report. Identify the key files and functions
   involved in the crash and investigate their history to see when the problematic
   logic was introduced.
3. Compare the bug explanation with the commit history to find the point where
   the described logic error first appeared.

A bug is typically introduced when a piece of code is first written, or when
a refactoring changed its logic in a way that introduced the bug.
Trace the history of relevant symbols or find when specific code patterns were introduced/removed.

You must provide exactly one bug-introducing commit hash.
If you are unable to confidently determine the bug-introducing commit after investigation,
return an empty string rather than guessing.

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:
The crash is:

usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036, CPU#0: kworker/0:4/4798
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
lr : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
sp : ffff800098516d20
x29: ffff800098516d20 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: ffff800086d0a338 x21: 0000000000000000
x20: 000000000000004b x19: 000000000000003c x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
irq event stamp: 16196
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62
hardirqs last disabled at (16196): [<ffff8000868f86e0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425
softirqs last  enabled at (16128): [<ffff80008030ff18>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (16128): [<ffff80008030ff18>] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650
softirqs last disabled at (16119): [<ffff8000800204b0>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kernel BUG at lib/string_helpers.c:1044!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Tainted: G        W           syzkaller #1 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
lr : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
sp : ffff800098516d50
x29: ffff800098516d50 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: 000000000000004b x21: ffff0000d1862680
x20: 1fffe0001a30c4d0 x19: ffff0000c3014000 x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043 (P)
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
Code: d503233f a9bf7bfd 910003fd 94619ee8 (d4210000) 
---[ end trace 0000000000000000 ]---



The explanation of the root cause is:

The crash is caused by a buffer overflow (both an out-of-bounds read and an out-of-bounds write) in the `ttusb_dec_send_command()` function, triggered by a malicious or malfunctioning USB device returning an unexpectedly large payload length.

### Detailed Analysis

In `drivers/media/usb/ttusb-dec/ttusb_dec.c`, the `ttusb_dec_send_command()` function allocates a buffer `b` to send a command and receive the response via `usb_bulk_msg()`:

```c
	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
```
Here, `COMMAND_PACKET_SIZE` is defined as `0x3c` (60), so the allocated buffer `b` is exactly 64 bytes.

After receiving the response from the USB device, the driver reads the payload length directly from `b[3]` (which is fully controlled by the USB device) and copies the payload into the caller-provided `cmd_result` buffer:

```c
		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0)
			memcpy(cmd_result, &b[4], b[3]);
```

There are two major flaws in this logic:
1. **No bounds check against the received data or the allocated buffer `b`**: `b[3]` is an 8-bit value and can be up to 255. If the device returns a value greater than `COMMAND_PACKET_SIZE` (60), the `memcpy()` will read past the end of the 64-byte buffer `b`. In the syzkaller crash, `b[3]` was `75`, leading to a 75-byte read from `&b[4]` (which only has 60 bytes allocated). This triggers the `fortify_memcpy_chk` panic (`75 byte read of buffer size 60`).
2. **No bounds check against the destination buffer `cmd_result`**: The size of `cmd_result` is never passed to `ttusb_dec_send_command()`. While callers like `ttusb_dec_get_stb_state()` pass a 60-byte buffer (`u8 c[COMMAND_PACKET_SIZE]`), other callers like `ttusbdecfe_dvbt_read_status()` in `ttusbdecfe.c` pass a much smaller buffer (`u8 result[4]`). If the device returns `b[3] = 60` for the latter, it will result in a severe stack buffer overflow.

### Proposed Fix

To fix this comprehensively, the API needs to be updated to pass the size of the destination buffer, and `ttusb_dec_send_command()` must validate `b[3]` against the received length, the maximum packet size, and the destination buffer size.

**1. Update `ttusbdecfe_config` in `drivers/media/usb/ttusb-dec/ttusbdecfe.h`:**
Add `cmd_result_len` to the `send_command` callback signature.
```c
struct ttusbdecfe_config
{
	int (*send_command)(struct dvb_frontend* fe, const u8 command,
			    int param_length, const u8 params[],
			    int *result_length, u8 cmd_result[],
			    int cmd_result_len);
};
```

**2. Update `ttusb_dec_send_command()` in `ttusb_dec.c`:**
Add `cmd_result_len` to the signature and implement the necessary bounds checks.
```c
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	// ...
	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);

	if (result) {
		printk("%s: result bulk message failed: error %d\n",
		       __func__, result);
		goto err_mutex_unlock;
	} else {
		if (debug) {
			printk(KERN_DEBUG "%s: result: %*ph\n",
			       __func__, actual_len, b);
		}

		/* Ensure we received at least the 4-byte header */
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		/* Ensure the device isn't claiming more data than it sent or than fits in b */
		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];

		if (cmd_result && b[3] > 0) {
			/* Ensure we don't overflow the caller's buffer */
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
	}
	// ...
```

**3. Update all callers:**
You will need to update all callers of `ttusb_dec_send_command()` in `ttusb_dec.c` and `state->config->send_command()` in `ttusbdecfe.c` to pass the correct buffer size. 
For example:
- In `ttusb_dec_get_stb_state()`: pass `sizeof(c)` instead of just `c`.
- In `ttusbdecfe_dvbt_read_status()`: pass `sizeof(result)` instead of just `result`.
- For calls where `cmd_result` is `NULL`, simply pass `0` as the length.


The patch that fixes the bug is:

diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..b54b7b4bb 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
@@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
@@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
@@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
@@ -902,7 +922,7 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 			break;
 		case TTUSB_DEC_INTERFACE_IN:
 			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+							b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
@@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
@@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
@@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
@@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
@@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
@@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
@@ -1621,10 +1641,13 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params,
+				      result_length, cmd_result,
+				      cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..b013d6dfc 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					  sizeof(result));
 	if(ret)
 		return ret;
 
@@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -14,7 +14,8 @@ struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);


Search for the commit(s) that introduced this bug.

236/2 2026/08/17 21:58 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13280
							output: 57
							thoughts: 232
						

Thoughts:
**Pinpointing the Bug's Genesis**

Okay, so we've got a patch that fixes an out-of-bounds read/write in `ttusb_dec_send_command` within the `ttusb_dec.c` driver. The issue, as I understand it, stems from a vulnerability. We're using `b[3]` as the length for a `memcpy`, which is a classic recipe for disaster, and it's not being properly checked against either the allocated buffer size or the intended destination size. The provided patch adds `cmd_result_len` and properly bounds-checks the incoming value in multiple cases, addressing `b[3] > COMMAND_PACKET_SIZE`, `b[3] > actual_len - 4`, and `b[3] > cmd_result_len`.

My next step is clear: I need to pinpoint the exact commit that introduced this flaw. My approach? A good old `git log` dive. I'll trace the history of `ttusb_dec_send_command` in `drivers/media/usb/ttusb-dec/ttusb_dec.c`, zeroing in on either when the function itself was first added or, more likely, when the vulnerable `memcpy` logic was introduced. This will allow me to narrow down the possible commits that are responsible for the bug. From there, I can begin my deep dive of the likely culprits.



237/2 2026/08/17 21:58 tool git-log
0m Args:
map[CodeRegexp:memcpy\(cmd_result, &b\[4\], b\[3\]\) PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:786baecfe78f [media] dvb-usb: move it to drivers/media/usb/dvb-usb
]

238/2 2026/08/17 21:59 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13914
							output: 47
							thoughts: 54
						

Thoughts:
**Investigating Potential File Relocation**

Okay, hold on a minute. My initial instinct is telling me that `drivers/media/usb/ttusb-dec/ttusb_dec.c` may have undergone a move, a refactoring, or some other organizational change within the codebase. The location feels... *off*. To be absolutely sure, and before I start hunting down potentially missing functions, the first thing I need to do is verify the history of `ttusb_dec_send_command`. I'll use `git log` with the symbol name search parameter to trace its lineage. This will definitively tell me if the relevant file was moved, renamed, or if it has been touched recently, and might point me to its new home or any related changesets that are relevant to this function. This is a crucial first step before wasting time chasing phantoms. I'm going to get this clarified ASAP.



239/2 2026/08/17 21:59 tool git-log
0m Args:
map[SourcePath:drivers/media/usb/ttusb-dec/ttusb_dec.c SymbolName:ttusb_dec_send_command]

Results:
map[Output:36b9d695aa6f media: ttusb-dec: avoid release of non-acquired mutex
dba328bab4c6 media: ttusb-dec: cleanup an error handling logic
a10feaf8c464 media: ttusb-dec: Fix info-leak in ttusb_dec_send_command()
61fc87498bc6 [media] ttusb_dec: use KERNEL_CONT where needed
e9815ceea973 V4L/DVB (7517): media/dvb/ttusb-dec replace remaining __FUNCTION__ occurrences
3593cab5d62c V4L/DVB (3318b): sem2mutex: drivers/media/, #2
1da177e4c3f4 Linux-2.6.12-rc2
]

240/2 2026/08/17 21:59 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14419
							output: 45
							thoughts: 43
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in the weeds of debugging and familiar with the Linux kernel:

**Root Cause Analysis Begins: Backtracking to 2.6.12-rc2**

Alright, so we've got a bug to hunt down. My immediate instinct is to start rewinding the clock, seeing where this thing *first* reared its ugly head. The commit ID `1da177e4c3f4` is jumping out at me as a likely starting point – that's the Linux-2.6.12-rc2 tag, if my memory serves. Given the age, I'm betting that the bug might have been there from the start. Let's fire up the git log and get a diff, and check, because if it was introduced later it would save some time.



241/2 2026/08/17 21:59 tool git-show
0m Args:
map[Commit:1da177e4c3f4:drivers/media/dvb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:
Full output is too long, showing 1000 out of 1744 lines.

[/*
  * TTUSB DEC Driver
  *
  * Copyright (C) 2003-2004 Alex Woods <linux-dvb@giblets.org>
  * IR support by Peter Beutner <p.beutner@gmx.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
 
 #include <asm/semaphore.h>
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/usb.h>
 #include <linux/version.h>
 #include <linux/interrupt.h>
 #include <linux/firmware.h>
 #include <linux/crc32.h>
 #include <linux/init.h>
 #include <linux/input.h>
 
 #include "dmxdev.h"
 #include "dvb_demux.h"
 #include "dvb_filter.h"
 #include "dvb_frontend.h"
 #include "dvb_net.h"
 #include "ttusbdecfe.h"
 
 static int debug;
 static int output_pva;
 static int enable_rc;
 
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
 module_param(output_pva, int, 0444);
 MODULE_PARM_DESC(output_pva, "Output PVA from dvr device (default:off)");
 module_param(enable_rc, int, 0644);
 MODULE_PARM_DESC(enable_rc, "Turn on/off IR remote control(default: off)");
 
 #define dprintk	if (debug) printk
 
 #define DRIVER_NAME		"TechnoTrend/Hauppauge DEC USB"
 
 #define COMMAND_PIPE		0x03
 #define RESULT_PIPE		0x04
 #define IN_PIPE			0x08
 #define OUT_PIPE		0x07
 #define IRQ_PIPE		0x0A
 
 #define COMMAND_PACKET_SIZE	0x3c
 #define ARM_PACKET_SIZE		0x1000
 #define IRQ_PACKET_SIZE		0x8
 
 #define ISO_BUF_COUNT		0x04
 #define FRAMES_PER_ISO_BUF	0x04
 #define ISO_FRAME_SIZE		0x0380
 
 #define	MAX_PVA_LENGTH		6144
 
 enum ttusb_dec_model {
 	TTUSB_DEC2000T,
 	TTUSB_DEC2540T,
 	TTUSB_DEC3000S
 };
 
 enum ttusb_dec_packet_type {
 	TTUSB_DEC_PACKET_PVA,
 	TTUSB_DEC_PACKET_SECTION,
 	TTUSB_DEC_PACKET_EMPTY
 };
 
 enum ttusb_dec_interface {
 	TTUSB_DEC_INTERFACE_INITIAL,
 	TTUSB_DEC_INTERFACE_IN,
 	TTUSB_DEC_INTERFACE_OUT
 };
 
 struct ttusb_dec {
 	enum ttusb_dec_model		model;
 	char				*model_name;
 	char				*firmware_name;
 	int				can_playback;
 
 	/* DVB bits */
 	struct dvb_adapter		*adapter;
 	struct dmxdev			dmxdev;
 	struct dvb_demux		demux;
 	struct dmx_frontend		frontend;
 	struct dvb_net			dvb_net;
 	struct dvb_frontend*		fe;
 
 	u16			pid[DMX_PES_OTHER];
 
 	/* USB bits */
 	struct usb_device		*udev;
 	u8				trans_count;
 	unsigned int			command_pipe;
 	unsigned int			result_pipe;
 	unsigned int			in_pipe;
 	unsigned int			out_pipe;
 	unsigned int			irq_pipe;
 	enum ttusb_dec_interface	interface;
 	struct semaphore		usb_sem;
 
 	void			*irq_buffer;
 	struct urb		*irq_urb;
 	dma_addr_t		irq_dma_handle;
 	void			*iso_buffer;
 	dma_addr_t		iso_dma_handle;
 	struct urb		*iso_urb[ISO_BUF_COUNT];
 	int			iso_stream_count;
 	struct semaphore	iso_sem;
 
 	u8				packet[MAX_PVA_LENGTH + 4];
 	enum ttusb_dec_packet_type	packet_type;
 	int				packet_state;
 	int				packet_length;
 	int				packet_payload_length;
 	u16				next_packet_id;
 
 	int				pva_stream_count;
 	int				filter_stream_count;
 
 	struct dvb_filter_pes2ts	a_pes2ts;
 	struct dvb_filter_pes2ts	v_pes2ts;
 
 	u8			v_pes[16 + MAX_PVA_LENGTH];
 	int			v_pes_length;
 	int			v_pes_postbytes;
 
 	struct list_head	urb_frame_list;
 	struct tasklet_struct	urb_tasklet;
 	spinlock_t		urb_frame_list_lock;
 
 	struct dvb_demux_filter	*audio_filter;
 	struct dvb_demux_filter	*video_filter;
 	struct list_head	filter_info_list;
 	spinlock_t		filter_info_list_lock;
 
 	struct input_dev	rc_input_dev;
 
 	int			active; /* Loaded successfully */
 };
 
 struct urb_frame {
 	u8			data[ISO_FRAME_SIZE];
 	int			length;
 	struct list_head	urb_frame_list;
 };
 
 struct filter_info {
 	u8			stream_id;
 	struct dvb_demux_filter	*filter;
 	struct list_head	filter_info_list;
 };
 
 static u16 rc_keys[] = {
 	KEY_POWER,
 	KEY_MUTE,
 	KEY_1,
 	KEY_2,
 	KEY_3,
 	KEY_4,
 	KEY_5,
 	KEY_6,
 	KEY_7,
 	KEY_8,
 	KEY_9,
 	KEY_0,
 	KEY_CHANNELUP,
 	KEY_VOLUMEDOWN,
 	KEY_OK,
 	KEY_VOLUMEUP,
 	KEY_CHANNELDOWN,
 	KEY_PREVIOUS,
 	KEY_ESC,
 	KEY_RED,
 	KEY_GREEN,
 	KEY_YELLOW,
 	KEY_BLUE,
 	KEY_OPTION,
 	KEY_M,
 	KEY_RADIO
 };
 
 static void ttusb_dec_set_model(struct ttusb_dec *dec,
 				enum ttusb_dec_model model);
 
 static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs)
 {
 	struct ttusb_dec * dec = urb->context;
 	char *buffer = dec->irq_buffer;
 	int retval;
 
 	switch(urb->status) {
 		case 0: /*success*/
 			break;
 		case -ECONNRESET:
 		case -ENOENT:
 		case -ESHUTDOWN:
 		case -ETIMEDOUT:
 			/* this urb is dead, cleanup */
 			dprintk("%s:urb shutting down with status: %d\n",
 					__FUNCTION__, urb->status);
 			return;
 		default:
 			dprintk("%s:nonzero status received: %d\n",
 					__FUNCTION__,urb->status);
 			goto exit;
 	}
 
 	if( (buffer[0] == 0x1) && (buffer[2] == 0x15) )  {
 		/* IR - Event */
 		/* this is an fact a bit too simple implementation;
 		 * the box also reports a keyrepeat signal
 		 * (with buffer[3] == 0x40) in an intervall of ~100ms.
 		 * But to handle this correctly we had to imlemenent some
 		 * kind of timer which signals a 'key up' event if no
 		 * keyrepeat signal is recieved for lets say 200ms.
 		 * this should/could be added later ...
 		 * for now lets report each signal as a key down and up*/
 		dprintk("%s:rc signal:%d\n", __FUNCTION__, buffer[4]);
 		input_report_key(&dec->rc_input_dev,rc_keys[buffer[4]-1],1);
 		input_report_key(&dec->rc_input_dev,rc_keys[buffer[4]-1],0);
 		input_sync(&dec->rc_input_dev);
 	}
 
 exit:	retval = usb_submit_urb(urb, GFP_ATOMIC);
 	if(retval)
 		printk("%s - usb_commit_urb failed with result: %d\n",
 			__FUNCTION__, retval);
 }
 
 static u16 crc16(u16 crc, const u8 *buf, size_t len)
 {
 	u16 tmp;
 
 	while (len--) {
 		crc ^= *buf++;
 		crc ^= (u8)crc >> 4;
 		tmp = (u8)crc;
 		crc ^= (tmp ^ (tmp << 1)) << 4;
 	}
 	return crc;
 }
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
 				  int *result_length, u8 cmd_result[])
 {
 	int result, actual_len, i;
 	u8 *b;
 
 	dprintk("%s\n", __FUNCTION__);
 
 	b = kmalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
 
 	if ((result = down_interruptible(&dec->usb_sem))) {
 		kfree(b);
 		printk("%s: Failed to down usb semaphore.\n", __FUNCTION__);
 		return result;
 	}
 
 	b[0] = 0xaa;
 	b[1] = ++dec->trans_count;
 	b[2] = command;
 	b[3] = param_length;
 
 	if (params)
 		memcpy(&b[4], params, param_length);
 
 	if (debug) {
 		printk("%s: command: ", __FUNCTION__);
 		for (i = 0; i < param_length + 4; i++)
 			printk("0x%02X ", b[i]);
 		printk("\n");
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: command bulk message failed: error %d\n",
 		       __FUNCTION__, result);
 		up(&dec->usb_sem);
 		kfree(b);
 		return result;
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
 			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);
 
 	if (result) {
 		printk("%s: result bulk message failed: error %d\n",
 		       __FUNCTION__, result);
 		up(&dec->usb_sem);
 		kfree(b);
 		return result;
 	} else {
 		if (debug) {
 			printk("%s: result: ", __FUNCTION__);
 			for (i = 0; i < actual_len; i++)
 				printk("0x%02X ", b[i]);
 			printk("\n");
 		}
 
 		if (result_length)
 			*result_length = b[3];
 		if (cmd_result && b[3] > 0)
 			memcpy(cmd_result, &b[4], b[3]);
 
 		up(&dec->usb_sem);
 
 		kfree(b);
 		return 0;
 	}
 }
 
 static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 				    unsigned int *model, unsigned int *version)
 {
 	u8 c[COMMAND_PACKET_SIZE];
 	int c_length;
 	int result;
 	unsigned int tmp;
 
 	dprintk("%s\n", __FUNCTION__);
 
 	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
 	if (result)
 		return result;
 
 	if (c_length >= 0x0c) {
 		if (mode != NULL) {
 			memcpy(&tmp, c, 4);
 			*mode = ntohl(tmp);
 		}
 		if (model != NULL) {
 			memcpy(&tmp, &c[4], 4);
 			*model = ntohl(tmp);
 		}
 		if (version != NULL) {
 			memcpy(&tmp, &c[8], 4);
 			*version = ntohl(tmp);
 		}
 		return 0;
 	} else {
 		return -1;
 	}
 }
 
 static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data)
 {
 	struct ttusb_dec *dec = (struct ttusb_dec *)priv;
 
 	dec->audio_filter->feed->cb.ts(data, 188, NULL, 0,
 				       &dec->audio_filter->feed->feed.ts,
 				       DMX_OK);
 
 	return 0;
 }
 
 static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
 {
 	struct ttusb_dec *dec = (struct ttusb_dec *)priv;
 
 	dec->video_filter->feed->cb.ts(data, 188, NULL, 0,
 				       &dec->video_filter->feed->feed.ts,
 				       DMX_OK);
 
 	return 0;
 }
 
 static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 {
 	u8 b[] = { 0x00, 0x00, 0x00, 0x00,
 		   0x00, 0x00, 0xff, 0xff,
 		   0xff, 0xff, 0xff, 0xff };
 
 	u16 pcr = htons(dec->pid[DMX_PES_PCR]);
 	u16 audio = htons(dec->pid[DMX_PES_AUDIO]);
 	u16 video = htons(dec->pid[DMX_PES_VIDEO]);
 
 	dprintk("%s\n", __FUNCTION__);
 
 	memcpy(&b[0], &pcr, 2);
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
 	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
 	dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO],
 			       ttusb_dec_video_pes2ts_cb, dec);
 	dec->v_pes_length = 0;
 	dec->v_pes_postbytes = 0;
 }
 
 static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
 {
 	if (length < 8) {
 		printk("%s: packet too short - discarding\n", __FUNCTION__);
 		return;
 	}
 
 	if (length > 8 + MAX_PVA_LENGTH) {
 		printk("%s: packet too long - discarding\n", __FUNCTION__);
 		return;
 	}
 
 	switch (pva[2]) {
 
 	case 0x01: {		/* VideoStream */
 		int prebytes = pva[5] & 0x03;
 		int postbytes = (pva[5] & 0x0c) >> 2;
 		u16 v_pes_payload_length;
 
 		if (output_pva) {
 			dec->video_filter->feed->cb.ts(pva, length, NULL, 0,
 				&dec->video_filter->feed->feed.ts, DMX_OK);
 			return;
 		}
 
 		if (dec->v_pes_postbytes > 0 &&
 		    dec->v_pes_postbytes == prebytes) {
 			memcpy(&dec->v_pes[dec->v_pes_length],
 			       &pva[12], prebytes);
 
 			dvb_filter_pes2ts(&dec->v_pes2ts, dec->v_pes,
 					  dec->v_pes_length + prebytes, 1);
 		}
 
 		if (pva[5] & 0x10) {
 			dec->v_pes[7] = 0x80;
 			dec->v_pes[8] = 0x05;
 
 			dec->v_pes[9] = 0x21 | ((pva[8] & 0xc0) >> 5);
 			dec->v_pes[10] = ((pva[8] & 0x3f) << 2) |
 					 ((pva[9] & 0xc0) >> 6);
 			dec->v_pes[11] = 0x01 |
 					 ((pva[9] & 0x3f) << 2) |
 					 ((pva[10] & 0x80) >> 6);
 			dec->v_pes[12] = ((pva[10] & 0x7f) << 1) |
 					 ((pva[11] & 0xc0) >> 7);
 			dec->v_pes[13] = 0x01 | ((pva[11] & 0x7f) << 1);
 
 			memcpy(&dec->v_pes[14], &pva[12 + prebytes],
 			       length - 12 - prebytes);
 			dec->v_pes_length = 14 + length - 12 - prebytes;
 		} else {
 			dec->v_pes[7] = 0x00;
 			dec->v_pes[8] = 0x00;
 
 			memcpy(&dec->v_pes[9], &pva[8], length - 8);
 			dec->v_pes_length = 9 + length - 8;
 		}
 
 		dec->v_pes_postbytes = postbytes;
 
 		if (dec->v_pes[9 + dec->v_pes[8]] == 0x00 &&
 		    dec->v_pes[10 + dec->v_pes[8]] == 0x00 &&
 		    dec->v_pes[11 + dec->v_pes[8]] == 0x01)
 			dec->v_pes[6] = 0x84;
 		else
 			dec->v_pes[6] = 0x80;
 
 		v_pes_payload_length = htons(dec->v_pes_length - 6 +
 					     postbytes);
 		memcpy(&dec->v_pes[4], &v_pes_payload_length, 2);
 
 		if (postbytes == 0)
 			dvb_filter_pes2ts(&dec->v_pes2ts, dec->v_pes,
 					  dec->v_pes_length, 1);
 
 		break;
 	}
 
 	case 0x02:		/* MainAudioStream */
 		if (output_pva) {
 			dec->audio_filter->feed->cb.ts(pva, length, NULL, 0,
 				&dec->audio_filter->feed->feed.ts, DMX_OK);
 			return;
 		}
 
 		dvb_filter_pes2ts(&dec->a_pes2ts, &pva[8], length - 8,
 				  pva[5] & 0x10);
 		break;
 
 	default:
 		printk("%s: unknown PVA type: %02x.\n", __FUNCTION__,
 		       pva[2]);
 		break;
 	}
 }
 
 static void ttusb_dec_process_filter(struct ttusb_dec *dec, u8 *packet,
 				     int length)
 {
 	struct list_head *item;
 	struct filter_info *finfo;
 	struct dvb_demux_filter *filter = NULL;
 	unsigned long flags;
 	u8 sid;
 
 	sid = packet[1];
 	spin_lock_irqsave(&dec->filter_info_list_lock, flags);
 	for (item = dec->filter_info_list.next; item != &dec->filter_info_list;
 	     item = item->next) {
 		finfo = list_entry(item, struct filter_info, filter_info_list);
 		if (finfo->stream_id == sid) {
 			filter = finfo->filter;
 			break;
 		}
 	}
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 
 	if (filter)
 		filter->feed->cb.sec(&packet[2], length - 2, NULL, 0,
 				     &filter->filter, DMX_OK);
 }
 
 static void ttusb_dec_process_packet(struct ttusb_dec *dec)
 {
 	int i;
 	u16 csum = 0;
 	u16 packet_id;
 
 	if (dec->packet_length % 2) {
 		printk("%s: odd sized packet - discarding\n", __FUNCTION__);
 		return;
 	}
 
 	for (i = 0; i < dec->packet_length; i += 2)
 		csum ^= ((dec->packet[i] << 8) + dec->packet[i + 1]);
 
 	if (csum) {
 		printk("%s: checksum failed - discarding\n", __FUNCTION__);
 		return;
 	}
 
 	packet_id = dec->packet[dec->packet_length - 4] << 8;
 	packet_id += dec->packet[dec->packet_length - 3];
 
 	if ((packet_id != dec->next_packet_id) && dec->next_packet_id) {
 		printk("%s: warning: lost packets between %u and %u\n",
 		       __FUNCTION__, dec->next_packet_id - 1, packet_id);
 	}
 
 	if (packet_id == 0xffff)
 		dec->next_packet_id = 0x8000;
 	else
 		dec->next_packet_id = packet_id + 1;
 
 	switch (dec->packet_type) {
 	case TTUSB_DEC_PACKET_PVA:
 		if (dec->pva_stream_count)
 			ttusb_dec_process_pva(dec, dec->packet,
 					      dec->packet_payload_length);
 		break;
 
 	case TTUSB_DEC_PACKET_SECTION:
 		if (dec->filter_stream_count)
 			ttusb_dec_process_filter(dec, dec->packet,
 						 dec->packet_payload_length);
 		break;
 
 	case TTUSB_DEC_PACKET_EMPTY:
 		break;
 	}
 }
 
 static void swap_bytes(u8 *b, int length)
 {
 	u8 c;
 
 	length -= length % 2;
 	for (; length; b += 2, length -= 2) {
 		c = *b;
 		*b = *(b + 1);
 		*(b + 1) = c;
 	}
 }
 
 static void ttusb_dec_process_urb_frame(struct ttusb_dec *dec, u8 *b,
 					int length)
 {
 	swap_bytes(b, length);
 
 	while (length) {
 		switch (dec->packet_state) {
 
 		case 0:
 		case 1:
 		case 2:
 			if (*b++ == 0xaa)
 				dec->packet_state++;
 			else
 				dec->packet_state = 0;
 
 			length--;
 			break;
 
 		case 3:
 			if (*b == 0x00) {
 				dec->packet_state++;
 				dec->packet_length = 0;
 			} else if (*b != 0xaa) {
 				dec->packet_state = 0;
 			}
 
 			b++;
 			length--;
 			break;
 
 		case 4:
 			dec->packet[dec->packet_length++] = *b++;
 
 			if (dec->packet_length == 2) {
 				if (dec->packet[0] == 'A' &&
 				    dec->packet[1] == 'V') {
 					dec->packet_type =
 						TTUSB_DEC_PACKET_PVA;
 					dec->packet_state++;
 				} else if (dec->packet[0] == 'S') {
 					dec->packet_type =
 						TTUSB_DEC_PACKET_SECTION;
 					dec->packet_state++;
 				} else if (dec->packet[0] == 0x00) {
 					dec->packet_type =
 						TTUSB_DEC_PACKET_EMPTY;
 					dec->packet_payload_length = 2;
 					dec->packet_state = 7;
 				} else {
 					printk("%s: unknown packet type: "
 					       "%02x%02x\n", __FUNCTION__,
 					       dec->packet[0], dec->packet[1]);
 					dec->packet_state = 0;
 				}
 			}
 
 			length--;
 			break;
 
 		case 5:
 			dec->packet[dec->packet_length++] = *b++;
 
 			if (dec->packet_type == TTUSB_DEC_PACKET_PVA &&
 			    dec->packet_length == 8) {
 				dec->packet_state++;
 				dec->packet_payload_length = 8 +
 					(dec->packet[6] << 8) +
 					dec->packet[7];
 			} else if (dec->packet_type ==
 					TTUSB_DEC_PACKET_SECTION &&
 				   dec->packet_length == 5) {
 				dec->packet_state++;
 				dec->packet_payload_length = 5 +
 					((dec->packet[3] & 0x0f) << 8) +
 					dec->packet[4];
 			}
 
 			length--;
 			break;
 
 		case 6: {
 			int remainder = dec->packet_payload_length -
 					dec->packet_length;
 
 			if (length >= remainder) {
 				memcpy(dec->packet + dec->packet_length,
 				       b, remainder);
 				dec->packet_length += remainder;
 				b += remainder;
 				length -= remainder;
 				dec->packet_state++;
 			} else {
 				memcpy(&dec->packet[dec->packet_length],
 				       b, length);
 				dec->packet_length += length;
 				length = 0;
 			}
 
 			break;
 		}
 
 		case 7: {
 			int tail = 4;
 
 			dec->packet[dec->packet_length++] = *b++;
 
 			if (dec->packet_type == TTUSB_DEC_PACKET_SECTION &&
 			    dec->packet_payload_length % 2)
 				tail++;
 
 			if (dec->packet_length ==
 			    dec->packet_payload_length + tail) {
 				ttusb_dec_process_packet(dec);
 				dec->packet_state = 0;
 			}
 
 			length--;
 			break;
 		}
 
 		default:
 			printk("%s: illegal packet state encountered.\n",
 			       __FUNCTION__);
 			dec->packet_state = 0;
 		}
 	}
 }
 
 static void ttusb_dec_process_urb_frame_list(unsigned long data)
 {
 	struct ttusb_dec *dec = (struct ttusb_dec *)data;
 	struct list_head *item;
 	struct urb_frame *frame;
 	unsigned long flags;
 
 	while (1) {
 		spin_lock_irqsave(&dec->urb_frame_list_lock, flags);
 		if ((item = dec->urb_frame_list.next) != &dec->urb_frame_list) {
 			frame = list_entry(item, struct urb_frame,
 					   urb_frame_list);
 			list_del(&frame->urb_frame_list);
 		} else {
 			spin_unlock_irqrestore(&dec->urb_frame_list_lock,
 					       flags);
 			return;
 		}
 		spin_unlock_irqrestore(&dec->urb_frame_list_lock, flags);
 
 		ttusb_dec_process_urb_frame(dec, frame->data, frame->length);
 		kfree(frame);
 	}
 }
 
 static void ttusb_dec_process_urb(struct urb *urb, struct pt_regs *ptregs)
 {
 	struct ttusb_dec *dec = urb->context;
 
 	if (!urb->status) {
 		int i;
 
 		for (i = 0; i < FRAMES_PER_ISO_BUF; i++) {
 			struct usb_iso_packet_descriptor *d;
 			u8 *b;
 			int length;
 			struct urb_frame *frame;
 
 			d = &urb->iso_frame_desc[i];
 			b = urb->transfer_buffer + d->offset;
 			length = d->actual_length;
 
 			if ((frame = kmalloc(sizeof(struct urb_frame),
 					     GFP_ATOMIC))) {
 				unsigned long flags;
 
 				memcpy(frame->data, b, length);
 				frame->length = length;
 
 				spin_lock_irqsave(&dec->urb_frame_list_lock,
 						     flags);
 				list_add_tail(&frame->urb_frame_list,
 					      &dec->urb_frame_list);
 				spin_unlock_irqrestore(&dec->urb_frame_list_lock,
 						       flags);
 
 				tasklet_schedule(&dec->urb_tasklet);
 			}
 		}
 	} else {
 		 /* -ENOENT is expected when unlinking urbs */
 		if (urb->status != -ENOENT)
 			dprintk("%s: urb error: %d\n", __FUNCTION__,
 				urb->status);
 	}
 
 	if (dec->iso_stream_count)
 		usb_submit_urb(urb, GFP_ATOMIC);
 }
 
 static void ttusb_dec_setup_urbs(struct ttusb_dec *dec)
 {
 	int i, j, buffer_offset = 0;
 
 	dprintk("%s\n", __FUNCTION__);
 
 	for (i = 0; i < ISO_BUF_COUNT; i++) {
 		int frame_offset = 0;
 		struct urb *urb = dec->iso_urb[i];
 
 		urb->dev = dec->udev;
 		urb->context = dec;
 		urb->complete = ttusb_dec_process_urb;
 		urb->pipe = dec->in_pipe;
 		urb->transfer_flags = URB_ISO_ASAP;
 		urb->interval = 1;
 		urb->number_of_packets = FRAMES_PER_ISO_BUF;
 		urb->transfer_buffer_length = ISO_FRAME_SIZE *
 					      FRAMES_PER_ISO_BUF;
 		urb->transfer_buffer = dec->iso_buffer + buffer_offset;
 		buffer_offset += ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF;
 
 		for (j = 0; j < FRAMES_PER_ISO_BUF; j++) {
 			urb->iso_frame_desc[j].offset = frame_offset;
 			urb->iso_frame_desc[j].length = ISO_FRAME_SIZE;
 			frame_offset += ISO_FRAME_SIZE;
 		}
 	}
 }
 
 static void ttusb_dec_stop_iso_xfer(struct ttusb_dec *dec)
 {
 	int i;
 
 	dprintk("%s\n", __FUNCTION__);
 
 	if (down_interruptible(&dec->iso_sem))
 		return;
 
 	dec->iso_stream_count--;
 
 	if (!dec->iso_stream_count) {
 		for (i = 0; i < ISO_BUF_COUNT; i++)
 			usb_kill_urb(dec->iso_urb[i]);
 	}
 
 	up(&dec->iso_sem);
 }
 
 /* Setting the interface of the DEC tends to take down the USB communications
  * for a short period, so it's important not to call this function just before
  * trying to talk to it.
  */
 static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 				   enum ttusb_dec_interface interface)
 {
 	int result = 0;
 	u8 b[] = { 0x05 };
 
 	if (interface != dec->interface) {
 		switch (interface) {
 		case TTUSB_DEC_INTERFACE_INITIAL:
 			result = usb_set_interface(dec->udev, 0, 0);
 			break;
 		case TTUSB_DEC_INTERFACE_IN:
 			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
 							b, NULL, NULL);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
 			break;
 		case TTUSB_DEC_INTERFACE_OUT:
 			result = usb_set_interface(dec->udev, 0, 1);
 			break;
 		}
 
 		if (result)
 			return result;
 
 		dec->interface = interface;
 	}
 
 	return 0;
 }
 
 static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
 {
 	int i, result;
 
 	dprintk("%s\n", __FUNCTION__);
 
 	if (down_interruptible(&dec->iso_sem))
 		return -EAGAIN;
 
 	if (!dec->iso_stream_count) {
 		ttusb_dec_setup_urbs(dec);
 
 		dec->packet_state = 0;
 		dec->v_pes_postbytes = 0;
 		dec->next_packet_id = 0;
 
 		for (i = 0; i < ISO_BUF_COUNT; i++) {
 			if ((result = usb_submit_urb(dec->iso_urb[i],
 						     GFP_ATOMIC))) {
 				printk("%s: failed urb submission %d: "
 				       "error %d\n", __FUNCTION__, i, result);
 
 				while (i) {
 					usb_kill_urb(dec->iso_urb[i - 1]);
 					i--;
 				}
 
 				up(&dec->iso_sem);
 				return result;
 			}
 		}
 	}
 
 	dec->iso_stream_count++;
 
 	up(&dec->iso_sem);
 
 	return 0;
 }
 
 static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
 	struct ttusb_dec *dec = dvbdmx->priv;
 	u8 b0[] = { 0x05 };
 	int result = 0;
 
 	dprintk("%s\n", __FUNCTION__);
 
 	dprintk("  ts_type:");
 
 	if (dvbdmxfeed->ts_type & TS_DECODER)
 		dprintk(" TS_DECODER");
 
 	if (dvbdmxfeed->ts_type & TS_PACKET)
 		dprintk(" TS_PACKET");
 
 	if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
 		dprintk(" TS_PAYLOAD_ONLY");
 
 	dprintk("\n");
 
 	switch (dvbdmxfeed->pes_type) {
 
 	case DMX_TS_PES_VIDEO:
 		dprintk("  pes_type: DMX_TS_PES_VIDEO\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		dec->pid[DMX_PES_VIDEO] = dvbdmxfeed->pid;
 		dec->video_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_TS_PES_AUDIO:
 		dprintk("  pes_type: DMX_TS_PES_AUDIO\n");
 		dec->pid[DMX_PES_AUDIO] = dvbdmxfeed->pid;
 		dec->audio_filter = dvbdmxfeed->filter;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_TS_PES_TELETEXT:
 		dec->pid[DMX_PES_TELETEXT] = dvbdmxfeed->pid;
 		dprintk("  pes_type: DMX_TS_PES_TELETEXT\n");
 		break;
 
 	case DMX_TS_PES_PCR:
 		dprintk("  pes_type: DMX_TS_PES_PCR\n");
 		dec->pid[DMX_PES_PCR] = dvbdmxfeed->pid;
 		ttusb_dec_set_pids(dec);
 		break;
 
 	case DMX_TS_PES_OTHER:
 		dprintk("  pes_type: DMX_TS_PES_OTHER\n");
 		break;
 
 	default:
 		dprintk("  pes_type: unknown (%d)\n", dvbdmxfeed->pes_type);
 		return -EINVAL;
 
 	}
 
 	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
 	if (result)
 		return result;
 
 	dec->pva_stream_count++;
 	return ttusb_dec_start_iso_xfer(dec);
 }
 
 static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 {
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00, 0x00, 0x00, 0x01,
 		    0x00, 0x00, 0x00, 0x00,
 		    0x00, 0x00, 0x00, 0x00,
]
]

242/2 2026/08/17 21:59 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25238
							output: 52
							thoughts: 923
						

Thoughts:
**Bug Analysis: ttusb_dec_send_command - Initial Commit Vulnerability**

Okay, so I'm digging into this `ttusb_dec_send_command` function, and it looks like it's been around since the very beginning – the initial Linux kernel commit, `1da177e4c3f4`.  My initial thought was to see if the buggy `memcpy` had been introduced later, perhaps as part of a refactoring, but no such luck. It's right there, in the original implementation.  I confirmed this with a quick check: the `memcpy(cmd_result, &b[4], b[3]);` is indeed present from the very start.

Now, let's nail down *why* this is a problem. The crash report specifically mentions a `memcpy` buffer overflow: "75 byte read of buffer size 60". Aha! So, `b[3]` is being used as the length for the `memcpy` without any bounds checking. This is the root cause. This is a classic vulnerability, easily spotted.

`b` is allocated with a size of `COMMAND_PACKET_SIZE + 4` (64 bytes). The `crash report` is saying that `memcpy` tries to read 75 bytes, an out-of-bounds read of `b`. The key is that `b[3]` represents the length of the data to be copied. The vulnerability lies in the fact that `b[3]` isn't validated to ensure it's within the allocated buffer size. This allows a malicious value in `b[3]` to cause an out-of-bounds read. In addition, the size of the destination buffer `cmd_result` is not checked either, which can lead to a buffer overflow.

I'm pretty confident that the bug-introducing commit is indeed `1da177e4c3f412243cecb1a8220a65ce01ed66d0`. It's that initial commit, and the flawed `memcpy` has been there since day one.

So, I'll return `1da177e4c3f412243cecb1a8220a65ce01ed66d0` as the culprit. I am, however, keeping an eye out for any further related commits, just in case.



243/2 2026/08/17 21:59 tool set-results
0m Error:
log-in to see details

Args:
map[FixesHash:1da177e4c3f412243cecb1a8220a65ce01ed66d0]

Results:
map[FixesHash:1da177e4c3f412243cecb1a8220a65ce01ed66d0]

244/2 2026/08/17 21:59 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26789
							output: 37
							thoughts: 55
						

Thoughts:
**Investigating a Missing Commit**

Okay, hold on a second. Something's not right. The system is telling me that `1da177e4c3f412243cecb1a8220a65ce01ed66d0` can't be found. That's strange, that commit should definitely exist. It's a fundamental reference point. I'm going to have to double-check the exact hash of the *very* first commit to make sure I haven't got a typo somewhere in my command or script. There's no way that base is missing, not in a correctly managed repository. Something is awry and I need to identify it.



245/2 2026/08/17 21:59 tool git-log
0m Args:
map[Count:1 PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c]

Results:
map[Output:bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
]

246/2 2026/08/17 21:59 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27076
							output: 39
							thoughts: 68
						

Thoughts:
**Investigating the `ttusb_dec.c` History**

Okay, so I was just looking at the `git-log` output for `drivers/media/usb/ttusb-dec/ttusb_dec.c`, and I saw that commit `bf4afc53b77a` popped up. Now, that's interesting. I need to make sure I understand the full context here. Time to double-check that file's commit history to make sure there are no other unexpected changes. I'll take a closer look and make sure I haven't missed anything significant.



247/2 2026/08/17 21:59 tool git-log
10m Error:
log-in to see details

Args:
map[CodeRegexp:memcpy\(cmd_result, &b\[4\], b\[3\]\) Count:10]

Results:
map[Output:]

248/2 2026/08/17 22:09 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27347
							output: 52
							thoughts: 22
						

Thoughts:
Here's my thought process, summarized as you requested:

**Finding the Origin of `ttusb_dec_send_command`**

Okay, so I need to track down the exact commit where the `ttusb_dec_send_command` function was first introduced. This is a common and necessary task, especially when dealing with legacy codebases. Understanding the provenance of a function, particularly a potentially sensitive one, is crucial for debugging, understanding its intended behavior, and assessing its potential impact on the system. I’ll need to use my expertise in version control, most likely Git, to pinpoint this specific commit. Knowing the commit hash is essential for cross-referencing this information with related documentation, bug reports, and code reviews, providing a solid foundation for analysis. This hash is the breadcrumb trail I need to follow.



249/2 2026/08/17 22:09 tool git-log
0m Error:
log-in to see details

Args:
map[Count:10 PathPrefix:drivers/media/usb/ttusb-dec/ttusb_dec.c SymbolName:ttusb_dec_send_command]

Results:
map[Output:]

250/2 2026/08/17 22:09 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27615
							output: 52
							thoughts: 14
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Leveraging SourcePath with SymbolName for Optimal Results**

Okay, so I'm processing this data, and it's hitting me: the optimal approach here is to couple `SourcePath` with `SymbolName`. It's pretty obvious in retrospect, but it just clicked. I was probably trying to use them separately initially, which, depending on the context, might *sometimes* work. But for *this specific task* I'm working on, the inherent correlation between the two is where the power lies. That combination unlocks a more precise and efficient solution. Using `SourcePath` alone, I'd probably be missing valuable context, or, I'd have to perform more operations to achieve the same result. The same goes for `SymbolName`. It would have required additional work to identify the information or context I need. This combined approach is going to streamline everything significantly. Yeah, that's definitely the route to go.



251/2 2026/08/17 22:09 tool git-log
0m Args:
map[Count:10 SourcePath:drivers/media/usb/ttusb-dec/ttusb_dec.c SymbolName:ttusb_dec_send_command]

Results:
map[Output:36b9d695aa6f media: ttusb-dec: avoid release of non-acquired mutex
dba328bab4c6 media: ttusb-dec: cleanup an error handling logic
a10feaf8c464 media: ttusb-dec: Fix info-leak in ttusb_dec_send_command()
61fc87498bc6 [media] ttusb_dec: use KERNEL_CONT where needed
e9815ceea973 V4L/DVB (7517): media/dvb/ttusb-dec replace remaining __FUNCTION__ occurrences
3593cab5d62c V4L/DVB (3318b): sem2mutex: drivers/media/, #2
1da177e4c3f4 Linux-2.6.12-rc2
]

252/2 2026/08/17 22:09 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28107
							output: 26
							thoughts: 58
						

Thoughts:
Okay, here's my interpretation of that.

**Analyzing the Hash Integrity**

Alright, so the input hash I'm given, `1da177e4c3f4`, is apparently supposed to be a truncated version of the full hash `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2`. The immediate question is, does that truncated form actually *represent* the full hash as intended? I need to verify that the prefix match is valid. While I wouldn't expect a collision on such a short prefix with a decent hashing algorithm, it's always worth confirming, especially when dealing with data integrity. I'll need to double check the generation process for this hash to make sure that the full hash is correctly derived from the source, and that the shorter value is actually a valid abbreviated representation. I'm going to have to dive into the specifics of *how* this hash was generated and what it's intended to represent to ensure there are no issues.



253/2 2026/08/17 22:09 tool git-show
0m Args:
map[Commit:1da177e4c3f4]

Results:
map[Output:
Full output is too long, showing 1000 out of 6822520 lines.

[commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
 Author: Linus Torvalds <torvalds@ppc970.osdl.org>
 Date:   Sat Apr 16 15:20:36 2005 -0700
 
     Linux-2.6.12-rc2
     
     Initial git repository build. I'm not bothering with the full history,
     even though we have it. We can create a separate "historical" git
     archive of that later if we want to, and in the meantime it's about
     3.2GB when imported into git - space that would just make the early
     git days unnecessarily complicated, when we don't have a lot of good
     infrastructure for it.
     
     Let it rip!
 
 diff --git a/COPYING b/COPYING
 new file mode 100644
 index 000000000000..2a7e338ec2fc
 --- /dev/null
 +++ b/COPYING
 @@ -0,0 +1,356 @@
 +
 +   NOTE! This copyright does *not* cover user programs that use kernel
 + services by normal system calls - this is merely considered normal use
 + of the kernel, and does *not* fall under the heading of "derived work".
 + Also note that the GPL below is copyrighted by the Free Software
 + Foundation, but the instance of code that it refers to (the Linux
 + kernel) is copyrighted by me and others who actually wrote it.
 +
 + Also note that the only valid version of the GPL as far as the kernel
 + is concerned is _this_ particular version of the license (ie v2, not
 + v2.2 or v3.x or whatever), unless explicitly otherwise stated.
 +
 +			Linus Torvalds
 +
 +----------------------------------------
 +
 +		    GNU GENERAL PUBLIC LICENSE
 +		       Version 2, June 1991
 +
 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
 +                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 + Everyone is permitted to copy and distribute verbatim copies
 + of this license document, but changing it is not allowed.
 +
 +			    Preamble
 +
 +  The licenses for most software are designed to take away your
 +freedom to share and change it.  By contrast, the GNU General Public
 +License is intended to guarantee your freedom to share and change free
 +software--to make sure the software is free for all its users.  This
 +General Public License applies to most of the Free Software
 +Foundation's software and to any other program whose authors commit to
 +using it.  (Some other Free Software Foundation software is covered by
 +the GNU Library General Public License instead.)  You can apply it to
 +your programs, too.
 +
 +  When we speak of free software, we are referring to freedom, not
 +price.  Our General Public Licenses are designed to make sure that you
 +have the freedom to distribute copies of free software (and charge for
 +this service if you wish), that you receive source code or can get it
 +if you want it, that you can change the software or use pieces of it
 +in new free programs; and that you know you can do these things.
 +
 +  To protect your rights, we need to make restrictions that forbid
 +anyone to deny you these rights or to ask you to surrender the rights.
 +These restrictions translate to certain responsibilities for you if you
 +distribute copies of the software, or if you modify it.
 +
 +  For example, if you distribute copies of such a program, whether
 +gratis or for a fee, you must give the recipients all the rights that
 +you have.  You must make sure that they, too, receive or can get the
 +source code.  And you must show them these terms so they know their
 +rights.
 +
 +  We protect your rights with two steps: (1) copyright the software, and
 +(2) offer you this license which gives you legal permission to copy,
 +distribute and/or modify the software.
 +
 +  Also, for each author's protection and ours, we want to make certain
 +that everyone understands that there is no warranty for this free
 +software.  If the software is modified by someone else and passed on, we
 +want its recipients to know that what they have is not the original, so
 +that any problems introduced by others will not reflect on the original
 +authors' reputations.
 +
 +  Finally, any free program is threatened constantly by software
 +patents.  We wish to avoid the danger that redistributors of a free
 +program will individually obtain patent licenses, in effect making the
 +program proprietary.  To prevent this, we have made it clear that any
 +patent must be licensed for everyone's free use or not licensed at all.
 +
 +  The precise terms and conditions for copying, distribution and
 +modification follow.
 +
 +		    GNU GENERAL PUBLIC LICENSE
 +   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 +
 +  0. This License applies to any program or other work which contains
 +a notice placed by the copyright holder saying it may be distributed
 +under the terms of this General Public License.  The "Program", below,
 +refers to any such program or work, and a "work based on the Program"
 +means either the Program or any derivative work under copyright law:
 +that is to say, a work containing the Program or a portion of it,
 +either verbatim or with modifications and/or translated into another
 +language.  (Hereinafter, translation is included without limitation in
 +the term "modification".)  Each licensee is addressed as "you".
 +
 +Activities other than copying, distribution and modification are not
 +covered by this License; they are outside its scope.  The act of
 +running the Program is not restricted, and the output from the Program
 +is covered only if its contents constitute a work based on the
 +Program (independent of having been made by running the Program).
 +Whether that is true depends on what the Program does.
 +
 +  1. You may copy and distribute verbatim copies of the Program's
 +source code as you receive it, in any medium, provided that you
 +conspicuously and appropriately publish on each copy an appropriate
 +copyright notice and disclaimer of warranty; keep intact all the
 +notices that refer to this License and to the absence of any warranty;
 +and give any other recipients of the Program a copy of this License
 +along with the Program.
 +
 +You may charge a fee for the physical act of transferring a copy, and
 +you may at your option offer warranty protection in exchange for a fee.
 +
 +  2. You may modify your copy or copies of the Program or any portion
 +of it, thus forming a work based on the Program, and copy and
 +distribute such modifications or work under the terms of Section 1
 +above, provided that you also meet all of these conditions:
 +
 +    a) You must cause the modified files to carry prominent notices
 +    stating that you changed the files and the date of any change.
 +
 +    b) You must cause any work that you distribute or publish, that in
 +    whole or in part contains or is derived from the Program or any
 +    part thereof, to be licensed as a whole at no charge to all third
 +    parties under the terms of this License.
 +
 +    c) If the modified program normally reads commands interactively
 +    when run, you must cause it, when started running for such
 +    interactive use in the most ordinary way, to print or display an
 +    announcement including an appropriate copyright notice and a
 +    notice that there is no warranty (or else, saying that you provide
 +    a warranty) and that users may redistribute the program under
 +    these conditions, and telling the user how to view a copy of this
 +    License.  (Exception: if the Program itself is interactive but
 +    does not normally print such an announcement, your work based on
 +    the Program is not required to print an announcement.)
 +
 +These requirements apply to the modified work as a whole.  If
 +identifiable sections of that work are not derived from the Program,
 +and can be reasonably considered independent and separate works in
 +themselves, then this License, and its terms, do not apply to those
 +sections when you distribute them as separate works.  But when you
 +distribute the same sections as part of a whole which is a work based
 +on the Program, the distribution of the whole must be on the terms of
 +this License, whose permissions for other licensees extend to the
 +entire whole, and thus to each and every part regardless of who wrote it.
 +
 +Thus, it is not the intent of this section to claim rights or contest
 +your rights to work written entirely by you; rather, the intent is to
 +exercise the right to control the distribution of derivative or
 +collective works based on the Program.
 +
 +In addition, mere aggregation of another work not based on the Program
 +with the Program (or with a work based on the Program) on a volume of
 +a storage or distribution medium does not bring the other work under
 +the scope of this License.
 +
 +  3. You may copy and distribute the Program (or a work based on it,
 +under Section 2) in object code or executable form under the terms of
 +Sections 1 and 2 above provided that you also do one of the following:
 +
 +    a) Accompany it with the complete corresponding machine-readable
 +    source code, which must be distributed under the terms of Sections
 +    1 and 2 above on a medium customarily used for software interchange; or,
 +
 +    b) Accompany it with a written offer, valid for at least three
 +    years, to give any third party, for a charge no more than your
 +    cost of physically performing source distribution, a complete
 +    machine-readable copy of the corresponding source code, to be
 +    distributed under the terms of Sections 1 and 2 above on a medium
 +    customarily used for software interchange; or,
 +
 +    c) Accompany it with the information you received as to the offer
 +    to distribute corresponding source code.  (This alternative is
 +    allowed only for noncommercial distribution and only if you
 +    received the program in object code or executable form with such
 +    an offer, in accord with Subsection b above.)
 +
 +The source code for a work means the preferred form of the work for
 +making modifications to it.  For an executable work, complete source
 +code means all the source code for all modules it contains, plus any
 +associated interface definition files, plus the scripts used to
 +control compilation and installation of the executable.  However, as a
 +special exception, the source code distributed need not include
 +anything that is normally distributed (in either source or binary
 +form) with the major components (compiler, kernel, and so on) of the
 +operating system on which the executable runs, unless that component
 +itself accompanies the executable.
 +
 +If distribution of executable or object code is made by offering
 +access to copy from a designated place, then offering equivalent
 +access to copy the source code from the same place counts as
 +distribution of the source code, even though third parties are not
 +compelled to copy the source along with the object code.
 +
 +  4. You may not copy, modify, sublicense, or distribute the Program
 +except as expressly provided under this License.  Any attempt
 +otherwise to copy, modify, sublicense or distribute the Program is
 +void, and will automatically terminate your rights under this License.
 +However, parties who have received copies, or rights, from you under
 +this License will not have their licenses terminated so long as such
 +parties remain in full compliance.
 +
 +  5. You are not required to accept this License, since you have not
 +signed it.  However, nothing else grants you permission to modify or
 +distribute the Program or its derivative works.  These actions are
 +prohibited by law if you do not accept this License.  Therefore, by
 +modifying or distributing the Program (or any work based on the
 +Program), you indicate your acceptance of this License to do so, and
 +all its terms and conditions for copying, distributing or modifying
 +the Program or works based on it.
 +
 +  6. Each time you redistribute the Program (or any work based on the
 +Program), the recipient automatically receives a license from the
 +original licensor to copy, distribute or modify the Program subject to
 +these terms and conditions.  You may not impose any further
 +restrictions on the recipients' exercise of the rights granted herein.
 +You are not responsible for enforcing compliance by third parties to
 +this License.
 +
 +  7. If, as a consequence of a court judgment or allegation of patent
 +infringement or for any other reason (not limited to patent issues),
 +conditions are imposed on you (whether by court order, agreement or
 +otherwise) that contradict the conditions of this License, they do not
 +excuse you from the conditions of this License.  If you cannot
 +distribute so as to satisfy simultaneously your obligations under this
 +License and any other pertinent obligations, then as a consequence you
 +may not distribute the Program at all.  For example, if a patent
 +license would not permit royalty-free redistribution of the Program by
 +all those who receive copies directly or indirectly through you, then
 +the only way you could satisfy both it and this License would be to
 +refrain entirely from distribution of the Program.
 +
 +If any portion of this section is held invalid or unenforceable under
 +any particular circumstance, the balance of the section is intended to
 +apply and the section as a whole is intended to apply in other
 +circumstances.
 +
 +It is not the purpose of this section to induce you to infringe any
 +patents or other property right claims or to contest validity of any
 +such claims; this section has the sole purpose of protecting the
 +integrity of the free software distribution system, which is
 +implemented by public license practices.  Many people have made
 +generous contributions to the wide range of software distributed
 +through that system in reliance on consistent application of that
 +system; it is up to the author/donor to decide if he or she is willing
 +to distribute software through any other system and a licensee cannot
 +impose that choice.
 +
 +This section is intended to make thoroughly clear what is believed to
 +be a consequence of the rest of this License.
 +
 +  8. If the distribution and/or use of the Program is restricted in
 +certain countries either by patents or by copyrighted interfaces, the
 +original copyright holder who places the Program under this License
 +may add an explicit geographical distribution limitation excluding
 +those countries, so that distribution is permitted only in or among
 +countries not thus excluded.  In such case, this License incorporates
 +the limitation as if written in the body of this License.
 +
 +  9. The Free Software Foundation may publish revised and/or new versions
 +of the General Public License from time to time.  Such new versions will
 +be similar in spirit to the present version, but may differ in detail to
 +address new problems or concerns.
 +
 +Each version is given a distinguishing version number.  If the Program
 +specifies a version number of this License which applies to it and "any
 +later version", you have the option of following the terms and conditions
 +either of that version or of any later version published by the Free
 +Software Foundation.  If the Program does not specify a version number of
 +this License, you may choose any version ever published by the Free Software
 +Foundation.
 +
 +  10. If you wish to incorporate parts of the Program into other free
 +programs whose distribution conditions are different, write to the author
 +to ask for permission.  For software which is copyrighted by the Free
 +Software Foundation, write to the Free Software Foundation; we sometimes
 +make exceptions for this.  Our decision will be guided by the two goals
 +of preserving the free status of all derivatives of our free software and
 +of promoting the sharing and reuse of software generally.
 +
 +			    NO WARRANTY
 +
 +  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
 +REPAIR OR CORRECTION.
 +
 +  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 +POSSIBILITY OF SUCH DAMAGES.
 +
 +		     END OF TERMS AND CONDITIONS
 +
 +	    How to Apply These Terms to Your New Programs
 +
 +  If you develop a new program, and you want it to be of the greatest
 +possible use to the public, the best way to achieve this is to make it
 +free software which everyone can redistribute and change under these terms.
 +
 +  To do so, attach the following notices to the program.  It is safest
 +to attach them to the start of each source file to most effectively
 +convey the exclusion of warranty; and each file should have at least
 +the "copyright" line and a pointer to where the full notice is found.
 +
 +    <one line to give the program's name and a brief idea of what it does.>
 +    Copyright (C) <year>  <name of author>
 +
 +    This program is free software; you can redistribute it and/or modify
 +    it under the terms of the GNU General Public License as published by
 +    the Free Software Foundation; either version 2 of the License, or
 +    (at your option) any later version.
 +
 +    This program is distributed in the hope that it will be useful,
 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +    GNU General Public License for more details.
 +
 +    You should have received a copy of the GNU General Public License
 +    along with this program; if not, write to the Free Software
 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 +
 +
 +Also add information on how to contact you by electronic and paper mail.
 +
 +If the program is interactive, make it output a short notice like this
 +when it starts in an interactive mode:
 +
 +    Gnomovision version 69, Copyright (C) year name of author
 +    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 +    This is free software, and you are welcome to redistribute it
 +    under certain conditions; type `show c' for details.
 +
 +The hypothetical commands `show w' and `show c' should show the appropriate
 +parts of the General Public License.  Of course, the commands you use may
 +be called something other than `show w' and `show c'; they could even be
 +mouse-clicks or menu items--whatever suits your program.
 +
 +You should also get your employer (if you work as a programmer) or your
 +school, if any, to sign a "copyright disclaimer" for the program, if
 +necessary.  Here is a sample; alter the names:
 +
 +  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
 +  `Gnomovision' (which makes passes at compilers) written by James Hacker.
 +
 +  <signature of Ty Coon>, 1 April 1989
 +  Ty Coon, President of Vice
 +
 +This General Public License does not permit incorporating your program into
 +proprietary programs.  If your program is a subroutine library, you may
 +consider it more useful to permit linking proprietary applications with the
 +library.  If this is what you want to do, use the GNU Library General
 +Public License instead of this License.
 diff --git a/CREDITS b/CREDITS
 new file mode 100644
 index 000000000000..671e9c2d31fe
 --- /dev/null
 +++ b/CREDITS
 @@ -0,0 +1,3743 @@
 +	This is at least a partial credits-file of people that have
 +	contributed to the Linux project.  It is sorted by name and
 +	formatted to allow easy grepping and beautification by
 +	scripts.  The fields are: name (N), email (E), web-address
 +	(W), PGP key ID and fingerprint (P), description (D), and
 +	snail-mail address (S).
 +	Thanks,
 +
 +			Linus
 +----------
 +
 +N: Matti Aarnio
 +E: mea@nic.funet.fi
 +D: Alpha systems hacking, IPv6 and other network related stuff
 +D: One of assisting postmasters for vger.kernel.org's lists
 +S: (ask for current address)
 +S: Finland
 +
 +N: Dragos Acostachioaie
 +E: dragos@iname.com
 +W: http://www.arbornet.org/~dragos
 +D: /proc/sysvipc
 +S: C. Negri 6, bl. D3
 +S: Iasi 6600
 +S: Romania
 +
 +N: Monalisa Agrawal
 +E: magrawal@nortelnetworks.com
 +D: Basic Interphase 5575 driver with UBR and ABR support.
 +S: 75 Donald St, Apt 42
 +S: Weymouth, MA 02188
 +
 +N: Dave Airlie
 +E: airlied@linux.ie
 +W: http://www.csn.ul.ie/~airlied
 +D: NFS over TCP patches
 +D: in-kernel DRM Maintainer
 +S: Longford, Ireland
 +S: Sydney, Australia
 +
 +N: Tigran A. Aivazian
 +E: tigran@veritas.com
 +W: http://www.moses.uklinux.net/patches
 +D: BFS filesystem
 +D: Intel IA32 CPU microcode update support
 +D: Various kernel patches
 +S: United Kingdom
 +
 +N: Werner Almesberger
 +E: werner@almesberger.net
 +W: http://www.almesberger.net/
 +D: dosfs, LILO, some fd features, ATM, various other hacks here and there
 +S: Buenos Aires
 +S: Argentina
 +
 +N: Tim Alpaerts
 +E: tim_alpaerts@toyota-motor-europe.com
 +D: 802.2 class II logical link control layer,
 +D: the humble start of an opening towards the IBM SNA protocols
 +S: Klaproosstraat 72 c 10
 +S: B-2610 Wilrijk-Antwerpen
 +S: Belgium
 +
 +N: Anton Altaparmakov
 +E: aia21@cantab.net
 +W: http://www-stu.christs.cam.ac.uk/~aia21/
 +D: Author of new NTFS driver, various other kernel hacks.
 +S: Christ's College
 +S: Cambridge CB2 3BU
 +S: United Kingdom
 +
 +N: C. Scott Ananian
 +E: cananian@alumni.princeton.edu
 +W: http://www.pdos.lcs.mit.edu/~cananian
 +P: 1024/85AD9EED AD C0 49 08 91 67 DF D7  FA 04 1A EE 09 E8 44 B0
 +D: Unix98 pty support.
 +D: APM update to 1.2 spec.
 +D: /devfs hacking.
 +S: 7 Kiwi Loop
 +S: Howell, NJ 07731
 +S: USA
 +
 +N: Erik Andersen
 +E: andersen@codepoet.org
 +W: http://www.codepoet.org/
 +P: 1024D/30D39057 1BC4 2742 E885 E4DE 9301  0C82 5F9B 643E 30D3 9057
 +D: Maintainer of ide-cd and Uniform CD-ROM driver, 
 +D: ATAPI CD-Changer support, Major 2.1.x CD-ROM update.
 +S: 352 North 525 East
 +S: Springville, Utah 84663
 +S: USA
 +
 +N: Michael Ang
 +E: mang@subcarrier.org
 +W: http://www.subcarrier.org/mang
 +D: Linux/PA-RISC hacker
 +S: 85 Frank St.
 +S: Ottawa, Ontario
 +S: Canada K2P 0X3
 +
 +N: H. Peter Anvin
 +E: hpa@zytor.com
 +W: http://www.zytor.com/~hpa/
 +P: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
 +D: Author of the SYSLINUX boot loader, maintainer of the linux.* news
 +D: hierarchy and the Linux Device List; various kernel hacks
 +S: 4390 Albany Drive #46
 +S: San Jose, California 95129
 +S: USA
 +
 +N: Andrea Arcangeli
 +E: andrea@suse.de
 +W: http://www.kernel.org/pub/linux/kernel/people/andrea/
 +P: 1024D/68B9CB43 13D9 8355 295F 4823 7C49  C012 DFA1 686E 68B9 CB43
 +P: 1024R/CB4660B9 CC A0 71 81 F4 A0 63 AC  C0 4B 81 1D 8C 15 C8 E5
 +D: Parport hacker
 +D: Implemented a workaround for some interrupt buggy printers
 +D: Author of pscan that helps to fix lp/parport bugs
 +D: Author of lil (Linux Interrupt Latency benchmark)
 +D: Fixed the shm swap deallocation at swapoff time (try_to_unuse message)
 +D: VM hacker
 +D: Various other kernel hacks
 +S: Via Cicalini 26
 +S: Imola 40026
 +S: Italy
 +
 +N: Derek Atkins
 +E: warlord@MIT.EDU
 +D: Linux-AFS Port, random kernel hacker,
 +D: VFS fixes (new notify_change in particular)
 +D: Moving all VFS access checks into the file systems
 +S: MIT Room E15-341
 +S: 20 Ames Street
 +S: Cambridge, Massachusetts 02139
 +S: USA
 +
 +N: Michel Aubry
 +E: giovanni <giovanni@sudfr.com>
 +D: Aladdin 1533/1543(C) chipset IDE
 +D: VIA MVP-3/TX Pro III chipset IDE
 +
 +N: Jens Axboe
 +E: axboe@suse.de
 +D: Linux CD-ROM maintainer, DVD support
 +D: elevator + block layer rewrites
 +D: highmem I/O support
 +D: misc hacking on IDE, SCSI, block drivers, etc
 +S: Peter Bangs Vej 258, 2TH
 +S: 2500 Valby
 +S: Denmark
 +
 +N: John Aycock
 +E: aycock@cpsc.ucalgary.ca
 +D: Adaptec 274x driver
 +S: Department of Computer Science
 +S: University of Calgary
 +S: Calgary, Alberta
 +S: Canada
 +
 +N: Miles Bader
 +E: miles@gnu.org
 +D: v850 port (uClinux)
 +S: NEC Corporation
 +S: 1753 Shimonumabe, Nakahara-ku
 +S: Kawasaki 211-8666
 +S: Japan
 +
 +N: Ralf Baechle
 +E: ralf@gnu.org
 +P: 1024/AF7B30C1 CF 97 C2 CC 6D AE A7 FE  C8 BA 9C FC 88 DE 32 C3
 +D: Linux/MIPS port
 +D: Linux/68k hacker
 +S: Hauptstrasse 19
 +S: 79837 St. Blasien
 +S: Germany
 +
 +N: Krishna Balasubramanian
 +E: balasub@cis.ohio-state.edu
 +D: Wrote SYS V IPC (part of standard kernel since 0.99.10)
 +
 +N: Dario Ballabio
 +E: ballabio_dario@emc.com
 +E: dario.ballabio@tiscalinet.it
 +E: dario.ballabio@inwind.it
 +D: Author and maintainer of the Ultrastor 14F/34F SCSI driver
 +D: Author and maintainer of the EATA ISA/EISA/PCI SCSI driver
 +S: EMC Corporation
 +S: Milano
 +S: Italy
 +
 +N: Paul Bame
 +E: bame@debian.org
 +E: bame@puffin.external.hp.com
 +E: paul_bame@hp.com
 +W: http://www.parisc-linux.org
 +D: PA-RISC 32 and 64-bit early boot, firmware interface, interrupts, misc
 +S: MS42
 +S: Hewlett-Packard
 +S: 3404 E Harmony Rd
 +S: Fort Collins, CO 80525
 +
 +N: Arindam Banerji
 +E: axb@cse.nd.edu
 +D: Contributed ESDI driver routines needed to port LINUX to the PS/2 MCA.
 +S: Department of Computer Science & Eng.
 +S: University of Notre Dame
 +S: Notre Dame, Indiana
 +S: USA
 +
 +N: Greg Banks
 +E: gnb@alphalink.com.au
 +D: IDT77105 ATM network driver
 +D: some SuperH port work
 +D: some trivial futzing with kconfig
 +
 +N: James Banks
 +E: james@sovereign.org
 +D: TLAN network driver
 +D: Logitech Busmouse driver
 +
 +N: Krzysztof G. Baranowski
 +E: kgb@manjak.knm.org.pl
 +P: 1024/FA6F16D1 96 D1 1A CF 5F CA 69 EC  F9 4F 36 1F 6D 60 7B DA
 +D: Maintainer of the System V file system.
 +D: System V fs update for 2.1.x dcache.
 +D: Forward ported a couple of SCSI drivers.
 +D: Various bugfixes.
 +S: ul. Koscielna 12a
 +S: 62-300 Wrzesnia
 +S: Poland
 +
 +N: Fred Barnes
 +E: frmb2@ukc.ac.uk
 +D: Various parport/ppdev hacks and fixes
 +S: Computing Lab, The University
 +S: Canterbury, KENT
 +S: CT2 7NF
 +S: England
 +
 +N: Paul Barton-Davis
 +E: pbd@op.net
 +D: Driver for WaveFront soundcards (Turtle Beach Maui, Tropez, Tropez+)
 +D: Various bugfixes and changes to sound drivers
 +S: USA 
 +
 +N: Carlos Henrique Bauer
 +E: chbauer@acm.org
 +E: bauer@atlas.unisinos.br
 +D: Some new sysctl entries for the parport driver.
 +D: New sysctl function for handling unsigned longs
 +S: Universidade do Vale do Rio dos Sinos - UNISINOS
 +S: DSI/IDASI
 +S: Av. Unisinos, 950
 +S: 93022000 Sao Leopoldo RS
 +S: Brazil
 +
 +N: Peter Bauer
 +E: 100136.3530@compuserve.com
 +D: Driver for depca-ethernet-board
 +S: 69259 Wilhemsfeld
 +S: Rainweg 15
 +S: Germany
 +
 +N: Fred Baumgarten
 +E: dc6iq@insl1.etec.uni-karlsruhe.de
 +E: dc6iq@adacom.org
 +E: dc6iq@db0ais.#hes.deu.eu (packet radio)
 +D: NET-2 & netstat(8)
 +S: Soevener Strasse 11
 +S: 53773 Hennef
 +S: Germany
 +
 +N: Donald Becker
 +E: becker@cesdis.gsfc.nasa.gov
 +D: General low-level networking hacker
 +D: Most of the ethercard drivers
 +D: Original author of the NFS server
 +S: USRA Center of Excellence in Space Data and Information Sciences
 +S: Code 930.5, Goddard Space Flight Center
 +S: Greenbelt, Maryland 20771
 +S: USA
 +
 +N: Adam Belay
 +E: ambx1@neo.rr.com
 +D: Linux Plug and Play Support
 +S: USA
 +
 +N: Daniele Bellucci
 +E: bellucda@tiscali.it
 +D: Various Janitor work.
 +W: http://web.tiscali.it/bellucda
 +S: Via Delle Palme, 9
 +S: Terni 05100
 +S: Italy
 +
 +N: Krzysztof Benedyczak
 +E: golbi@mat.uni.torun.pl
 +W: http://www.mat.uni.torun.pl/~golbi
 +D: POSIX message queues fs (with M. Wronski)
 +S: ul. Podmiejska 52
 +S: Radunica
 +S: 83-000 Pruszcz Gdanski
 +S: Poland
 +
 +N: Randolph Bentson
 +E: bentson@grieg.seaslug.org
 +W: http://www.aa.net/~bentson/
 +P: 1024/39ED5729 5C A8 7A F4 B2 7A D1 3E  B5 3B 81 CF 47 30 11 71
 +D: Author of driver for Cyclom-Y and Cyclades-Z async mux
 +S: 2322 37th Ave SW
 +S: Seattle, Washington 98126-2010
 +S: USA
 +
 +N: Stephen R. van den Berg (AKA BuGless)
 +E: berg@pool.informatik.rwth-aachen.de
 +D: General kernel, gcc, and libc hacker
 +D: Specialisation: tweaking, ensuring portability, tweaking, cleaning,
 +D: tweaking and occasionally debugging :-)
 +S: Bouwensstraat 22
 +S: 6369 BG Simpelveld
 +S: The Netherlands
 +
 +N: Peter Berger
 +E: pberger@brimson.com
 +W: http://www.brimson.com
 +D: Author/maintainer of Digi AccelePort USB driver
 +S: 1549 Hiironen Rd.
 +S: Brimson, MN  55602
 +S: USA
 +
 +N: Hennus Bergman
 +P: 1024/77D50909 76 99 FD 31 91 E1 96 1C  90 BB 22 80 62 F6 BD 63
 +D: Author and maintainer of the QIC-02 tape driver
 +S: The Netherlands
 +
 +N: Tomas Berndtsson
 +E: tomas@nocrew.org
 +W: http://tomas.nocrew.org/
 +D: dsp56k device driver
 +
 +N: Ross Biro
 +E: bir7@leland.Stanford.Edu
 +D: Original author of the Linux networking code
 +
 +N: Anton Blanchard
 +E: anton@samba.org
 +W: http://samba.org/~anton/
 +P: 1024/8462A731 4C 55 86 34 44 59 A7 99  2B 97 88 4A 88 9A 0D 97
 +D: sun4 port, Sparc hacker
 +
 +N: Hugh Blemings
 +E: hugh@misc.nu
 +W: http://misc.nu/hugh/
 +D: Author and maintainer of the Keyspan USB to Serial drivers
 +S: Po Box 234
 +S: Belconnen ACT 2616
 +S: Australia
 +
 +N: Philip Blundell
 +E: philb@gnu.org
 +D: Linux/ARM hacker
 +D: Device driver hacker (eexpress, 3c505, c-qcam, ...)
 +D: m68k port to HP9000/300
 +D: AUN network protocols
 +D: Co-architect of the parallel port sharing system
 +D: IPv6 netfilter
 +S: FutureTV Labs Ltd
 +S: Brunswick House, 61-69 Newmarket Rd, Cambridge CB5 8EG
 +S: United Kingdom
 +
 +N: Thomas Bogend�rfer
 +E: tsbogend@alpha.franken.de
 +D: PCnet32 driver, SONIC driver, JAZZ_ESP driver
 +D: newport abscon driver, g364 framebuffer driver
 +D: strace for Linux/Alpha
 +D: Linux/MIPS hacker
 +S: Schafhofstr. 40
 +S: 90556 Cadolzburg
 +S: Germany
 +
 +N: Bill Bogstad
 +E: bogstad@pobox.com
 +D: wrote /proc/self hack, minor samba & dosemu patches
 +
 +N: Axel Boldt
 +E: axel@uni-paderborn.de
 +W: http://math-www.uni-paderborn.de/~axel/
 +D: Configuration help text support
 +D: Linux CD and Support Giveaway List
 +
 +N: Erik Inge Bols�
 +E: knan@mo.himolde.no
 +D: Misc kernel hacks
 +
 +N: Andreas E. Bombe
 +E: andreas.bombe@munich.netsurf.de
 +W: http://home.pages.de/~andreas.bombe/
 +P: 1024/04880A44 72E5 7031 4414 2EB6 F6B4  4CBD 1181 7032 0488 0A44
 +D: IEEE 1394 subsystem rewrite and maintainer
 +D: Texas Instruments PCILynx IEEE 1394 driver
 +
 +N: Al Borchers
 +E: alborchers@steinerpoint.com
 +D: Author/maintainer of Digi AccelePort USB driver
 +D: work on usbserial and keyspan_pda drivers
 +S: 4912 Zenith Ave. S.
 +S: Minneapolis, MN  55410
 +S: USA
 +
 +N: Marc Boucher
 +E: marc@mbsi.ca
 +P: CA 67 A5 1A 38 CE B6 F2  D5 83 51 03 D2 9C 30 9E  CE D2 DD 65
 +D: Netfilter core
 +D: IP policy routing by mark
 +D: Various fixes (mostly networking)
 +S: Montreal, Quebec
 +S: Canada
 +
 +N: Zolt�n B�sz�rm�nyi
 +E: zboszor@mail.externet.hu
 +D: MTRR emulation with Cyrix style ARR registers, Athlon MTRR support
 +
 +N: John Boyd
 +E: boyd@cis.ohio-state.edu
 +D: Co-author of wd7000 SCSI driver
 +S: 101 Curl Drive #591
 +S: Columbus, Ohio 43210
 +S: USA
 +
 +N: Peter Braam
 +E: braam@clusterfs.com
 +W: http://www.clusterfs.com/
 +D: Coda & InterMezzo filesystems
 +S: 181 McNeil
 +S: Canmore, AB
 +S: Canada, T1W 2R9
 +
 +N: Ryan Bradetich
 +E: rbradetich@uswest.net
 +D: Linux/PA-RISC hacker
 +S: 1200 Goldenrod Dr.
 +S: Nampa, Idaho 83686
 +
 +N: Derrick J. Brashear
 +E: shadow@dementia.org
 +W: http://www.dementia.org/~shadow
 +P: 512/71EC9367 C5 29 0F BC 83 51 B9 F0  BC 05 89 A0 4F 1F 30 05
 +D: Author of Sparc CS4231 audio driver, random Sparc work
 +S: 403 Gilmore Avenue
 +S: Trafford, Pennsylvania 15085
 +S: USA
 +
 +N: Dag Brattli
 +E: dagb@cs.uit.no
 +W: http://www.cs.uit.no/~dagb
 +D: IrDA Subsystem
 +S: 19. Wellington Road
 +S: Lancaster, LA1 4DN
 +S: UK, England
 +
 +N: Lars Brinkhoff
 +E: lars@nocrew.org
 +W: http://lars.nocrew.org/
 +D: dsp56k device driver
 +D: ptrace proxy in user mode kernel port
 +S: Kopmansg 2
 +S: 411 13  Goteborg
 +S: Sweden
 +
 +N: Dominik Brodowski
 +E: linux@brodo.de
 +W: http://www.brodo.de/
 +P: 1024D/725B37C6  190F 3E77 9C89 3B6D BECD  46EE 67C3 0308 725B 37C6
 +D: parts of CPUFreq code, ACPI bugfixes
 +S: Tuebingen, Germany
 +
 +N: Andries Brouwer
 +E: aeb@cwi.nl
 +D: random Linux hacker
 +S: Bessemerstraat 21
 +S: Amsterdam
 +S: The Netherlands
 +
 +N: Zach Brown
 +E: zab@zabbo.net
 +D: maestro pci sound
 +
 +N: Gary Brubaker
 +E: xavyer@ix.netcom.com
 +D: USB Serial Empeg Empeg-car Mark I/II Driver
 +
 +N: Matthias Bruestle
 +E: m@mbsks.franken.de
 +D: REINER SCT cyberJack pinpad/e-com USB chipcard reader driver
 +S: Germany
 +
 +N: Adrian Bunk
 +E: bunk@stusta.de
 +P: 1024D/4F12B400  B29C E71E FE19 6755 5C8A  84D4 99FC EA98 4F12 B400
 +D: misc kernel hacking and testing
 +S: Grasmeierstrasse 11
 +S: 80805 Muenchen
 +S: Germany
 +
 +N: Ray Burr
 +E: ryb@nightmare.com
 +D: Original author of Amiga FFS filesystem
 +S: Orlando, Florida
 +S: USA
 +
 +N: Lennert Buytenhek
 +E: buytenh@gnu.org
 +D: Rewrite of the ethernet bridging code
 +S: Ravenhorst 58B
 +S: 2317 AK Leiden
 +S: The Netherlands
 +
 +N: Michael Callahan
 +E: callahan@maths.ox.ac.uk
 +D: PPP for Linux
 +S: The Mathematical Institute
 +S: 25-29 St Giles
 +S: Oxford
 +S: United Kingdom
 +
 +N: Luiz Fernando N. Capitulino
 +E: lcapitulino@terra.com.br
 +E: lcapitulino@prefeitura.sp.gov.br
 +W: http://www.telecentros.sp.gov.br
 +D: Little fixes and a lot of janitorial work
 +S: E-GOV Telecentros SP
 +S: Brazil
 +
 +N: Remy Card
 +E: Remy.Card@masi.ibp.fr
 +E: Remy.Card@linux.org
 +D: Extended file system [defunct] designer and developer
 +D: Second extended file system designer and developer
 +S: Institut Blaise Pascal
 +S: 4 Place Jussieu
 +S: 75252 Paris Cedex 05
 +S: France
 +
 +N: Ulf Carlsson
 +D: SGI Indy audio (HAL2) drivers
 +E: ulfc@bun.falkenberg.se
 +
 +N: Ed Carp
 +E: ecarp@netcom.com
 +D: uucp, elm, pine, pico port
 +D: cron, at(1) developer
 +S: 48287 Sawleaf
 +S: Fremont, California 94539
 +S: USA
 +
 +N: Florent Chabaud
 +E: florent.chabaud@polytechnique.org
 +D: software suspend
 +S: SGDN/DCSSI/SDS/LTI
 +S: 58, Bd Latour-Maubourg
 +S: 75700 Paris 07 SP
 +S: France
 +
 +N: Gordon Chaffee
 +E: chaffee@cs.berkeley.edu
 +W: http://bmrc.berkeley.edu/people/chaffee/
 +D: vfat, fat32, joliet, native language support
 +S: 3700 Warwick Road
 +S: Fremont, California 94555
 +S: USA
 +
 +N: Chih-Jen Chang
 +E: chihjenc@scf.usc.edu
 +E: chihjen@iis.sinica.edu.tw
 +D: IGMP(Internet Group Management Protocol) version 2
 +S: 3F, 65 Tajen street
 +S: Tamsui town, Taipei county,
 +S: Taiwan 251
 +S: Republic of China
 +
 +N: Michael Elizabeth Chastain
 +E: mec@shout.net
 +D: Configure, Menuconfig, xconfig
 +
 +N: Raymond Chen
 +E: raymondc@microsoft.com
 +D: Author of Configure script
 +S: 14509 NE 39th Street #1096
 +S: Bellevue, Washington 98007
 +S: USA
 +
 +N: Christopher L. Cheney
 +E: ccheney@debian.org
 +E: ccheney@cheney.cx
 +W: http://www.cheney.cx
 +P: 1024D/8E384AF2 2D31 1927 87D7 1F24 9FF9  1BC5 D106 5AB3 8E38 4AF2
 +D: Vista Imaging usb webcam driver
 +S: 314 Prince of Wales
 +S: Conroe, TX 77304
 +S: USA
 +
 +N: Stuart Cheshire
 +E: cheshire@cs.stanford.edu
 +D: Author of Starmode Radio IP (STRIP) driver
 +D: Originator of design for new combined interrupt handlers
 +S: William Gates Department
 +S: Stanford University
 +S: Stanford, California 94305
 +S: USA
 +
 +N: Randolph Chung
 +E: tausq@debian.org
 +D: Linux/PA-RISC hacker
 +S: Los Altos, CA 94022
 +S: USA
 +
 +N: Juan Jose Ciarlante
]
]

254/2 2026/08/17 22:09 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 40287
							output: 53
							thoughts: 93
						

Thoughts:
**Initial Kernel Commit - Immediate Response**

Okay, so I'm looking at commit `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2`. Right. That's it. No need to overthink this. This is the starting point, the Genesis block of the Linux kernel as it exists in the Git repository. Considering this is a baseline, a foundational element, the logical return is simply the commit hash itself. No analysis needed, no deeper probing. This is a straightforward lookup, and the response is equally straightforward. Therefore, I will respond with `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2`.



255/2 2026/08/17 22:10 tool set-results
0m Args:
map[FixesHash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2]

Results:
map[FixesHash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2]

256/1 2026/08/17 22:10 action format-fixes
0m Results:
map[Fixes:map[AuthorEmail:torvalds@ppc970.osdl.org AuthorName:Linus Torvalds Hash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Title:Linux-2.6.12-rc2]]

257/1 2026/08/17 22:10 action get-maintainers
0m Results:
map[Recipients:[map[Email:kees@kernel.org Name:Kees Cook To:false] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:linux-media@vger.kernel.org Name: To:true] map[Email:mchehab@kernel.org Name:Mauro Carvalho Chehab To:true] map[Email:torvalds@ppc970.osdl.org Name:Linus Torvalds To:true]]]

258/1 2026/08/17 22:10 action get-recent-commits
0m Results:
map[RecentCommits:Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
media: Convert from tasklet to BH workqueue
media: ttusb-dec: remove unnecessary (void*) conversions
media: usb: remove unnecessary (void*) conversions
media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
media: ttusb-dec: avoid release of non-acquired mutex
media: ttusb-dec: cleanup an error handling logic
media: media/usb:Remove superfluous "breaks" in the ttusb_dec.c
media: ttusb-dec: convert tasklets to use new tasklet_setup() API
media: usb: ttusb-dec: reduce the number of memory reads in ttusb_dec_handle_irq()
media: ttusb-dec: Fix info-leak in ttusb_dec_send_command()
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
media: usb: fix several typos
media: dvb: represent min/max/step/tolerance freqs in Hz
media: dvb: update buffer mmaped flags and frame counter
media: ttusb-dec: Remove pci_zalloc_coherent() abuse
media: move dvb kAPI headers to include/media
media: usb: constify usb_device_id
[media] media: Drop FSF's postal address from the source code files
]

259/1 2026/08/17 22:10 agent description-generator
0m Model:
best-expensive

Instruction:
You are an experienced Linux kernel developer tasked with writing a commit description for
a kernel bug fixing commit. The description should start with a one-line summary,
and then include description of the bug being fixed, and how it's fixed by the provided patch.
The one-line summary should describe the change being made, rather than mention the tool that
detected the bug.

The description must not contain lines starting with '#' because they will dropped by git as comments.
The description must not contain lines starting with '--' or '---' (including inline code diffs)
because they may confuse git/patch utilities.

Your final reply should contain only the text of the commit description.


The one-line summary must be not longer than 72 characters.

IMPORTANT: Do not wrap lines manually (e.g., at 80 characters); we will reformat the text
automatically, so keep paragraphs as single lines without newlines.

Generally try to phrase the description without mentioning syzkaller
(avoid phrases like "the bug was triggered by syzkaller" or "the bug was triggered by fuzzer", etc).
How the bug was triggered is generally an irrelevant detail.
Any bug triggered by a fuzzer can also be triggered by a malicious user, or a buggy program.

If the crash is reported by a sanitizer (e.g., KASAN, KMSAN, lockdep), include the relevant
parts of the sanitizer output to illustrate the problem. Exclude less relevant sections,
as the stack trace can be very long. Describe the execution path that leads to the manifestation
of the kernel bug.


If the patch removes the WARN_ON macro, refer to the fact that WARN_ON
must not be used for conditions that can legitimately happen, and that pr_err
should be used instead if necessary.

Don't assume that panic_on_warn is set, and that WARNINGs are fatal.
While panic_on_warn may be set when the bug was reproduced, it's generally not set on production systems.


Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash that corresponds to the bug is:

usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036, CPU#0: kworker/0:4/4798
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
lr : __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036
sp : ffff800098516d20
x29: ffff800098516d20 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: ffff800086d0a338 x21: 0000000000000000
x20: 000000000000004b x19: 000000000000003c x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
irq event stamp: 16196
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (16195): [<ffff8000868fc7b4>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62
hardirqs last disabled at (16196): [<ffff8000868f86e0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425
softirqs last  enabled at (16128): [<ffff80008030ff18>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (16128): [<ffff80008030ff18>] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650
softirqs last disabled at (16119): [<ffff8000800204b0>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kernel BUG at lib/string_helpers.c:1044!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 4798 Comm: kworker/0:4 Tainted: G        W           syzkaller #1 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Workqueue: usb_hub_wq hub_event
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
lr : __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
sp : ffff800098516d50
x29: ffff800098516d50 x28: dfff800000000000 x27: ffff7000130a2db0
x26: 0000000000000000 x25: ffff0000d1862683 x24: ffff800098516ea0
x23: 000000000000004b x22: 000000000000004b x21: ffff0000d1862680
x20: 1fffe0001a30c4d0 x19: ffff0000c3014000 x18: 1fffe00035ba8028
x17: 0000000000000003 x16: ffff800088ba7000 x15: ffff8000824ea6c8
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000002 x9 : 653dfa0a2f6c5200
x8 : 653dfa0a2f6c5200 x7 : ffff80008048e0c4 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f8054
x2 : 0000000100000000 x1 : ffff0000c57d1d40 x0 : 0000000000000000
Call trace:
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043 (P)
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671
 usb_probe_interface+0x308/0x788 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_set_configuration+0x1184/0x158c drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:250
 usb_probe_device+0x114/0x2b0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x29c/0x800 drivers/base/dd.c:706
 __driver_probe_device+0x1e0/0x350 drivers/base/dd.c:868
 driver_probe_device+0x6c/0x19c drivers/base/dd.c:898
 __device_attach_driver+0x198/0x2f8 drivers/base/dd.c:1026
 bus_for_each_drv+0x144/0x1dc drivers/base/bus.c:500
 __device_attach+0x248/0x390 drivers/base/dd.c:1098
 device_initial_probe+0x90/0xc8 drivers/base/dd.c:1153
 bus_probe_device+0x58/0x120 drivers/base/bus.c:620
 device_add+0x6cc/0x9e0 drivers/base/core.c:3772
 usb_new_device+0x9c4/0x11f8 drivers/usb/core/hub.c:2703
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event+0x1ef0/0x39fc drivers/usb/core/hub.c:5961
 process_one_work kernel/workqueue.c:3322 [inline]
 process_scheduled_works+0x788/0x10b8 kernel/workqueue.c:3405
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3486
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842
Code: d503233f a9bf7bfd 910003fd 94619ee8 (d4210000) 
---[ end trace 0000000000000000 ]---




The explanation of the root cause of the bug is:

The crash is caused by a buffer overflow (both an out-of-bounds read and an out-of-bounds write) in the `ttusb_dec_send_command()` function, triggered by a malicious or malfunctioning USB device returning an unexpectedly large payload length.

### Detailed Analysis

In `drivers/media/usb/ttusb-dec/ttusb_dec.c`, the `ttusb_dec_send_command()` function allocates a buffer `b` to send a command and receive the response via `usb_bulk_msg()`:

```c
	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
```
Here, `COMMAND_PACKET_SIZE` is defined as `0x3c` (60), so the allocated buffer `b` is exactly 64 bytes.

After receiving the response from the USB device, the driver reads the payload length directly from `b[3]` (which is fully controlled by the USB device) and copies the payload into the caller-provided `cmd_result` buffer:

```c
		if (result_length)
			*result_length = b[3];
		if (cmd_result && b[3] > 0)
			memcpy(cmd_result, &b[4], b[3]);
```

There are two major flaws in this logic:
1. **No bounds check against the received data or the allocated buffer `b`**: `b[3]` is an 8-bit value and can be up to 255. If the device returns a value greater than `COMMAND_PACKET_SIZE` (60), the `memcpy()` will read past the end of the 64-byte buffer `b`. In the syzkaller crash, `b[3]` was `75`, leading to a 75-byte read from `&b[4]` (which only has 60 bytes allocated). This triggers the `fortify_memcpy_chk` panic (`75 byte read of buffer size 60`).
2. **No bounds check against the destination buffer `cmd_result`**: The size of `cmd_result` is never passed to `ttusb_dec_send_command()`. While callers like `ttusb_dec_get_stb_state()` pass a 60-byte buffer (`u8 c[COMMAND_PACKET_SIZE]`), other callers like `ttusbdecfe_dvbt_read_status()` in `ttusbdecfe.c` pass a much smaller buffer (`u8 result[4]`). If the device returns `b[3] = 60` for the latter, it will result in a severe stack buffer overflow.

### Proposed Fix

To fix this comprehensively, the API needs to be updated to pass the size of the destination buffer, and `ttusb_dec_send_command()` must validate `b[3]` against the received length, the maximum packet size, and the destination buffer size.

**1. Update `ttusbdecfe_config` in `drivers/media/usb/ttusb-dec/ttusbdecfe.h`:**
Add `cmd_result_len` to the `send_command` callback signature.
```c
struct ttusbdecfe_config
{
	int (*send_command)(struct dvb_frontend* fe, const u8 command,
			    int param_length, const u8 params[],
			    int *result_length, u8 cmd_result[],
			    int cmd_result_len);
};
```

**2. Update `ttusb_dec_send_command()` in `ttusb_dec.c`:**
Add `cmd_result_len` to the signature and implement the necessary bounds checks.
```c
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
				  int param_length, const u8 params[],
				  int *result_length, u8 cmd_result[],
				  int cmd_result_len)
{
	// ...
	result = usb_bulk_msg(dec->udev, dec->result_pipe, b,
			      COMMAND_PACKET_SIZE + 4, &actual_len, 1000);

	if (result) {
		printk("%s: result bulk message failed: error %d\n",
		       __func__, result);
		goto err_mutex_unlock;
	} else {
		if (debug) {
			printk(KERN_DEBUG "%s: result: %*ph\n",
			       __func__, actual_len, b);
		}

		/* Ensure we received at least the 4-byte header */
		if (actual_len < 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		/* Ensure the device isn't claiming more data than it sent or than fits in b */
		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
			result = -EIO;
			goto err_mutex_unlock;
		}

		if (result_length)
			*result_length = b[3];

		if (cmd_result && b[3] > 0) {
			/* Ensure we don't overflow the caller's buffer */
			if (b[3] > cmd_result_len) {
				result = -EIO;
				goto err_mutex_unlock;
			}
			memcpy(cmd_result, &b[4], b[3]);
		}
	}
	// ...
```

**3. Update all callers:**
You will need to update all callers of `ttusb_dec_send_command()` in `ttusb_dec.c` and `state->config->send_command()` in `ttusbdecfe.c` to pass the correct buffer size. 
For example:
- In `ttusb_dec_get_stb_state()`: pass `sizeof(c)` instead of just `c`.
- In `ttusbdecfe_dvbt_read_status()`: pass `sizeof(result)` instead of just `result`.
- For calls where `cmd_result` is `NULL`, simply pass `0` as the length.

The diff of the bug fix is:

diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 825a38759..b54b7b4bb 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -314,13 +314,17 @@ static u16 crc16(u16 crc, const u8 *buf, size_t len)
 
 static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 				  int param_length, const u8 params[],
-				  int *result_length, u8 cmd_result[])
+				  int *result_length, u8 cmd_result[],
+				  int cmd_result_len)
 {
 	int result, actual_len;
 	u8 *b;
 
 	dprintk("%s\n", __func__);
 
+	if (param_length > COMMAND_PACKET_SIZE)
+		return -EINVAL;
+
 	b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
 	if (!b)
 		return -ENOMEM;
@@ -366,10 +370,25 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
 			       __func__, actual_len, b);
 		}
 
+		if (actual_len < 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
+		if (b[3] > COMMAND_PACKET_SIZE || b[3] > actual_len - 4) {
+			result = -EIO;
+			goto err_mutex_unlock;
+		}
+
 		if (result_length)
 			*result_length = b[3];
-		if (cmd_result && b[3] > 0)
+		if (cmd_result && b[3] > 0) {
+			if (b[3] > cmd_result_len) {
+				result = -EIO;
+				goto err_mutex_unlock;
+			}
 			memcpy(cmd_result, &b[4], b[3]);
+		}
 	}
 
 err_mutex_unlock:
@@ -389,7 +408,8 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
 
 	dprintk("%s\n", __func__);
 
-	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c);
+	result = ttusb_dec_send_command(dec, 0x08, 0, NULL, &c_length, c,
+					sizeof(c));
 	if (result)
 		return result;
 
@@ -448,7 +468,7 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
 	memcpy(&b[2], &audio, 2);
 	memcpy(&b[4], &video, 2);
 
-	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL, 0);
 
 	dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO],
 			       ttusb_dec_audio_pes2ts_cb, dec);
@@ -902,7 +922,7 @@ static int ttusb_dec_set_interface(struct ttusb_dec *dec,
 			break;
 		case TTUSB_DEC_INTERFACE_IN:
 			result = ttusb_dec_send_command(dec, 0x80, sizeof(b),
-							b, NULL, NULL);
+							b, NULL, NULL, 0);
 			if (result)
 				return result;
 			result = usb_set_interface(dec->udev, 0, 8);
@@ -1021,7 +1041,7 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 
 	}
 
-	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x80, sizeof(b0), b0, NULL, NULL, 0);
 	if (result)
 		return result;
 
@@ -1056,7 +1076,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	memcpy(&b0[5], &dvbdmxfeed->filter->filter.filter_value[0], 1);
 
 	result = ttusb_dec_send_command(dec, 0x60, sizeof(b0), b0,
-					&c_length, c);
+					&c_length, c, sizeof(c));
 
 	if (!result) {
 		if (c_length == 2) {
@@ -1114,7 +1134,7 @@ static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
 	struct ttusb_dec *dec = dvbdmxfeed->demux->priv;
 	u8 b0[] = { 0x00 };
 
-	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x81, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->pva_stream_count--;
 
@@ -1135,7 +1155,7 @@ static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
 	list_del(&finfo->filter_info_list);
 	spin_unlock_irqrestore(&dec->filter_info_list_lock, flags);
 	kfree(finfo);
-	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL);
+	ttusb_dec_send_command(dec, 0x62, sizeof(b0), b0, NULL, NULL, 0);
 
 	dec->filter_stream_count--;
 
@@ -1238,7 +1258,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__func__);
 	/* enable irq pipe */
-	ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
+	ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -1354,7 +1374,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 	firmware_csum_ns = htons(firmware_csum);
 	memcpy(&b0[6], &firmware_csum_ns, 2);
 
-	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL, 0);
 
 	if (result) {
 		release_firmware(fw_entry);
@@ -1395,7 +1415,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 		}
 	}
 
-	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL, 0);
 
 	release_firmware(fw_entry);
 	kfree(b);
@@ -1621,10 +1641,13 @@ static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
 
 static int fe_send_command(struct dvb_frontend* fe, const u8 command,
 			   int param_length, const u8 params[],
-			   int *result_length, u8 cmd_result[])
+			   int *result_length, u8 cmd_result[],
+			   int cmd_result_len)
 {
 	struct ttusb_dec* dec = fe->dvb->priv;
-	return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
+	return ttusb_dec_send_command(dec, command, param_length, params,
+				      result_length, cmd_result,
+				      cmd_result_len);
 }
 
 static const struct ttusbdecfe_config fe_config = {
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 215221370..b013d6dfc 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -44,7 +44,8 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 
 	*status=0;
 
-	ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result);
+	ret = state->config->send_command(fe, 0x73, sizeof(b), b, &len, result,
+					  sizeof(result));
 	if(ret)
 		return ret;
 
@@ -85,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
 
 	__be32 freq = htonl(p->frequency / 1000);
 	memcpy(&b[4], &freq, sizeof (u32));
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -130,7 +131,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
 	lnb_voltage = htonl(state->voltage);
 	memcpy(&b[28], &lnb_voltage, sizeof(u32));
 
-	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
+	state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL, 0);
 
 	return 0;
 }
@@ -149,7 +150,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
 
 	state->config->send_command(fe, 0x72,
 				    sizeof(b) - (6 - cmd->msg_len), b,
-				    NULL, NULL);
+				    NULL, NULL, 0);
 
 	return 0;
 }
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.h b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
index 73828bb22..96600ad4c 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.h
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.h
@@ -14,7 +14,8 @@ struct ttusbdecfe_config
 {
 	int (*send_command)(struct dvb_frontend* fe, const u8 command,
 			    int param_length, const u8 params[],
-			    int *result_length, u8 cmd_result[]);
+			    int *result_length, u8 cmd_result[],
+			    int cmd_result_len);
 };
 
 extern struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config);


Additional description of the patch:

I have analyzed the root cause and implemented the fix as proposed, with an additional safeguard.

### Changes made:
1. **Updated `ttusbdecfe_config`**: Added `cmd_result_len` to the `send_command` callback signature in `drivers/media/usb/ttusb-dec/ttusbdecfe.h`.
2. **Updated `ttusb_dec_send_command`**: 
   - Added `cmd_result_len` to the function signature.
   - Added a check to ensure `param_length` does not exceed `COMMAND_PACKET_SIZE` before allocating and copying into the buffer `b`. This prevents a potential out-of-bounds write when copying `params` into `b`.
   - Added bounds checks to ensure the received payload length (`b[3]`) does not exceed `COMMAND_PACKET_SIZE`, the actual received data length (`actual_len - 4`), or the caller-provided buffer size (`cmd_result_len`).
   - Added a check to ensure `actual_len` is at least 4 bytes to safely read the header.
3. **Updated all callers**: Updated all invocations of `ttusb_dec_send_command` in `ttusb_dec.c` and `state->config->send_command` in `ttusbdecfe.c` to pass the correct destination buffer size (using `sizeof()`) or `0` when `cmd_result` is `NULL`.

### Why these changes were made:
The primary issue was trusting the device-provided length field (`b[3]`) without validating it against the bounds of the allocated buffer or the caller's destination buffer. By passing the destination buffer size down the call stack and validating `b[3]` against both the source (actual received data) and destination (caller's buffer size) boundaries, we ensure that malicious or malfunctioning USB devices cannot trigger out-of-bounds reads or writes. 

Additionally, I added a check for `param_length > COMMAND_PACKET_SIZE` at the beginning of `ttusb_dec_send_command`. While current callers pass safe values, this prevents future callers from accidentally overflowing the allocated command buffer `b` when copying `params`.

Here are summaries of recent commits that touched the same files.
Format the summary line consistently with these, look how prefixes
are specified, letter capitalization, style, etc. 

Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
media: Convert from tasklet to BH workqueue
media: ttusb-dec: remove unnecessary (void*) conversions
media: usb: remove unnecessary (void*) conversions
media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
media: ttusb-dec: avoid release of non-acquired mutex
media: ttusb-dec: cleanup an error handling logic
media: media/usb:Remove superfluous "breaks" in the ttusb_dec.c
media: ttusb-dec: convert tasklets to use new tasklet_setup() API
media: usb: ttusb-dec: reduce the number of memory reads in ttusb_dec_handle_irq()
media: ttusb-dec: Fix info-leak in ttusb_dec_send_command()
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
media: usb: fix several typos
media: dvb: represent min/max/step/tolerance freqs in Hz
media: dvb: update buffer mmaped flags and frame counter
media: ttusb-dec: Remove pci_zalloc_coherent() abuse
media: move dvb kAPI headers to include/media
media: usb: constify usb_device_id
[media] media: Drop FSF's postal address from the source code files


Reply:
media: ttusb-dec: fix buffer overflow in ttusb_dec_send_command()

The ttusb_dec_send_command() function allocates a 64-byte buffer
(COMMAND_PACKET_SIZE + 4) for USB communication. After receiving a
response, it reads the payload length from b[3] (which is fully controlled
by the USB device) and copies the payload into the caller-provided
cmd_result buffer. There are two missing bounds checks. First, b[3] can be
up to 255, exceeding the 60-byte payload capacity of the allocated buffer,
leading to an out-of-bounds read. Second, the size of cmd_result is not
passed to the function, so a large b[3] can cause a buffer overflow in the
destination buffer (e.g., a 4-byte buffer in
ttusbdecfe_dvbt_read_status()).

This can result in a fortify panic:

memcpy: detected buffer overflow: 75 byte read of buffer size 60
WARNING: lib/string_helpers.c:1037 at __fortify_report+0xa0/0xb8
lib/string_helpers.c:1036
...
Call trace:
 __fortify_report+0xa0/0xb8 lib/string_helpers.c:1036 (P)
 __fortify_panic+0x10/0x14 lib/string_helpers.c:1043
 fortify_memcpy_chk include/linux/fortify-string.h:549 [inline]
 ttusb_dec_start_feed+0x0/0x10ac
 drivers/media/usb/ttusb-dec/ttusb_dec.c:372
 ttusb_dec_get_stb_state drivers/media/usb/ttusb-dec/ttusb_dec.c:392
 [inline]
 ttusb_dec_init_stb drivers/media/usb/ttusb-dec/ttusb_dec.c:1413 [inline]
 ttusb_dec_probe+0x724/0x1aa0 drivers/media/usb/ttusb-dec/ttusb_dec.c:1671

Fix this by adding a cmd_result_len parameter to ttusb_dec_send_command()
and the send_command callback in ttusbdecfe_config. Update all callers to
pass the correct buffer size. Inside ttusb_dec_send_command(), validate
param_length, ensure actual_len is at least 4 bytes, and check that b[3]
does not exceed COMMAND_PACKET_SIZE, actual_len - 4, or cmd_result_len.

260/2 2026/08/17 22:10 llm description-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14190
							output: 606
							thoughts: 2137
						

Thoughts:
**My Analysis of the Linux Kernel Bug Fix**

Okay, so I'm looking at a buffer overflow in `ttusb_dec_send_command` within the `ttusb-dec` driver. The immediate issue is that the driver trusts the payload length reported by the USB device without validating it.  Specifically, `b[3]` is read from the USB device, but there's no check to ensure it doesn't exceed either the allocated buffer size or, crucially, the size of the buffer the caller provides.  This is a classic vulnerability.  I see a function, `ttusb_dec_send_command()`, that allocates a 64-byte buffer (plus four bytes) for USB communication, and then pulls the payload length from `b[3]`. This payload is then copied into a buffer provided by the calling function.  There are two glaring oversights here that need fixing.  First, `b[3]` can contain a value up to 255 which goes way over the internal buffer, causing an out-of-bounds read.  Second, and perhaps more significantly, the size of the destination buffer (`cmd_result`) is not passed to `ttusb_dec_send_command()`.  This allows a malicious USB device to potentially trigger a buffer overflow in the calling code, such as in `ttusbdecfe_dvbt_read_status()`, where it appears the buffer could be as small as 4 bytes. I have KASAN/fortify output to highlight this as well.

The sanitizer output clearly points this out: `memcpy: detected buffer overflow: 75 byte read of buffer size 60`. It goes on to report the call trace as well, which includes the offending `ttusb_dec_send_command()` function. The error shows up through a chain of calls including `ttusb_dec_start_feed`, `ttusb_dec_get_stb_state`, `ttusb_dec_init_stb`, and finally `ttusb_dec_probe`.

To fix this, I have to add a `cmd_result_len` parameter to `ttusb_dec_send_command()` and also to the `send_command` callback within `ttusbdecfe_config`.  I'll then add validations within `ttusb_dec_send_command()` itself. The fix involves validating that `param_length` is not larger than `COMMAND_PACKET_SIZE` and that `actual_len` is at least four bytes, the minimum for the response.  Crucially, I need to check `b[3]` against `COMMAND_PACKET_SIZE`, `actual_len - 4` and now the newly added `cmd_result_len`. Finally, I'll need to update all the callers to now pass the correct buffer size.



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)