ID Workflow Result Correct Bug Created Started Finished Revision
9d9e7ba8 patching ❓ WARNING in drm_mode_create_lease_ioctl 2026/10/13 20:16 2026/10/13 20:55 2026/10/14 00:39 7321cd29
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 drm_mode_create_lease_ioctl
CrashLogID 6677157893373952
CrashReportID 4798516850851840
KernelCommit 573067a5a685c238d90270ffb6efae6b26c72fed
KernelConfig
Show (336867 bytes)
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.13.0-rc3 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="Debian clang version 15.0.6"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=150006
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=150006
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=24000
CONFIG_LLD_VERSION=0
CONFIG_RUSTC_VERSION=0
CONFIG_RUSTC_LLVM_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_PAHOLE_VERSION=124
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_USELIB is not set
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_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS=y
CONFIG_GENERIC_IRQ_IPI=y
CONFIG_GENERIC_IRQ_IPI_MUX=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
# end of IRQ subsystem

CONFIG_GENERIC_TIME_VSYSCALL=y
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
# 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_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
# 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
# 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_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GCC_NO_STRINGOP_OVERFLOW=y
CONFIG_ARCH_SUPPORTS_INT128=y
CONFIG_NUMA_BALANCING=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_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_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
# CONFIG_CPUSETS_V1 is not set
CONFIG_PROC_PID_CPUSET=y
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_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=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
# CONFIG_BOOT_CONFIG is not set
CONFIG_INITRAMFS_PRESERVE_MTIME=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_LD_ORPHAN_WARN=y
CONFIG_LD_ORPHAN_WARN_LEVEL="warn"
CONFIG_SYSCTL=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y
# CONFIG_SGETMASK_SYSCALL is not set
CONFIG_SYSFS_SYSCALL=y
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_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KCMP=y
CONFIG_RSEQ=y
# CONFIG_DEBUG_RSEQ is not set
CONFIG_CACHESTAT_SYSCALL=y
# CONFIG_PC104 is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_SELFTEST is not set
CONFIG_KALLSYMS_ALL=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=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_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
# end of Kexec and crash features
# 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=18
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=y
CONFIG_ARCH_AIROHA=y
CONFIG_ARCH_SUNXI=y
CONFIG_ARCH_ALPINE=y
CONFIG_ARCH_APPLE=y
CONFIG_ARCH_BCM=y
CONFIG_ARCH_BCM2835=y
CONFIG_ARCH_BCM_IPROC=y
CONFIG_ARCH_BCMBCA=y
CONFIG_ARCH_BRCMSTB=y
CONFIG_ARCH_BERLIN=y
# CONFIG_ARCH_BITMAIN is not set
CONFIG_ARCH_EXYNOS=y
CONFIG_ARCH_SPARX5=y
CONFIG_ARCH_K3=y
CONFIG_ARCH_LG1K=y
CONFIG_ARCH_HISI=y
CONFIG_ARCH_KEEMBAY=y
CONFIG_ARCH_MEDIATEK=y
CONFIG_ARCH_MESON=y
CONFIG_ARCH_MVEBU=y
CONFIG_ARCH_NXP=y
CONFIG_ARCH_LAYERSCAPE=y
CONFIG_ARCH_MXC=y
CONFIG_ARCH_S32=y
CONFIG_ARCH_MA35=y
CONFIG_ARCH_NPCM=y
# CONFIG_ARCH_PENSANDO is not set
CONFIG_ARCH_QCOM=y
CONFIG_ARCH_REALTEK=y
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_ARCH_SEATTLE=y
CONFIG_ARCH_INTEL_SOCFPGA=y
CONFIG_ARCH_STM32=y
CONFIG_ARCH_SYNQUACER=y
CONFIG_ARCH_TEGRA=y
CONFIG_ARCH_TESLA_FSD=y
CONFIG_ARCH_SPRD=y
CONFIG_ARCH_THUNDER=y
CONFIG_ARCH_THUNDER2=y
CONFIG_ARCH_UNIPHIER=y
CONFIG_ARCH_VEXPRESS=y
CONFIG_ARCH_VISCONTI=y
CONFIG_ARCH_XGENE=y
CONFIG_ARCH_ZYNQMP=y
# end of Platform selection

#
# Kernel Features
#

#
# ARM errata workarounds via the alternatives framework
#
CONFIG_AMPERE_ERRATUM_AC03_CPU_38=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_LD_HAS_FIX_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=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_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_QCOM_FALKOR_ERRATUM_1003=y
CONFIG_QCOM_FALKOR_ERRATUM_1009=y
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
CONFIG_QCOM_FALKOR_ERRATUM_E1041=y
CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=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_BIG_ENDIAN is not set
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_SCHED_MC=y
# CONFIG_SCHED_CLUSTER is not set
CONFIG_SCHED_SMT=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_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_RODATA_FULL_DEFAULT_ENABLED=y
# CONFIG_ARM64_SW_TTBR0_PAN is not set
CONFIG_ARM64_TAGGED_ADDR_ABI=y
CONFIG_COMPAT=y
CONFIG_KUSER_HELPERS=y
# CONFIG_COMPAT_ALIGNMENT_FIXUPS is not set
# CONFIG_ARMV8_DEPRECATED is not set

#
# ARMv8.1 architectural features
#
CONFIG_ARM64_HW_AFDBM=y
CONFIG_ARM64_PAN=y
CONFIG_AS_HAS_LSE_ATOMICS=y
CONFIG_ARM64_LSE_ATOMICS=y
CONFIG_ARM64_USE_LSE_ATOMICS=y
# end of ARMv8.1 architectural features

#
# ARMv8.2 architectural features
#
CONFIG_AS_HAS_ARMV8_2=y
CONFIG_AS_HAS_SHA3=y
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_CC_HAS_SIGN_RETURN_ADDRESS=y
CONFIG_AS_HAS_ARMV8_3=y
CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y
CONFIG_AS_HAS_LDAPR=y
# end of ARMv8.3 architectural features

#
# ARMv8.4 architectural features
#
CONFIG_ARM64_AMU_EXTN=y
CONFIG_AS_HAS_ARMV8_4=y
CONFIG_ARM64_TLB_RANGE=y
# 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

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

CONFIG_ARM64_SVE=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 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=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_ALLWINNER_SUN50I_CPUFREQ_NVMEM=y
CONFIG_ARM_APPLE_SOC_CPUFREQ=y
CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
# CONFIG_ARM_ARMADA_8K_CPUFREQ is not set
CONFIG_ARM_SCPI_CPUFREQ=y
CONFIG_ARM_IMX_CPUFREQ_DT=y
CONFIG_ARM_MEDIATEK_CPUFREQ=y
CONFIG_ARM_MEDIATEK_CPUFREQ_HW=y
CONFIG_ARM_QCOM_CPUFREQ_NVMEM=y
CONFIG_ARM_QCOM_CPUFREQ_HW=y
CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
CONFIG_ARM_SCMI_CPUFREQ=y
CONFIG_ARM_TEGRA20_CPUFREQ=y
CONFIG_ARM_TEGRA124_CPUFREQ=y
CONFIG_ARM_TEGRA186_CPUFREQ=y
CONFIG_ARM_TEGRA194_CPUFREQ=y
CONFIG_ARM_TI_CPUFREQ=y
CONFIG_QORIQ_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 is not set
# 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_NHLT=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_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_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_KVM_XFER_TO_GUEST_WORK=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_GENERIC_MMU_NOTIFIER=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
# CONFIG_NVHE_EL2_DEBUG is not set
# CONFIG_PTDUMP_STAGE2_DEBUGFS is not set
CONFIG_CPU_MITIGATIONS=y

#
# General architecture-dependent options
#
CONFIG_ARCH_HAS_SUBPAGE_FAULTS=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=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_STACKLEAK=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_LTO_NONE=y
CONFIG_ARCH_SUPPORTS_CFI_CLANG=y
CONFIG_HAVE_CONTEXT_TRACKING_USER=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=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_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
# 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_ASM_MODVERSIONS=y
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_SHA1=y
# CONFIG_MODULE_SIG_SHA256 is not set
# 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="sha1"
# CONFIG_MODULE_COMPRESS is not set
# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set
CONFIG_MODPROBE_PATH="/sbin/modprobe"
# CONFIG_TRIM_UNUSED_KSYMS is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_PUNT_BIO=y
CONFIG_BLK_DEV_BSG_COMMON=y
CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_DEV_WRITE_MOUNTED is not set
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_BLK_WBT=y
CONFIG_BLK_WBT_MQ=y
CONFIG_BLK_CGROUP_IOLATENCY=y
# CONFIG_BLK_CGROUP_FC_APPID is not set
CONFIG_BLK_CGROUP_IOCOST=y
# CONFIG_BLK_CGROUP_IOPRIO 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_MQ_PCI=y
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_BLK_PM=y
CONFIG_BLOCK_HOLDER_DEPRECATED=y
CONFIG_BLK_MQ_STACKING=y

#
# 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_ZPOOL=y
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_ZSWAP_ZPOOL_DEFAULT_ZBUD is not set
CONFIG_ZSWAP_ZPOOL_DEFAULT_Z3FOLD_DEPRECATED=y
# CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC is not set
CONFIG_ZSWAP_ZPOOL_DEFAULT="z3fold"
# CONFIG_ZBUD is not set
CONFIG_Z3FOLD_DEPRECATED=y
CONFIG_Z3FOLD=y
CONFIG_ZSMALLOC=y
# CONFIG_ZSMALLOC_STAT is not set
CONFIG_ZSMALLOC_CHAIN_SIZE=8

#
# Slab allocator options
#
CONFIG_SLUB=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_SLUB_CPU_PARTIAL=y
# CONFIG_RANDOM_KMALLOC_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_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y
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_MEMORY_BALLOON=y
CONFIG_BALLOON_COMPACTION=y
CONFIG_COMPACTION=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_PAGE_REPORTING=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_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
CONFIG_THP_SWAP=y
CONFIG_READ_ONLY_THP_FOR_FS=y
CONFIG_PGTABLE_HAS_HUGE_LEAVES=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_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_PTE_DEVMAP=y
CONFIG_ARCH_HAS_ZONE_DMA_SET=y
CONFIG_ZONE_DMA=y
CONFIG_ZONE_DMA32=y
CONFIG_ZONE_DEVICE=y
CONFIG_HMM_MIRROR=y
CONFIG_GET_FREE_REGION=y
CONFIG_DEVICE_PRIVATE=y
CONFIG_VMAP_PFN=y
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
CONFIG_ARCH_HAS_PKEYS=y
CONFIG_ARCH_USES_PG_ARCH_2=y
CONFIG_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

#
# Data Access Monitoring
#
CONFIG_DAMON=y
CONFIG_DAMON_VADDR=y
CONFIG_DAMON_PADDR=y
# CONFIG_DAMON_SYSFS is not set
# CONFIG_DAMON_DBGFS_DEPRECATED is not set
CONFIG_DAMON_RECLAIM=y
# CONFIG_DAMON_LRU_SORT 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

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_UNIX=y
CONFIG_AF_UNIX_OOB=y
CONFIG_UNIX_DIAG=y
CONFIG_TLS=y
CONFIG_TLS_DEVICE=y
CONFIG_TLS_TOE=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_ESPINTCP=y
CONFIG_SMC=y
CONFIG_SMC_DIAG=y
# CONFIG_SMC_LO is not set
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_SIGPOOL=y
# 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_DCCP=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NF_CT_PROTO_SCTP=y
CONFIG_NF_CT_PROTO_UDPLITE=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_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

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

#
# DCCP CCIDs Configuration
#
# CONFIG_IP_DCCP_CCID2_DEBUG is not set
CONFIG_IP_DCCP_CCID3=y
# CONFIG_IP_DCCP_CCID3_DEBUG is not set
CONFIG_IP_DCCP_TFRC_LIB=y
# end of DCCP CCIDs Configuration

#
# DCCP Kernel Hacking
#
# CONFIG_IP_DCCP_DEBUG is not set
# end of DCCP Kernel Hacking

CONFIG_IP_SCTP=y
# CONFIG_SCTP_DBG_OBJCNT is not set
CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set
CONFIG_SCTP_COOKIE_HMAC_MD5=y
CONFIG_SCTP_COOKIE_HMAC_SHA1=y
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_CLIP=y
# CONFIG_ATM_CLIP_NO_ICMP is not set
CONFIG_ATM_LANE=y
CONFIG_ATM_MPOA=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_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_KSZ 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_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC=y
CONFIG_LLC2=y
# CONFIG_ATALK is not set
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_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_NC=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=y
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_HAMRADIO=y

#
# Packet Radio protocols
#
CONFIG_AX25=y
CONFIG_AX25_DAMA_SLAVE=y
CONFIG_NETROM=y
CONFIG_ROSE=y

#
# AX.25 network device drivers
#
CONFIG_MKISS=y
CONFIG_6PACK=y
CONFIG_BPQETHER=y
# CONFIG_BAYCOM_SER_FDX is not set
# CONFIG_BAYCOM_SER_HDX is not set
# CONFIG_BAYCOM_PAR is not set
# CONFIG_YAM is not set
# end of AX.25 network device drivers

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_HCIDTL1 is not set
# CONFIG_BT_HCIBT3C is not set
# CONFIG_BT_HCIBLUECARD is not set
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_QCOMSMD=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_RXPERF is not set
CONFIG_AF_KCM=y
CONFIG_STREAM_PARSER=y
# CONFIG_MCTP is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=y
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y
CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
CONFIG_CFG80211_CRDA_SUPPORT=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_RFKILL_GPIO is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_FD=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_NET_9P_USBG is not set
CONFIG_NET_9P_RDMA=y
# CONFIG_NET_9P_DEBUG is not set
CONFIG_CAIF=y
CONFIG_CAIF_DEBUG=y
CONFIG_CAIF_NETDEV=y
CONFIG_CAIF_USB=y
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 is not set
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_TEGRA_AHB=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_ECAM=y
CONFIG_PCI_BRIDGE_EMUL=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_PCIE_BUS_TUNE_OFF is not set
CONFIG_PCIE_BUS_DEFAULT=y
# CONFIG_PCIE_BUS_SAFE is not set
# CONFIG_PCIE_BUS_PERFORMANCE is not set
# CONFIG_PCIE_BUS_PEER2PEER 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_AARDVARK=y
CONFIG_PCIE_ALTERA=y
CONFIG_PCIE_ALTERA_MSI=y
# CONFIG_PCIE_APPLE is not set
CONFIG_PCIE_BRCMSTB=y
CONFIG_PCIE_IPROC=y
CONFIG_PCIE_IPROC_PLATFORM=y
CONFIG_PCIE_IPROC_MSI=y
CONFIG_PCI_HOST_THUNDER_PEM=y
CONFIG_PCI_HOST_THUNDER_ECAM=y
# CONFIG_PCI_FTPCI100 is not set
CONFIG_PCI_HOST_COMMON=y
CONFIG_PCI_HOST_GENERIC=y
# CONFIG_PCIE_HISI_ERR is not set
# CONFIG_PCIE_MEDIATEK is not set
CONFIG_PCIE_MEDIATEK_GEN3=y
CONFIG_PCI_TEGRA=y
CONFIG_PCIE_RCAR_HOST=y
CONFIG_PCIE_RCAR_EP=y
CONFIG_PCIE_ROCKCHIP=y
CONFIG_PCIE_ROCKCHIP_HOST=y
# CONFIG_PCIE_ROCKCHIP_EP is not set
CONFIG_PCI_XGENE=y
CONFIG_PCI_XGENE_MSI=y
# CONFIG_PCIE_XILINX is not set
# CONFIG_PCIE_XILINX_DMA_PL is not set
# CONFIG_PCIE_XILINX_NWL is not set
# CONFIG_PCIE_XILINX_CPM is not set

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

#
# DesignWare-based PCIe controllers
#
CONFIG_PCIE_DW=y
CONFIG_PCIE_DW_HOST=y
CONFIG_PCIE_DW_EP=y
# CONFIG_PCIE_AL is not set
CONFIG_PCI_MESON=y
CONFIG_PCI_IMX6=y
CONFIG_PCI_IMX6_HOST=y
# CONFIG_PCI_IMX6_EP is not set
CONFIG_PCI_LAYERSCAPE=y
# CONFIG_PCI_LAYERSCAPE_EP is not set
CONFIG_PCI_HISI=y
CONFIG_PCIE_KIRIN=y
CONFIG_PCIE_HISI_STB=y
# CONFIG_PCIE_KEEMBAY_HOST is not set
# CONFIG_PCIE_KEEMBAY_EP is not set
CONFIG_PCIE_ARMADA_8K=y
CONFIG_PCIE_TEGRA194=y
CONFIG_PCIE_TEGRA194_HOST=y
# CONFIG_PCIE_TEGRA194_EP is not set
# CONFIG_PCIE_DW_PLAT_HOST is not set
# CONFIG_PCIE_DW_PLAT_EP is not set
CONFIG_PCIE_QCOM_COMMON=y
CONFIG_PCIE_QCOM=y
# CONFIG_PCIE_QCOM_EP is not set
CONFIG_PCIE_RCAR_GEN4=y
CONFIG_PCIE_RCAR_GEN4_HOST=y
CONFIG_PCIE_RCAR_GEN4_EP=y
CONFIG_PCIE_ROCKCHIP_DW=y
CONFIG_PCIE_ROCKCHIP_DW_HOST=y
# CONFIG_PCIE_ROCKCHIP_DW_EP is not set
# CONFIG_PCI_EXYNOS is not set
# CONFIG_PCIE_UNIPHIER is not set
# CONFIG_PCIE_UNIPHIER_EP is not set
# CONFIG_PCI_KEYSTONE_HOST is not set
# CONFIG_PCI_KEYSTONE_EP is not set
CONFIG_PCIE_VISCONTI_HOST=y
# end of DesignWare-based PCIe controllers

#
# Mobiveil-based PCIe controllers
#
CONFIG_PCIE_MOBIVEIL=y
CONFIG_PCIE_MOBIVEIL_HOST=y
CONFIG_PCIE_LAYERSCAPE_GEN4=y
# CONFIG_PCIE_MOBIVEIL_PLAT is not set
# 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_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_HAVE_PWRCTL=y
CONFIG_PCI_PWRCTL=y
CONFIG_PCI_PWRCTL_PWRSEQ=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_I82092 is not set
# CONFIG_RAPIDIO 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_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y

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

CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
CONFIG_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
CONFIG_DEBUG_DEVRES=y
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
CONFIG_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_REGMAP_SOUNDWIRE=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_BRCMSTB_GISB_ARB=y
# CONFIG_MOXTET is not set
CONFIG_HISILICON_LPC=y
# CONFIG_IMX_WEIM is not set
CONFIG_QCOM_EBI2=y
# CONFIG_QCOM_SSC_BLOCK_BUS is not set
CONFIG_STM32_FIREWALL=y
CONFIG_SUN50I_DE2_BUS=y
CONFIG_SUNXI_RSB=y
CONFIG_TEGRA_ACONNECT=y
# CONFIG_TEGRA_GMI is not set
CONFIG_TI_SYSC=y
CONFIG_UNIPHIER_SYSTEM_BUS=y
CONFIG_VEXPRESS_CONFIG=y
CONFIG_FSL_MC_BUS=y
# CONFIG_FSL_MC_UAPI_SUPPORT is not set
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

#
# Cache Drivers
#
# end of Cache Drivers

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

#
# 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
CONFIG_IMX_SCMI_MISC_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 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_RASPBERRYPI_FIRMWARE=y
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_INTEL_STRATIX10_SERVICE=y
CONFIG_INTEL_STRATIX10_RSU=y
CONFIG_MTK_ADSP_IPC=y
CONFIG_SYSFB=y
# CONFIG_SYSFB_SIMPLEFB is not set
CONFIG_TI_SCI_PROTOCOL=y
# CONFIG_TURRIS_MOX_RWTM is not set
# CONFIG_ARM_FFA_TRANSPORT is not set
CONFIG_TEE_BNXT_FW=y
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
# end of EFI (Extensible Firmware Interface) Support

CONFIG_UEFI_CPER=y
CONFIG_UEFI_CPER_ARM=y
# CONFIG_TEE_STMM_EFI is not set
# CONFIG_IMX_DSP is not set
CONFIG_IMX_SCU=y
CONFIG_IMX_SCMI_MISC_DRV=y
CONFIG_MESON_SM=y
CONFIG_ARM_PSCI_FW=y
# CONFIG_ARM_PSCI_CHECKER is not set

#
# Qualcomm firmware drivers
#
CONFIG_QCOM_SCM=y
CONFIG_QCOM_TZMEM=y
# CONFIG_QCOM_TZMEM_MODE_GENERIC is not set
CONFIG_QCOM_TZMEM_MODE_SHMBRIDGE=y
CONFIG_QCOM_QSEECOM=y
CONFIG_QCOM_QSEECOM_UEFISECAPP=y
# 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
#
CONFIG_TEGRA_IVC=y
CONFIG_TEGRA_BPMP=y
# end of Tegra firmware driver

#
# Zynq MPSoC Firmware Drivers
#
CONFIG_ZYNQMP_FIRMWARE=y
# CONFIG_ZYNQMP_FIRMWARE_DEBUG is not set
# end of Zynq MPSoC Firmware Drivers
# end of Firmware Drivers

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_BRCM_U_BOOT is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_OF_PARTS_BCM4908=y
# CONFIG_MTD_OF_PARTS_LINKSYS_NS is not set
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_MTD_PARSER_TRX is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_QCOMSMEM_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_MARVELL=y
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_MXC is not set
# CONFIG_MTD_NAND_SUNXI is not set
# CONFIG_MTD_NAND_HISI504 is not set
CONFIG_MTD_NAND_QCOM=y
# CONFIG_MTD_NAND_MXIC is not set
# CONFIG_MTD_NAND_TEGRA is not set
# CONFIG_MTD_NAND_STM32_FMC2 is not set
# CONFIG_MTD_NAND_MESON 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
# CONFIG_MTD_NAND_ROCKCHIP is not set
# CONFIG_MTD_NAND_RENESAS 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 is not set

#
# 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
# CONFIG_MTD_NAND_ECC_MEDIATEK 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_SPI_HISI_SFC 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_HBMC_AM654=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_OVERLAY is not set
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=y
# CONFIG_ZRAM_DEF_COMP_LZO is not set
CONFIG_ZRAM_DEF_COMP="lzo-rle"
# 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_CDROM_PKTCDVD is not set
CONFIG_ATA_OVER_ETH=y
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_UBLK is not set
CONFIG_BLK_DEV_RNBD=y
CONFIG_BLK_DEV_RNBD_CLIENT=y

#
# 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_APPLE 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
# 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_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_QCOM_COINCELL=y
CONFIG_QCOM_FASTRPC=y
# 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_SENSORS_APDS990X 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 is not set
CONFIG_MISC_RTSX=y
# CONFIG_HISI_HIKEY_USB is not set
# CONFIG_OPEN_DICE is not set
# CONFIG_VCPU_STALL_DETECTOR is not set
CONFIG_TPS6594_ESM=y
CONFIG_TPS6594_PFSM=y
# CONFIG_NSM is not set
# CONFIG_MARVELL_CN10K_DPI 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
# 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_ECHO 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
# 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=y
CONFIG_SCSI_MPT3SAS=y
CONFIG_SCSI_MPT2SAS_MAX_SGE=128
CONFIG_SCSI_MPT3SAS_MAX_SGE=128
# 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_BRCM=y
CONFIG_AHCI_DWC=y
# CONFIG_AHCI_IMX is not set
CONFIG_AHCI_CEVA=y
# CONFIG_AHCI_MTK is not set
CONFIG_AHCI_MVEBU=y
# CONFIG_AHCI_SUNXI is not set
# CONFIG_AHCI_TEGRA is not set
CONFIG_AHCI_XGENE=y
CONFIG_AHCI_QORIQ=y
# CONFIG_SATA_AHCI_SEATTLE is not set
# 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_RCAR=y
# 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_IMX 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_AUTODETECT is not set
CONFIG_MD_BITMAP_FILE=y
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_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_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_DUMMY is not set
CONFIG_ATM_TCP=y
# CONFIG_ATM_LANAI is not set
# CONFIG_ATM_ENI is not set
# CONFIG_ATM_NICSTAR is not set
# CONFIG_ATM_IDT77252 is not set
# CONFIG_ATM_IA is not set
# CONFIG_ATM_FORE200E is not set
# CONFIG_ATM_HE is not set
# CONFIG_ATM_SOLOS is not set
CONFIG_CAIF_DRIVERS=y
CONFIG_CAIF_TTY=y
CONFIG_CAIF_VIRTIO=y

#
# 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_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_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_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
# end of Distributed Switch Architecture drivers

CONFIG_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
CONFIG_NET_VENDOR_ACTIONS=y
# CONFIG_OWL_EMAC 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_ALLWINNER=y
# CONFIG_SUN4I_EMAC is not set
CONFIG_NET_VENDOR_ALTEON=y
# CONFIG_ACENIC is not set
# CONFIG_ALTERA_TSE is not set
CONFIG_NET_VENDOR_AMAZON=y
# CONFIG_ENA_ETHERNET is not set
# CONFIG_NET_VENDOR_AMD is not set
CONFIG_NET_XGENE=y
# CONFIG_NET_XGENE_V2 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_DNET 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_FREESCALE=y
CONFIG_FEC=y
CONFIG_FSL_FMAN=y
CONFIG_DPAA_ERRATUM_A050385=y
# CONFIG_FSL_PQ_MDIO is not set
CONFIG_FSL_XGMAC_MDIO=y
# CONFIG_GIANFAR is not set
CONFIG_FSL_DPAA_ETH=y
CONFIG_FSL_DPAA2_ETH=y
# CONFIG_FSL_DPAA2_ETH_DCB is not set
CONFIG_FSL_DPAA2_PTP_CLOCK=y
# CONFIG_FSL_DPAA2_SWITCH is not set
CONFIG_FSL_ENETC_CORE=y
CONFIG_NXP_ENETC_PF_COMMON=y
CONFIG_FSL_ENETC=y
# CONFIG_NXP_ENETC4 is not set
CONFIG_FSL_ENETC_VF=y
CONFIG_FSL_ENETC_IERB=y
CONFIG_FSL_ENETC_MDIO=y
CONFIG_FSL_ENETC_PTP_CLOCK=y
CONFIG_FSL_ENETC_QOS=y
# CONFIG_NXP_NETC_BLK_CTRL is not set
# CONFIG_NET_VENDOR_FUJITSU is not set
CONFIG_NET_VENDOR_FUNGIBLE=y
# CONFIG_FUN_ETH is not set
CONFIG_NET_VENDOR_GOOGLE=y
CONFIG_GVE=y
CONFIG_NET_VENDOR_HISILICON=y
CONFIG_HIX5HD2_GMAC=y
# CONFIG_HISI_FEMAC is not set
# CONFIG_HIP04_ETH is not set
CONFIG_HNS_MDIO=y
CONFIG_HNS=y
CONFIG_HNS_DSAF=y
CONFIG_HNS_ENET=y
CONFIG_HNS3=y
CONFIG_HNS3_HCLGE=y
# CONFIG_HNS3_DCB is not set
# CONFIG_HNS3_HCLGEVF is not set
CONFIG_HNS3_ENET=y
# CONFIG_HIBMCGE is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=y
CONFIG_E1000=y
CONFIG_E1000E=y
CONFIG_IGB=y
CONFIG_IGB_HWMON=y
CONFIG_IGBVF=y
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_ICE is not set
# CONFIG_FM10K is not set
# CONFIG_IGC is not set
# CONFIG_IDPF is not set
# CONFIG_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_MEDIATEK is not set
CONFIG_NET_VENDOR_MELLANOX=y
CONFIG_MLX4_EN=y
# CONFIG_MLX4_EN_DCB is not set
CONFIG_MLX4_CORE=y
CONFIG_MLX4_DEBUG=y
CONFIG_MLX4_CORE_GEN2=y
CONFIG_MLX5_CORE=y
# CONFIG_MLX5_FPGA is not set
CONFIG_MLX5_CORE_EN=y
CONFIG_MLX5_EN_ARFS=y
CONFIG_MLX5_EN_RXNFC=y
CONFIG_MLX5_MPFS=y
CONFIG_MLX5_ESWITCH=y
CONFIG_MLX5_BRIDGE=y
# CONFIG_MLX5_CLS_ACT is not set
# CONFIG_MLX5_CORE_EN_DCB is not set
# CONFIG_MLX5_CORE_IPOIB is not set
# CONFIG_MLX5_MACSEC is not set
# CONFIG_MLX5_EN_IPSEC is not set
# CONFIG_MLX5_EN_TLS is not set
CONFIG_MLX5_SW_STEERING=y
CONFIG_MLX5_HW_STEERING=y
# CONFIG_MLX5_SF is not set
# CONFIG_MLX5_DPLL is not set
# CONFIG_MLXSW_CORE is not set
# CONFIG_MLXFW is not set
# CONFIG_MLXBF_GIGE is not set
CONFIG_NET_VENDOR_META=y
# 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_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_NETERION 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_OA_TC6 is not set
# CONFIG_NET_VENDOR_PACKET_ENGINES 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_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_HIPPI is not set
CONFIG_QCOM_IPA=y
CONFIG_PHYLINK=y
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
# CONFIG_LED_TRIGGER_PHY is not set
CONFIG_PHYLIB_LEDS=y
CONFIG_FIXED_PHY=y
# CONFIG_SFP is not set

#
# MII PHY device drivers
#
# CONFIG_AIR_EN8811H_PHY is not set
# CONFIG_AMD_PHY is not set
CONFIG_MESON_GXL_PHY=y
# 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_CYGNUS_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_MEDIATEK_GE_PHY is not set
# CONFIG_MEDIATEK_GE_SOC_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 is not set
# CONFIG_QCA807X_PHY is not set
# CONFIG_QSEMI_PHY is not set
CONFIG_REALTEK_PHY=y
# 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 is not set
CONFIG_VITESSE_PHY=y
# CONFIG_XILINX_GMII2RGMII is not set
# CONFIG_MICREL_KS8995MA is not set
# CONFIG_PSE_CONTROLLER is not set
CONFIG_CAN_DEV=y
CONFIG_CAN_VCAN=y
CONFIG_CAN_VXCAN=y
CONFIG_CAN_NETLINK=y
CONFIG_CAN_CALC_BITTIMING=y
CONFIG_CAN_RX_OFFLOAD=y
# CONFIG_CAN_BXCAN is not set
# CONFIG_CAN_CAN327 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_XILINXCAN is not set
# CONFIG_CAN_C_CAN is not set
# CONFIG_CAN_CC770 is not set
# CONFIG_CAN_CTUCANFD_PCI is not set
# CONFIG_CAN_CTUCANFD_PLATFORM is not set
# CONFIG_CAN_ESD_402_PCI is not set
CONFIG_CAN_IFI_CANFD=y
CONFIG_CAN_M_CAN=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_RCAR=y
CONFIG_CAN_RCAR_CANFD=y
# CONFIG_CAN_ROCKCHIP_CANFD 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
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_BUS=y
CONFIG_FWNODE_MDIO=y
CONFIG_OF_MDIO=y
CONFIG_ACPI_MDIO=y
CONFIG_MDIO_DEVRES=y
# CONFIG_MDIO_SUN4I is not set
CONFIG_MDIO_XGENE=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_BCM_IPROC=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_MESON_G12A=y
CONFIG_MDIO_BUS_MUX_MESON_GXL=y
CONFIG_MDIO_BUS_MUX_BCM_IPROC=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
CONFIG_PCS_LYNX=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_PPPOE=y
CONFIG_PPPOE_HASH_BITS_1=y
# CONFIG_PPPOE_HASH_BITS_2 is not set
# CONFIG_PPPOE_HASH_BITS_4 is not set
# CONFIG_PPPOE_HASH_BITS_8 is not set
CONFIG_PPPOE_HASH_BITS=1
CONFIG_PPTP=y
CONFIG_PPPOL2TP=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=y
CONFIG_SLIP=y
CONFIG_SLHC=y
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_CATC=y
CONFIG_USB_KAWETH=y
CONFIG_USB_PEGASUS=y
CONFIG_USB_RTL8150=y
CONFIG_USB_RTL8152=y
CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_HUAWEI_CDC_NCM=y
CONFIG_USB_NET_CDC_MBIM=y
CONFIG_USB_NET_DM9601=y
CONFIG_USB_NET_SR9700=y
CONFIG_USB_NET_SR9800=y
CONFIG_USB_NET_SMSC75XX=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB_NET_GL620A=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
CONFIG_USB_NET_RNDIS_HOST=y
CONFIG_USB_NET_CDC_SUBSET_ENABLE=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_NET_CX82310_ETH=y
CONFIG_USB_NET_KALMIA=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_HSO=y
CONFIG_USB_NET_INT51X1=y
CONFIG_USB_CDC_PHONET=y
CONFIG_USB_IPHETH=y
CONFIG_USB_SIERRA_NET=y
CONFIG_USB_VL600=y
CONFIG_USB_NET_CH9200=y
CONFIG_USB_NET_AQC111=y
CONFIG_USB_RTL8153_ECM=y
CONFIG_WLAN=y
CONFIG_WLAN_VENDOR_ADMTEK=y
# CONFIG_ADM8211 is not set
CONFIG_ATH_COMMON=y
CONFIG_WLAN_VENDOR_ATH=y
# CONFIG_ATH_DEBUG is not set
# CONFIG_ATH5K is not set
# CONFIG_ATH5K_PCI is not set
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_COMMON_DEBUG=y
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=y
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_STATION_STATISTICS is not set
CONFIG_ATH9K_DYNACK=y
# CONFIG_ATH9K_WOW is not set
CONFIG_ATH9K_RFKILL=y
CONFIG_ATH9K_CHANNEL_CONTEXT=y
CONFIG_ATH9K_PCOEM=y
# CONFIG_ATH9K_PCI_NO_EEPROM is not set
CONFIG_ATH9K_HTC=y
CONFIG_ATH9K_HTC_DEBUGFS=y
# CONFIG_ATH9K_HWRNG is not set
CONFIG_ATH9K_COMMON_SPECTRAL=y
CONFIG_CARL9170=y
CONFIG_CARL9170_LEDS=y
# CONFIG_CARL9170_DEBUGFS is not set
CONFIG_CARL9170_WPC=y
CONFIG_CARL9170_HWRNG=y
CONFIG_ATH6KL=y
# CONFIG_ATH6KL_SDIO is not set
CONFIG_ATH6KL_USB=y
# CONFIG_ATH6KL_DEBUG is not set
# CONFIG_ATH6KL_TRACING is not set
CONFIG_AR5523=y
# CONFIG_WIL6210 is not set
CONFIG_ATH10K=y
CONFIG_ATH10K_CE=y
CONFIG_ATH10K_PCI=y
# CONFIG_ATH10K_AHB is not set
CONFIG_ATH10K_SDIO=y
CONFIG_ATH10K_USB=y
CONFIG_ATH10K_SNOC=y
# CONFIG_ATH10K_DEBUG is not set
# CONFIG_ATH10K_DEBUGFS is not set
CONFIG_ATH10K_LEDS=y
# CONFIG_ATH10K_TRACING is not set
CONFIG_WCN36XX=y
# CONFIG_WCN36XX_DEBUGFS is not set
CONFIG_ATH11K=y
CONFIG_ATH11K_AHB=y
CONFIG_ATH11K_PCI=y
# CONFIG_ATH11K_DEBUG is not set
# CONFIG_ATH11K_DEBUGFS is not set
# CONFIG_ATH11K_TRACING is not set
CONFIG_ATH12K=y
# CONFIG_ATH12K_DEBUG is not set
# CONFIG_ATH12K_DEBUGFS is not set
# CONFIG_ATH12K_TRACING is not set
# CONFIG_ATH12K_COREDUMP 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_SLIC_DS26522 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_QCOM_BAM_DMUX is not set
# 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
CONFIG_ISDN=y
CONFIG_ISDN_CAPI=y
CONFIG_MISDN=y
CONFIG_MISDN_DSP=y
CONFIG_MISDN_L1OIP=y

#
# mISDN hardware drivers
#
# CONFIG_MISDN_HFCPCI is not set
# CONFIG_MISDN_HFCMULTI is not set
CONFIG_MISDN_HFCUSB=y
# CONFIG_MISDN_AVMFRITZ is not set
# CONFIG_MISDN_SPEEDFAX is not set
# CONFIG_MISDN_INFINEON is not set
# CONFIG_MISDN_W6692 is not set
# CONFIG_MISDN_NETJET is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_LEDS=y
CONFIG_INPUT_FF_MEMLESS=y
# CONFIG_INPUT_SPARSEKMAP is not set
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
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ADC=y
# CONFIG_KEYBOARD_ADP5588 is not set
# CONFIG_KEYBOARD_ADP5589 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_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX 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_SNVS_PWRKEY=y
# CONFIG_KEYBOARD_IMX is not set
CONFIG_KEYBOARD_IMX_BBM_SCMI=y
CONFIG_KEYBOARD_IMX_SC_KEY=y
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_TEGRA 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_SUN4I_LRADC 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_MT6779 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_HYCON_HY46XX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_ILITEK is not set
# CONFIG_TOUCHSCREEN_IPROC 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_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_RASPBERRYPI_FW is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_TI_AM335X_TSC 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_SUN4I is not set
CONFIG_TOUCHSCREEN_SUR40=y
# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set
# CONFIG_TOUCHSCREEN_SX8654 is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
# CONFIG_TOUCHSCREEN_ZET6223 is not set
# CONFIG_TOUCHSCREEN_ZFORCE is not set
# CONFIG_TOUCHSCREEN_COLIBRI_VF50 is not set
# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set
# CONFIG_TOUCHSCREEN_IQS5XX is not set
# CONFIG_TOUCHSCREEN_IQS7211 is not set
# CONFIG_TOUCHSCREEN_ZINITIX is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX83112B is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
CONFIG_INPUT_BBNSM_PWRKEY=y
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_E3X0_BUTTON is not set
CONFIG_INPUT_PM8941_PWRKEY=y
CONFIG_INPUT_PM8XXX_VIBRATOR=y
# 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_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_INPUT_HISI_POWERKEY=y
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_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_SUN4I_PS2 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_DEPRECATED_OPTIONS=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_MANY_PORTS=y
# CONFIG_SERIAL_8250_PCI1XXXX is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_DWLIB=y
CONFIG_SERIAL_8250_BCM2835AUX=y
CONFIG_SERIAL_8250_FSL=y
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_8250_EM=y
# CONFIG_SERIAL_8250_RT288X is not set
CONFIG_SERIAL_8250_OMAP=y
CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP=y
CONFIG_SERIAL_8250_MT6577=y
CONFIG_SERIAL_8250_UNIPHIER=y
CONFIG_SERIAL_8250_PERICOM=y
CONFIG_SERIAL_8250_TEGRA=y
CONFIG_SERIAL_8250_BCM7271=y
CONFIG_SERIAL_OF_PLATFORM=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_MESON=y
CONFIG_SERIAL_MESON_CONSOLE=y
CONFIG_SERIAL_SAMSUNG=y
CONFIG_SERIAL_SAMSUNG_UARTS=4
CONFIG_SERIAL_SAMSUNG_CONSOLE=y
CONFIG_SERIAL_TEGRA=y
CONFIG_SERIAL_TEGRA_TCU=y
CONFIG_SERIAL_TEGRA_TCU_CONSOLE=y
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
CONFIG_SERIAL_IMX=y
CONFIG_SERIAL_IMX_CONSOLE=y
CONFIG_SERIAL_IMX_EARLYCON=y
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_SH_SCI=y
CONFIG_SERIAL_SH_SCI_NR_UARTS=18
CONFIG_SERIAL_SH_SCI_CONSOLE=y
CONFIG_SERIAL_SH_SCI_EARLYCON=y
CONFIG_SERIAL_SH_SCI_DMA=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_MSM=y
CONFIG_SERIAL_MSM_CONSOLE=y
CONFIG_SERIAL_QCOM_GENI=y
CONFIG_SERIAL_QCOM_GENI_CONSOLE=y
# CONFIG_SERIAL_SIFIVE is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
CONFIG_SERIAL_BCM63XX=y
# CONFIG_SERIAL_BCM63XX_CONSOLE 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
CONFIG_SERIAL_STM32=y
CONFIG_SERIAL_STM32_CONSOLE=y
CONFIG_SERIAL_MVEBU_UART=y
CONFIG_SERIAL_MVEBU_CONSOLE=y
CONFIG_SERIAL_OWL=y
CONFIG_SERIAL_OWL_CONSOLE=y
# CONFIG_SERIAL_NUVOTON_MA35D1 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_NPCM7XX_KCS_IPMI_BMC 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_AIROHA=y
# CONFIG_HW_RANDOM_BA431 is not set
CONFIG_HW_RANDOM_BCM2835=y
CONFIG_HW_RANDOM_BCM74110=y
CONFIG_HW_RANDOM_IPROC_RNG200=y
CONFIG_HW_RANDOM_OMAP=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_HW_RANDOM_HISI=y
CONFIG_HW_RANDOM_HISTB=y
CONFIG_HW_RANDOM_XGENE=y
CONFIG_HW_RANDOM_STM32=y
CONFIG_HW_RANDOM_MESON=y
CONFIG_HW_RANDOM_CAVIUM=y
CONFIG_HW_RANDOM_MTK=y
CONFIG_HW_RANDOM_EXYNOS=y
CONFIG_HW_RANDOM_OPTEE=y
CONFIG_HW_RANDOM_NPCM=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 is not set
CONFIG_HW_RANDOM_ROCKCHIP=y
# CONFIG_APPLICOM is not set
# 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_SYNQUACER 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 is not set
CONFIG_I2C_MUX_REG=y
# CONFIG_I2C_DEMUX_PINCTRL is not set
# CONFIG_I2C_MUX_MLXCPLD is not set
# end of Multiplexer I2C Chip support

CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=y
CONFIG_I2C_ALGOBIT=y

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_AMD_MP2 is not set
# CONFIG_I2C_HIX5HD2 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_ALTERA is not set
CONFIG_I2C_BCM2835=y
CONFIG_I2C_BCM_IPROC=y
CONFIG_I2C_BRCMSTB=y
CONFIG_I2C_CADENCE=y
# CONFIG_I2C_CBUS_GPIO is not set
CONFIG_I2C_DESIGNWARE_CORE=y
# CONFIG_I2C_DESIGNWARE_SLAVE is not set
CONFIG_I2C_DESIGNWARE_PLATFORM=y
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EMEV2 is not set
CONFIG_I2C_EXYNOS5=y
CONFIG_I2C_GPIO=y
# CONFIG_I2C_GPIO_FAULT_INJECTOR is not set
# CONFIG_I2C_HISI is not set
CONFIG_I2C_IMX=y
CONFIG_I2C_IMX_LPI2C=y
CONFIG_I2C_MESON=y
CONFIG_I2C_MT65XX=y
# CONFIG_I2C_MT7621 is not set
CONFIG_I2C_MV64XXX=y
# CONFIG_I2C_NOMADIK is not set
# CONFIG_I2C_NPCM is not set
# CONFIG_I2C_OCORES is not set
CONFIG_I2C_OMAP=y
CONFIG_I2C_OWL=y
CONFIG_I2C_APPLE=y
# CONFIG_I2C_PCA_PLATFORM is not set
CONFIG_I2C_PXA=y
# CONFIG_I2C_PXA_SLAVE is not set
CONFIG_I2C_QCOM_CCI=y
CONFIG_I2C_QCOM_GENI=y
CONFIG_I2C_QUP=y
CONFIG_I2C_RIIC=y
CONFIG_I2C_RK3X=y
CONFIG_I2C_RZV2M=y
CONFIG_I2C_S3C2410=y
CONFIG_I2C_SH_MOBILE=y
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_SPRD is not set
# CONFIG_I2C_STM32F4 is not set
# CONFIG_I2C_STM32F7 is not set
# CONFIG_I2C_SYNQUACER is not set
CONFIG_I2C_TEGRA=y
CONFIG_I2C_TEGRA_BPMP=y
# CONFIG_I2C_UNIPHIER is not set
CONFIG_I2C_UNIPHIER_F=y
CONFIG_I2C_VERSATILE=y
# CONFIG_I2C_THUNDERX is not set
# CONFIG_I2C_XILINX is not set
# CONFIG_I2C_XLP9XX is not set
CONFIG_I2C_RCAR=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_XGENE_SLIMPRO 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_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_AIROHA_SNFI is not set
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AMLOGIC_SPIFC_A1 is not set
# CONFIG_SPI_APPLE is not set
CONFIG_SPI_ARMADA_3700=y
# CONFIG_SPI_AXI_SPI_ENGINE is not set
CONFIG_SPI_BCM2835=y
CONFIG_SPI_BCM2835AUX=y
# CONFIG_SPI_BCM63XX_HSSPI is not set
CONFIG_SPI_BCM_QSPI=y
# CONFIG_SPI_BCMBCA_HSSPI is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_CADENCE is not set
CONFIG_SPI_CADENCE_QUADSPI=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_FSL_LPSPI=y
CONFIG_SPI_FSL_QUADSPI=y
# CONFIG_SPI_HISI_KUNPENG is not set
# CONFIG_SPI_HISI_SFC_V3XX is not set
CONFIG_SPI_NXP_FLEXSPI=y
# CONFIG_SPI_GPIO is not set
CONFIG_SPI_IMX=y
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_FSL_SPI is not set
CONFIG_SPI_FSL_DSPI=y
CONFIG_SPI_LJCA=y
CONFIG_SPI_MESON_SPICC=y
CONFIG_SPI_MESON_SPIFC=y
# CONFIG_SPI_MICROCHIP_CORE is not set
# CONFIG_SPI_MICROCHIP_CORE_QSPI is not set
CONFIG_SPI_MT65XX=y
CONFIG_SPI_MTK_NOR=y
# CONFIG_SPI_WPCM_FIU is not set
# CONFIG_SPI_NPCM_FIU is not set
# CONFIG_SPI_NPCM_PSPI is not set
# CONFIG_SPI_OC_TINY is not set
CONFIG_SPI_OMAP24XX=y
CONFIG_SPI_ORION=y
# CONFIG_SPI_PCI1XXXX is not set
CONFIG_SPI_PL022=y
CONFIG_SPI_ROCKCHIP=y
CONFIG_SPI_ROCKCHIP_SFC=y
CONFIG_SPI_RPCIF=y
CONFIG_SPI_RSPI=y
CONFIG_SPI_RZV2M_CSI=y
CONFIG_SPI_QCOM_QSPI=y
CONFIG_SPI_QUP=y
CONFIG_SPI_QCOM_GENI=y
CONFIG_SPI_S3C64XX=y
# CONFIG_SPI_SC18IS602 is not set
CONFIG_SPI_SH_MSIOF=y
# CONFIG_SPI_SH_HSPI is not set
# CONFIG_SPI_SIFIVE is not set
# CONFIG_SPI_SN_F_OSPI is not set
# CONFIG_SPI_SPRD is not set
# CONFIG_SPI_SPRD_ADI is not set
# CONFIG_SPI_STM32 is not set
# CONFIG_SPI_STM32_QSPI is not set
# CONFIG_SPI_SUN4I is not set
CONFIG_SPI_SUN6I=y
# CONFIG_SPI_SYNQUACER is not set
# CONFIG_SPI_MXIC is not set
CONFIG_SPI_TEGRA210_QUAD=y
CONFIG_SPI_TEGRA114=y
# CONFIG_SPI_TEGRA20_SFLASH is not set
# CONFIG_SPI_TEGRA20_SLINK is not set
# CONFIG_SPI_THUNDERX is not set
# CONFIG_SPI_UNIPHIER is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_XLP is not set
# CONFIG_SPI_ZYNQMP_GQSPI is not set
# 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_SPMI_MSM_PMIC_ARB=y
CONFIG_SPMI_MTK_PMIF=y
# 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

#
# PPS generators support
#

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
CONFIG_PTP_1588_CLOCK_DTE=y
CONFIG_PTP_1588_CLOCK_QORIQ=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
# end of PTP clock 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_APPLE_GPIO 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_KEEMBAY 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_ROCKCHIP=y
# CONFIG_PINCTRL_SCMI is not set
CONFIG_PINCTRL_SINGLE=y
# CONFIG_PINCTRL_STMFX is not set
# CONFIG_PINCTRL_SX150X is not set
CONFIG_PINCTRL_TPS6594=y
CONFIG_PINCTRL_ZYNQMP=y
CONFIG_PINCTRL_OWL=y
CONFIG_PINCTRL_S700=y
CONFIG_PINCTRL_S900=y
CONFIG_PINCTRL_BCM2835=y
CONFIG_PINCTRL_BCM4908=y
CONFIG_PINCTRL_IPROC_GPIO=y
CONFIG_PINCTRL_NS2_MUX=y
# CONFIG_PINCTRL_AS370 is not set
# CONFIG_PINCTRL_BERLIN_BG4CT is not set
CONFIG_PINCTRL_IMX=y
# CONFIG_PINCTRL_IMX_SCMI is not set
CONFIG_PINCTRL_IMX_SCU=y
CONFIG_PINCTRL_IMX8MM=y
CONFIG_PINCTRL_IMX8MN=y
CONFIG_PINCTRL_IMX8MP=y
CONFIG_PINCTRL_IMX8MQ=y
CONFIG_PINCTRL_IMX8QM=y
CONFIG_PINCTRL_IMX8QXP=y
CONFIG_PINCTRL_IMX8DXL=y
CONFIG_PINCTRL_IMX8ULP=y
# CONFIG_PINCTRL_IMX91 is not set
CONFIG_PINCTRL_IMX93=y

#
# MediaTek pinctrl drivers
#
CONFIG_EINT_MTK=y
CONFIG_PINCTRL_MTK=y
CONFIG_PINCTRL_MTK_V2=y
CONFIG_PINCTRL_MTK_MOORE=y
CONFIG_PINCTRL_MTK_PARIS=y
# CONFIG_PINCTRL_AIROHA is not set
CONFIG_PINCTRL_MT2712=y
CONFIG_PINCTRL_MT6765=y
CONFIG_PINCTRL_MT6779=y
CONFIG_PINCTRL_MT6795=y
CONFIG_PINCTRL_MT6797=y
CONFIG_PINCTRL_MT7622=y
CONFIG_PINCTRL_MT7981=y
CONFIG_PINCTRL_MT7986=y
CONFIG_PINCTRL_MT8167=y
CONFIG_PINCTRL_MT8173=y
CONFIG_PINCTRL_MT8183=y
CONFIG_PINCTRL_MT8186=y
CONFIG_PINCTRL_MT8188=y
CONFIG_PINCTRL_MT8192=y
CONFIG_PINCTRL_MT8195=y
CONFIG_PINCTRL_MT8365=y
CONFIG_PINCTRL_MT8516=y
CONFIG_PINCTRL_MT6397=y
# end of MediaTek pinctrl drivers

CONFIG_PINCTRL_MESON=y
CONFIG_PINCTRL_MESON_GXBB=y
CONFIG_PINCTRL_MESON_GXL=y
CONFIG_PINCTRL_MESON8_PMX=y
CONFIG_PINCTRL_MESON_AXG=y
CONFIG_PINCTRL_MESON_AXG_PMX=y
CONFIG_PINCTRL_MESON_G12A=y
CONFIG_PINCTRL_MESON_A1=y
CONFIG_PINCTRL_MESON_S4=y
CONFIG_PINCTRL_AMLOGIC_C3=y
CONFIG_PINCTRL_AMLOGIC_T7=y
CONFIG_PINCTRL_MVEBU=y
CONFIG_PINCTRL_ARMADA_AP806=y
CONFIG_PINCTRL_ARMADA_CP110=y
CONFIG_PINCTRL_AC5=y
CONFIG_PINCTRL_ARMADA_37XX=y
# CONFIG_PINCTRL_NPCM8XX is not set
# CONFIG_PINCTRL_MA35D1 is not set
# CONFIG_PINCTRL_S32G2 is not set
CONFIG_PINCTRL_MSM=y
CONFIG_PINCTRL_IPQ5018=y
CONFIG_PINCTRL_IPQ5332=y
# CONFIG_PINCTRL_IPQ5424 is not set
CONFIG_PINCTRL_IPQ8074=y
CONFIG_PINCTRL_IPQ6018=y
CONFIG_PINCTRL_IPQ9574=y
# CONFIG_PINCTRL_MDM9607 is not set
CONFIG_PINCTRL_MSM8916=y
CONFIG_PINCTRL_MSM8953=y
CONFIG_PINCTRL_MSM8976=y
CONFIG_PINCTRL_MSM8994=y
CONFIG_PINCTRL_MSM8996=y
CONFIG_PINCTRL_MSM8998=y
CONFIG_PINCTRL_QCM2290=y
CONFIG_PINCTRL_QCS404=y
# CONFIG_PINCTRL_QCS615 is not set
# CONFIG_PINCTRL_QCS8300 is not set
CONFIG_PINCTRL_QDF2XXX=y
CONFIG_PINCTRL_QDU1000=y
CONFIG_PINCTRL_SA8775P=y
# CONFIG_PINCTRL_SAR2130P is not set
CONFIG_PINCTRL_SC7180=y
CONFIG_PINCTRL_SC7280=y
CONFIG_PINCTRL_SC8180X=y
CONFIG_PINCTRL_SC8280XP=y
CONFIG_PINCTRL_SDM660=y
CONFIG_PINCTRL_SDM670=y
CONFIG_PINCTRL_SDM845=y
CONFIG_PINCTRL_SDX75=y
CONFIG_PINCTRL_SM4450=y
CONFIG_PINCTRL_SM6115=y
CONFIG_PINCTRL_SM6125=y
CONFIG_PINCTRL_SM6350=y
CONFIG_PINCTRL_SM6375=y
# CONFIG_PINCTRL_SM7150 is not set
CONFIG_PINCTRL_SM8150=y
CONFIG_PINCTRL_SM8250=y
CONFIG_PINCTRL_SM8350=y
CONFIG_PINCTRL_SM8450=y
CONFIG_PINCTRL_SM8550=y
CONFIG_PINCTRL_SM8650=y
# CONFIG_PINCTRL_SM8750 is not set
CONFIG_PINCTRL_X1E80100=y
CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
# CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set
CONFIG_PINCTRL_LPASS_LPI=y
CONFIG_PINCTRL_SC7280_LPASS_LPI=y
# CONFIG_PINCTRL_SM4250_LPASS_LPI is not set
CONFIG_PINCTRL_SM6115_LPASS_LPI=y
CONFIG_PINCTRL_SM8250_LPASS_LPI=y
CONFIG_PINCTRL_SM8350_LPASS_LPI=y
CONFIG_PINCTRL_SM8450_LPASS_LPI=y
CONFIG_PINCTRL_SC8280XP_LPASS_LPI=y
CONFIG_PINCTRL_SM8550_LPASS_LPI=y
CONFIG_PINCTRL_SM8650_LPASS_LPI=y
CONFIG_PINCTRL_RTD=y
CONFIG_PINCTRL_RTD1619B=y
CONFIG_PINCTRL_RTD1319D=y
CONFIG_PINCTRL_RTD1315E=y

#
# Renesas pinctrl drivers
#
CONFIG_PINCTRL_RENESAS=y
CONFIG_PINCTRL_SH_PFC=y
CONFIG_PINCTRL_PFC_R8A77995=y
CONFIG_PINCTRL_PFC_R8A77990=y
CONFIG_PINCTRL_PFC_R8A77951=y
CONFIG_PINCTRL_PFC_R8A77965=y
CONFIG_PINCTRL_PFC_R8A77960=y
CONFIG_PINCTRL_PFC_R8A77961=y
CONFIG_PINCTRL_PFC_R8A779F0=y
CONFIG_PINCTRL_PFC_R8A77980=y
CONFIG_PINCTRL_PFC_R8A77970=y
CONFIG_PINCTRL_PFC_R8A779A0=y
CONFIG_PINCTRL_PFC_R8A779G0=y
CONFIG_PINCTRL_PFC_R8A779H0=y
CONFIG_PINCTRL_RZG2L=y
CONFIG_PINCTRL_PFC_R8A774C0=y
CONFIG_PINCTRL_PFC_R8A774E1=y
CONFIG_PINCTRL_PFC_R8A774A1=y
CONFIG_PINCTRL_PFC_R8A774B1=y
CONFIG_PINCTRL_RZV2M=y
# end of Renesas pinctrl drivers

CONFIG_PINCTRL_SAMSUNG=y
CONFIG_PINCTRL_EXYNOS=y
CONFIG_PINCTRL_EXYNOS_ARM64=y
# CONFIG_PINCTRL_SPRD_SC9860 is not set
CONFIG_PINCTRL_STM32=y
CONFIG_PINCTRL_STM32MP257=y
CONFIG_PINCTRL_SUNXI=y
# CONFIG_PINCTRL_SUN4I_A10 is not set
# CONFIG_PINCTRL_SUN5I is not set
# CONFIG_PINCTRL_SUN6I_A31 is not set
# CONFIG_PINCTRL_SUN6I_A31_R is not set
# CONFIG_PINCTRL_SUN8I_A23 is not set
# CONFIG_PINCTRL_SUN8I_A33 is not set
# CONFIG_PINCTRL_SUN8I_A83T is not set
# CONFIG_PINCTRL_SUN8I_A83T_R is not set
# CONFIG_PINCTRL_SUN8I_A23_R is not set
# CONFIG_PINCTRL_SUN8I_H3 is not set
CONFIG_PINCTRL_SUN8I_H3_R=y
# CONFIG_PINCTRL_SUN8I_V3S is not set
# CONFIG_PINCTRL_SUN9I_A80 is not set
# CONFIG_PINCTRL_SUN9I_A80_R is not set
# CONFIG_PINCTRL_SUN20I_D1 is not set
CONFIG_PINCTRL_SUN50I_A64=y
CONFIG_PINCTRL_SUN50I_A64_R=y
CONFIG_PINCTRL_SUN50I_A100=y
CONFIG_PINCTRL_SUN50I_A100_R=y
CONFIG_PINCTRL_SUN50I_H5=y
CONFIG_PINCTRL_SUN50I_H6=y
CONFIG_PINCTRL_SUN50I_H6_R=y
CONFIG_PINCTRL_SUN50I_H616=y
CONFIG_PINCTRL_SUN50I_H616_R=y
CONFIG_PINCTRL_TEGRA=y
CONFIG_PINCTRL_TEGRA124=y
CONFIG_PINCTRL_TEGRA210=y
CONFIG_PINCTRL_TEGRA194=y
CONFIG_PINCTRL_TEGRA234=y
CONFIG_PINCTRL_TEGRA_XUSB=y
CONFIG_PINCTRL_UNIPHIER=y
# CONFIG_PINCTRL_UNIPHIER_LD4 is not set
# CONFIG_PINCTRL_UNIPHIER_PRO4 is not set
# CONFIG_PINCTRL_UNIPHIER_SLD8 is not set
# CONFIG_PINCTRL_UNIPHIER_PRO5 is not set
# CONFIG_PINCTRL_UNIPHIER_PXS2 is not set
# CONFIG_PINCTRL_UNIPHIER_LD6B is not set
CONFIG_PINCTRL_UNIPHIER_LD11=y
CONFIG_PINCTRL_UNIPHIER_LD20=y
CONFIG_PINCTRL_UNIPHIER_PXS3=y
CONFIG_PINCTRL_UNIPHIER_NX1=y
CONFIG_PINCTRL_VISCONTI=y
CONFIG_PINCTRL_TMPV7700=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=y
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_RASPBERRYPI_EXP=y
CONFIG_GPIO_BCM_XGS_IPROC=y
CONFIG_GPIO_BRCMSTB=y
# CONFIG_GPIO_CADENCE is not set
CONFIG_GPIO_DAVINCI=y
CONFIG_GPIO_DWAPB=y
# CONFIG_GPIO_EIC_SPRD is not set
CONFIG_GPIO_EN7523=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_IMX_SCU=y
# CONFIG_GPIO_LOGICVC is not set
CONFIG_GPIO_MB86S7X=y
CONFIG_GPIO_MPC8XXX=y
CONFIG_GPIO_MVEBU=y
CONFIG_GPIO_MXC=y
# CONFIG_GPIO_NPCM_SGPIO is not set
CONFIG_GPIO_PL061=y
# CONFIG_GPIO_POLARFIRE_SOC is not set
CONFIG_GPIO_RCAR=y
CONFIG_GPIO_ROCKCHIP=y
CONFIG_GPIO_RTD=y
# CONFIG_GPIO_SIFIVE is not set
# CONFIG_GPIO_SPRD is not set
CONFIG_GPIO_SYSCON=y
CONFIG_GPIO_TEGRA=y
CONFIG_GPIO_TEGRA186=y
# CONFIG_GPIO_THUNDERX is not set
CONFIG_GPIO_UNIPHIER=y
CONFIG_GPIO_VF610=y
CONFIG_GPIO_VISCONTI=y
CONFIG_GPIO_WCD934X=y
CONFIG_GPIO_XGENE=y
CONFIG_GPIO_XGENE_SB=y
# CONFIG_GPIO_XILINX is not set
# CONFIG_GPIO_XLP is not set
# CONFIG_GPIO_ZYNQ is not set
CONFIG_GPIO_ZYNQMP_MODEPIN=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 is not set
# CONFIG_GPIO_TPIC2810 is not set
# end of I2C GPIO expanders

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

#
# 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_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_BRCMSTB=y
# CONFIG_POWER_RESET_GPIO is not set
# CONFIG_POWER_RESET_GPIO_RESTART is not set
# CONFIG_POWER_RESET_HISI is not set
# CONFIG_POWER_RESET_LINKSTATION is not set
CONFIG_POWER_RESET_MSM=y
CONFIG_POWER_RESET_QCOM_PON=y
# CONFIG_POWER_RESET_OCELOT_RESET is not set
# CONFIG_POWER_RESET_ODROID_GO_ULTRA_POWEROFF is not set
# 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_SEQUENCING=y
CONFIG_POWER_SEQUENCING_QCOM_WCN=y
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_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_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_MAX77976 is not set
CONFIG_CHARGER_MT6360=y
# CONFIG_CHARGER_MT6370 is not set
# CONFIG_CHARGER_QCOM_SMBB is not set
# CONFIG_BATTERY_PM8916_BMS_VM is not set
# CONFIG_CHARGER_PM8916_LBC 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_UCS1002 is not set
# CONFIG_CHARGER_BD99954 is not set
# CONFIG_BATTERY_UG3105 is not set
# CONFIG_CHARGER_QCOM_SMB2 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_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_SPARX5 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_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_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_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_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_RASPBERRYPI_HWMON=y
CONFIG_SENSORS_SL28CPLD=y
# CONFIG_SENSORS_SBTSI is not set
# CONFIG_SENSORS_SBRMI 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_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_ADC128D818 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
CONFIG_SENSORS_INA2XX=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 is not set
# CONFIG_SENSORS_TMP103 is not set
# CONFIG_SENSORS_TMP108 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_TMP464 is not set
# CONFIG_SENSORS_TMP513 is not set
# CONFIG_SENSORS_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

#
# 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_HISI_THERMAL=y
# CONFIG_IMX_THERMAL is not set
CONFIG_IMX_SC_THERMAL=y
CONFIG_IMX8MM_THERMAL=y
CONFIG_K3_THERMAL=y
# CONFIG_MAX77620_THERMAL is not set
CONFIG_QORIQ_THERMAL=y
CONFIG_SUN8I_THERMAL=y
CONFIG_ROCKCHIP_THERMAL=y
CONFIG_ARMADA_THERMAL=y
# CONFIG_DA9062_THERMAL is not set

#
# Mediatek thermal drivers
#
CONFIG_MTK_THERMAL=y
# CONFIG_MTK_SOC_THERMAL is not set
CONFIG_MTK_LVTS_THERMAL=y
# CONFIG_MTK_LVTS_THERMAL_DEBUGFS is not set
# end of Mediatek thermal drivers

CONFIG_AMLOGIC_THERMAL=y

#
# Broadcom thermal drivers
#
CONFIG_BCM2711_THERMAL=y
CONFIG_BCM2835_THERMAL=y
CONFIG_BRCMSTB_THERMAL=y
CONFIG_BCM_NS_THERMAL=y
CONFIG_BCM_SR_THERMAL=y
# end of Broadcom thermal drivers

#
# Samsung thermal drivers
#
CONFIG_EXYNOS_THERMAL=y
# end of Samsung thermal drivers

#
# STMicroelectronics thermal drivers
#
# CONFIG_ST_THERMAL is not set
# CONFIG_ST_THERMAL_MEMMAP is not set
# end of STMicroelectronics thermal drivers

CONFIG_RCAR_THERMAL=y
CONFIG_RCAR_GEN3_THERMAL=y
CONFIG_RZG2L_THERMAL=y

#
# NVIDIA Tegra thermal drivers
#
CONFIG_TEGRA_SOCTHERM=y
CONFIG_TEGRA_BPMP_THERMAL=y
# end of NVIDIA Tegra thermal drivers

CONFIG_GENERIC_ADC_THERMAL=y

#
# Qualcomm thermal drivers
#
CONFIG_QCOM_TSENS=y
CONFIG_QCOM_SPMI_ADC_TM5=y
CONFIG_QCOM_SPMI_TEMP_ALARM=y
CONFIG_QCOM_LMH=y
# end of Qualcomm thermal drivers

CONFIG_UNIPHIER_THERMAL=y
# CONFIG_SPRD_THERMAL is not set
CONFIG_KHADAS_MCU_FAN_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 is not set
# CONFIG_XILINX_WINDOW_WATCHDOG is not set
# CONFIG_ZIIRAVE_WATCHDOG is not set
CONFIG_SL28CPLD_WATCHDOG=y
# CONFIG_AIROHA_WATCHDOG is not set
CONFIG_ARM_SP805_WATCHDOG=y
CONFIG_ARM_SBSA_WATCHDOG=y
# CONFIG_ARMADA_37XX_WATCHDOG is not set
# CONFIG_CADENCE_WATCHDOG is not set
CONFIG_S3C2410_WATCHDOG=y
CONFIG_DW_WATCHDOG=y
CONFIG_K3_RTI_WATCHDOG=y
CONFIG_SUNXI_WATCHDOG=y
CONFIG_NPCM7XX_WATCHDOG=y
# CONFIG_TWL4030_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_MAX77620_WATCHDOG is not set
CONFIG_IMX2_WDT=y
CONFIG_IMX_SC_WDT=y
CONFIG_IMX7ULP_WDT=y
# CONFIG_RETU_WATCHDOG is not set
# CONFIG_TEGRA_WATCHDOG is not set
CONFIG_QCOM_WDT=y
CONFIG_MESON_GXBB_WATCHDOG=y
CONFIG_MESON_WATCHDOG=y
CONFIG_MEDIATEK_WATCHDOG=y
CONFIG_ARM_SMC_WATCHDOG=y
CONFIG_RENESAS_WDT=y
# CONFIG_RENESAS_RZAWDT is not set
# CONFIG_RENESAS_RZN1WDT is not set
CONFIG_RENESAS_RZG2LWDT=y
# CONFIG_RENESAS_RZV2HWDT is not set
CONFIG_STM32_WATCHDOG=y
CONFIG_UNIPHIER_WATCHDOG=y
CONFIG_RTD119X_WATCHDOG=y
# CONFIG_SPRD_WATCHDOG is not set
CONFIG_PM8916_WATCHDOG=y
# CONFIG_VISCONTI_WATCHDOG is not set
# CONFIG_APPLE_WATCHDOG is not set
# CONFIG_ALIM7101_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_HP_WATCHDOG is not set
CONFIG_MARVELL_GTI_WDT=y
CONFIG_BCM2835_WDT=y
CONFIG_BCM7038_WDT=y
# 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_KEEMBAY_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y
CONFIG_SSB=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
# CONFIG_SSB_PCIHOST is not set
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
# CONFIG_SSB_SDIOHOST is not set
# CONFIG_SSB_DRIVER_GPIO is not set
CONFIG_BCMA_POSSIBLE=y
CONFIG_BCMA=y
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
# CONFIG_BCMA_HOST_PCI is not set
# CONFIG_BCMA_HOST_SOC is not set
# CONFIG_BCMA_DRIVER_PCI is not set
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DRIVER_GPIO is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_ADP5585 is not set
# CONFIG_MFD_ALTERA_A10SR is not set
CONFIG_MFD_ALTERA_SYSMGR=y
# CONFIG_MFD_ACT8945A is not set
# CONFIG_MFD_SUN4I_GPADC 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_AC100 is not set
CONFIG_MFD_AXP20X=y
CONFIG_MFD_AXP20X_I2C=y
CONFIG_MFD_AXP20X_RSB=y
# CONFIG_MFD_CS42L43_I2C is not set
# CONFIG_MFD_CS42L43_SDW is not set
# CONFIG_MFD_MADERA is not set
# CONFIG_MFD_MAX5970 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_EXYNOS_LPASS=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_HI6421_PMIC=y
# CONFIG_MFD_HI6421_SPMI is not set
CONFIG_MFD_HI655X_PMIC=y
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_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_MAX77714 is not set
# CONFIG_MFD_MAX77843 is not set
# CONFIG_MFD_MAX8907 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
CONFIG_MFD_MT6360=y
CONFIG_MFD_MT6370=y
CONFIG_MFD_MT6397=y
# CONFIG_MFD_MENF21BMC is not set
# CONFIG_MFD_OCELOT is not set
# CONFIG_EZX_PCAP 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_PCF50633 is not set
# CONFIG_MFD_QCOM_RPM is not set
CONFIG_MFD_SPMI_PMIC=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_SI476X_CORE is not set
CONFIG_MFD_SIMPLE_MFD_I2C=y
CONFIG_MFD_SL28CPLD=y
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SKY81452 is not set
# CONFIG_MFD_SC27XX_PMIC is not set
CONFIG_RZ_MTU3=y
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_SUN6I_PRCM is not set
CONFIG_MFD_SYSCON=y
CONFIG_MFD_TI_AM335X_TSCADC=y
# CONFIG_MFD_LP3943 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_TI_LMU 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_WL1273_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_LOCHNAGAR 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_STM32_LPTIMER is not set
# CONFIG_MFD_STM32_TIMERS 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_KHADAS_MCU=y
# CONFIG_MFD_QCOM_PM8008 is not set
# CONFIG_MFD_CS40L50_I2C is not set
# CONFIG_MFD_CS40L50_SPI is not set
CONFIG_MFD_VEXPRESS_SYSREG=y
# CONFIG_RAVE_SP_CORE is not set
# CONFIG_MFD_INTEL_M10_BMC_SPI is not set
# CONFIG_MFD_RSMU_I2C is not set
# CONFIG_MFD_RSMU_SPI 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_ANATOP 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_HI655X=y
# CONFIG_REGULATOR_ISL9305 is not set
# CONFIG_REGULATOR_ISL6271A 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_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_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_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_MT6370 is not set
# CONFIG_REGULATOR_MT6380 is not set
CONFIG_REGULATOR_MT6397=y
CONFIG_REGULATOR_PCA9450=y
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_REFGEN is not set
CONFIG_REGULATOR_QCOM_RPMH=y
CONFIG_REGULATOR_QCOM_SMD_RPM=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_RK808=y
CONFIG_REGULATOR_ROHM=y
# CONFIG_REGULATOR_RT4801 is not set
# CONFIG_REGULATOR_RT4803 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_RTQ2134 is not set
# CONFIG_REGULATOR_RTMV20 is not set
# CONFIG_REGULATOR_RTQ6752 is not set
# CONFIG_REGULATOR_RTQ2208 is not set
# CONFIG_REGULATOR_S2MPA01 is not set
CONFIG_REGULATOR_S2MPS11=y
# CONFIG_REGULATOR_S5M8767 is not set
# CONFIG_REGULATOR_SLG51000 is not set
# CONFIG_REGULATOR_STM32_BOOSTER is not set
# CONFIG_REGULATOR_STM32_VREFBUF is not set
# CONFIG_REGULATOR_STM32_PWR is not set
CONFIG_REGULATOR_SUN20I=y
# 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_TPS65219=y
CONFIG_REGULATOR_TPS6594=y
# CONFIG_REGULATOR_TPS6524X is not set
CONFIG_REGULATOR_TWL4030=y
CONFIG_REGULATOR_UNIPHIER=y
CONFIG_REGULATOR_RZG2L_VBCTRL=y
CONFIG_REGULATOR_VCTRL=y
# CONFIG_REGULATOR_VEXPRESS is not set
# CONFIG_REGULATOR_VQMMC_IPQ4019 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_MESON=y
# CONFIG_IR_MESON_TX is not set
# CONFIG_IR_MTK is not set
# CONFIG_IR_NUVOTON is not set
CONFIG_IR_REDRAT3=y
# CONFIG_IR_SERIAL is not set
CONFIG_IR_STREAMZAP=y
CONFIG_IR_SUNXI=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_MESON_AO is not set
CONFIG_CEC_MESON_G12A_AO=y
# CONFIG_CEC_GPIO is not set
# CONFIG_CEC_SAMSUNG_S5P is not set
# CONFIG_CEC_STM32 is not set
# CONFIG_CEC_TEGRA 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_JPEG_HELPER=y
CONFIG_V4L2_H264=y
CONFIG_V4L2_VP9=y
CONFIG_V4L2_MEM2MEM_DEV=y
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_VIDEO_USBTV=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

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

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

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

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

#
# Software defined radio USB devices
#
CONFIG_USB_AIRSPY=y
CONFIG_USB_HACKRF=y
CONFIG_USB_MSI2500=y
# CONFIG_MEDIA_PCI_SUPPORT is not set
CONFIG_RADIO_ADAPTERS=y
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_SAA7706H is not set
CONFIG_RADIO_SHARK=y
CONFIG_RADIO_SHARK2=y
CONFIG_RADIO_SI4713=y
CONFIG_RADIO_TEA575X=y
# CONFIG_RADIO_TEA5764 is not set
# CONFIG_RADIO_TEF6862 is not set
# CONFIG_RADIO_WL1273 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
#
# CONFIG_VIDEO_ALLEGRO_DVT is not set

#
# Amlogic media platform drivers
#
# CONFIG_VIDEO_MESON_GE2D is not set

#
# Amphion drivers
#
CONFIG_VIDEO_AMPHION_VPU=y

#
# Aspeed media platform drivers
#

#
# Atmel media platform drivers
#
# CONFIG_VIDEO_BCM2835_UNICAM is not set

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

#
# Chips&Media media platform drivers
#
# CONFIG_VIDEO_CODA is not set
CONFIG_VIDEO_WAVE_VPU=y
# CONFIG_VIDEO_E5010_JPEG_ENC is not set

#
# Intel media platform drivers
#

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

#
# Mediatek media platform drivers
#
CONFIG_VIDEO_MEDIATEK_JPEG=y
# CONFIG_VIDEO_MEDIATEK_MDP is not set
CONFIG_VIDEO_MEDIATEK_VCODEC_SCP=y
CONFIG_VIDEO_MEDIATEK_VCODEC=y
# CONFIG_VIDEO_MEDIATEK_VPU is not set
# CONFIG_VIDEO_MEDIATEK_MDP3 is not set

#
# Microchip Technology, Inc. media platform drivers
#

#
# Nuvoton media platform drivers
#
# CONFIG_VIDEO_NPCM_VCD_ECE is not set

#
# NVidia media platform drivers
#
# CONFIG_VIDEO_TEGRA_VDE is not set

#
# NXP media platform drivers
#
CONFIG_VIDEO_IMX7_CSI=y
# CONFIG_VIDEO_IMX8MQ_MIPI_CSI2 is not set
CONFIG_VIDEO_IMX_MIPI_CSIS=y
CONFIG_VIDEO_IMX8_ISI=y
CONFIG_VIDEO_IMX8_ISI_M2M=y
# CONFIG_VIDEO_IMX_PXP is not set
# CONFIG_VIDEO_DW100 is not set
CONFIG_VIDEO_IMX8_JPEG=y

#
# Qualcomm media platform drivers
#
CONFIG_VIDEO_QCOM_CAMSS=y
CONFIG_VIDEO_QCOM_VENUS=y

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

#
# Renesas media platform drivers
#
CONFIG_VIDEO_RCAR_CSI2=y
CONFIG_VIDEO_RCAR_ISP=y
CONFIG_VIDEO_RCAR_VIN=y
CONFIG_VIDEO_RZG2L_CSI2=y
CONFIG_VIDEO_RZG2L_CRU=y
CONFIG_VIDEO_RENESAS_FCP=y
CONFIG_VIDEO_RENESAS_FDP1=y
# CONFIG_VIDEO_RENESAS_JPU is not set
CONFIG_VIDEO_RENESAS_VSP1=y
CONFIG_VIDEO_RCAR_DRIF=y

#
# Rockchip media platform drivers
#
# CONFIG_VIDEO_ROCKCHIP_RGA is not set
# CONFIG_VIDEO_ROCKCHIP_ISP1 is not set

#
# Samsung media platform drivers
#
CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=y
# CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS is not set
# CONFIG_VIDEO_SAMSUNG_S5P_G2D is not set
CONFIG_VIDEO_SAMSUNG_S5P_JPEG=y
CONFIG_VIDEO_SAMSUNG_S5P_MFC=y

#
# STMicroelectronics media platform drivers
#
# CONFIG_VIDEO_STM32_DCMI is not set
# CONFIG_VIDEO_STM32_DCMIPP is not set
# CONFIG_VIDEO_STM32_DMA2D is not set

#
# Sunxi media platform drivers
#
# CONFIG_VIDEO_SUN4I_CSI is not set
CONFIG_VIDEO_SUN6I_CSI=y
# CONFIG_VIDEO_SUN6I_MIPI_CSI2 is not set
# CONFIG_VIDEO_SUN8I_A83T_MIPI_CSI2 is not set
# CONFIG_VIDEO_SUN8I_DEINTERLACE is not set
# CONFIG_VIDEO_SUN8I_ROTATE is not set

#
# Texas Instruments drivers
#
# CONFIG_VIDEO_TI_CAL is not set
CONFIG_VIDEO_TI_J721E_CSI2RX=y

#
# Verisilicon media platform drivers
#
CONFIG_VIDEO_HANTRO=y
# CONFIG_VIDEO_HANTRO_HEVC_RFC is not set
CONFIG_VIDEO_HANTRO_IMX8M=y
CONFIG_VIDEO_HANTRO_ROCKCHIP=y
CONFIG_VIDEO_HANTRO_SUNXI=y
CONFIG_VIDEO_HANTRO_STM32MP25=y

#
# 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_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_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_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_OV01A10 is not set
# CONFIG_VIDEO_OV02A10 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_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_OV64A40 is not set
# CONFIG_VIDEO_OV6650 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_S5K5BAF is not set
# CONFIG_VIDEO_S5K6A3 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

#
# Lens drivers
#
# 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
# end of Lens drivers

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

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

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

#
# Video decoders
#
# CONFIG_VIDEO_ADV7180 is not set
# CONFIG_VIDEO_ADV7183 is not set
# CONFIG_VIDEO_ADV748X is not set
# CONFIG_VIDEO_ADV7604 is not set
# CONFIG_VIDEO_ADV7842 is not set
# CONFIG_VIDEO_BT819 is not set
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_ISL7998X is not set
# CONFIG_VIDEO_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_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_TEGRA_HOST1X_CONTEXT_BUS=y
CONFIG_TEGRA_HOST1X=y
CONFIG_TEGRA_HOST1X_FIREWALL=y
CONFIG_DRM=y
CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_DEBUG_MM=y
CONFIG_DRM_KMS_HELPER=y
# CONFIG_DRM_PANIC 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
# 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_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_STATE_HELPER=y
CONFIG_DRM_TTM=y
CONFIG_DRM_EXEC=y
CONFIG_DRM_GPUVM=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_SCHED=y

#
# I2C encoder or helper chips
#
CONFIG_DRM_I2C_CH7006=y
CONFIG_DRM_I2C_SIL164=y
CONFIG_DRM_I2C_NXP_TDA998X=y
# CONFIG_DRM_I2C_NXP_TDA9950 is not set
# end of I2C encoder or helper chips

#
# 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_RADEON is not set
# CONFIG_DRM_AMDGPU is not set
CONFIG_DRM_NOUVEAU=y
CONFIG_NOUVEAU_PLATFORM_DRIVER=y
CONFIG_NOUVEAU_DEBUG=5
CONFIG_NOUVEAU_DEBUG_DEFAULT=3
# CONFIG_NOUVEAU_DEBUG_MMU is not set
# CONFIG_NOUVEAU_DEBUG_PUSH is not set
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
# CONFIG_DRM_NOUVEAU_SVM is not set
# CONFIG_DRM_NOUVEAU_GSP_DEFAULT is not set
# CONFIG_DRM_XE is not set
# CONFIG_DRM_KMB_DISPLAY is not set
CONFIG_DRM_VGEM=y
CONFIG_DRM_VKMS=y
CONFIG_DRM_EXYNOS=y

#
# CRTCs
#
# CONFIG_DRM_EXYNOS_FIMD is not set
CONFIG_DRM_EXYNOS5433_DECON=y
CONFIG_DRM_EXYNOS7_DECON=y
# CONFIG_DRM_EXYNOS_MIXER is not set
# CONFIG_DRM_EXYNOS_VIDI is not set

#
# Encoders and Bridges
#
CONFIG_DRM_EXYNOS_DSI=y
# CONFIG_DRM_EXYNOS_DP is not set
CONFIG_DRM_EXYNOS_HDMI=y
CONFIG_DRM_EXYNOS_MIC=y

#
# Sub-drivers
#
# CONFIG_DRM_EXYNOS_G2D is not set
# CONFIG_DRM_EXYNOS_FIMC is not set
# CONFIG_DRM_EXYNOS_ROTATOR is not set
# CONFIG_DRM_EXYNOS_SCALER is not set
CONFIG_DRM_ROCKCHIP=y
CONFIG_ROCKCHIP_VOP=y
CONFIG_ROCKCHIP_VOP2=y
CONFIG_ROCKCHIP_ANALOGIX_DP=y
CONFIG_ROCKCHIP_CDN_DP=y
CONFIG_ROCKCHIP_DW_HDMI=y
# CONFIG_ROCKCHIP_DW_HDMI_QP is not set
CONFIG_ROCKCHIP_DW_MIPI_DSI=y
CONFIG_ROCKCHIP_INNO_HDMI=y
CONFIG_ROCKCHIP_LVDS=y
# CONFIG_ROCKCHIP_RGB is not set
# CONFIG_ROCKCHIP_RK3066_HDMI is not set
# CONFIG_DRM_VMWGFX is not set
CONFIG_DRM_UDL=y
# CONFIG_DRM_AST is not set
# CONFIG_DRM_MGAG200 is not set
CONFIG_DRM_RCAR_DU=y
CONFIG_DRM_RCAR_USE_CMM=y
CONFIG_DRM_RCAR_CMM=y
CONFIG_DRM_RCAR_DW_HDMI=y
CONFIG_DRM_RCAR_USE_LVDS=y
CONFIG_DRM_RCAR_LVDS=y
CONFIG_DRM_RCAR_USE_MIPI_DSI=y
CONFIG_DRM_RCAR_MIPI_DSI=y
CONFIG_DRM_RCAR_VSP=y
CONFIG_DRM_RCAR_WRITEBACK=y
CONFIG_DRM_RZG2L_DU=y
CONFIG_DRM_RZG2L_MIPI_DSI=y
# CONFIG_DRM_SHMOBILE is not set
CONFIG_DRM_SUN4I=y
CONFIG_DRM_SUN6I_DSI=y
CONFIG_DRM_SUN8I_DW_HDMI=y
CONFIG_DRM_SUN8I_MIXER=y
CONFIG_DRM_SUN8I_TCON_TOP=y
# CONFIG_DRM_QXL is not set
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
CONFIG_DRM_MSM=y
CONFIG_DRM_MSM_GPU_STATE=y
# CONFIG_DRM_MSM_GPU_SUDO is not set
CONFIG_DRM_MSM_MDSS=y
CONFIG_DRM_MSM_MDP4=y
CONFIG_DRM_MSM_MDP5=y
CONFIG_DRM_MSM_DPU=y
CONFIG_DRM_MSM_DP=y
CONFIG_DRM_MSM_DSI=y
CONFIG_DRM_MSM_DSI_28NM_PHY=y
CONFIG_DRM_MSM_DSI_20NM_PHY=y
CONFIG_DRM_MSM_DSI_28NM_8960_PHY=y
CONFIG_DRM_MSM_DSI_14NM_PHY=y
CONFIG_DRM_MSM_DSI_10NM_PHY=y
CONFIG_DRM_MSM_DSI_7NM_PHY=y
CONFIG_DRM_MSM_HDMI=y
CONFIG_DRM_MSM_HDMI_HDCP=y
CONFIG_DRM_TEGRA=y
# CONFIG_DRM_TEGRA_DEBUG is not set
# CONFIG_DRM_TEGRA_STAGING is not set
# CONFIG_DRM_STM 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_TH101MB31UIG002_28A is not set
CONFIG_DRM_PANEL_BOE_TV101WUM_NL6=y
# CONFIG_DRM_PANEL_BOE_TV101WUM_LL2 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_DSI_CM is not set
CONFIG_DRM_PANEL_LVDS=y
# CONFIG_DRM_PANEL_HIMAX_HX83102 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112A is not set
# CONFIG_DRM_PANEL_HIMAX_HX8394 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 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_LG4573 is not set
# CONFIG_DRM_PANEL_LG_SW43408 is not set
# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set
CONFIG_DRM_PANEL_MANTIX_MLAF057WE51=y
# 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_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 is not set
CONFIG_DRM_PANEL_NOVATEK_NT36672E=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_RM68200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM692E5 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM69380 is not set
# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS581VF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS639RQ08 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set
# CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set
# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set
# CONFIG_DRM_PANEL_SAMSUNG_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_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_SOFEF00 is not set
# CONFIG_DRM_PANEL_SEIKO_43WVF1G 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 is not set
CONFIG_DRM_PANEL_EDP=y
CONFIG_DRM_PANEL_SIMPLE=y
# CONFIG_DRM_PANEL_SYNAPTICS_R63353 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_R66451 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM69299 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_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_FSL_LDB=y
# CONFIG_DRM_ITE_IT6263 is not set
# 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_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_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_ANALOGIX_ANX6345 is not set
# CONFIG_DRM_ANALOGIX_ANX78XX is not set
CONFIG_DRM_ANALOGIX_DP=y
CONFIG_DRM_ANALOGIX_ANX7625=y
CONFIG_DRM_I2C_ADV7511=y
CONFIG_DRM_I2C_ADV7511_AUDIO=y
CONFIG_DRM_I2C_ADV7511_CEC=y
# CONFIG_DRM_CDNS_DSI is not set
CONFIG_DRM_CDNS_MHDP8546=y
CONFIG_DRM_CDNS_MHDP8546_J721E=y
CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE=y
CONFIG_DRM_IMX8MP_HDMI_PVI=y
# CONFIG_DRM_IMX8QM_LDB is not set
# CONFIG_DRM_IMX8QXP_LDB is not set
# CONFIG_DRM_IMX8QXP_PIXEL_COMBINER is not set
# CONFIG_DRM_IMX8QXP_PIXEL_LINK is not set
# CONFIG_DRM_IMX8QXP_PIXEL_LINK_TO_DPI is not set
# CONFIG_DRM_IMX93_MIPI_DSI is not set
CONFIG_DRM_DW_HDMI=y
CONFIG_DRM_DW_HDMI_AHB_AUDIO=y
CONFIG_DRM_DW_HDMI_I2S_AUDIO=y
# CONFIG_DRM_DW_HDMI_GP_AUDIO is not set
CONFIG_DRM_DW_HDMI_CEC=y
CONFIG_DRM_DW_MIPI_DSI=y
# end of Display Interface Bridges

CONFIG_DRM_IMX_DCSS=y
# CONFIG_DRM_IMX_LCDC is not set
CONFIG_DRM_V3D=y
CONFIG_DRM_VC4=y
# CONFIG_DRM_VC4_HDMI_CEC is not set
CONFIG_DRM_ETNAVIV=y
CONFIG_DRM_ETNAVIV_THERMAL=y
CONFIG_DRM_HISI_HIBMC=y
CONFIG_DRM_HISI_KIRIN=y
# CONFIG_DRM_LOGICVC is not set
CONFIG_DRM_MEDIATEK=y
CONFIG_DRM_MEDIATEK_DP=y
CONFIG_DRM_MEDIATEK_HDMI=y
CONFIG_DRM_MXS=y
CONFIG_DRM_MXSFB=y
CONFIG_DRM_IMX_LCDIF=y
CONFIG_DRM_MESON=y
CONFIG_DRM_MESON_DW_HDMI=y
CONFIG_DRM_MESON_DW_MIPI_DSI=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_SIMPLEDRM=y
# 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_TINYDRM_ST7586 is not set
# CONFIG_TINYDRM_ST7735R is not set
CONFIG_DRM_PL111=y
CONFIG_DRM_LIMA=y
CONFIG_DRM_PANFROST=y
CONFIG_DRM_PANTHOR=y
CONFIG_DRM_TIDSS=y
CONFIG_DRM_GUD=y
# CONFIG_DRM_SSD130X is not set
# CONFIG_DRM_SPRD is not set
CONFIG_DRM_POWERVR=y
# CONFIG_DRM_WERROR 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_IMX 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_XILINX 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_FIRMWARE_EDID is not set
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_MODE_HELPERS=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_KTD253 is not set
# CONFIG_BACKLIGHT_KTD2801 is not set
# CONFIG_BACKLIGHT_KTZ8866 is not set
CONFIG_BACKLIGHT_PWM=y
# CONFIG_BACKLIGHT_MT6370 is not set
# CONFIG_BACKLIGHT_QCOM_WLED is not set
# 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 is not set
# CONFIG_BACKLIGHT_LV5207LP is not set
# CONFIG_BACKLIGHT_BD6107 is not set
# CONFIG_BACKLIGHT_ARCXCNN is not set
# CONFIG_BACKLIGHT_LED is not set
# end of Backlight & LCD device support

CONFIG_VIDEOMODE_HELPERS=y
CONFIG_HDMI=y

#
# 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_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
# end of Graphics support

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

#
# HD-Audio
#
CONFIG_SND_HDA=y
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_TEGRA=y
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_SCODEC_COMPONENT=y
# CONFIG_SND_HDA_SCODEC_CS35L41_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L41_SPI is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_SPI is not set
# CONFIG_SND_HDA_SCODEC_TAS2781_I2C is not set
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_CODEC_CIRRUS=y
# CONFIG_SND_HDA_CODEC_CS8409 is not set
CONFIG_SND_HDA_CODEC_CONEXANT=y
# CONFIG_SND_HDA_CODEC_SENARYTECH is not set
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set
# CONFIG_SND_HDA_CTL_DEV_ID is not set
# end of HD-Audio

CONFIG_SND_HDA_CORE=y
CONFIG_SND_HDA_ALIGNED_MMIO=y
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_PREALLOC_SIZE=0
CONFIG_SND_INTEL_NHLT=y
CONFIG_SND_INTEL_DSP_CONFIG=y
CONFIG_SND_INTEL_SOUNDWIRE_ACPI=y
CONFIG_SND_SPI=y
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_AUDIO_MIDI_V2=y
CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y
CONFIG_SND_USB_UA101=y
CONFIG_SND_USB_CAIAQ=y
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_USB_6FIRE=y
CONFIG_SND_USB_HIFACE=y
CONFIG_SND_BCD2000=y
CONFIG_SND_USB_LINE6=y
CONFIG_SND_USB_POD=y
CONFIG_SND_USB_PODHD=y
CONFIG_SND_USB_TONEPORT=y
CONFIG_SND_USB_VARIAX=y
# CONFIG_SND_FIREWIRE is not set
# CONFIG_SND_PCMCIA is not set
CONFIG_SND_SOC=y
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
CONFIG_SND_SOC_COMPRESS=y
CONFIG_SND_SOC_TOPOLOGY=y
# CONFIG_SND_SOC_ADI is not set
# CONFIG_SND_SOC_AMD_ACP is not set
# CONFIG_SND_AMD_ACP_CONFIG is not set
CONFIG_SND_SOC_APPLE_MCA=y
# CONFIG_SND_ATMEL_SOC is not set
CONFIG_SND_BCM2835_SOC_I2S=y
# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set
# CONFIG_SND_DESIGNWARE_I2S is not set

#
# SoC Audio for Freescale CPUs
#

#
# Common SoC Audio options for Freescale CPUs:
#
CONFIG_SND_SOC_FSL_ASRC=y
CONFIG_SND_SOC_FSL_SAI=y
# CONFIG_SND_SOC_FSL_MQS is not set
CONFIG_SND_SOC_FSL_AUDMIX=y
CONFIG_SND_SOC_FSL_SSI=y
CONFIG_SND_SOC_FSL_SPDIF=y
CONFIG_SND_SOC_FSL_ESAI=y
CONFIG_SND_SOC_FSL_MICFIL=y
CONFIG_SND_SOC_FSL_EASRC=y
# CONFIG_SND_SOC_FSL_XCVR is not set
# CONFIG_SND_SOC_FSL_AUD2HTX is not set
CONFIG_SND_SOC_FSL_UTILS=y
# CONFIG_SND_SOC_FSL_RPMSG is not set
CONFIG_SND_SOC_IMX_PCM_DMA=y
CONFIG_SND_SOC_IMX_AUDMUX=y
CONFIG_SND_IMX_SOC=y

#
# SoC Audio support for Freescale i.MX boards:
#
# CONFIG_SND_SOC_IMX_ES8328 is not set
CONFIG_SND_SOC_IMX_SGTL5000=y
CONFIG_SND_SOC_FSL_ASOC_CARD=y
CONFIG_SND_SOC_IMX_AUDMIX=y
# CONFIG_SND_SOC_IMX_HDMI is not set
# CONFIG_SND_SOC_IMX_RPMSG is not set
# CONFIG_SND_SOC_IMX_CARD is not set
# end of SoC Audio for Freescale CPUs

# CONFIG_SND_SOC_CHV3_I2S is not set
# CONFIG_SND_I2S_HI6210_I2S is not set
# CONFIG_SND_KIRKWOOD_SOC is not set

#
# SoC Audio for Loongson CPUs
#
# end of SoC Audio for Loongson CPUs

# CONFIG_SND_SOC_IMG is not set
# CONFIG_SND_SOC_INTEL_KEEMBAY is not set
CONFIG_SND_SOC_MEDIATEK=y
# CONFIG_SND_SOC_MT2701 is not set
# CONFIG_SND_SOC_MT6797 is not set
# CONFIG_SND_SOC_MT7986 is not set
# CONFIG_SND_SOC_MT8173 is not set
CONFIG_SND_SOC_MT8183=y
CONFIG_SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A=y
CONFIG_SND_SOC_MT8183_DA7219_MAX98357A=y
# CONFIG_SND_SOC_MT8186 is not set
# CONFIG_SND_SOC_MTK_BTCVSD is not set
# CONFIG_SND_SOC_MT8188 is not set
CONFIG_SND_SOC_MT8192=y
CONFIG_SND_SOC_MT8192_MT6359_RT1015_RT5682=y
CONFIG_SND_SOC_MT8195=y
CONFIG_SND_SOC_MT8195_MT6359=y
# CONFIG_SND_SOC_MT8365 is not set

#
# ASoC support for Amlogic platforms
#
CONFIG_SND_MESON_AIU=y
CONFIG_SND_MESON_AXG_FIFO=y
CONFIG_SND_MESON_AXG_FRDDR=y
CONFIG_SND_MESON_AXG_TODDR=y
CONFIG_SND_MESON_AXG_TDM_FORMATTER=y
CONFIG_SND_MESON_AXG_TDM_INTERFACE=y
CONFIG_SND_MESON_AXG_TDMIN=y
CONFIG_SND_MESON_AXG_TDMOUT=y
CONFIG_SND_MESON_AXG_SOUND_CARD=y
CONFIG_SND_MESON_AXG_SPDIFOUT=y
CONFIG_SND_MESON_AXG_SPDIFIN=y
CONFIG_SND_MESON_AXG_PDM=y
CONFIG_SND_MESON_CARD_UTILS=y
CONFIG_SND_MESON_CODEC_GLUE=y
CONFIG_SND_MESON_GX_SOUND_CARD=y
CONFIG_SND_MESON_G12A_TOACODEC=y
CONFIG_SND_MESON_G12A_TOHDMITX=y
CONFIG_SND_SOC_MESON_T9015=y
# end of ASoC support for Amlogic platforms

CONFIG_SND_SOC_QCOM=y
CONFIG_SND_SOC_LPASS_CPU=y
CONFIG_SND_SOC_LPASS_HDMI=y
CONFIG_SND_SOC_LPASS_PLATFORM=y
CONFIG_SND_SOC_LPASS_CDC_DMA=y
CONFIG_SND_SOC_LPASS_APQ8016=y
CONFIG_SND_SOC_LPASS_SC7180=y
CONFIG_SND_SOC_LPASS_SC7280=y
# CONFIG_SND_SOC_STORM is not set
CONFIG_SND_SOC_APQ8016_SBC=y
CONFIG_SND_SOC_QCOM_COMMON=y
CONFIG_SND_SOC_QCOM_SDW=y
CONFIG_SND_SOC_QDSP6_COMMON=y
CONFIG_SND_SOC_QDSP6_CORE=y
CONFIG_SND_SOC_QDSP6_AFE=y
CONFIG_SND_SOC_QDSP6_AFE_DAI=y
CONFIG_SND_SOC_QDSP6_AFE_CLOCKS=y
CONFIG_SND_SOC_QDSP6_ADM=y
CONFIG_SND_SOC_QDSP6_ROUTING=y
CONFIG_SND_SOC_QDSP6_ASM=y
CONFIG_SND_SOC_QDSP6_ASM_DAI=y
CONFIG_SND_SOC_QDSP6_APM_DAI=y
CONFIG_SND_SOC_QDSP6_APM_LPASS_DAI=y
CONFIG_SND_SOC_QDSP6_APM=y
CONFIG_SND_SOC_QDSP6_PRM_LPASS_CLOCKS=y
CONFIG_SND_SOC_QDSP6_PRM=y
CONFIG_SND_SOC_QDSP6=y
CONFIG_SND_SOC_MSM8996=y
CONFIG_SND_SOC_SDM845=y
CONFIG_SND_SOC_SM8250=y
CONFIG_SND_SOC_SC8280XP=y
CONFIG_SND_SOC_SC7180=y
CONFIG_SND_SOC_SC7280=y
CONFIG_SND_SOC_X1E80100=y

#
# SoC Audio support for Renesas SoCs
#
# CONFIG_SND_SOC_SH4_FSI is not set
CONFIG_SND_SOC_RCAR=y
CONFIG_SND_SOC_RZ=y
# end of SoC Audio support for Renesas SoCs

CONFIG_SND_SOC_ROCKCHIP=y
CONFIG_SND_SOC_ROCKCHIP_I2S=y
CONFIG_SND_SOC_ROCKCHIP_I2S_TDM=y
# CONFIG_SND_SOC_ROCKCHIP_PDM is not set
CONFIG_SND_SOC_ROCKCHIP_SPDIF=y
# CONFIG_SND_SOC_ROCKCHIP_MAX98090 is not set
CONFIG_SND_SOC_ROCKCHIP_RT5645=y
# CONFIG_SND_SOC_RK3288_HDMI_ANALOG is not set
CONFIG_SND_SOC_RK3399_GRU_SOUND=y
CONFIG_SND_SOC_SAMSUNG=y
# CONFIG_SND_SAMSUNG_PCM is not set
# CONFIG_SND_SAMSUNG_SPDIF is not set
# CONFIG_SND_SAMSUNG_I2S is not set
# CONFIG_SND_SOC_SAMSUNG_SMDK_WM8994 is not set
# CONFIG_SND_SOC_SAMSUNG_SMDK_SPDIF is not set
# CONFIG_SND_SOC_SMDK_WM8994_PCM is not set
# CONFIG_SND_SOC_SNOW is not set
# CONFIG_SND_SOC_ODROID is not set
# CONFIG_SND_SOC_ARNDALE is not set
# CONFIG_SND_SOC_SAMSUNG_ARIES_WM8994 is not set
# CONFIG_SND_SOC_SAMSUNG_MIDAS_WM1811 is not set
CONFIG_SND_SOC_SDCA_OPTIONAL=y
CONFIG_SND_SOC_SOF_TOPLEVEL=y
# CONFIG_SND_SOC_SOF_PCI is not set
# CONFIG_SND_SOC_SOF_ACPI is not set
CONFIG_SND_SOC_SOF_OF=y
CONFIG_SND_SOC_SOF_OF_DEV=y
CONFIG_SND_SOC_SOF_COMPRESS=y
# CONFIG_SND_SOC_SOF_DEVELOPER_SUPPORT is not set
CONFIG_SND_SOC_SOF=y
CONFIG_SND_SOC_SOF_IPC3=y
# CONFIG_SND_SOC_SOF_IMX_TOPLEVEL is not set
CONFIG_SND_SOC_SOF_MTK_TOPLEVEL=y
CONFIG_SND_SOC_SOF_MTK_COMMON=y
# CONFIG_SND_SOC_SOF_MT8186 is not set
CONFIG_SND_SOC_SOF_MT8195=y
CONFIG_SND_SOC_SOF_XTENSA=y
# CONFIG_SND_SOC_SPRD is not set

#
# STMicroelectronics STM32 SOC audio support
#
# CONFIG_SND_SOC_STM32_SAI is not set
# CONFIG_SND_SOC_STM32_I2S is not set
# CONFIG_SND_SOC_STM32_SPDIFRX is not set
# end of STMicroelectronics STM32 SOC audio support

#
# Allwinner SoC Audio support
#
# CONFIG_SND_SUN4I_CODEC is not set
CONFIG_SND_SUN8I_CODEC=y
CONFIG_SND_SUN8I_CODEC_ANALOG=y
CONFIG_SND_SUN50I_CODEC_ANALOG=y
CONFIG_SND_SUN4I_I2S=y
CONFIG_SND_SUN4I_SPDIF=y
# CONFIG_SND_SUN50I_DMIC is not set
CONFIG_SND_SUN8I_ADDA_PR_REGMAP=y
# end of Allwinner SoC Audio support

CONFIG_SND_SOC_TEGRA=y
# CONFIG_SND_SOC_TEGRA20_AC97 is not set
# CONFIG_SND_SOC_TEGRA20_DAS is not set
# CONFIG_SND_SOC_TEGRA20_I2S is not set
# CONFIG_SND_SOC_TEGRA20_SPDIF is not set
# CONFIG_SND_SOC_TEGRA30_AHUB is not set
# CONFIG_SND_SOC_TEGRA30_I2S is not set
CONFIG_SND_SOC_TEGRA210_AHUB=y
CONFIG_SND_SOC_TEGRA210_DMIC=y
CONFIG_SND_SOC_TEGRA210_I2S=y
CONFIG_SND_SOC_TEGRA210_OPE=y
CONFIG_SND_SOC_TEGRA186_ASRC=y
CONFIG_SND_SOC_TEGRA186_DSPK=y
CONFIG_SND_SOC_TEGRA210_ADMAIF=y
CONFIG_SND_SOC_TEGRA210_MVC=y
CONFIG_SND_SOC_TEGRA210_SFC=y
CONFIG_SND_SOC_TEGRA210_AMX=y
CONFIG_SND_SOC_TEGRA210_ADX=y
CONFIG_SND_SOC_TEGRA210_MIXER=y
CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD=y
# CONFIG_SND_SOC_TEGRA_RT5631 is not set
# CONFIG_SND_SOC_TEGRA_RT5640 is not set
# CONFIG_SND_SOC_TEGRA_WM8753 is not set
# CONFIG_SND_SOC_TEGRA_WM8903 is not set
# CONFIG_SND_SOC_TEGRA_WM9712 is not set
# CONFIG_SND_SOC_TEGRA_TRIMSLICE is not set
# CONFIG_SND_SOC_TEGRA_ALC5632 is not set
# CONFIG_SND_SOC_TEGRA_MAX98090 is not set
# CONFIG_SND_SOC_TEGRA_MAX98088 is not set
# CONFIG_SND_SOC_TEGRA_RT5677 is not set
# CONFIG_SND_SOC_TEGRA_SGTL5000 is not set

#
# Audio support for Texas Instruments SoCs
#
CONFIG_SND_SOC_TI_EDMA_PCM=y
CONFIG_SND_SOC_TI_SDMA_PCM=y
CONFIG_SND_SOC_TI_UDMA_PCM=y

#
# Texas Instruments DAI support for:
#
CONFIG_SND_SOC_DAVINCI_MCASP=y

#
# Audio support for boards with Texas Instruments SoCs
#
CONFIG_SND_SOC_J721E_EVM=y
# end of Audio support for Texas Instruments SoCs

# CONFIG_SND_SOC_UNIPHIER is not set
# CONFIG_SND_SOC_XILINX_I2S is not set
# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set
# CONFIG_SND_SOC_XILINX_SPDIF is not set
# CONFIG_SND_SOC_XTFPGA_I2S is not set
CONFIG_SND_SOC_I2C_AND_SPI=y

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

CONFIG_SND_SIMPLE_CARD_UTILS=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_SND_AUDIO_GRAPH_CARD=y
CONFIG_SND_AUDIO_GRAPH_CARD2=y
# CONFIG_SND_AUDIO_GRAPH_CARD2_CUSTOM_SAMPLE is not set
# CONFIG_SND_TEST_COMPONENT is not set
CONFIG_SND_VIRTIO=y
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
CONFIG_UHID=y
CONFIG_HID_GENERIC=y

#
# 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_PRODIKEYS=y
CONFIG_HID_CMEDIA=y
CONFIG_HID_CP2112=y
CONFIG_HID_CREATIVE_SB0540=y
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
CONFIG_DRAGONRISE_FF=y
CONFIG_HID_EMS_FF=y
CONFIG_HID_ELAN=y
CONFIG_HID_ELECOM=y
CONFIG_HID_ELO=y
CONFIG_HID_EVISION=y
CONFIG_HID_EZKEY=y
CONFIG_HID_FT260=y
CONFIG_HID_GEMBIRD=y
CONFIG_HID_GFRM=y
CONFIG_HID_GLORIOUS=y
CONFIG_HID_HOLTEK=y
CONFIG_HOLTEK_FF=y
CONFIG_HID_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_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_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_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_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_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
# end of Special HID drivers

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

#
# USB HID support
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y
# end of USB HID 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
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_HISTB is not set
CONFIG_USB_XHCI_MTK=y
# CONFIG_USB_XHCI_MVEBU is not set
CONFIG_USB_XHCI_RCAR=y
CONFIG_USB_XHCI_RZV2M=y
CONFIG_USB_XHCI_TEGRA=y
CONFIG_USB_EHCI_BRCMSTB=y
CONFIG_USB_BRCMSTB=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_NPCM7XX=y
CONFIG_USB_EHCI_HCD_ORION=y
# CONFIG_USB_EHCI_TEGRA is not set
CONFIG_USB_EHCI_EXYNOS=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_EXYNOS=y
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_RENESAS_USBHS_HCD=y
CONFIG_USB_HCD_BCMA=y
CONFIG_USB_HCD_SSB=y
# CONFIG_USB_HCD_TEST_MODE is not set
CONFIG_USB_RENESAS_USBHS=y

#
# 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_CDNS_HOST=y
CONFIG_USB_CDNS3=y
CONFIG_USB_CDNS3_GADGET=y
CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_CDNS3_PCI_WRAP=y
CONFIG_USB_CDNS3_TI=y
CONFIG_USB_CDNS3_IMX=y
CONFIG_USB_CDNSP_PCI=y
CONFIG_USB_CDNSP_GADGET=y
CONFIG_USB_CDNSP_HOST=y
CONFIG_USB_MTU3=y
# CONFIG_USB_MTU3_HOST is not set
# CONFIG_USB_MTU3_GADGET is not set
CONFIG_USB_MTU3_DUAL_ROLE=y
# CONFIG_USB_MTU3_DEBUG is not set
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
#
CONFIG_USB_MUSB_SUNXI=y
# CONFIG_USB_MUSB_MEDIATEK is not set

#
# 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_EXYNOS=y
CONFIG_USB_DWC3_PCI=y
CONFIG_USB_DWC3_HAPS=y
CONFIG_USB_DWC3_KEYSTONE=y
CONFIG_USB_DWC3_MESON_G12A=y
CONFIG_USB_DWC3_OF_SIMPLE=y
CONFIG_USB_DWC3_QCOM=y
CONFIG_USB_DWC3_IMX8MP=y
CONFIG_USB_DWC3_XILINX=y
CONFIG_USB_DWC3_AM62=y
CONFIG_USB_DWC3_RTK=y
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_USB_QCOM_EUD=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_BRCM_USB_PINMAP=y
CONFIG_USB_ONBOARD_DEV=y
# CONFIG_USB_ONBOARD_DEV_USB5744 is not set
CONFIG_USB_ATM=y
CONFIG_USB_SPEEDTOUCH=y
CONFIG_USB_CXACRU=y
CONFIG_USB_UEAGLEATM=y
CONFIG_USB_XUSBATM=y

#
# USB Physical Layer drivers
#
CONFIG_USB_PHY=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_TAHVO_USB=y
CONFIG_TAHVO_USB_HOST_BY_DEFAULT=y
CONFIG_USB_ISP1301=y
CONFIG_USB_MXS_PHY=y
CONFIG_USB_TEGRA_PHY=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_RENESAS_USBHS_UDC=y
CONFIG_USB_RZV2M_USB3DRD=y
CONFIG_USB_RENESAS_USB3=y
# CONFIG_USB_RENESAS_USBF is not set
CONFIG_USB_PXA27X=y
CONFIG_USB_MV_UDC=y
CONFIG_USB_MV_U3D=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_NET2272=y
CONFIG_USB_NET2272_DMA=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_TEGRA_XUDC=y
CONFIG_USB_CDNS2_UDC=y
CONFIG_USB_DUMMY_HCD=y
# end of USB Peripheral Controller

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

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

CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_TYPEC_MT6360=y
CONFIG_TYPEC_TCPCI_MT6370=y
CONFIG_TYPEC_TCPCI_MAXIM=y
CONFIG_TYPEC_FUSB302=y
CONFIG_TYPEC_QCOM_PMIC=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 is not set
CONFIG_TYPEC_MUX_NB7VPQ904M=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
# 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_QCOM_DML=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_ESDHC=y
CONFIG_MMC_SDHCI_OF_DWCMSHC=y
CONFIG_MMC_SDHCI_OF_SPARX5=y
# CONFIG_MMC_SDHCI_OF_MA35D1 is not set
CONFIG_MMC_SDHCI_CADENCE=y
CONFIG_MMC_SDHCI_ESDHC_IMX=y
CONFIG_MMC_SDHCI_TEGRA=y
# CONFIG_MMC_SDHCI_S3C is not set
# CONFIG_MMC_SDHCI_PXAV3 is not set
CONFIG_MMC_SDHCI_F_SDH30=y
# CONFIG_MMC_SDHCI_MILBEAUT is not set
CONFIG_MMC_SDHCI_IPROC=y
# CONFIG_MMC_SDHCI_NPCM is not set
CONFIG_MMC_MESON_GX=y
# CONFIG_MMC_MESON_MX_SDIO is not set
CONFIG_MMC_SDHCI_MSM=y
# CONFIG_MMC_MXC is not set
# CONFIG_MMC_TIFM_SD is not set
CONFIG_MMC_SPI=y
# CONFIG_MMC_SDRICOH_CS is not set
# CONFIG_MMC_SDHCI_SPRD is not set
CONFIG_MMC_TMIO_CORE=y
CONFIG_MMC_SDHI=y
# CONFIG_MMC_SDHI_SYS_DMAC is not set
CONFIG_MMC_SDHI_INTERNAL_DMAC=y
CONFIG_MMC_UNIPHIER=y
# 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_DW_ROCKCHIP=y
# CONFIG_MMC_SH_MMCIF is not set
CONFIG_MMC_VUB300=y
CONFIG_MMC_USHC=y
# CONFIG_MMC_USDHI6ROL0 is not set
CONFIG_MMC_REALTEK_USB=y
CONFIG_MMC_SUNXI=y
CONFIG_MMC_CQHCI=y
CONFIG_MMC_HSQ=y
# CONFIG_MMC_TOSHIBA_PCI is not set
CONFIG_MMC_BCM2835=y
CONFIG_MMC_MTK=y
CONFIG_MMC_SDHCI_BRCMSTB=y
CONFIG_MMC_SDHCI_XENON=y
CONFIG_MMC_SDHCI_AM654=y
CONFIG_MMC_OWL=y
CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFS_BSG=y
# CONFIG_SCSI_UFS_CRYPTO is not set
# 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_SCSI_UFS_QCOM=y
# CONFIG_SCSI_UFS_MEDIATEK is not set
CONFIG_SCSI_UFS_HISI=y
CONFIG_SCSI_UFS_RENESAS=y
CONFIG_SCSI_UFS_TI_J721E=y
CONFIG_SCSI_UFS_EXYNOS=y
# CONFIG_SCSI_UFS_SPRD is not set
CONFIG_MEMSTICK=y
# CONFIG_MEMSTICK_DEBUG is not set

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

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

#
# LED drivers
#
# CONFIG_LEDS_AN30259A is not set
# CONFIG_LEDS_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_SUN50I_A100 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_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_BCM63138=y

#
# Flash and Torch LED drivers
#

#
# RGB LED drivers
#
# CONFIG_LEDS_GROUP_MULTICOLOR is not set
# CONFIG_LEDS_KTD202X is not set
# CONFIG_LEDS_NCP5623 is not set
# CONFIG_LEDS_PWM_MULTICOLOR is not set
CONFIG_LEDS_QCOM_LPG=y
# 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

#
# Simple LED drivers
#
# CONFIG_ACCESSIBILITY is not set
CONFIG_INFINIBAND=y
CONFIG_INFINIBAND_USER_MAD=y
CONFIG_INFINIBAND_USER_ACCESS=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_INFINIBAND_HNS is not set
CONFIG_MLX4_INFINIBAND=y
# CONFIG_MLX5_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_LEGACY_SYSFS=y
# CONFIG_EDAC_DEBUG is not set
CONFIG_EDAC_GHES=y
# CONFIG_EDAC_AL_MC is not set
CONFIG_EDAC_LAYERSCAPE=y
# CONFIG_EDAC_THUNDERX is not set
# CONFIG_EDAC_ALTERA is not set
# CONFIG_EDAC_SYNOPSYS is not set
# CONFIG_EDAC_XGENE is not set
# CONFIG_EDAC_QCOM is not set
# CONFIG_EDAC_DMC520 is not set
# CONFIG_EDAC_ZYNQMP is not set
# CONFIG_EDAC_NPCM is not set
# CONFIG_EDAC_VERSAL 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_BRCMSTB=y
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_PCF85063=y
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_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 is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_IMXDI is not set
CONFIG_RTC_DRV_FSL_FTM_ALARM=y
CONFIG_RTC_DRV_MESON_VRTC=y
CONFIG_RTC_DRV_S3C=y
# CONFIG_RTC_DRV_SH is not set
# CONFIG_RTC_DRV_PL030 is not set
CONFIG_RTC_DRV_PL031=y
CONFIG_RTC_DRV_SUN6I=y
# CONFIG_RTC_DRV_MV is not set
CONFIG_RTC_DRV_ARMADA38X=y
# CONFIG_RTC_DRV_CADENCE is not set
# CONFIG_RTC_DRV_FTRTC010 is not set
CONFIG_RTC_DRV_PM8XXX=y
CONFIG_RTC_DRV_TEGRA=y
# CONFIG_RTC_DRV_MXC is not set
# CONFIG_RTC_DRV_MXC_V2 is not set
CONFIG_RTC_DRV_SNVS=y
CONFIG_RTC_DRV_BBNSM=y
CONFIG_RTC_DRV_IMX_BBM_SCMI=y
CONFIG_RTC_DRV_IMX_SC=y
# CONFIG_RTC_DRV_MT2712 is not set
CONFIG_RTC_DRV_MT6397=y
# CONFIG_RTC_DRV_MT7622 is not set
CONFIG_RTC_DRV_XGENE=y
# CONFIG_RTC_DRV_R7301 is not set
# CONFIG_RTC_DRV_STM32 is not set
CONFIG_RTC_DRV_RTD119X=y
CONFIG_RTC_DRV_TI_K3=y
# CONFIG_RTC_DRV_MA35D1 is not set
# CONFIG_RTC_DRV_RENESAS_RTCA3 is not set

#
# HID Sensor RTC drivers
#
CONFIG_RTC_DRV_HID_SENSOR_TIME=y
# CONFIG_RTC_DRV_GOLDFISH is not set
CONFIG_RTC_DRV_AMLOGIC_A4=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_APPLE_ADMAC=y
# CONFIG_AXI_DMAC is not set
CONFIG_BCM_SBA_RAID=y
CONFIG_DMA_BCM2835=y
CONFIG_DMA_SUN6I=y
# CONFIG_DW_AXI_DMAC is not set
CONFIG_FSL_EDMA=y
# CONFIG_FSL_QDMA is not set
# CONFIG_HISI_DMA is not set
# CONFIG_IMX_DMA is not set
CONFIG_IMX_SDMA=y
# CONFIG_INTEL_IDMA64 is not set
CONFIG_K3_DMA=y
CONFIG_MV_XOR=y
CONFIG_MV_XOR_V2=y
# CONFIG_MXS_DMA is not set
CONFIG_OWL_DMA=y
CONFIG_PL330_DMA=y
# CONFIG_PLX_DMA is not set
# CONFIG_SPRD_DMA is not set
CONFIG_TEGRA186_GPC_DMA=y
CONFIG_TEGRA20_APB_DMA=y
CONFIG_TEGRA210_ADMA=y
# CONFIG_UNIPHIER_MDMAC is not set
# CONFIG_UNIPHIER_XDMAC is not set
# CONFIG_XGENE_DMA is not set
# CONFIG_XILINX_DMA is not set
# CONFIG_XILINX_XDMA is not set
# CONFIG_XILINX_ZYNQMP_DMA is not set
# CONFIG_XILINX_ZYNQMP_DPDMA is not set
# CONFIG_AMD_QDMA is not set
# CONFIG_MTK_HSDMA is not set
# CONFIG_MTK_CQDMA is not set
# CONFIG_MTK_UART_APDMA is not set
CONFIG_QCOM_BAM_DMA=y
CONFIG_QCOM_GPI_DMA=y
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
CONFIG_RENESAS_DMA=y
CONFIG_RCAR_DMAC=y
CONFIG_RENESAS_USB_DMAC=y
CONFIG_RZ_DMAC=y
CONFIG_TI_K3_UDMA=y
CONFIG_TI_K3_UDMA_GLUE_LAYER=y
CONFIG_TI_K3_PSIL=y
# CONFIG_FSL_DPAA2_QDMA is not set
# CONFIG_STM32_DMA is not set
# CONFIG_STM32_MDMA is not set
# CONFIG_STM32_DMA3 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_MOVE_NOTIFY=y
# CONFIG_DMABUF_DEBUG is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_SYSFS_STATS is not set
CONFIG_DMABUF_HEAPS_SYSTEM=y
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_MMAP=y
CONFIG_VFIO_PCI_INTX=y
CONFIG_VFIO_PCI=y
# CONFIG_MLX5_VFIO_PCI is not set
# 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

#
# VFIO support for FSL_MC bus devices
#
# CONFIG_VFIO_FSL_MC is not set
# end of VFIO support for FSL_MC bus 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_VDPA=y
CONFIG_VDPA_SIM=y
CONFIG_VDPA_SIM_NET=y
CONFIG_VDPA_SIM_BLOCK=y
# CONFIG_IFCVF is not set
# CONFIG_MLX5_VDPA_NET 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

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

CONFIG_GREYBUS=y
# CONFIG_GREYBUS_BEAGLEPLAY is not set
CONFIG_GREYBUS_ES2=y
CONFIG_COMEDI=y
# CONFIG_COMEDI_DEBUG is not set
CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
# CONFIG_COMEDI_MISC_DRIVERS is not set
# CONFIG_COMEDI_PCI_DRIVERS is not set
# CONFIG_COMEDI_PCMCIA_DRIVERS 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_8255_SA is not set
# CONFIG_COMEDI_KCOMEDILIB is not set
# CONFIG_COMEDI_TESTS is not set
CONFIG_STAGING=y
# CONFIG_RTL8723BS is not set

#
# IIO staging drivers
#

#
# Accelerometers
#
# CONFIG_ADIS16203 is not set
# CONFIG_ADIS16240 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_MFD_NVEC is not set
CONFIG_STAGING_MEDIA=y
# CONFIG_DVB_AV7110 is not set
CONFIG_VIDEO_MAX96712=y
CONFIG_VIDEO_MESON_VDEC=y
# CONFIG_VIDEO_ROCKCHIP_VDEC is not set

#
# StarFive media platform drivers
#
# CONFIG_VIDEO_SUNXI is not set
# CONFIG_VIDEO_TEGRA is not set
# CONFIG_STAGING_MEDIA_DEPRECATED is not set
# CONFIG_FB_TFT is not set
# CONFIG_MOST_COMPONENTS is not set
# CONFIG_GREYBUS_AUDIO is not set
# CONFIG_GREYBUS_BOOTROM is not set
# CONFIG_GREYBUS_FIRMWARE is not set
CONFIG_GREYBUS_HID=y
# CONFIG_GREYBUS_LOG is not set
# CONFIG_GREYBUS_LOOPBACK is not set
# CONFIG_GREYBUS_POWER is not set
# CONFIG_GREYBUS_RAW is not set
# CONFIG_GREYBUS_VIBRATOR is not set
CONFIG_GREYBUS_BRIDGED_PHY=y
# CONFIG_GREYBUS_GPIO is not set
# CONFIG_GREYBUS_I2C is not set
# CONFIG_GREYBUS_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_BCM_VIDEOCORE=y
CONFIG_BCM2835_VCHIQ=y
CONFIG_VCHIQ_CDEV=y
CONFIG_SND_BCM2835=y
# CONFIG_VIDEO_BCM2835 is not set
# CONFIG_BCM2835_VCHIQ_MMAL is not set
# CONFIG_XIL_AXIS_FIFO is not set
# CONFIG_VME_BUS is not set
# CONFIG_GPIB is not set
# CONFIG_GOLDFISH is not set
# CONFIG_CHROME_PLATFORMS is not set
# CONFIG_CZNIC_PLATFORMS is not set
# CONFIG_MELLANOX_PLATFORM is not set
CONFIG_SURFACE_PLATFORMS=y
# CONFIG_SURFACE_3_POWER_OPREGION is not set
# CONFIG_SURFACE_GPE is not set
# CONFIG_SURFACE_HOTPLUG is not set
# CONFIG_SURFACE_PRO3_BUTTON is not set
# CONFIG_SURFACE_AGGREGATOR is not set
CONFIG_ARM64_PLATFORM_DEVICES=y
# CONFIG_EC_ACER_ASPIRE1 is not set
# CONFIG_EC_LENOVO_YOGA_C630 is not set
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y

#
# Clock driver for ARM Reference designs
#
CONFIG_CLK_ICST=y
CONFIG_CLK_SP810=y
CONFIG_CLK_VEXPRESS_OSC=y
# end of Clock driver for ARM Reference designs

# CONFIG_LMK04832 is not set
CONFIG_COMMON_CLK_APPLE_NCO=y
# CONFIG_COMMON_CLK_MAX77686 is not set
# CONFIG_COMMON_CLK_MAX9485 is not set
CONFIG_COMMON_CLK_RK808=y
CONFIG_COMMON_CLK_HI655X=y
CONFIG_COMMON_CLK_SCMI=y
CONFIG_COMMON_CLK_SCPI=y
# 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=y
CONFIG_COMMON_CLK_EN7523=y
CONFIG_COMMON_CLK_FSL_FLEXSPI=y
CONFIG_COMMON_CLK_FSL_SAI=y
CONFIG_COMMON_CLK_S2MPS11=y
# CONFIG_CLK_TWL is not set
# CONFIG_COMMON_CLK_AXI_CLKGEN is not set
CONFIG_CLK_QORIQ=y
CONFIG_CLK_LS1028A_PLLDIG=y
CONFIG_COMMON_CLK_XGENE=y
# CONFIG_COMMON_CLK_NPCM8XX is not set
CONFIG_COMMON_CLK_PWM=y
CONFIG_COMMON_CLK_RS9_PCIE=y
# CONFIG_COMMON_CLK_SI521XX is not set
CONFIG_COMMON_CLK_VC3=y
CONFIG_COMMON_CLK_VC5=y
# CONFIG_COMMON_CLK_VC7 is not set
CONFIG_COMMON_CLK_BD718XX=y
# CONFIG_COMMON_CLK_FIXED_MMIO is not set
CONFIG_CLK_ACTIONS=y
CONFIG_CLK_OWL_S500=y
CONFIG_CLK_OWL_S700=y
CONFIG_CLK_OWL_S900=y
CONFIG_CLK_BCM2711_DVP=y
CONFIG_CLK_BCM2835=y
CONFIG_CLK_BCM_63XX=y
CONFIG_COMMON_CLK_IPROC=y
CONFIG_CLK_BCM_NS2=y
CONFIG_CLK_BCM_SR=y
CONFIG_CLK_RASPBERRYPI=y
CONFIG_COMMON_CLK_HI3516CV300=y
CONFIG_COMMON_CLK_HI3519=y
CONFIG_COMMON_CLK_HI3559A=y
CONFIG_COMMON_CLK_HI3660=y
CONFIG_COMMON_CLK_HI3670=y
CONFIG_COMMON_CLK_HI3798CV200=y
CONFIG_COMMON_CLK_HI6220=y
CONFIG_RESET_HISI=y
CONFIG_STUB_CLK_HI6220=y
CONFIG_STUB_CLK_HI3660=y
CONFIG_MXC_CLK=y
CONFIG_MXC_CLK_SCU=y
CONFIG_CLK_IMX8MM=y
CONFIG_CLK_IMX8MN=y
CONFIG_CLK_IMX8MP=y
CONFIG_CLK_IMX8MQ=y
CONFIG_CLK_IMX8QXP=y
CONFIG_CLK_IMX8ULP=y
CONFIG_CLK_IMX93=y
# CONFIG_CLK_IMX95_BLK_CTL is not set
CONFIG_TI_SCI_CLK=y
# CONFIG_TI_SCI_CLK_PROBE_FROM_FW is not set
CONFIG_TI_SYSCON_CLK=y

#
# Clock driver for MediaTek SoC
#
CONFIG_COMMON_CLK_MEDIATEK=y
CONFIG_COMMON_CLK_MEDIATEK_FHCTL=y
CONFIG_COMMON_CLK_MT2712=y
# CONFIG_COMMON_CLK_MT2712_BDPSYS is not set
# CONFIG_COMMON_CLK_MT2712_IMGSYS is not set
# CONFIG_COMMON_CLK_MT2712_JPGDECSYS is not set
# CONFIG_COMMON_CLK_MT2712_MFGCFG is not set
# CONFIG_COMMON_CLK_MT2712_MMSYS is not set
# CONFIG_COMMON_CLK_MT2712_VDECSYS is not set
# CONFIG_COMMON_CLK_MT2712_VENCSYS is not set
# CONFIG_COMMON_CLK_MT6735 is not set
CONFIG_COMMON_CLK_MT6765=y
# CONFIG_COMMON_CLK_MT6765_AUDIOSYS is not set
# CONFIG_COMMON_CLK_MT6765_CAMSYS is not set
# CONFIG_COMMON_CLK_MT6765_GCESYS is not set
# CONFIG_COMMON_CLK_MT6765_MMSYS is not set
# CONFIG_COMMON_CLK_MT6765_IMGSYS is not set
# CONFIG_COMMON_CLK_MT6765_VCODECSYS is not set
# CONFIG_COMMON_CLK_MT6765_MFGSYS is not set
# CONFIG_COMMON_CLK_MT6765_MIPI0ASYS is not set
# CONFIG_COMMON_CLK_MT6765_MIPI0BSYS is not set
# CONFIG_COMMON_CLK_MT6765_MIPI1ASYS is not set
# CONFIG_COMMON_CLK_MT6765_MIPI1BSYS is not set
# CONFIG_COMMON_CLK_MT6765_MIPI2ASYS is not set
# CONFIG_COMMON_CLK_MT6765_MIPI2BSYS is not set
CONFIG_COMMON_CLK_MT6779=y
# CONFIG_COMMON_CLK_MT6779_MMSYS is not set
# CONFIG_COMMON_CLK_MT6779_IMGSYS is not set
# CONFIG_COMMON_CLK_MT6779_IPESYS is not set
# CONFIG_COMMON_CLK_MT6779_CAMSYS is not set
# CONFIG_COMMON_CLK_MT6779_VDECSYS is not set
# CONFIG_COMMON_CLK_MT6779_VENCSYS is not set
# CONFIG_COMMON_CLK_MT6779_MFGCFG is not set
# CONFIG_COMMON_CLK_MT6779_AUDSYS is not set
CONFIG_COMMON_CLK_MT6795=y
CONFIG_COMMON_CLK_MT6795_MFGCFG=y
CONFIG_COMMON_CLK_MT6795_MMSYS=y
CONFIG_COMMON_CLK_MT6795_VDECSYS=y
CONFIG_COMMON_CLK_MT6795_VENCSYS=y
CONFIG_COMMON_CLK_MT6797=y
# CONFIG_COMMON_CLK_MT6797_MMSYS is not set
# CONFIG_COMMON_CLK_MT6797_IMGSYS is not set
# CONFIG_COMMON_CLK_MT6797_VDECSYS is not set
# CONFIG_COMMON_CLK_MT6797_VENCSYS is not set
CONFIG_COMMON_CLK_MT7622=y
# CONFIG_COMMON_CLK_MT7622_ETHSYS is not set
# CONFIG_COMMON_CLK_MT7622_HIFSYS is not set
# CONFIG_COMMON_CLK_MT7622_AUDSYS is not set
CONFIG_COMMON_CLK_MT7981=y
CONFIG_COMMON_CLK_MT7981_ETHSYS=y
CONFIG_COMMON_CLK_MT7986=y
CONFIG_COMMON_CLK_MT7986_ETHSYS=y
CONFIG_COMMON_CLK_MT7988=y
CONFIG_COMMON_CLK_MT8167=y
CONFIG_COMMON_CLK_MT8167_AUDSYS=y
CONFIG_COMMON_CLK_MT8167_IMGSYS=y
CONFIG_COMMON_CLK_MT8167_MFGCFG=y
CONFIG_COMMON_CLK_MT8167_MMSYS=y
CONFIG_COMMON_CLK_MT8167_VDECSYS=y
CONFIG_COMMON_CLK_MT8173=y
CONFIG_COMMON_CLK_MT8173_IMGSYS=y
CONFIG_COMMON_CLK_MT8173_MMSYS=y
CONFIG_COMMON_CLK_MT8173_VDECSYS=y
CONFIG_COMMON_CLK_MT8173_VENCSYS=y
CONFIG_COMMON_CLK_MT8183=y
CONFIG_COMMON_CLK_MT8183_AUDIOSYS=y
CONFIG_COMMON_CLK_MT8183_CAMSYS=y
CONFIG_COMMON_CLK_MT8183_IMGSYS=y
CONFIG_COMMON_CLK_MT8183_IPU_CORE0=y
CONFIG_COMMON_CLK_MT8183_IPU_CORE1=y
CONFIG_COMMON_CLK_MT8183_IPU_ADL=y
CONFIG_COMMON_CLK_MT8183_IPU_CONN=y
CONFIG_COMMON_CLK_MT8183_MFGCFG=y
CONFIG_COMMON_CLK_MT8183_MMSYS=y
CONFIG_COMMON_CLK_MT8183_VDECSYS=y
CONFIG_COMMON_CLK_MT8183_VENCSYS=y
CONFIG_COMMON_CLK_MT8186=y
CONFIG_COMMON_CLK_MT8186_CAMSYS=y
CONFIG_COMMON_CLK_MT8186_IMGSYS=y
CONFIG_COMMON_CLK_MT8186_IPESYS=y
CONFIG_COMMON_CLK_MT8186_WPESYS=y
CONFIG_COMMON_CLK_MT8186_IMP_IIC_WRAP=y
CONFIG_COMMON_CLK_MT8186_MCUSYS=y
CONFIG_COMMON_CLK_MT8186_MDPSYS=y
CONFIG_COMMON_CLK_MT8186_MFGCFG=y
CONFIG_COMMON_CLK_MT8186_MMSYS=y
CONFIG_COMMON_CLK_MT8186_VDECSYS=y
CONFIG_COMMON_CLK_MT8186_VENCSYS=y
CONFIG_COMMON_CLK_MT8188=y
CONFIG_COMMON_CLK_MT8188_ADSP_AUDIO26M=y
CONFIG_COMMON_CLK_MT8188_CAMSYS=y
CONFIG_COMMON_CLK_MT8188_IMGSYS=y
CONFIG_COMMON_CLK_MT8188_IMP_IIC_WRAP=y
CONFIG_COMMON_CLK_MT8188_IPESYS=y
CONFIG_COMMON_CLK_MT8188_MFGCFG=y
CONFIG_COMMON_CLK_MT8188_VDECSYS=y
CONFIG_COMMON_CLK_MT8188_VDOSYS=y
CONFIG_COMMON_CLK_MT8188_VENCSYS=y
CONFIG_COMMON_CLK_MT8188_VPPSYS=y
CONFIG_COMMON_CLK_MT8188_WPESYS=y
CONFIG_COMMON_CLK_MT8192=y
CONFIG_COMMON_CLK_MT8192_AUDSYS=y
CONFIG_COMMON_CLK_MT8192_CAMSYS=y
CONFIG_COMMON_CLK_MT8192_IMGSYS=y
CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP=y
CONFIG_COMMON_CLK_MT8192_IPESYS=y
CONFIG_COMMON_CLK_MT8192_MDPSYS=y
CONFIG_COMMON_CLK_MT8192_MFGCFG=y
CONFIG_COMMON_CLK_MT8192_MMSYS=y
CONFIG_COMMON_CLK_MT8192_MSDC=y
CONFIG_COMMON_CLK_MT8192_SCP_ADSP=y
CONFIG_COMMON_CLK_MT8192_VDECSYS=y
CONFIG_COMMON_CLK_MT8192_VENCSYS=y
CONFIG_COMMON_CLK_MT8195=y
CONFIG_COMMON_CLK_MT8195_APUSYS=y
CONFIG_COMMON_CLK_MT8195_IMP_IIC_WRAP=y
CONFIG_COMMON_CLK_MT8195_MFGCFG=y
CONFIG_COMMON_CLK_MT8195_SCP_ADSP=y
CONFIG_COMMON_CLK_MT8195_VDOSYS=y
CONFIG_COMMON_CLK_MT8195_VPPSYS=y
CONFIG_COMMON_CLK_MT8195_CAMSYS=y
CONFIG_COMMON_CLK_MT8195_IMGSYS=y
CONFIG_COMMON_CLK_MT8195_IPESYS=y
CONFIG_COMMON_CLK_MT8195_WPESYS=y
CONFIG_COMMON_CLK_MT8195_VDECSYS=y
CONFIG_COMMON_CLK_MT8195_VENCSYS=y
CONFIG_COMMON_CLK_MT8365=y
CONFIG_COMMON_CLK_MT8365_APU=y
CONFIG_COMMON_CLK_MT8365_CAM=y
CONFIG_COMMON_CLK_MT8365_MFG=y
CONFIG_COMMON_CLK_MT8365_MMSYS=y
CONFIG_COMMON_CLK_MT8365_VDEC=y
CONFIG_COMMON_CLK_MT8365_VENC=y
CONFIG_COMMON_CLK_MT8516=y
# CONFIG_COMMON_CLK_MT8516_AUDSYS is not set
# end of Clock driver for MediaTek SoC

#
# Clock support for Amlogic platforms
#
CONFIG_COMMON_CLK_MESON_REGMAP=y
CONFIG_COMMON_CLK_MESON_DUALDIV=y
CONFIG_COMMON_CLK_MESON_MPLL=y
CONFIG_COMMON_CLK_MESON_PHASE=y
CONFIG_COMMON_CLK_MESON_PLL=y
CONFIG_COMMON_CLK_MESON_SCLK_DIV=y
CONFIG_COMMON_CLK_MESON_VID_PLL_DIV=y
CONFIG_COMMON_CLK_MESON_VCLK=y
CONFIG_COMMON_CLK_MESON_CLKC_UTILS=y
CONFIG_COMMON_CLK_MESON_AO_CLKC=y
CONFIG_COMMON_CLK_MESON_EE_CLKC=y
CONFIG_COMMON_CLK_MESON_CPU_DYNDIV=y
CONFIG_COMMON_CLK_GXBB=y
CONFIG_COMMON_CLK_AXG=y
CONFIG_COMMON_CLK_AXG_AUDIO=y
# CONFIG_COMMON_CLK_A1_PLL is not set
# CONFIG_COMMON_CLK_A1_PERIPHERALS is not set
CONFIG_COMMON_CLK_C3_PLL=y
CONFIG_COMMON_CLK_C3_PERIPHERALS=y
CONFIG_COMMON_CLK_G12A=y
CONFIG_COMMON_CLK_S4_PLL=y
CONFIG_COMMON_CLK_S4_PERIPHERALS=y
# end of Clock support for Amlogic platforms

CONFIG_ARMADA_AP_CP_HELPER=y
CONFIG_ARMADA_37XX_CLK=y
CONFIG_ARMADA_AP806_SYSCON=y
CONFIG_ARMADA_CP110_SYSCON=y
CONFIG_COMMON_CLK_NUVOTON=y
CONFIG_CLK_MA35D1=y
CONFIG_QCOM_GDSC=y
CONFIG_COMMON_CLK_QCOM=y
CONFIG_CLK_X1E80100_CAMCC=y
CONFIG_CLK_X1E80100_DISPCC=y
CONFIG_CLK_X1E80100_GCC=y
CONFIG_CLK_X1E80100_GPUCC=y
CONFIG_CLK_X1E80100_TCSRCC=y
# CONFIG_CLK_QCM2290_GPUCC is not set
CONFIG_QCOM_A53PLL=y
# CONFIG_QCOM_A7PLL is not set
CONFIG_QCOM_CLK_APCS_MSM8916=y
CONFIG_QCOM_CLK_APCC_MSM8996=y
CONFIG_QCOM_CLK_SMD_RPM=y
CONFIG_QCOM_CLK_RPMH=y
CONFIG_IPQ_APSS_PLL=y
CONFIG_IPQ_APSS_6018=y
# CONFIG_IPQ_GCC_4019 is not set
CONFIG_IPQ_GCC_5018=y
CONFIG_IPQ_GCC_5332=y
# CONFIG_IPQ_GCC_5424 is not set
CONFIG_IPQ_GCC_6018=y
CONFIG_IPQ_GCC_8074=y
CONFIG_IPQ_GCC_9574=y
# CONFIG_IPQ_NSSCC_QCA8K is not set
CONFIG_MSM_GCC_8916=y
# CONFIG_MSM_GCC_8917 is not set
# CONFIG_MSM_GCC_8939 is not set
# CONFIG_MSM_GCC_8953 is not set
# CONFIG_MSM_GCC_8976 is not set
CONFIG_MSM_MMCC_8994=y
CONFIG_MSM_GCC_8994=y
CONFIG_MSM_GCC_8996=y
CONFIG_MSM_MMCC_8996=y
CONFIG_MSM_GCC_8998=y
# CONFIG_MSM_GPUCC_8998 is not set
CONFIG_MSM_MMCC_8998=y
CONFIG_QCM_GCC_2290=y
CONFIG_QCM_DISPCC_2290=y
CONFIG_QCS_GCC_404=y
# CONFIG_SA_CAMCC_8775P is not set
# CONFIG_QCS_GCC_8300 is not set
# CONFIG_SC_CAMCC_7180 is not set
# CONFIG_SC_CAMCC_7280 is not set
CONFIG_SC_CAMCC_8280XP=y
# CONFIG_SA_DISPCC_8775P is not set
# CONFIG_SC_DISPCC_7180 is not set
CONFIG_SC_DISPCC_7280=y
CONFIG_SC_DISPCC_8280XP=y
CONFIG_SA_GCC_8775P=y
CONFIG_SA_GPUCC_8775P=y
# CONFIG_SAR_GCC_2130P is not set
# CONFIG_SAR_GPUCC_2130P is not set
CONFIG_SC_GCC_7180=y
CONFIG_SC_GCC_7280=y
CONFIG_SC_GCC_8180X=y
CONFIG_SC_GCC_8280XP=y
# CONFIG_SC_GPUCC_7180 is not set
CONFIG_SC_GPUCC_7280=y
CONFIG_SC_GPUCC_8280XP=y
# CONFIG_SC_LPASSCC_7280 is not set
CONFIG_SC_LPASSCC_8280XP=y
# CONFIG_SC_LPASS_CORECC_7180 is not set
# CONFIG_SC_LPASS_CORECC_7280 is not set
# CONFIG_SC_VIDEOCC_7180 is not set
# CONFIG_SC_VIDEOCC_7280 is not set
CONFIG_SDM_CAMCC_845=y
# CONFIG_SDM_GCC_660 is not set
# CONFIG_SDM_MMCC_660 is not set
# CONFIG_SDM_GPUCC_660 is not set
# CONFIG_QCS_TURING_404 is not set
# CONFIG_QCS_Q6SSTOP_404 is not set
CONFIG_QDU_GCC_1000=y
# CONFIG_QDU_ECPRICC_1000 is not set
CONFIG_SDM_GCC_845=y
CONFIG_SDM_GPUCC_845=y
CONFIG_SDM_VIDEOCC_845=y
CONFIG_SDM_DISPCC_845=y
CONFIG_SDM_LPASSCC_845=y
CONFIG_SDX_GCC_75=y
# CONFIG_SM_CAMCC_4450 is not set
# CONFIG_SM_CAMCC_6350 is not set
# CONFIG_SM_CAMCC_7150 is not set
# CONFIG_SM_CAMCC_8150 is not set
CONFIG_SM_CAMCC_8250=y
# CONFIG_SM_CAMCC_8450 is not set
# CONFIG_SM_CAMCC_8550 is not set
# CONFIG_SM_CAMCC_8650 is not set
# CONFIG_SM_DISPCC_4450 is not set
CONFIG_SM_DISPCC_6115=y
CONFIG_SM_DISPCC_8250=y
CONFIG_SM_DISPCC_8450=y
CONFIG_SM_DISPCC_8550=y
CONFIG_SM_GCC_4450=y
CONFIG_SM_GCC_6115=y
# CONFIG_SM_GCC_6125 is not set
# CONFIG_SM_GCC_6350 is not set
# CONFIG_SM_GCC_6375 is not set
# CONFIG_SM_GCC_7150 is not set
CONFIG_SM_GCC_8150=y
CONFIG_SM_GCC_8250=y
CONFIG_SM_GCC_8350=y
CONFIG_SM_GCC_8450=y
CONFIG_SM_GCC_8550=y
CONFIG_SM_GCC_8650=y
# CONFIG_SM_GPUCC_4450 is not set
CONFIG_SM_GPUCC_6115=y
# CONFIG_SM_GPUCC_6125 is not set
# CONFIG_SM_GPUCC_6375 is not set
# CONFIG_SM_GPUCC_6350 is not set
CONFIG_SM_GPUCC_8150=y
CONFIG_SM_GPUCC_8250=y
CONFIG_SM_GPUCC_8350=y
CONFIG_SM_GPUCC_8450=y
CONFIG_SM_GPUCC_8550=y
CONFIG_SM_GPUCC_8650=y
CONFIG_SM_TCSRCC_8550=y
CONFIG_SM_TCSRCC_8650=y
# CONFIG_SA_VIDEOCC_8775P is not set
# CONFIG_SM_VIDEOCC_7150 is not set
# CONFIG_SM_VIDEOCC_8150 is not set
CONFIG_SM_VIDEOCC_8250=y
# CONFIG_SM_VIDEOCC_8350 is not set
# CONFIG_SM_VIDEOCC_8550 is not set
# CONFIG_SPMI_PMIC_CLKDIV is not set
CONFIG_QCOM_HFPLL=y
# CONFIG_KPSS_XCC is not set
CONFIG_CLK_GFM_LPASS_SM8250=y
# CONFIG_SM_VIDEOCC_8450 is not set
CONFIG_CLK_RENESAS=y
CONFIG_CLK_R8A774A1=y
CONFIG_CLK_R8A774B1=y
CONFIG_CLK_R8A774C0=y
CONFIG_CLK_R8A774E1=y
CONFIG_CLK_R8A7795=y
CONFIG_CLK_R8A77960=y
CONFIG_CLK_R8A77961=y
CONFIG_CLK_R8A77965=y
CONFIG_CLK_R8A77970=y
CONFIG_CLK_R8A77980=y
CONFIG_CLK_R8A77990=y
CONFIG_CLK_R8A77995=y
CONFIG_CLK_R8A779A0=y
CONFIG_CLK_R8A779F0=y
CONFIG_CLK_R8A779G0=y
CONFIG_CLK_R8A779H0=y
CONFIG_CLK_R9A07G043=y
CONFIG_CLK_R9A07G044=y
CONFIG_CLK_R9A07G054=y
CONFIG_CLK_R9A08G045=y
CONFIG_CLK_R9A09G011=y
CONFIG_CLK_R9A09G057=y
CONFIG_CLK_RCAR_CPG_LIB=y
CONFIG_CLK_RCAR_GEN3_CPG=y
CONFIG_CLK_RCAR_GEN4_CPG=y
CONFIG_CLK_RCAR_USB2_CLOCK_SEL=y
CONFIG_CLK_RZG2L=y
CONFIG_CLK_RZV2H=y
# CONFIG_CLK_RENESAS_VBATTB is not set
CONFIG_CLK_RENESAS_CPG_MSSR=y
CONFIG_CLK_RENESAS_DIV6=y
CONFIG_COMMON_CLK_ROCKCHIP=y
CONFIG_CLK_PX30=y
CONFIG_CLK_RK3308=y
CONFIG_CLK_RK3328=y
CONFIG_CLK_RK3368=y
CONFIG_CLK_RK3399=y
CONFIG_CLK_RK3568=y
CONFIG_CLK_RK3576=y
CONFIG_CLK_RK3588=y
CONFIG_COMMON_CLK_SAMSUNG=y
CONFIG_EXYNOS_ARM64_COMMON_CLK=y
CONFIG_EXYNOS_AUDSS_CLK_CON=y
CONFIG_EXYNOS_CLKOUT=y
CONFIG_TESLA_FSD_COMMON_CLK=y
CONFIG_CLK_INTEL_SOCFPGA=y
CONFIG_CLK_INTEL_SOCFPGA64=y
CONFIG_SPRD_COMMON_CLK=y
CONFIG_SPRD_SC9860_CLK=y
CONFIG_SPRD_SC9863A_CLK=y
CONFIG_SPRD_UMS512_CLK=y
CONFIG_SUNXI_CCU=y
CONFIG_SUN50I_A64_CCU=y
CONFIG_SUN50I_A100_CCU=y
CONFIG_SUN50I_A100_R_CCU=y
CONFIG_SUN50I_H6_CCU=y
CONFIG_SUN50I_H616_CCU=y
CONFIG_SUN50I_H6_R_CCU=y
CONFIG_SUN6I_RTC_CCU=y
CONFIG_SUN8I_H3_CCU=y
CONFIG_SUN8I_DE2_CCU=y
CONFIG_SUN8I_R_CCU=y
CONFIG_CLK_TEGRA_BPMP=y
CONFIG_TEGRA_CLK_DFLL=y
CONFIG_COMMON_CLK_STM32MP=y
CONFIG_COMMON_CLK_STM32MP257=y
CONFIG_CLK_UNIPHIER=y
CONFIG_COMMON_CLK_VISCONTI=y
# CONFIG_XILINX_VCU is not set
# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set
CONFIG_COMMON_CLK_ZYNQMP=y
CONFIG_HWSPINLOCK=y
# CONFIG_HWSPINLOCK_OMAP is not set
CONFIG_HWSPINLOCK_QCOM=y
# CONFIG_HWSPINLOCK_SPRD is not set
# CONFIG_HWSPINLOCK_SUN6I is not set

#
# Clock Source drivers
#
CONFIG_TIMER_OF=y
CONFIG_TIMER_ACPI=y
CONFIG_TIMER_PROBE=y
CONFIG_CLKSRC_MMIO=y
CONFIG_OMAP_DM_TIMER=y
CONFIG_DW_APB_TIMER=y
CONFIG_DW_APB_TIMER_OF=y
CONFIG_ROCKCHIP_TIMER=y
CONFIG_OWL_TIMER=y
CONFIG_SUN4I_TIMER=y
CONFIG_TEGRA_TIMER=y
CONFIG_TEGRA186_TIMER=y
CONFIG_NPCM7XX_TIMER=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_SUN50I_ERRATUM_UNKNOWN1=y
CONFIG_ARM_TIMER_SP804=y
CONFIG_CLKSRC_EXYNOS_MCT=y
CONFIG_SYS_SUPPORTS_SH_CMT=y
CONFIG_MTK_TIMER=y
CONFIG_MTK_CPUX_TIMER=y
CONFIG_SPRD_TIMER=y
CONFIG_SYS_SUPPORTS_SH_TMU=y
CONFIG_SH_TIMER_CMT=y
CONFIG_RENESAS_OSTM=y
CONFIG_SH_TIMER_TMU=y
CONFIG_TIMER_IMX_SYS_CTR=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_IMX_MBOX=y
CONFIG_PLATFORM_MHU=y
# CONFIG_PL320_MBOX is not set
# CONFIG_ARMADA_37XX_RWTM_MBOX is not set
CONFIG_OMAP2PLUS_MBOX=y
# CONFIG_ROCKCHIP_MBOX is not set
CONFIG_PCC=y
# CONFIG_ALTERA_MBOX is not set
CONFIG_BCM2835_MBOX=y
CONFIG_TI_MESSAGE_MANAGER=y
CONFIG_HI3660_MBOX=y
CONFIG_HI6220_MBOX=y
# CONFIG_MAILBOX_TEST is not set
CONFIG_QCOM_APCS_IPC=y
CONFIG_TEGRA_HSP_MBOX=y
# CONFIG_XGENE_SLIMPRO_MBOX is not set
# CONFIG_BCM_PDC_MBOX is not set
CONFIG_BCM_FLEXRM_MBOX=y
CONFIG_MTK_ADSP_MBOX=y
CONFIG_MTK_CMDQ_MBOX=y
CONFIG_ZYNQMP_IPI_MBOX=y
CONFIG_SUN6I_MSGBOX=y
# CONFIG_SPRD_MBOX is not set
# CONFIG_QCOM_CPUCP_MBOX is not set
CONFIG_QCOM_IPCC=y
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_LPAE_SELFTEST is not set
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_IOMMUFD_DRIVER_CORE=y
CONFIG_IOMMUFD=y
# CONFIG_IOMMUFD_VFIO_CONTAINER is not set
# CONFIG_IOMMUFD_TEST is not set
CONFIG_ROCKCHIP_IOMMU=y
# CONFIG_SUN50I_IOMMU is not set
CONFIG_TEGRA_IOMMU_SMMU=y
# CONFIG_EXYNOS_IOMMU is not set
# CONFIG_IPMMU_VMSA is not set
CONFIG_APPLE_DART=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_QCOM=y
# CONFIG_ARM_SMMU_QCOM_DEBUG is not set
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_MTK_IOMMU=y
CONFIG_QCOM_IOMMU=y
# CONFIG_VIRTIO_IOMMU is not set
# CONFIG_SPRD_IOMMU is not set

#
# Remoteproc drivers
#
CONFIG_REMOTEPROC=y
# CONFIG_REMOTEPROC_CDEV is not set
CONFIG_IMX_REMOTEPROC=y
# CONFIG_IMX_DSP_REMOTEPROC is not set
CONFIG_MTK_SCP=y
CONFIG_PRU_REMOTEPROC=y
CONFIG_QCOM_PIL_INFO=y
CONFIG_QCOM_RPROC_COMMON=y
CONFIG_QCOM_Q6V5_COMMON=y
CONFIG_QCOM_Q6V5_ADSP=y
CONFIG_QCOM_Q6V5_MSS=y
CONFIG_QCOM_Q6V5_PAS=y
# CONFIG_QCOM_Q6V5_WCSS is not set
CONFIG_QCOM_SYSMON=y
CONFIG_QCOM_WCNSS_PIL=y
# CONFIG_RCAR_REMOTEPROC is not set
# CONFIG_STM32_RPROC is not set
CONFIG_TI_K3_DSP_REMOTEPROC=y
# CONFIG_TI_K3_M4_REMOTEPROC is not set
CONFIG_TI_K3_R5_REMOTEPROC=y
# CONFIG_XLNX_R5_REMOTEPROC 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_MTK_SCP=y
CONFIG_RPMSG_QCOM_GLINK=y
CONFIG_RPMSG_QCOM_GLINK_RPM=y
CONFIG_RPMSG_QCOM_GLINK_SMEM=y
CONFIG_RPMSG_QCOM_SMD=y
CONFIG_RPMSG_VIRTIO=y
# end of Rpmsg drivers

CONFIG_SOUNDWIRE=y

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

#
# SOC (System On Chip) specific Drivers
#

#
# Amlogic SoC drivers
#
CONFIG_MESON_CANVAS=y
CONFIG_MESON_CLK_MEASURE=y
CONFIG_MESON_GX_SOCINFO=y
# end of Amlogic SoC drivers

#
# Apple SoC drivers
#
CONFIG_APPLE_MAILBOX=y
CONFIG_APPLE_RTKIT=y
CONFIG_APPLE_SART=y
# end of Apple SoC drivers

#
# Broadcom SoC drivers
#
CONFIG_SOC_BRCMSTB=y
# end of Broadcom SoC drivers

#
# NXP/Freescale QorIQ SoC drivers
#
CONFIG_FSL_DPAA=y
# CONFIG_FSL_DPAA_CHECKING is not set
# CONFIG_FSL_BMAN_TEST is not set
# CONFIG_FSL_QMAN_TEST is not set
# CONFIG_QUICC_ENGINE is not set
CONFIG_FSL_GUTS=y
CONFIG_FSL_MC_DPIO=y
CONFIG_DPAA2_CONSOLE=y
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

#
# Hisilicon SoC drivers
#
# CONFIG_KUNPENG_HCCS is not set
# end of Hisilicon SoC drivers

#
# i.MX SoC drivers
#
CONFIG_SOC_IMX8M=y
CONFIG_SOC_IMX9=y
# 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

#
# MediaTek SoC drivers
#
CONFIG_MTK_CMDQ=y
CONFIG_MTK_DEVAPC=y
# CONFIG_MTK_DVFSRC is not set
CONFIG_MTK_INFRACFG=y
CONFIG_MTK_PMIC_WRAP=y
CONFIG_MTK_REGULATOR_COUPLER=y
CONFIG_MTK_MMSYS=y
CONFIG_MTK_SVS=y
CONFIG_MTK_SOCINFO=y
# end of MediaTek SoC drivers

# CONFIG_WPCM450_SOC is not set

#
# Qualcomm SoC drivers
#
CONFIG_QCOM_AOSS_QMP=y
CONFIG_QCOM_COMMAND_DB=y
CONFIG_QCOM_GENI_SE=y
# CONFIG_QCOM_GSBI is not set
CONFIG_QCOM_LLCC=y
CONFIG_QCOM_KRYO_L2_ACCESSORS=y
CONFIG_QCOM_MDT_LOADER=y
CONFIG_QCOM_OCMEM=y
CONFIG_QCOM_PD_MAPPER=y
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_RAMP_CTRL is not set
CONFIG_QCOM_RMTFS_MEM=y
# CONFIG_QCOM_RPM_MASTER_STATS is not set
CONFIG_QCOM_RPMH=y
CONFIG_QCOM_SMEM=y
CONFIG_QCOM_SMD_RPM=y
CONFIG_QCOM_SMEM_STATE=y
CONFIG_QCOM_SMP2P=y
CONFIG_QCOM_SMSM=y
CONFIG_QCOM_SOCINFO=y
CONFIG_QCOM_SPM=y
CONFIG_QCOM_STATS=y
CONFIG_QCOM_WCNSS_CTRL=y
CONFIG_QCOM_APR=y
CONFIG_QCOM_ICC_BWMON=y
CONFIG_QCOM_PBS=y
# end of Qualcomm SoC drivers

CONFIG_SOC_RENESAS=y
CONFIG_ARCH_RCAR_GEN3=y
CONFIG_ARCH_RCAR_GEN4=y
CONFIG_ARCH_RZG2L=y
CONFIG_ARCH_R8A77995=y
CONFIG_ARCH_R8A77990=y
CONFIG_ARCH_R8A77951=y
CONFIG_ARCH_R8A77965=y
CONFIG_ARCH_R8A77960=y
CONFIG_ARCH_R8A77961=y
CONFIG_ARCH_R8A779F0=y
CONFIG_ARCH_R8A77980=y
CONFIG_ARCH_R8A77970=y
CONFIG_ARCH_R8A779A0=y
CONFIG_ARCH_R8A779G0=y
CONFIG_ARCH_R8A779H0=y
CONFIG_ARCH_R8A774C0=y
CONFIG_ARCH_R8A774E1=y
CONFIG_ARCH_R8A774A1=y
CONFIG_ARCH_R8A774B1=y
CONFIG_ARCH_R9A07G043=y
CONFIG_ARCH_R9A07G044=y
CONFIG_ARCH_R9A07G054=y
CONFIG_ARCH_R9A08G045=y
CONFIG_ARCH_R9A09G011=y
CONFIG_ARCH_R9A09G057=y
CONFIG_PWC_RZV2M=y
CONFIG_RST_RCAR=y
CONFIG_ROCKCHIP_GRF=y
CONFIG_ROCKCHIP_IODOMAIN=y
CONFIG_SOC_SAMSUNG=y
CONFIG_EXYNOS_CHIPID=y
CONFIG_EXYNOS_USI=y
CONFIG_EXYNOS_PMU=y
CONFIG_SUNXI_MBUS=y
CONFIG_SUNXI_SRAM=y
CONFIG_ARCH_TEGRA_132_SOC=y
CONFIG_ARCH_TEGRA_210_SOC=y
CONFIG_ARCH_TEGRA_186_SOC=y
CONFIG_ARCH_TEGRA_194_SOC=y
CONFIG_ARCH_TEGRA_234_SOC=y
# CONFIG_ARCH_TEGRA_241_SOC is not set
CONFIG_SOC_TEGRA_FUSE=y
CONFIG_SOC_TEGRA_FLOWCTRL=y
CONFIG_SOC_TEGRA_PMC=y
CONFIG_SOC_TEGRA_CBB=y
CONFIG_SOC_TI=y
CONFIG_TI_K3_RINGACC=y
CONFIG_TI_K3_SOCINFO=y
CONFIG_TI_PRUSS=y
CONFIG_TI_SCI_INTA_MSI_DOMAIN=y

#
# Xilinx SoC drivers
#
CONFIG_ZYNQMP_POWER=y
CONFIG_XLNX_EVENT_MANAGER=y
# end of Xilinx SoC drivers
# end of SOC (System On Chip) specific Drivers

#
# PM Domains
#
CONFIG_OWL_PM_DOMAINS_HELPER=y
CONFIG_OWL_PM_DOMAINS=y

#
# Amlogic PM Domains
#
CONFIG_MESON_EE_PM_DOMAINS=y
CONFIG_MESON_SECURE_PM_DOMAINS=y
# end of Amlogic PM Domains

CONFIG_APPLE_PMGR_PWRSTATE=y
CONFIG_ARM_SCMI_PERF_DOMAIN=y
CONFIG_ARM_SCMI_POWER_DOMAIN=y
CONFIG_ARM_SCPI_POWER_DOMAIN=y

#
# Broadcom PM Domains
#
CONFIG_BCM2835_POWER=y
CONFIG_RASPBERRYPI_POWER=y
CONFIG_BCM_PMB=y
# end of Broadcom PM Domains

#
# i.MX PM Domains
#
CONFIG_IMX_GPCV2_PM_DOMAINS=y
CONFIG_IMX8M_BLK_CTRL=y
CONFIG_IMX9_BLK_CTRL=y
CONFIG_IMX_SCU_PD=y
# end of i.MX PM Domains

#
# MediaTek PM Domains
#
CONFIG_MTK_SCPSYS=y
CONFIG_MTK_SCPSYS_PM_DOMAINS=y
# end of MediaTek PM Domains

#
# Qualcomm PM Domains
#
CONFIG_QCOM_CPR=y
CONFIG_QCOM_RPMHPD=y
CONFIG_QCOM_RPMPD=y
# end of Qualcomm PM Domains

CONFIG_SYSC_RCAR=y
CONFIG_SYSC_RCAR_GEN4=y
CONFIG_SYSC_R8A77995=y
CONFIG_SYSC_R8A77990=y
CONFIG_SYSC_R8A7795=y
CONFIG_SYSC_R8A77965=y
CONFIG_SYSC_R8A77960=y
CONFIG_SYSC_R8A77961=y
CONFIG_SYSC_R8A779F0=y
CONFIG_SYSC_R8A77980=y
CONFIG_SYSC_R8A77970=y
CONFIG_SYSC_R8A779A0=y
CONFIG_SYSC_R8A779G0=y
CONFIG_SYSC_R8A779H0=y
CONFIG_SYSC_R8A774C0=y
CONFIG_SYSC_R8A774E1=y
CONFIG_SYSC_R8A774A1=y
CONFIG_SYSC_R8A774B1=y
CONFIG_ROCKCHIP_PM_DOMAINS=y
CONFIG_EXYNOS_PM_DOMAINS=y
# CONFIG_SUN20I_PPU is not set
CONFIG_SOC_TEGRA_POWERGATE_BPMP=y
CONFIG_TI_SCI_PM_DOMAINS=y
CONFIG_ZYNQMP_PM_DOMAINS=y
# 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_EXYNOS_BUS_DEVFREQ is not set
CONFIG_ARM_IMX_BUS_DEVFREQ=y
CONFIG_ARM_IMX8M_DDRC_DEVFREQ=y
# CONFIG_ARM_TEGRA_DEVFREQ is not set
CONFIG_ARM_MEDIATEK_CCI_DEVFREQ=y
# CONFIG_ARM_RK3399_DMC_DEVFREQ is not set
# CONFIG_ARM_SUN8I_A33_MBUS_DEVFREQ is not set
# CONFIG_PM_DEVFREQ_EVENT is not set
CONFIG_EXTCON=y

#
# Extcon Device Drivers
#
# CONFIG_EXTCON_ADC_JACK is not set
# CONFIG_EXTCON_FSA9480 is not set
# CONFIG_EXTCON_GPIO is not set
# CONFIG_EXTCON_LC824206XA is not set
# CONFIG_EXTCON_MAX3355 is not set
CONFIG_EXTCON_PTN5150=y
# CONFIG_EXTCON_QCOM_SPMI_MISC is not set
# CONFIG_EXTCON_RT8973A is not set
# CONFIG_EXTCON_SM5502 is not set
CONFIG_EXTCON_USB_GPIO=y
CONFIG_EXTCON_USBC_TUSB320=y
# CONFIG_EXTCON_RTK_TYPE_C is not set
CONFIG_MEMORY=y
# CONFIG_ARM_PL172_MPMC is not set
CONFIG_BRCMSTB_DPFE=y
CONFIG_BRCMSTB_MEMC=y
# CONFIG_OMAP_GPMC is not set
# CONFIG_FSL_IFC is not set
CONFIG_MTK_SMI=y
CONFIG_RENESAS_RPCIF=y
# CONFIG_STM32_FMC2_EBI is not set
CONFIG_TEGRA_MC=y
# CONFIG_TEGRA210_EMC 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_AD4130 is not set
# CONFIG_AD4695 is not set
# CONFIG_AD7091R5 is not set
# CONFIG_AD7091R8 is not set
# CONFIG_AD7124 is not set
# CONFIG_AD7173 is not set
# CONFIG_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_ADI_AXI_ADC is not set
# CONFIG_AXP20X_ADC is not set
# CONFIG_AXP288_ADC is not set
# CONFIG_BCM_IPROC_ADC is not set
# CONFIG_BERLIN2_ADC is not set
# CONFIG_CC10001_ADC is not set
CONFIG_DLN2_ADC=y
# CONFIG_ENVELOPE_DETECTOR is not set
CONFIG_EXYNOS_ADC=y
# CONFIG_GEHC_PMC_ADC is not set
# CONFIG_HI8435 is not set
# CONFIG_HX711 is not set
# CONFIG_IMX7D_ADC is not set
CONFIG_IMX8QXP_ADC=y
CONFIG_IMX93_ADC=y
# 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_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 is not set
# CONFIG_MEDIATEK_MT6360_ADC is not set
# CONFIG_MEDIATEK_MT6370_ADC is not set
CONFIG_MEDIATEK_MT6577_AUXADC=y
CONFIG_MESON_SARADC=y
# CONFIG_NAU7802 is not set
# CONFIG_NPCM_ADC is not set
# CONFIG_PAC1921 is not set
# CONFIG_PAC1934 is not set
CONFIG_QCOM_VADC_COMMON=y
# CONFIG_QCOM_SPMI_RRADC is not set
# CONFIG_QCOM_SPMI_IADC is not set
CONFIG_QCOM_SPMI_VADC=y
CONFIG_QCOM_SPMI_ADC5=y
CONFIG_ROCKCHIP_SARADC=y
# CONFIG_RICHTEK_RTQ6056 is not set
CONFIG_RZG2L_ADC=y
# CONFIG_SD_ADC_MODULATOR is not set
# CONFIG_STM32_ADC_CORE is not set
# CONFIG_STM32_DFSDM_CORE is not set
# CONFIG_STM32_DFSDM_ADC is not set
# CONFIG_SUN20I_GPADC is not set
# CONFIG_TI_ADC081C is not set
# CONFIG_TI_ADC0832 is not set
# CONFIG_TI_ADC084S021 is not set
# CONFIG_TI_ADC12138 is not set
# CONFIG_TI_ADC108S102 is not set
# CONFIG_TI_ADC128S052 is not set
# CONFIG_TI_ADC161S626 is not set
CONFIG_TI_ADS1015=y
# CONFIG_TI_ADS1119 is not set
# CONFIG_TI_ADS7924 is not set
# CONFIG_TI_ADS1100 is not set
# CONFIG_TI_ADS1298 is not set
# CONFIG_TI_ADS7950 is not set
# CONFIG_TI_ADS8344 is not set
# CONFIG_TI_ADS8688 is not set
# CONFIG_TI_ADS124S08 is not set
# CONFIG_TI_ADS131E08 is not set
CONFIG_TI_AM335X_ADC=y
# 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 is not set
# CONFIG_XILINX_AMS is not set
# end of Analog to digital converters

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

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

#
# Amplifiers
#
# CONFIG_AD8366 is not set
# CONFIG_ADA4250 is not set
# CONFIG_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_PMS7003 is not set
# CONFIG_SCD30_CORE is not set
# CONFIG_SCD4X 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_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 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_AD9739A is not set
# CONFIG_ADI_AXI_DAC 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_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_MAX5522 is not set
# CONFIG_MAX5821 is not set
# CONFIG_MCP4725 is not set
# CONFIG_MCP4728 is not set
# CONFIG_MCP4821 is not set
# CONFIG_MCP4922 is not set
# CONFIG_STM32_DAC 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_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_MPU6050_I2C is not set
# CONFIG_INV_MPU6050_SPI is not set
# CONFIG_SMI240 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_AL3010 is not set
# CONFIG_AL3320A is not set
# CONFIG_APDS9300 is not set
# CONFIG_APDS9306 is not set
# CONFIG_APDS9960 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_BU27008 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_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_VEML6030 is not set
# CONFIG_VEML6040 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_IIO_ST_MAGN_3AXIS=y
CONFIG_IIO_ST_MAGN_I2C_3AXIS=y
CONFIG_IIO_ST_MAGN_SPI_3AXIS=y
# 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_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_INTERRUPT_TRIGGER is not set
# 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_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 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
# end of Pressure sensors

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

#
# Proximity and distance sensors
#
# 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_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_APPLE is not set
# CONFIG_PWM_ATMEL_TCB is not set
# CONFIG_PWM_AXI_PWMGEN is not set
CONFIG_PWM_BCM_IPROC=y
CONFIG_PWM_BCM2835=y
# CONFIG_PWM_BERLIN is not set
CONFIG_PWM_BRCMSTB=y
# 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_HIBVT is not set
# CONFIG_PWM_IMX1 is not set
CONFIG_PWM_IMX27=y
# CONFIG_PWM_IMX_TPM is not set
# CONFIG_PWM_KEEMBAY is not set
CONFIG_PWM_MESON=y
CONFIG_PWM_MTK_DISP=y
CONFIG_PWM_MEDIATEK=y
# CONFIG_PWM_OMAP_DMTIMER is not set
# CONFIG_PWM_PCA9685 is not set
# CONFIG_PWM_RASPBERRYPI_POE is not set
CONFIG_PWM_RCAR=y
CONFIG_PWM_RENESAS_TPU=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_PWM_RZ_MTU3=y
CONFIG_PWM_SAMSUNG=y
CONFIG_PWM_SL28CPLD=y
# CONFIG_PWM_SPRD is not set
CONFIG_PWM_SUN4I=y
CONFIG_PWM_TEGRA=y
CONFIG_PWM_TIECAP=y
CONFIG_PWM_TIEHRPWM=y
# CONFIG_PWM_TWL is not set
# CONFIG_PWM_TWL_LED is not set
CONFIG_PWM_VISCONTI=y
# CONFIG_PWM_XILINX is not set

#
# IRQ chip support
#
CONFIG_IRQCHIP=y
CONFIG_ARM_GIC=y
CONFIG_ARM_GIC_PM=y
CONFIG_ARM_GIC_MAX_NR=1
CONFIG_ARM_GIC_V2M=y
CONFIG_ARM_GIC_V3=y
CONFIG_ARM_GIC_V3_ITS=y
CONFIG_ARM_GIC_V3_ITS_FSL_MC=y
CONFIG_IRQ_MSI_LIB=y
CONFIG_ALPINE_MSI=y
# CONFIG_AL_FIC is not set
CONFIG_BCM7038_L1_IRQ=y
CONFIG_BCM7120_L2_IRQ=y
CONFIG_BRCMSTB_L2_IRQ=y
CONFIG_DW_APB_ICTL=y
CONFIG_HISILICON_IRQ_MBIGEN=y
# CONFIG_LAN966X_OIC is not set
CONFIG_RENESAS_IRQC=y
CONFIG_RENESAS_RZG2L_IRQC=y
CONFIG_RENESAS_RZV2H_ICU=y
CONFIG_SL28CPLD_INTC=y
CONFIG_SUN6I_R_INTC=y
CONFIG_SUNXI_NMI_INTC=y
# CONFIG_XILINX_INTC is not set
CONFIG_IMX_GPCV2=y
CONFIG_MVEBU_GICP=y
CONFIG_MVEBU_ICU=y
CONFIG_MVEBU_ODMI=y
CONFIG_MVEBU_PIC=y
CONFIG_MVEBU_SEI=y
CONFIG_LS_EXTIRQ=y
CONFIG_LS_SCFG_MSI=y
CONFIG_PARTITION_PERCPU=y
CONFIG_STM32MP_EXTI=y
CONFIG_QCOM_IRQ_COMBINER=y
CONFIG_IRQ_UNIPHIER_AIDET=y
CONFIG_MESON_IRQ_GPIO=y
CONFIG_QCOM_PDC=y
CONFIG_QCOM_MPM=y
CONFIG_IMX_IRQSTEER=y
CONFIG_IMX_INTMUX=y
CONFIG_IMX_MU_MSI=y
CONFIG_TI_SCI_INTR_IRQCHIP=y
CONFIG_TI_SCI_INTA_IRQCHIP=y
CONFIG_TI_PRUSS_INTC=y
CONFIG_MST_IRQ=y
CONFIG_APPLE_AIC=y
# end of IRQ chip support

# CONFIG_IPACK_BUS is not set
CONFIG_ARCH_HAS_RESET_CONTROLLER=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RESET_BERLIN=y
CONFIG_RESET_BRCMSTB=y
CONFIG_RESET_BRCMSTB_RESCAL=y
CONFIG_RESET_GPIO=y
CONFIG_RESET_IMX7=y
CONFIG_RESET_IMX8MP_AUDIOMIX=y
# CONFIG_RESET_MCHP_SPARX5 is not set
CONFIG_RESET_NPCM=y
CONFIG_RESET_NUVOTON_MA35D1=y
CONFIG_RESET_QCOM_AOSS=y
CONFIG_RESET_QCOM_PDC=y
CONFIG_RESET_RASPBERRYPI=y
CONFIG_RESET_RZG2L_USBPHY_CTRL=y
CONFIG_RESET_SCMI=y
CONFIG_RESET_SIMPLE=y
CONFIG_RESET_SUNXI=y
CONFIG_RESET_TI_SCI=y
# CONFIG_RESET_TI_SYSCON is not set
# CONFIG_RESET_TI_TPS380X is not set
CONFIG_RESET_UNIPHIER=y
CONFIG_RESET_UNIPHIER_GLUE=y
CONFIG_RESET_ZYNQMP=y
CONFIG_RESET_MESON_COMMON=y
CONFIG_RESET_MESON=y
# CONFIG_RESET_MESON_AUX is not set
CONFIG_RESET_MESON_AUDIO_ARB=y
CONFIG_COMMON_RESET_HI3660=y
CONFIG_COMMON_RESET_HI6220=y
CONFIG_RESET_TEGRA_BPMP=y

#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
CONFIG_GENERIC_PHY_MIPI_DPHY=y
CONFIG_PHY_XGENE=y
CONFIG_PHY_CAN_TRANSCEIVER=y
# CONFIG_PHY_AIROHA_PCIE is not set
# CONFIG_PHY_NXP_PTN3222 is not set
CONFIG_PHY_SUN4I_USB=y
CONFIG_PHY_SUN6I_MIPI_DPHY=y
# CONFIG_PHY_SUN9I_USB is not set
# CONFIG_PHY_SUN50I_USB3 is not set
CONFIG_PHY_MESON8B_USB2=y
CONFIG_PHY_MESON_GXL_USB2=y
CONFIG_PHY_MESON_G12A_MIPI_DPHY_ANALOG=y
CONFIG_PHY_MESON_G12A_USB2=y
CONFIG_PHY_MESON_G12A_USB3_PCIE=y
CONFIG_PHY_MESON_AXG_PCIE=y
CONFIG_PHY_MESON_AXG_MIPI_PCIE_ANALOG=y
CONFIG_PHY_MESON_AXG_MIPI_DPHY=y

#
# PHY drivers for Broadcom platforms
#
CONFIG_PHY_BCM_SR_USB=y
# CONFIG_BCM_KONA_USB2_PHY is not set
# CONFIG_PHY_BCM_NS_USB2 is not set
# CONFIG_PHY_BCM_NS_USB3 is not set
CONFIG_PHY_NS2_PCIE=y
CONFIG_PHY_NS2_USB_DRD=y
CONFIG_PHY_BRCM_SATA=y
CONFIG_PHY_BRCM_USB=y
CONFIG_PHY_BCM_SR_PCIE=y
# end of PHY drivers for Broadcom platforms

CONFIG_PHY_CADENCE_TORRENT=y
# CONFIG_PHY_CADENCE_DPHY is not set
CONFIG_PHY_CADENCE_DPHY_RX=y
CONFIG_PHY_CADENCE_SIERRA=y
CONFIG_PHY_CADENCE_SALVO=y
CONFIG_PHY_FSL_IMX8MQ_USB=y
# CONFIG_PHY_MIXEL_LVDS_PHY is not set
CONFIG_PHY_MIXEL_MIPI_DPHY=y
CONFIG_PHY_FSL_IMX8M_PCIE=y
# CONFIG_PHY_FSL_IMX8QM_HSIO is not set
CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY=y
# CONFIG_PHY_FSL_LYNX_28G is not set
CONFIG_PHY_HI6220_USB=y
# CONFIG_PHY_HI3660_USB is not set
# CONFIG_PHY_HI3670_USB is not set
# CONFIG_PHY_HI3670_PCIE is not set
CONFIG_PHY_HISTB_COMBPHY=y
CONFIG_PHY_HISI_INNO_USB2=y
# CONFIG_PHY_BERLIN_SATA is not set
# CONFIG_PHY_BERLIN_USB is not set
CONFIG_PHY_MVEBU_A3700_COMPHY=y
CONFIG_PHY_MVEBU_A3700_UTMI=y
# CONFIG_PHY_MVEBU_A38X_COMPHY is not set
CONFIG_PHY_MVEBU_CP110_COMPHY=y
# CONFIG_PHY_MVEBU_CP110_UTMI is not set
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
# CONFIG_PHY_MTK_PCIE is not set
# CONFIG_PHY_MTK_XFI_TPHY is not set
CONFIG_PHY_MTK_TPHY=y
# CONFIG_PHY_MTK_UFS is not set
# CONFIG_PHY_MTK_XSPHY is not set
CONFIG_PHY_MTK_HDMI=y
# CONFIG_PHY_MTK_MIPI_CSI_0_5 is not set
CONFIG_PHY_MTK_MIPI_DSI=y
CONFIG_PHY_MTK_DP=y
# CONFIG_PHY_SPARX5_SERDES is not set
# CONFIG_PHY_LAN966X_SERDES is not set
CONFIG_PHY_CPCAP_USB=y
# CONFIG_PHY_MAPPHONE_MDM6600 is not set
# CONFIG_PHY_OCELOT_SERDES is not set
# CONFIG_PHY_MA35_USB is not set
# CONFIG_PHY_QCOM_APQ8064_SATA is not set
CONFIG_PHY_QCOM_EDP=y
# CONFIG_PHY_QCOM_IPQ4019_USB is not set
# CONFIG_PHY_QCOM_IPQ806X_SATA is not set
CONFIG_PHY_QCOM_PCIE2=y
CONFIG_PHY_QCOM_QMP=y
CONFIG_PHY_QCOM_QMP_COMBO=y
CONFIG_PHY_QCOM_QMP_PCIE=y
CONFIG_PHY_QCOM_QMP_PCIE_8996=y
CONFIG_PHY_QCOM_QMP_UFS=y
CONFIG_PHY_QCOM_QMP_USB=y
# CONFIG_PHY_QCOM_QMP_USB_LEGACY is not set
CONFIG_PHY_QCOM_QUSB2=y
CONFIG_PHY_QCOM_SNPS_EUSB2=y
CONFIG_PHY_QCOM_EUSB2_REPEATER=y
CONFIG_PHY_QCOM_M31_USB=y
CONFIG_PHY_QCOM_USB_HS=y
CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=y
CONFIG_PHY_QCOM_USB_HSIC=y
CONFIG_PHY_QCOM_USB_HS_28NM=y
CONFIG_PHY_QCOM_USB_SS=y
# CONFIG_PHY_QCOM_IPQ806X_USB is not set
CONFIG_PHY_QCOM_SGMII_ETH=y
# CONFIG_PHY_RTK_RTD_USB2PHY is not set
# CONFIG_PHY_RTK_RTD_USB3PHY is not set
CONFIG_PHY_R8A779F0_ETHERNET_SERDES=y
# CONFIG_PHY_RCAR_GEN2 is not set
CONFIG_PHY_RCAR_GEN3_PCIE=y
CONFIG_PHY_RCAR_GEN3_USB2=y
CONFIG_PHY_RCAR_GEN3_USB3=y
# CONFIG_PHY_ROCKCHIP_DP is not set
# CONFIG_PHY_ROCKCHIP_DPHY_RX0 is not set
CONFIG_PHY_ROCKCHIP_EMMC=y
CONFIG_PHY_ROCKCHIP_INNO_HDMI=y
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
# CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY is not set
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y
CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y
CONFIG_PHY_ROCKCHIP_PCIE=y
CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX=y
CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y
CONFIG_PHY_ROCKCHIP_TYPEC=y
# CONFIG_PHY_ROCKCHIP_USB is not set
CONFIG_PHY_ROCKCHIP_USBDP=y
CONFIG_PHY_EXYNOS_DP_VIDEO=y
CONFIG_PHY_EXYNOS_MIPI_VIDEO=y
# CONFIG_PHY_EXYNOS_PCIE is not set
CONFIG_PHY_SAMSUNG_UFS=y
CONFIG_PHY_SAMSUNG_USB2=y
CONFIG_PHY_EXYNOS5_USBDRD=y
CONFIG_PHY_UNIPHIER_USB2=y
CONFIG_PHY_UNIPHIER_USB3=y
# CONFIG_PHY_UNIPHIER_PCIE is not set
CONFIG_PHY_UNIPHIER_AHCI=y
# CONFIG_PHY_STM32_COMBOPHY is not set
# CONFIG_PHY_STM32_USBPHYC is not set
CONFIG_PHY_TEGRA_XUSB=y
CONFIG_PHY_TEGRA194_P2U=y
CONFIG_PHY_AM654_SERDES=y
CONFIG_PHY_J721E_WIZ=y
CONFIG_OMAP_USB2=y
CONFIG_PHY_TUSB1210=y
# CONFIG_PHY_INTEL_KEEMBAY_EMMC is not set
# CONFIG_PHY_INTEL_KEEMBAY_USB is not set
# CONFIG_PHY_XILINX_ZYNQMP is not set
# 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_FSL_IMX8_DDR_PMU=y
# CONFIG_FSL_IMX9_DDR_PMU is not set
CONFIG_QCOM_L2_PMU=y
CONFIG_QCOM_L3_PMU=y
CONFIG_THUNDERX2_PMU=y
# CONFIG_XGENE_PMU is not set
CONFIG_ARM_SPE_PMU=y
CONFIG_ARM_DMC620_PMU=y
# CONFIG_MARVELL_CN10K_TAD_PMU is not set
# CONFIG_APPLE_M1_CPU_PMU is not set
# 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_MARVELL_CN10K_DDR_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_MESON_DDR_PMU=y
# CONFIG_MARVELL_PEM_PMU is not set
# end of Performance monitor support

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

#
# Android
#
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder0,binder1"
# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
# end of Android

CONFIG_TRACE_GPU_MEM=y
# 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_APPLE_EFUSES=y
CONFIG_NVMEM_BCM_OCOTP=y
# CONFIG_NVMEM_IMX_IIM is not set
CONFIG_NVMEM_IMX_OCOTP=y
CONFIG_NVMEM_IMX_OCOTP_ELE=y
CONFIG_NVMEM_IMX_OCOTP_SCU=y
CONFIG_NVMEM_LAYERSCAPE_SFP=y
CONFIG_NVMEM_MESON_EFUSE=y
# CONFIG_NVMEM_MESON_MX_EFUSE is not set
CONFIG_NVMEM_MTK_EFUSE=y
CONFIG_NVMEM_QCOM_QFPROM=y
CONFIG_NVMEM_QCOM_SEC_QFPROM=y
# CONFIG_NVMEM_RCAR_EFUSE is not set
CONFIG_NVMEM_RMEM=y
CONFIG_NVMEM_ROCKCHIP_EFUSE=y
CONFIG_NVMEM_ROCKCHIP_OTP=y
CONFIG_NVMEM_SNVS_LPGPR=y
CONFIG_NVMEM_SPMI_SDAM=y
# CONFIG_NVMEM_SPRD_EFUSE is not set
# CONFIG_NVMEM_STM32_ROMEM is not set
CONFIG_NVMEM_SUNXI_SID=y
# CONFIG_NVMEM_U_BOOT_ENV is not set
CONFIG_NVMEM_UNIPHIER_EFUSE=y
# CONFIG_NVMEM_ZYNQMP is not set

#
# HW tracing support
#
CONFIG_STM=y
# CONFIG_STM_PROTO_BASIC is not set
# CONFIG_STM_PROTO_SYS_T is not set
# 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_FPGA_MGR_SOCFPGA is not set
# CONFIG_FPGA_MGR_SOCFPGA_A10 is not set
# 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_STRATIX10_SOC=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_SOCFPGA_FPGA_BRIDGE is not set
CONFIG_ALTERA_FREEZE_BRIDGE=y
# CONFIG_XILINX_PR_DECOUPLER is not set
CONFIG_FPGA_REGION=y
CONFIG_OF_FPGA_REGION=y
# CONFIG_FPGA_DFL is not set
# CONFIG_FPGA_MGR_ZYNQMP_FPGA is not set
# CONFIG_FPGA_MGR_VERSAL_FPGA is not set
# CONFIG_FPGA_MGR_MICROCHIP_SPI is not set
# CONFIG_FPGA_MGR_LATTICE_SYSCONFIG_SPI is not set
# CONFIG_FSI is not set
CONFIG_TEE=y
CONFIG_OPTEE=y
# CONFIG_OPTEE_INSECURE_LOAD_IMAGE is not set
CONFIG_MULTIPLEXER=y

#
# 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_SLIM_QCOM_CTRL=y
CONFIG_SLIM_QCOM_NGD_CTRL=y
CONFIG_INTERCONNECT=y
CONFIG_INTERCONNECT_IMX=y
CONFIG_INTERCONNECT_IMX8MM=y
CONFIG_INTERCONNECT_IMX8MN=y
CONFIG_INTERCONNECT_IMX8MQ=y
CONFIG_INTERCONNECT_IMX8MP=y
# CONFIG_INTERCONNECT_MTK is not set
CONFIG_INTERCONNECT_QCOM=y
CONFIG_INTERCONNECT_QCOM_BCM_VOTER=y
# CONFIG_INTERCONNECT_QCOM_MSM8909 is not set
CONFIG_INTERCONNECT_QCOM_MSM8916=y
# CONFIG_INTERCONNECT_QCOM_MSM8937 is not set
# CONFIG_INTERCONNECT_QCOM_MSM8939 is not set
# CONFIG_INTERCONNECT_QCOM_MSM8953 is not set
# CONFIG_INTERCONNECT_QCOM_MSM8974 is not set
# CONFIG_INTERCONNECT_QCOM_MSM8976 is not set
CONFIG_INTERCONNECT_QCOM_MSM8996=y
CONFIG_INTERCONNECT_QCOM_OSM_L3=y
CONFIG_INTERCONNECT_QCOM_QCM2290=y
CONFIG_INTERCONNECT_QCOM_QCS404=y
# CONFIG_INTERCONNECT_QCOM_QCS615 is not set
# CONFIG_INTERCONNECT_QCOM_QCS8300 is not set
CONFIG_INTERCONNECT_QCOM_QDU1000=y
CONFIG_INTERCONNECT_QCOM_RPMH_POSSIBLE=y
CONFIG_INTERCONNECT_QCOM_RPMH=y
CONFIG_INTERCONNECT_QCOM_SA8775P=y
# CONFIG_INTERCONNECT_QCOM_SAR2130P is not set
CONFIG_INTERCONNECT_QCOM_SC7180=y
CONFIG_INTERCONNECT_QCOM_SC7280=y
CONFIG_INTERCONNECT_QCOM_SC8180X=y
CONFIG_INTERCONNECT_QCOM_SC8280XP=y
# CONFIG_INTERCONNECT_QCOM_SDM660 is not set
# CONFIG_INTERCONNECT_QCOM_SDM670 is not set
CONFIG_INTERCONNECT_QCOM_SDM845=y
# CONFIG_INTERCONNECT_QCOM_SDX55 is not set
# CONFIG_INTERCONNECT_QCOM_SDX65 is not set
CONFIG_INTERCONNECT_QCOM_SDX75=y
CONFIG_INTERCONNECT_QCOM_SM6115=y
# CONFIG_INTERCONNECT_QCOM_SM6350 is not set
# CONFIG_INTERCONNECT_QCOM_SM7150 is not set
CONFIG_INTERCONNECT_QCOM_SM8150=y
CONFIG_INTERCONNECT_QCOM_SM8250=y
CONFIG_INTERCONNECT_QCOM_SM8350=y
CONFIG_INTERCONNECT_QCOM_SM8450=y
CONFIG_INTERCONNECT_QCOM_SM8550=y
CONFIG_INTERCONNECT_QCOM_SM8650=y
CONFIG_INTERCONNECT_QCOM_X1E80100=y
CONFIG_INTERCONNECT_QCOM_SMD_RPM=y
# CONFIG_INTERCONNECT_SAMSUNG is not set
CONFIG_INTERCONNECT_CLK=y
CONFIG_COUNTER=y
# CONFIG_INTERRUPT_CNT is not set
CONFIG_RZ_MTU3_CNT=y
# CONFIG_TI_ECAP_CAPTURE is not set
# CONFIG_TI_EQEP is not set
CONFIG_MOST=y
CONFIG_MOST_USB_HDM=y
# CONFIG_MOST_CDEV is not set
# CONFIG_MOST_SND is not set
# CONFIG_PECI is not set
CONFIG_HTE=y
CONFIG_HTE_TEGRA194=y
CONFIG_HTE_TEGRA194_TEST=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_EXT3_FS=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
CONFIG_JFS_FS=y
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
CONFIG_JFS_DEBUG=y
# CONFIG_JFS_STATISTICS is not set
CONFIG_XFS_FS=y
# CONFIG_XFS_SUPPORT_V4 is not set
# CONFIG_XFS_SUPPORT_ASCII_CI is not set
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_XFS_ONLINE_SCRUB is not set
# CONFIG_XFS_WARN is not set
# CONFIG_XFS_DEBUG is not set
CONFIG_GFS2_FS=y
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=y
CONFIG_OCFS2_FS_O2CB=y
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=y
CONFIG_OCFS2_FS_STATS=y
# CONFIG_OCFS2_DEBUG_MASKLOG is not set
CONFIG_OCFS2_DEBUG_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
CONFIG_BTRFS_ASSERT=y
# CONFIG_BTRFS_EXPERIMENTAL is not set
CONFIG_BTRFS_FS_REF_VERIFY=y
CONFIG_NILFS2_FS=y
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FAULT_INJECTION=y
CONFIG_F2FS_FS_COMPRESSION=y
CONFIG_F2FS_FS_LZO=y
CONFIG_F2FS_FS_LZORLE=y
CONFIG_F2FS_FS_LZ4=y
CONFIG_F2FS_FS_LZ4HC=y
CONFIG_F2FS_FS_ZSTD=y
# CONFIG_F2FS_IOSTAT is not set
# CONFIG_F2FS_UNFAIR_RWSEM is not set
CONFIG_BCACHEFS_FS=y
CONFIG_BCACHEFS_QUOTA=y
CONFIG_BCACHEFS_ERASURE_CODING=y
CONFIG_BCACHEFS_POSIX_ACL=y
CONFIG_BCACHEFS_DEBUG=y
# CONFIG_BCACHEFS_TESTS is not set
# CONFIG_BCACHEFS_LOCK_TIME_STATS is not set
# CONFIG_BCACHEFS_NO_LATENCY_ACCT is not set
CONFIG_BCACHEFS_SIX_OPTIMISTIC_SPIN=y
# CONFIG_BCACHEFS_PATH_TRACEPOINTS is not set
CONFIG_ZONEFS_FS=y
CONFIG_FS_DAX=y
CONFIG_FS_DAX_PMD=y
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FILE_LOCKING=y
CONFIG_FS_ENCRYPTION=y
CONFIG_FS_ENCRYPTION_ALGS=y
# CONFIG_FS_ENCRYPTION_INLINE_CRYPT 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_OVERLAY_FS=y
CONFIG_OVERLAY_FS_REDIRECT_DIR=y
CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y
CONFIG_OVERLAY_FS_INDEX=y
# CONFIG_OVERLAY_FS_NFS_EXPORT is not set
# CONFIG_OVERLAY_FS_XINO_AUTO is not set
# CONFIG_OVERLAY_FS_METACOPY is not set
CONFIG_OVERLAY_FS_DEBUG=y

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

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

#
# DOS/FAT/EXFAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_FAT_DEFAULT_UTF8 is not set
CONFIG_EXFAT_FS=y
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS3_FS=y
# CONFIG_NTFS3_64BIT_CLUSTER is not set
CONFIG_NTFS3_LZX_XPRESS=y
CONFIG_NTFS3_FS_POSIX_ACL=y
# CONFIG_NTFS_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=y
CONFIG_ADFS_FS=y
# CONFIG_ADFS_FS_RW is not set
CONFIG_AFFS_FS=y
CONFIG_ECRYPT_FS=y
CONFIG_ECRYPT_FS_MESSAGING=y
CONFIG_HFS_FS=y
CONFIG_HFSPLUS_FS=y
CONFIG_BEFS_FS=y
# CONFIG_BEFS_DEBUG is not set
CONFIG_BFS_FS=y
CONFIG_EFS_FS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_RUBIN=y
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
CONFIG_UBIFS_ATIME_SUPPORT=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
# CONFIG_UBIFS_FS_AUTHENTICATION is not set
CONFIG_CRAMFS=y
CONFIG_CRAMFS_BLOCKDEV=y
CONFIG_CRAMFS_MTD=y
CONFIG_SQUASHFS=y
# CONFIG_SQUASHFS_FILE_CACHE is not set
CONFIG_SQUASHFS_FILE_DIRECT=y
CONFIG_SQUASHFS_DECOMP_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=y
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZ4=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_VXFS_FS=y
CONFIG_MINIX_FS=y
CONFIG_OMFS_FS=y
CONFIG_HPFS_FS=y
CONFIG_QNX4FS_FS=y
CONFIG_QNX6FS_FS=y
# CONFIG_QNX6FS_DEBUG is not set
CONFIG_ROMFS_FS=y
# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
CONFIG_ROMFS_BACKED_BY_BOTH=y
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_ROMFS_ON_MTD=y
CONFIG_PSTORE=y
CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240
CONFIG_PSTORE_COMPRESS=y
# CONFIG_PSTORE_CONSOLE is not set
# CONFIG_PSTORE_PMSG is not set
CONFIG_PSTORE_RAM=y
# CONFIG_PSTORE_BLK is not set
CONFIG_SYSV_FS=y
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
# CONFIG_UFS_DEBUG is not set
CONFIG_EROFS_FS=y
# CONFIG_EROFS_FS_DEBUG is not set
CONFIG_EROFS_FS_XATTR=y
CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
CONFIG_EROFS_FS_BACKED_BY_FILE=y
CONFIG_EROFS_FS_ZIP=y
# CONFIG_EROFS_FS_ZIP_LZMA is not set
# CONFIG_EROFS_FS_ZIP_DEFLATE is not set
# CONFIG_EROFS_FS_ZIP_ZSTD is not set
# CONFIG_EROFS_FS_ONDEMAND is not set
# CONFIG_EROFS_FS_PCPU_KTHREAD is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
# CONFIG_NFS_V2 is not set
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_BLOCK=y
CONFIG_PNFS_FLEXFILE_LAYOUT=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
# CONFIG_NFS_V4_1_MIGRATION is not set
CONFIG_NFS_V4_SECURITY_LABEL=y
CONFIG_ROOT_NFS=y
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_DISABLE_UDP_SUPPORT is not set
CONFIG_NFS_V4_2_READ_PLUS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V2 is not set
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_PNFS=y
CONFIG_NFSD_BLOCKLAYOUT=y
CONFIG_NFSD_SCSILAYOUT=y
CONFIG_NFSD_FLEXFILELAYOUT=y
CONFIG_NFSD_V4_2_INTER_SSC=y
CONFIG_NFSD_V4_SECURITY_LABEL=y
# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
# CONFIG_NFS_LOCALIO is not set
CONFIG_NFS_V4_2_SSC_HELPER=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_BACKCHANNEL=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA1 is not set
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_CAMELLIA is not set
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA2 is not set
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_SUNRPC_XPRT_RDMA is not set
CONFIG_CEPH_FS=y
CONFIG_CEPH_FSCACHE=y
CONFIG_CEPH_FS_POSIX_ACL=y
# CONFIG_CEPH_FS_SECURITY_LABEL is not set
CONFIG_CIFS=y
# CONFIG_CIFS_STATS2 is not set
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_SWN_UPCALL=y
CONFIG_CIFS_SMB_DIRECT=y
CONFIG_CIFS_FSCACHE=y
# CONFIG_CIFS_ROOT is not set
# CONFIG_CIFS_COMPRESSION is not set
CONFIG_SMB_SERVER=y
# CONFIG_SMB_SERVER_SMBDIRECT is not set
# CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN is not set
# CONFIG_SMB_SERVER_KERBEROS5 is not set
CONFIG_SMBFS=y
# CONFIG_CODA_FS is not set
CONFIG_AFS_FS=y
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y
# CONFIG_AFS_DEBUG_CURSOR is not set
CONFIG_9P_FS=y
CONFIG_9P_FSCACHE=y
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_9P_FS_SECURITY=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
CONFIG_NLS_CODEPAGE_864=y
CONFIG_NLS_CODEPAGE_865=y
CONFIG_NLS_CODEPAGE_866=y
CONFIG_NLS_CODEPAGE_869=y
CONFIG_NLS_CODEPAGE_936=y
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=y
CONFIG_NLS_ISO8859_3=y
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
CONFIG_NLS_ISO8859_13=y
CONFIG_NLS_ISO8859_14=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_MAC_ROMAN=y
CONFIG_NLS_MAC_CELTIC=y
CONFIG_NLS_MAC_CENTEURO=y
CONFIG_NLS_MAC_CROATIAN=y
CONFIG_NLS_MAC_CYRILLIC=y
CONFIG_NLS_MAC_GAELIC=y
CONFIG_NLS_MAC_GREEK=y
CONFIG_NLS_MAC_ICELAND=y
CONFIG_NLS_MAC_INUIT=y
CONFIG_NLS_MAC_ROMANIAN=y
CONFIG_NLS_MAC_TURKISH=y
CONFIG_NLS_UTF8=y
CONFIG_NLS_UCS2_UTILS=y
CONFIG_DLM=y
# CONFIG_DLM_DEBUG is not set
CONFIG_UNICODE=y
# CONFIG_UNICODE_NORMALIZATION_SELFTEST is not set
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
# CONFIG_TRUSTED_KEYS_CAAM 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=y
# CONFIG_PROC_MEM_FORCE_PTRACE is not set
# CONFIG_PROC_MEM_NO_FORCE is not set
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_INFINIBAND=y
CONFIG_SECURITY_NETWORK_XFRM=y
CONFIG_SECURITY_PATH=y
CONFIG_HARDENED_USERCOPY=y
# CONFIG_FORTIFY_SOURCE is not set
# 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_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_ENABLER=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
# CONFIG_INIT_STACK_NONE is not set
# CONFIG_INIT_STACK_ALL_PATTERN is not set
CONFIG_INIT_STACK_ALL_ZERO=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
# end of Memory initialization

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

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

CONFIG_XOR_BLOCKS=y
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_RNG_DEFAULT=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_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_NULL2=y
CONFIG_CRYPTO_PCRYPT=y
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_AUTHENC=y
CONFIG_CRYPTO_TEST=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=y
CONFIG_CRYPTO_ECRDSA=y
CONFIG_CRYPTO_CURVE25519=y
# end of Public-key cryptography

#
# Block ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_TI=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_FCRYPT=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_KEYWRAP=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_PCBC=y
CONFIG_CRYPTO_XCTR=y
CONFIG_CRYPTO_XTS=y
CONFIG_CRYPTO_NHPOLY1305=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=y
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_GHASH=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
CONFIG_CRYPTO_POLYVAL=y
CONFIG_CRYPTO_POLY1305=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_SM3_GENERIC=y
CONFIG_CRYPTO_STREEBOG=y
CONFIG_CRYPTO_VMAC=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_XCBC=y
CONFIG_CRYPTO_XXHASH=y
# end of Hashes, digests, and MACs

#
# CRCs (cyclic redundancy checks)
#
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32=y
CONFIG_CRYPTO_CRCT10DIF=y
CONFIG_CRYPTO_CRC64_ROCKSOFT=y
# 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_ANSI_CPRNG=y
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_DRBG_HMAC=y
CONFIG_CRYPTO_DRBG_HASH=y
CONFIG_CRYPTO_DRBG_CTR=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_JITTERENTROPY=y
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32
CONFIG_CRYPTO_JITTERENTROPY_OSR=1
CONFIG_CRYPTO_KDF800108_CTR=y
# end of Random number generation

#
# Userspace interface
#
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_RNG_CAVP is not set
CONFIG_CRYPTO_USER_API_AEAD=y
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
# end of Userspace interface

CONFIG_CRYPTO_HASH_INFO=y
# CONFIG_CRYPTO_NHPOLY1305_NEON is not set
CONFIG_CRYPTO_CHACHA20_NEON=y

#
# Accelerated Cryptographic Algorithms for CPU (arm64)
#
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_POLY1305_NEON=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA256_ARM64=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_SHA512_ARM64=y
CONFIG_CRYPTO_SHA512_ARM64_CE=y
CONFIG_CRYPTO_SHA3_ARM64=y
# CONFIG_CRYPTO_SM3_NEON is not set
CONFIG_CRYPTO_SM3_ARM64_CE=y
# CONFIG_CRYPTO_POLYVAL_ARM64_CE is not set
CONFIG_CRYPTO_AES_ARM64=y
CONFIG_CRYPTO_AES_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
CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=y
# end of Accelerated Cryptographic Algorithms for CPU (arm64)

CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_ALLWINNER=y
# CONFIG_CRYPTO_DEV_SUN4I_SS is not set
CONFIG_CRYPTO_DEV_SUN8I_CE=y
# CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG is not set
# CONFIG_CRYPTO_DEV_SUN8I_CE_HASH is not set
# CONFIG_CRYPTO_DEV_SUN8I_CE_PRNG is not set
# CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG is not set
# CONFIG_CRYPTO_DEV_SUN8I_SS is not set
CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y
CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y
CONFIG_CRYPTO_DEV_FSL_CAAM=y
# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y
CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_PRNG_API=y
# CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_TEST is not set
CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y
# CONFIG_CRYPTO_DEV_SAHARA is not set
# CONFIG_CRYPTO_DEV_EXYNOS_RNG is not set
# CONFIG_CRYPTO_DEV_S5P is not set
# 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_MXS_DCP is not set
# CONFIG_CAVIUM_CPT is not set
# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set
# CONFIG_CRYPTO_DEV_MARVELL_CESA is not set
# CONFIG_CRYPTO_DEV_OCTEONTX_CPT is not set
# CONFIG_CRYPTO_DEV_KEEMBAY_OCS_AES_SM4 is not set
# CONFIG_CRYPTO_DEV_KEEMBAY_OCS_ECC is not set
# CONFIG_CRYPTO_DEV_KEEMBAY_OCS_HCU 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_CAVIUM_ZIP is not set
CONFIG_CRYPTO_DEV_QCE=y
CONFIG_CRYPTO_DEV_QCE_SKCIPHER=y
CONFIG_CRYPTO_DEV_QCE_SHA=y
CONFIG_CRYPTO_DEV_QCE_AEAD=y
CONFIG_CRYPTO_DEV_QCE_ENABLE_ALL=y
# CONFIG_CRYPTO_DEV_QCE_ENABLE_SKCIPHER is not set
# CONFIG_CRYPTO_DEV_QCE_ENABLE_SHA is not set
# CONFIG_CRYPTO_DEV_QCE_ENABLE_AEAD is not set
CONFIG_CRYPTO_DEV_QCE_SW_MAX_LEN=512
CONFIG_CRYPTO_DEV_QCOM_RNG=y
# CONFIG_CRYPTO_DEV_ROCKCHIP is not set
CONFIG_CRYPTO_DEV_TEGRA=y
# CONFIG_CRYPTO_DEV_ZYNQMP_AES is not set
# CONFIG_CRYPTO_DEV_ZYNQMP_SHA3 is not set
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_CRYPTO_DEV_BCM_SPU=y
# CONFIG_CRYPTO_DEV_STM32_CRC is not set
# CONFIG_CRYPTO_DEV_STM32_HASH is not set
# CONFIG_CRYPTO_DEV_STM32_CRYP is not set
# 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_HISI_TRNG=y
CONFIG_CRYPTO_DEV_AMLOGIC_GXL=y
# CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG is not set
CONFIG_CRYPTO_DEV_SA2UL=y
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_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_ECDSA=y
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
# end of Certificates for signature checking

CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_RAID6_PQ=y
CONFIG_RAID6_PQ_BENCHMARK=y
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_STMP_DEVICE=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

#
# Crypto library routines
#
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_ARC4=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CHACHA_GENERIC=y
CONFIG_CRYPTO_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_DES=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9
CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_SHA256=y
# end of Crypto library routines

CONFIG_CRC_CCITT=y
CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC64_ROCKSOFT=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
CONFIG_CRC64=y
CONFIG_CRC4=y
CONFIG_CRC7=y
CONFIG_LIBCRC32C=y
CONFIG_CRC8=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_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_GLOB_SELFTEST is not set
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_GENERIC_VDSO_TIME_NS=y
CONFIG_VDSO_GETRANDOM=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_SG_SPLIT=y
CONFIG_SG_POOL=y
CONFIG_ARCH_HAS_PMEM_API=y
CONFIG_MEMREGION=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
CONFIG_MIN_HEAP=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
# 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_SPLIT is not set
# CONFIG_DEBUG_INFO_BTF is not set
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
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_DISALLOW_MOUNT is not set
# 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_SIGNED_WRAP is not set
# CONFIG_UBSAN_BOOL is not set
# CONFIG_UBSAN_ENUM is not set
# CONFIG_UBSAN_ALIGNMENT is not set
# CONFIG_TEST_UBSAN is not set
CONFIG_HAVE_ARCH_KCSAN=y
CONFIG_HAVE_KCSAN_COMPILER=y
# end of Generic Kernel Debugging Instruments

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

#
# Memory Debugging
#
CONFIG_PAGE_EXTENSION=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_SLUB_DEBUG=y
# CONFIG_SLUB_DEBUG_ON is not set
CONFIG_SLUB_RCU_DEBUG=y
CONFIG_PAGE_OWNER=y
CONFIG_PAGE_TABLE_CHECK=y
CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
CONFIG_PAGE_POISONING=y
# CONFIG_DEBUG_PAGE_REF is not set
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_ARCH_HAS_DEBUG_WX=y
# CONFIG_DEBUG_WX is not set
CONFIG_GENERIC_PTDUMP=y
CONFIG_PTDUMP_CORE=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_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_ON_OOPS_VALUE=1
CONFIG_PANIC_TIMEOUT=86400
CONFIG_LOCKUP_DETECTOR=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
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=y
CONFIG_WQ_WATCHDOG=y
# 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_DEBUG is not set
CONFIG_SCHED_INFO=y
CONFIG_SCHEDSTATS=y
# end of Scheduler Debugging

CONFIG_DEBUG_PREEMPT=y

#
# 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_WARN_ALL_UNSEEDED_RANDOM is not set
# 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_RETVAL=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=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_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_PROFILE_ALL_BRANCHES is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_UPROBE_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_PREEMPTIRQ_DELAY_TEST is not set
# CONFIG_RV 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_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
# 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_CC_HAS_SANCOV_TRACE_PC=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_MIN_HEAP 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_PRINTF is not set
# CONFIG_TEST_SCANF is not set
# CONFIG_TEST_BITMAP is not set
# CONFIG_TEST_UUID 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_BPF is not set
# CONFIG_TEST_BLACKHOLE_DEV is not set
# CONFIG_FIND_BIT_BENCHMARK is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_SYSCTL 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
KernelRepo git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
ReproCID 5924416757694464
ReproOpts {"repeat":true,"procs":1,"slowdown":1,"sandbox":"","sandbox_arg":0,"close_fds":false}
ReproSyzID 6246251999264768
SyzkallerCommit f3558dbf032eab2b77c1cb11b9ce2baffe7838d3
TargetArch arm64
TargetOS linux
TargetVMArch arm64

Current Stage: moderation
Next Stage: upstream

Reporting Stages and Comments:
Stage Source Reported At Ext ID Comments
moderation lore 2026/10/14 00:40 <4c497e30-fff3-4ef0-81f9-b9b47ca9e22f@mail.kernel.org>
2 Comments
  • syzbot@kernel.org (2026/10/14 00:44):
    In drm_mode_create_lease_ioctl(), user space supplies an object_count and
    an array of object_ids to be leased. The kernel copies the IDs from user
    space using memdup_array_user(), and then fill_object_idr() allocates a
    temporary array of pointers using kzalloc_objs(struct drm_mode_object *,
    object_count).
    
    Because kzalloc_objs() performs a kmalloc-family allocation with GFP_KERNEL
    (which lacks __GFP_NOWARN), if user space requests a sufficiently large
    object_count (for example, 1,000,000 mode objects), the allocation for the
    pointer array (1,000,000 * 8 = 8,000,000 bytes on 64-bit systems) requires
    order 11 pages. This exceeds MAX_PAGE_ORDER and triggers a warning in the
    page allocator:
    
    WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340
    [inline]
    WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640
    mm/page_alloc.c:5397
    Call trace:
     alloc_order_allowed mm/page_alloc.c:5340 [inline]
     __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
     alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
     alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
     ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
     __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
     fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
     drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
     drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
     drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
     vfs_ioctl fs/ioctl.c:51 [inline]
     __do_sys_ioctl fs/ioctl.c:597 [inline]
    
    Furthermore, cl->object_count is an unbounded __u32, whereas
    fill_object_idr() and validate_lease() treat object_count as a signed
    integer. A value of cl->object_count greater than or equal to 2^31 results
    in signed integer overflow. In addition, an allocation size exceeding
    INT_MAX would trigger a WARN_ON_ONCE inside __kvmalloc_node_noprof().
    
    Fix these issues by validating cl->object_count early in
    drm_mode_create_lease_ioctl() so that requests with cl->object_count >
    INT_MAX / sizeof(struct drm_mode_object *) are rejected with -EINVAL.
    Additionally, switch the object_ids allocation to vmemdup_array_user() and
    the objects pointer array allocation to kvzalloc_objs(), freeing both with
    kvfree(), so that large allocations can fall back to vmalloc without
    triggering allocator warnings or failing under memory fragmentation.
    
    Fixes: 62884cd386b8 ("drm: Add four ioctls for managing drm mode object leases [v7]")
    Assisted-by: Gemini:gemini-3.8-flash Gemini:gemini-3.1-pro-preview syzbot
    Reported-by: syzbot+6754751ad05524dae739@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=6754751ad05524dae739
    Link: https://syzkaller.appspot.com/ai_job?id=9d9e7ba8-2ca5-4a5b-a7be-8e951e80e2f7
    To: "David Airlie" <airlied@gmail.com>
    To: <dri-devel@lists.freedesktop.org>
    To: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>
    To: "Maxime Ripard" <mripard@kernel.org>
    To: "Simona Vetter" <simona@ffwll.ch>
    To: "Thomas Zimmermann" <tzimmermann@suse.de>
    To: "Keith Packard" <keithp@keithp.com>
    Cc: <linux-kernel@vger.kernel.org>
    
    ---
    diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
    index 5d2cf724c..6d31bc95d 100644
    --- a/drivers/gpu/drm/drm_lease.c
    +++ b/drivers/gpu/drm/drm_lease.c
    @@ -3,6 +3,9 @@
      * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
      */
     #include <linux/file.h>
    +#include <linux/limits.h>
    +#include <linux/slab.h>
    +#include <linux/string.h>
     #include <linux/uaccess.h>
     
     #include <drm/drm_auth.h>
    @@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
     	int ret;
     	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
     
    -	objects = kzalloc_objs(struct drm_mode_object *, object_count);
    +	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
     	if (!objects)
     		return -ENOMEM;
     
    @@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
     		if (objects[o])
     			drm_mode_object_put(objects[o]);
     	}
    -	kfree(objects);
    +	kvfree(objects);
     	return ret;
     }
     
    @@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
     		return -EINVAL;
     	}
     
    +	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
    +		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
    +		return -EINVAL;
    +	}
    +
     	lessor = drm_file_get_master(lessor_priv);
     	/* Do not allow sub-leases */
     	if (lessor->lessor) {
    @@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
     	/* Handle leased objects, if any */
     	idr_init(&leases);
     	if (object_count != 0) {
    -		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
    -					       object_count, sizeof(__u32));
    +		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
    +						object_count, sizeof(__u32));
     		if (IS_ERR(object_ids)) {
     			ret = PTR_ERR(object_ids);
     			idr_destroy(&leases);
    @@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
     		/* fill and validate the object idr */
     		ret = fill_object_idr(dev, lessor_priv, &leases,
     				      object_count, object_ids);
    -		kfree(object_ids);
    +		kvfree(object_ids);
     		if (ret) {
     			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
     			idr_destroy(&leases);
    
    
    base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
    -- 
    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.
    
  • immersa.bartosz.chronowski@gmail.com (2026/10/23 10:09):
    The v1 allocator change addresses the selected warning: both temporary arrays
    can use vmalloc-backed storage, the pointer array remains zeroed, and both frees
    match. In one matched 180-second run, the unpatched kernel reproduced the warning
    and the patched kernel did not; guest probes also exercised zero-object and real
    leases. The patch still needs changes because its count guard permits an
    impractical allocation before object lookup, and the description overstates the
    signed-count problem and blurs the warning trace's source revision.
    
    Keep the allocator and cleanup changes, but reject excessive object_count
    values before copying the IDs. The current INT_MAX / sizeof(pointer) guard
    admits about 268 million IDs on arm64, enough for roughly 2 GiB of pointers
    plus 1 GiB of copied IDs before the first lookup. Choose and explain a finite
    per-request limit tied to the lease objects the ioctl can support and a
    reasonable allocation budget. Keep the signed helper-parameter bound as a
    separate check, and preserve zero-object and valid leases and their cleanup.
    
    Correct the description to say that an unsigned cl->object_count outside the
    signed helper's range would be converted to a signed parameter; the evidence
    does not show signed arithmetic overflow. Identify drm_lease.c:389 as the
    historical warning-site line in the reported tree, rather than treating that
    line and a later source location as the same revision. Explain that vmalloc
    fallback removes the selected high-order allocation warning while the new
    count limit controls resource use. The existing Fixes: tag and recipients need
    no change for this revision.
    
    After revising the guard, repeat the exact-base build and matched unpatched /
    patched reproducer check. Exercise counts around the new limit, zero-object
    and real leases, invalid-ID recovery, and allocation-failure unwind. The
    current run did not inject ENOMEM, so cleanup on that path remains supported
    by source inspection rather than a forced-failure test.
    
    Impact assessment: the selected trigger proves a warning and failed ioctl for
    a DRM master, not memory disclosure or corruption. Warning-to-panic policy
    could turn that warning into an outage. The present multi-GiB count allowance
    is a resource concern; repeated or memory-pressure behavior was not tested.
    
    Kind Regards / Mit freundlichen Grüßen
    BART CHRONOWSKI
    
    On Wed, Oct 14, 2026 at 12:40:00AM +0000, 'syzbot' via syzkaller-upstream-moderation wrote:
    > In drm_mode_create_lease_ioctl(), user space supplies an object_count and
    > an array of object_ids to be leased. The kernel copies the IDs from user
    > space using memdup_array_user(), and then fill_object_idr() allocates a
    > temporary array of pointers using kzalloc_objs(struct drm_mode_object *,
    > object_count).
    > 
    > Because kzalloc_objs() performs a kmalloc-family allocation with GFP_KERNEL
    > (which lacks __GFP_NOWARN), if user space requests a sufficiently large
    > object_count (for example, 1,000,000 mode objects), the allocation for the
    > pointer array (1,000,000 * 8 = 8,000,000 bytes on 64-bit systems) requires
    > order 11 pages. This exceeds MAX_PAGE_ORDER and triggers a warning in the
    > page allocator:
    > 
    > WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340
    > [inline]
    > WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640
    > mm/page_alloc.c:5397
    > Call trace:
    >  alloc_order_allowed mm/page_alloc.c:5340 [inline]
    >  __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
    >  alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
    >  alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
    >  ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
    >  __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
    >  fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
    >  drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
    >  drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
    >  drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
    >  vfs_ioctl fs/ioctl.c:51 [inline]
    >  __do_sys_ioctl fs/ioctl.c:597 [inline]
    > 
    > Furthermore, cl->object_count is an unbounded __u32, whereas
    > fill_object_idr() and validate_lease() treat object_count as a signed
    > integer. A value of cl->object_count greater than or equal to 2^31 results
    > in signed integer overflow. In addition, an allocation size exceeding
    > INT_MAX would trigger a WARN_ON_ONCE inside __kvmalloc_node_noprof().
    > 
    > Fix these issues by validating cl->object_count early in
    > drm_mode_create_lease_ioctl() so that requests with cl->object_count >
    > INT_MAX / sizeof(struct drm_mode_object *) are rejected with -EINVAL.
    > Additionally, switch the object_ids allocation to vmemdup_array_user() and
    > the objects pointer array allocation to kvzalloc_objs(), freeing both with
    > kvfree(), so that large allocations can fall back to vmalloc without
    > triggering allocator warnings or failing under memory fragmentation.
    > 
    > Fixes: 62884cd386b8 ("drm: Add four ioctls for managing drm mode object leases [v7]")
    > Assisted-by: Gemini:gemini-3.8-flash Gemini:gemini-3.1-pro-preview syzbot
    > Reported-by: syzbot+6754751ad05524dae739@syzkaller.appspotmail.com
    > Closes: https://syzkaller.appspot.com/bug?extid=6754751ad05524dae739
    > Link: https://syzkaller.appspot.com/ai_job?id=9d9e7ba8-2ca5-4a5b-a7be-8e951e80e2f7
    > To: "David Airlie" <airlied@gmail.com>
    > To: <dri-devel@lists.freedesktop.org>
    > To: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>
    > To: "Maxime Ripard" <mripard@kernel.org>
    > To: "Simona Vetter" <simona@ffwll.ch>
    > To: "Thomas Zimmermann" <tzimmermann@suse.de>
    > To: "Keith Packard" <keithp@keithp.com>
    > Cc: <linux-kernel@vger.kernel.org>
    > 
    > ---
    > diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
    > index 5d2cf724c..6d31bc95d 100644
    > --- a/drivers/gpu/drm/drm_lease.c
    > +++ b/drivers/gpu/drm/drm_lease.c
    > @@ -3,6 +3,9 @@
    >   * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
    >   */
    >  #include <linux/file.h>
    > +#include <linux/limits.h>
    > +#include <linux/slab.h>
    > +#include <linux/string.h>
    >  #include <linux/uaccess.h>
    >  
    >  #include <drm/drm_auth.h>
    > @@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
    >  	int ret;
    >  	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
    >  
    > -	objects = kzalloc_objs(struct drm_mode_object *, object_count);
    > +	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
    >  	if (!objects)
    >  		return -ENOMEM;
    >  
    > @@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
    >  		if (objects[o])
    >  			drm_mode_object_put(objects[o]);
    >  	}
    > -	kfree(objects);
    > +	kvfree(objects);
    >  	return ret;
    >  }
    >  
    > @@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
    >  		return -EINVAL;
    >  	}
    >  
    > +	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
    > +		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
    > +		return -EINVAL;
    > +	}
    > +
    >  	lessor = drm_file_get_master(lessor_priv);
    >  	/* Do not allow sub-leases */
    >  	if (lessor->lessor) {
    > @@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
    >  	/* Handle leased objects, if any */
    >  	idr_init(&leases);
    >  	if (object_count != 0) {
    > -		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
    > -					       object_count, sizeof(__u32));
    > +		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
    > +						object_count, sizeof(__u32));
    >  		if (IS_ERR(object_ids)) {
    >  			ret = PTR_ERR(object_ids);
    >  			idr_destroy(&leases);
    > @@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
    >  		/* fill and validate the object idr */
    >  		ret = fill_object_idr(dev, lessor_priv, &leases,
    >  				      object_count, object_ids);
    > -		kfree(object_ids);
    > +		kvfree(object_ids);
    >  		if (ret) {
    >  			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
    >  			idr_destroy(&leases);
    > 
    > 
    > base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
    > -- 
    > 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.
    > 
    > -- 
    > You received this message because you are subscribed to the Google Groups "syzkaller-upstream-moderation" group.
    > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-upstream-moderation+unsubscribe@googlegroups.com.
    > To view this discussion visit https://groups.google.com/d/msgid/syzkaller-upstream-moderation/4c497e30-fff3-4ef0-81f9-b9b47ca9e22f%40mail.kernel.org.
    

Outputs:
AckedBy
[]
Fixes
map[AuthorEmail:keithp@keithp.com AuthorName:Keith Packard Hash:62884cd386b876638720ef88374b31a84ca7ee5f Title:drm: Add four ioctls for managing drm mode object leases [v7]]
KernelBranch
master
KernelCommit
24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
KernelRepo
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
PatchDescription
drm/lease: Use kvmalloc and bound object_count in create lease ioctl

In drm_mode_create_lease_ioctl(), user space supplies an object_count and
an array of object_ids to be leased. The kernel copies the IDs from user
space using memdup_array_user(), and then fill_object_idr() allocates a
temporary array of pointers using kzalloc_objs(struct drm_mode_object *,
object_count).

Because kzalloc_objs() performs a kmalloc-family allocation with GFP_KERNEL
(which lacks __GFP_NOWARN), if user space requests a sufficiently large
object_count (for example, 1,000,000 mode objects), the allocation for the
pointer array (1,000,000 * 8 = 8,000,000 bytes on 64-bit systems) requires
order 11 pages. This exceeds MAX_PAGE_ORDER and triggers a warning in the
page allocator:

WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340
[inline]
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640
mm/page_alloc.c:5397
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline]
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]

Furthermore, cl->object_count is an unbounded __u32, whereas
fill_object_idr() and validate_lease() treat object_count as a signed
integer. A value of cl->object_count greater than or equal to 2^31 results
in signed integer overflow. In addition, an allocation size exceeding
INT_MAX would trigger a WARN_ON_ONCE inside __kvmalloc_node_noprof().

Fix these issues by validating cl->object_count early in
drm_mode_create_lease_ioctl() so that requests with cl->object_count >
INT_MAX / sizeof(struct drm_mode_object *) are rejected with -EINVAL.
Additionally, switch the object_ids allocation to vmemdup_array_user() and
the objects pointer array allocation to kvzalloc_objs(), freeing both with
kvfree(), so that large allocations can fall back to vmalloc without
triggering allocator warnings or failing under memory fragmentation.
PatchDiff
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -3,6 +3,9 @@
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
@@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
@@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
@@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
@@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);
Recipients
[map[Email:airlied@gmail.com Name:David Airlie To:true] map[Email:dri-devel@lists.freedesktop.org Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:maarten.lankhorst@linux.intel.com Name:Maarten Lankhorst To:true] map[Email:mripard@kernel.org Name:Maxime Ripard To:true] map[Email:simona@ffwll.ch Name:Simona Vetter To:true] map[Email:tzimmermann@suse.de Name:Thomas Zimmermann To:true] map[Email:keithp@keithp.com Name:Keith Packard To:true]]
ReportedBy
[]
ReviewedBy
[]
SuggestedBy
[]
TestedBy
[]

Crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 6413 at mm/page_alloc.c:4727 __alloc_pages_noprof+0x320/0x6a8 mm/page_alloc.c:4727
Modules linked in:
CPU: 0 UID: 0 PID: 6413 Comm: syz-executor175 Not tainted 6.13.0-rc3-syzkaller-g573067a5a685 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __alloc_pages_noprof+0x320/0x6a8 mm/page_alloc.c:4727
lr : __alloc_pages_noprof+0xc8/0x6a8 mm/page_alloc.c:4721
sp : ffff8000a31a75c0
x29: ffff8000a31a76b0 x28: ffff8000a31a75e0 x27: dfff800000000000
x26: ffff700014634ebc x25: 0000000000000000 x24: ffff8000a31a7600
x23: 0000000000000000 x22: 0000000000040dc0 x21: 1ffff00014634ec0
x20: ffff8000a31a7620 x19: 000000000000000b x18: ffff0001fea8e950
x17: 000000000000d49f x16: ffff80008b5fea08 x15: 0000000000000005
x14: 1ffff00014634ec4 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700014634ec9 x10: 1ffff00014634ec8 x9 : 0000000000000001
x8 : ffff800092c5e000 x7 : 0000000000000000 x6 : ffff0000e23d0900
x5 : ffff0000e23d0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : ffff8000a31a7620
Call trace:
 __alloc_pages_noprof+0x320/0x6a8 mm/page_alloc.c:4727 (P)
 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
 alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
 ___kmalloc_large_node+0xbc/0x1d8 mm/slub.c:4243
 __kmalloc_large_node_noprof+0x2c/0xbc mm/slub.c:4270
 __do_kmalloc_node mm/slub.c:4286 [inline]
 __kmalloc_noprof+0x3ec/0x54c mm/slub.c:4310
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kmalloc_array_noprof include/linux/slab.h:946 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x4b0/0x17e8 drivers/gpu/drm/drm_lease.c:522
 drm_ioctl_kernel+0x26c/0x368 drivers/gpu/drm/drm_ioctl.c:796
 drm_ioctl+0x624/0xb14 drivers/gpu/drm/drm_ioctl.c:893
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl fs/ioctl.c:892 [inline]
 __arm64_sys_ioctl+0x14c/0x1cc fs/ioctl.c:892
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744
 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600
irq event stamp: 6308
hardirqs last  enabled at (6307): [<ffff80008b69eeb4>] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:85 [inline]
hardirqs last  enabled at (6307): [<ffff80008b69eeb4>] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:95
hardirqs last disabled at (6308): [<ffff80008b69c83c>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:488
softirqs last  enabled at (4330): [<ffff80008030e7b4>] softirq_handle_end kernel/softirq.c:407 [inline]
softirqs last  enabled at (4330): [<ffff80008030e7b4>] handle_softirqs+0xb44/0xd34 kernel/softirq.c:589
softirqs last disabled at (4319): [<ffff800080020db4>] __do_softirq+0x14/0x20 kernel/softirq.c:595
---[ end trace 0000000000000000 ]---

Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/10/13 20:55 flow patching
3h44m Results:
map[AckedBy:[] Fixes:map[AuthorEmail:keithp@keithp.com AuthorName:Keith Packard Hash:62884cd386b876638720ef88374b31a84ca7ee5f Title:drm: Add four ioctls for managing drm mode object leases [v7]] KernelBranch:master KernelCommit:24a19b953e2a3d0ea5a8c4951a0ab8f32720c907 KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git PatchDescription:drm/lease: Use kvmalloc and bound object_count in create lease ioctl

In drm_mode_create_lease_ioctl(), user space supplies an object_count and
an array of object_ids to be leased. The kernel copies the IDs from user
space using memdup_array_user(), and then fill_object_idr() allocates a
temporary array of pointers using kzalloc_objs(struct drm_mode_object *,
object_count).

Because kzalloc_objs() performs a kmalloc-family allocation with GFP_KERNEL
(which lacks __GFP_NOWARN), if user space requests a sufficiently large
object_count (for example, 1,000,000 mode objects), the allocation for the
pointer array (1,000,000 * 8 = 8,000,000 bytes on 64-bit systems) requires
order 11 pages. This exceeds MAX_PAGE_ORDER and triggers a warning in the
page allocator:

WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340
[inline]
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640
mm/page_alloc.c:5397
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline]
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]

Furthermore, cl->object_count is an unbounded __u32, whereas
fill_object_idr() and validate_lease() treat object_count as a signed
integer. A value of cl->object_count greater than or equal to 2^31 results
in signed integer overflow. In addition, an allocation size exceeding
INT_MAX would trigger a WARN_ON_ONCE inside __kvmalloc_node_noprof().

Fix these issues by validating cl->object_count early in
drm_mode_create_lease_ioctl() so that requests with cl->object_count >
INT_MAX / sizeof(struct drm_mode_object *) are rejected with -EINVAL.
Additionally, switch the object_ids allocation to vmemdup_array_user() and
the objects pointer array allocation to kvzalloc_objs(), freeing both with
kvfree(), so that large allocations can fall back to vmalloc without
triggering allocator warnings or failing under memory fragmentation. PatchDiff:diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -3,6 +3,9 @@
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
@@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
@@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
@@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
@@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);
 Recipients:[map[Email:airlied@gmail.com Name:David Airlie To:true] map[Email:dri-devel@lists.freedesktop.org Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:maarten.lankhorst@linux.intel.com Name:Maarten Lankhorst To:true] map[Email:mripard@kernel.org Name:Maxime Ripard To:true] map[Email:simona@ffwll.ch Name:Simona Vetter To:true] map[Email:tzimmermann@suse.de Name:Thomas Zimmermann To:true] map[Email:keithp@keithp.com Name:Keith Packard To:true]] ReportedBy:[] ReviewedBy:[] SuggestedBy:[] TestedBy:[]]

1/1 2026/10/13 20:55 action base-commit-picker
0m Results:
map[KernelBranch:master KernelCommit:24a19b953e2a3d0ea5a8c4951a0ab8f32720c907 KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git]

2/1 2026/10/13 20:55 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 <fcntl.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>

#ifndef __NR_ioctl
#define __NR_ioctl 29
#endif
#ifndef __NR_mmap
#define __NR_mmap 222
#endif

static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2)
{
	if (a0 == 0xc || a0 == 0xb) {
		char buf[128];
		sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2);
		return open(buf, O_RDWR, 0);
	} else {
		unsigned long nb = a1;
		char buf[1024];
		char* hash;
		strncpy(buf, (char*)a0, sizeof(buf) - 1);
		buf[sizeof(buf) - 1] = 0;
		while ((hash = strchr(buf, '#'))) {
			*hash = '0' + (char)(nb % 10);
			nb /= 10;
		}
		return open(buf, a2 & ~O_CREAT, 0);
	}
}

uint64_t r[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_open_dev$dri arguments: [
//    dev: ptr[in, buffer] {
//      buffer: {2f 64 65 76 2f 64 72 69 2f 63 61 72 64 23 00} (length 0xf)
//    }
//    id: intptr = 0x1f (8 bytes)
//    flags: open_flags = 0x0 (8 bytes)
//  ]
//  returns fd_dri
memcpy((void*)0x20000000, "/dev/dri/card#\000", 15);
	res = -1;
res = syz_open_dev(/*dev=*/0x20000000, /*id=*/0x1f, /*flags=*/0);
	if (res != -1)
		r[0] = res;
//  ioctl$DRM_IOCTL_MODE_CREATE_LEASE arguments: [
//    fd: fd_dri (resource)
//    cmd: const = 0xc01864c6 (4 bytes)
//    arg: ptr[inout, drm_mode_create_lease] {
//      drm_mode_create_lease {
//        object_ids: ptr[in, array[drm_obj_id]] {
//          array[drm_obj_id] {
//            drm_obj_id (resource)
//          }
//        }
//        object_count: len = 0xf4240 (4 bytes)
//        flags: drm_mode_create_lease_flag = 0x0 (4 bytes)
//        lessee_id: drm_lessee_id (resource)
//        fd: fd (resource)
//      }
//    }
//  ]
*(uint64_t*)0x200003c0 = 0x20000280;
*(uint32_t*)0x20000280 = 0;
*(uint32_t*)0x200003c8 = 0xf4240;
*(uint32_t*)0x200003cc = 0;
	syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0xc01864c6, /*arg=*/0x200003c0ul);
	return 0;
}
]

3/1 2026/10/13 20:55 action kernel-checkouter
0m Results:
map[KernelSrc:/app/workdir/cache/src/b40b16009ab47f464bda3fd2225415bcd6bb334b]

4/1 2026/10/13 20:55 action kernel-builder
45m Results:
map[KernelObj:/app/workdir/cache/build/0fe9a23712023dd69a64fd3143b6d5c65ff16a57]

5/1 2026/10/13 21:41 action crash-reproducer
6m Results:
map[OtherCrashReports:<nil> ReproducedBugTitle:WARNING in alloc_frozen_pages_noprof ReproducedCrashReport:------------[ cut here ]------------
WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline], CPU#1: syz.0.17/7032
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397, CPU#1: syz.0.17/7032
Modules linked in:
CPU: 1 UID: 0 PID: 7032 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : alloc_order_allowed mm/page_alloc.c:5340 [inline]
pc : __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
lr : __alloc_frozen_pages_noprof+0xa8/0x640 mm/page_alloc.c:5388
sp : ffff80009d2e7580
x29: ffff80009d2e7650 x28: ffff700013a5cf18 x27: ffff80009d2e75a0
x26: 1ffff0001302e474 x25: dfff800000000000 x24: ffff700013a5ceb4
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000040dc0
x20: 0000000000000000 x19: 000000000000000b x18: 00000000ffffffff
x17: 0000000000000000 x16: ffff80008b5b9788 x15: 0000000000000005
x14: 1ffff00013a5ceb8 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700013a5cebd x10: dfff800000000000 x9 : 0000000000000001
x8 : ffff8000939c7000 x7 : 0000000000000000 x6 : ffff0000e8bd0900
x5 : ffff0000e8bd0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline] (P)
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397 (P)
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 __do_kmalloc_node mm/slub.c:5402 [inline]
 __kmalloc_noprof+0x3ec/0x6bc mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 _kzalloc_noprof include/linux/slab.h:1312 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:583
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758
 el0t_64_sync_handler+0x68/0xdc arch/arm64/kernel/entry-common.c:777
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590
irq event stamp: 4228
hardirqs last  enabled at (4227): [<ffff80008b64f030>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (4227): [<ffff80008b64f030>] __arm64_exit_to_kernel_mode+0x64/0x78 arch/arm64/kernel/entry-common.c:60
hardirqs last disabled at (4228): [<ffff80008b64afb0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:445
softirqs last  enabled at (3568): [<ffff8000803f5178>] softirq_handle_end kernel/softirq.c:491 [inline]
softirqs last  enabled at (3568): [<ffff8000803f5178>] handle_softirqs+0xc88/0xdfc kernel/softirq.c:673
softirqs last disabled at (3415): [<ffff800080020ff4>] __do_softirq+0x14/0x20 kernel/softirq.c:679
---[ end trace 0000000000000000 ]---
 ReproducedFaultInjection:]

6/1 2026/10/13 21:47 action codesearch-prepare
19m Results:
map[Index:codesearch-index]

7/1 2026/10/13 22:06 agent debugger
25m Model:
deep-reasoning

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:

------------[ cut here ]------------
WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline], CPU#1: syz.0.17/7032
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397, CPU#1: syz.0.17/7032
Modules linked in:
CPU: 1 UID: 0 PID: 7032 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : alloc_order_allowed mm/page_alloc.c:5340 [inline]
pc : __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
lr : __alloc_frozen_pages_noprof+0xa8/0x640 mm/page_alloc.c:5388
sp : ffff80009d2e7580
x29: ffff80009d2e7650 x28: ffff700013a5cf18 x27: ffff80009d2e75a0
x26: 1ffff0001302e474 x25: dfff800000000000 x24: ffff700013a5ceb4
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000040dc0
x20: 0000000000000000 x19: 000000000000000b x18: 00000000ffffffff
x17: 0000000000000000 x16: ffff80008b5b9788 x15: 0000000000000005
x14: 1ffff00013a5ceb8 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700013a5cebd x10: dfff800000000000 x9 : 0000000000000001
x8 : ffff8000939c7000 x7 : 0000000000000000 x6 : ffff0000e8bd0900
x5 : ffff0000e8bd0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline] (P)
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397 (P)
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 __do_kmalloc_node mm/slub.c:5402 [inline]
 __kmalloc_noprof+0x3ec/0x6bc mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 _kzalloc_noprof include/linux/slab.h:1312 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:583
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758
 el0t_64_sync_handler+0x68/0xdc arch/arm64/kernel/entry-common.c:777
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590
irq event stamp: 4228
hardirqs last  enabled at (4227): [<ffff80008b64f030>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (4227): [<ffff80008b64f030>] __arm64_exit_to_kernel_mode+0x64/0x78 arch/arm64/kernel/entry-common.c:60
hardirqs last disabled at (4228): [<ffff80008b64afb0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:445
softirqs last  enabled at (3568): [<ffff8000803f5178>] softirq_handle_end kernel/softirq.c:491 [inline]
softirqs last  enabled at (3568): [<ffff8000803f5178>] handle_softirqs+0xc88/0xdfc kernel/softirq.c:673
softirqs last disabled at (3415): [<ffff800080020ff4>] __do_softirq+0x14/0x20 kernel/softirq.c:679
---[ 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 <fcntl.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>

#ifndef __NR_ioctl
#define __NR_ioctl 29
#endif
#ifndef __NR_mmap
#define __NR_mmap 222
#endif

static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2)
{
	if (a0 == 0xc || a0 == 0xb) {
		char buf[128];
		sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2);
		return open(buf, O_RDWR, 0);
	} else {
		unsigned long nb = a1;
		char buf[1024];
		char* hash;
		strncpy(buf, (char*)a0, sizeof(buf) - 1);
		buf[sizeof(buf) - 1] = 0;
		while ((hash = strchr(buf, '#'))) {
			*hash = '0' + (char)(nb % 10);
			nb /= 10;
		}
		return open(buf, a2 & ~O_CREAT, 0);
	}
}

uint64_t r[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_open_dev$dri arguments: [
//    dev: ptr[in, buffer] {
//      buffer: {2f 64 65 76 2f 64 72 69 2f 63 61 72 64 23 00} (length 0xf)
//    }
//    id: intptr = 0x1f (8 bytes)
//    flags: open_flags = 0x0 (8 bytes)
//  ]
//  returns fd_dri
memcpy((void*)0x20000000, "/dev/dri/card#\000", 15);
	res = -1;
res = syz_open_dev(/*dev=*/0x20000000, /*id=*/0x1f, /*flags=*/0);
	if (res != -1)
		r[0] = res;
//  ioctl$DRM_IOCTL_MODE_CREATE_LEASE arguments: [
//    fd: fd_dri (resource)
//    cmd: const = 0xc01864c6 (4 bytes)
//    arg: ptr[inout, drm_mode_create_lease] {
//      drm_mode_create_lease {
//        object_ids: ptr[in, array[drm_obj_id]] {
//          array[drm_obj_id] {
//            drm_obj_id (resource)
//          }
//        }
//        object_count: len = 0xf4240 (4 bytes)
//        flags: drm_mode_create_lease_flag = 0x0 (4 bytes)
//        lessee_id: drm_lessee_id (resource)
//        fd: fd (resource)
//      }
//    }
//  ]
*(uint64_t*)0x200003c0 = 0x20000280;
*(uint32_t*)0x20000280 = 0;
*(uint32_t*)0x200003c8 = 0xf4240;
*(uint32_t*)0x200003cc = 0;
	syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0xc01864c6, /*arg=*/0x200003c0ul);
	return 0;
}





Reply:
An analysis of the crash reveals that it is caused by an unbounded user-controlled allocation size in the DRM lease creation ioctl, which attempts to allocate a contiguous memory block larger than `MAX_PAGE_ORDER` using the `kmalloc` family of functions.

### Root Cause Analysis

The crash is a warning triggered in `alloc_order_allowed()` because `__alloc_frozen_pages_noprof()` is called with an allocation order that exceeds `MAX_PAGE_ORDER` (typically 10, which corresponds to 4MB on systems with 4KB pages).

This happens in `fill_object_idr()` when allocating the `objects` array:
```c
// drivers/gpu/drm/drm_lease.c:389
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```
The `kzalloc_objs` macro expands to a `kmalloc`-family allocation (equivalent to `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`). 

The `object_count` comes directly from the user-space `drm_mode_create_lease` struct via `cl->object_count` in `drm_mode_create_lease_ioctl()`. There is no upper bound check on this value.

Before calling `fill_object_idr()`, `drm_mode_create_lease_ioctl()` allocates the `object_ids` array using `memdup_array_user()`:
```c
// drivers/gpu/drm/drm_lease.c:512
		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
```
`memdup_array_user()` uses `memdup_user()`, which allocates memory with `GFP_USER | __GFP_NOWARN`. Because of the `__GFP_NOWARN` flag, if `object_count` is extremely large (e.g., requiring > 4MB), `memdup_array_user()` will silently fail and return `-ENOMEM` without triggering any warnings.

However, there is a specific window where `object_count` is large enough to require more than 4MB for the `objects` array (which has 8-byte pointers on 64-bit systems), but small enough that the `object_ids` array (which has 4-byte `__u32` elements) fits within 4MB. 

In the provided syzkaller reproducer:
```c
*(uint32_t*)0x200003c8 = 0xf4240; // object_count = 1,000,000
```
1. `object_count` is set to `1,000,000`.
2. `memdup_array_user()` allocates `1,000,000 * 4 = 4,000,000` bytes. This is order 10, which is `<= MAX_PAGE_ORDER`. The allocation succeeds.
3. `fill_object_idr()` then calls `kzalloc_objs()` to allocate `1,000,000 * 8 = 8,000,000` bytes. This requires order 11, which is `> MAX_PAGE_ORDER`. 
4. Since `kzalloc_objs()` uses `GFP_KERNEL` without `__GFP_NOWARN`, the page allocator loudly complains and triggers the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)` warning.

### Proposed Fix

To fix this, the allocation of the `objects` array in `fill_object_idr()` should be changed to use `kvzalloc_objs()`, which gracefully falls back to `vmalloc()` for large allocations and does not trigger the page allocator warning. The corresponding `kfree()` must also be updated to `kvfree()`.

```c
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,7 +386,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +462,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
```

*(Note: While adding an arbitrary upper bound check to `object_count` in `drm_mode_create_lease_ioctl()` is another option, using `kvzalloc_objs()` is the standard kernel pattern for handling user-controlled array sizes without imposing artificial limits).*

8/2 2026/10/13 22:06 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 7505
							output: 41
							thoughts: 503
						

Thoughts:
**Analyzing a Kernel Crash During Lease Creation**

Okay, so I've got a crash, and the kernel's telling me it's happening during memory allocation – specifically, a warning at `mm/page_alloc.c:5340`. The crucial thing here is the stack trace.  I see `alloc_order_allowed` and `__alloc_frozen_pages_noprof` at the top, which immediately points me towards memory management issues related to a specific allocation order and frozen pages. This suggests we're running into limits or contention within the page allocator, possibly when the system is under memory pressure or during a critical allocation phase. It looks like CPU#1, running a syzbot process (likely a fuzzer), triggered this.

The stack unwinds through `alloc_pages_mpol`, indicating memory policy is also involved.  The use of `__kmalloc_large_node`, followed by `fill_object_idr`, confirms that this is kmalloc, and specifically indicates a large allocation. Now, since this leads to `drm_mode_create_lease_ioctl`, the core of the problem *likely* lies within the Direct Rendering Manager (DRM) lease creation path. It looks like we're calling  `drm_mode_create_lease_ioctl` and that function is calling  `fill_object_idr`.

My instinct is to dive into `drivers/gpu/drm/drm_lease.c`, specifically the `fill_object_idr` function, and see how memory is being allocated there. It's likely we're requesting a large allocation that isn't feasible, or there's a leak or a contention issue within the lease mechanism itself.  The combination of large kmalloc, the freeze path, and the DRM context, points me to DRM lease creation as the root of the issue. I'll probably look at what object is being passed to the `fill_object_idr` function.



9/2 2026/10/13 22:07 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:fill_object_idr]

Results:
map[SourceCode: 378:	static int fill_object_idr(struct drm_device *dev,
 379:				   struct drm_file *lessor_priv,
 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
 465:		kfree(objects);
 466:		return ret;
 467:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

10/2 2026/10/13 22:07 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9962
							output: 20
							thoughts: 69
						

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

**Digging into the Memory Allocation**

Okay, the crash is happening right at `kzalloc_objs(struct drm_mode_object *, object_count);`. That's a red flag – clearly a memory allocation issue. Now, `kzalloc_objs` is almost certainly a macro, so I need to see what it expands to. My guess is it's using something like `kcalloc` or `kzalloc_array`, or a wrapper around `kzalloc`. I need to inspect the definition of `kzalloc_objs` to confirm my suspicion and understand *exactly* how the memory is being requested and initialized. This is the starting point to understand this allocation's role and potential problems.



11/2 2026/10/13 22:08 tool grepper
0m Args:
map[Expression:#define kzalloc_objs]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1156-	__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
include/linux/slab.h:1157:#define kzalloc_objs(P, COUNT, ...) \
include/linux/slab.h-1158-	__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
]

12/2 2026/10/13 22:08 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10372
							output: 44
							thoughts: 16
						

Thoughts:
Okay, here's my summary, taking the perspective of someone deeply familiar with kernel development, specifically the DRM subsystem:

**Diving into `drm_mode_create_lease_ioctl`**

Alright, let's get into the weeds with `drm_mode_create_lease_ioctl`. I need to really dig into this one, understand its purpose, and ensure it's functioning as expected, and ideally that it is as efficient as possible. This is a critical interface, so the details here *matter*. I'm thinking about the implications for resource allocation, concurrency, and security. What are the key data structures involved? What's the flow of execution? I'm already mentally tracing the call stack, thinking about how this fits into the larger framework of KMS and the interaction between the kernel and userspace. Is this ioctl properly handling error conditions? Are there any potential race conditions I need to be aware of? I'll probably need to consult the relevant documentation, the code itself, and maybe even some existing test cases. I'll need to think about performance, memory usage, and all the edge cases. I'll also be considering how it interacts with the underlying hardware, and how it is all linked into the DRM. I can already see some spots where improvements could be made. I'm going to start reading.



13/2 2026/10/13 22:09 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_mode_create_lease_ioctl]

Results:
map[SourceCode: 469:	/*
 470:	 * The master associated with the specified file will have a lease
 471:	 * created containing the objects specified in the ioctl structure.
 472:	 * A file descriptor will be allocated for that and returned to the
 473:	 * application.
 474:	 */
 475:	int drm_mode_create_lease_ioctl(struct drm_device *dev,
 476:					void *data, struct drm_file *lessor_priv)
 477:	{
 478:		struct drm_mode_create_lease *cl = data;
 479:		size_t object_count;
 480:		int ret = 0;
 481:		struct idr leases;
 482:		struct drm_master *lessor;
 483:		struct drm_master *lessee = NULL;
 484:		struct file *lessee_file = NULL;
 485:		struct file *lessor_file = lessor_priv->filp;
 486:		struct drm_file *lessee_priv;
 487:		int fd = -1;
 488:		uint32_t *object_ids;
 489:	
 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
 535:			ret = fd;
 536:			goto out_lessor;
 537:		}
 538:	
 539:		drm_dbg_lease(dev, "Creating lease\n");
 540:		/* lessee will take the ownership of leases */
 541:		lessee = drm_lease_create(lessor, &leases);
 542:	
 543:		if (IS_ERR(lessee)) {
 544:			ret = PTR_ERR(lessee);
 545:			idr_destroy(&leases);
 546:			goto out_leases;
 547:		}
 548:	
 549:		/* Clone the lessor file to create a new file for us */
 550:		drm_dbg_lease(dev, "Allocating lease file\n");
 551:		lessee_file = file_clone_open(lessor_file);
 552:		if (IS_ERR(lessee_file)) {
 553:			ret = PTR_ERR(lessee_file);
 554:			goto out_lessee;
 555:		}
 556:	
 557:		lessee_priv = lessee_file->private_data;
 558:		/* Change the file to a master one */
 559:		drm_master_put(&lessee_priv->master);
 560:		lessee_priv->master = lessee;
 561:		lessee_priv->is_master = 1;
 562:		lessee_priv->authenticated = 1;
 563:	
 564:		/* Pass fd back to userspace */
 565:		drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id);
 566:		cl->fd = fd;
 567:		cl->lessee_id = lessee->lessee_id;
 568:	
 569:		/* Hook up the fd */
 570:		fd_install(fd, lessee_file);
 571:	
 572:		drm_master_put(&lessor);
 573:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
 574:		return 0;
 575:	
 576:	out_lessee:
 577:		drm_master_put(&lessee);
 578:	
 579:	out_leases:
 580:		put_unused_fd(fd);
 581:	
 582:	out_lessor:
 583:		drm_master_put(&lessor);
 584:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
 585:		return ret;
 586:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

14/2 2026/10/13 22:09 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12531
							output: 41
							thoughts: 453
						

Thoughts:
**Analyzing the Allocation Failure**

Okay, so I'm looking at this crash log. The kernel's screaming about an allocation failure deep within `mm/page_alloc.c`, specifically at `alloc_order_allowed`. The backtrace points to `__alloc_frozen_pages_noprof` and, tracing back, it's triggered by `kzalloc_objs` in `fill_object_idr`. That `kzalloc_objs` call is the critical point.

The `object_count` for this `kzalloc_objs` call is clearly the culprit. It's coming from `cl->object_count`. And looking at the reproducer, it looks like this is set to 0xf4240, or 1,000,000. So we are calling `kzalloc_objs` with `1000000` as the size.

Doing the math, a call to `kzalloc_objs` with 1,000,000 of the `drm_mode_object` struct (8 bytes) means we are trying to allocate 8,000,000 bytes, or roughly 8MB. Right, that's an order 11 allocation (2048 pages). That's where the problem arises: `alloc_order_allowed` is likely failing because the system's `MAX_PAGE_ORDER` is typically 10 (4MB). Order 11 is exceeding that limit. It makes sense, generally you wouldn't be able to allocate an 8MB contiguous block directly from the page allocator, especially in a system under load.

But wait, I see `memdup_array_user` is used to allocate `object_ids`. Doesn't `memdup_array_user` use `kvmalloc` or something similar for potentially very large allocations? I need to check how `memdup_array_user` is implemented to be sure. That may provide a hint, as perhaps it's not being used consistently for large sizes. I will need to verify this assumption.



15/2 2026/10/13 22:09 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:memdup_array_user]

Results:
map[SourceCode:  22:	/**
  23:	 * memdup_array_user - duplicate array from user space
  24:	 * @src: source address in user space
  25:	 * @n: number of array members to copy
  26:	 * @size: size of one array member
  27:	 *
  28:	 * Return: an ERR_PTR() on failure. Result is physically
  29:	 * contiguous, to be freed by kfree().
  30:	 */
  31:	static inline __realloc_size(2, 3)
  32:	void *memdup_array_user(const void __user *src, size_t n, size_t size)
  33:	{
  34:		size_t nbytes;
  35:	
  36:		if (check_mul_overflow(n, size, &nbytes))
  37:			return ERR_PTR(-EOVERFLOW);
  38:	
  39:		return memdup_user(src, nbytes);
  40:	}
 SourceFile:include/linux/string.h]

16/2 2026/10/13 22:09 llm debugger
3m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13770
							output: 35
							thoughts: 37
						

Thoughts:
Here's my thought process, as if I were considering this code:

**Analyzing `memdup_user` and Memory Allocation**

Okay, hold on a second. I need to be absolutely sure about how `memdup_user` handles memory allocation. It looks like it uses `kmalloc_track_caller`, which could introduce some potential issues. `kmalloc_track_caller` could either fail outright (returning NULL) or, if configured to do so, it might actually fall back to using `kvmalloc` under certain circumstances. That's something I need to verify. My assumption, at this point, is that the code may not perform as expected under heavy system loads. Let me quickly examine the implementation of `memdup_user` to confirm how it's behaving. I need to understand its memory allocation strategy to ensure the code's robustness.



17/2 2026/10/13 22:13 tool codesearch-definition-source
0m Args:
map[ContextFile:include/linux/string.h Name:memdup_user]

Results:
map[SourceCode: 208:	/**
 209:	 * memdup_user - duplicate memory region from user space
 210:	 *
 211:	 * @src: source address in user space
 212:	 * @len: number of bytes to copy
 213:	 *
 214:	 * Return: an ERR_PTR() on failure.  Result is physically
 215:	 * contiguous, to be freed by kfree().
 216:	 */
 217:	void *memdup_user(const void __user *src, size_t len)
 218:	{
 219:		void *p;
 220:	
 221:		p = kmem_buckets_alloc_track_caller(user_buckets, len, GFP_USER | __GFP_NOWARN);
 222:		if (!p)
 223:			return ERR_PTR(-ENOMEM);
 224:	
 225:		if (copy_from_user(p, src, len)) {
 226:			kfree(p);
 227:			return ERR_PTR(-EFAULT);
 228:		}
 229:	
 230:		return p;
 231:	}
 SourceFile:mm/util.c]

18/2 2026/10/13 22:13 llm debugger
2m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14377
							output: 36
							thoughts: 610
						

Thoughts:
**Analyzing Memory Allocation in the DRM Driver**

Okay, so I'm looking at this code and immediately I see `memdup_user` uses `__GFP_NOWARN`. That's good, it avoids flooding the logs with warnings if it can't get a big contiguous block, but I need to understand why it might be failing silently. The trace shows a crash *after* `memdup_user` which suggests the `memdup_user` is succeeding.

Then I see `kzalloc_objs` is being used in `fill_object_idr`. That call is concerning because it's using the standard `kcalloc` or `kmalloc_array`, *not* `__GFP_NOWARN`. Looking deeper, `kzalloc_objs` actually expands to `__alloc_objs`, using `default_gfp`. Given the context, that's almost certainly `GFP_KERNEL`. This is where I need to focus. So `kzalloc_objs` called with a large object count is equivalent to allocating an array using `kcalloc`.

Specifically, `kzalloc_objs(struct drm_mode_object *, object_count)` becomes `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`.  With an `object_count` of 1,000,000, that means we're trying to allocate 8MB, using `GFP_KERNEL`, which *does* trigger warnings if the allocation size is too large.

Initially, I had a hunch that `memdup_user` was failing and causing the issue, but if it fails it returns `-ENOMEM` which is subsequently handled, so the `memdup_user` must be working.  Now, `memdup_user` allocates `object_count * sizeof(__u32)` which is 4MB (1,000,000 * 4). This results in an order 10 allocation which *should* work since `MAX_PAGE_ORDER` is 10. So `memdup_user` either succeeds or fails silently, but if it fails the return is handled.

The crash *has* to be in `kzalloc_objs` then. If `memdup_user` succeeded, that means 4MB allocation worked, and the subsequent call to `fill_object_idr` with a *similar* object count (1,000,000), but allocating *pointers* instead of 4 byte integers, explains the crash.  We are now trying to allocate `object_count * sizeof(struct drm_mode_object *)`, which is on a 64-bit system, 8MB, i.e. 1,000,000 * 8 bytes. That's order 11, and that's the problem. Since `MAX_PAGE_ORDER` is 10, the `kzalloc_objs` is generating the warning in `alloc_order_allowed` because we are trying to allocate an order that is too high. Time to double-check `mm/page_alloc.c` to confirm my suspicion.



19/2 2026/10/13 22:15 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/page_alloc.c Name:alloc_order_allowed]

Results:
map[SourceCode:5330:	static inline bool alloc_order_allowed(gfp_t gfp, unsigned int order,
5331:					       unsigned int alloc_flags)
5332:	{
5333:		if (alloc_flags & ALLOC_NOLOCK)
5334:			return pcp_allowed_order(order);
5335:	
5336:		/*
5337:		 * There are several places where we assume that the order value is sane
5338:		 * so bail out early if the request is out of bound.
5339:		 */
5340:		return !(WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp));
5341:	}
 SourceFile:mm/page_alloc.c]

20/2 2026/10/13 22:15 llm debugger
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15918
							output: 52
							thoughts: 558
						

Thoughts:
**Analyzing Potential Memory Allocation Issues in DRM Lease Handling**

Okay, so if the requested `order` exceeds `MAX_PAGE_ORDER`, that's definitely a red flag, triggering a warning. Let's dig deeper into `fill_object_idr`. Specifically, I'm concerned about this section:

```c
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
	if (!objects)
		return -ENOMEM;
```

It seems like `object_count` comes from user space, and while it's a `size_t` internally, it's derived from a `__u32` (`cl->object_count`) in `drm_mode_create_lease_ioctl`. So, we're theoretically looking at up to 4,294,967,295 objects, but potentially less due to size limitations.

The initial thought was that `memdup_array_user` might fail with `-ENOMEM` (or maybe even `-EOVERFLOW`) if `object_count` is large. However, because it uses `__GFP_NOWARN`, there wouldn't be a warning. The core problem, however, is that if we provide a `object_count` large enough that `memdup_array_user` works, like a 4MB array (order 10), but `kzalloc_objs` needs 8MB (order 11), we hit a potential warning because the `kzalloc_objs` call doesn't use `__GFP_NOWARN` and the allocation is larger than `MAX_PAGE_ORDER`.

Now, wait a minute, `kzalloc_objs` is a macro using `kzalloc`. Shouldn't we be using `kvzalloc` or `kvmalloc_array` for large allocations? Yes, those are standard for this scenario. Thinking about it, the `objects` array here is just a temporary container for `drm_mode_object` pointers. It's allocated, populated, validated, and then freed.

```c
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
...
out_free_objects:
	for (o = 0; o < object_count; o++) {
		if (objects[o])
			drm_mode_object_put(objects[o]);
	}
	kfree(objects);
```
So, yes, absolutely, this array *could* be allocated with `kvmalloc_array` or `kvzalloc` and freed with `kvfree`! Let's just make sure that `kzalloc_objs` is a macro, and take a look at it to be sure.



21/2 2026/10/13 22:16 tool codesearch-find-references
0m Error:
log-in to see details

Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c IncludeSnippetLines:0 Name:kzalloc_objs SourceTreePrefix:]

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

22/2 2026/10/13 22:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17139
							output: 45
							thoughts: 29
						

Thoughts:
Here's my thought process, as requested:

**Investigating the Origins of `kzalloc_objs`**

Okay, so I see `kzalloc_objs` is defined in `include/linux/slab.h`. That's the key. Knowing the header file tells me a lot. Now, my immediate instinct is to figure out *when* this thing was introduced. Understanding the commit history is often crucial for diagnosing potential bugs or understanding the evolution of a particular slab allocator feature. I need to trace this back to its roots. Time to dig into the git logs and see when `kzalloc_objs` first made its appearance. Let's start the hunt for that defining commit.



23/2 2026/10/13 22:17 tool git-log
0m Args:
map[CodeRegexp:kzalloc_objs Count:10 SourcePath:include/linux/slab.h SymbolName:]

Results:
map[Output:27c0f718d3b3 scsi: ch: Do not keep references to data transfer element devices
17637e1a581a bpf: Skip detached progs in trampoline images that are still in use
59e0cc31cc5c clk: ti: composite: resolve parent clocks by name again
c0aceaf65b70 bnxt_en: Bound SW TPA IDs to prevent crashes
3a2c4d55e32a treewide: refresh kmalloc_obj() conversions
f7f11bdddaba doc:it_IT: align Italian documentation in process
8c59f5c467af scripts: coccinelle: devm_free: reduce false positives
1beb81947eb4 net/sched: account classifier filter allocations to memcg
8fa4804fe62c NFSv4.1: zero referring call lists before decoding
992cc9f94ca9 net/packet: defer vmalloc TX_RING free until skbs finish
]

24/2 2026/10/13 22:17 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17613
							output: 31
							thoughts: 31
						

Thoughts:
Okay, let's dive into this. Here's my take on those commit thoughts:

**Analyzing Commit 3a2c4d55e32a**

Alright, let's take a look at commit `3a2c4d55e32a`. The description says it's a "treewide: refresh kmalloc_obj() conversions".  Right away, I'm thinking about the potential scope and impact here. A "treewide" change always raises a flag; it means this isn't isolated, but potentially touches a substantial portion of the codebase. So, the first question is, what specifically *is* being converted? Are we talking about `kmalloc_obj()` calls themselves, the structures/usages surrounding them, or some other associated process? Understanding the "refresh" aspect is key. Is this an effort to update to new kernel API or best practices, perhaps optimizing memory allocation or addressing some past issue related to object management? I'll need to dig into the commit itself to see what's changed and why. I'm looking for the 'before and after' to understand the rationale and verify the correctness of the change. This is critical for assessing the potential for regressions or side effects. Ultimately, I'll need to assess the correctness of this commit as a whole, focusing on how this conversion impacts memory management in the system, and any performance differences this conversion offers, and if any.



25/2 2026/10/13 22:18 tool git-show
0m Args:
map[Commit:3a2c4d55e32a Stat:true]

Results:
map[Output:commit 3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d
Author: Kees Cook <kees+treewide@kernel.org>
Date:   Wed Sep 2 15:31:14 2026 -0700

    treewide: refresh kmalloc_obj() conversions
    
    This is another run of the Coccinelle script for converting kmalloc()
    family of allocations to kmalloc_obj() via the existing rules in
    scripts/coccinelle/api/kmalloc_objs.cocci
    
    This catches both the set of kmalloc() uses added since the first
    kmalloc_obj() conversions in v7.0 and adds a large group missed in the
    first pass due to Coccinelle not interacting well with the cleanup.h
    scoped_...() family of macros[1]. I worked around this with spatch's
    "--macro-file" argument to a file with all the scoped_...() macros mapped
    to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control
    flow indicator I could find.
    
    Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc,
    riscv, and s390 with no new warnings.
    
    Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1]
    Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2]
    Signed-off-by: Kees Cook <kees+treewide@kernel.org>

 arch/arm64/crypto/aes-neonbs-glue.c                |  4 +-
 arch/arm64/kvm/nested.c                            |  2 +-
 arch/loongarch/kvm/intc/dmsintc.c                  |  2 +-
 arch/mips/bcm47xx/buttons.c                        |  8 ++--
 arch/powerpc/sysdev/xive/common.c                  |  2 +-
 arch/riscv/kvm/vcpu_pmu.c                          |  4 +-
 arch/s390/kvm/s390/s390.c                          |  4 +-
 drivers/accel/rocket/rocket_job.c                  |  2 +-
 drivers/acpi/irq.c                                 |  8 ++--
 drivers/base/property.c                            |  2 +-
 drivers/block/drbd/drbd_nl_gen.c                   | 40 +++++++++--------
 drivers/block/ublk_drv.c                           |  4 +-
 drivers/block/zram/backend_lz4.c                   |  2 +-
 drivers/clk/ti/composite.c                         |  2 +-
 drivers/clk/ti/mux.c                               |  2 +-
 drivers/cpufreq/amd-pstate.c                       |  2 +-
 drivers/crypto/inside-secure/eip93/eip93-common.c  |  5 +--
 .../crypto/intel/qat/qat_common/qat_comp_algs.c    |  3 +-
 drivers/crypto/ti/dthev2-aes.c                     |  8 ++--
 drivers/devfreq/hisi_uncore_freq.c                 |  2 +-
 drivers/dma-buf/st-dma-fence.c                     |  2 +-
 drivers/dma-buf/udmabuf.c                          |  4 +-
 drivers/dma/switchtec_dma.c                        |  7 ++-
 drivers/edac/versalnet_edac.c                      |  2 +-
 drivers/firmware/arm_scmi/driver.c                 |  2 +-
 drivers/firmware/qcom/qcom_tzmem.c                 |  8 ++--
 drivers/firmware/ti_sci.c                          |  2 +-
 drivers/fpga/dfl-afu-dma-region.c                  |  2 +-
 drivers/gpio/gpio-aggregator.c                     |  4 +-
 drivers/gpio/gpio-mpsse.c                          |  2 +-
 drivers/gpio/gpio-sim.c                            |  3 +-
 drivers/gpio/gpio-virtuser.c                       |  3 +-
 drivers/gpio/gpiolib-cdev.c                        |  2 +-
 drivers/gpio/gpiolib.c                             |  4 +-
 drivers/gpu/buddy.c                                | 13 ++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c   |  5 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c      |  4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_lockdep.c        |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c     |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c            |  5 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c            |  4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c    |  6 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c           |  6 +--
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c           | 12 ++---
 .../amdgpu_dm/tests/amdgpu_dm_connector_test.c     |  2 +-
 .../display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c  |  8 ++--
 .../display/amdgpu_dm/tests/amdgpu_dm_irq_test.c   | 18 ++++----
 .../display/amdgpu_dm/tests/amdgpu_dm_plane_test.c |  4 +-
 .../amd/display/amdgpu_dm/tests/amdgpu_dm_test.c   |  2 +-
 drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c   |  2 +-
 .../amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c   |  4 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  3 +-
 drivers/gpu/drm/amd/display/dc/core/dc_surface.c   |  2 +-
 .../gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c |  2 +-
 .../gpu/drm/amd/display/dc/dccg/dcn60/dcn60_dccg.c |  2 +-
 drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c       |  2 +-
 .../amd/display/dc/irq/dcn42/irq_service_dcn42.c   |  2 +-
 .../amd/display/dc/irq/dcn60/irq_service_dcn60.c   |  3 +-
 .../drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.c    |  2 +-
 .../amd/display/dc/resource/dcn30/dcn30_resource.c |  4 +-
 .../display/dc/resource/dcn302/dcn302_resource.c   |  4 +-
 .../display/dc/resource/dcn303/dcn303_resource.c   |  4 +-
 .../amd/display/dc/resource/dcn31/dcn31_resource.c |  4 +-
 .../display/dc/resource/dcn314/dcn314_resource.c   |  4 +-
 .../display/dc/resource/dcn315/dcn315_resource.c   |  4 +-
 .../display/dc/resource/dcn316/dcn316_resource.c   |  4 +-
 .../amd/display/dc/resource/dcn32/dcn32_resource.c |  4 +-
 .../display/dc/resource/dcn321/dcn321_resource.c   |  4 +-
 .../amd/display/dc/resource/dcn35/dcn35_resource.c |  4 +-
 .../display/dc/resource/dcn351/dcn351_resource.c   |  4 +-
 .../amd/display/dc/resource/dcn36/dcn36_resource.c |  4 +-
 .../display/dc/resource/dcn401/dcn401_resource.c   |  4 +-
 .../amd/display/dc/resource/dcn42/dcn42_resource.c | 50 ++++++++++-----------
 .../display/dc/resource/dcn42b/dcn42b_resource.c   | 46 +++++++++----------
 .../amd/display/dc/resource/dcn60/dcn60_resource.c | 42 +++++++++--------
 drivers/gpu/drm/amd/display/modules/power/power.c  |  5 +--
 .../gpu/drm/amd/display/modules/power/power_abm.c  |  3 +-
 .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c    |  2 +-
 .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c   |  4 +-
 drivers/gpu/drm/amd/ras/core/cmd.c                 |  4 +-
 drivers/gpu/drm/drm_exec.c                         |  2 +-
 drivers/gpu/drm/drm_syncobj.c                      |  2 +-
 drivers/gpu/drm/qxl/qxl_display.c                  |  2 +-
 drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c       |  2 +-
 drivers/gpu/drm/verisilicon/vs_plane.c             |  4 +-
 drivers/gpu/drm/virtio/virtgpu_prime.c             |  4 +-
 drivers/gpu/drm/vkms/vkms_configfs.c               |  8 ++--
 drivers/gpu/drm/xe/xe_amc.c                        |  2 +-
 drivers/gpu/drm/xe/xe_vm.c                         |  2 +-
 drivers/hid/hid-asus.c                             |  6 +--
 drivers/hid/hid-steam.c                            |  4 +-
 drivers/hid/hid-steelseries-arctis.c               |  2 +-
 drivers/hv/channel.c                               |  5 +--
 drivers/hv/hv_balloon.c                            |  2 +-
 drivers/hwmon/applesmc.c                           | 17 ++++---
 drivers/hwtracing/coresight/coresight-core.c       |  2 +-
 drivers/i2c/busses/i2c-gpio.c                      |  2 +-
 drivers/i3c/master/amd-i3c-master.c                |  4 +-
 drivers/iio/adc/ad7280a.c                          |  4 +-
 drivers/iio/buffer/industrialio-buffer-dmaengine.c |  2 +-
 drivers/iio/inkern.c                               |  2 +-
 drivers/infiniband/core/nldev.c                    |  2 +-
 drivers/infiniband/hw/hns/hns_roce_debugfs.c       |  3 +-
 drivers/input/input.c                              |  2 +-
 drivers/input/keyboard/adp5585-keys.c              |  4 +-
 drivers/input/keyboard/atkbd.c                     |  2 +-
 drivers/input/misc/ims-pcu.c                       |  2 +-
 drivers/input/mouse/psmouse-smbus.c                |  2 +-
 drivers/input/serio/serio_raw.c                    |  2 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h        |  2 +-
 drivers/iommu/iommufd/device.c                     |  2 +-
 drivers/iommu/iommufd/driver.c                     |  2 +-
 drivers/iommu/iommufd/hwpt_noiommu.c               |  2 +-
 drivers/iommu/vsi-iommu.c                          |  2 +-
 drivers/irqchip/irq-gic-v5-irs.c                   |  2 +-
 drivers/irqchip/irq-loongarch-ir.c                 |  2 +-
 drivers/irqchip/irq-realtek-rtl.c                  |  2 +-
 drivers/mailbox/riscv-sbi-mpxy-mbox.c              |  2 +-
 drivers/md/dm-inlinecrypt.c                        |  2 +-
 drivers/md/md-llbitmap.c                           |  4 +-
 drivers/media/platform/allegro-dvt/allegro-core.c  |  2 +-
 drivers/media/platform/amd/isp4/isp4_interface.c   |  6 +--
 drivers/media/platform/renesas/rcar-isp/core.c     |  2 +-
 drivers/media/rc/igorplugusb.c                     |  2 +-
 drivers/mfd/mfd-core.c                             |  4 +-
 drivers/mfd/ucb1x00-assabet.c                      |  2 +-
 drivers/mtd/mtd_virt_concat.c                      |  4 +-
 drivers/mtd/mtdconcat.c                            |  2 +-
 drivers/net/dsa/mv88e6xxx/tcflower.c               |  2 +-
 drivers/net/ethernet/alibaba/eea/eea_adminq.c      |  7 ++-
 drivers/net/ethernet/alibaba/eea/eea_net.c         |  8 ++--
 drivers/net/ethernet/alibaba/eea/eea_pci.c         |  2 +-
 drivers/net/ethernet/alibaba/eea/eea_ring.c        |  2 +-
 drivers/net/ethernet/alibaba/eea/eea_rx.c          |  5 +--
 drivers/net/ethernet/alibaba/eea/eea_tx.c          |  3 +-
 drivers/net/ethernet/amd/pds_core/core.c           |  3 +-
 drivers/net/ethernet/amd/pds_core/fw.c             |  6 +--
 drivers/net/ethernet/cadence/macb_main.c           |  2 +-
 drivers/net/ethernet/cisco/enic/enic_admin.c       |  2 +-
 drivers/net/ethernet/cisco/enic/enic_main.c        |  6 +--
 .../net/ethernet/freescale/dpaa2/dpaa2-switch.c    |  5 +--
 drivers/net/ethernet/intel/libie/controlq.c        |  3 +-
 .../net/ethernet/marvell/octeontx2/af/cn20k/npc.c  | 13 +++---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  |  3 +-
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c |  2 +-
 .../net/ethernet/mellanox/mlx5/core/sf/hw_table.c  |  2 +-
 .../mellanox/mlx5/core/steering/sws/dr_icm_pool.c  |  2 +-
 drivers/net/ethernet/meta/fbnic/fbnic_irq.c        |  2 +-
 drivers/net/ethernet/microsoft/mana/gdma_main.c    |  8 ++--
 drivers/net/ntb_netdev.c                           |  3 +-
 drivers/net/wireless/ath/ath12k/ahb.c              |  2 +-
 .../net/wireless/intel/iwlwifi/mld/regulatory.c    |  3 +-
 drivers/net/wireless/mediatek/mt76/mt7921/regd.c   |  2 +-
 drivers/net/wireless/mediatek/mt76/mt7925/main.c   |  2 +-
 drivers/net/wireless/mediatek/mt76/mt7925/regd.c   |  2 +-
 drivers/net/wireless/morsemicro/mm81x/mac.c        |  9 ++--
 drivers/net/wireless/morsemicro/mm81x/yaps.c       | 10 ++---
 drivers/net/wireless/nxp/nxpwifi/cfg80211.c        | 14 +++---
 drivers/net/wireless/nxp/nxpwifi/cmdevt.c          |  2 +-
 drivers/net/wireless/nxp/nxpwifi/ie.c              | 14 +++---
 drivers/net/wireless/nxp/nxpwifi/init.c            |  2 +-
 drivers/net/wireless/nxp/nxpwifi/main.c            |  8 ++--
 drivers/net/wireless/nxp/nxpwifi/scan.c            | 13 +++---
 drivers/net/wireless/nxp/nxpwifi/sta_cfg.c         |  2 +-
 drivers/net/wireless/nxp/nxpwifi/sta_cmd.c         |  2 +-
 drivers/net/wireless/nxp/nxpwifi/uap_event.c       |  2 +-
 drivers/nvdimm/region_devs.c                       |  3 +-
 drivers/nvme/host/core.c                           |  3 +-
 drivers/nvme/host/pci.c                            |  2 +-
 drivers/opp/core.c                                 |  4 +-
 drivers/pci/endpoint/pci-ep-msi.c                  |  4 +-
 drivers/platform/x86/amd/hsmp/acpi.c               |  5 +--
 .../platform/x86/hp/hp-bioscfg/enum-attributes.c   |  4 +-
 drivers/platform/x86/intel/pmc/pwrm_telemetry.c    |  3 +-
 drivers/pmdomain/core.c                            |  2 +-
 drivers/power/reset/reboot-mode.c                  |  6 +--
 drivers/power/sequencing/core.c                    |  2 +-
 drivers/power/sequencing/pwrseq-pcie-m2.c          |  2 +-
 drivers/power/supply/power_supply_core.c           |  6 +--
 drivers/ptp/ptp_chardev.c                          |  2 +-
 drivers/s390/block/dasd.c                          |  2 +-
 drivers/scsi/fnic/fnic_debugfs.c                   |  2 +-
 drivers/scsi/leapraid/leapraid_func.c              | 52 +++++++++-------------
 drivers/scsi/scsi_scan.c                           |  2 +-
 drivers/soc/bcm/brcmstb/common.c                   |  2 +-
 drivers/spi/spi-offload.c                          |  2 +-
 drivers/staging/greybus/raw.c                      |  2 +-
 drivers/staging/media/atomisp/pci/sh_css.c         | 30 +++++--------
 .../staging/media/atomisp/pci/sh_css_firmware.c    |  4 +-
 drivers/tee/qcomtee/user_obj.c                     |  3 +-
 drivers/thunderbolt/stream.c                       | 12 +++--
 drivers/tty/moxa.c                                 |  3 +-
 drivers/tty/vt/consolemap.c                        |  3 +-
 drivers/ufs/core/ufs-txeq.c                        |  2 +-
 drivers/ufs/host/ufs-qcom.c                        |  2 +-
 drivers/usb/gadget/function/f_ncm.c                |  2 +-
 drivers/usb/usbip/usbip_common.c                   |  2 +-
 drivers/xen/grant-table.c                          |  2 +-
 fs/9p/vfs_dentry.c                                 |  3 +-
 fs/afs/dir.c                                       |  2 +-
 fs/afs/symlink.c                                   |  3 +-
 fs/binfmt_misc.c                                   |  7 ++-
 fs/ceph/addr.c                                     |  2 +-
 fs/ceph/mds_client.c                               |  2 +-
 fs/ceph/subvolume_metrics.c                        |  2 +-
 fs/coredump.c                                      |  2 +-
 fs/ext4/fast_commit.c                              |  4 +-
 fs/fuse/file.c                                     |  3 +-
 fs/fuse/readdir.c                                  |  2 +-
 fs/hfs/bnode.c                                     |  2 +-
 fs/namespace.c                                     |  2 +-
 fs/nfsd/export.c                                   |  7 ++-
 fs/nfsd/nfs4callback.c                             |  4 +-
 fs/nfsd/nfs4state.c                                |  7 +--
 fs/nfsd/nfsctl.c                                   |  2 +-
 fs/ntfs/bitmap.c                                   |  2 +-
 fs/ntfs/compress.c                                 |  8 ++--
 fs/ntfs/dir.c                                      | 16 +++----
 fs/ntfs/ea.c                                       |  2 +-
 fs/ntfs/index.c                                    |  2 +-
 fs/ntfs/logfile.c                                  |  2 +-
 fs/ntfs/mft.c                                      | 10 +++--
 fs/ntfs/runlist.c                                  | 14 +++---
 fs/ntfs/super.c                                    |  2 +-
 fs/overlayfs/readdir.c                             |  2 +-
 fs/smb/client/cifs_swn.c                           |  2 +-
 fs/smb/client/dfs_cache.c                          |  2 +-
 fs/smb/client/smb2inode.c                          |  2 +-
 fs/smb/server/ksmbd_work.c                         |  2 +-
 fs/smb/server/smb2pdu.c                            |  2 +-
 fs/xfs/libxfs/xfs_da_btree.c                       |  4 +-
 init/initramfs_test.c                              |  2 +-
 io_uring/napi.c                                    |  2 +-
 io_uring/zcrx.c                                    |  4 +-
 kernel/bpf/diagnostics.c                           |  2 +-
 kernel/bpf/hashtab.c                               |  2 +-
 kernel/bpf/liveness.c                              |  2 +-
 kernel/bpf/log.c                                   |  2 +-
 kernel/bpf/verifier.c                              |  5 +--
 kernel/dma/map_benchmark.c                         |  3 +-
 kernel/events/core.c                               |  5 +--
 kernel/futex/core.c                                |  6 +--
 kernel/irq/manage.c                                |  2 +-
 kernel/jump_label.c                                |  5 +--
 kernel/kthread.c                                   |  2 +-
 kernel/sched/ext/cid.c                             | 16 +++----
 kernel/sched/ext/ext.c                             |  2 +-
 kernel/sched/ext/sub.c                             |  2 +-
 kernel/trace/fprobe.c                              |  2 +-
 kernel/trace/ring_buffer.c                         |  4 +-
 kernel/trace/trace_eprobe.c                        |  2 +-
 kernel/trace/trace_remote.c                        | 10 ++---
 lib/test_rhashtable.c                              |  2 +-
 lib/test_workqueue.c                               |  4 +-
 lib/tests/kunit_iov_iter.c                         |  2 +-
 mm/damon/tests/vaddr-kunit.h                       |  2 +-
 net/batman-adv/hard-interface.c                    |  2 +-
 net/bluetooth/hci_sync.c                           |  3 +-
 net/devlink/netlink.c                              |  2 +-
 net/devlink/param.c                                |  7 ++-
 net/ipv4/tcp_ipv4.c                                |  4 +-
 net/mac80211/nan.c                                 |  3 +-
 net/mctp/test/route-test.c                         |  2 +-
 net/mctp/test/utils.c                              |  2 +-
 net/netfilter/nf_tables_api.c                      |  2 +-
 net/netfilter/nfnetlink_cttimeout.c                |  2 +-
 net/rds/info.c                                     |  2 +-
 net/rxrpc/key.c                                    |  2 +-
 net/sched/act_gate.c                               |  4 +-
 net/sched/act_tunnel_key.c                         |  2 +-
 net/sunrpc/auth_gss/gss_krb5_crypto.c              |  5 +--
 net/sunrpc/svcauth_unix.c                          |  4 +-
 net/sunrpc/xdr.c                                   |  3 +-
 net/unix/af_unix.c                                 |  4 +-
 net/wireless/core.c                                |  5 +--
 net/wireless/nl80211.c                             |  9 ++--
 security/integrity/ima/ima_queue.c                 |  3 +-
 sound/core/compress_offload.c                      |  4 +-
 sound/core/control.c                               |  6 +--
 sound/core/control_led.c                           |  2 +-
 sound/core/init.c                                  |  2 +-
 sound/core/misc.c                                  |  2 +-
 sound/core/oss/mixer_oss.c                         |  2 +-
 sound/core/pcm_native.c                            |  2 +-
 sound/core/seq/oss/seq_oss_synth.c                 |  2 +-
 sound/core/seq/seq_clientmgr.c                     |  2 +-
 sound/core/seq/seq_virmidi.c                       |  2 +-
 sound/core/timer.c                                 |  2 +-
 sound/drivers/aloop.c                              |  4 +-
 sound/isa/gus/gus_dma.c                            |  2 +-
 sound/pci/cs46xx/cs46xx_lib.c                      |  2 +-
 sound/pci/ctxfi/ctamixer.c                         |  4 +-
 sound/pci/ctxfi/ctdaio.c                           |  4 +-
 sound/pci/ctxfi/ctsrc.c                            |  4 +-
 sound/pci/ctxfi/cttimer.c                          |  2 +-
 sound/pci/emu10k1/emufx.c                          |  2 +-
 sound/soc/codecs/simple-amplifier.c                |  2 +-
 sound/soc/generic/simple-card-utils.c              |  2 +-
 sound/soc/meson/gx-formatter.c                     |  2 +-
 sound/soc/qcom/qdsp6/q6afe.c                       |  2 +-
 sound/soc/sdca/sdca_functions.c                    | 19 ++++----
 sound/soc/sof/sof-client-probes-ipc4.c             |  2 +-
 sound/soc/sof/sof-client.c                         |  2 +-
 sound/sparc/amd7930.c                              |  2 +-
 304 files changed, 637 insertions(+), 726 deletions(-)
]

26/2 2026/10/13 22:18 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24691
							output: 44
							thoughts: 201
						

Thoughts:
Here's my analysis of the code snippet, thinking out loud as an expert:

**Investigating `kzalloc_objs` Usage and Potential Vulnerability**

Okay, so `kzalloc_objs`... right, it's essentially a wrapper around `kcalloc` or `kmalloc_array` with the `__GFP_ZERO` flag, ensuring the allocated memory is zeroed out. No surprises there. But, looking at where it's *used* is key. Hmm, it's in `fill_object_idr`:

```c
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```

Before this, the code probably used `kcalloc` with `GFP_KERNEL`. Got it. The line of code is interesting; it is allocating memory for an array of `drm_mode_object` pointers. Now, if `object_count` is large, `kzalloc_objs` will attempt a large, contiguous allocation using `GFP_KERNEL`. That's where things get potentially dicey.

The real question is, where does `object_count` come from? Is it user-controlled? That's the critical point. If it's derived from user space without a robust upper bound check, we could have a vulnerability. A maliciously crafted `object_count` value could lead to a massive allocation request, potentially leading to a denial-of-service or even system instability. I need to trace this back. Is there an upper bound check for `object_count`? Let me see... I'll check `drm_mode_create_lease_ioctl`, which is probably the source of the `object_count` value.



27/2 2026/10/13 22:19 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_mode_create_lease_ioctl]

Results:
map[SourceCode: 469:	/*
 470:	 * The master associated with the specified file will have a lease
 471:	 * created containing the objects specified in the ioctl structure.
 472:	 * A file descriptor will be allocated for that and returned to the
 473:	 * application.
 474:	 */
 475:	int drm_mode_create_lease_ioctl(struct drm_device *dev,
 476:					void *data, struct drm_file *lessor_priv)
 477:	{
 478:		struct drm_mode_create_lease *cl = data;
 479:		size_t object_count;
 480:		int ret = 0;
 481:		struct idr leases;
 482:		struct drm_master *lessor;
 483:		struct drm_master *lessee = NULL;
 484:		struct file *lessee_file = NULL;
 485:		struct file *lessor_file = lessor_priv->filp;
 486:		struct drm_file *lessee_priv;
 487:		int fd = -1;
 488:		uint32_t *object_ids;
 489:	
 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
 535:			ret = fd;
 536:			goto out_lessor;
 537:		}
 538:	
 539:		drm_dbg_lease(dev, "Creating lease\n");
 540:		/* lessee will take the ownership of leases */
 541:		lessee = drm_lease_create(lessor, &leases);
 542:	
 543:		if (IS_ERR(lessee)) {
 544:			ret = PTR_ERR(lessee);
 545:			idr_destroy(&leases);
 546:			goto out_leases;
 547:		}
 548:	
 549:		/* Clone the lessor file to create a new file for us */
 550:		drm_dbg_lease(dev, "Allocating lease file\n");
 551:		lessee_file = file_clone_open(lessor_file);
 552:		if (IS_ERR(lessee_file)) {
 553:			ret = PTR_ERR(lessee_file);
 554:			goto out_lessee;
 555:		}
 556:	
 557:		lessee_priv = lessee_file->private_data;
 558:		/* Change the file to a master one */
 559:		drm_master_put(&lessee_priv->master);
 560:		lessee_priv->master = lessee;
 561:		lessee_priv->is_master = 1;
 562:		lessee_priv->authenticated = 1;
 563:	
 564:		/* Pass fd back to userspace */
 565:		drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id);
 566:		cl->fd = fd;
 567:		cl->lessee_id = lessee->lessee_id;
 568:	
 569:		/* Hook up the fd */
 570:		fd_install(fd, lessee_file);
 571:	
 572:		drm_master_put(&lessor);
 573:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
 574:		return 0;
 575:	
 576:	out_lessee:
 577:		drm_master_put(&lessee);
 578:	
 579:	out_leases:
 580:		put_unused_fd(fd);
 581:	
 582:	out_lessor:
 583:		drm_master_put(&lessor);
 584:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
 585:		return ret;
 586:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

28/2 2026/10/13 22:19 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27118
							output: 39
							thoughts: 189
						

Thoughts:
**Vulnerability Analysis: Object Count Integer Overflow**

Okay, so I'm looking at this code and immediately I see a potential issue. There's no upper bound check on `object_count` before it's assigned here:

```c
		object_count = cl->object_count;
...
		if (object_count != 0) {
			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
						       object_count, sizeof(__u32));
```

That's a red flag. It looks like it's just grabbing the value directly from `cl->object_count`. Then, if it isn't zero, it goes on to allocate memory with `memdup_array_user`, which is going to be the source of the problem. `memdup_array_user` is crucial here because it uses `memdup_user`, and I know from experience that `memdup_user` ultimately calls `kmem_buckets_alloc_track_caller` with `GFP_USER | __GFP_NOWARN`. And that's what's got me concerned. `kmem_buckets_alloc_track_caller`... hmm, I recall that being linked to `kvmalloc` in some contexts.

I need to confirm if `kmem_buckets_alloc_track_caller` *can* use `kvmalloc`. Time to double-check the `mm/util.c` or `include/linux/slab.h` source to be absolutely sure what that function is doing. Integer overflow, particularly when combined with memory allocation, is a classic vulnerability vector. This needs a closer look.



29/2 2026/10/13 22:19 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/util.c Name:kmem_buckets_alloc_track_caller]

Results:
map[SourceCode: SourceFile:]

30/2 2026/10/13 22:19 llm debugger
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27732
							output: 33
							thoughts: 12
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, keeping in mind the audience is an expert:

**Revisiting `memdup_user`**

Alright, time to circle back to `memdup_user`. I've been working on this area, and I want to re-examine that specific function. I'm probably picking it apart for a reason - likely a subtle bug report, performance issue, or security concern has piqued my interest. Perhaps a recent patch related to memory handling sparked a new line of thinking. It could be I am trying to determine if I missed something during the initial code review, or have a deeper understanding after further context has presented itself. Let's see if the assumptions I had before hold up to another close look. It warrants a fresh perspective.



31/2 2026/10/13 22:21 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/util.c Name:memdup_user]

Results:
map[SourceCode: 208:	/**
 209:	 * memdup_user - duplicate memory region from user space
 210:	 *
 211:	 * @src: source address in user space
 212:	 * @len: number of bytes to copy
 213:	 *
 214:	 * Return: an ERR_PTR() on failure.  Result is physically
 215:	 * contiguous, to be freed by kfree().
 216:	 */
 217:	void *memdup_user(const void __user *src, size_t len)
 218:	{
 219:		void *p;
 220:	
 221:		p = kmem_buckets_alloc_track_caller(user_buckets, len, GFP_USER | __GFP_NOWARN);
 222:		if (!p)
 223:			return ERR_PTR(-ENOMEM);
 224:	
 225:		if (copy_from_user(p, src, len)) {
 226:			kfree(p);
 227:			return ERR_PTR(-EFAULT);
 228:		}
 229:	
 230:		return p;
 231:	}
 SourceFile:mm/util.c]

32/2 2026/10/13 22:21 llm debugger
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28297
							output: 26
							thoughts: 17
						

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

**Kernel Memory Allocation Analysis: Grepping for Clues**

Alright, I'm diving in to diagnose a kernel memory issue. My first instinct, given my experience, is to zero in on potential memory allocation problems. And the most direct way to start that investigation is to look for clues in the allocation calls. I'm thinking of focusing my grep query on `kmem_buckets_alloc_track_caller`. It’s a pretty good starting point to identify specific points in the kernel code where memory is being allocated, and tracking down the call path with the addition of the "track_caller" variant should give me a specific stack trace. This should give me a quick way to pinpoint the problematic code. This is definitely my starting point. From there, I can refine the search, look at callers, and start building a more comprehensive picture. Let's see what we find.



33/2 2026/10/13 22:22 tool grepper
0m Args:
map[Expression:#define kmem_buckets_alloc_track_caller]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1183-
include/linux/slab.h:1184:#define kmem_buckets_alloc_track_caller(_b, _size, _flags) \
include/linux/slab.h-1185-	kmem_buckets_alloc_node_track_caller(_b, _size, _flags, NUMA_NO_NODE)
]

34/2 2026/10/13 22:22 llm debugger
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28694
							output: 28
							thoughts: 19
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, presented in the first person:

**Diving into Kernel Memory Allocation Tracking**

Alright, so I'm thinking about digging into kernel memory allocation tracking. My initial instinct is to use `grep`. Specifically, I'm going to search for the string `kmem_buckets_alloc_node_track_caller`. That's a good starting point, right? It's a key function related to tracking kernel memory allocations, likely tied to the `kmem_cache` subsystem and its associated debugging features, specifically aimed at identifying the caller responsible for a particular allocation. Searching for this function should quickly pinpoint relevant code paths. It's a quick and dirty, but effective way, to get a handle on where allocation tracking is being used in the current codebase. From there, I can refine the search, depending on what the results give me. I'm hoping to quickly identify the locations involved in this particular allocation path!



35/2 2026/10/13 22:24 tool grepper
0m Args:
map[Expression:#define kmem_buckets_alloc_node_track_caller]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1180-
include/linux/slab.h:1181:#define kmem_buckets_alloc_node_track_caller(_b, _size, _flags, _node)	\
include/linux/slab.h-1182-	alloc_hooks(__kmalloc_node_track_caller_noprof(PASS_KMALLOC_PARAMS(_size, _b, __kmalloc_token(_size)), _flags, _node, _RET_IP_))
]

36/2 2026/10/13 22:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29121
							output: 35
							thoughts: 726
						

Thoughts:
**Analyzing Memory Allocation in `fill_object_idr`**

Okay, let's break this down. It seems we're seeing an interesting interaction between `memdup_user` (and consequently, `memdup_array_user`) and `kzalloc_objs` within `fill_object_idr`. The key issue is how they handle memory allocation size limits imposed by `kmalloc` versus `kvmalloc`.

First, I realize `memdup_user` is using `kmalloc`, not `kvmalloc`. Because of this, it can only allocate up to `MAX_PAGE_ORDER` which is usually around 4MB. Now, if the `object_count` is 1,000,000, then the data to be copied by `memdup_user` is `4,000,000` bytes, which, in this case, is safely within the `4MB` limit and `memdup_user` succeeds.

However, after that, `fill_object_idr` calls `kzalloc_objs`, which then attempts to allocate memory for the object pointers. This allocation size is `1,000,000 * 8 = 8,000,000` bytes, which exceeds the `kmalloc` limit and requires order 11, which exceeds the allowed order. Since `kzalloc_objs` uses `kmalloc` without `__GFP_NOWARN`, it triggers a warning in `alloc_order_allowed`.

My first thought is to fix this by using `kvmalloc_array` or `kvzalloc` for `objects` in `fill_object_idr`.

But wait, `memdup_array_user` *also* uses `kmalloc` (through `memdup_user`), which is relevant here. If `object_count` is larger than 1,048,576 (for example, 2,000,000), `memdup_array_user` will attempt to allocate 8MB, and because it uses `__GFP_NOWARN`, it will simply fail and return `-ENOMEM` silently. `kzalloc_objs` does *not* use `__GFP_NOWARN`, leading to the warning, but only if `memdup_array_user` *succeeds*, yet `kzalloc_objs` *fails*. This creates a particular window of vulnerability, it looks like `sizeof(__u32)` is 4, and `sizeof(struct drm_mode_object *)` is 8. So, when the `object_count` is between `4MB / 8 = 524,288` and `4MB / 4 = 1,048,576`, `memdup_array_user` succeeds, but `kzalloc_objs` fails, thus the warning!

So, the optimal fix is to replace `kmalloc` with `kvmalloc_array` for this allocation:

```c
	objects = kvmalloc_array(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL | __GFP_ZERO);
```

While `kvmalloc_array` is the better solution, maybe we can just limit the size of `object_count`? I should probably check if there is an upper limit to the number of objects we can support in a lease. Let me look at that.



37/2 2026/10/13 22:24 tool grepper
0m Args:
map[Expression:object_count PathPrefixes:[drivers/gpu/drm/drm_lease.c]]

Results:
map[Output:drivers/gpu/drm/drm_lease.c=346=static int validate_lease(struct drm_device *dev,
drivers/gpu/drm/drm_lease.c:347:			  int object_count,
drivers/gpu/drm/drm_lease.c-348-			  struct drm_mode_object **objects,
--
drivers/gpu/drm/drm_lease.c-358-
drivers/gpu/drm/drm_lease.c:359:	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c-360-		if (objects[o]->type == DRM_MODE_OBJECT_CRTC && has_crtc == -1) {
--
drivers/gpu/drm/drm_lease.c=378=static int fill_object_idr(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-380-			   struct idr *leases,
drivers/gpu/drm/drm_lease.c:381:			   int object_count,
drivers/gpu/drm/drm_lease.c-382-			   u32 *object_ids)
--
drivers/gpu/drm/drm_lease.c-388-
drivers/gpu/drm/drm_lease.c:389:	objects = kzalloc_objs(struct drm_mode_object *, object_count);
drivers/gpu/drm/drm_lease.c-390-	if (!objects)
--
drivers/gpu/drm/drm_lease.c-394-	   and check for validity. */
drivers/gpu/drm/drm_lease.c:395:	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c-396-		objects[o] = drm_mode_object_find(dev, lessor_priv,
--
drivers/gpu/drm/drm_lease.c-410-
drivers/gpu/drm/drm_lease.c:411:	ret = validate_lease(dev, object_count, objects, universal_planes);
drivers/gpu/drm/drm_lease.c-412-	if (ret) {
--
drivers/gpu/drm/drm_lease.c-418-	   universal planes */
drivers/gpu/drm/drm_lease.c:419:	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c-420-		struct drm_mode_object *obj = objects[o];
--
drivers/gpu/drm/drm_lease.c-460-out_free_objects:
drivers/gpu/drm/drm_lease.c:461:	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c-462-		if (objects[o])
--
drivers/gpu/drm/drm_lease.c=475=int drm_mode_create_lease_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-478-	struct drm_mode_create_lease *cl = data;
drivers/gpu/drm/drm_lease.c:479:	size_t object_count;
drivers/gpu/drm/drm_lease.c-480-	int ret = 0;
--
drivers/gpu/drm/drm_lease.c-506-
drivers/gpu/drm/drm_lease.c:507:	object_count = cl->object_count;
drivers/gpu/drm/drm_lease.c-508-
--
drivers/gpu/drm/drm_lease.c-510-	idr_init(&leases);
drivers/gpu/drm/drm_lease.c:511:	if (object_count != 0) {
drivers/gpu/drm/drm_lease.c-512-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
drivers/gpu/drm/drm_lease.c:513:					       object_count, sizeof(__u32));
drivers/gpu/drm/drm_lease.c-514-		if (IS_ERR(object_ids)) {
--
drivers/gpu/drm/drm_lease.c-521-		ret = fill_object_idr(dev, lessor_priv, &leases,
drivers/gpu/drm/drm_lease.c:522:				      object_count, object_ids);
drivers/gpu/drm/drm_lease.c-523-		kfree(object_ids);
]

38/2 2026/10/13 22:24 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31782
							output: 37
							thoughts: 510
						

Thoughts:
**Analyzing Memory Allocation in DRM Lease Creation**

Okay, so I'm looking at this code and initially thought there wasn't a hard limit on `object_count`. But hold on, `memdup_array_user` is using `kmalloc` internally (through `memdup_user`), which means a large `object_count` could lead to an `-ENOMEM` error, although it won't warn due to the use of `__GFP_NOWARN`. However, the `kzalloc_objs` function *does* warn due to using `kmalloc` without `__GFP_NOWARN`. And of course, `object_ids` is freed with `kfree()`.

The immediate thought is to switch `kzalloc_objs` to `kvmalloc_array`, which would squash that warning. But then I remember `memdup_array_user` has its own limit due to its use of `kmalloc` (around 4MB). If we *really* need to handle more than 4MB for `object_ids`, then we'd need to consider `vmemdup_user` or something similar, which I doubt.

Actually, does a lease even *need* a large number of objects? DRM leases are usually about a few CRTCs, connectors, and planes. The total number of objects in a DRM device is typically small, often under a thousand. So, in practice, `object_count` likely won't be enormous. It's user space that we're talking about, so we have to consider what they *could* pass.

So, if we use `kvmalloc_array` for `objects`, we can at least avoid the warning. Wait, `kvmalloc_array` doesn't warn on large sizes; it just falls back to `vmalloc`. I wonder if there is a `kvzalloc_objs`? No, there isn't. So we can use `kvzalloc` or `kvmalloc_array`, either of those look good. I just need to make sure to free `objects` using `kvfree` if I use `kvmalloc_array`, since that's what's allocated.

Okay, let me double-check that `memdup_array_user` really uses `kmalloc` and not `kvmalloc`. Gotta be certain about this!



39/2 2026/10/13 22:24 tool codesearch-definition-source
0m Args:
map[ContextFile:include/linux/string.h Name:memdup_array_user]

Results:
map[SourceCode:  22:	/**
  23:	 * memdup_array_user - duplicate array from user space
  24:	 * @src: source address in user space
  25:	 * @n: number of array members to copy
  26:	 * @size: size of one array member
  27:	 *
  28:	 * Return: an ERR_PTR() on failure. Result is physically
  29:	 * contiguous, to be freed by kfree().
  30:	 */
  31:	static inline __realloc_size(2, 3)
  32:	void *memdup_array_user(const void __user *src, size_t n, size_t size)
  33:	{
  34:		size_t nbytes;
  35:	
  36:		if (check_mul_overflow(n, size, &nbytes))
  37:			return ERR_PTR(-EOVERFLOW);
  38:	
  39:		return memdup_user(src, nbytes);
  40:	}
 SourceFile:include/linux/string.h]

40/2 2026/10/13 22:25 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33122
							output: 34
							thoughts: 671
						

Thoughts:
**Analyzing Potential Memory Allocation Issues in DRM Lease Creation**

Okay, so here's the situation. I'm looking at the memory allocation within `drm_mode_create_lease_ioctl`, specifically the handling of `object_ids`. I see that `memdup_array_user` is used, and the memory returned is subsequently freed using `kfree()`, which means `object_ids` is initially allocated via `kmalloc`, presumably through `memdup_user`.

Now, if `object_count` is set to something large, like 1,000,000, `memdup_array_user` allocates a significant chunk – 4MB in this case. Given that `MAX_PAGE_ORDER` is 10, 4MB falls within that limit, so `memdup_array_user` succeeds, which seems reasonable.

The follow-up allocation in `fill_object_idr` attempts to grab 8MB. Since `kzalloc_objs` uses `kmalloc` without `__GFP_NOWARN`, it triggers a warning because it's exceeding the `MAX_PAGE_ORDER` limit for `kmalloc`.

My first thought is, "Well, if we change `kzalloc_objs` to `kvmalloc_array`, we can handle larger allocations." But I also realize that the `memdup_array_user` step has a limit of 4MB. If the userspace code gives us `object_count = 2,000,000`, the allocation needed would be 8MB. Will `memdup_array_user` itself cause a warning? No. It uses `GFP_USER | __GFP_NOWARN` so it won't warn, but will simply return `-ENOMEM`.

So, the only warning we're seeing originates from `kzalloc_objs` because of the lack of `__GFP_NOWARN` and because it can be larger than what's allocated by `memdup_array_user`, which is only 4 bytes per element instead of 8.

The next question I have is whether such a large `object_count` even makes sense. A DRM device has a finite number of objects, limited by things like `dev->mode_config.num_crtc` and `num_connector`. The total number is likely a few thousand at most. But the `drm_mode_create_lease_ioctl` doesn't seem to validate `object_count` against any upper bound.

So here's what I'm thinking: we could simply use `kvmalloc_array` for `objects` and `kvfree` to free it. Alternatively, we could consider using `kvmalloc_array` for *both* `object_ids` and `objects`. Wait, `memdup_array_user` is used for `object_ids`, so we have to use `kvmalloc` for that too. There's `vmemdup_user` which uses `kvmalloc`, but there's no array version of `vmemdup_user`, `vmemdup_array_user`.

Ultimately, using `kvmalloc_array` for `objects` seems like the most standard approach to deal with large allocations that may exceed `MAX_PAGE_ORDER`. I need to check if `kvmalloc_array` is used elsewhere in `drm_lease.c` as a sanity check.



41/2 2026/10/13 22:25 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:kvmalloc PathPrefixes:[drivers/gpu/drm/drm_lease.c]]

Results:
map[Output:]

42/2 2026/10/13 22:25 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 34569
							output: 41
							thoughts: 22
						

Thoughts:
Okay, here's my summary, tailored for an expert audience, as if it were my thought process:

**Internal Review of Functionality**

No, that's not quite right. It's not behaving as expected. Time to take a fresh look at `fill_object_idr`. I need to re-examine the logic within that function, specifically how it handles object identification and potential IDR conflicts. I'm going to start by reviewing the assumptions made about input data and the control flow within `fill_object_idr` to pinpoint the source of the deviation. I have a hunch, but need to rule out certain areas first. It's frustrating to run into this.



43/2 2026/10/13 22:25 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:fill_object_idr]

Results:
map[SourceCode: 378:	static int fill_object_idr(struct drm_device *dev,
 379:				   struct drm_file *lessor_priv,
 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
 465:		kfree(objects);
 466:		return ret;
 467:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

44/2 2026/10/13 22:26 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 36272
							output: 31
							thoughts: 743
						

Thoughts:
**Reflecting on Memory Allocation Strategies**

Okay, so I'm looking at changing `kzalloc_objs` to `kvmalloc_array` with `__GFP_ZERO` in this DRM code, and the corresponding `kfree` to `kvfree`. Seems straightforward enough, right? But then I remember `memdup_array_user` uses `kmalloc`, and that's going to fail if the `object_count` gets too large – like, over 1,048,576 elements, assuming a 4MB limit. Using `kvmalloc_array` for `objects` means it could potentially be allocated with `vmalloc` if it's a very large array.

Now I remember that `memdup_array_user` is used for `object_ids` within `drm_mode_create_lease_ioctl`, which is a problem:

```c
		if (object_count != 0) {
			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
						       object_count, sizeof(__u32));
			if (IS_ERR(object_ids)) {
				ret = PTR_ERR(object_ids);
				idr_destroy(&leases);
				goto out_lessor;
			}
```

If `object_count` gets big, `memdup_array_user` will quietly fail with `-ENOMEM`. The question is, how do we handle situations where we *might* have a large `object_count`?

Realistically, though, `object_count` *shouldn't* be enormous. Let's see if we can establish an upper limit. I'll check if there's any implicit limit on the total number of DRM objects. Typically, DRM devices have just a few dozen. Maybe we can set a reasonable cap, say, 1024 or 4096?

Wait, `object_count` represents the number of objects a user wants to lease. If we restrict it, there's a risk of breaking some userspace applications that need to lease many objects, like those managing multiple planes. But, a million objects? Probably not.

However, using `kvmalloc_array` and `kvfree` is the proper, standard approach for arrays where the size is user-controlled, without imposing arbitrary limits.

Thinking back to `memdup_array_user`, which uses `kmalloc`, if we need to support very large arrays, we should be using `vmemdup_user` instead. But that code path is already using `memdup_array_user`, which means it doesn't support the case of `object_count` > 1,048,576 anyway.

So, if I just swap `kzalloc_objs` for `kvmalloc_array` and `kfree` for `kvfree`, it should resolve the warning I was getting.

Hold on a sec... `kzalloc_objs` is a macro expanding to `__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)`. Is there a `kvzalloc_objs`? No.

Actually, `kvmalloc_array` *is* perfectly fine here.

Let me just quickly verify `kvmalloc_array` is actually available. Yep, it's in `include/linux/slab.h`. Wait, `kvcalloc` is also available. Let me check `kvcalloc`.



45/2 2026/10/13 22:26 tool grepper
0m Args:
map[Expression:kvcalloc PathPrefixes:[include/linux/slab.h]]

Results:
map[Output:include/linux/slab.h=1367=_kvmalloc_array_node_noprof(size_t n, size_t size, gfp_t flags, int node, kmalloc_token_t token)
--
include/linux/slab.h-1377-#define kvmalloc_array_noprof(...)		kvmalloc_array_node_noprof(__VA_ARGS__, NUMA_NO_NODE)
include/linux/slab.h:1378:#define kvcalloc_node_noprof(_n,_s,_f,_node)	kvmalloc_array_node_noprof(_n,_s,(_f)|__GFP_ZERO,_node)
include/linux/slab.h:1379:#define kvcalloc_noprof(...)			kvcalloc_node_noprof(__VA_ARGS__, NUMA_NO_NODE)
include/linux/slab.h-1380-
include/linux/slab.h-1381-#define kvmalloc_array(...)			alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__))
include/linux/slab.h:1382:#define kvcalloc_node(...)			alloc_hooks(kvcalloc_node_noprof(__VA_ARGS__))
include/linux/slab.h:1383:#define kvcalloc(...)				alloc_hooks(kvcalloc_noprof(__VA_ARGS__))
include/linux/slab.h-1384-
]

46/2 2026/10/13 22:26 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 38167
							output: 44
							thoughts: 418
						

Thoughts:
**Considering Memory Allocation Strategies**

Okay, so `kvcalloc` is definitely an option here. I can use `kvcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)` to allocate the initial array and then use `kvfree(objects)` to free it later. That's straightforward enough.

But hold on, what about `memdup_array_user`? I need to think through the potential impact of different `object_count` values. If `object_count` is really large, say 2,000,000, `memdup_array_user` is likely to silently fail with `-ENOMEM`. That's not ideal, so I'll need to handle that. On the other hand, if `object_count` is 1,000,000, `memdup_array_user` *should* succeed because it allocates 4,000,000 bytes, which is of order 10 and therefore, <= MAX_PAGE_ORDER. Then `kvcalloc` will allocate 8,000,000 bytes using `vmalloc` because it's > 4MB.

I'm starting to get to the details. This `vmalloc` will succeed, but will it trigger a warning? Not necessarily. Then the loop I have will run 1,000,000 times. That is what I need to consider.

Now I'm looking at the core of the problem. If `object_count` is 1,000,000, the loop itself will take a significant amount of time. I do not have a problem with `drm_mode_object_find` as it is relatively fast (idr lookup). But if it takes too long, it might trigger a soft lockup. I need to keep that in mind.

Hmm, does `drm_mode_object_find` acquire a spinlock or a mutex? That's critical information, and I need to check the source code for `drm_mode_object_find` to be sure.



47/2 2026/10/13 22:26 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_mode_object.c Name:drm_mode_object_find]

Results:
map[SourceCode: 166:	/**
 167:	 * drm_mode_object_find - look up a drm object with static lifetime
 168:	 * @dev: drm device
 169:	 * @file_priv: drm file
 170:	 * @id: id of the mode object
 171:	 * @type: type of the mode object
 172:	 *
 173:	 * This function is used to look up a modeset object. It will acquire a
 174:	 * reference for reference counted objects. This reference must be dropped again
 175:	 * by callind drm_mode_object_put().
 176:	 */
 177:	struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
 178:			struct drm_file *file_priv,
 179:			uint32_t id, uint32_t type)
 180:	{
 181:		struct drm_mode_object *obj = NULL;
 182:	
 183:		obj = __drm_mode_object_find(dev, file_priv, id, type);
 184:		return obj;
 185:	}
 SourceFile:drivers/gpu/drm/drm_mode_object.c]

48/2 2026/10/13 22:26 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 39439
							output: 45
							thoughts: 14
						

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

**Diving into `__drm_mode_object_find`**

Alright, let's take a look at `__drm_mode_object_find`. I'm going to start by confirming its basic purpose – it's the core function for locating a specific DRM mode object, right? I'll probably be checking how it handles various object types and their associated IDs. My immediate concern is usually the robustness of the search: does it correctly handle potential null pointers or invalid ID inputs? Are there any obvious race conditions or locking issues that I should be aware of, especially if this function is called concurrently from different threads? I'll be keen on examining the internal data structures it's traversing, verifying how it handles different driver implementations. Finally, I'll be looking for any potential optimization opportunities. Can we do a more efficient lookup?



49/2 2026/10/13 22:27 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_mode_object.c Name:__drm_mode_object_find]

Results:
map[SourceCode: 138:	struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
 139:						       struct drm_file *file_priv,
 140:						       uint32_t id, uint32_t type)
 141:	{
 142:		struct drm_mode_object *obj = NULL;
 143:	
 144:		mutex_lock(&dev->mode_config.idr_mutex);
 145:		obj = idr_find(&dev->mode_config.object_idr, id);
 146:		if (obj && type != DRM_MODE_OBJECT_ANY && obj->type != type)
 147:			obj = NULL;
 148:		if (obj && obj->id != id)
 149:			obj = NULL;
 150:	
 151:		if (obj && drm_mode_object_lease_required(obj->type) &&
 152:		    !_drm_lease_held(file_priv, obj->id)) {
 153:			drm_dbg_kms(dev, "[OBJECT:%d] not included in lease", id);
 154:			obj = NULL;
 155:		}
 156:	
 157:		if (obj && obj->free_cb) {
 158:			if (!kref_get_unless_zero(&obj->refcount))
 159:				obj = NULL;
 160:		}
 161:		mutex_unlock(&dev->mode_config.idr_mutex);
 162:	
 163:		return obj;
 164:	}
 SourceFile:drivers/gpu/drm/drm_mode_object.c]

50/2 2026/10/13 22:27 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 40163
							output: 51
							thoughts: 383
						

Thoughts:
**Analyzing Potential Performance Issues in DRM Lease Handling**

Okay, so I'm looking at this `__drm_mode_object_find` function, and the first thing that jumps out is that it's taking the `dev->mode_config.idr_mutex`. If the `object_count` happens to be massive – say, a million – this thing is going to lock and unlock that mutex *a million times*. That could introduce a significant delay. I had to pause though, because I wasn't completely clear whether that `mutex_lock` was interruptible, but no it is not. The good news is that it drops the lock between iterations so it's not a complete hard lockup, but still…it seems like we should probably cap `object_count` at some reasonable value to prevent pathological cases.

But then I see the `idr_alloc` calls within the loop and, shoot, that could be a performance bottleneck too!
```c
		for (o = 0; o < object_count; o++) {
			struct drm_mode_object *obj = objects[o];
			u32 object_id = objects[o]->id;
...
			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
```
A large `object_count` means a lot of memory being allocated for the IDR. I'm getting a bad feeling about this; is there any similar limitation I can check for elsewhere?

Let me just quickly re-examine the `drm_mode_create_lease_ioctl` and make sure it has the fix. Oh, I see that replacing the `kcalloc` with `kvcalloc` seems to clear up that warning. But wait, this `kzalloc_objs` variable wasn't always around, it was introduced in commit `3a2c4d55e32a`. Before that, it was just `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`. Maybe I should check the history of `fill_object_idr` just to get some more context on what changes have been happening there.



51/2 2026/10/13 22:28 tool git-log
0m Args:
map[CodeRegexp: Count:10 SourcePath:drivers/gpu/drm/drm_lease.c SymbolName:fill_object_idr]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
948de84233d3 drm : Insert blank lines after declarations.
e40b76428842 drm/leases: Drop object_id validation for negative ids
b5f06893c499 drm: Rename crtc_idr as object_idr to KMS cleanups
968029057192 drm/lease: look at ->universal_planes only once
a0c1af46e9d7 drm/lease: debug output for lease creation
7591844c197c drm: Fix kerneldoc warnings for drm_lease
]

52/2 2026/10/13 22:28 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 41348
							output: 31
							thoughts: 18
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and written in the first person:

**Analyzing the Commit Hash: 32a92f8c8932**

Alright, let's dive into this specific commit hash: `32a92f8c8932`. My immediate instinct is to treat this as a potentially critical piece of the puzzle. I'll need to rapidly ascertain its significance. First, I'm thinking about the repository and branch context. Is this a recent commit, or something older? What's the merge history around it? Knowing that will drastically affect my interpretation.

Next, I'll automatically run through a mental checklist of potential areas this could touch. Is this code, documentation, or configuration? Based on past experience, could this be a security fix, a performance optimization, a refactor, or perhaps a completely innocuous change like a comment update? The format of the hash itself doesn’t tell me much, though a quick scan of the characters might trigger my memory for similar or related commits.

My next step would be to quickly pull up the commit diff, mentally parsing the changes. I'll look for specific keywords or patterns that stand out: API calls, data structure alterations, library updates, or anything that seems outside the ordinary. Are there any potential vulnerabilities that jump out, even in a cursory glance? I’ll immediately look for regressions or introduced bugs. If this commit modifies core functionality, I'll need to give it more attention than minor documentation change.

Depending on what I discover in the diff, my analysis path might diverge. If it looks benign, I'll likely file it away, noting it down for future reference in case any issues pop up. If it raises any red flags, I'll start digging deeper, perhaps by checking related commits or running tests to confirm the impact of these changes. My expertise is knowing where to look and what to look for based on my overall knowledge of the system. I have to make a quick judgement on how much attention to give to this commit.



53/2 2026/10/13 22:28 tool git-show
0m Args:
map[Commit:32a92f8c8932 Stat:true]

Results:
map[Output:commit 32a92f8c89326985e05dce8b22d3f0aa07a3e1bd
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Feb 21 20:03:00 2026 -0800

    Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
    
    This converts some of the visually simpler cases that have been split
    over multiple lines.  I only did the ones that are easy to verify the
    resulting diff by having just that final GFP_KERNEL argument on the next
    line.
    
    Somebody should probably do a proper coccinelle script for this, but for
    me the trivial script actually resulted in an assertion failure in the
    middle of the script.  I probably had made it a bit _too_ trivial.
    
    So after fighting that far a while I decided to just do some of the
    syntactically simpler cases with variations of the previous 'sed'
    scripts.
    
    The more syntactically complex multi-line cases would mostly really want
    whitespace cleanup anyway.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

 arch/arm/mach-omap1/mcbsp.c                        |  3 +-
 arch/arm64/kernel/vdso.c                           |  3 +-
 arch/loongarch/kernel/vdso.c                       |  3 +-
 arch/powerpc/kvm/book3s_pr.c                       |  3 +-
 arch/powerpc/mm/book3s64/mmu_context.c             |  6 ++--
 arch/powerpc/perf/hv-24x7.c                        |  3 +-
 arch/powerpc/perf/imc-pmu.c                        | 12 +++----
 arch/powerpc/platforms/powernv/idle.c              |  3 +-
 arch/powerpc/platforms/powernv/memtrace.c          |  3 +-
 arch/powerpc/platforms/powernv/opal-imc.c          |  3 +-
 arch/powerpc/platforms/powernv/opal-powercap.c     |  6 ++--
 arch/powerpc/platforms/powernv/opal-psr.c          |  3 +-
 .../powerpc/platforms/powernv/opal-sensor-groups.c |  6 ++--
 arch/powerpc/sysdev/mpic.c                         |  3 +-
 arch/powerpc/sysdev/mpic_msgr.c                    |  3 +-
 arch/riscv/kernel/vdso.c                           |  3 +-
 arch/s390/kvm/pci.c                                |  3 +-
 arch/s390/pci/pci.c                                |  3 +-
 arch/sh/drivers/pci/pcie-sh7786.c                  |  3 +-
 arch/sparc/kernel/smp_64.c                         |  3 +-
 arch/sparc/kernel/sys_sparc_64.c                   |  6 ++--
 arch/um/drivers/vector_kern.c                      |  6 ++--
 arch/x86/events/intel/uncore_snbep.c               |  3 +-
 arch/x86/hyperv/hv_init.c                          |  3 +-
 arch/x86/kernel/amd_nb.c                           |  3 +-
 arch/x86/kernel/cpu/sgx/main.c                     |  3 +-
 arch/x86/kvm/cpuid.c                               |  3 +-
 arch/x86/kvm/vmx/tdx.c                             |  3 +-
 block/blk-crypto-fallback.c                        |  3 +-
 block/blk-crypto-profile.c                         |  3 +-
 drivers/accel/amdxdna/amdxdna_gem.c                |  3 +-
 drivers/accel/ethosu/ethosu_drv.c                  |  3 +-
 drivers/accel/ethosu/ethosu_gem.c                  |  3 +-
 .../accel/habanalabs/common/command_submission.c   |  3 +-
 drivers/accel/habanalabs/common/debugfs.c          |  3 +-
 drivers/accel/habanalabs/common/hw_queue.c         |  3 +-
 drivers/accel/habanalabs/common/mmu/mmu.c          |  3 +-
 drivers/accel/habanalabs/common/security.c         | 12 +++----
 drivers/accel/habanalabs/gaudi2/gaudi2_security.c  |  3 +-
 drivers/accel/qaic/qaic_ssr.c                      |  3 +-
 drivers/acpi/apei/einj-core.c                      |  3 +-
 drivers/acpi/cppc_acpi.c                           |  3 +-
 drivers/acpi/mipi-disco-img.c                      |  3 +-
 drivers/acpi/platform_profile.c                    |  3 +-
 drivers/acpi/processor_perflib.c                   |  3 +-
 drivers/acpi/processor_throttling.c                |  3 +-
 drivers/acpi/riscv/irq.c                           |  3 +-
 drivers/acpi/scan.c                                |  3 +-
 drivers/ata/libahci_platform.c                     |  3 +-
 drivers/atm/he.c                                   |  3 +-
 drivers/atm/iphase.c                               | 12 +++----
 drivers/base/physical_location.c                   |  3 +-
 drivers/block/drbd/drbd_receiver.c                 |  3 +-
 drivers/block/ps3vram.c                            |  3 +-
 drivers/block/xen-blkback/blkback.c                |  3 +-
 drivers/block/xen-blkback/xenbus.c                 |  9 ++---
 drivers/block/xen-blkfront.c                       |  3 +-
 drivers/block/z2ram.c                              |  3 +-
 drivers/bus/mhi/ep/main.c                          |  3 +-
 drivers/bus/mhi/host/boot.c                        |  3 +-
 drivers/bus/mhi/host/init.c                        |  6 ++--
 drivers/char/agp/sworks-agp.c                      |  3 +-
 drivers/char/agp/uninorth-agp.c                    |  3 +-
 drivers/char/virtio_console.c                      |  3 +-
 drivers/clk/aspeed/clk-aspeed.c                    |  3 +-
 drivers/clk/bcm/clk-iproc-asiu.c                   |  3 +-
 drivers/clk/clk-gemini.c                           |  3 +-
 drivers/clk/clk-milbeaut.c                         |  3 +-
 drivers/clk/clk-stm32f4.c                          |  3 +-
 drivers/clk/imx/clk-imx6q.c                        |  3 +-
 drivers/clk/imx/clk-imx6sl.c                       |  3 +-
 drivers/clk/imx/clk-imx6sll.c                      |  3 +-
 drivers/clk/imx/clk-imx6sx.c                       |  3 +-
 drivers/clk/imx/clk-imx6ul.c                       |  3 +-
 drivers/clk/imx/clk-imx7ulp.c                      | 12 +++----
 drivers/clk/imx/clk-imx8mm.c                       |  3 +-
 drivers/clk/ingenic/cgu.c                          |  3 +-
 drivers/clk/mvebu/common.c                         |  3 +-
 drivers/clk/st/clk-flexgen.c                       |  3 +-
 drivers/clk/st/clkgen-pll.c                        |  3 +-
 drivers/clk/tegra/clk.c                            |  3 +-
 drivers/clocksource/dw_apb_timer.c                 |  3 +-
 drivers/clocksource/sh_cmt.c                       |  3 +-
 drivers/clocksource/sh_mtu2.c                      |  3 +-
 drivers/clocksource/sh_tmu.c                       |  3 +-
 drivers/comedi/drivers/ni_670x.c                   |  3 +-
 drivers/connector/cn_proc.c                        |  3 +-
 drivers/cpufreq/acpi-cpufreq.c                     |  3 +-
 drivers/cpufreq/armada-37xx-cpufreq.c              |  3 +-
 drivers/cpufreq/longhaul.c                         |  3 +-
 drivers/cpufreq/sparc-us2e-cpufreq.c               |  3 +-
 drivers/cpufreq/sparc-us3-cpufreq.c                |  3 +-
 drivers/crypto/amcc/crypto4xx_core.c               |  3 +-
 drivers/crypto/cavium/nitrox/nitrox_mbx.c          |  3 +-
 drivers/crypto/hisilicon/qm.c                      |  6 ++--
 drivers/crypto/hisilicon/sec2/sec_crypto.c         |  3 +-
 drivers/crypto/hisilicon/zip/zip_crypto.c          |  3 +-
 .../crypto/intel/qat/qat_common/adf_fw_counters.c  |  3 +-
 drivers/crypto/intel/qat/qat_common/adf_sriov.c    |  3 +-
 drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c |  3 +-
 drivers/crypto/stm32/stm32-cryp.c                  |  3 +-
 drivers/crypto/virtio/virtio_crypto_core.c         |  3 +-
 drivers/devfreq/governor_userspace.c               |  3 +-
 drivers/dma-buf/udmabuf.c                          |  3 +-
 drivers/dma/amba-pl08x.c                           |  3 +-
 drivers/dma/plx_dma.c                              |  3 +-
 drivers/dma/xilinx/zynqmp_dma.c                    |  3 +-
 drivers/edac/edac_device.c                         |  9 ++---
 drivers/edac/edac_mc.c                             |  3 +-
 drivers/edac/i7core_edac.c                         |  6 ++--
 drivers/extcon/extcon.c                            | 12 +++----
 drivers/firmware/efi/apple-properties.c            |  3 +-
 drivers/firmware/efi/test/efi_test.c               |  3 +-
 drivers/firmware/qcom/qcom_tzmem.c                 |  3 +-
 drivers/fpga/dfl.c                                 |  6 ++--
 drivers/gpib/agilent_82350b/agilent_82350b.c       |  3 +-
 drivers/gpib/agilent_82357a/agilent_82357a.c       |  3 +-
 drivers/gpib/common/gpib_os.c                      |  3 +-
 drivers/gpio/gpio-sim.c                            |  3 +-
 drivers/gpio/gpio-virtuser.c                       |  3 +-
 drivers/gpio/gpiolib-shared.c                      |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c            | 12 +++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c            |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c     | 18 ++++------
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c             |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c      |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c       |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c           |  3 +-
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c     |  3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c             |  3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c              |  3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c              |  3 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c              |  3 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c              |  3 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c           |  3 +-
 drivers/gpu/drm/amd/amdkfd/kfd_events.c            |  3 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c           |  3 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 12 +++----
 drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c  |  9 ++---
 drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c   | 42 ++++++++--------------
 .../amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c   |  3 +-
 .../amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c   |  3 +-
 .../amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c |  6 ++--
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  3 +-
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  6 ++--
 .../display/dc/resource/dce100/dce100_resource.c   |  3 +-
 .../display/dc/resource/dce110/dce110_resource.c   |  9 ++---
 .../display/dc/resource/dce112/dce112_resource.c   |  3 +-
 .../display/dc/resource/dce120/dce120_resource.c   |  3 +-
 .../amd/display/dc/resource/dce60/dce60_resource.c |  3 +-
 .../amd/display/dc/resource/dce80/dce80_resource.c |  3 +-
 .../amd/display/dc/resource/dcn10/dcn10_resource.c |  3 +-
 .../amd/display/dc/resource/dcn20/dcn20_resource.c |  9 ++---
 .../display/dc/resource/dcn201/dcn201_resource.c   |  3 +-
 .../amd/display/dc/resource/dcn21/dcn21_resource.c |  3 +-
 .../amd/display/dc/resource/dcn30/dcn30_resource.c |  9 ++---
 .../display/dc/resource/dcn301/dcn301_resource.c   |  9 ++---
 .../display/dc/resource/dcn302/dcn302_resource.c   | 27 +++++---------
 .../display/dc/resource/dcn303/dcn303_resource.c   | 27 +++++---------
 .../amd/display/dc/resource/dcn31/dcn31_resource.c | 12 +++----
 .../display/dc/resource/dcn314/dcn314_resource.c   | 12 +++----
 .../display/dc/resource/dcn315/dcn315_resource.c   | 12 +++----
 .../display/dc/resource/dcn316/dcn316_resource.c   | 12 +++----
 .../amd/display/dc/resource/dcn32/dcn32_resource.c | 12 +++----
 .../display/dc/resource/dcn321/dcn321_resource.c   | 12 +++----
 .../amd/display/dc/resource/dcn35/dcn35_resource.c | 12 +++----
 .../display/dc/resource/dcn351/dcn351_resource.c   | 12 +++----
 .../amd/display/dc/resource/dcn36/dcn36_resource.c | 12 +++----
 .../display/dc/resource/dcn401/dcn401_resource.c   | 12 +++----
 .../drm/amd/display/modules/color/color_gamma.c    |  6 ++--
 drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c     |  3 +-
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c         |  3 +-
 .../amd/pm/powerplay/hwmgr/process_pptables_v1_0.c |  3 +-
 .../drm/amd/pm/powerplay/hwmgr/processpptables.c   | 21 ++++-------
 .../pm/powerplay/hwmgr/vega10_processpptables.c    |  3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c  |  3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c    |  3 +-
 .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c    |  3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c   |  3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c |  3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c     |  3 +-
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c   |  3 +-
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c   |  3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c     |  3 +-
 .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c   |  3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c     |  3 +-
 .../gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c  |  3 +-
 drivers/gpu/drm/arm/malidp_mw.c                    |  3 +-
 drivers/gpu/drm/ast/ast_dp.c                       |  3 +-
 drivers/gpu/drm/drm_atomic.c                       |  3 +-
 drivers/gpu/drm/drm_atomic_helper.c                |  3 +-
 drivers/gpu/drm/drm_atomic_state_helper.c          |  3 +-
 drivers/gpu/drm/drm_buddy.c                        |  6 ++--
 drivers/gpu/drm/drm_client_modeset.c               |  3 +-
 drivers/gpu/drm/drm_gem_atomic_helper.c            |  3 +-
 drivers/gpu/drm/drm_lease.c                        |  3 +-
 drivers/gpu/drm/drm_plane.c                        |  3 +-
 drivers/gpu/drm/drm_plane_helper.c                 |  3 +-
 drivers/gpu/drm/drm_writeback.c                    |  3 +-
 drivers/gpu/drm/etnaviv/etnaviv_flop_reset.c       |  3 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c       |  3 +-
 drivers/gpu/drm/exynos/exynos_drm_g2d.c            |  3 +-
 drivers/gpu/drm/gma500/intel_gmbus.c               |  3 +-
 drivers/gpu/drm/gma500/psb_intel_sdvo.c            | 12 +++----
 drivers/gpu/drm/gud/gud_connector.c                |  6 ++--
 drivers/gpu/drm/gud/gud_drv.c                      |  3 +-
 drivers/gpu/drm/i915/display/intel_bios.c          |  3 +-
 drivers/gpu/drm/i915/display/intel_dp_tunnel.c     |  3 +-
 drivers/gpu/drm/i915/gem/i915_gem_create.c         |  3 +-
 drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c       |  3 +-
 drivers/gpu/drm/i915/gt/intel_workarounds.c        |  3 +-
 drivers/gpu/drm/i915/gt/selftest_execlists.c       |  3 +-
 drivers/gpu/drm/i915/gt/selftest_timeline.c        |  6 ++--
 drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c     |  3 +-
 drivers/gpu/drm/i915/i915_cmd_parser.c             |  3 +-
 drivers/gpu/drm/i915/selftests/i915_request.c      |  3 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c             |  3 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c          |  3 +-
 drivers/gpu/drm/nouveau/dispnv04/overlay.c         |  6 ++--
 drivers/gpu/drm/nouveau/nouveau_svm.c              |  3 +-
 drivers/gpu/drm/nouveau/nvif/fifo.c                |  3 +-
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c           |  3 +-
 drivers/gpu/drm/qxl/qxl_display.c                  |  3 +-
 drivers/gpu/drm/qxl/qxl_ioctl.c                    |  3 +-
 drivers/gpu/drm/radeon/atombios_encoders.c         |  6 ++--
 drivers/gpu/drm/radeon/btc_dpm.c                   |  3 +-
 drivers/gpu/drm/radeon/ci_dpm.c                    |  3 +-
 drivers/gpu/drm/radeon/ni_dpm.c                    |  3 +-
 drivers/gpu/drm/radeon/r600_dpm.c                  |  3 +-
 drivers/gpu/drm/radeon/radeon_atombios.c           | 12 +++----
 drivers/gpu/drm/radeon/radeon_combios.c            |  3 +-
 drivers/gpu/drm/radeon/radeon_connectors.c         | 18 ++++------
 drivers/gpu/drm/radeon/radeon_cs.c                 |  3 +-
 drivers/gpu/drm/radeon/radeon_display.c            | 15 +++-----
 drivers/gpu/drm/radeon/radeon_vm.c                 |  3 +-
 drivers/gpu/drm/radeon/si_dpm.c                    |  3 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c        |  3 +-
 drivers/gpu/drm/scheduler/sched_main.c             |  3 +-
 drivers/gpu/drm/tiny/appletbdrm.c                  |  3 +-
 drivers/gpu/drm/ttm/ttm_tt.c                       |  3 +-
 drivers/gpu/drm/v3d/v3d_submit.c                   | 12 +++----
 drivers/gpu/drm/vc4/vc4_bo.c                       |  3 +-
 drivers/gpu/drm/virtio/virtgpu_fence.c             |  3 +-
 drivers/gpu/drm/virtio/virtgpu_prime.c             |  3 +-
 drivers/gpu/drm/vkms/vkms_crtc.c                   |  6 ++--
 drivers/gpu/drm/vmwgfx/vmwgfx_blit.c               |  6 ++--
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c                |  3 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c            |  3 +-
 drivers/gpu/drm/xe/xe_eu_stall.c                   |  3 +-
 drivers/gpu/drm/xe/xe_oa.c                         |  3 +-
 drivers/gpu/drm/xe/xe_pt.c                         |  3 +-
 drivers/gpu/drm/xe/xe_vm_madvise.c                 |  3 +-
 drivers/gpu/drm/xen/xen_drm_front_gem.c            |  3 +-
 drivers/gpu/host1x/channel.c                       |  3 +-
 drivers/greybus/manifest.c                         |  3 +-
 drivers/greybus/svc.c                              |  3 +-
 drivers/hid/hid-google-hammer.c                    |  3 +-
 drivers/hid/hid-haptic.c                           |  3 +-
 drivers/hid/intel-ish-hid/ishtp/hbm.c              |  3 +-
 drivers/hv/hv.c                                    |  3 +-
 drivers/hv/ring_buffer.c                           |  3 +-
 drivers/hwmon/coretemp.c                           |  3 +-
 drivers/hwmon/ibmpex.c                             |  3 +-
 drivers/hwtracing/coresight/coresight-tmc-etr.c    |  3 +-
 drivers/i2c/busses/i2c-qcom-geni.c                 |  3 +-
 drivers/i2c/i2c-dev.c                              |  3 +-
 drivers/i3c/master.c                               |  3 +-
 drivers/i3c/master/mipi-i3c-hci/dma.c              |  3 +-
 drivers/infiniband/core/cache.c                    |  3 +-
 drivers/infiniband/core/cm.c                       |  3 +-
 drivers/infiniband/core/cma.c                      |  9 ++---
 drivers/infiniband/core/roce_gid_mgmt.c            |  3 +-
 drivers/infiniband/core/rw.c                       |  6 ++--
 drivers/infiniband/core/sa_query.c                 |  3 +-
 drivers/infiniband/core/sysfs.c                    |  9 ++---
 drivers/infiniband/core/user_mad.c                 |  3 +-
 drivers/infiniband/core/uverbs_cmd.c               |  3 +-
 drivers/infiniband/hw/bng_re/bng_fw.c              |  3 +-
 drivers/infiniband/hw/bnxt_re/ib_verbs.c           |  6 ++--
 drivers/infiniband/hw/bnxt_re/qplib_fp.c           |  3 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c         |  3 +-
 drivers/infiniband/hw/cxgb4/qp.c                   |  9 ++---
 drivers/infiniband/hw/efa/efa_verbs.c              |  3 +-
 drivers/infiniband/hw/hfi1/pio.c                   |  6 ++--
 drivers/infiniband/hw/hfi1/user_exp_rcv.c          |  3 +-
 drivers/infiniband/hw/hns/hns_roce_main.c          |  3 +-
 drivers/infiniband/hw/ionic/ionic_admin.c          |  6 ++--
 drivers/infiniband/hw/ionic/ionic_controlpath.c    |  6 ++--
 drivers/infiniband/hw/ionic/ionic_hw_stats.c       |  9 ++---
 drivers/infiniband/hw/irdma/cm.c                   |  6 ++--
 drivers/infiniband/hw/irdma/icrdma_if.c            |  3 +-
 drivers/infiniband/hw/irdma/ig3rdma_if.c           |  3 +-
 drivers/infiniband/hw/irdma/verbs.c                |  6 ++--
 drivers/infiniband/hw/mlx4/alias_GUID.c            |  3 +-
 drivers/infiniband/hw/mlx4/mad.c                   |  3 +-
 drivers/infiniband/hw/mlx4/main.c                  |  3 +-
 drivers/infiniband/hw/mlx4/sysfs.c                 |  3 +-
 drivers/infiniband/hw/mlx5/counters.c              |  6 ++--
 drivers/infiniband/hw/mlx5/fs.c                    |  6 ++--
 drivers/infiniband/hw/mlx5/gsi.c                   |  3 +-
 drivers/infiniband/hw/mlx5/mr.c                    |  3 +-
 drivers/infiniband/hw/mlx5/qp.c                    |  3 +-
 drivers/infiniband/hw/mthca/mthca_allocator.c      |  3 +-
 drivers/infiniband/hw/mthca/mthca_mr.c             |  3 +-
 drivers/infiniband/hw/ocrdma/ocrdma_main.c         |  6 ++--
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c        |  3 +-
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c     |  9 ++---
 drivers/infiniband/ulp/ipoib/ipoib_main.c          |  3 +-
 drivers/infiniband/ulp/isert/ib_isert.c            |  3 +-
 drivers/infiniband/ulp/rtrs/rtrs-clt.c             |  3 +-
 drivers/infiniband/ulp/rtrs/rtrs-srv.c             |  6 ++--
 drivers/infiniband/ulp/srpt/ib_srpt.c              |  3 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c        |  3 +-
 drivers/ipack/carriers/tpci200.c                   |  3 +-
 drivers/irqchip/irq-alpine-msi.c                   |  3 +-
 drivers/irqchip/irq-bcm6345-l1.c                   |  3 +-
 drivers/irqchip/irq-bcm7038-l1.c                   |  3 +-
 drivers/irqchip/irq-bcm7120-l2.c                   |  3 +-
 drivers/irqchip/irq-gic-v3-its.c                   |  3 +-
 drivers/irqchip/irq-gic-v5-iwb.c                   |  3 +-
 drivers/irqchip/irq-riscv-intc.c                   |  3 +-
 drivers/isdn/capi/capi.c                           |  3 +-
 drivers/macintosh/windfarm_pm121.c                 |  3 +-
 drivers/macintosh/windfarm_pm91.c                  |  6 ++--
 drivers/md/dm-snap-persistent.c                    |  3 +-
 drivers/md/dm-snap.c                               |  3 +-
 drivers/md/dm-zoned-metadata.c                     |  3 +-
 drivers/md/raid0.c                                 |  3 +-
 drivers/md/raid1.c                                 |  6 ++--
 drivers/md/raid5-ppl.c                             |  3 +-
 drivers/md/raid5.c                                 |  3 +-
 drivers/media/common/b2c2/flexcop.c                |  3 +-
 drivers/media/dvb-core/dvbdev.c                    |  6 ++--
 drivers/media/dvb-frontends/dib0070.c              |  3 +-
 drivers/media/dvb-frontends/dib0090.c              |  3 +-
 drivers/media/dvb-frontends/s5h1420.c              |  3 +-
 drivers/media/dvb-frontends/stv0900_core.c         |  6 ++--
 .../media/platform/nxp/imx8-isi/imx8-isi-core.c    |  3 +-
 drivers/media/platform/renesas/vsp1/vsp1_video.c   |  3 +-
 drivers/media/test-drivers/vidtv/vidtv_psi.c       |  3 +-
 drivers/media/test-drivers/vimc/vimc-core.c        |  3 +-
 drivers/media/usb/dvb-usb/cinergyT2-fe.c           |  3 +-
 drivers/media/usb/dvb-usb/vp702x-fe.c              |  3 +-
 drivers/media/usb/dvb-usb/vp7045-fe.c              |  3 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c            |  3 +-
 drivers/media/v4l2-core/v4l2-ctrls-core.c          |  3 +-
 drivers/media/v4l2-core/v4l2-flash-led-class.c     |  3 +-
 drivers/media/v4l2-core/v4l2-subdev.c              |  3 +-
 drivers/message/fusion/mptlan.c                    |  6 ++--
 drivers/message/fusion/mptsas.c                    |  3 +-
 drivers/mfd/timberdale.c                           |  3 +-
 drivers/misc/altera-stapl/altera.c                 |  3 +-
 drivers/misc/fastrpc.c                             |  6 ++--
 drivers/misc/genwqe/card_ddcb.c                    |  6 ++--
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c      |  6 ++--
 drivers/misc/mei/interrupt.c                       |  3 +-
 drivers/misc/sgi-xp/xpc_main.c                     |  6 ++--
 drivers/misc/sgi-xp/xpc_uv.c                       |  3 +-
 drivers/mtd/chips/cfi_cmdset_0001.c                |  3 +-
 drivers/mtd/chips/cfi_probe.c                      |  3 +-
 drivers/mtd/chips/jedec_probe.c                    |  3 +-
 drivers/mtd/ftl.c                                  |  3 +-
 drivers/mtd/mtdconcat.c                            |  3 +-
 drivers/mtd/parsers/bcm47xxpart.c                  |  3 +-
 drivers/mtd/parsers/parser_trx.c                   |  3 +-
 drivers/mtd/parsers/scpart.c                       |  3 +-
 drivers/mtd/rfd_ftl.c                              |  3 +-
 drivers/mtd/sm_ftl.c                               |  3 +-
 drivers/mtd/ubi/eba.c                              |  6 ++--
 drivers/net/bonding/bond_main.c                    |  6 ++--
 drivers/net/dsa/ocelot/felix.c                     |  3 +-
 drivers/net/dsa/sja1105/sja1105_devlink.c          |  3 +-
 drivers/net/ethernet/amd/pcnet32.c                 |  6 ++--
 drivers/net/ethernet/apm/xgene-v2/main.c           |  3 +-
 drivers/net/ethernet/aquantia/atlantic/aq_ptp.c    |  3 +-
 drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c   |  3 +-
 drivers/net/ethernet/broadcom/bcm63xx_enet.c       |  6 ++--
 drivers/net/ethernet/broadcom/bcmsysport.c         |  3 +-
 drivers/net/ethernet/broadcom/bnge/bnge_netdev.c   | 18 ++++------
 drivers/net/ethernet/broadcom/bnge/bnge_rmem.c     |  3 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c    |  9 ++---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c   |  3 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c  |  6 ++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          | 12 +++----
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c      |  3 +-
 drivers/net/ethernet/broadcom/cnic.c               |  9 ++---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c     |  6 ++--
 drivers/net/ethernet/broadcom/sb1250-mac.c         |  3 +-
 drivers/net/ethernet/brocade/bna/bnad.c            |  3 +-
 drivers/net/ethernet/calxeda/xgmac.c               |  6 ++--
 drivers/net/ethernet/cavium/liquidio/lio_core.c    |  6 ++--
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c |  3 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c    |  3 +-
 .../net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c |  3 +-
 .../net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c   |  6 ++--
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c     |  9 ++---
 drivers/net/ethernet/cisco/enic/enic_main.c        |  9 ++---
 drivers/net/ethernet/emulex/benet/be_main.c        |  6 ++--
 .../net/ethernet/freescale/dpaa2/dpaa2-switch.c    |  6 ++--
 drivers/net/ethernet/freescale/enetc/enetc.c       |  3 +-
 drivers/net/ethernet/freescale/gianfar.c           |  6 ++--
 drivers/net/ethernet/google/gve/gve_ethtool.c      |  3 +-
 drivers/net/ethernet/google/gve/gve_main.c         |  3 +-
 drivers/net/ethernet/google/gve/gve_rx.c           |  3 +-
 drivers/net/ethernet/google/gve/gve_rx_dqo.c       |  3 +-
 drivers/net/ethernet/google/gve/gve_tx.c           |  3 +-
 drivers/net/ethernet/google/gve/gve_tx_dqo.c       |  3 +-
 drivers/net/ethernet/hisilicon/hns/hnae.c          |  3 +-
 drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c   |  3 +-
 .../net/ethernet/huawei/hinic3/hinic3_netdev_ops.c |  3 +-
 .../ethernet/huawei/hinic3/hinic3_queue_common.c   |  3 +-
 drivers/net/ethernet/huawei/hinic3/hinic3_rx.c     |  3 +-
 drivers/net/ethernet/huawei/hinic3/hinic3_tx.c     |  3 +-
 drivers/net/ethernet/ibm/ibmvnic.c                 | 15 +++-----
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c   | 12 +++----
 drivers/net/ethernet/intel/e1000e/ethtool.c        |  6 ++--
 drivers/net/ethernet/intel/fm10k/fm10k_main.c      |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c     |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  3 +-
 drivers/net/ethernet/intel/iavf/iavf_main.c        |  9 ++---
 drivers/net/ethernet/intel/ice/ice_arfs.c          |  6 ++--
 drivers/net/ethernet/intel/ice/ice_common.c        |  3 +-
 drivers/net/ethernet/intel/ice/ice_lib.c           |  9 ++---
 drivers/net/ethernet/intel/idpf/idpf_controlq.c    |  3 +-
 .../net/ethernet/intel/idpf/idpf_controlq_setup.c  |  6 ++--
 drivers/net/ethernet/intel/idpf/idpf_lib.c         |  3 +-
 drivers/net/ethernet/intel/idpf/idpf_txrx.c        | 24 +++++--------
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c    | 12 +++----
 .../net/ethernet/intel/idpf/idpf_virtchnl_ptp.c    |  3 +-
 drivers/net/ethernet/intel/igc/igc_main.c          |  3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c    |  6 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c       |  3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |  3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c     |  3 +-
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c  |  3 +-
 drivers/net/ethernet/intel/libie/fwlog.c           |  3 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c    |  3 +-
 .../net/ethernet/marvell/octeon_ep/octep_main.c    |  3 +-
 .../ethernet/marvell/octeon_ep_vf/octep_vf_main.c  |  3 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |  6 ++--
 .../ethernet/marvell/prestera/prestera_counter.c   |  3 +-
 drivers/net/ethernet/marvell/sky2.c                |  6 ++--
 drivers/net/ethernet/mellanox/mlx4/alloc.c         |  3 +-
 drivers/net/ethernet/mellanox/mlx4/cmd.c           |  9 ++---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c     |  6 ++--
 drivers/net/ethernet/mellanox/mlx4/main.c          |  6 ++--
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  | 12 +++----
 drivers/net/ethernet/mellanox/mlx5/core/en/qos.c   |  3 +-
 .../net/ethernet/mellanox/mlx5/core/en/xsk/pool.c  |  3 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  3 +-
 .../net/ethernet/mellanox/mlx5/core/fpga/conn.c    |  6 ++--
 drivers/net/ethernet/mellanox/mlx5/core/rl.c       |  3 +-
 .../mellanox/mlx5/core/steering/hws/action.c       |  3 +-
 .../ethernet/mellanox/mlx5/core/steering/hws/bwc.c |  3 +-
 .../mellanox/mlx5/core/steering/hws/fs_hws.c       |  9 ++---
 .../mellanox/mlx5/core/steering/hws/matcher.c      |  3 +-
 .../mellanox/mlx5/core/steering/hws/send.c         |  3 +-
 .../mellanox/mlx5/core/steering/sws/dr_buddy.c     |  6 ++--
 .../mellanox/mlx5/core/steering/sws/dr_icm_pool.c  |  3 +-
 .../mellanox/mlx5/core/steering/sws/fs_dr.c        |  6 ++--
 .../ethernet/mellanox/mlxsw/core_acl_flex_keys.c   |  3 +-
 drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c   |  3 +-
 drivers/net/ethernet/mellanox/mlxsw/core_thermal.c |  3 +-
 drivers/net/ethernet/mellanox/mlxsw/pci.c          |  3 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |  6 ++--
 .../mellanox/mlxsw/spectrum_acl_bloom_filter.c     |  3 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_buffers.c |  3 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c |  9 ++---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c |  3 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  6 ++--
 drivers/net/ethernet/micrel/ksz884x.c              |  3 +-
 .../net/ethernet/microchip/lan966x/lan966x_fdma.c  |  3 +-
 .../net/ethernet/microchip/sparx5/sparx5_main.c    |  3 +-
 drivers/net/ethernet/microsoft/mana/mana_en.c      |  6 ++--
 drivers/net/ethernet/myricom/myri10ge/myri10ge.c   |  3 +-
 drivers/net/ethernet/netronome/nfp/bpf/offload.c   |  3 +-
 .../net/ethernet/netronome/nfp/flower/lag_conf.c   |  3 +-
 drivers/net/ethernet/netronome/nfp/nfd3/rings.c    |  3 +-
 drivers/net/ethernet/netronome/nfp/nfdk/rings.c    |  3 +-
 .../net/ethernet/netronome/nfp/nfp_net_common.c    |  3 +-
 drivers/net/ethernet/netronome/nfp/nfp_net_main.c  |  3 +-
 .../net/ethernet/netronome/nfp/nfp_shared_buf.c    |  3 +-
 drivers/net/ethernet/nvidia/forcedeth.c            |  6 ++--
 drivers/net/ethernet/pasemi/pasemi_mac.c           |  6 ++--
 .../net/ethernet/qlogic/netxen/netxen_nic_init.c   |  3 +-
 drivers/net/ethernet/qlogic/qed/qed_cxt.c          |  6 ++--
 drivers/net/ethernet/qlogic/qed/qed_debug.c        |  3 +-
 .../net/ethernet/qlogic/qed/qed_init_fw_funcs.c    |  3 +-
 drivers/net/ethernet/qlogic/qede/qede_main.c       |  9 ++---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c   |  3 +-
 .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c   |  3 +-
 drivers/net/ethernet/renesas/ravb_main.c           |  3 +-
 drivers/net/ethernet/renesas/rswitch_main.c        |  6 ++--
 drivers/net/ethernet/renesas/sh_eth.c              |  6 ++--
 drivers/net/ethernet/rocker/rocker_main.c          |  3 +-
 drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c    |  3 +-
 drivers/net/ethernet/sfc/falcon/rx.c               |  3 +-
 drivers/net/ethernet/sfc/falcon/selftest.c         |  3 +-
 drivers/net/ethernet/sfc/mcdi_mon.c                |  3 +-
 drivers/net/ethernet/sfc/rx_common.c               |  3 +-
 drivers/net/ethernet/sfc/selftest.c                |  3 +-
 drivers/net/ethernet/sfc/siena/mcdi_mon.c          |  3 +-
 drivers/net/ethernet/sfc/siena/rx_common.c         |  3 +-
 drivers/net/ethernet/sfc/siena/selftest.c          |  3 +-
 drivers/net/ethernet/smsc/smsc9420.c               |  6 ++--
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  6 ++--
 drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c    |  9 ++---
 drivers/net/ethernet/ti/k3-cppi-desc-pool.c        |  3 +-
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c  |  6 ++--
 drivers/net/hyperv/netvsc_drv.c                    |  3 +-
 drivers/net/ieee802154/ca8210.c                    |  3 +-
 drivers/net/ipa/gsi_trans.c                        |  3 +-
 drivers/net/pcs/pcs-rzn1-miic.c                    |  3 +-
 drivers/net/usb/hso.c                              |  3 +-
 drivers/net/usb/smsc75xx.c                         |  3 +-
 drivers/net/wan/fsl_ucc_hdlc.c                     |  6 ++--
 drivers/net/wireless/ath/ath10k/ce.c               | 12 +++----
 drivers/net/wireless/ath/ath10k/mac.c              |  3 +-
 drivers/net/wireless/ath/ath12k/dp.c               |  3 +-
 drivers/net/wireless/ath/ath12k/mac.c              |  6 ++--
 drivers/net/wireless/ath/ath5k/eeprom.c            | 12 +++----
 drivers/net/wireless/ath/wil6210/fw_inc.c          |  3 +-
 drivers/net/wireless/ath/wil6210/pmc.c             |  3 +-
 drivers/net/wireless/ath/wil6210/txrx_edma.c       |  3 +-
 drivers/net/wireless/broadcom/b43/debugfs.c        |  3 +-
 drivers/net/wireless/broadcom/b43/dma.c            |  3 +-
 drivers/net/wireless/broadcom/b43legacy/dma.c      |  3 +-
 .../wireless/broadcom/brcm80211/brcmfmac/pcie.c    |  3 +-
 drivers/net/wireless/intel/ipw2x00/ipw2100.c       |  3 +-
 drivers/net/wireless/intel/ipw2x00/libipw_module.c |  3 +-
 drivers/net/wireless/intel/iwlegacy/common.c       |  9 ++---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.c        |  3 +-
 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 15 +++-----
 drivers/net/wireless/intel/iwlwifi/mld/d3.c        |  6 ++--
 drivers/net/wireless/intel/iwlwifi/mld/sta.c       |  3 +-
 drivers/net/wireless/intel/iwlwifi/mld/time_sync.c |  3 +-
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c       |  3 +-
 .../net/wireless/intel/iwlwifi/pcie/gen1_2/rx.c    |  3 +-
 .../net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c    |  3 +-
 drivers/net/wireless/intersil/p54/eeprom.c         |  6 ++--
 drivers/net/wireless/marvell/mwifiex/scan.c        |  3 +-
 drivers/net/wireless/microchip/wilc1000/cfg80211.c |  9 ++---
 drivers/net/wireless/quantenna/qtnfmac/commands.c  | 12 +++----
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c     |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192du/sw.c    |  6 ++--
 drivers/net/wireless/realtek/rtw88/sdio.c          |  3 +-
 drivers/net/wireless/realtek/rtw89/usb.c           |  3 +-
 drivers/net/wireless/st/cw1200/debug.c             |  3 +-
 drivers/net/wireless/st/cw1200/queue.c             |  6 ++--
 drivers/net/wireless/st/cw1200/scan.c              |  3 +-
 drivers/net/wireless/ti/wl1251/init.c              |  3 +-
 drivers/net/wwan/iosm/iosm_ipc_protocol.c          |  3 +-
 drivers/net/xen-netfront.c                         |  3 +-
 drivers/nvdimm/btt.c                               |  6 ++--
 drivers/nvdimm/nd_perf.c                           |  3 +-
 drivers/nvdimm/region_devs.c                       |  3 +-
 drivers/nvme/host/auth.c                           |  3 +-
 drivers/nvme/host/rdma.c                           |  3 +-
 drivers/nvme/host/tcp.c                            |  3 +-
 drivers/nvme/target/configfs.c                     |  3 +-
 drivers/nvme/target/core.c                         |  6 ++--
 drivers/nvme/target/fc.c                           |  3 +-
 drivers/nvme/target/loop.c                         |  3 +-
 drivers/nvme/target/pci-epf.c                      |  6 ++--
 drivers/opp/core.c                                 |  3 +-
 drivers/opp/of.c                                   |  3 +-
 drivers/pci/hotplug/cpqphp_nvram.c                 |  3 +-
 drivers/pci/hotplug/cpqphp_pci.c                   | 21 ++++-------
 drivers/pci/hotplug/ibmphp_ebda.c                  |  9 ++---
 drivers/pci/hotplug/ibmphp_pci.c                   | 36 +++++++------------
 drivers/pci/hotplug/ibmphp_res.c                   | 21 ++++-------
 drivers/perf/riscv_pmu_sbi.c                       |  3 +-
 drivers/pinctrl/bcm/pinctrl-bcm2835.c              |  3 +-
 drivers/pinctrl/berlin/berlin.c                    |  3 +-
 drivers/pinctrl/pinctrl-apple-gpio.c               |  3 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c              |  3 +-
 drivers/pinctrl/vt8500/pinctrl-wmt.c               |  3 +-
 drivers/platform/chrome/chromeos_laptop.c          |  3 +-
 drivers/platform/x86/asus-armoury.c                |  6 ++--
 drivers/platform/x86/dell/dell-smbios-base.c       |  3 +-
 drivers/platform/x86/intel/int3472/tps68470.c      |  3 +-
 .../x86/intel/speed_select_if/isst_if_common.c     |  6 ++--
 .../x86/intel/uncore-frequency/uncore-frequency.c  |  3 +-
 drivers/platform/x86/sony-laptop.c                 |  3 +-
 drivers/platform/x86/uv_sysfs.c                    | 12 +++----
 drivers/platform/x86/x86-android-tablets/core.c    |  3 +-
 drivers/powercap/intel_rapl_common.c               |  3 +-
 drivers/regulator/of_regulator.c                   |  3 +-
 drivers/s390/block/dcssblk.c                       |  6 ++--
 drivers/s390/block/scm_blk.c                       |  3 +-
 drivers/s390/char/con3270.c                        |  3 +-
 drivers/s390/cio/css.c                             |  3 +-
 drivers/s390/cio/qdio_thinint.c                    |  3 +-
 drivers/s390/cio/vfio_ccw_ops.c                    |  3 +-
 drivers/scsi/53c700.c                              |  3 +-
 drivers/scsi/BusLogic.c                            |  3 +-
 drivers/scsi/aacraid/linit.c                       |  3 +-
 drivers/scsi/be2iscsi/be_main.c                    |  9 ++---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c                  |  3 +-
 drivers/scsi/bnx2fc/bnx2fc_io.c                    |  3 +-
 drivers/scsi/csiostor/csio_lnode.c                 |  3 +-
 drivers/scsi/elx/efct/efct_hw.c                    |  3 +-
 drivers/scsi/esas2r/esas2r_init.c                  |  6 ++--
 drivers/scsi/ibmvscsi/ibmvfc.c                     |  3 +-
 drivers/scsi/ipr.c                                 |  3 +-
 drivers/scsi/lpfc/lpfc_els.c                       |  6 ++--
 drivers/scsi/lpfc/lpfc_init.c                      |  3 +-
 drivers/scsi/lpfc/lpfc_mbox.c                      |  3 +-
 drivers/scsi/lpfc/lpfc_mem.c                       |  3 +-
 drivers/scsi/lpfc/lpfc_sli.c                       |  3 +-
 drivers/scsi/lpfc/lpfc_vport.c                     |  3 +-
 drivers/scsi/megaraid/megaraid_mm.c                |  6 ++--
 drivers/scsi/megaraid/megaraid_sas_base.c          |  6 ++--
 drivers/scsi/megaraid/megaraid_sas_fusion.c        |  6 ++--
 drivers/scsi/mpi3mr/mpi3mr_fw.c                    |  3 +-
 drivers/scsi/mpi3mr/mpi3mr_transport.c             |  3 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c                |  3 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.c                 |  6 ++--
 drivers/scsi/mpt3sas/mpt3sas_scsih.c               |  6 ++--
 drivers/scsi/mvumi.c                               |  3 +-
 drivers/scsi/qedf/qedf_io.c                        |  6 ++--
 drivers/scsi/qedf/qedf_main.c                      |  3 +-
 drivers/scsi/qedi/qedi_main.c                      |  3 +-
 drivers/scsi/qla2xxx/qla_init.c                    |  6 ++--
 drivers/scsi/qla2xxx/qla_inline.h                  |  3 +-
 drivers/scsi/qla2xxx/qla_isr.c                     |  3 +-
 drivers/scsi/qla2xxx/qla_mid.c                     |  3 +-
 drivers/scsi/qla2xxx/qla_os.c                      |  9 ++---
 drivers/scsi/qla2xxx/qla_target.c                  |  3 +-
 drivers/scsi/scsi_debug.c                          |  6 ++--
 drivers/scsi/ses.c                                 |  3 +-
 drivers/scsi/smartpqi/smartpqi_init.c              |  3 +-
 drivers/scsi/vmw_pvscsi.c                          |  3 +-
 drivers/soc/qcom/pdr_interface.c                   |  3 +-
 drivers/soc/renesas/rz-sysc.c                      |  3 +-
 drivers/soundwire/amd_init.c                       |  6 ++--
 drivers/soundwire/amd_manager.c                    |  3 +-
 drivers/soundwire/intel.c                          |  3 +-
 drivers/soundwire/intel_ace2x.c                    |  3 +-
 drivers/soundwire/intel_init.c                     |  3 +-
 drivers/spi/spi-bcm-qspi.c                         |  3 +-
 drivers/spi/spi-mpc52xx.c                          |  3 +-
 drivers/spi/spi-virtio.c                           |  3 +-
 drivers/staging/greybus/light.c                    |  9 ++---
 drivers/staging/greybus/power_supply.c             |  3 +-
 drivers/staging/media/atomisp/pci/atomisp_ioctl.c  |  9 ++---
 drivers/staging/media/atomisp/pci/sh_css.c         |  6 ++--
 .../staging/media/atomisp/pci/sh_css_firmware.c    |  3 +-
 drivers/staging/media/atomisp/pci/sh_css_params.c  |  3 +-
 drivers/staging/vme_user/vme_tsi148.c              |  3 +-
 drivers/target/target_core_iblock.c                |  3 +-
 drivers/target/target_core_pr.c                    |  3 +-
 drivers/tee/qcomtee/call.c                         |  3 +-
 drivers/tee/qcomtee/mem_obj.c                      |  3 +-
 drivers/tee/tee_core.c                             |  9 ++---
 drivers/thermal/intel/intel_hfi.c                  |  3 +-
 drivers/thermal/testing/zone.c                     | 15 +++-----
 drivers/thermal/thermal_of.c                       |  3 +-
 drivers/thunderbolt/switch.c                       |  3 +-
 drivers/tty/goldfish.c                             |  3 +-
 drivers/tty/serial/8250/8250_platform.c            |  6 ++--
 drivers/tty/serial/jsm/jsm_tty.c                   |  3 +-
 drivers/tty/serial/serial_core.c                   |  3 +-
 drivers/tty/tty_io.c                               |  3 +-
 drivers/tty/vt/keyboard.c                          |  3 +-
 drivers/usb/core/hcd.c                             |  6 ++--
 drivers/usb/gadget/function/f_midi.c               |  3 +-
 drivers/usb/gadget/function/f_midi2.c              |  3 +-
 drivers/usb/gadget/udc/bdc/bdc_core.c              |  3 +-
 drivers/usb/host/uhci-hcd.c                        |  3 +-
 drivers/usb/host/xhci-mtk-sch.c                    |  3 +-
 drivers/usb/mon/mon_bin.c                          |  3 +-
 drivers/usb/serial/mos7840.c                       |  3 +-
 drivers/usb/typec/ucsi/ucsi.c                      |  3 +-
 drivers/usb/usbip/vhci_sysfs.c                     |  6 ++--
 drivers/vdpa/mlx5/net/mlx5_vnet.c                  |  3 +-
 drivers/vdpa/vdpa_sim/vdpa_sim.c                   |  6 ++--
 drivers/vfio/pci/pds/dirty.c                       |  3 +-
 drivers/vfio/pci/vfio_pci_dmabuf.c                 |  3 +-
 drivers/vhost/net.c                                |  3 +-
 drivers/vhost/scsi.c                               |  6 ++--
 drivers/vhost/vhost.c                              |  3 +-
 drivers/video/fbdev/arkfb.c                        |  3 +-
 drivers/video/fbdev/mmp/fb/mmpfb.c                 |  3 +-
 drivers/video/fbdev/omap2/omapfb/dss/manager.c     |  3 +-
 drivers/video/fbdev/smscufx.c                      |  3 +-
 drivers/video/fbdev/udlfb.c                        |  3 +-
 drivers/video/fbdev/uvesafb.c                      |  3 +-
 drivers/video/of_display_timing.c                  |  3 +-
 drivers/virt/acrn/mm.c                             |  3 +-
 drivers/virt/nitro_enclaves/ne_misc_dev.c          |  3 +-
 drivers/virtio/virtio_pci_common.c                 |  6 ++--
 drivers/xen/gntdev.c                               |  6 ++--
 drivers/xen/grant-table.c                          |  3 +-
 drivers/xen/xen-acpi-processor.c                   |  6 ++--
 drivers/xen/xen-scsiback.c                         |  3 +-
 fs/aio.c                                           |  3 +-
 fs/binfmt_elf.c                                    |  3 +-
 fs/btrfs/ioctl.c                                   |  3 +-
 fs/btrfs/tests/btrfs-tests.c                       |  3 +-
 fs/btrfs/zoned.c                                   |  3 +-
 fs/cachefiles/ondemand.c                           |  3 +-
 fs/coredump.c                                      |  3 +-
 fs/erofs/xattr.c                                   |  3 +-
 fs/exfat/balloc.c                                  |  3 +-
 fs/ext2/super.c                                    |  3 +-
 fs/ext4/orphan.c                                   |  3 +-
 fs/fhandle.c                                       |  6 ++--
 fs/jbd2/journal.c                                  |  3 +-
 fs/jffs2/summary.c                                 | 12 +++----
 fs/jffs2/xattr.c                                   |  3 +-
 fs/mbcache.c                                       |  3 +-
 fs/nfsd/nfs4proc.c                                 |  3 +-
 fs/nfsd/nfs4state.c                                |  6 ++--
 fs/ocfs2/cluster/heartbeat.c                       |  6 ++--
 fs/ocfs2/journal.c                                 |  3 +-
 fs/ocfs2/slot_map.c                                |  3 +-
 fs/orangefs/orangefs-bufmap.c                      |  3 +-
 fs/pstore/ram.c                                    |  3 +-
 fs/select.c                                        |  3 +-
 fs/smb/client/misc.c                               |  3 +-
 fs/xfs/xfs_super.c                                 |  3 +-
 fs/xfs/xfs_zone_gc.c                               |  3 +-
 fs/zonefs/super.c                                  |  6 ++--
 include/net/udp.h                                  |  3 +-
 kernel/bpf/core.c                                  |  3 +-
 kernel/gcov/fs.c                                   |  3 +-
 kernel/gcov/gcc_4_7.c                              |  3 +-
 kernel/locking/locktorture.c                       |  3 +-
 kernel/padata.c                                    |  3 +-
 kernel/params.c                                    |  3 +-
 kernel/rcu/rcuscale.c                              |  6 ++--
 kernel/rcu/rcutorture.c                            |  3 +-
 kernel/sched/ext.c                                 |  3 +-
 kernel/trace/trace.c                               |  9 ++---
 kernel/trace/trace_events_hist.c                   |  3 +-
 kernel/trace/trace_probe.c                         |  3 +-
 kernel/unwind/deferred.c                           |  3 +-
 lib/assoc_array.c                                  |  3 +-
 lib/kunit/executor.c                               |  3 +-
 lib/tests/test_ratelimit.c                         |  3 +-
 mm/damon/sysfs-schemes.c                           | 18 ++++------
 mm/damon/sysfs.c                                   |  3 +-
 mm/damon/tests/core-kunit.h                        |  6 ++--
 mm/damon/vaddr.c                                   |  3 +-
 mm/ksm.c                                           |  3 +-
 mm/memory-tiers.c                                  |  3 +-
 mm/mempolicy.c                                     |  9 ++---
 mm/mmu_notifier.c                                  |  3 +-
 mm/swapfile.c                                      |  3 +-
 net/bluetooth/l2cap_sock.c                         |  3 +-
 net/can/af_can.c                                   |  6 ++--
 net/ceph/mon_client.c                              |  3 +-
 net/core/dev.c                                     |  3 +-
 net/core/drop_monitor.c                            |  3 +-
 net/core/flow_offload.c                            |  3 +-
 net/ethtool/mse.c                                  |  3 +-
 net/ipv4/af_inet.c                                 |  3 +-
 net/ipv4/fib_semantics.c                           |  3 +-
 net/ipv4/nexthop.c                                 |  3 +-
 net/ipv6/addrconf.c                                |  3 +-
 net/ipv6/af_inet6.c                                |  3 +-
 net/ipv6/ip6_fib.c                                 |  6 ++--
 net/mac80211/util.c                                |  3 +-
 net/netfilter/ipvs/ip_vs_conn.c                    |  3 +-
 net/netfilter/ipvs/ip_vs_mh.c                      |  3 +-
 net/netfilter/nfnetlink_cthelper.c                 |  3 +-
 net/netlink/policy.c                               |  3 +-
 net/openvswitch/conntrack.c                        |  6 ++--
 net/openvswitch/datapath.c                         |  3 +-
 net/openvswitch/vport.c                            |  3 +-
 net/packet/af_packet.c                             |  3 +-
 net/rds/ib.c                                       |  3 +-
 net/rds/rdma.c                                     |  3 +-
 net/sched/cls_api.c                                |  3 +-
 net/sched/cls_u32.c                                |  3 +-
 net/sched/sch_cake.c                               |  3 +-
 net/sched/sch_fq_codel.c                           |  3 +-
 net/sched/sch_hhf.c                                |  3 +-
 net/sched/sch_mq.c                                 |  3 +-
 net/sched/sch_mqprio.c                             |  3 +-
 net/sched/sch_taprio.c                             |  3 +-
 net/smc/smc_wr.c                                   | 15 +++-----
 net/sunrpc/auth_gss/auth_gss.c                     |  3 +-
 net/sunrpc/cache.c                                 |  3 +-
 net/sunrpc/svcsock.c                               |  3 +-
 net/tipc/netlink_compat.c                          |  6 ++--
 net/unix/af_unix.c                                 |  3 +-
 net/wireless/nl80211.c                             |  9 ++---
 net/xdp/xsk_buff_pool.c                            |  6 ++--
 security/apparmor/policy_unpack.c                  |  3 +-
 security/integrity/ima/ima_policy.c                |  3 +-
 security/selinux/ss/conditional.c                  |  3 +-
 security/selinux/ss/policydb.c                     |  3 +-
 sound/aoa/codecs/onyx.c                            |  6 ++--
 sound/core/oss/pcm_plugin.c                        |  3 +-
 sound/core/seq/seq_memory.c                        |  3 +-
 sound/core/ump.c                                   |  3 +-
 sound/drivers/vx/vx_pcm.c                          |  6 ++--
 sound/hda/codecs/ca0132.c                          |  3 +-
 sound/hda/common/proc.c                            |  3 +-
 sound/hda/core/ext/stream.c                        |  3 +-
 sound/hda/core/sysfs.c                             |  3 +-
 sound/pci/cs46xx/dsp_spos.c                        |  6 ++--
 sound/pci/emu10k1/emufx.c                          |  6 ++--
 sound/pci/via82xx.c                                |  3 +-
 sound/pci/via82xx_modem.c                          |  3 +-
 sound/soc/au1x/dma.c                               |  3 +-
 sound/soc/codecs/aw88395/aw88395_lib.c             |  3 +-
 sound/soc/codecs/da7219.c                          |  3 +-
 sound/soc/codecs/lpass-rx-macro.c                  |  6 ++--
 sound/soc/codecs/lpass-wsa-macro.c                 |  6 ++--
 sound/soc/codecs/tas2781-fmwlib.c                  | 12 +++----
 sound/soc/codecs/wm_adsp.c                         |  3 +-
 sound/soc/soc-dapm.c                               |  3 +-
 sound/soc/sof/ipc3-topology.c                      |  3 +-
 sound/soc/sof/ipc4-topology.c                      |  3 +-
 sound/synth/emux/emux.c                            |  3 +-
 sound/synth/emux/emux_seq.c                        |  3 +-
 sound/usb/6fire/control.c                          |  3 +-
 sound/usb/line6/capture.c                          |  3 +-
 sound/usb/line6/playback.c                         |  3 +-
 sound/usb/mixer.c                                  |  3 +-
 sound/usb/mixer_quirks.c                           |  3 +-
 sound/usb/usx2y/usbusx2yaudio.c                    |  3 +-
 sound/xen/xen_snd_front_alsa.c                     |  3 +-
 826 files changed, 1211 insertions(+), 2422 deletions(-)
]

54/2 2026/10/13 22:28 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 60268
							output: 31
							thoughts: 1745
						

Thoughts:
**Analyzing the Large Allocation in `drm_mode_create_lease_ioctl`**

Okay, so I'm looking at commit `32a92f8c8932` which changed the allocation of `objects` from `kcalloc` to `kzalloc_objs`. The core issue here is that the `object_count` isn't bounded and the allocation size can exceed the limit for `kmalloc`, causing a warning in `alloc_order_allowed`.  `kzalloc_objs`, it turns out, is just a `kmalloc` wrapper, which explains the problem.

My initial thought was to simply bound `object_count` directly, but then I realized that `memdup_array_user` already acts as a de facto limit due to the size limitation of `kmalloc` based allocations, effectively bounding `object_count` to about 1,048,576.  So, I can allocate an object array of up to 4MB, but no more.

The next obvious solution is to swap `kzalloc_objs` for `kvcalloc`. This uses `vmalloc`, which doesn't have the size limitation issue that's causing the warning. However, I have to remember that switching to `kvcalloc` requires changing the corresponding `kfree` to `kvfree`.

There doesn't seem to be a good reason *not* to use `kvcalloc` here. It's a clean fix.

I then considered whether I should also switch `object_ids` to `kvmalloc_array`. But, `memdup_array_user` has no `vmemdup_array_user` counterpart.  I could use `vmemdup_user`, but I'd need to add overflow checking. Since `memdup_array_user` silently fails with `-ENOMEM` for overly large sizes and the issue is really only in the `objects` allocation, sticking with `memdup_array_user` is fine. It avoids adding new code and potential bugs.

So, the plan is to switch `kzalloc_objs` to `kvcalloc` and change `kfree` to `kvfree` in `fill_object_idr`. That's the most direct fix, and it's consistent with how the kernel handles these kinds of allocations. Let's make sure `kvcalloc` is appropriate in the `drm_lease.c` code. Okay, looks like `kvcalloc` is defined as using `kvmalloc_array` with `__GFP_ZERO`, so it's precisely what I need.

Just to be absolutely certain, let's write down the problem and the explanation:

The crash is a warning in `alloc_order_allowed` because `__alloc_frozen_pages_noprof` is called with an order greater than `MAX_PAGE_ORDER`.  This is triggered by `fill_object_idr` when allocating the `objects` array using `kzalloc_objs`. This function internally uses a `kmalloc`-based allocation, similar to `kcalloc`. The problem is that the `object_count` comes directly from userspace without any bounds checking, through `cl->object_count` in `drm_mode_create_lease_ioctl`. `memdup_array_user` allocates `object_ids` before the `objects` array with `kmalloc`, which silently fails for sizes > 4MB. The warning happens when `kzalloc_objs` tries to allocate more than `MAX_PAGE_ORDER`.

The reproducer sets `object_count` to 1,000,000.  The `memdup_array_user` allocation is fine, but the subsequent 8MB allocation using `kzalloc_objs` triggers the warning.

So, the fix is to use `kvcalloc` (or `kvmalloc_array` with `__GFP_ZERO`) for the `objects` array in `fill_object_idr` and to change the corresponding `kfree` call to `kvfree`.  `kvcalloc` will allocate using `vmalloc` and avoid the size limitations, while still zeroing the memory. Adding a check for the upper bound of `object_count` would also work, but using `kvcalloc` is simpler and more idiomatic.

Now, let's just make sure I'm using `kvcalloc` correctly. Yes, `kvcalloc(n, size, flags)` takes three arguments, and that's precisely what's needed.



55/2 2026/10/13 22:29 tool grepper
0m Args:
map[Expression:kvcalloc\( PathPrefixes:[drivers/gpu/drm/]]

Results:
map[Output:drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c=1028=int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c-1128-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:1129:		vm_entries = kvcalloc(args->num_entries, sizeof(*vm_entries), GFP_KERNEL);
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c-1130-		if (!vm_entries) {
--
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c=388=svm_migrate_vma_to_vram(struct kfd_node *node, struct svm_range *prange,
--
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c-410-
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:411:	buf = kvcalloc(npages,
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c-412-		       2 * sizeof(*migrate.src) + sizeof(u64) + sizeof(dma_addr_t),
--
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c=711=svm_migrate_vma_to_ram(struct kfd_node *node, struct svm_range *prange,
--
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c-736-
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:737:	buf = kvcalloc(npages,
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c-738-		       2 * sizeof(*migrate.src) + sizeof(u64) + sizeof(dma_addr_t),
--
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c=526=void dm_dtn_log_append_v(struct dc_context *ctx,
--
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c-559-	if (total > log_ctx->size) {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c:560:		char *buf = kvcalloc(total, sizeof(char), GFP_KERNEL);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c-561-
--
drivers/gpu/drm/drm_gpusvm.c=841=enum drm_gpusvm_scan_result drm_gpusvm_scan_mm(struct drm_gpusvm_range *range,
--
drivers/gpu/drm/drm_gpusvm.c-861-
drivers/gpu/drm/drm_gpusvm.c:862:	pfns = kvcalloc(npages, sizeof(*pfns), GFP_KERNEL);
drivers/gpu/drm/drm_gpusvm.c-863-	if (!pfns)
--
drivers/gpu/drm/drm_pagemap.c=668=int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
--
drivers/gpu/drm/drm_pagemap.c-714-
drivers/gpu/drm/drm_pagemap.c:715:	buf = kvcalloc(npages, 2 * sizeof(*migrate.src) + sizeof(*pagemap_addr) +
drivers/gpu/drm/drm_pagemap.c-716-		       sizeof(*pages), GFP_KERNEL);
--
drivers/gpu/drm/drm_pagemap.c=1312=int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
--
drivers/gpu/drm/drm_pagemap.c-1330-
drivers/gpu/drm/drm_pagemap.c:1331:	buf = kvcalloc(npages, 2 * sizeof(*src) + sizeof(*pagemap_addr) +
drivers/gpu/drm/drm_pagemap.c-1332-		       sizeof(*pages), GFP_KERNEL);
--
drivers/gpu/drm/drm_pagemap.c=1410=static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
--
drivers/gpu/drm/drm_pagemap.c-1450-
drivers/gpu/drm/drm_pagemap.c:1451:	buf = kvcalloc(npages, 2 * sizeof(*migrate.src) + sizeof(*pagemap_addr) +
drivers/gpu/drm/drm_pagemap.c-1452-		       sizeof(*pages), GFP_KERNEL);
--
drivers/gpu/drm/lima/lima_drv.c=102=static int lima_ioctl_gem_submit(struct drm_device *dev, void *data, struct drm_file *file)
--
drivers/gpu/drm/lima/lima_drv.c-124-
drivers/gpu/drm/lima/lima_drv.c:125:	bos = kvcalloc(args->nr_bos, sizeof(*submit.bos) + sizeof(*submit.lbos), GFP_KERNEL);
drivers/gpu/drm/lima/lima_drv.c-126-	if (!bos)
--
drivers/gpu/drm/nouveau/nouveau_dmem.c=489=nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk)
--
drivers/gpu/drm/nouveau/nouveau_dmem.c-495-
drivers/gpu/drm/nouveau/nouveau_dmem.c:496:	src_pfns = kvcalloc(npages, sizeof(*src_pfns), GFP_KERNEL | __GFP_NOFAIL);
drivers/gpu/drm/nouveau/nouveau_dmem.c:497:	dst_pfns = kvcalloc(npages, sizeof(*dst_pfns), GFP_KERNEL | __GFP_NOFAIL);
drivers/gpu/drm/nouveau/nouveau_dmem.c-498-	dma_info = kvzalloc_objs(*dma_info, npages, GFP_KERNEL | __GFP_NOFAIL);
--
drivers/gpu/drm/ttm/ttm_tt.c=118=static int ttm_tt_alloc_page_directory(struct ttm_tt *ttm)
drivers/gpu/drm/ttm/ttm_tt.c-119-{
drivers/gpu/drm/ttm/ttm_tt.c:120:	ttm->pages = kvcalloc(ttm->num_pages, sizeof(void*), GFP_KERNEL);
drivers/gpu/drm/ttm/ttm_tt.c-121-	if (!ttm->pages)
--
drivers/gpu/drm/ttm/ttm_tt.c=127=static int ttm_dma_tt_alloc_page_directory(struct ttm_tt *ttm)
drivers/gpu/drm/ttm/ttm_tt.c-128-{
drivers/gpu/drm/ttm/ttm_tt.c:129:	ttm->pages = kvcalloc(ttm->num_pages, sizeof(*ttm->pages) +
drivers/gpu/drm/ttm/ttm_tt.c-130-			      sizeof(*ttm->dma_address), GFP_KERNEL);
]

56/2 2026/10/13 22:29 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 64944
							output: 35
							thoughts: 97
						

Thoughts:
Here's my thought process, as it unfolded:

**Examining Memory Allocation Routines**

Okay, so I see `kvcalloc` used here – right, I remember it takes three arguments. But hold on, what's this `kvzalloc_objs`? That doesn't immediately ring a bell. And I see it’s in `nouveau_dmem.c`! Hmmm, interesting, because I don't recall seeing that routine explicitly before. Let me just quickly confirm, is this a typo, or does this routine *actually* exist? I'll quickly check for a declaration of `kvzalloc_objs`. I need to ensure there isn't something subtle going on here, something I might have missed. Gotta be thorough.



57/2 2026/10/13 22:30 tool grepper
0m Args:
map[Expression:#define kvzalloc_objs PathPrefixes:[include/linux/slab.h]]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1172-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
include/linux/slab.h:1173:#define kvzalloc_objs(P, COUNT, ...) \
include/linux/slab.h-1174-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
]

58/2 2026/10/13 22:30 llm debugger
2m Model:
gemini-3.1-pro-preview

Tokens:
							input: 65400
							output: 1188
							thoughts: 2026
						

Thoughts:
**My Analysis of the DRM Lease Allocation Issue**

Okay, so I've dug into this crash, and here's what I've got. The smoking gun seems to be this `kvzalloc_objs` function. It looks like it was introduced around the same time this issue started popping up, so that's a good lead. The fix seems straightforward enough: replacing `kzalloc_objs` with `kvzalloc_objs` and the corresponding `kfree` with `kvfree` should do the trick.

Let me verify this quickly. Right, it looks like `kvzalloc_objs` in `include/linux/slab.h` is defined as:

```c
#define kvzalloc_objs(P, COUNT, ...) \
	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
```

So we can definitely use it with `kvzalloc_objs(struct drm_mode_object *, object_count)`. And then in the `out_free_objects` code:

```c
	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
```

Then we simply have to change the `kfree(objects)` to `kvfree(objects)`.

I can see this is a very clean and targeted fix.

Now, let's nail down the root cause. The warning we're seeing in `alloc_order_allowed` is triggered because `__alloc_frozen_pages_noprof` is being called with an order greater than `MAX_PAGE_ORDER`. This is happening during the allocation of the `objects` array within the `fill_object_idr` function:

```c
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```

`kzalloc_objs` expands to a `kmalloc`-family allocation, essentially `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`. The kicker is that `object_count` comes straight from userspace via the `drm_mode_create_lease` struct's `cl->object_count` field in `drm_mode_create_lease_ioctl`. The code *doesn't* have an upper bound check on this `object_count` value.

Before this call, `drm_mode_create_lease_ioctl` allocates `object_ids` using `memdup_array_user`:

```c
		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
```

`memdup_array_user` uses `memdup_user`, which in turn uses `kmalloc` with `GFP_USER | __GFP_NOWARN`. Because of `__GFP_NOWARN`, if `object_count` is large (say, greater than 1,048,576 – requiring >4MB), `memdup_array_user` will silently fail and return `-ENOMEM`. However, if `object_count` is large enough to require more than 4MB for the `objects` array (8-byte elements on 64-bit), *but* small enough for the `object_ids` array (4-byte elements) to fit within that 4MB limit, `memdup_array_user` succeeds. Then, the `kzalloc_objs` call attempts a large allocation exceeding 4MB (order > `MAX_PAGE_ORDER`). Since `kzalloc_objs` uses `GFP_KERNEL` without `__GFP_NOWARN`, this triggers the warning in `alloc_order_allowed`.

In the provided syzkaller reproducer, `object_count` is set to 1,000,000. `memdup_array_user` allocates 4,000,000 bytes (1,000,000 * 4). This is order 10 (assuming 4KB pages), which is within `MAX_PAGE_ORDER`. So, that succeeds. Then `fill_object_idr` attempts to allocate 8,000,000 bytes (1,000,000 * 8), which is order 11 and *exceeds* `MAX_PAGE_ORDER`, leading to the warning.

So, the proposed fix is clear: change the allocation in `fill_object_idr` to use `kvzalloc_objs` (which falls back to `vmalloc` for large allocations and avoids this warning) and the corresponding `kfree` to `kvfree`.




59/1 2026/10/13 22:32 agent history-explorer
17m Model:
deep-reasoning

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:

------------[ cut here ]------------
WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline], CPU#1: syz.0.17/7032
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397, CPU#1: syz.0.17/7032
Modules linked in:
CPU: 1 UID: 0 PID: 7032 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : alloc_order_allowed mm/page_alloc.c:5340 [inline]
pc : __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
lr : __alloc_frozen_pages_noprof+0xa8/0x640 mm/page_alloc.c:5388
sp : ffff80009d2e7580
x29: ffff80009d2e7650 x28: ffff700013a5cf18 x27: ffff80009d2e75a0
x26: 1ffff0001302e474 x25: dfff800000000000 x24: ffff700013a5ceb4
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000040dc0
x20: 0000000000000000 x19: 000000000000000b x18: 00000000ffffffff
x17: 0000000000000000 x16: ffff80008b5b9788 x15: 0000000000000005
x14: 1ffff00013a5ceb8 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700013a5cebd x10: dfff800000000000 x9 : 0000000000000001
x8 : ffff8000939c7000 x7 : 0000000000000000 x6 : ffff0000e8bd0900
x5 : ffff0000e8bd0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline] (P)
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397 (P)
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 __do_kmalloc_node mm/slub.c:5402 [inline]
 __kmalloc_noprof+0x3ec/0x6bc mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 _kzalloc_noprof include/linux/slab.h:1312 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:583
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758
 el0t_64_sync_handler+0x68/0xdc arch/arm64/kernel/entry-common.c:777
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590
irq event stamp: 4228
hardirqs last  enabled at (4227): [<ffff80008b64f030>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (4227): [<ffff80008b64f030>] __arm64_exit_to_kernel_mode+0x64/0x78 arch/arm64/kernel/entry-common.c:60
hardirqs last disabled at (4228): [<ffff80008b64afb0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:445
softirqs last  enabled at (3568): [<ffff8000803f5178>] softirq_handle_end kernel/softirq.c:491 [inline]
softirqs last  enabled at (3568): [<ffff8000803f5178>] handle_softirqs+0xc88/0xdfc kernel/softirq.c:673
softirqs last disabled at (3415): [<ffff800080020ff4>] __do_softirq+0x14/0x20 kernel/softirq.c:679
---[ end trace 0000000000000000 ]---


The explanation of the root cause of the bug is:

An analysis of the crash reveals that it is caused by an unbounded user-controlled allocation size in the DRM lease creation ioctl, which attempts to allocate a contiguous memory block larger than `MAX_PAGE_ORDER` using the `kmalloc` family of functions.

### Root Cause Analysis

The crash is a warning triggered in `alloc_order_allowed()` because `__alloc_frozen_pages_noprof()` is called with an allocation order that exceeds `MAX_PAGE_ORDER` (typically 10, which corresponds to 4MB on systems with 4KB pages).

This happens in `fill_object_idr()` when allocating the `objects` array:
```c
// drivers/gpu/drm/drm_lease.c:389
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```
The `kzalloc_objs` macro expands to a `kmalloc`-family allocation (equivalent to `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`). 

The `object_count` comes directly from the user-space `drm_mode_create_lease` struct via `cl->object_count` in `drm_mode_create_lease_ioctl()`. There is no upper bound check on this value.

Before calling `fill_object_idr()`, `drm_mode_create_lease_ioctl()` allocates the `object_ids` array using `memdup_array_user()`:
```c
// drivers/gpu/drm/drm_lease.c:512
		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
```
`memdup_array_user()` uses `memdup_user()`, which allocates memory with `GFP_USER | __GFP_NOWARN`. Because of the `__GFP_NOWARN` flag, if `object_count` is extremely large (e.g., requiring > 4MB), `memdup_array_user()` will silently fail and return `-ENOMEM` without triggering any warnings.

However, there is a specific window where `object_count` is large enough to require more than 4MB for the `objects` array (which has 8-byte pointers on 64-bit systems), but small enough that the `object_ids` array (which has 4-byte `__u32` elements) fits within 4MB. 

In the provided syzkaller reproducer:
```c
*(uint32_t*)0x200003c8 = 0xf4240; // object_count = 1,000,000
```
1. `object_count` is set to `1,000,000`.
2. `memdup_array_user()` allocates `1,000,000 * 4 = 4,000,000` bytes. This is order 10, which is `<= MAX_PAGE_ORDER`. The allocation succeeds.
3. `fill_object_idr()` then calls `kzalloc_objs()` to allocate `1,000,000 * 8 = 8,000,000` bytes. This requires order 11, which is `> MAX_PAGE_ORDER`. 
4. Since `kzalloc_objs()` uses `GFP_KERNEL` without `__GFP_NOWARN`, the page allocator loudly complains and triggers the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)` warning.

### Proposed Fix

To fix this, the allocation of the `objects` array in `fill_object_idr()` should be changed to use `kvzalloc_objs()`, which gracefully falls back to `vmalloc()` for large allocations and does not trigger the page allocator warning. The corresponding `kfree()` must also be updated to `kvfree()`.

```c
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,7 +386,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +462,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
```

*(Note: While adding an arbitrary upper bound check to `object_count` in `drm_mode_create_lease_ioctl()` is another option, using `kvzalloc_objs()` is the standard kernel pattern for handling user-controlled array sizes without imposing artificial limits).*

Reply:
Based on a review of recent commits in the DRM subsystem (`drivers/gpu/drm/`) over the last 3 years, there is a clear set of established idioms and patterns for addressing unbounded user-controlled allocation sizes that trigger page allocator warnings.

### 1. Switching to the `kvmalloc` family (Primary Fix)
The proposed fix of switching from `kzalloc_objs()` to `kvzalloc_objs()` (and `kfree()` to `kvfree()`) is the standard kernel pattern for handling large, unbounded arrays without imposing artificial limits. 
* **Prior Art:** Commit `bca45af5998a` ("drm/vc4: Use kvmalloc_objs() for the BO cache size list") fixed a nearly identical issue where an unbounded cache size list scaled with the largest BO freed, requiring an order-6 allocation that failed under fragmentation and triggered a `warn_alloc()` splat. The fix was to use `kvmalloc_objs()` so large lists can fall back to `vmalloc()`, avoiding the allocation failure.

### 2. Adding an Upper Bound Check (Crucial Secondary Fix)
While `kvmalloc` avoids the `MAX_PAGE_ORDER` warning, it has its own limitation: it will trigger a `WARN_ON_ONCE(size > INT_MAX)` if the requested allocation size exceeds `INT_MAX` (2GB). Because `object_count` is a `__u32` and `sizeof(struct drm_mode_object *)` is 8 bytes on 64-bit systems, a malicious user can easily pass an `object_count` that results in an allocation size up to ~34GB, which will still trigger a kernel warning even with `kvzalloc_objs()`.
* **Prior Art:** Commit `a1ba4594232c` ("drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO") addressed this exact scenario. A user-supplied `__u32` was used in `kvcalloc()`, which produced an allocation exceeding `INT_MAX` and triggered a warning in `__kvmalloc_node_noprof()`. The fix was to add a bounds check (`if (args->num_entries > INT_MAX / sizeof(*vm_entries)) return -EINVAL;`).
* **Prior Art:** Commit `0829b5bcdd3b` ("drm/i915: 2 GiB of relocations ought to be enough for anybody*") similarly capped the number of relocations to avoid the `kvmalloc` warning for `size > INT_MAX`.

### 3. Consistent Userspace Copying (Optional but Recommended)
Before allocating the `objects` array, the code allocates the `object_ids` array using `memdup_array_user()`. While `memdup_array_user()` fails silently for large sizes (due to `__GFP_NOWARN`), it still limits the maximum size to `MAX_PAGE_ORDER`. To consistently support large arrays across both allocations and separate user/kernel slabs, the DRM subsystem has been moving towards using `vmemdup_array_user()`.
* **Prior Art:** Commit `cb77b79abf5f` ("drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup") and commit `c4ac100e9ae2` ("drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array") both replaced `kvmalloc_array() + copy_from_user()` or `memdup_user()` with `vmemdup_array_user()` when dealing with potentially large, user-controlled arrays.

### Summary of Recommendations for the Fix
Based on how similar bugs were addressed, the final fix should:
1. Apply the proposed switch to `kvzalloc_objs()` and `kvfree()` in `fill_object_idr()`.
2. Add a sanity bounds check in `drm_mode_create_lease_ioctl()` to ensure `object_count` does not exceed `INT_MAX / sizeof(void *)` to prevent `kvmalloc` from warning on sizes > 2GB.
3. (Optional) Change the `object_ids` allocation from `memdup_array_user()` to `vmemdup_array_user()` to allow the first array to also gracefully fall back to `vmalloc()`.

60/2 2026/10/13 22:32 llm history-explorer
3m Model:
gemini-3.1-pro-preview

Tokens:
							input: 7433
							output: 34
							thoughts: 272
						

Thoughts:
**Investigating Kernel Bug Prior Art**

Okay, so I'm tasked with looking into potential prior solutions for this kernel bug in `drivers/gpu/drm/drm_lease.c`. The core issue seems to be an unbounded allocation size controlled by a user, which then triggers a `kmalloc` warning when allocating the `objects` array within `fill_object_idr()`. The proposed fix is to use `kvzalloc_objs` (or potentially `kvmalloc_array` or `kvcalloc`) instead of `kzalloc_objs`. Makes sense, we're trying to mitigate the unbounded allocation risk.

My immediate thought is to delve into the commit history. I need to find precedents. I need to see how similar issues have been tackled in the past, specifically looking for examples of where `kmalloc`-based allocations were replaced with `kvmalloc`-based counterparts or where unbounded allocations were addressed. I'm thinking, missing locks, incorrect reference counting, general error-path bugs…anything that's in the same ballpark.

Given the scope of the problem I'm going to set up `git-log` search criteria with a `Since` date of "3 years" on the subsystem or the file itself. Specifically, I'll focus on commits that address allocation issues in `drivers/gpu/drm/drm_lease.c` or, for broader context, the entire `drivers/gpu/drm/` directory.

So, first thing's first: let's try searching for commits in `drivers/gpu/drm/drm_lease.c` or `drivers/gpu/drm/` that involve the switch from those memory allocators to the "kv" variants to try and address this bug. I'll start with this more narrow focus, then broaden it to the entire directory.

I'll use `git-log` with the `PathPrefix="drivers/gpu/drm/drm_lease.c"` and `Since="3 years"` to get the specific commits in that file. That should give me a good starting point.



61/2 2026/10/13 22:36 tool git-log
0m Args:
map[PathPrefix:drivers/gpu/drm/drm_lease.c Since:3 years]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
]

62/2 2026/10/13 22:36 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8244
							output: 49
							thoughts: 109
						

Thoughts:
Okay, here's my analysis of this situation:

**Investigating Potential Memory Allocation Issues in the DRM Subsystem**

Alright, two commits in `drivers/gpu/drm/drm_lease.c` over three years? That's not much activity, and from a quick glance, they appear to be broad refactorings. Probably not where the interesting bugs are. Time to widen the net. Let's cast a broader search across the `drivers/gpu/drm/` directory.

I'm thinking, given the potential for vulnerabilities, I need to focus on memory allocation. Specifically, I'm concerned about the use of `kvmalloc`, `kvcalloc`, or `kvzalloc`, the implications of `MAX_PAGE_ORDER`, any checks around `order > MAX_PAGE_ORDER`, and, of course, anything hinting at "unbounded" or "user-controlled" memory allocation. Those are the red flags I'm looking for. They're all potential entry points for a memory-related vulnerability, or at least where I'd start digging.



63/2 2026/10/13 22:36 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc|kvcalloc|kvzalloc|kvfree] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:]

64/2 2026/10/13 22:36 llm history-explorer
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8642
							output: 38
							thoughts: 64
						

Thoughts:
Here's my thought process, as requested:

**Investigating Memory Allocation in DRM Drivers**

Hmm, that's odd. I was expecting to see some recent commits related to kernel memory allocation functions like `kvmalloc`, `kvcalloc`, `kvzalloc`, and `kvfree` within the `drivers/gpu/drm/` directory over the past three years. The absence of direct hits is surprising. My first instinct is to double-check my search parameters. Perhaps I was too specific. Let's start by broadening the scope. Instead of searching for the exact combination with path prefixes, I should look at just `kvmalloc` without any path restrictions to see if there are any indirect usages in that specific driver. Or, I might narrow my search, but focus on just `kvmalloc` within the `drivers/gpu/drm/` directory. That seems like a good starting point to understand what's really happening here. Maybe I need to look at indirect allocations, or different allocation functions altogether.



65/2 2026/10/13 22:37 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:bca45af5998a drm/vc4: Use kvmalloc_objs() for the BO cache size list
847b371debf3 drm/gpusvm: Fix MM reference leak in drm_gpusvm_range_evict
a8eba56abcad drm/exec: Use kvmalloc_objs for exec->objects
a1ba4594232c drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO
1fe7bf5457f6 drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO
4625fe5bbdac drm: gpu: msm: forbid mem reclaim from reset
e9405ce75e8e drm/amdgpu/userq: Use kvfree instead of kfree in amdgpu_userq_signal_ioctl
087be0cd54f5 drm/amdgpu/userq: Use kvfree instead of kfree in amdgpu_userq_wait_ioctl
189f164e573e Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
c4ac100e9ae2 drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
]

66/2 2026/10/13 22:37 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9274
							output: 22
							thoughts: 125
						

Thoughts:
Okay, here's my breakdown of what I'm looking at:

**Investigating Memory Allocation Usage in DRM Subsystems**

Right, so I see `kvmalloc_objs` being employed within `drm/vc4` and `drm/exec`, that’s interesting. Let's delve a bit deeper and investigate its use. I should really be focusing on avoiding potential memory leaks and ensuring efficient resource management, as you well know.

I'll check out how it's being handled in `drm/amdgpu`, specifically with the recent incorporation of `vmemdup_array_user` in `amdgpu_bo_create_list_entry_array`. I also need to verify that we are validating the `num_entries` field in `GEM_OP GET_MAPPING_INFO` to safeguard against possible vulnerabilities. Also, the `drm/exec` area is using it for `exec->objects`, so I'll see if there's any related nuance.

I'm thinking I’ll use those two commits, `a8eba56abcad` and `c4ac100e9ae2` as a reference point. They'll likely illuminate some of the key changes and decisions made in the code. I'll need to go through those and see if there are other areas to look at.



67/2 2026/10/13 22:38 tool git-show
0m Args:
map[Commit:a8eba56abcad]

Results:
map[Output:commit a8eba56abcadca67bb4b717d9ea8ebdc703fb111
Author: Jonathan Cavitt <jonathan.cavitt@intel.com>
Date:   Thu Jul 2 01:24:58 2026 +0800

    drm/exec: Use kvmalloc_objs for exec->objects
    
    Use kvmalloc_objs instead of kvmalloc_array when initializing
    exec->objects in drm_exec_init.
    
    Concern caught by static analysis.
    
    Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
    Cc: Rob Clark <robdclark@chromium.org>
    Cc: Christian KΓΆnig <christian.koenig@amd.com>
    Reviewed-by: Christian KΓΆnig <christian.koenig@amd.com>
    Link: https://patch.msgid.link/20260701172458.1416930-1-jonathan.cavitt@intel.com

diff --git a/drivers/gpu/drm/drm_exec.c b/drivers/gpu/drm/drm_exec.c
index 7988f5e7d56a..fa923852fae4 100644
--- a/drivers/gpu/drm/drm_exec.c
+++ b/drivers/gpu/drm/drm_exec.c
@@ -79,7 +79,7 @@ void drm_exec_init(struct drm_exec *exec, u32 flags, unsigned nr)
 		nr = PAGE_SIZE / sizeof(void *);
 
 	exec->flags = flags;
-	exec->objects = kvmalloc_array(nr, sizeof(void *), GFP_KERNEL);
+	exec->objects = kvmalloc_objs(*exec->objects, nr, GFP_KERNEL);
 
 	/* If allocation here fails, just delay that till the first use */
 	exec->max_objects = exec->objects ? nr : 0;
]

68/2 2026/10/13 22:38 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10203
							output: 25
							thoughts: 16
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it were my own internal monologue:

**Investigating a Specific Commit Hash**

Alright, time to dive in. `c4ac100e9ae2`. That's the commit hash I need to look at. The immediate thought isn't "what is it?" but rather, a mental checklist begins. What's the context? What branches is this likely associated with? Any recent alerts pointing me here? Before I even start, I'm mentally parsing the system logs and thinking about potential areas of impact. Is this a core library change, or something more isolated? I'm anticipating the questions I'll need to answer about this commit. Let's see if this one holds the key.



69/2 2026/10/13 22:38 tool git-show
0m Args:
map[Commit:c4ac100e9ae2]

Results:
map[Output:commit c4ac100e9ae252b09986766ad23b1f83ca3a369d
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Thu Jun 12 11:44:26 2025 +0100

    drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
    
    Replace kvmalloc_array() + copy_from_user() with vmemdup_array_user() on
    the fast path.
    
    This shrinks the source code and improves separation between the kernel
    and userspace slabs.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
index 702f6610d024..66fb37b64388 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
@@ -184,43 +184,36 @@ void amdgpu_bo_list_put(struct amdgpu_bo_list *list)
 int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
 				      struct drm_amdgpu_bo_list_entry **info_param)
 {
-	const void __user *uptr = u64_to_user_ptr(in->bo_info_ptr);
 	const uint32_t info_size = sizeof(struct drm_amdgpu_bo_list_entry);
+	const void __user *uptr = u64_to_user_ptr(in->bo_info_ptr);
+	const uint32_t bo_info_size = in->bo_info_size;
+	const uint32_t bo_number = in->bo_number;
 	struct drm_amdgpu_bo_list_entry *info;
-	int r;
-
-	info = kvmalloc_array(in->bo_number, info_size, GFP_KERNEL);
-	if (!info)
-		return -ENOMEM;
 
 	/* copy the handle array from userspace to a kernel buffer */
-	r = -EFAULT;
-	if (likely(info_size == in->bo_info_size)) {
-		unsigned long bytes = in->bo_number *
-			in->bo_info_size;
-
-		if (copy_from_user(info, uptr, bytes))
-			goto error_free;
-
+	if (likely(info_size == bo_info_size)) {
+		info = vmemdup_array_user(uptr, bo_number, info_size);
+		if (IS_ERR(info))
+			return PTR_ERR(info);
 	} else {
-		unsigned long bytes = min(in->bo_info_size, info_size);
+		const uint32_t bytes = min(bo_info_size, info_size);
 		unsigned i;
 
-		memset(info, 0, in->bo_number * info_size);
-		for (i = 0; i < in->bo_number; ++i) {
-			if (copy_from_user(&info[i], uptr, bytes))
-				goto error_free;
+		info = kvmalloc_array(bo_number, info_size, GFP_KERNEL);
+		if (!info)
+			return -ENOMEM;
 
-			uptr += in->bo_info_size;
+		memset(info, 0, bo_number * info_size);
+		for (i = 0; i < bo_number; ++i, uptr += bo_info_size) {
+			if (copy_from_user(&info[i], uptr, bytes)) {
+				kvfree(info);
+				return -EFAULT;
+			}
 		}
 	}
 
 	*info_param = info;
 	return 0;
-
-error_free:
-	kvfree(info);
-	return r;
 }
 
 int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
]

70/2 2026/10/13 22:38 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11574
							output: 46
							thoughts: 54
						

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

**Investigating Potential Memory Allocation Issues in DRM Drivers**

Alright, time to dig into some potential memory allocation issues within the DRM (Direct Rendering Manager) subsystem drivers. I suspect something might be awry. My gut tells me there could be some subtle memory overruns or misuse happening, and I want to get to the bottom of it. I'm going to start by casting a wide net, looking for clues. Specifically, I'm going to search through the commit history within the `drivers/gpu/drm/` directory. I'll be looking for any commits that touch on certain areas that frequently introduce allocation problems.

First, I'll search for mentions of `MAX_PAGE_ORDER`. This constant often represents a limit on the size of contiguous memory allocations, so any commits that deal with it are immediately interesting. I will also make that search include `order > MAX_PAGE_ORDER`. Then, I'll broaden the search to look for `memdup_user` and `memdup_array_user`. These functions, while convenient, are easy to misuse and can lead to vulnerabilities if not handled carefully. Finally, I'll include `kvmalloc` in the search. It's a kernel virtual memory allocator, and any modifications to its usage, especially in the context of DRM drivers, deserve close scrutiny. This should help me quickly identify any commits that might be relevant to my investigation. I expect this initial search will hopefully give me some leads to start investigating!



71/2 2026/10/13 22:38 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc MAX_PAGE_ORDER] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:]

72/2 2026/10/13 22:38 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12013
							output: 43
							thoughts: 14
						

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

**Investigating Memory Allocation Boundaries**

Right, let's dive in. I need to get a handle on how memory is being managed in this system, specifically, any potential for unbounded allocation. My initial thought is to zero in on `kvmalloc`. I'm going to search for instances of its usage and pair that search with "unbounded" as a keyword. This could point me towards code that's allocating kernel virtual memory and, crucially, might be doing so without sufficient checks or limits. I'm hoping to identify areas where a rogue driver, or even a subtle bug, could lead to a denial-of-service or, worse, a security vulnerability. The combination of `kvmalloc` with 'unbounded' seems like a good starting point for a focused investigation. I want to see how these two concepts interact within the code.



73/2 2026/10/13 22:38 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc unbounded] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:]

74/2 2026/10/13 22:38 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12282
							output: 42
							thoughts: 13
						

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

**Analyzing Memory Allocation Strategies & User Context**

Alright, my internal processes are now focused. I need to delve into the relationship between `kvmalloc` and the `user` context. My immediate goal is to understand how these two concepts interact, and what specific information I can derive from their association. I am thinking, what I am trying to understand is how the kernel's virtual memory allocator, `kvmalloc`, is utilized within the scope of user-space interactions. This could reveal potential vulnerabilities, performance bottlenecks, or even insights into the overall system architecture. Now, I am thinking, should I look for specific patterns of `kvmalloc` calls triggered by user actions, or maybe trace how memory allocated by `kvmalloc` is eventually mapped into user-space. Perhaps there are data structures involved, and the interaction of those data structures with these calls. I will conduct these searches to uncover crucial system behavior.



75/2 2026/10/13 22:38 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc user] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:a1ba4594232c drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO
1fe7bf5457f6 drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO
e9405ce75e8e drm/amdgpu/userq: Use kvfree instead of kfree in amdgpu_userq_signal_ioctl
087be0cd54f5 drm/amdgpu/userq: Use kvfree instead of kfree in amdgpu_userq_wait_ioctl
189f164e573e Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
c4ac100e9ae2 drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
a292fdecd728 drm/amdgpu: Implement userqueue signal/wait IOCTL
0829b5bcdd3b drm/i915: 2 GiB of relocations ought to be enough for anybody*
]

76/2 2026/10/13 22:38 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12815
							output: 25
							thoughts: 16
						

Thoughts:
Okay, let's dive into this. Here's my perspective on this specific task:

**Analyzing `0829b5bcdd3b`**

Alright, the first thing I'm doing is to acknowledge this identifier, `0829b5bcdd3b`. I need to figure out what this represents. Given my expertise, it's likely a hash, some sort of identifier, perhaps a commit ID, a file checksum, or maybe even a database key. The format suggests a hexadecimal representation, which is common in many of the systems I work with. I need to understand the context. Is this a file? A revision? What system is it from? Let's check.



77/2 2026/10/13 22:39 tool git-show
0m Args:
map[Commit:0829b5bcdd3b]

Results:
map[Output:commit 0829b5bcdd3ba077c408e71e22ac2bfa85bf2c95
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Tue May 21 11:12:01 2024 +0100

    drm/i915: 2 GiB of relocations ought to be enough for anybody*
    
    Kernel test robot reports i915 can hit a warn in kvmalloc_node which has
    a purpose of dissalowing crazy size kernel allocations. This was added in
    7661809d493b ("mm: don't allow oversized kvmalloc() calls"):
    
           /* Don't even allow crazy sizes */
           if (WARN_ON_ONCE(size > INT_MAX))
                   return NULL;
    
    This would be kind of okay since i915 at one point dropped the need for
    making a shadow copy of the relocation list, but then it got re-added in
    fd1500fcd442 ("Revert "drm/i915/gem: Drop relocation slowpath".") a year
    after Linus added the above warning.
    
    It is plausible that the issue was not seen until now because to trigger
    gem_exec_reloc test requires a combination of an relatively older
    generation hardware but with at least 8GiB of RAM installed. Probably even
    more depending on runtime checks.
    
    Lets cap what we allow userspace to pass in using the matching limit.
    There should be no issue for real userspace since we are talking about
    "crazy" number of relocations which have no practical purpose.
    
    *) Well IGT tests might get upset but they can be easily adjusted.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Reported-by: kernel test robot <oliver.sang@intel.com>
    Closes: https://lore.kernel.org/oe-lkp/202405151008.6ddd1aaf-oliver.sang@intel.com
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Kent Overstreet <kent.overstreet@linux.dev>
    Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240521101201.18978-1-tursulin@igalia.com

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 090724fa766c..8aff06933f54 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1533,7 +1533,7 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)
 		u64_to_user_ptr(entry->relocs_ptr);
 	unsigned long remain = entry->relocation_count;
 
-	if (unlikely(remain > N_RELOC(ULONG_MAX)))
+	if (unlikely(remain > N_RELOC(INT_MAX)))
 		return -EINVAL;
 
 	/*
@@ -1641,7 +1641,7 @@ static int check_relocations(const struct drm_i915_gem_exec_object2 *entry)
 	if (size == 0)
 		return 0;
 
-	if (size > N_RELOC(ULONG_MAX))
+	if (size > N_RELOC(INT_MAX))
 		return -EINVAL;
 
 	addr = u64_to_user_ptr(entry->relocs_ptr);
]

78/2 2026/10/13 22:39 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14126
							output: 26
							thoughts: 41
						

Thoughts:
Okay, here's my interpretation of this commit's intention:

**Ensuring Memory Allocation Safety**

Alright, so the key here is to prevent a potential problem with `kvmalloc`. The user's providing a count, which is being used to determine the size of a memory allocation, and we need to make sure this count doesn't lead to issues with `kvmalloc` where the requested size exceeds `INT_MAX`. This is a classic integer overflow risk, and we're addressing it directly by capping that count. It's a pragmatic defense against unexpected behavior, memory allocation failures, or even security vulnerabilities related to excessively large memory requests. I'd expect this approach to maintain functionality while upholding system stability. I should double check how this interacts with the wider code base, so I'll probably start by looking at `a1ba4594232c` to see the context of this change and how the user's input is being handled throughout the call stack. Understanding the specifics of that commit would likely clarify the exact nature of the vulnerability being addressed and the rationale for the chosen cap.



79/2 2026/10/13 22:39 tool git-show
0m Args:
map[Commit:a1ba4594232c]

Results:
map[Output:commit a1ba4594232c87c3b8defd6f89a2e40f8b08395d
Author: Ziyi Guo <n7l8m4@u.northwestern.edu>
Date:   Sun Feb 8 00:02:55 2026 +0000

    drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO
    
    kvcalloc(args->num_entries, sizeof(*vm_entries), GFP_KERNEL) at
    amdgpu_gem.c:1050 uses the user-supplied num_entries directly without
    any upper bounds check. Since num_entries is a __u32 and
    sizeof(drm_amdgpu_gem_vm_entry) is 32 bytes, a large num_entries
    produces an allocation exceeding INT_MAX, triggering
    WARNING in __kvmalloc_node_noprof(), causing a kernel WARNING,
    TAINT_WARN, and panic on CONFIG_PANIC_ON_WARN=y systems.
    
    Add a size bounds check before we invoke the kvzalloc() to
    reject oversized num_entries early with -EINVAL.
    
    Fixes: 4d82724f7f2b ("drm/amdgpu: Add mapping info option for GEM_OP ioctl")
    Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 1fe7bf5457f6efd7be60b17e23163ba54341d73d)
    Cc: stable@vger.kernel.org

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 06dd2e8a5b47..fe6d988e7f24 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -1093,6 +1093,11 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
 		 * If that number is larger than the size of the array, the ioctl must
 		 * be retried.
 		 */
+		if (args->num_entries > INT_MAX / sizeof(*vm_entries)) {
+			r = -EINVAL;
+			goto out_exec;
+		}
+
 		vm_entries = kvcalloc(args->num_entries, sizeof(*vm_entries), GFP_KERNEL);
 		if (!vm_entries) {
 			r = -ENOMEM;
]

80/2 2026/10/13 22:39 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15155
							output: 43
							thoughts: 106
						

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

**Analyzing Potential Memory Allocation Vulnerabilities in DRM Drivers**

Alright, so this commit's brought up a critical point: a bounds check on `args->num_entries` before calling `kvcalloc`. My immediate thought is, "good catch!" We've got to be vigilant about these integer overflows leading to out-of-bounds memory allocations. It's a textbook example of a vulnerability. The warning from `kvcalloc` is the canary in the coal mine, and addressing it proactively is the right approach.

Now, my mind's already racing ahead. I need to see if this is an isolated incident, or if it highlights a more systemic issue within `drivers/gpu/drm/`. I'm going to leverage my familiarity with the codebase and search for other instances where we've seen this pattern of shifting from the more primitive `kmalloc` to `kvmalloc`, `kvzalloc`, or `kvcalloc`. I’ll target `drivers/gpu/drm/` specifically. My query will be focused: look for the transitions, because that's where we're most likely to find allocations whose size is based on some user-controllable input. That's where we need to be extra cautious. I'm going to search for instances of both `kvmalloc` and `kmalloc` to identify those potential problematic transitions. We're looking for code that's been patched, and we want to know what the rationale was.



81/2 2026/10/13 22:39 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc kmalloc] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:bca45af5998a drm/vc4: Use kvmalloc_objs() for the BO cache size list
189f164e573e Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
4ea512714c42 drm/xe: Fix CFI violation when accessing sysfs files
a292fdecd728 drm/amdgpu: Implement userqueue signal/wait IOCTL
590b9d576cae mm: kvmalloc: align kvrealloc() with krealloc()
]

82/2 2026/10/13 22:39 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15773
							output: 25
							thoughts: 16
						

Thoughts:
Okay, here's my interpretation of that.

**Analyzing Commit `bca45af5998a`**

Right, let's dive into this commit, `bca45af5998a`. The identifier is the only starting information I have, so I'll begin by calling the associated object from the database and reading the commit header and diffs. I'm going to look for any obvious red flags: are there any large files introduced or changed? Are we creating, modifying, or deleting crucial configurations? Is the diff clean, or does it hint at some messy rebasing? Any merge commits are easy to spot. I am hoping for a nice, concise code change, but the ID on its own isn't telling me enough. The commit message will be key here - I'm hoping it's descriptive and provides some context. Understanding the intention behind this change will help me evaluate its impact much faster than sifting through code blindly. I need to understand what this commit is supposed to *do*, and whether it does it correctly. I'll need to then quickly evaluate whether it introduces any vulnerabilities, regression potential, or performance bottlenecks.



83/2 2026/10/13 22:39 tool git-show
0m Args:
map[Commit:bca45af5998a]

Results:
map[Output:commit bca45af5998a05f34b13a2ef11e639bac9c62643
Author: MaΓ­ra Canal <mcanal@igalia.com>
Date:   Wed Sep 30 16:06:51 2026 -0300

    drm/vc4: Use kvmalloc_objs() for the BO cache size list
    
    The BO cache size list has one entry per BO page count, so its size
    scales with the largest BO ever freed. A 64 MiB BO already needs at
    least an order-6 allocation, which fails under fragmentation and
    triggers a warn_alloc() splat on BO close:
    
      page allocation failure: order:7, mode:0x40cc0(GFP_KERNEL|__GFP_COMP)
      Call trace:
       ...
       warn_alloc+0x118/0x190
       __alloc_pages_slowpath+0x4a8/0x520
       ...
       __kmalloc_noprof+0x3ac/0x5d8
       vc4_free_object+0x128/0x370 [vc4]
       drm_gem_object_handle_put_unlocked+0xb8/0x158 [drm]
       drm_gem_object_release_handle+0x74/0xe8 [drm]
       drm_gem_handle_delete+0x6c/0xa8 [drm]
       drm_gem_close_ioctl+0x34/0x50 [drm]
    
    The list doesn't need physically contiguous memory. Use kvmalloc_objs()
    so large lists can fall back to vmalloc(), avoiding the allocation
    failure.
    
    Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
    Reviewed-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
    Link: https://patch.msgid.link/20260930190721.1897264-2-mcanal@igalia.com
    Signed-off-by: MaΓ­ra Canal <mcanal@igalia.com>

diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index ea1be891ac78..7b8b3364000f 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -204,7 +204,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev,
 		struct list_head *new_list;
 		uint32_t i;
 
-		new_list = kmalloc_objs(struct list_head, new_size);
+		new_list = kvmalloc_objs(struct list_head, new_size);
 		if (!new_list)
 			return NULL;
 
@@ -224,7 +224,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev,
 		for (i = vc4->bo_cache.size_list_size; i < new_size; i++)
 			INIT_LIST_HEAD(&new_list[i]);
 
-		kfree(vc4->bo_cache.size_list);
+		kvfree(vc4->bo_cache.size_list);
 		vc4->bo_cache.size_list = new_list;
 		vc4->bo_cache.size_list_size = new_size;
 	}
@@ -1052,7 +1052,7 @@ static void vc4_bo_cache_destroy(struct drm_device *dev, void *unused)
 	cancel_work_sync(&vc4->bo_cache.time_work);
 
 	vc4_bo_cache_purge(dev);
-	kfree(vc4->bo_cache.size_list);
+	kvfree(vc4->bo_cache.size_list);
 
 	for (i = 0; i < vc4->num_labels; i++) {
 		if (vc4->bo_labels[i].num_allocated) {
]

84/2 2026/10/13 22:39 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17159
							output: 40
							thoughts: 96
						

Thoughts:
Here's my thought process, as if I were analyzing this:

**Identifying a Familiar Pattern and Potential Solutions**

Okay, this scenario screams "memory allocation issue" to me. Specifically, I'm seeing a classic case of a user-supplied size potentially leading to an `kmalloc` failure due to an excessively large `order` value, exceeding `MAX_PAGE_ORDER`. This is a textbook problem. The proposed fix, switching to `kvmalloc_objs` and `kvfree`, is the right path to take given the context - assuming a small number of large memory allocations is preferable to a large number of smaller allocations. Now I need to see if this pattern has been addressed elsewhere in the `drivers/gpu/drm/` directory. Are there any existing solutions I can draw from for an example? I need to know the pattern and existing solutions.
I'm going to quickly search for other commits in that area that utilize the `kvmalloc_array`, `kvcalloc`, or `kvzalloc` functions. This will help me to determine if this is a recurring issue, if there are existing best practices within the DRM subsystem, and if a common solution or pattern has already been established in other similar areas of the kernel. This also helps in debugging the issue as I may be able to glean information on how to test this, since this seems to be an old issue.



85/2 2026/10/13 22:39 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc_array] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:847b371debf3 drm/gpusvm: Fix MM reference leak in drm_gpusvm_range_evict
a8eba56abcad drm/exec: Use kvmalloc_objs for exec->objects
c4ac100e9ae2 drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
a292fdecd728 drm/amdgpu: Implement userqueue signal/wait IOCTL
b57e3ca1fb19 drm/amdgpu: Use kvcalloc instead of kvmalloc_array in amdgpu_cs_parser_bos()
bae9fca96843 drm: i915: Adapt to -Walloc-size
]

86/2 2026/10/13 22:39 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17774
							output: 25
							thoughts: 16
						

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

**Analyzing that Hash**

Alright, let's take a look at that hash, `b57e3ca1fb19`. Right away, my mind starts to race. Depending on the context, this could represent a commit hash, a file hash, a block identifier in a blockchain, or even a unique identifier in some custom data structure. Given the length and hexadecimal format, it screams SHA-1 or MD5 initially, though SHA-256 is increasingly common. If this is from a system I'm working with, I need to immediately recall its conventions. Is it truncated? Does the system use a specific hashing algorithm standard? Where is this hash *from*? What systems does it connect to? That's what I need to establish first. Knowing that, I can work backward from its source to get a better handle on its meaning. Then, I need to start thinking about the context. What metadata surrounds this hash? What system generated it? Is it associated with any logs, change history, or version control system? Are there any tools, scripts, or APIs I can use to quickly resolve it? The goal will be to uncover its origin and content quickly. Once I understand that, I can determine its relevance to the problem.



87/2 2026/10/13 22:40 tool git-show
0m Args:
map[Commit:b57e3ca1fb19]

Results:
map[Output:commit b57e3ca1fb192962f5b062c2e13e1bab1936292c
Author: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Date:   Wed Dec 20 19:36:20 2023 +0530

    drm/amdgpu: Use kvcalloc instead of kvmalloc_array in amdgpu_cs_parser_bos()
    
    kvmalloc_array + __GFP_ZERO is the same with kvcalloc.
    
    Fixes the below:
    drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:873 amdgpu_cs_parser_bos() warn: Please consider using kvcalloc instead of kvmalloc_array
    
    Cc: Christian KΓΆnig <christian.koenig@amd.com>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
    Reviewed-by: Christian KΓΆnig <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index e50be6500030..83c7fc09218c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -870,9 +870,9 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
 		struct amdgpu_bo *bo = e->bo;
 		int i;
 
-		e->user_pages = kvmalloc_array(bo->tbo.ttm->num_pages,
-					sizeof(struct page *),
-					GFP_KERNEL | __GFP_ZERO);
+		e->user_pages = kvcalloc(bo->tbo.ttm->num_pages,
+					 sizeof(struct page *),
+					 GFP_KERNEL);
 		if (!e->user_pages) {
 			DRM_ERROR("kvmalloc_array failure\n");
 			r = -ENOMEM;
]

88/2 2026/10/13 22:40 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18719
							output: 25
							thoughts: 16
						

Thoughts:
Okay, here's my interpretation of that:

**Investigating a Hash Value**

Right, let's take a look at this hash: `a292fdecd728`. This likely represents a unique identifier – could be a commit, a file, a transaction ID, or even a specific state in some system. Now, my immediate thoughts are: what kind of context does this hash exist in? Where did it come from? Knowing the origin is key to knowing how to proceed. Is this a system I recognize, or something new? Is there a known format, algorithm, or associated metadata that I should be aware of? This needs immediate investigation so I can interpret this number.



89/2 2026/10/13 22:40 tool git-show
0m Args:
map[Commit:a292fdecd728]

Results:
map[Output:commit a292fdecd72834b3bec380baa5db1e69e7f70679
Author: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Date:   Wed Oct 30 10:26:07 2024 +0530

    drm/amdgpu: Implement userqueue signal/wait IOCTL
    
    This patch introduces new IOCTL for userqueue secure semaphore.
    
    The signal IOCTL called from userspace application creates a drm
    syncobj and array of bo GEM handles and passed in as parameter to
    the driver to install the fence into it.
    
    The wait IOCTL gets an array of drm syncobjs, finds the fences
    attached to the drm syncobjs and obtain the array of
    memory_address/fence_value combintion which are returned to
    userspace.
    
    v2: (Christian)
        - Install fence into GEM BO object.
        - Lock all BO's using the dma resv subsystem
        - Reorder the sequence in signal IOCTL function.
        - Get write pointer from the shadow wptr
        - use userq_fence to fetch the va/value in wait IOCTL.
    
    v3: (Christian)
        - Use drm_exec helper for the proper BO drm reserve and avoid BO
          lock/unlock issues.
        - fence/fence driver reference count logic for signal/wait IOCTLs.
    
    v4: (Christian)
        - Fixed the drm_exec calling sequence
        - use dma_resv_for_each_fence_unlock if BO's are not locked
        - Modified the fence_info array storing logic.
    
    v5: (Christian)
        - Keep fence_drv until wait queue execution.
        - Add dma_fence_wait for other fences.
        - Lock BO's using drm_exec as the number of fences in them could
          change.
        - Install signaled fences as well into BO/Syncobj.
        - Move Syncobj fence installation code after the drm_exec_prepare_array.
        - Directly add dma_resv_usage_rw(args->bo_flags....
        - remove unnecessary dma_fence_put.
    
    v6: (Christian)
        - Add xarray stuff to store the fence_drv
        - Implement a function to iterate over the xarray and drop
          the fence_drv references.
        - Add drm_exec_until_all_locked() wrapper
        - Add a check that if we haven't exceeded the user allocated num_fences
          before adding dma_fence to the fences array.
    
    v7: (Christian)
        - Use memdup_user() for kmalloc_array + copy_from_user
        - Move the fence_drv references from the xarray into the newly created fence
          and drop the fence_drv references when we signal this fence.
        - Move this locking of BOs before the "if (!wait_info->num_fences)",
          this way you need this code block only once.
        - Merge the error handling code and the cleanup + return 0 code.
        - Initializing the xa should probably be done in the userq code.
        - Remove the userq back pointer stored in fence_drv.
        - Pass xarray as parameter in amdgpu_userq_walk_and_drop_fence_drv()
    
    v8: (Christian)
        - Move fence_drv references must come before adding the fence to the list.
        - Use xa_lock_irqsave_nested for nested spinlock operations.
        - userq_mgr should be per fpriv and not one per device.
        - Restructure the interrupt process code for the early exit of the loop.
        - The reference acquired in the syncobj fence replace code needs to be
          kept around.
        - Modify the dma_fence acquire placement in wait IOCTL.
        - Move USERQ_BO_WRITE flag to UAPI header file.
        - drop the fence drv reference after telling the hw to stop accessing it.
        - Add multi sync object support to userq signal IOCTL.
    
    V9: (Christian)
        - Store all the fence_drv ref to other drivers and not ourself.
        - Remove the userq fence xa implementation and replace with
          kvmalloc_array.
    
    v10: (Christian)
         - Add a comment for the userq_xa xarray
         - drop the if check of userq_fence->fence_drv_array
         - use the i variable to initialize userq_fence->fence_drv_array_count
         - drop the fence reference before you free the array in the error handling,
           otherwise it could be that some references leaked.
    
    Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
    Suggested-by: Christian KΓΆnig <christian.koenig@amd.com>
    Reviewed-by: Christian KΓΆnig <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 02511b6eb6af..be10fbe293e4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1094,6 +1094,12 @@ struct amdgpu_device {
 	struct amdgpu_mqd               mqds[AMDGPU_HW_IP_NUM];
 	const struct amdgpu_userq_funcs *userq_funcs[AMDGPU_HW_IP_NUM];
 
+	/* xarray used to retrieve the user queue fence driver reference
+	 * in the EOP interrupt handler to signal the particular user
+	 * queue fence.
+	 */
+	struct xarray			userq_xa;
+
 	/* df */
 	struct amdgpu_df                df;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 0221e7928989..148f859c3b98 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2950,6 +2950,8 @@ const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
 	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_OP, amdgpu_gem_op_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
 	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_USERPTR, amdgpu_gem_userptr_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
 	DRM_IOCTL_DEF_DRV(AMDGPU_USERQ, amdgpu_userq_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
+	DRM_IOCTL_DEF_DRV(AMDGPU_USERQ_SIGNAL, amdgpu_userq_signal_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
+	DRM_IOCTL_DEF_DRV(AMDGPU_USERQ_WAIT, amdgpu_userq_wait_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
 };
 
 static const struct drm_driver amdgpu_kms_driver = {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
index 3693453d8b60..8f9d2427d380 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
@@ -25,6 +25,7 @@
 #include <linux/kref.h>
 #include <linux/slab.h>
 
+#include <drm/drm_exec.h>
 #include <drm/drm_syncobj.h>
 
 #include "amdgpu.h"
@@ -92,6 +93,7 @@ int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev,
 	spin_lock_init(&fence_drv->fence_list_lock);
 
 	fence_drv->adev = adev;
+	fence_drv->uq_fence_drv_xa_ref = &userq->uq_fence_drv_xa;
 	fence_drv->context = dma_fence_context_alloc(1);
 	get_task_comm(fence_drv->timeline_name, current);
 
@@ -105,6 +107,7 @@ void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_d
 	struct amdgpu_userq_fence *userq_fence, *tmp;
 	struct dma_fence *fence;
 	u64 rptr;
+	int i;
 
 	if (!fence_drv)
 		return;
@@ -115,14 +118,16 @@ void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_d
 	list_for_each_entry_safe(userq_fence, tmp, &fence_drv->fences, link) {
 		fence = &userq_fence->base;
 
-		if (rptr >= fence->seqno) {
-			dma_fence_signal(fence);
-			list_del(&userq_fence->link);
-
-			dma_fence_put(fence);
-		} else {
+		if (rptr < fence->seqno)
 			break;
-		}
+
+		dma_fence_signal(fence);
+
+		for (i = 0; i < userq_fence->fence_drv_array_count; i++)
+			amdgpu_userq_fence_driver_put(userq_fence->fence_drv_array[i]);
+
+		list_del(&userq_fence->link);
+		dma_fence_put(fence);
 	}
 	spin_unlock(&fence_drv->fence_list_lock);
 }
@@ -132,8 +137,11 @@ void amdgpu_userq_fence_driver_destroy(struct kref *ref)
 	struct amdgpu_userq_fence_driver *fence_drv = container_of(ref,
 					 struct amdgpu_userq_fence_driver,
 					 refcount);
+	struct amdgpu_userq_fence_driver *xa_fence_drv;
 	struct amdgpu_device *adev = fence_drv->adev;
 	struct amdgpu_userq_fence *fence, *tmp;
+	struct xarray *xa = &adev->userq_xa;
+	unsigned long index;
 	struct dma_fence *f;
 
 	spin_lock(&fence_drv->fence_list_lock);
@@ -150,6 +158,12 @@ void amdgpu_userq_fence_driver_destroy(struct kref *ref)
 	}
 	spin_unlock(&fence_drv->fence_list_lock);
 
+	xa_lock(xa);
+	xa_for_each(xa, index, xa_fence_drv)
+		if (xa_fence_drv == fence_drv)
+			__xa_erase(xa, index);
+	xa_unlock(xa);
+
 	/* Free seq64 memory */
 	amdgpu_seq64_free(adev, fence_drv->gpu_addr);
 	kfree(fence_drv);
@@ -192,6 +206,33 @@ int amdgpu_userq_fence_create(struct amdgpu_usermode_queue *userq,
 	amdgpu_userq_fence_driver_get(fence_drv);
 	dma_fence_get(fence);
 
+	if (!xa_empty(&userq->uq_fence_drv_xa)) {
+		struct amdgpu_userq_fence_driver *stored_fence_drv;
+		unsigned long index, count = 0;
+		int i = 0;
+
+		xa_for_each(&userq->uq_fence_drv_xa, index, stored_fence_drv)
+			count++;
+
+		userq_fence->fence_drv_array =
+			kvmalloc_array(count,
+				       sizeof(struct amdgpu_userq_fence_driver *),
+				       GFP_KERNEL);
+
+		if (userq_fence->fence_drv_array) {
+			xa_for_each(&userq->uq_fence_drv_xa, index, stored_fence_drv) {
+				userq_fence->fence_drv_array[i] = stored_fence_drv;
+				xa_erase(&userq->uq_fence_drv_xa, index);
+				i++;
+			}
+		}
+
+		userq_fence->fence_drv_array_count = i;
+	} else {
+		userq_fence->fence_drv_array = NULL;
+		userq_fence->fence_drv_array_count = 0;
+	}
+
 	/* Check if hardware has already processed the job */
 	spin_lock_irqsave(&fence_drv->fence_list_lock, flags);
 	if (!dma_fence_is_signaled_locked(fence))
@@ -241,6 +282,8 @@ static void amdgpu_userq_fence_free(struct rcu_head *rcu)
 
 	/* Release the fence driver reference */
 	amdgpu_userq_fence_driver_put(fence_drv);
+
+	kvfree(userq_fence->fence_drv_array);
 	kmem_cache_free(amdgpu_userq_fence_slab, userq_fence);
 }
 
@@ -256,3 +299,392 @@ static const struct dma_fence_ops amdgpu_userq_fence_ops = {
 	.signaled = amdgpu_userq_fence_signaled,
 	.release = amdgpu_userq_fence_release,
 };
+
+/**
+ * amdgpu_userq_fence_read_wptr - Read the userq wptr value
+ *
+ * @filp: drm file private data structure
+ * @queue: user mode queue structure pointer
+ * @wptr: write pointer value
+ *
+ * Read the wptr value from userq's MQD. The userq signal IOCTL
+ * creates a dma_fence for the shared buffers that expects the
+ * RPTR value written to seq64 memory >= WPTR.
+ *
+ * Returns wptr value on success, error on failure.
+ */
+static int amdgpu_userq_fence_read_wptr(struct drm_file *filp,
+					struct amdgpu_usermode_queue *queue,
+					u64 *wptr)
+{
+	struct amdgpu_fpriv *fpriv = filp->driver_priv;
+	struct amdgpu_bo_va_mapping *mapping;
+	struct amdgpu_vm *vm = &fpriv->vm;
+	struct amdgpu_bo *bo;
+	u64 addr, *ptr;
+	int r;
+
+	addr = queue->userq_prop->wptr_gpu_addr;
+	addr &= AMDGPU_GMC_HOLE_MASK;
+
+	mapping = amdgpu_vm_bo_lookup_mapping(vm, addr >> PAGE_SHIFT);
+	if (!mapping)
+		return -EINVAL;
+
+	bo = mapping->bo_va->base.bo;
+	r = amdgpu_bo_reserve(bo, true);
+	if (r) {
+		DRM_ERROR("Failed to reserve userqueue wptr bo");
+		return r;
+	}
+
+	r = amdgpu_bo_kmap(bo, (void **)&ptr);
+	if (r) {
+		DRM_ERROR("Failed mapping the userqueue wptr bo");
+		goto map_error;
+	}
+
+	*wptr = le64_to_cpu(*ptr);
+
+	amdgpu_bo_kunmap(bo);
+	amdgpu_bo_unreserve(bo);
+
+	return 0;
+
+map_error:
+	amdgpu_bo_unreserve(bo);
+	return r;
+}
+
+int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data,
+			      struct drm_file *filp)
+{
+	struct amdgpu_fpriv *fpriv = filp->driver_priv;
+	struct amdgpu_userq_mgr *userq_mgr = &fpriv->userq_mgr;
+	struct drm_amdgpu_userq_signal *args = data;
+	struct amdgpu_usermode_queue *queue;
+	struct drm_gem_object **gobj = NULL;
+	struct drm_syncobj **syncobj = NULL;
+	u32 *syncobj_handles, num_syncobj_handles;
+	u32 *bo_handles, num_bo_handles;
+	int r, i, entry, boentry;
+	struct dma_fence *fence;
+	struct drm_exec exec;
+	u64 wptr;
+
+	/* Array of syncobj handles */
+	num_syncobj_handles = args->num_syncobj_handles;
+	syncobj_handles = memdup_user(u64_to_user_ptr(args->syncobj_handles_array),
+				      sizeof(u32) * num_syncobj_handles);
+	if (IS_ERR(syncobj_handles))
+		return PTR_ERR(syncobj_handles);
+
+	/* Array of pointers to the looked up syncobjs */
+	syncobj = kmalloc_array(num_syncobj_handles, sizeof(*syncobj), GFP_KERNEL);
+	if (!syncobj) {
+		r = -ENOMEM;
+		goto free_syncobj_handles;
+	}
+
+	for (entry = 0; entry < num_syncobj_handles; entry++) {
+		syncobj[entry] = drm_syncobj_find(filp, syncobj_handles[entry]);
+		if (!syncobj[entry]) {
+			r = -ENOENT;
+			goto free_syncobj;
+		}
+	}
+
+	/* Array of bo handles */
+	num_bo_handles = args->num_bo_handles;
+	bo_handles = memdup_user(u64_to_user_ptr(args->bo_handles_array),
+				 sizeof(u32) * num_bo_handles);
+	if (IS_ERR(bo_handles))
+		goto free_syncobj;
+
+	/* Array of pointers to the GEM objects */
+	gobj = kmalloc_array(num_bo_handles, sizeof(*gobj), GFP_KERNEL);
+	if (!gobj) {
+		r = -ENOMEM;
+		goto free_bo_handles;
+	}
+
+	for (boentry = 0; boentry < num_bo_handles; boentry++) {
+		gobj[boentry] = drm_gem_object_lookup(filp, bo_handles[boentry]);
+		if (!gobj[boentry]) {
+			r = -ENOENT;
+			goto put_gobj;
+		}
+	}
+
+	drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT, 0);
+	drm_exec_until_all_locked(&exec) {
+		r = drm_exec_prepare_array(&exec, gobj, num_bo_handles, 1);
+		drm_exec_retry_on_contention(&exec);
+		if (r)
+			goto exec_fini;
+	}
+
+	/*Retrieve the user queue */
+	queue = idr_find(&userq_mgr->userq_idr, args->queue_id);
+	if (!queue) {
+		r = -ENOENT;
+		goto exec_fini;
+	}
+
+	r = amdgpu_userq_fence_read_wptr(filp, queue, &wptr);
+	if (r)
+		goto exec_fini;
+
+	/* Create a new fence */
+	r = amdgpu_userq_fence_create(queue, wptr, &fence);
+	if (r)
+		goto exec_fini;
+
+	for (i = 0; i < num_bo_handles; i++)
+		dma_resv_add_fence(gobj[i]->resv, fence,
+				   dma_resv_usage_rw(args->bo_flags &
+				   AMDGPU_USERQ_BO_WRITE));
+
+	/* Add the created fence to syncobj/BO's */
+	for (i = 0; i < num_syncobj_handles; i++)
+		drm_syncobj_replace_fence(syncobj[i], fence);
+
+	/* drop the reference acquired in fence creation function */
+	dma_fence_put(fence);
+
+exec_fini:
+	drm_exec_fini(&exec);
+put_gobj:
+	while (boentry-- > 0)
+		drm_gem_object_put(gobj[boentry]);
+	kfree(gobj);
+free_bo_handles:
+	kfree(bo_handles);
+free_syncobj:
+	while (entry-- > 0)
+		if (syncobj[entry])
+			drm_syncobj_put(syncobj[entry]);
+	kfree(syncobj);
+free_syncobj_handles:
+	kfree(syncobj_handles);
+
+	return r;
+}
+
+int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
+			    struct drm_file *filp)
+{
+	struct drm_amdgpu_userq_fence_info *fence_info = NULL;
+	struct drm_amdgpu_userq_wait *wait_info = data;
+	u32 *syncobj_handles, *bo_handles;
+	struct dma_fence **fences = NULL;
+	u32 num_syncobj, num_bo_handles;
+	struct drm_gem_object **gobj;
+	struct drm_exec exec;
+	int r, i, entry, cnt;
+	u64 num_fences = 0;
+
+	num_bo_handles = wait_info->num_bo_handles;
+	bo_handles = memdup_user(u64_to_user_ptr(wait_info->bo_handles_array),
+				 sizeof(u32) * num_bo_handles);
+	if (IS_ERR(bo_handles))
+		return PTR_ERR(bo_handles);
+
+	num_syncobj = wait_info->num_syncobj_handles;
+	syncobj_handles = memdup_user(u64_to_user_ptr(wait_info->syncobj_handles_array),
+				      sizeof(u32) * num_syncobj);
+	if (IS_ERR(syncobj_handles)) {
+		r = PTR_ERR(syncobj_handles);
+		goto free_bo_handles;
+	}
+
+	/* Array of GEM object handles */
+	gobj = kmalloc_array(num_bo_handles, sizeof(*gobj), GFP_KERNEL);
+	if (!gobj) {
+		r = -ENOMEM;
+		goto free_syncobj_handles;
+	}
+
+	for (entry = 0; entry < num_bo_handles; entry++) {
+		gobj[entry] = drm_gem_object_lookup(filp, bo_handles[entry]);
+		if (!gobj[entry]) {
+			r = -ENOENT;
+			goto put_gobj;
+		}
+	}
+
+	drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT, 0);
+	drm_exec_until_all_locked(&exec) {
+		r = drm_exec_prepare_array(&exec, gobj, num_bo_handles, 0);
+		drm_exec_retry_on_contention(&exec);
+		if (r) {
+			drm_exec_fini(&exec);
+			goto put_gobj;
+		}
+	}
+
+	if (!wait_info->num_fences) {
+		/* Count syncobj's fence */
+		for (i = 0; i < num_syncobj; i++) {
+			struct dma_fence *fence;
+
+			r = drm_syncobj_find_fence(filp, syncobj_handles[i],
+						   0, 0, &fence);
+			if (r)
+				goto exec_fini;
+
+			num_fences++;
+			dma_fence_put(fence);
+		}
+
+		/* Count GEM objects fence */
+		for (i = 0; i < num_bo_handles; i++) {
+			struct dma_resv_iter resv_cursor;
+			struct dma_fence *fence;
+
+			dma_resv_for_each_fence(&resv_cursor, gobj[i]->resv,
+						dma_resv_usage_rw(wait_info->bo_wait_flags &
+						AMDGPU_USERQ_BO_WRITE), fence)
+				num_fences++;
+		}
+
+		/*
+		 * Passing num_fences = 0 means that userspace doesn't want to
+		 * retrieve userq_fence_info. If num_fences = 0 we skip filling
+		 * userq_fence_info and return the actual number of fences on
+		 * args->num_fences.
+		 */
+		wait_info->num_fences = num_fences;
+	} else {
+		/* Array of fence info */
+		fence_info = kmalloc_array(wait_info->num_fences, sizeof(*fence_info), GFP_KERNEL);
+		if (!fence_info) {
+			r = -ENOMEM;
+			goto exec_fini;
+		}
+
+		/* Array of fences */
+		fences = kmalloc_array(wait_info->num_fences, sizeof(*fences), GFP_KERNEL);
+		if (!fences) {
+			r = -ENOMEM;
+			goto free_fence_info;
+		}
+
+		/* Retrieve GEM objects fence */
+		for (i = 0; i < num_bo_handles; i++) {
+			struct dma_resv_iter resv_cursor;
+			struct dma_fence *fence;
+
+			dma_resv_for_each_fence(&resv_cursor, gobj[i]->resv,
+						dma_resv_usage_rw(wait_info->bo_wait_flags &
+						AMDGPU_USERQ_BO_WRITE), fence) {
+				if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
+					r = -EINVAL;
+					goto free_fences;
+				}
+
+				fences[num_fences++] = fence;
+				dma_fence_get(fence);
+			}
+		}
+
+		/* Retrieve syncobj's fence */
+		for (i = 0; i < num_syncobj; i++) {
+			struct dma_fence *fence;
+
+			r = drm_syncobj_find_fence(filp, syncobj_handles[i],
+						   0, 0, &fence);
+			if (r)
+				goto free_fences;
+
+			if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
+				r = -EINVAL;
+				goto free_fences;
+			}
+
+			fences[num_fences++] = fence;
+		}
+
+		for (i = 0, cnt = 0; i < wait_info->num_fences; i++) {
+			struct amdgpu_userq_fence_driver *fence_drv;
+			struct amdgpu_userq_fence *userq_fence;
+			u32 index;
+
+			userq_fence = to_amdgpu_userq_fence(fences[i]);
+			if (!userq_fence) {
+				/*
+				 * Just waiting on other driver fences should
+				 * be good for now
+				 */
+				dma_fence_wait(fences[i], false);
+				dma_fence_put(fences[i]);
+
+				continue;
+			}
+
+			fence_drv = userq_fence->fence_drv;
+			/*
+			 * We need to make sure the user queue release their reference
+			 * to the fence drivers at some point before queue destruction.
+			 * Otherwise, we would gather those references until we don't
+			 * have any more space left and crash.
+			 */
+			if (fence_drv->uq_fence_drv_xa_ref) {
+				r = xa_alloc(fence_drv->uq_fence_drv_xa_ref, &index, fence_drv,
+					     xa_limit_32b, GFP_KERNEL);
+				if (r)
+					goto free_fences;
+
+				amdgpu_userq_fence_driver_get(fence_drv);
+			}
+
+			/* Store drm syncobj's gpu va address and value */
+			fence_info[cnt].va = fence_drv->gpu_addr;
+			fence_info[cnt].value = fences[i]->seqno;
+
+			dma_fence_put(fences[i]);
+			/* Increment the actual userq fence count */
+			cnt++;
+		}
+
+		wait_info->num_fences = cnt;
+		/* Copy userq fence info to user space */
+		if (copy_to_user(u64_to_user_ptr(wait_info->userq_fence_info),
+				 fence_info, wait_info->num_fences * sizeof(*fence_info))) {
+			r = -EFAULT;
+			goto free_fences;
+		}
+
+		kfree(fences);
+		kfree(fence_info);
+	}
+
+	drm_exec_fini(&exec);
+	for (i = 0; i < num_bo_handles; i++)
+		drm_gem_object_put(gobj[i]);
+	kfree(gobj);
+
+	kfree(syncobj_handles);
+	kfree(bo_handles);
+
+	return 0;
+
+free_fences:
+	while (num_fences-- > 0)
+		dma_fence_put(fences[num_fences]);
+	kfree(fences);
+free_fence_info:
+	kfree(fence_info);
+exec_fini:
+	drm_exec_fini(&exec);
+put_gobj:
+	while (entry-- > 0)
+		drm_gem_object_put(gobj[entry]);
+	kfree(gobj);
+free_syncobj_handles:
+	kfree(syncobj_handles);
+free_bo_handles:
+	kfree(bo_handles);
+
+	return r;
+}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.h
index c3e04cdbb9e7..f72424248cc5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.h
@@ -37,7 +37,9 @@ struct amdgpu_userq_fence {
 	 */
 	spinlock_t lock;
 	struct list_head link;
+	unsigned long fence_drv_array_count;
 	struct amdgpu_userq_fence_driver *fence_drv;
+	struct amdgpu_userq_fence_driver **fence_drv_array;
 };
 
 struct amdgpu_userq_fence_driver {
@@ -52,6 +54,7 @@ struct amdgpu_userq_fence_driver {
 	spinlock_t fence_list_lock;
 	struct list_head fences;
 	struct amdgpu_device *adev;
+	struct xarray *uq_fence_drv_xa_ref;
 	char timeline_name[TASK_COMM_LEN];
 };
 
@@ -65,5 +68,9 @@ int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev,
 				    struct amdgpu_usermode_queue *userq);
 void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_drv);
 void amdgpu_userq_fence_driver_destroy(struct kref *ref);
+int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data,
+			      struct drm_file *filp);
+int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
+			    struct drm_file *filp);
 
 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
index bcd86c1b3a75..34c1297d7970 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
@@ -27,6 +27,32 @@
 #include "amdgpu_userqueue.h"
 #include "amdgpu_userq_fence.h"
 
+static void amdgpu_userq_walk_and_drop_fence_drv(struct xarray *xa)
+{
+	struct amdgpu_userq_fence_driver *fence_drv;
+	unsigned long index;
+
+	if (xa_empty(xa))
+		return;
+
+	xa_lock(xa);
+	xa_for_each(xa, index, fence_drv) {
+		__xa_erase(xa, index);
+		amdgpu_userq_fence_driver_put(fence_drv);
+	}
+
+	xa_unlock(xa);
+}
+
+static void
+amdgpu_userq_fence_driver_free(struct amdgpu_usermode_queue *userq)
+{
+	amdgpu_userq_walk_and_drop_fence_drv(&userq->uq_fence_drv_xa);
+	xa_destroy(&userq->uq_fence_drv_xa);
+	/* Drop the fence_drv reference held by user queue */
+	amdgpu_userq_fence_driver_put(userq->fence_drv);
+}
+
 static void
 amdgpu_userqueue_cleanup(struct amdgpu_userq_mgr *uq_mgr,
 			 struct amdgpu_usermode_queue *queue,
@@ -36,7 +62,7 @@ amdgpu_userqueue_cleanup(struct amdgpu_userq_mgr *uq_mgr,
 	const struct amdgpu_userq_funcs *uq_funcs = adev->userq_funcs[queue->queue_type];
 
 	uq_funcs->mqd_destroy(uq_mgr, queue);
-	amdgpu_userq_fence_driver_put(queue->fence_drv);
+	amdgpu_userq_fence_driver_free(queue);
 	idr_remove(&uq_mgr->userq_idr, queue_id);
 	kfree(queue);
 }
@@ -234,6 +260,7 @@ amdgpu_userqueue_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	}
 	queue->doorbell_index = index;
 
+	xa_init_flags(&queue->uq_fence_drv_xa, XA_FLAGS_ALLOC);
 	r = amdgpu_userq_fence_driver_alloc(adev, queue);
 	if (r) {
 		DRM_ERROR("Failed to alloc fence driver\n");
diff --git a/drivers/gpu/drm/amd/include/amdgpu_userqueue.h b/drivers/gpu/drm/amd/include/amdgpu_userqueue.h
index 76a59c350c2a..7df837fedce0 100644
--- a/drivers/gpu/drm/amd/include/amdgpu_userqueue.h
+++ b/drivers/gpu/drm/amd/include/amdgpu_userqueue.h
@@ -47,6 +47,7 @@ struct amdgpu_usermode_queue {
 	struct amdgpu_userq_obj	db_obj;
 	struct amdgpu_userq_obj fw_obj;
 	struct amdgpu_userq_obj wptr_obj;
+	struct xarray		uq_fence_drv_xa;
 	struct amdgpu_userq_fence_driver *fence_drv;
 };
 
]

90/2 2026/10/13 22:40 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28390
							output: 25
							thoughts: 175
						

Thoughts:
**Analyzing Memory Allocation in a Recent Commit**

Okay, so I'm looking at this commit and immediately something feels a little off with the memory allocation strategy here. I see they're using `memdup_user` for both `syncobj_handles` and `bo_handles`, which are arrays of `u32` as the code indicates. But then, for the `syncobj` and `gobj` structures, they're using `kmalloc_array`. I'm trying to wrap my head around the rationale for this divergence. It’s not immediately apparent why we'd choose different methods for what appear, at face value, to be similar allocation needs. This doesn’t seem related to the more nuanced situation of using `kvmalloc` for user-controlled unbounded arrays.

To get a clearer picture, let's go back and check out the rationale behind commit `847b371debf3` "drm/gpusvm: Fix MM reference leak in drm_gpusvm_range_evict." Understanding the context there might illuminate the current approach.



91/2 2026/10/13 22:40 tool git-show
0m Args:
map[Commit:847b371debf3]

Results:
map[Output:commit 847b371debf3c8c72384ab7b9a0c4123a74cc925
Author: Matthew Brost <matthew.brost@intel.com>
Date:   Tue Jul 14 10:00:25 2026 -0700

    drm/gpusvm: Fix MM reference leak in drm_gpusvm_range_evict
    
    If kvmalloc_array() fails in drm_gpusvm_range_evict(), the MM
    reference acquired earlier is not released, resulting in a reference
    leak.
    
    Fix this by dropping the MM reference on the kvmalloc_array()
    failure path.
    
    Fixes: 99624bdff867 ("drm/gpusvm: Add support for GPU Shared Virtual Memory")
    Cc: stable@vger.kernel.org
    Signed-off-by: Matthew Brost <matthew.brost@intel.com>
    Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
    Link: https://patch.msgid.link/20260714170025.3487974-1-matthew.brost@intel.com

diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
index 9a06ff7d2608..9aeaca02e928 100644
--- a/drivers/gpu/drm/drm_gpusvm.c
+++ b/drivers/gpu/drm/drm_gpusvm.c
@@ -1753,8 +1753,10 @@ int drm_gpusvm_range_evict(struct drm_gpusvm *gpusvm,
 		return -EFAULT;
 
 	pfns = kvmalloc_array(npages, sizeof(*pfns), GFP_KERNEL);
-	if (!pfns)
+	if (!pfns) {
+		mmput(mm);
 		return -ENOMEM;
+	}
 
 	hmm_range.hmm_pfns = pfns;
 	while (!time_after(jiffies, timeout)) {
]

92/2 2026/10/13 22:40 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29390
							output: 40
							thoughts: 728
						

Thoughts:
**Memory Leak Fix: A Familiar Pattern**

Alright, this looks like a straightforward memory leak fix. Let's break down what's happening. The core issue revolves around an unbounded, user-controlled allocation size within `drm_mode_create_lease_ioctl`. Specifically, the code uses `kzalloc_objs` (which, as we know, is a wrapper for `kcalloc`) to allocate an array of pointers. The size of this array, controlled by `object_count`, can get dangerously large. When `object_count` gets past `MAX_PAGE_ORDER`, the page allocator throws a warning.

The fix, as proposed, is to switch to `kvzalloc_objs` (which wraps `kvcalloc`) and, consequently, `kvfree`. Simple enough on the surface. But, let's see if we can understand this better. It seems like the common issue is allocating a list with a possibly large size.

I started digging into similar issues within `drivers/gpu/drm/` to see if there was precedent. Here's what I found, and it's quite revealing:

1.  `bca45af5998a` (drm/vc4): The BO cache size list was scaling with the largest BO ever freed. A large BO, like 64 MiB, could trigger an order-6 allocation, which could fail due to fragmentation and trigger `warn_alloc()`. The fix was `kvmalloc_objs()`, so the large lists could fall back to `vmalloc()`, which avoids the allocation failure.
2.  `a1ba4594232c` (drm/amdgpu): Here, `kvcalloc` directly used the user-supplied `num_entries`. This could lead to a really large `num_entries`, which produces an allocation exceeding `INT_MAX`, and triggers a warning in `__kvmalloc_node_noprof()`. The fix added a bounds check before invoking `kvzalloc()`. Good to know!
3.  `0829b5bcdd3b` (drm/i915): Capped the number of relocations to avoid `kvmalloc` warning for `size > INT_MAX`.
4.  `a8eba56abcad` (drm/exec): A straight switch to `kvmalloc_objs` from `kvmalloc_array`.
5.  `c4ac100e9ae2` (drm/amdgpu): Replaced `kvmalloc_array() + copy_from_user()` with `vmemdup_array_user()` on the fast path. Okay, interesting. Wait, `vmemdup_array_user()`? Let's check this against `memdup_array_user`.

So, in our bug, `memdup_array_user` is used for `object_ids`. `memdup_array_user` calls `memdup_user`, which uses `kmalloc` with `__GFP_NOWARN`. This means it silently fails for really large sizes. However, our `objects` array is allocated with `kzalloc_objs`, which uses `GFP_KERNEL` without `__GFP_NOWARN`, and that's why we get the warning. This seems like it is a pattern!

The proposed fix of `kvzalloc_objs` for `objects` makes sense here.

Finally, I'll search for `kvmalloc_objs` in `drivers/gpu/drm/` to double-check that this fix is indeed the right approach and see how frequently we've applied this pattern.



93/2 2026/10/13 22:40 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc_objs] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:bca45af5998a drm/vc4: Use kvmalloc_objs() for the BO cache size list
a8eba56abcad drm/exec: Use kvmalloc_objs for exec->objects
189f164e573e Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
]

94/2 2026/10/13 22:40 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31023
							output: 27
							thoughts: 18
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and written in the first person:

**Investigating a Specific Identifier**

Alright, let's take a look at this one: `189f164e573e`. Just the identifier itself doesn't tell us much, but it immediately flags the need for deeper analysis. Based on its structure, I'm already mentally forming some hypotheses. Is this a hash value? A unique transaction ID? A process identifier? The format hints at something hexadecimal, so my initial focus will be on the potential systems or data stores where this kind of representation is prevalent within our infrastructure. I'll need to correlate this identifier to its context. My first step will be to search the relevant logs and data sources, using this identifier as the primary query term. I'm expecting some hits there. I'll also want to look at system metadata to look for connections. Depending on the results of the initial searches, I might need to move to a more granular analysis to dig further.



95/2 2026/10/13 22:40 tool git-show
0m Args:
map[Commit:189f164e573e]

Results:
map[Output:commit 189f164e573e18d9f8876dbd3ad8fcbe11f93037
Author: Kees Cook <kees@kernel.org>
Date:   Sat Feb 21 23:46:04 2026 -0800

    Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
    
    Conversion performed via this Coccinelle script:
    
      // SPDX-License-Identifier: GPL-2.0-only
      // Options: --include-headers-for-types --all-includes --include-headers --keep-comments
      virtual patch
    
      @gfp depends on patch && !(file in "tools") && !(file in "samples")@
      identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
                        kzalloc_obj,kzalloc_objs,kzalloc_flex,
                        kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
                        kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
      @@
    
            ALLOC(...
      -             , GFP_KERNEL
            )
    
      $ make coccicheck MODE=patch COCCI=gfp.cocci
    
    Build and boot tested x86_64 with Fedora 42's GCC and Clang:
    
    Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
    Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01
    
    Signed-off-by: Kees Cook <kees@kernel.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/arch/arm/probes/kprobes/test-core.c b/arch/arm/probes/kprobes/test-core.c
index ef93f2f1db62..7a2baa135f0f 100644
--- a/arch/arm/probes/kprobes/test-core.c
+++ b/arch/arm/probes/kprobes/test-core.c
@@ -764,7 +764,7 @@ static int coverage_start_fn(const struct decode_header *h, void *args)
 static int coverage_start(const union decode_item *table)
 {
 	coverage.base = kmalloc_objs(struct coverage_entry,
-				     MAX_COVERAGE_ENTRIES, GFP_KERNEL);
+				     MAX_COVERAGE_ENTRIES);
 	coverage.num_entries = 0;
 	coverage.nesting = 0;
 	return table_iter(table, coverage_start_fn, &coverage);
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 70a846c5ddba..b01ebaace48e 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -342,7 +342,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
 	/* Allocate cluster boot configuration structs */
 	nclusters = mips_cps_numclusters();
 	mips_cps_cluster_bootcfg = kzalloc_objs(*mips_cps_cluster_bootcfg,
-						nclusters, GFP_KERNEL);
+						nclusters);
 	if (!mips_cps_cluster_bootcfg)
 		goto err_out;
 
@@ -368,8 +368,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
 			int v;
 			core_vpes = core_vpe_count(cl, c);
 			core_bootcfg[c].vpe_config = kzalloc_objs(*core_bootcfg[c].vpe_config,
-								  core_vpes,
-								  GFP_KERNEL);
+								  core_vpes);
 			for (v = 0; v < core_vpes; v++)
 				cpumask_set_cpu(nvpe++, &mips_cps_cluster_bootcfg[cl].cpumask);
 			if (!core_bootcfg[c].vpe_config)
diff --git a/arch/powerpc/kvm/e500_mmu.c b/arch/powerpc/kvm/e500_mmu.c
index 13bcadccb2b7..48580c85f23b 100644
--- a/arch/powerpc/kvm/e500_mmu.c
+++ b/arch/powerpc/kvm/e500_mmu.c
@@ -913,8 +913,7 @@ int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500)
 	vcpu_e500->gtlb_params[1].sets = 1;
 
 	vcpu_e500->gtlb_arch = kmalloc_objs(*vcpu_e500->gtlb_arch,
-					    KVM_E500_TLB0_SIZE + KVM_E500_TLB1_SIZE,
-					    GFP_KERNEL);
+					    KVM_E500_TLB0_SIZE + KVM_E500_TLB1_SIZE);
 	if (!vcpu_e500->gtlb_arch)
 		return -ENOMEM;
 
@@ -922,14 +921,12 @@ int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500)
 	vcpu_e500->gtlb_offset[1] = KVM_E500_TLB0_SIZE;
 
 	vcpu_e500->gtlb_priv[0] = kzalloc_objs(struct tlbe_ref,
-					       vcpu_e500->gtlb_params[0].entries,
-					       GFP_KERNEL);
+					       vcpu_e500->gtlb_params[0].entries);
 	if (!vcpu_e500->gtlb_priv[0])
 		goto free_vcpu;
 
 	vcpu_e500->gtlb_priv[1] = kzalloc_objs(struct tlbe_ref,
-					       vcpu_e500->gtlb_params[1].entries,
-					       GFP_KERNEL);
+					       vcpu_e500->gtlb_params[1].entries);
 	if (!vcpu_e500->gtlb_priv[1])
 		goto free_vcpu;
 
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index db98e9af8812..c1563b4eaa94 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1699,8 +1699,7 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent,
 		/* Needed for hotplug/migration */
 		if (!per_nest_pmu_arr) {
 			per_nest_pmu_arr = kzalloc_objs(struct imc_pmu *,
-							get_max_nest_dev() + 1,
-							GFP_KERNEL);
+							get_max_nest_dev() + 1);
 			if (!per_nest_pmu_arr)
 				goto err;
 		}
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index d4665daa34c2..10fa9b844fcc 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -2282,7 +2282,7 @@ static int spufs_switch_log_open(struct inode *inode, struct file *file)
 	}
 
 	ctx->switch_log = kmalloc_flex(*ctx->switch_log, log,
-				       SWITCH_LOG_BUFSIZE, GFP_KERNEL);
+				       SWITCH_LOG_BUFSIZE);
 
 	if (!ctx->switch_log) {
 		rc = -ENOMEM;
diff --git a/arch/powerpc/platforms/powernv/opal-async.c b/arch/powerpc/platforms/powernv/opal-async.c
index 2cacfe5407c9..6560c024bfd2 100644
--- a/arch/powerpc/platforms/powernv/opal-async.c
+++ b/arch/powerpc/platforms/powernv/opal-async.c
@@ -266,7 +266,7 @@ int __init opal_async_comp_init(void)
 
 	opal_max_async_tokens = be32_to_cpup(async);
 	opal_async_tokens = kzalloc_objs(*opal_async_tokens,
-					 opal_max_async_tokens, GFP_KERNEL);
+					 opal_max_async_tokens);
 	if (!opal_async_tokens) {
 		err = -ENOMEM;
 		goto out_opal_node;
diff --git a/arch/powerpc/platforms/pseries/papr_platform_attributes.c b/arch/powerpc/platforms/pseries/papr_platform_attributes.c
index 38b417c158ba..c6159870de0e 100644
--- a/arch/powerpc/platforms/pseries/papr_platform_attributes.c
+++ b/arch/powerpc/platforms/pseries/papr_platform_attributes.c
@@ -314,8 +314,7 @@ static int __init papr_init(void)
 	/* Allocate the groups before registering */
 	for (idx = 0; idx < num_attrs; idx++) {
 		papr_groups[idx].pg.attrs = kzalloc_objs(*papr_groups[idx].pg.attrs,
-							 KOBJ_MAX_ATTRS + 1,
-							 GFP_KERNEL);
+							 KOBJ_MAX_ATTRS + 1);
 		if (!papr_groups[idx].pg.attrs)
 			goto out_pgattrs;
 
diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c
index cc2f980700f3..1961135689db 100644
--- a/arch/riscv/kernel/module.c
+++ b/arch/riscv/kernel/module.c
@@ -754,7 +754,7 @@ initialize_relocation_hashtable(unsigned int num_relocations,
 
 	/* Number of relocations may be large, so kvmalloc it */
 	*relocation_hashtable = kvmalloc_objs(**relocation_hashtable,
-					      hashtable_size, GFP_KERNEL);
+					      hashtable_size);
 	if (!*relocation_hashtable)
 		return 0;
 
diff --git a/arch/riscv/kvm/vcpu_sbi_fwft.c b/arch/riscv/kvm/vcpu_sbi_fwft.c
index 14cea431b863..2eab15339694 100644
--- a/arch/riscv/kvm/vcpu_sbi_fwft.c
+++ b/arch/riscv/kvm/vcpu_sbi_fwft.c
@@ -353,7 +353,7 @@ static int kvm_sbi_ext_fwft_init(struct kvm_vcpu *vcpu)
 	int i;
 
 	fwft->configs = kzalloc_objs(struct kvm_sbi_fwft_config,
-				     ARRAY_SIZE(features), GFP_KERNEL);
+				     ARRAY_SIZE(features));
 	if (!fwft->configs)
 		return -ENOMEM;
 
diff --git a/arch/s390/kernel/perf_pai.c b/arch/s390/kernel/perf_pai.c
index 8fd3e47307a3..86f71a3d1ef2 100644
--- a/arch/s390/kernel/perf_pai.c
+++ b/arch/s390/kernel/perf_pai.c
@@ -282,8 +282,7 @@ static int pai_alloc_cpu(struct perf_event *event, int cpu)
 			need_paiext_cb = true;
 		}
 		cpump->save = kvmalloc_objs(struct pai_userdata,
-					    pai_pmu[idx].num_avail + 1,
-					    GFP_KERNEL);
+					    pai_pmu[idx].num_avail + 1);
 		if (!cpump->area || !cpump->save ||
 		    (need_paiext_cb && !cpump->paiext_cb)) {
 			pai_free(mp);
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 42f392e6add3..012b2bcaa8a0 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1070,7 +1070,7 @@ static int __init ubd_init(void)
 		return -1;
 
 	irq_req_buffer = kmalloc_objs(struct io_thread_req *,
-				      UBD_REQ_BUFFER_SIZE, GFP_KERNEL);
+				      UBD_REQ_BUFFER_SIZE);
 	irq_remainder = 0;
 
 	if (irq_req_buffer == NULL) {
@@ -1078,7 +1078,7 @@ static int __init ubd_init(void)
 		return -ENOMEM;
 	}
 	io_req_buffer = kmalloc_objs(struct io_thread_req *,
-				     UBD_REQ_BUFFER_SIZE, GFP_KERNEL);
+				     UBD_REQ_BUFFER_SIZE);
 
 	io_remainder = 0;
 
diff --git a/arch/um/drivers/vfio_kern.c b/arch/um/drivers/vfio_kern.c
index 7b6492174da0..e6dab473cde4 100644
--- a/arch/um/drivers/vfio_kern.c
+++ b/arch/um/drivers/vfio_kern.c
@@ -515,7 +515,7 @@ static void uml_vfio_open_device(struct uml_vfio_device *dev)
 	}
 
 	dev->intr_ctx = kmalloc_objs(struct uml_vfio_intr_ctx,
-				     dev->udev.irq_count, GFP_KERNEL);
+				     dev->udev.irq_count);
 	if (!dev->intr_ctx) {
 		pr_err("Failed to allocate interrupt context (%s)\n",
 		       dev->name);
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 41f571040145..cf3a4fe06ff2 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -7379,7 +7379,7 @@ static __always_inline int intel_pmu_init_hybrid(enum hybrid_pmu_type pmus)
 
 	x86_pmu.num_hybrid_pmus = hweight_long(pmus_mask);
 	x86_pmu.hybrid_pmu = kzalloc_objs(struct x86_hybrid_pmu,
-					  x86_pmu.num_hybrid_pmus, GFP_KERNEL);
+					  x86_pmu.num_hybrid_pmus);
 	if (!x86_pmu.hybrid_pmu)
 		return -ENOMEM;
 
diff --git a/arch/x86/events/intel/uncore_discovery.c b/arch/x86/events/intel/uncore_discovery.c
index c8bf3983accf..12e259a988dd 100644
--- a/arch/x86/events/intel/uncore_discovery.c
+++ b/arch/x86/events/intel/uncore_discovery.c
@@ -745,8 +745,7 @@ intel_uncore_generic_init_uncores(enum uncore_access_type type_id, int num_extra
 	int i = 0;
 
 	uncores = kzalloc_objs(struct intel_uncore_type *,
-			       num_discovered_types[type_id] + num_extra + 1,
-			       GFP_KERNEL);
+			       num_discovered_types[type_id] + num_extra + 1);
 	if (!uncores)
 		return empty_uncore;
 
diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
index d22cabe119b1..c5065f84b78b 100644
--- a/arch/x86/kvm/vmx/tdx.c
+++ b/arch/x86/kvm/vmx/tdx.c
@@ -2407,7 +2407,7 @@ static int __tdx_td_init(struct kvm *kvm, struct td_params *td_params,
 	/* TDVPS = TDVPR(4K page) + TDCX(multiple 4K pages), -1 for TDVPR. */
 	kvm_tdx->td.tdcx_nr_pages = tdx_sysinfo->td_ctrl.tdvps_base_size / PAGE_SIZE - 1;
 	tdcs_pages = kzalloc_objs(*kvm_tdx->td.tdcs_pages,
-				  kvm_tdx->td.tdcs_nr_pages, GFP_KERNEL);
+				  kvm_tdx->td.tdcs_nr_pages);
 	if (!tdcs_pages)
 		goto free_tdr;
 
diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c
index 24b8b1c40e25..61f595410832 100644
--- a/block/blk-crypto-fallback.c
+++ b/block/blk-crypto-fallback.c
@@ -574,7 +574,7 @@ static int blk_crypto_fallback_init(void)
 		goto fail_destroy_profile;
 
 	blk_crypto_keyslots = kzalloc_objs(blk_crypto_keyslots[0],
-					   blk_crypto_num_keyslots, GFP_KERNEL);
+					   blk_crypto_num_keyslots);
 	if (!blk_crypto_keyslots)
 		goto fail_free_wq;
 
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 54ee346ddb5a..9d1dd6ccfad7 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -1805,7 +1805,7 @@ static int disk_alloc_zone_resources(struct gendisk *disk,
 
 	disk->zone_wplugs_hash =
 		kzalloc_objs(struct hlist_head,
-			     disk_zone_wplugs_hash_size(disk), GFP_KERNEL);
+			     disk_zone_wplugs_hash_size(disk));
 	if (!disk->zone_wplugs_hash)
 		return -ENOMEM;
 
diff --git a/drivers/accel/habanalabs/common/context.c b/drivers/accel/habanalabs/common/context.c
index 276c97aba992..69c68b187bb7 100644
--- a/drivers/accel/habanalabs/common/context.c
+++ b/drivers/accel/habanalabs/common/context.c
@@ -210,8 +210,7 @@ int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx)
 	atomic_set(&ctx->thread_ctx_switch_token, 1);
 	ctx->thread_ctx_switch_wait_token = 0;
 	ctx->cs_pending = kzalloc_objs(struct hl_fence *,
-				       hdev->asic_prop.max_pending_cs,
-				       GFP_KERNEL);
+				       hdev->asic_prop.max_pending_cs);
 	if (!ctx->cs_pending)
 		return -ENOMEM;
 
diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index d4c3473fb64f..09b27bac3a31 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -893,8 +893,7 @@ static int device_early_init(struct hl_device *hdev)
 
 	if (hdev->asic_prop.completion_queues_count) {
 		hdev->cq_wq = kzalloc_objs(struct workqueue_struct *,
-					   hdev->asic_prop.completion_queues_count,
-					   GFP_KERNEL);
+					   hdev->asic_prop.completion_queues_count);
 		if (!hdev->cq_wq) {
 			rc = -ENOMEM;
 			goto asid_fini;
@@ -2159,8 +2158,7 @@ int hl_device_init(struct hl_device *hdev)
 
 	if (user_interrupt_cnt) {
 		hdev->user_interrupt = kzalloc_objs(*hdev->user_interrupt,
-						    user_interrupt_cnt,
-						    GFP_KERNEL);
+						    user_interrupt_cnt);
 		if (!hdev->user_interrupt) {
 			rc = -ENOMEM;
 			goto early_fini;
@@ -2227,7 +2225,7 @@ int hl_device_init(struct hl_device *hdev)
 	 */
 	if (cq_cnt) {
 		hdev->completion_queue = kzalloc_objs(*hdev->completion_queue,
-						      cq_cnt, GFP_KERNEL);
+						      cq_cnt);
 
 		if (!hdev->completion_queue) {
 			dev_err(hdev->dev,
@@ -2249,8 +2247,7 @@ int hl_device_init(struct hl_device *hdev)
 	}
 
 	hdev->shadow_cs_queue = kzalloc_objs(struct hl_cs *,
-					     hdev->asic_prop.max_pending_cs,
-					     GFP_KERNEL);
+					     hdev->asic_prop.max_pending_cs);
 	if (!hdev->shadow_cs_queue) {
 		rc = -ENOMEM;
 		goto cq_fini;
diff --git a/drivers/accel/habanalabs/common/hw_queue.c b/drivers/accel/habanalabs/common/hw_queue.c
index f0ab99dd74d6..4232f374dfc3 100644
--- a/drivers/accel/habanalabs/common/hw_queue.c
+++ b/drivers/accel/habanalabs/common/hw_queue.c
@@ -1083,7 +1083,7 @@ int hl_hw_queues_create(struct hl_device *hdev)
 	int i, rc, q_ready_cnt;
 
 	hdev->kernel_queues = kzalloc_objs(*hdev->kernel_queues,
-					   asic->max_queues, GFP_KERNEL);
+					   asic->max_queues);
 
 	if (!hdev->kernel_queues) {
 		dev_err(hdev->dev, "Not enough memory for H/W queues\n");
diff --git a/drivers/accel/habanalabs/common/hwmon.c b/drivers/accel/habanalabs/common/hwmon.c
index 3c0f405a5148..768604d2392d 100644
--- a/drivers/accel/habanalabs/common/hwmon.c
+++ b/drivers/accel/habanalabs/common/hwmon.c
@@ -196,7 +196,7 @@ int hl_build_hwmon_channel_info(struct hl_device *hdev, struct cpucp_sensor *sen
 	}
 
 	channels_info = kzalloc_objs(struct hwmon_channel_info *,
-				     num_active_sensor_types + 1, GFP_KERNEL);
+				     num_active_sensor_types + 1);
 	if (!channels_info) {
 		rc = -ENOMEM;
 		goto channels_info_array_err;
diff --git a/drivers/accel/habanalabs/gaudi/gaudi.c b/drivers/accel/habanalabs/gaudi/gaudi.c
index 76fdf3b77b87..5ddb38aaff7a 100644
--- a/drivers/accel/habanalabs/gaudi/gaudi.c
+++ b/drivers/accel/habanalabs/gaudi/gaudi.c
@@ -540,7 +540,7 @@ static int gaudi_set_fixed_properties(struct hl_device *hdev)
 
 	prop->max_queues = GAUDI_QUEUE_ID_SIZE;
 	prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties,
-					     prop->max_queues, GFP_KERNEL);
+					     prop->max_queues);
 
 	if (!prop->hw_queues_props)
 		return -ENOMEM;
diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c
index 91f46719931c..5d9c6f0698b7 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
@@ -2763,7 +2763,7 @@ static int gaudi2_set_fixed_properties(struct hl_device *hdev)
 
 	prop->max_queues = GAUDI2_QUEUE_ID_SIZE;
 	prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties,
-					     prop->max_queues, GFP_KERNEL);
+					     prop->max_queues);
 
 	if (!prop->hw_queues_props)
 		return -ENOMEM;
@@ -3944,8 +3944,7 @@ static int gaudi2_special_blocks_config(struct hl_device *hdev)
 	prop->glbl_err_max_cause_num = GAUDI2_GLBL_ERR_MAX_CAUSE_NUM;
 	prop->num_of_special_blocks = ARRAY_SIZE(gaudi2_special_blocks);
 	prop->special_blocks = kmalloc_objs(*prop->special_blocks,
-					    prop->num_of_special_blocks,
-					    GFP_KERNEL);
+					    prop->num_of_special_blocks);
 	if (!prop->special_blocks)
 		return -ENOMEM;
 
@@ -3960,8 +3959,7 @@ static int gaudi2_special_blocks_config(struct hl_device *hdev)
 	if (ARRAY_SIZE(gaudi2_iterator_skip_block_types)) {
 		prop->skip_special_blocks_cfg.block_types =
 				kmalloc_objs(gaudi2_iterator_skip_block_types[0],
-					     ARRAY_SIZE(gaudi2_iterator_skip_block_types),
-					     GFP_KERNEL);
+					     ARRAY_SIZE(gaudi2_iterator_skip_block_types));
 		if (!prop->skip_special_blocks_cfg.block_types) {
 			rc = -ENOMEM;
 			goto free_special_blocks;
@@ -3977,8 +3975,7 @@ static int gaudi2_special_blocks_config(struct hl_device *hdev)
 	if (ARRAY_SIZE(gaudi2_iterator_skip_block_ranges)) {
 		prop->skip_special_blocks_cfg.block_ranges =
 				kmalloc_objs(gaudi2_iterator_skip_block_ranges[0],
-					     ARRAY_SIZE(gaudi2_iterator_skip_block_ranges),
-					     GFP_KERNEL);
+					     ARRAY_SIZE(gaudi2_iterator_skip_block_ranges));
 		if (!prop->skip_special_blocks_cfg.block_ranges) {
 			rc = -ENOMEM;
 			goto free_skip_special_blocks_types;
diff --git a/drivers/accel/habanalabs/goya/goya.c b/drivers/accel/habanalabs/goya/goya.c
index f94a331f4c32..bf12702e0a69 100644
--- a/drivers/accel/habanalabs/goya/goya.c
+++ b/drivers/accel/habanalabs/goya/goya.c
@@ -364,7 +364,7 @@ int goya_set_fixed_properties(struct hl_device *hdev)
 
 	prop->max_queues = GOYA_QUEUE_ID_SIZE;
 	prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties,
-					     prop->max_queues, GFP_KERNEL);
+					     prop->max_queues);
 
 	if (!prop->hw_queues_props)
 		return -ENOMEM;
diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
index 755971c13caf..ac51bff39833 100644
--- a/drivers/accel/rocket/rocket_job.c
+++ b/drivers/accel/rocket/rocket_job.c
@@ -497,8 +497,7 @@ int rocket_job_open(struct rocket_file_priv *rocket_priv)
 {
 	struct rocket_device *rdev = rocket_priv->rdev;
 	struct drm_gpu_scheduler **scheds = kmalloc_objs(*scheds,
-							 rdev->num_cores,
-							 GFP_KERNEL);
+							 rdev->num_cores);
 	unsigned int core;
 	int ret;
 
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 5f4751478752..3fa28f1abca3 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -837,8 +837,7 @@ int acpi_video_get_levels(struct acpi_device *device,
 	 * special levels (see below)
 	 */
 	br->levels = kmalloc_objs(*br->levels,
-				  obj->package.count + ACPI_VIDEO_FIRST_LEVEL,
-				  GFP_KERNEL);
+				  obj->package.count + ACPI_VIDEO_FIRST_LEVEL);
 	if (!br->levels) {
 		result = -ENOMEM;
 		goto out_free;
@@ -1331,7 +1330,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
 			  dod->package.count);
 
 	active_list = kzalloc_objs(struct acpi_video_enumerated_device,
-				   1 + dod->package.count, GFP_KERNEL);
+				   1 + dod->package.count);
 	if (!active_list) {
 		status = -ENOMEM;
 		goto out;
diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c
index afffde4cfe7a..9b88d0993e88 100644
--- a/drivers/acpi/riscv/irq.c
+++ b/drivers/acpi/riscv/irq.c
@@ -343,7 +343,7 @@ static u32 riscv_acpi_add_prt_dep(acpi_handle handle)
 			acpi_get_handle(handle, entry->source, &link_handle);
 			dep_devices.count = 1;
 			dep_devices.handles = kzalloc_objs(*dep_devices.handles,
-							   1, GFP_KERNEL);
+							   1);
 			if (!dep_devices.handles) {
 				acpi_handle_err(handle, "failed to allocate memory\n");
 				continue;
@@ -355,7 +355,7 @@ static u32 riscv_acpi_add_prt_dep(acpi_handle handle)
 			gsi_handle = riscv_acpi_get_gsi_handle(entry->source_index);
 			dep_devices.count = 1;
 			dep_devices.handles = kzalloc_objs(*dep_devices.handles,
-							   1, GFP_KERNEL);
+							   1);
 			if (!dep_devices.handles) {
 				acpi_handle_err(handle, "failed to allocate memory\n");
 				continue;
diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 82075543a1ed..b6b1dd76a06b 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -130,8 +130,7 @@ static void lpi_device_get_constraints_amd(void)
 			}
 
 			lpi_constraints_table = kzalloc_objs(*lpi_constraints_table,
-							     package->package.count,
-							     GFP_KERNEL);
+							     package->package.count);
 
 			if (!lpi_constraints_table)
 				goto free_acpi_buffer;
@@ -210,7 +209,7 @@ static void lpi_device_get_constraints(void)
 		return;
 
 	lpi_constraints_table = kzalloc_objs(*lpi_constraints_table,
-					     out_obj->package.count, GFP_KERNEL);
+					     out_obj->package.count);
 	if (!lpi_constraints_table)
 		goto free_acpi_buffer;
 
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 0dccb4526a7c..21f91d9f2fbc 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -5903,7 +5903,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		}
 
 		target_procs = kzalloc_objs(struct binder_proc *,
-					    target_procs_count, GFP_KERNEL);
+					    target_procs_count);
 
 		if (!target_procs) {
 			mutex_unlock(&binder_procs_lock);
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 4dd3415d8fdb..241f16a9b63d 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -917,7 +917,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc,
 	alloc->vm_start = vma->vm_start;
 
 	alloc->pages = kvzalloc_objs(alloc->pages[0],
-				     alloc->buffer_size / PAGE_SIZE, GFP_KERNEL);
+				     alloc->buffer_size / PAGE_SIZE);
 	if (!alloc->pages) {
 		ret = -ENOMEM;
 		failure_string = "alloc page array";
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index d155f9dab44c..12cb3aa588bc 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1846,8 +1846,7 @@ static int eni_start(struct atm_dev *dev)
 	buffer_mem = eni_dev->mem - (buf - eni_dev->ram);
 	eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2;
 	eni_dev->free_list = kmalloc_objs(*eni_dev->free_list,
-					  eni_dev->free_list_size + 1,
-					  GFP_KERNEL);
+					  eni_dev->free_list_size + 1);
 	if (!eni_dev->free_list) {
 		printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n",
 		    dev->number);
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index eb16451ba0a3..391ac5e3d2f5 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -884,7 +884,7 @@ static int cpu_cache_sysfs_init(unsigned int cpu)
 
 	/* Allocate all required memory */
 	per_cpu_index_dev(cpu) = kzalloc_objs(struct device *,
-					      cache_leaves(cpu), GFP_KERNEL);
+					      cache_leaves(cpu));
 	if (unlikely(per_cpu_index_dev(cpu) == NULL))
 		goto err_out;
 
diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index c60dafbe79e8..4d6725a0035e 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -1418,7 +1418,7 @@ static struct rnbd_clt_dev *init_dev(struct rnbd_clt_session *sess,
 	 * nr_poll_queues: the number of polling queues
 	 */
 	dev->hw_queues = kzalloc_objs(*dev->hw_queues,
-				      nr_cpu_ids + nr_poll_queues, GFP_KERNEL);
+				      nr_cpu_ids + nr_poll_queues);
 	if (!dev->hw_queues) {
 		ret = -ENOMEM;
 		goto out_alloc;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 8fc7fc3bf867..f765970578f9 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2209,12 +2209,11 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo)
 		rinfo->shadow[i].grants_used =
 			kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants);
 		rinfo->shadow[i].sg = kvzalloc_objs(rinfo->shadow[i].sg[0],
-						    psegs, GFP_KERNEL);
+						    psegs);
 		if (info->max_indirect_segments)
 			rinfo->shadow[i].indirect_grants =
 				kvzalloc_objs(rinfo->shadow[i].indirect_grants[0],
-					      INDIRECT_GREFS(grants),
-					      GFP_KERNEL);
+					      INDIRECT_GREFS(grants));
 		if ((rinfo->shadow[i].grants_used == NULL) ||
 			(rinfo->shadow[i].sg == NULL) ||
 		     (info->max_indirect_segments &&
diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index 879b8b706428..e3d0a3cbaf94 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -1137,7 +1137,7 @@ int mhi_ep_power_up(struct mhi_ep_cntrl *mhi_cntrl)
 	mhi_ep_mmio_init(mhi_cntrl);
 
 	mhi_cntrl->mhi_event = kzalloc_objs(*mhi_cntrl->mhi_event,
-					    mhi_cntrl->event_rings, GFP_KERNEL);
+					    mhi_cntrl->event_rings);
 	if (!mhi_cntrl->mhi_event)
 		return -ENOMEM;
 
@@ -1400,7 +1400,7 @@ static int mhi_ep_chan_init(struct mhi_ep_cntrl *mhi_cntrl,
 	 * only the defined channels
 	 */
 	mhi_cntrl->mhi_chan = kzalloc_objs(*mhi_cntrl->mhi_chan,
-					   mhi_cntrl->max_chan, GFP_KERNEL);
+					   mhi_cntrl->max_chan);
 	if (!mhi_cntrl->mhi_chan)
 		return -ENOMEM;
 
diff --git a/drivers/bus/mhi/ep/ring.c b/drivers/bus/mhi/ep/ring.c
index ee5b7f4755c5..9375b16ff2a5 100644
--- a/drivers/bus/mhi/ep/ring.c
+++ b/drivers/bus/mhi/ep/ring.c
@@ -206,7 +206,7 @@ int mhi_ep_ring_start(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_ring *ring,
 
 	/* Allocate ring cache memory for holding the copy of host ring */
 	ring->ring_cache = kzalloc_objs(struct mhi_ring_element,
-					ring->ring_size, GFP_KERNEL);
+					ring->ring_size);
 	if (!ring->ring_cache)
 		return -ENOMEM;
 
diff --git a/drivers/clk/aspeed/clk-ast2600.c b/drivers/clk/aspeed/clk-ast2600.c
index bc9a5b81009d..873879e5ad9b 100644
--- a/drivers/clk/aspeed/clk-ast2600.c
+++ b/drivers/clk/aspeed/clk-ast2600.c
@@ -839,7 +839,7 @@ static void __init aspeed_g6_cc_init(struct device_node *np)
 	soc_rev = (readl(scu_g6_base + ASPEED_G6_SILICON_REV) & CHIP_REVISION_ID) >> 16;
 
 	aspeed_g6_clk_data = kzalloc_flex(*aspeed_g6_clk_data, hws,
-				          ASPEED_G6_NUM_CLKS, GFP_KERNEL);
+				          ASPEED_G6_NUM_CLKS);
 	if (!aspeed_g6_clk_data)
 		return;
 	aspeed_g6_clk_data->num = ASPEED_G6_NUM_CLKS;
diff --git a/drivers/clk/clk-clps711x.c b/drivers/clk/clk-clps711x.c
index babe42e59533..27a57a9b3cb3 100644
--- a/drivers/clk/clk-clps711x.c
+++ b/drivers/clk/clk-clps711x.c
@@ -54,7 +54,7 @@ static void __init clps711x_clk_init_dt(struct device_node *np)
 	BUG_ON(!base);
 
 	clps711x_clk = kzalloc_flex(*clps711x_clk, clk_data.hws,
-				    CLPS711X_CLK_MAX, GFP_KERNEL);
+				    CLPS711X_CLK_MAX);
 	BUG_ON(!clps711x_clk);
 
 	spin_lock_init(&clps711x_clk->lock);
diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
index 2cd1ae4f152d..79eca6ee3120 100644
--- a/drivers/clk/clk-npcm7xx.c
+++ b/drivers/clk/clk-npcm7xx.c
@@ -422,7 +422,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
 		goto npcm7xx_init_error;
 
 	npcm7xx_clk_data = kzalloc_flex(*npcm7xx_clk_data, hws,
-					NPCM7XX_NUM_CLOCKS, GFP_KERNEL);
+					NPCM7XX_NUM_CLOCKS);
 	if (!npcm7xx_clk_data)
 		goto npcm7xx_init_np_err;
 
diff --git a/drivers/clocksource/ingenic-sysost.c b/drivers/clocksource/ingenic-sysost.c
index d967972c1fdc..026615bbe921 100644
--- a/drivers/clocksource/ingenic-sysost.c
+++ b/drivers/clocksource/ingenic-sysost.c
@@ -459,7 +459,7 @@ static int __init ingenic_ost_probe(struct device_node *np)
 	ost->soc_info = id->data;
 
 	ost->clocks = kzalloc_flex(*ost->clocks, hws,
-				   ost->soc_info->num_channels, GFP_KERNEL);
+				   ost->soc_info->num_channels);
 	if (!ost->clocks) {
 		ret = -ENOMEM;
 		goto err_clk_disable;
diff --git a/drivers/comedi/drivers/ni_tio.c b/drivers/comedi/drivers/ni_tio.c
index d6e7e2006981..519359a870a7 100644
--- a/drivers/comedi/drivers/ni_tio.c
+++ b/drivers/comedi/drivers/ni_tio.c
@@ -1795,7 +1795,7 @@ ni_gpct_device_construct(struct comedi_device *dev,
 
 	counter_dev->counters = kzalloc_objs(*counter, num_counters);
 	counter_dev->regs = kzalloc_objs(*counter_dev->regs,
-					 counter_dev->num_chips, GFP_KERNEL);
+					 counter_dev->num_chips);
 	if (!counter_dev->regs || !counter_dev->counters) {
 		kfree(counter_dev->regs);
 		kfree(counter_dev->counters);
diff --git a/drivers/crypto/intel/qat/qat_common/adf_telemetry.c b/drivers/crypto/intel/qat/qat_common/adf_telemetry.c
index a745c1ca4048..8c575113cbcd 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_telemetry.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_telemetry.c
@@ -76,7 +76,7 @@ static int adf_tl_alloc_mem(struct adf_accel_dev *accel_dev)
 		goto err_free_tl;
 
 	telemetry->regs_hist_buff = kmalloc_objs(*telemetry->regs_hist_buff,
-						 tl_data->num_hbuff, GFP_KERNEL);
+						 tl_data->num_hbuff);
 	if (!telemetry->regs_hist_buff)
 		goto err_free_rp_indexes;
 
diff --git a/drivers/crypto/intel/qat/qat_common/qat_uclo.c b/drivers/crypto/intel/qat/qat_common/qat_uclo.c
index 30f83f06d185..e61a367b0d17 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_uclo.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_uclo.c
@@ -1200,8 +1200,7 @@ static int qat_uclo_map_suof(struct icp_qat_fw_loader_handle *handle,
 
 	if (suof_handle->img_table.num_simgs != 0) {
 		suof_img_hdr = kzalloc_objs(img_header,
-					    suof_handle->img_table.num_simgs,
-					    GFP_KERNEL);
+					    suof_handle->img_table.num_simgs);
 		if (!suof_img_hdr)
 			return -ENOMEM;
 		suof_handle->img_table.simg_hdr = suof_img_hdr;
@@ -1892,8 +1891,7 @@ static int qat_uclo_map_objs_from_mof(struct icp_qat_mof_handle *mobj_handle)
 		sobj_chunk_num = sobj_hdr->num_chunks;
 
 	mobj_hdr = kzalloc_objs(*mobj_hdr,
-				size_add(uobj_chunk_num, sobj_chunk_num),
-				GFP_KERNEL);
+				size_add(uobj_chunk_num, sobj_chunk_num));
 	if (!mobj_hdr)
 		return -ENOMEM;
 
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index 0c5ad5a55453..cf0d3c2dfc04 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -78,7 +78,7 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance
 	dev_ctl->instances = dev_inst;
 
 	dev_blk = kzalloc_objs(struct edac_device_block,
-			       nr_instances * nr_blocks, GFP_KERNEL);
+			       nr_instances * nr_blocks);
 	if (!dev_blk)
 		goto free;
 
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index fc434739b3c3..09d4e816404b 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -776,7 +776,7 @@ static struct sbridge_dev *alloc_sbridge_dev(int seg, u8 bus, enum domain dom,
 		return NULL;
 
 	sbridge_dev->pdev = kzalloc_objs(*sbridge_dev->pdev,
-					 table->n_devs_per_imc, GFP_KERNEL);
+					 table->n_devs_per_imc);
 	if (!sbridge_dev->pdev) {
 		kfree(sbridge_dev);
 		return NULL;
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index b2c6a1660c51..d9e9815a5f96 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -1208,8 +1208,7 @@ static int extcon_alloc_groups(struct extcon_dev *edev)
 		return 0;
 
 	edev->extcon_dev_type.groups = kzalloc_objs(*edev->extcon_dev_type.groups,
-						    edev->max_supported + 2,
-						    GFP_KERNEL);
+						    edev->max_supported + 2);
 	if (!edev->extcon_dev_type.groups)
 		return -ENOMEM;
 
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
index 21c61405f794..d2b40a1a565e 100644
--- a/drivers/firewire/core-iso.c
+++ b/drivers/firewire/core-iso.c
@@ -31,8 +31,7 @@
 int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count)
 {
 	struct page **page_array __free(kfree) = kzalloc_objs(page_array[0],
-							      page_count,
-							      GFP_KERNEL);
+							      page_count);
 
 	if (!page_array)
 		return -ENOMEM;
@@ -58,8 +57,7 @@ int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card,
 			  enum dma_data_direction direction)
 {
 	dma_addr_t *dma_addrs __free(kfree) = kzalloc_objs(dma_addrs[0],
-							   buffer->page_count,
-							   GFP_KERNEL);
+							   buffer->page_count);
 	int i;
 
 	if (!dma_addrs)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 04b45242dc76..af3d2fd61cf3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -1179,8 +1179,7 @@ static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev,
 			 */
 			ip_hw_instance = kzalloc_flex(*ip_hw_instance,
 						      base_addr,
-						      ip->num_base_address,
-						      GFP_KERNEL);
+						      ip->num_base_address);
 			if (!ip_hw_instance) {
 				DRM_ERROR("no memory for ip_hw_instance");
 				return -ENOMEM;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index d9b2252db00e..5179fa008626 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -1728,8 +1728,7 @@ int amdgpu_gmc_init_mem_ranges(struct amdgpu_device *adev)
 	bool valid;
 
 	adev->gmc.mem_partitions = kzalloc_objs(struct amdgpu_mem_partition_info,
-						AMDGPU_MAX_MEM_RANGES,
-						GFP_KERNEL);
+						AMDGPU_MAX_MEM_RANGES);
 	if (!adev->gmc.mem_partitions)
 		return -ENOMEM;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 49eedfbfb5e8..254a4e983f40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -437,7 +437,7 @@ int amdgpu_irq_add_id(struct amdgpu_device *adev,
 	if (!adev->irq.client[client_id].sources) {
 		adev->irq.client[client_id].sources =
 			kzalloc_objs(struct amdgpu_irq_src *,
-				     AMDGPU_MAX_IRQ_SRC_ID, GFP_KERNEL);
+				     AMDGPU_MAX_IRQ_SRC_ID);
 		if (!adev->irq.client[client_id].sources)
 			return -ENOMEM;
 	}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
index ad5d2fcd03d7..60bbe00e8024 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
@@ -452,8 +452,7 @@ static int amdgpu_pmu_alloc_pmu_attrs(
 		return -ENOMEM;
 
 	fmt_attr_group->attrs = kzalloc_objs(*fmt_attr_group->attrs,
-					     config->num_formats + 1,
-					     GFP_KERNEL);
+					     config->num_formats + 1);
 
 	if (!fmt_attr_group->attrs)
 		goto err_fmt_attr_grp;
@@ -464,7 +463,7 @@ static int amdgpu_pmu_alloc_pmu_attrs(
 		goto err_evt_attr;
 
 	evt_attr_group->attrs = kzalloc_objs(*evt_attr_group->attrs,
-					     config->num_events + 1, GFP_KERNEL);
+					     config->num_events + 1);
 
 	if (!evt_attr_group->attrs)
 		goto err_evt_attr_grp;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index eb3e62eb7b20..c0336ca9bf6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3239,7 +3239,7 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
 	if (from_rom) {
 		err_data.err_addr =
 			kzalloc_objs(struct eeprom_table_record,
-				     adev->umc.retire_unit, GFP_KERNEL);
+				     adev->umc.retire_unit);
 		if (!err_data.err_addr) {
 			dev_warn(adev->dev, "Failed to alloc UMC error address record in mca2pa conversion!\n");
 			return -ENOMEM;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index d319c37e0d4e..eeaa56c8d129 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1881,8 +1881,7 @@ static int amdgpu_ttm_pools_init(struct amdgpu_device *adev)
 		return 0;
 
 	adev->mman.ttm_pools = kzalloc_objs(*adev->mman.ttm_pools,
-					    adev->gmc.num_mem_partitions,
-					    GFP_KERNEL);
+					    adev->gmc.num_mem_partitions);
 	if (!adev->mman.ttm_pools)
 		return -ENOMEM;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
index 8da772ec4b40..4df0f9d5ad11 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
@@ -59,7 +59,7 @@ int amdgpu_umc_page_retirement_mca(struct amdgpu_device *adev,
 
 	err_data.err_addr =
 		kzalloc_objs(struct eeprom_table_record,
-			     adev->umc.max_ras_err_cnt_per_query, GFP_KERNEL);
+			     adev->umc.max_ras_err_cnt_per_query);
 	if (!err_data.err_addr) {
 		dev_warn(adev->dev,
 			"Failed to alloc memory for umc error record in MCA notifier!\n");
@@ -106,7 +106,7 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev,
 
 	err_data->err_addr =
 		kzalloc_objs(struct eeprom_table_record,
-			     adev->umc.max_ras_err_cnt_per_query, GFP_KERNEL);
+			     adev->umc.max_ras_err_cnt_per_query);
 
 	/* still call query_ras_error_address to clear error status
 	 * even NOMEM error is encountered
@@ -132,8 +132,7 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev,
 			    adev->umc.max_ras_err_cnt_per_query) {
 				err_data->err_addr =
 					kzalloc_objs(struct eeprom_table_record,
-						     adev->umc.max_ras_err_cnt_per_query,
-						     GFP_KERNEL);
+						     adev->umc.max_ras_err_cnt_per_query);
 
 				/* still call query_ras_error_address to clear error status
 				 * even NOMEM error is encountered
@@ -163,8 +162,7 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev,
 			    adev->umc.max_ras_err_cnt_per_query) {
 				err_data->err_addr =
 					kzalloc_objs(struct eeprom_table_record,
-						     adev->umc.max_ras_err_cnt_per_query,
-						     GFP_KERNEL);
+						     adev->umc.max_ras_err_cnt_per_query);
 
 				/* still call query_ras_error_address to clear error status
 				 * even NOMEM error is encountered
@@ -554,7 +552,7 @@ int amdgpu_umc_lookup_bad_pages_in_a_row(struct amdgpu_device *adev,
 	struct ras_err_data err_data;
 
 	err_data.err_addr = kzalloc_objs(struct eeprom_table_record,
-					 adev->umc.retire_unit, GFP_KERNEL);
+					 adev->umc.retire_unit);
 	if (!err_data.err_addr) {
 		dev_warn(adev->dev, "Failed to alloc memory in bad page lookup!\n");
 		return 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index 2c19b65de840..5cef8cd14148 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -500,8 +500,7 @@ static int amdgpu_vkms_sw_init(struct amdgpu_ip_block *ip_block)
 	struct amdgpu_device *adev = ip_block->adev;
 
 	adev->amdgpu_vkms_output = kzalloc_objs(struct amdgpu_vkms_output,
-						adev->mode_info.num_crtc,
-						GFP_KERNEL);
+						adev->mode_info.num_crtc);
 	if (!adev->amdgpu_vkms_output)
 		return -ENOMEM;
 
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index d0f7bd2a3481..09dabb3b3297 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -781,7 +781,7 @@ static int kfd_ioctl_get_process_apertures_new(struct file *filp,
 	 * the amount of memory allocated by user
 	 */
 	pa = kzalloc_objs(struct kfd_process_device_apertures,
-			  args->num_of_nodes, GFP_KERNEL);
+			  args->num_of_nodes);
 	if (!pa)
 		return -ENOMEM;
 
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
index 212f613fad1e..b96fbc03c371 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
@@ -959,7 +959,7 @@ void amdgpu_dm_crtc_secure_display_create_contexts(struct amdgpu_device *adev)
 	int i;
 
 	crtc_ctx = kzalloc_objs(struct secure_display_crtc_context,
-				adev->mode_info.num_crtc, GFP_KERNEL);
+				adev->mode_info.num_crtc);
 
 	if (!crtc_ctx) {
 		adev->dm.secure_display_ctx.crtc_ctx = NULL;
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c
index 13ac1980a376..8b555187ac75 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c
[Output truncated: showing 1000 of 7327 lines]]

96/2 2026/10/13 22:40 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49257
							output: 41
							thoughts: 957
						

Thoughts:
**Analyzing Kernel Memory Allocation Strategies in DRM Subsystem**

Okay, so `189f164e573e` is a refactoring where `kmalloc_objs(..., GFP_KERNEL)` is being simplified to `kmalloc_objs(...)` by Kees Cook, which removes the `GFP_KERNEL` argument. The bug report suggests a fix using `kvzalloc_objs()` which gracefully falls back to `vmalloc()` for large allocations, avoiding page allocator warnings, and requires a corresponding `kvfree()`.

Therefore, I need to hunt for commits addressing comparable unbounded allocation problems and subsequent shifts to `kvmalloc` or equivalent strategies within the relevant files or subsystem.

I've already identified some potentially relevant commits within the `drivers/gpu/drm/` subsystem: `bca45af5998a`, `a1ba4594232c`, `0829b5bcdd3b`, `a8eba56abcad`, and `c4ac100e9ae2`. Let's focus our attention on the files within the subsystem since the initial affected file is `drivers/gpu/drm/drm_lease.c`.

Let's revisit `bca45af5998a`. The issue here is a BO cache size list that scales with the largest BO ever freed. Large allocations (e.g., 64 MiB BOs) can trigger allocation failures and `warn_alloc()` due to fragmentation. `kvmalloc_objs()` provides a fallback to `vmalloc()`, which is crucial here to avoid such failures.

Then there is `a1ba4594232c`. This one deals with a missing bounds check on user-supplied `num_entries`, leading to allocations exceeding `INT_MAX`. This is an instance of a security concern. It proposes a size bounds check to reject oversized `num_entries` early, before even calling `kvzalloc()`. This is another interesting point.

Next is `0829b5bcdd3b`. Here the "kernel test robot" reported an issue in `kvmalloc_node` due to large sizes. This commit introduces a cap on user-space-passed sizes, preventing oversized kernel allocations.

Finally, `c4ac100e9ae2` involves replacing `kvmalloc_array() + copy_from_user()` with `vmemdup_array_user()` for efficiency. This suggests a preferred strategy for handling user-space data copying in the DRM subsystem.

I need to confirm if using `vmemdup_user` or something equivalent could be relevant. Now I will search for `vmemdup_user` within the `drivers/gpu/drm/` directory.



97/2 2026/10/13 22:41 tool git-log
0m Args:
map[MessageRegexps:[vmemdup_user] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:c5f500161709 drm/xe: Fix memory leak in exec_queue_set_hang_replay_state()
1026c1a73a96 drm/xe: Implement DRM_XE_EXEC_QUEUE_SET_HANG_REPLAY_STATE
]

98/2 2026/10/13 22:41 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 50922
							output: 43
							thoughts: 23
						

Thoughts:
Okay, here's my summary, tailored for an expert audience, as if I'm thinking these thoughts:

**Analyzing GPU Driver Memory Operations**

Alright, let's dive in. I need to understand how user-space memory is being handled in the DRM subsystem, specifically focusing on potential vulnerabilities. My initial target is `vmemdup_array_user`. I'm heading straight to the `drivers/gpu/drm/` directory because that's where the heart of the GPU driver code resides, and user-space interaction is a key area for exploitation. I'm focusing on that specific function because it suggests a potentially unsafe copy from user space. I need to see how it's used, how the size arguments are handled, and if there are any subtle integer overflows or off-by-one errors that could be leveraged. I'll be looking at the surrounding code for any missing bounds checks, race conditions with memory allocation or deallocation, and whether the destination buffer is properly validated. I'm expecting this to be a fruitful line of inquiry.



99/2 2026/10/13 22:41 tool git-log
0m Args:
map[MessageRegexps:[vmemdup_array_user] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:84c4c36acd5c drm/amdgpu: validate CP_GFX_SHADOW chunk size in CS pass1
7f61b2eef741 drm/amdgpu: validate CP_GFX_SHADOW chunk size in CS pass1
922682d48d62 drm/gem: Correct error condition in drm_gem_objects_lookup
cb77b79abf5f drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
c4ac100e9ae2 drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
]

100/2 2026/10/13 22:41 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 51382
							output: 25
							thoughts: 16
						

Thoughts:
Okay, here's my interpretation of that request, formatted as requested:

**Deconstructing cb77b79abf5f**

Alright, let's take a look at this `cb77b79abf5f` identifier. Based on its structure, my initial thought is that it's likely a commit hash, a transaction ID, or perhaps some sort of unique key. Given the length and hexadecimal format, it's screaming SHA-1 or a similar cryptographic hash. I'll need more context to be certain, of course. But assuming it is one of those, the next step is to figure out *where* this hash originated. Is it a Git commit? A database transaction? A message queue identifier? That's the crucial piece of information I'm missing. Understanding the system it pertains to will guide my next steps. I'll need to use my usual tools and techniques. From there I can determine its role, how to debug any issues related to it, or if it is even relevant at all.



101/2 2026/10/13 22:41 tool git-show
0m Args:
map[Commit:cb77b79abf5f]

Results:
map[Output:commit cb77b79abf5ff8f4af07f7ebef196a003c826b7a
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Wed Nov 12 09:27:32 2025 +0000

    drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
    
    Use a helper to shrink the code and separate the user and kernel slabs for
    better security.
    
    While at it lets remove the useless debug message.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Reviewed-by: AndrΓ© Almeida <andrealmeid@igalia.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://lore.kernel.org/r/20251112092732.23584-1-tvrtko.ursulin@igalia.com

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index a1a9c828938b..68168d58a7c8 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -783,7 +783,6 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
 int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 			   int count, struct drm_gem_object ***objs_out)
 {
-	struct drm_device *dev = filp->minor->dev;
 	struct drm_gem_object **objs;
 	u32 *handles;
 	int ret;
@@ -798,15 +797,9 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 
 	*objs_out = objs;
 
-	handles = kvmalloc_array(count, sizeof(u32), GFP_KERNEL);
-	if (!handles) {
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	if (copy_from_user(handles, bo_handles, count * sizeof(u32))) {
-		ret = -EFAULT;
-		drm_dbg_core(dev, "Failed to copy in GEM handles\n");
+	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
+	if (IS_ERR(handles)) {
+		ret = PTR_ERR(handles);
 		goto out;
 	}
 
]

102/2 2026/10/13 22:41 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52359
							output: 42
							thoughts: 505
						

Thoughts:
**Analyzing a Potential Memory Allocation Vulnerability in DRM Lease Code**

Okay, so I'm looking at this `vmemdup_array_user` function – seems like it's a helpful wrapper around `kvmalloc_array` and `copy_from_user`, nothing immediately concerning there. But hang on, the bug description is key here. Apparently, `drm_mode_create_lease_ioctl()` calls `memdup_array_user()` to allocate this `object_ids` array *before* calling `fill_object_idr()`. And this `memdup_array_user()` uses `memdup_user()`, allocating with `GFP_USER | __GFP_NOWARN`. The problem? If `object_count` is huge – potentially over 4MB, it silently fails because of the `__GFP_NOWARN` flag.

My immediate thought is, if the `memdup_array_user` fails silently, that's not the critical issue. The problem arises when it *succeeds* allocating a smaller chunk (like order 10), and then later `kzalloc_objs` is called which requires order 11 allocation and *loudly* fails because of a `kmalloc` usage without the `__GFP_NOWARN` flag.

So the proposed fix, smart, is to replace that `kzalloc_objs` call with `kvzalloc_objs`. This would allow the code to fallback to vmalloc if a large allocation is needed.

I need to see if this pattern has occurred elsewhere in `drivers/gpu/drm/`. I'm going to search for commits that have switched from `kmalloc` to `kvmalloc` to avoid these page allocation failures when dealing with user-controlled sizes.

Aha! There's `bca45af5998a`. It's exactly the same situation. That commit mentions: "The BO cache size list has one entry per BO page count, so its size scales with the largest BO ever freed. A 64 MiB BO already needs at least an order-6 allocation, which fails under fragmentation and triggers a warn_alloc() splat on BO close ... The list doesn't need physically contiguous memory. Use kvmalloc_objs() so large lists can fall back to vmalloc(), avoiding the allocation failure."

Okay, let's keep digging. I'll search for `kvmalloc` and `order` in `drivers/gpu/drm/` to see what else I can find and ensure this isn't a systemic issue.



103/2 2026/10/13 22:41 tool git-log
0m Args:
map[MessageRegexps:[kvmalloc order] PathPrefix:drivers/gpu/drm/ Since:3 years]

Results:
map[Output:bca45af5998a drm/vc4: Use kvmalloc_objs() for the BO cache size list
a292fdecd728 drm/amdgpu: Implement userqueue signal/wait IOCTL
]

104/2 2026/10/13 22:42 llm history-explorer
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53513
							output: 47
							thoughts: 711
						

Thoughts:
**Analyzing Allocation Patterns for User-Controlled Sizes**

Okay, so I've been digging into how we're handling potentially unbounded user-controlled allocation sizes, and I've identified a few key patterns that are being used to avoid problems. Looking at `bca45af5998a`, it's clear that the primary strategy is to leverage `kvmalloc` (or its related functions) instead of the standard `kmalloc` approach. This allows the system to fall back to `vmalloc` when dealing with larger allocations, thus avoiding those nasty `warn_alloc()` messages. It's essentially the preferred method in the kernel for this sort of thing, and it looks like `drm/vc4` is a prime example of its application.

Then there are scenarios where even `kvmalloc` throws a warningβ€”that happens when the size exceeds `INT_MAX`. In those instances, we see the implementation of an explicit upper bound check, as demonstrated in `a1ba4594232c` (drm/amdgpu) and `0829b5bcdd3b` (drm/i915). This is a pretty straightforward approach to prevent the warnings.

Finally, when copying large arrays from userspace, it's smarter to use helpers like `vmemdup_array_user()` instead of relying on the combination of `memdup_array_user()` and a `copy_from_user()` operation. The commits `cb77b79abf5f` and `c4ac100e9ae2` highlight the use of the `vmemdup_array_user` approach.

Now, looking at our own codebase, specifically at how we're allocating `object_ids`, I have to wonder if we're doing the right thing. We're currently using `memdup_array_user`. If `object_count` is large, it may fail silently due to the presence of `__GFP_NOWARN` flag. Should we be using `vmemdup_array_user` instead? If so, this would give us the potential to succeed with large arrays by leveraging `vmalloc`'s capabilities. Yes, that makes sense. `vmemdup_array_user` is the `vmalloc` equivalent of `memdup_array_user`. I'll need to check the `memdup_array_user` implementation in `drm_lease.c` to be sure.



105/2 2026/10/13 22:43 tool git-log
0m Args:
map[MessageRegexps:[memdup_array_user] PathPrefix:drivers/gpu/drm/drm_lease.c Since:3 years]

Results:
map[Output:]

106/2 2026/10/13 22:43 llm history-explorer
5m Model:
gemini-3.1-pro-preview

Tokens:
							input: 54808
							output: 38
							thoughts: 41
						

Thoughts:
Okay, let's see. My first thought is: **Connecting the Dots: memdup_array_user and drm_lease.c**.

Right, so `memdup_array_user` is mentioned in that bug report, and it's used in `drm_lease.c`. Okay, that's the key starting point. I need to understand the relationship between those two and how this specific function is being used.

Therefore, I need to check the definition of `vmemdup_array_user`. I'm going to look at that definition next. Let's see what's going on in there.



107/2 2026/10/13 22:49 tool codesearch-definition-source
0m Args:
map[ContextFile:include/linux/string.h Name:vmemdup_array_user]

Results:
map[SourceCode:  42:	/**
  43:	 * vmemdup_array_user - duplicate array from user space
  44:	 * @src: source address in user space
  45:	 * @n: number of array members to copy
  46:	 * @size: size of one array member
  47:	 *
  48:	 * Return: an ERR_PTR() on failure. Result may be not
  49:	 * physically contiguous. Use kvfree() to free.
  50:	 */
  51:	static inline __realloc_size(2, 3)
  52:	void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
  53:	{
  54:		size_t nbytes;
  55:	
  56:		if (check_mul_overflow(n, size, &nbytes))
  57:			return ERR_PTR(-EOVERFLOW);
  58:	
  59:		return vmemdup_user(src, nbytes);
  60:	}
 SourceFile:include/linux/string.h]

108/2 2026/10/13 22:49 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 55320
							output: 37
							thoughts: 33
						

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

**Investigating `vmemdup_array_user`'s Underlying Mechanism**

Right, so `vmemdup_array_user` is built on top of `vmemdup_user`. That's the first connection to grasp. The naming suggests array-specific handling, but let's dive deeper and confirm my assumption. I need to understand how this relationship works in detail. Time to dissect the `memdup_array_user` definition and figure out the exact nuance this abstraction provides.



109/2 2026/10/13 22:49 tool codesearch-definition-source
0m Args:
map[ContextFile:include/linux/string.h Name:memdup_array_user]

Results:
map[SourceCode:  22:	/**
  23:	 * memdup_array_user - duplicate array from user space
  24:	 * @src: source address in user space
  25:	 * @n: number of array members to copy
  26:	 * @size: size of one array member
  27:	 *
  28:	 * Return: an ERR_PTR() on failure. Result is physically
  29:	 * contiguous, to be freed by kfree().
  30:	 */
  31:	static inline __realloc_size(2, 3)
  32:	void *memdup_array_user(const void __user *src, size_t n, size_t size)
  33:	{
  34:		size_t nbytes;
  35:	
  36:		if (check_mul_overflow(n, size, &nbytes))
  37:			return ERR_PTR(-EOVERFLOW);
  38:	
  39:		return memdup_user(src, nbytes);
  40:	}
 SourceFile:include/linux/string.h]

110/2 2026/10/13 22:49 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 55811
							output: 44
							thoughts: 1058
						

Thoughts:
**Analysis of the Allocation Issue and Proposed Fix**

Alright, let's break this down. It seems we have a situation where `memdup_array_user` is used internally by `memdup_user`, while `kzalloc_objs` is causing the warning. The proposed fix of using `kvzalloc_objs` and `kvfree` for the `objects` array addresses the loud warning from `kzalloc_objs`. While `memdup_array_user` *does* limit large leases, it fails silently, so it is not a bug.

Looking at recent commits within `drivers/gpu/drm/` it's becoming clear how to proceed. There are several recurring patterns to consider:

1.  **Embracing `kvmalloc` for Unbounded Sizes:** Commits like `bca45af5998a` and `a8eba56abcad` highlight the strategy of migrating to the `kvmalloc` family, specifically `kvmalloc_objs`, to handle potentially large allocations by falling back to `vmalloc` when the page allocator struggles. This is the core of the proposed solution and is the direct analog to the issue we are seeing here.

2.  **Implementing Bounds Checks:** There's a parallel need to address the possibility of sizes that are larger than `INT_MAX`, as even `kvmalloc` will issue a warning in such a situation. Commits like `a1ba4594232c` and `0829b5bcdd3b` show how to explicitly check the user-provided size against `INT_MAX` and reject the request with `-EINVAL` if it's too large.

3.  **Using `vmemdup_array_user` for User-Space Data:** The `object_ids` array, allocated using `memdup_array_user()`, while not triggering a warning, is also constrained by `MAX_PAGE_ORDER`. Recent commits, like `cb77b79abf5f` and `c4ac100e9ae2`, suggest we should consider replacing `memdup_array_user()` with `vmemdup_array_user()` for consistency. This would ensure we can handle the same range of sizes for both allocations, even if the primary fix makes the potential sizes much larger.

In summary:

*   The *primary fix* is to follow the established pattern and use `kvzalloc_objs()` (or, equivalently, `kvcalloc()`) and `kvfree()` for the `objects` array, allowing fallback to `vmalloc()` and preventing the page allocator warning.
*   We should also consider a *secondary, important check* of verifying the allocation size doesn't exceed `INT_MAX`. This is similar to the approach shown in commit `a1ba4594232c`.
*   Finally, we should also look at the `object_ids` allocation, and consider updating it from `memdup_array_user()` to `vmemdup_array_user()`, to match the pattern from commits like `cb77b79abf5f`.

We should double check to see if `drm_mode_create_lease_ioctl` has any of the necessary bounds checks.



111/2 2026/10/13 22:49 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_mode_create_lease_ioctl]

Results:
map[SourceCode: 469:	/*
 470:	 * The master associated with the specified file will have a lease
 471:	 * created containing the objects specified in the ioctl structure.
 472:	 * A file descriptor will be allocated for that and returned to the
 473:	 * application.
 474:	 */
 475:	int drm_mode_create_lease_ioctl(struct drm_device *dev,
 476:					void *data, struct drm_file *lessor_priv)
 477:	{
 478:		struct drm_mode_create_lease *cl = data;
 479:		size_t object_count;
 480:		int ret = 0;
 481:		struct idr leases;
 482:		struct drm_master *lessor;
 483:		struct drm_master *lessee = NULL;
 484:		struct file *lessee_file = NULL;
 485:		struct file *lessor_file = lessor_priv->filp;
 486:		struct drm_file *lessee_priv;
 487:		int fd = -1;
 488:		uint32_t *object_ids;
 489:	
 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
 535:			ret = fd;
 536:			goto out_lessor;
 537:		}
 538:	
 539:		drm_dbg_lease(dev, "Creating lease\n");
 540:		/* lessee will take the ownership of leases */
 541:		lessee = drm_lease_create(lessor, &leases);
 542:	
 543:		if (IS_ERR(lessee)) {
 544:			ret = PTR_ERR(lessee);
 545:			idr_destroy(&leases);
 546:			goto out_leases;
 547:		}
 548:	
 549:		/* Clone the lessor file to create a new file for us */
 550:		drm_dbg_lease(dev, "Allocating lease file\n");
 551:		lessee_file = file_clone_open(lessor_file);
 552:		if (IS_ERR(lessee_file)) {
 553:			ret = PTR_ERR(lessee_file);
 554:			goto out_lessee;
 555:		}
 556:	
 557:		lessee_priv = lessee_file->private_data;
 558:		/* Change the file to a master one */
 559:		drm_master_put(&lessee_priv->master);
 560:		lessee_priv->master = lessee;
 561:		lessee_priv->is_master = 1;
 562:		lessee_priv->authenticated = 1;
 563:	
 564:		/* Pass fd back to userspace */
 565:		drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id);
 566:		cl->fd = fd;
 567:		cl->lessee_id = lessee->lessee_id;
 568:	
 569:		/* Hook up the fd */
 570:		fd_install(fd, lessee_file);
 571:	
 572:		drm_master_put(&lessor);
 573:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
 574:		return 0;
 575:	
 576:	out_lessee:
 577:		drm_master_put(&lessee);
 578:	
 579:	out_leases:
 580:		put_unused_fd(fd);
 581:	
 582:	out_lessor:
 583:		drm_master_put(&lessor);
 584:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
 585:		return ret;
 586:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

112/2 2026/10/13 22:49 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 59432
							output: 41
							thoughts: 98
						

Thoughts:
Okay, here's my understanding, tailored for an expert audience, as if it were my own thought process:

**Potential Memory Allocation Issue with Object Counting and `memdup_array_user`**

Alright, let's see... the `object_count` variable, that's derived from `cl->object_count`, right? And that `cl->object_count` is a `__u32`. Okay, standard unsigned 32-bit integer. Now, `memdup_array_user`, the function that's crucial here, takes two `size_t` arguments: `n` and `size`. The real gotcha is, if `object_count` is particularly large – let's say it's nearing the maximum value for a `__u32` – there's a serious risk. I see the potential for a silent `-ENOMEM` failure within `memdup_array_user`. The use of `__GFP_NOWARN` is what really worries me here, because any memory allocation failure doesn't give a warning. If it *does* somehow manage to succeed, we then move on to call `fill_object_idr`. So, the main thing to consider is the size of `object_count` because there's clearly a potential for a really nasty, difficult-to-debug memory allocation failure that can happen silently. We need to analyze this closely, as large values would cause issues and possible `memdup_array_user` failure.



113/2 2026/10/13 22:49 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:fill_object_idr]

Results:
map[SourceCode: 378:	static int fill_object_idr(struct drm_device *dev,
 379:				   struct drm_file *lessor_priv,
 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
 465:		kfree(objects);
 466:		return ret;
 467:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

114/2 2026/10/13 22:49 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 61384
							output: 963
							thoughts: 1155
						

Thoughts:
**My Analysis of the Proposed Fix**

Okay, so the initial plan is to swap `kzalloc_objs` with `kvzalloc_objs` and correspondingly replace `kfree` with `kvfree`. That seems reasonable on the surface. It matches the pattern seen in commit `bca45af5998a`. Let's dig deeper.

The core issue is that we have an unbounded user-controlled allocation size, leading to the page allocator throwing a warning because the requested size can exceed `MAX_PAGE_ORDER`. Switching to the `kvmalloc` family looks like the right approach, allowing the allocation to fall back to `vmalloc()` for potentially large requests, thus circumventing the page allocator's limitations.

I've been looking at similar cases in `drivers/gpu/drm/`. Commit `bca45af5998a` confirms this as the common solution. They encountered the exact same issue: an unbounded cache size list, that was causing allocation failures. The fix was, as we are proposing, to switch to `kvmalloc_objs()`. That gives us confidence in the approach.

However, there's a critical detail we need to address that's hinted at by `a1ba4594232c` and `0829b5bcdd3b`. If the user-controlled size is massive, even `kvmalloc` can generate a warning if the allocation size exceeds `INT_MAX`. Because `object_count` is a `__u32`, the total allocation size could easily exceed this, even with a pointer size of 8 bytes on a 64-bit system. We *must* include an upper bound check to prevent this.

I've just confirmed it in `mm/util.c` - `kvmalloc` does indeed warn when the allocation size exceeds `INT_MAX`. This makes the bounds check not just a good idea, but essential. `a1ba4594232c` shows precisely how to add that check. In our case, something like `if (object_count > INT_MAX / sizeof(struct drm_mode_object *))` will work. And looking at `cb77b79abf5f` and `c4ac100e9ae2`, we should also consider using `vmemdup_array_user()` for the `object_ids` allocation, to be consistent with the other DRM drivers dealing with large arrays.

Alright, time to formulate the final summary for the fix. The primary fix is to use `kvzalloc_objs` (or `kvcalloc()`) and `kvfree()` for the `objects` array. Crucially, we need to add the bounds check. We will want to check, `if (object_count > INT_MAX / sizeof(struct drm_mode_object *))`. Finally, let's consider switching `memdup_array_user()` to `vmemdup_array_user()` to ensure consistency. This combination of changes should provide a robust solution.



115/1 2026/10/13 22:50 action kernel-scratch-checkouter
1m Results:
map[KernelScratchSrc:/app/workdir/cache/tmp/tmp770938699]

116/1 2026/10/13 22:51 loop
1h26m
117/2 2026/10/13 22:51 iteration 0
1h26m
118/3 2026/10/13 22:51 agent patch-generator
24m Model:
core

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:

------------[ cut here ]------------
WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline], CPU#1: syz.0.17/7032
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397, CPU#1: syz.0.17/7032
Modules linked in:
CPU: 1 UID: 0 PID: 7032 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : alloc_order_allowed mm/page_alloc.c:5340 [inline]
pc : __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
lr : __alloc_frozen_pages_noprof+0xa8/0x640 mm/page_alloc.c:5388
sp : ffff80009d2e7580
x29: ffff80009d2e7650 x28: ffff700013a5cf18 x27: ffff80009d2e75a0
x26: 1ffff0001302e474 x25: dfff800000000000 x24: ffff700013a5ceb4
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000040dc0
x20: 0000000000000000 x19: 000000000000000b x18: 00000000ffffffff
x17: 0000000000000000 x16: ffff80008b5b9788 x15: 0000000000000005
x14: 1ffff00013a5ceb8 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700013a5cebd x10: dfff800000000000 x9 : 0000000000000001
x8 : ffff8000939c7000 x7 : 0000000000000000 x6 : ffff0000e8bd0900
x5 : ffff0000e8bd0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline] (P)
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397 (P)
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 __do_kmalloc_node mm/slub.c:5402 [inline]
 __kmalloc_noprof+0x3ec/0x6bc mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 _kzalloc_noprof include/linux/slab.h:1312 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:583
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758
 el0t_64_sync_handler+0x68/0xdc arch/arm64/kernel/entry-common.c:777
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590
irq event stamp: 4228
hardirqs last  enabled at (4227): [<ffff80008b64f030>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (4227): [<ffff80008b64f030>] __arm64_exit_to_kernel_mode+0x64/0x78 arch/arm64/kernel/entry-common.c:60
hardirqs last disabled at (4228): [<ffff80008b64afb0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:445
softirqs last  enabled at (3568): [<ffff8000803f5178>] softirq_handle_end kernel/softirq.c:491 [inline]
softirqs last  enabled at (3568): [<ffff8000803f5178>] handle_softirqs+0xc88/0xdfc kernel/softirq.c:673
softirqs last disabled at (3415): [<ffff800080020ff4>] __do_softirq+0x14/0x20 kernel/softirq.c:679
---[ end trace 0000000000000000 ]---


The explanation of the root cause of the bug is:

An analysis of the crash reveals that it is caused by an unbounded user-controlled allocation size in the DRM lease creation ioctl, which attempts to allocate a contiguous memory block larger than `MAX_PAGE_ORDER` using the `kmalloc` family of functions.

### Root Cause Analysis

The crash is a warning triggered in `alloc_order_allowed()` because `__alloc_frozen_pages_noprof()` is called with an allocation order that exceeds `MAX_PAGE_ORDER` (typically 10, which corresponds to 4MB on systems with 4KB pages).

This happens in `fill_object_idr()` when allocating the `objects` array:
```c
// drivers/gpu/drm/drm_lease.c:389
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```
The `kzalloc_objs` macro expands to a `kmalloc`-family allocation (equivalent to `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`). 

The `object_count` comes directly from the user-space `drm_mode_create_lease` struct via `cl->object_count` in `drm_mode_create_lease_ioctl()`. There is no upper bound check on this value.

Before calling `fill_object_idr()`, `drm_mode_create_lease_ioctl()` allocates the `object_ids` array using `memdup_array_user()`:
```c
// drivers/gpu/drm/drm_lease.c:512
		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
```
`memdup_array_user()` uses `memdup_user()`, which allocates memory with `GFP_USER | __GFP_NOWARN`. Because of the `__GFP_NOWARN` flag, if `object_count` is extremely large (e.g., requiring > 4MB), `memdup_array_user()` will silently fail and return `-ENOMEM` without triggering any warnings.

However, there is a specific window where `object_count` is large enough to require more than 4MB for the `objects` array (which has 8-byte pointers on 64-bit systems), but small enough that the `object_ids` array (which has 4-byte `__u32` elements) fits within 4MB. 

In the provided syzkaller reproducer:
```c
*(uint32_t*)0x200003c8 = 0xf4240; // object_count = 1,000,000
```
1. `object_count` is set to `1,000,000`.
2. `memdup_array_user()` allocates `1,000,000 * 4 = 4,000,000` bytes. This is order 10, which is `<= MAX_PAGE_ORDER`. The allocation succeeds.
3. `fill_object_idr()` then calls `kzalloc_objs()` to allocate `1,000,000 * 8 = 8,000,000` bytes. This requires order 11, which is `> MAX_PAGE_ORDER`. 
4. Since `kzalloc_objs()` uses `GFP_KERNEL` without `__GFP_NOWARN`, the page allocator loudly complains and triggers the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)` warning.

### Proposed Fix

To fix this, the allocation of the `objects` array in `fill_object_idr()` should be changed to use `kvzalloc_objs()`, which gracefully falls back to `vmalloc()` for large allocations and does not trigger the page allocator warning. The corresponding `kfree()` must also be updated to `kvfree()`.

```c
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,7 +386,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +462,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
```

*(Note: While adding an arbitrary upper bound check to `object_count` in `drm_mode_create_lease_ioctl()` is another option, using `kvzalloc_objs()` is the standard kernel pattern for handling user-controlled array sizes without imposing artificial limits).*


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

Based on a review of recent commits in the DRM subsystem (`drivers/gpu/drm/`) over the last 3 years, there is a clear set of established idioms and patterns for addressing unbounded user-controlled allocation sizes that trigger page allocator warnings.

### 1. Switching to the `kvmalloc` family (Primary Fix)
The proposed fix of switching from `kzalloc_objs()` to `kvzalloc_objs()` (and `kfree()` to `kvfree()`) is the standard kernel pattern for handling large, unbounded arrays without imposing artificial limits. 
* **Prior Art:** Commit `bca45af5998a` ("drm/vc4: Use kvmalloc_objs() for the BO cache size list") fixed a nearly identical issue where an unbounded cache size list scaled with the largest BO freed, requiring an order-6 allocation that failed under fragmentation and triggered a `warn_alloc()` splat. The fix was to use `kvmalloc_objs()` so large lists can fall back to `vmalloc()`, avoiding the allocation failure.

### 2. Adding an Upper Bound Check (Crucial Secondary Fix)
While `kvmalloc` avoids the `MAX_PAGE_ORDER` warning, it has its own limitation: it will trigger a `WARN_ON_ONCE(size > INT_MAX)` if the requested allocation size exceeds `INT_MAX` (2GB). Because `object_count` is a `__u32` and `sizeof(struct drm_mode_object *)` is 8 bytes on 64-bit systems, a malicious user can easily pass an `object_count` that results in an allocation size up to ~34GB, which will still trigger a kernel warning even with `kvzalloc_objs()`.
* **Prior Art:** Commit `a1ba4594232c` ("drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO") addressed this exact scenario. A user-supplied `__u32` was used in `kvcalloc()`, which produced an allocation exceeding `INT_MAX` and triggered a warning in `__kvmalloc_node_noprof()`. The fix was to add a bounds check (`if (args->num_entries > INT_MAX / sizeof(*vm_entries)) return -EINVAL;`).
* **Prior Art:** Commit `0829b5bcdd3b` ("drm/i915: 2 GiB of relocations ought to be enough for anybody*") similarly capped the number of relocations to avoid the `kvmalloc` warning for `size > INT_MAX`.

### 3. Consistent Userspace Copying (Optional but Recommended)
Before allocating the `objects` array, the code allocates the `object_ids` array using `memdup_array_user()`. While `memdup_array_user()` fails silently for large sizes (due to `__GFP_NOWARN`), it still limits the maximum size to `MAX_PAGE_ORDER`. To consistently support large arrays across both allocations and separate user/kernel slabs, the DRM subsystem has been moving towards using `vmemdup_array_user()`.
* **Prior Art:** Commit `cb77b79abf5f` ("drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup") and commit `c4ac100e9ae2` ("drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array") both replaced `kvmalloc_array() + copy_from_user()` or `memdup_user()` with `vmemdup_array_user()` when dealing with potentially large, user-controlled arrays.

### Summary of Recommendations for the Fix
Based on how similar bugs were addressed, the final fix should:
1. Apply the proposed switch to `kvzalloc_objs()` and `kvfree()` in `fill_object_idr()`.
2. Add a sanity bounds check in `drm_mode_create_lease_ioctl()` to ensure `object_count` does not exceed `INT_MAX / sizeof(void *)` to prevent `kvmalloc` from warning on sizes > 2GB.
3. (Optional) Change the `object_ids` allocation from `memdup_array_user()` to `vmemdup_array_user()` to allow the first array to also gracefully fall back to `vmalloc()`.




Reply:
I have created a patch to address the page allocator warning triggered in `drm_mode_create_lease_ioctl()`.

### Root Cause & Engineering Analysis
1. In `fill_object_idr()`, the temporary `objects` pointer array was allocated using `kzalloc_objs(struct drm_mode_object *, object_count)`. Because `kzalloc_objs` expands to `kmalloc` with `GFP_KERNEL` (which lacks `__GFP_NOWARN`), when a userspace caller provides a sufficiently large `cl->object_count` (e.g., 1,000,000 mode objects), the requested size exceeds `MAX_PAGE_ORDER` (order 11 > 10), triggering the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, ...)` in `alloc_order_allowed()`.
2. Although `cl->object_ids` was duplicated from user space using `memdup_array_user()`, that allocation also relied on `kmalloc` and could fail under memory fragmentation or for larger order allocations.
3. While switching to the `kvmalloc` family (`kvzalloc_objs()`) enables falling back to `vmalloc()` to prevent the `MAX_PAGE_ORDER` splat, `__kvmalloc_node_noprof()` still triggers a `WARN_ON_ONCE(size > INT_MAX)` if user space passes a crazy allocation size (> 2GB). Since `cl->object_count` is an unbounded `__u32`, `object_count * sizeof(struct drm_mode_object *)` could otherwise easily exceed `INT_MAX`.
4. Furthermore, `cl->object_count` is a `__u32` in `struct drm_mode_create_lease`, but `fill_object_idr()` and `validate_lease()` accept `int object_count`. Without an upper bound, a value $\ge 2^{31}$ would suffer signed integer overflow.

### Changes Made
1. **Switch to `kvzalloc_objs()` / `kvfree()`**:
   In `fill_object_idr()`, switched the `objects` array allocation from `kzalloc_objs()` to `kvzalloc_objs()` so large allocations can gracefully fall back to `vmalloc()`, and updated `kfree(objects)` to `kvfree(objects)`.
2. **Switch to `vmemdup_array_user()` / `kvfree()`**:
   In `drm_mode_create_lease_ioctl()`, switched copying `cl->object_ids` from `memdup_array_user()` to `vmemdup_array_user()`, and updated `kfree(object_ids)` to `kvfree(object_ids)`.
3. **Early Upper Bounds Check**:
   Added an early check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))` at the start of `drm_mode_create_lease_ioctl()`, alongside the `cl->flags` validation. Placing this check before `drm_file_get_master(lessor_priv)` ensures that invalid requests are rejected early with `-EINVAL` without leaking the lessor's `drm_master` reference, prevents `__kvmalloc_node_noprof()` from triggering `WARN_ON_ONCE(size > INT_MAX)` on both allocations, and guarantees that `object_count` safely fits within a positive `int`.
4. **Header Cleanups**:
   Included `<linux/limits.h>`, `<linux/slab.h>`, and `<linux/string.h>` in `drivers/gpu/drm/drm_lease.c` for `INT_MAX`, `kvzalloc_objs`/`kvfree`, and `vmemdup_array_user`.

119/4 2026/10/13 22:51 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 8929
							output: 40
							thoughts: 112
						

Thoughts:
**Analyzing the DRM Lease Implementation**

Okay, let's break this down. My initial instinct is to dive into the kernel code and see exactly what's going on. The problem likely relates to the DRM lease mechanism, so I'll start by focusing on `drivers/gpu/drm/drm_lease.c`. Specifically, I need to understand how the lease creation is handled, so I'll be investigating `drm_mode_create_lease_ioctl()` and the `fill_object_idr()` function. I'll need to understand their functionality to comprehend how they interrelate. I'll need to look around these functions as well.

To get a clearer picture, I'll need to read the source code directly. I'll use `read-file` and zero in on the relevant section, approximately lines 380 to 550, which should contain the key logic for these functions. Hopefully, this will give me the information I need.



120/4 2026/10/13 22:51 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:370 LineCount:100]

Results:
map[Contents: 370:		}
 371:		if (has_crtc == -1 || has_connector == -1)
 372:			return -EINVAL;
 373:		if (universal_planes && has_plane == -1)
 374:			return -EINVAL;
 375:		return 0;
 376:	}
 377:	
 378:	static int fill_object_idr(struct drm_device *dev,
 379:				   struct drm_file *lessor_priv,
 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
 465:		kfree(objects);
 466:		return ret;
 467:	}
 468:	
 469:	/*
]

121/4 2026/10/13 22:51 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 10877
							output: 40
							thoughts: 29
						

Thoughts:
Okay, here's my interpretation of what I would be thinking, formatted as requested:

**Diving into the Lease Implementation**

Right, let's get down to brass tacks. I've been working with DRM lease mechanisms for a while now, and to really understand how they are functioning in this specific context, I need to get my hands dirty. I'm going to start by pulling up the `drivers/gpu/drm/drm_lease.c` file. Given my expertise, I'm already familiar with the general structure, but I need to see exactly how this driver is handling the lease logic. Let's zero in on lines 470 through 570. That should give me a good slice of the critical code, right in the middle of the most important logic. That range will likely contain crucial sections related to either lease granting, renewal, revocation, or maybe even the interplay between userspace and the kernel. I'm hoping to quickly identify the key functions or data structures being used to manage these leases within this specific driver. From there I'll be able to tell what's happening at any point in time.



122/4 2026/10/13 22:52 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:470 LineCount:100]

Results:
map[Contents: 470:	 * The master associated with the specified file will have a lease
 471:	 * created containing the objects specified in the ioctl structure.
 472:	 * A file descriptor will be allocated for that and returned to the
 473:	 * application.
 474:	 */
 475:	int drm_mode_create_lease_ioctl(struct drm_device *dev,
 476:					void *data, struct drm_file *lessor_priv)
 477:	{
 478:		struct drm_mode_create_lease *cl = data;
 479:		size_t object_count;
 480:		int ret = 0;
 481:		struct idr leases;
 482:		struct drm_master *lessor;
 483:		struct drm_master *lessee = NULL;
 484:		struct file *lessee_file = NULL;
 485:		struct file *lessor_file = lessor_priv->filp;
 486:		struct drm_file *lessee_priv;
 487:		int fd = -1;
 488:		uint32_t *object_ids;
 489:	
 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
 535:			ret = fd;
 536:			goto out_lessor;
 537:		}
 538:	
 539:		drm_dbg_lease(dev, "Creating lease\n");
 540:		/* lessee will take the ownership of leases */
 541:		lessee = drm_lease_create(lessor, &leases);
 542:	
 543:		if (IS_ERR(lessee)) {
 544:			ret = PTR_ERR(lessee);
 545:			idr_destroy(&leases);
 546:			goto out_leases;
 547:		}
 548:	
 549:		/* Clone the lessor file to create a new file for us */
 550:		drm_dbg_lease(dev, "Allocating lease file\n");
 551:		lessee_file = file_clone_open(lessor_file);
 552:		if (IS_ERR(lessee_file)) {
 553:			ret = PTR_ERR(lessee_file);
 554:			goto out_lessee;
 555:		}
 556:	
 557:		lessee_priv = lessee_file->private_data;
 558:		/* Change the file to a master one */
 559:		drm_master_put(&lessee_priv->master);
 560:		lessee_priv->master = lessee;
 561:		lessee_priv->is_master = 1;
 562:		lessee_priv->authenticated = 1;
 563:	
 564:		/* Pass fd back to userspace */
 565:		drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id);
 566:		cl->fd = fd;
 567:		cl->lessee_id = lessee->lessee_id;
 568:	
 569:		/* Hook up the fd */
]

123/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 12743
							output: 39
							thoughts: 36
						

Thoughts:
Here's my take on the thought process, summarized as you requested:

**Digging Deeper into the DRM Lease Implementation**

Okay, so I've looked at the surface, and I'm pretty sure I know what's going on here, but let's not make any assumptions. Before I lock anything down, I need to thoroughly vet `drm_mode_create_lease_ioctl` and all of `drm_lease.c`. I have a feeling there might be some related functions or potentially even subtle references to other components that could be relevant to the issue I'm investigating. I need to be absolutely certain I understand the full scope of this lease mechanism, and the possible interactions, before I go any further. It’s the only way to avoid missing something crucial. Let's see what else the code reveals.



124/4 2026/10/13 22:52 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:565 LineCount:40]

Results:
map[Contents: 565:		drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id);
 566:		cl->fd = fd;
 567:		cl->lessee_id = lessee->lessee_id;
 568:	
 569:		/* Hook up the fd */
 570:		fd_install(fd, lessee_file);
 571:	
 572:		drm_master_put(&lessor);
 573:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
 574:		return 0;
 575:	
 576:	out_lessee:
 577:		drm_master_put(&lessee);
 578:	
 579:	out_leases:
 580:		put_unused_fd(fd);
 581:	
 582:	out_lessor:
 583:		drm_master_put(&lessor);
 584:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
 585:		return ret;
 586:	}
 587:	
 588:	int drm_mode_list_lessees_ioctl(struct drm_device *dev,
 589:				       void *data, struct drm_file *lessor_priv)
 590:	{
 591:		struct drm_mode_list_lessees *arg = data;
 592:		__u32 __user *lessee_ids = (__u32 __user *) (uintptr_t) (arg->lessees_ptr);
 593:		__u32 count_lessees = arg->count_lessees;
 594:		struct drm_master *lessor, *lessee;
 595:		int count;
 596:		int ret = 0;
 597:	
 598:		if (arg->pad)
 599:			return -EINVAL;
 600:	
 601:		/* Can't lease without MODESET */
 602:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 603:			return -EOPNOTSUPP;
 604:	
]

125/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 13623
							output: 40
							thoughts: 51
						

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

**Diving into the Lease Implementation**

Right, so we're focused on DRM leases, and my initial thought is to comprehensively audit the related ioctls within `drivers/gpu/drm/drm_lease.c`. We're likely dealing with the core logic there, and a thorough review of the various control interfaces is essential for understanding the full picture.

I'm specifically targeting the latter part of the file; I'll start by examining lines 605 and beyond. This usually means we're in the thick of the more complex lease management functions, perhaps error handling, cleanup routines, or interaction with other subsystems. I need to get a handle on what happens at the end of the line, and go from there.



126/4 2026/10/13 22:52 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:605 LineCount:100]

Results:
map[Contents: 605:		lessor = drm_file_get_master(lessor_priv);
 606:		drm_dbg_lease(dev, "List lessees for %d\n", lessor->lessee_id);
 607:	
 608:		mutex_lock(&dev->mode_config.idr_mutex);
 609:	
 610:		count = 0;
 611:		drm_for_each_lessee(lessee, lessor) {
 612:			/* Only list un-revoked leases */
 613:			if (!idr_is_empty(&lessee->leases)) {
 614:				if (count_lessees > count) {
 615:					drm_dbg_lease(dev, "Add lessee %d\n",
 616:						      lessee->lessee_id);
 617:					ret = put_user(lessee->lessee_id, lessee_ids + count);
 618:					if (ret)
 619:						break;
 620:				}
 621:				count++;
 622:			}
 623:		}
 624:	
 625:		drm_dbg_lease(dev, "Lessor leases to %d\n", count);
 626:		if (ret == 0)
 627:			arg->count_lessees = count;
 628:	
 629:		mutex_unlock(&dev->mode_config.idr_mutex);
 630:		drm_master_put(&lessor);
 631:	
 632:		return ret;
 633:	}
 634:	
 635:	/* Return the list of leased objects for the specified lessee */
 636:	int drm_mode_get_lease_ioctl(struct drm_device *dev,
 637:				     void *data, struct drm_file *lessee_priv)
 638:	{
 639:		struct drm_mode_get_lease *arg = data;
 640:		__u32 __user *object_ids = (__u32 __user *) (uintptr_t) (arg->objects_ptr);
 641:		__u32 count_objects = arg->count_objects;
 642:		struct drm_master *lessee;
 643:		struct idr *object_idr;
 644:		int count;
 645:		void *entry;
 646:		int object;
 647:		int ret = 0;
 648:	
 649:		if (arg->pad)
 650:			return -EINVAL;
 651:	
 652:		/* Can't lease without MODESET */
 653:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 654:			return -EOPNOTSUPP;
 655:	
 656:		lessee = drm_file_get_master(lessee_priv);
 657:		drm_dbg_lease(dev, "get lease for %d\n", lessee->lessee_id);
 658:	
 659:		mutex_lock(&dev->mode_config.idr_mutex);
 660:	
 661:		if (lessee->lessor == NULL)
 662:			/* owner can use all objects */
 663:			object_idr = &lessee->dev->mode_config.object_idr;
 664:		else
 665:			/* lessee can only use allowed object */
 666:			object_idr = &lessee->leases;
 667:	
 668:		count = 0;
 669:		idr_for_each_entry(object_idr, entry, object) {
 670:			if (count_objects > count) {
 671:				drm_dbg_lease(dev, "adding object %d\n", object);
 672:				ret = put_user(object, object_ids + count);
 673:				if (ret)
 674:					break;
 675:			}
 676:			count++;
 677:		}
 678:	
 679:		DRM_DEBUG("lease holds %d objects\n", count);
 680:		if (ret == 0)
 681:			arg->count_objects = count;
 682:	
 683:		mutex_unlock(&dev->mode_config.idr_mutex);
 684:		drm_master_put(&lessee);
 685:	
 686:		return ret;
 687:	}
 688:	
 689:	/*
 690:	 * This removes all of the objects from the lease without
 691:	 * actually getting rid of the lease itself; that way all
 692:	 * references to it still work correctly
 693:	 */
 694:	int drm_mode_revoke_lease_ioctl(struct drm_device *dev,
 695:					void *data, struct drm_file *lessor_priv)
 696:	{
 697:		struct drm_mode_revoke_lease *arg = data;
 698:		struct drm_master *lessor;
 699:		struct drm_master *lessee;
 700:		int ret = 0;
 701:	
 702:		drm_dbg_lease(dev, "revoke lease for %d\n", arg->lessee_id);
 703:	
 704:		/* Can't lease without MODESET */
]

127/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 15393
							output: 39
							thoughts: 18
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, and delivered as a first-person summary:

**Diving into `drm_mode_revoke_lease_ioctl`**

Alright, let's get down to brass tacks. I need to take a closer look at the rest of `drm_mode_revoke_lease_ioctl`. I've already scoped out the basics, and the general flow, but now it's time to dig deeper and ensure this function is behaving correctly under every possible scenario. I need to verify that it handles all the edge cases, and, critically, doesn't introduce any new security vulnerabilities. I'm focusing on the interaction with the DRM core, the resource management aspects, and of course, how it interacts with different drivers and configurations. I'm looking for potential race conditions, incorrect error handling, and anything that could lead to unexpected behavior. The goal is a rock-solid, secure implementation. Let's see what gems we can find in there!



128/4 2026/10/13 22:52 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:700 LineCount:40]

Results:
map[Contents: 700:		int ret = 0;
 701:	
 702:		drm_dbg_lease(dev, "revoke lease for %d\n", arg->lessee_id);
 703:	
 704:		/* Can't lease without MODESET */
 705:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 706:			return -EOPNOTSUPP;
 707:	
 708:		lessor = drm_file_get_master(lessor_priv);
 709:		mutex_lock(&dev->mode_config.idr_mutex);
 710:	
 711:		lessee = _drm_find_lessee(lessor, arg->lessee_id);
 712:	
 713:		/* No such lessee */
 714:		if (!lessee) {
 715:			ret = -ENOENT;
 716:			goto fail;
 717:		}
 718:	
 719:		/* Lease is not held by lessor */
 720:		if (lessee->lessor != lessor) {
 721:			ret = -EACCES;
 722:			goto fail;
 723:		}
 724:	
 725:		_drm_lease_revoke(lessee);
 726:	
 727:	fail:
 728:		mutex_unlock(&dev->mode_config.idr_mutex);
 729:		drm_master_put(&lessor);
 730:	
 731:		return ret;
 732:	}
]

129/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 16118
							output: 37
							thoughts: 44
						

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

**Reviewing the `drm_lease.c` Module**

Okay, that's the end of the `drm_lease.c` file – time to get a more comprehensive picture. To truly understand its place within the kernel, I need to zoom out. Let's start at the beginning of `drm_lease.c` to establish context, looking at those crucial initial header inclusions and the declared functions. Understanding the dependencies and the exposed API is key to dissecting how this leasing mechanism integrates with the broader Direct Rendering Manager (DRM) infrastructure. With a clear overview, I can make connections between the lease implementation and the kernel's overall functionality.



130/4 2026/10/13 22:52 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:1 LineCount:80]

Results:
map[Contents:   1:	// SPDX-License-Identifier: GPL-2.0-or-later
   2:	/*
   3:	 * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
   4:	 */
   5:	#include <linux/file.h>
   6:	#include <linux/uaccess.h>
   7:	
   8:	#include <drm/drm_auth.h>
   9:	#include <drm/drm_crtc.h>
  10:	#include <drm/drm_drv.h>
  11:	#include <drm/drm_file.h>
  12:	#include <drm/drm_lease.h>
  13:	#include <drm/drm_print.h>
  14:	
  15:	#include "drm_crtc_internal.h"
  16:	#include "drm_internal.h"
  17:	
  18:	/**
  19:	 * DOC: drm leasing
  20:	 *
  21:	 * DRM leases provide information about whether a DRM master may control a DRM
  22:	 * mode setting object. This enables the creation of multiple DRM masters that
  23:	 * manage subsets of display resources.
  24:	 *
  25:	 * The original DRM master of a device 'owns' the available drm resources. It
  26:	 * may create additional DRM masters and 'lease' resources which it controls
  27:	 * to the new DRM master. This gives the new DRM master control over the
  28:	 * leased resources until the owner revokes the lease, or the new DRM master
  29:	 * is closed. Some helpful terminology:
  30:	 *
  31:	 * - An 'owner' is a &struct drm_master that is not leasing objects from
  32:	 *   another &struct drm_master, and hence 'owns' the objects. The owner can be
  33:	 *   identified as the &struct drm_master for which &drm_master.lessor is NULL.
  34:	 *
  35:	 * - A 'lessor' is a &struct drm_master which is leasing objects to one or more
  36:	 *   other &struct drm_master. Currently, lessees are not allowed to
  37:	 *   create sub-leases, hence the lessor is the same as the owner.
  38:	 *
  39:	 * - A 'lessee' is a &struct drm_master which is leasing objects from some
  40:	 *   other &struct drm_master. Each lessee only leases resources from a single
  41:	 *   lessor recorded in &drm_master.lessor, and holds the set of objects that
  42:	 *   it is leasing in &drm_master.leases.
  43:	 *
  44:	 * - A 'lease' is a contract between the lessor and lessee that identifies
  45:	 *   which resources may be controlled by the lessee. All of the resources
  46:	 *   that are leased must be owned by or leased to the lessor, and lessors are
  47:	 *   not permitted to lease the same object to multiple lessees.
  48:	 *
  49:	 * The set of objects any &struct drm_master 'controls' is limited to the set
  50:	 * of objects it leases (for lessees) or all objects (for owners).
  51:	 *
  52:	 * Objects not controlled by a &struct drm_master cannot be modified through
  53:	 * the various state manipulating ioctls, and any state reported back to user
  54:	 * space will be edited to make them appear idle and/or unusable. For
  55:	 * instance, connectors always report 'disconnected', while encoders
  56:	 * report no possible crtcs or clones.
  57:	 *
  58:	 * Since each lessee may lease objects from a single lessor, display resource
  59:	 * leases form a tree of &struct drm_master. As lessees are currently not
  60:	 * allowed to create sub-leases, the tree depth is limited to 1. All of
  61:	 * these get activated simultaneously when the top level device owner changes
  62:	 * through the SETMASTER or DROPMASTER IOCTL, so &drm_device.master points to
  63:	 * the owner at the top of the lease tree (i.e. the &struct drm_master for which
  64:	 * &drm_master.lessor is NULL). The full list of lessees that are leasing
  65:	 * objects from the owner can be searched via the owner's
  66:	 * &drm_master.lessee_idr.
  67:	 */
  68:	
  69:	#define drm_for_each_lessee(lessee, lessor) \
  70:		list_for_each_entry((lessee), &(lessor)->lessees, lessee_list)
  71:	
  72:	static uint64_t drm_lease_idr_object;
  73:	
  74:	struct drm_master *drm_lease_owner(struct drm_master *master)
  75:	{
  76:		while (master->lessor != NULL)
  77:			master = master->lessor;
  78:		return master;
  79:	}
  80:	
]

131/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 17700
							output: 20
							thoughts: 34
						

Thoughts:
Okay, let's break this down.

**Investigating Memory Allocation Objects**

Right, so I need to understand what `kzalloc_objs` and `kvzalloc_objs` actually *are*. First instinct is to confirm their definitions – no point in making assumptions. Where are these things defined in the codebase? Okay, time to fire up `grep`. Let's see if we can locate them quickly and efficiently. Time to get to the core of these objects.



132/4 2026/10/13 22:52 tool grepper
0m Args:
map[Expression:define kvzalloc_objs]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1172-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
include/linux/slab.h:1173:#define kvzalloc_objs(P, COUNT, ...) \
include/linux/slab.h-1174-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
]

133/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 18015
							output: 36
							thoughts: 40
						

Thoughts:
Okay, let's dive into this. Here's my thought process on this:

**Investigating `kzalloc_objs` and `kvzalloc_objs` in `slab.h`**

Right, so I need to refresh my memory on how `kzalloc_objs` and `kvzalloc_objs` are actually defined. Given that these are slab allocator functions, and I'm interested in their implementation details, I'm heading straight to the source. Specifically, I know that the core definitions for slab allocation are usually in `include/linux/slab.h`. The line number is a general guideline; I'm expecting to find them around line 1170. This gives me a decent starting point. From there, I'll examine the function signatures, any inline comments, and possibly associated macros to get a complete picture of these functions' behavior. Ultimately, I'm aiming to understand the specifics of their zero-initialization behavior with respect to object allocation within the kernel.



134/4 2026/10/13 22:52 tool read-file
0m Args:
map[File:include/linux/slab.h FirstLine:1160 LineCount:25]

Results:
map[Contents:1160:		__alloc_flex(kzalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
1161:	
1162:	/* All kvmalloc aliases for kmalloc_(obj|objs|flex). */
1163:	#define kvmalloc_obj(P, ...) \
1164:		__alloc_objs(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
1165:	#define kvmalloc_objs(P, COUNT, ...) \
1166:		__alloc_objs(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
1167:	#define kvmalloc_flex(P, FAM, COUNT, ...) \
1168:		__alloc_flex(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
1169:	
1170:	/* All kvzalloc aliases for kmalloc_(obj|objs|flex). */
1171:	#define kvzalloc_obj(P, ...) \
1172:		__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
1173:	#define kvzalloc_objs(P, COUNT, ...) \
1174:		__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
1175:	#define kvzalloc_flex(P, FAM, COUNT, ...) \
1176:		__alloc_flex(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
1177:	
1178:	#define kmem_buckets_alloc(_b, _size, _flags)	\
1179:		alloc_hooks(__kmalloc_node_noprof(PASS_KMALLOC_PARAMS(_size, _b, __kmalloc_token(_size)), _flags, NUMA_NO_NODE))
1180:	
1181:	#define kmem_buckets_alloc_node_track_caller(_b, _size, _flags, _node)	\
1182:		alloc_hooks(__kmalloc_node_track_caller_noprof(PASS_KMALLOC_PARAMS(_size, _b, __kmalloc_token(_size)), _flags, _node, _RET_IP_))
1183:	
1184:	#define kmem_buckets_alloc_track_caller(_b, _size, _flags) \
]

135/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 18944
							output: 21
							thoughts: 71
						

Thoughts:
Here's my summary, as I'd be thinking it:

**Analyzing Memory Allocation in the DRM Mode Object Context**

Okay, so I'm looking at `kvzalloc_objs` here, and it's using `kvzalloc` with `sizeof(...) * count` and `GFP_KERNEL`. Standard kernel allocation using the vmalloc subsystem, that's fine. Now, let's see how that memory is handled. The next thing on the list is `vmemdup_array_user`. I need to figure out how this function fits into the picture. It's obviously related to memory duplication, potentially from userspace. Right, where is `vmemdup_array_user` actually defined? I'll just grep for that. Gotta trace that definition to see how it's dealing with copying from userspace, and what checks it's putting in place.



136/4 2026/10/13 22:52 tool grepper
0m Args:
map[Expression:vmemdup_array_user]

Results:
map[Output:arch/x86/kvm/cpuid.c=590=int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
--
arch/x86/kvm/cpuid.c-601-	if (cpuid->nent) {
arch/x86/kvm/cpuid.c:602:		e = vmemdup_array_user(entries, cpuid->nent, sizeof(*e));
arch/x86/kvm/cpuid.c-603-		if (IS_ERR(e))
--
arch/x86/kvm/cpuid.c=635=int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
--
arch/x86/kvm/cpuid.c-645-	if (cpuid->nent) {
arch/x86/kvm/cpuid.c:646:		e2 = vmemdup_array_user(entries, cpuid->nent, sizeof(*e2));
arch/x86/kvm/cpuid.c-647-		if (IS_ERR(e2))
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c=164=amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-174-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c:175:	return vmemdup_array_user(uptr, bo_number,
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-176-				  sizeof(struct drm_amdgpu_bo_list_entry));
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c=179=static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-219-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:220:		p->chunks[i].kdata = vmemdup_array_user(u64_to_user_ptr(user_chunk.chunk_data),
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-221-							size,
--
drivers/gpu/drm/drm_gem.c=832=int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
--
drivers/gpu/drm/drm_gem.c-847-
drivers/gpu/drm/drm_gem.c:848:	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
drivers/gpu/drm/drm_gem.c-849-	if (IS_ERR(handles)) {
--
drivers/tty/vt/consolemap.c=632=int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
--
drivers/tty/vt/consolemap.c-640-
drivers/tty/vt/consolemap.c:641:	struct unipair *unilist __free(kvfree) = vmemdup_array_user(list, ct, sizeof(*unilist));
drivers/tty/vt/consolemap.c-642-	if (IS_ERR(unilist))
--
include/linux/string.h=32=void *memdup_array_user(const void __user *src, size_t n, size_t size)
--
include/linux/string.h-42-/**
include/linux/string.h:43: * vmemdup_array_user - duplicate array from user space
include/linux/string.h-44- * @src: source address in user space
--
include/linux/string.h=51=static inline __realloc_size(2, 3)
include/linux/string.h:52:void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
include/linux/string.h-53-{
--
virt/kvm/kvm_main.c=5177=static long kvm_vm_ioctl(struct file *filp,
--
virt/kvm/kvm_main.c-5344-			urouting = argp;
virt/kvm/kvm_main.c:5345:			entries = vmemdup_array_user(urouting->entries,
virt/kvm/kvm_main.c-5346-						     routing.nr, sizeof(*entries));
]

137/4 2026/10/13 22:52 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 20437
							output: 34
							thoughts: 33
						

Thoughts:
Here's my analysis of the provided thought process, tailored for an expert audience:

**Diving into `vmemdup_array_user` Implementation**

Okay, so we're looking to understand the mechanics behind `vmemdup_array_user`. My first instinct is to go directly to the source. Specifically, I'll be heading over to `include/linux/string.h`, around line 40, to get a clear picture of its implementation details. I want to see precisely how it handles the virtual memory duplication within a user context. I'm assuming there's something non-trivial there, perhaps related to memory access permissions or security considerations for user-space data. The goal is to identify any potential gotchas or optimizations in its design. Let's see what's actually under the hood.



138/4 2026/10/13 22:53 tool read-file
0m Args:
map[File:include/linux/string.h FirstLine:30 LineCount:40]

Results:
map[Contents:  30:	 */
  31:	static inline __realloc_size(2, 3)
  32:	void *memdup_array_user(const void __user *src, size_t n, size_t size)
  33:	{
  34:		size_t nbytes;
  35:	
  36:		if (check_mul_overflow(n, size, &nbytes))
  37:			return ERR_PTR(-EOVERFLOW);
  38:	
  39:		return memdup_user(src, nbytes);
  40:	}
  41:	
  42:	/**
  43:	 * vmemdup_array_user - duplicate array from user space
  44:	 * @src: source address in user space
  45:	 * @n: number of array members to copy
  46:	 * @size: size of one array member
  47:	 *
  48:	 * Return: an ERR_PTR() on failure. Result may be not
  49:	 * physically contiguous. Use kvfree() to free.
  50:	 */
  51:	static inline __realloc_size(2, 3)
  52:	void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
  53:	{
  54:		size_t nbytes;
  55:	
  56:		if (check_mul_overflow(n, size, &nbytes))
  57:			return ERR_PTR(-EOVERFLOW);
  58:	
  59:		return vmemdup_user(src, nbytes);
  60:	}
  61:	
  62:	/*
  63:	 * Include machine specific inline routines
  64:	 */
  65:	#include <asm/string.h>
  66:	
  67:	#ifndef __HAVE_ARCH_STRCPY
  68:	extern char * strcpy(char *,const char *);
  69:	#endif
]

139/4 2026/10/13 22:53 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 21210
							output: 36
							thoughts: 71
						

Thoughts:
Here's my thought process, as requested:

**Understanding the Memory Allocation and Deallocation in `vmemdup_array_user`**

Okay, so `vmemdup_array_user` is returning memory allocated with `kvmalloc`, and crucially, this means I need to use `kvfree()` to release it.  That's straightforward, but I need to be absolutely certain I'm not missing any subtleties here. Let's delve deeper into the implementation. What precisely is `vmemdup_user` doing behind the scenes?  I need to understand its behaviour to be completely confident in how I'm handling the memory. I should be able to get a clear picture with a quick search using `grep`, or by jumping to the source code definition itself. I need to be sure that `vmemdup_user` doesn't do anything unexpected, or allocate additional memory that I need to be concerned with.



140/4 2026/10/13 22:53 tool codesearch-definition-source
0m Args:
map[ContextFile:include/linux/string.h Name:vmemdup_user]

Results:
map[SourceCode: 234:	/**
 235:	 * vmemdup_user - duplicate memory region from user space
 236:	 *
 237:	 * @src: source address in user space
 238:	 * @len: number of bytes to copy
 239:	 *
 240:	 * Return: an ERR_PTR() on failure.  Result may be not
 241:	 * physically contiguous.  Use kvfree() to free.
 242:	 */
 243:	void *vmemdup_user(const void __user *src, size_t len)
 244:	{
 245:		void *p;
 246:	
 247:		p = kmem_buckets_valloc(user_buckets, len, GFP_USER);
 248:		if (!p)
 249:			return ERR_PTR(-ENOMEM);
 250:	
 251:		if (copy_from_user(p, src, len)) {
 252:			kvfree(p);
 253:			return ERR_PTR(-EFAULT);
 254:		}
 255:	
 256:		return p;
 257:	}
 SourceFile:mm/util.c]

141/4 2026/10/13 22:53 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 21862
							output: 38
							thoughts: 50
						

Thoughts:
Okay, let's dive into this `kvmalloc` business. I'm wondering what happens when we throw a size larger than `INT_MAX` at it. My initial thought is to trace the execution path and see where it goes. I'll need to check the relevant function calls within the kernel code. Specifically, I'm thinking of looking at either `__kvmalloc_node_noprof` or `kvmalloc_node` in `mm/util.c`. That should give me the entry point or, at the very least, where the size parameter gets validated or processed. I'm keen to see if there's any overflow handling or if it just crashes spectacularly. Knowing the kernel, I'm guessing there's *something* in place, but I want to be certain.



142/4 2026/10/13 22:53 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/util.c Name:__kvmalloc_node_noprof]

Results:
map[SourceCode:7000:	void *__kvmalloc_node_noprof(DECL_KMALLOC_PARAMS(size, b, token), unsigned long align,
7001:				     gfp_t flags, int node)
7002:	{
7003:		bool allow_block;
7004:		void *ret;
7005:		const struct slab_alloc_context ac = {
7006:			.caller_addr = _RET_IP_,
7007:			.orig_size = size,
7008:			.alloc_flags = SLAB_ALLOC_DEFAULT,
7009:		};
7010:	
7011:		/*
7012:		 * It doesn't really make sense to fallback to vmalloc for sub page
7013:		 * requests
7014:		 */
7015:		ret = __do_kmalloc_node(PASS_BUCKET_PARAM(b),
7016:					kmalloc_gfp_adjust(flags, size),
7017:					node, PASS_TOKEN_PARAM(token), &ac);
7018:		if (ret || size <= PAGE_SIZE)
7019:			return ret;
7020:	
7021:		/* Don't even allow crazy sizes */
7022:		if (unlikely(size > INT_MAX)) {
7023:			WARN_ON_ONCE(!(flags & __GFP_NOWARN));
7024:			return NULL;
7025:		}
7026:	
7027:		/*
7028:		 * For non-blocking the VM_ALLOW_HUGE_VMAP is not used
7029:		 * because the huge-mapping path in vmalloc contains at
7030:		 * least one might_sleep() call.
7031:		 *
7032:		 * TODO: Revise huge-mapping path to support non-blocking
7033:		 * flags.
7034:		 */
7035:		allow_block = gfpflags_allow_blocking(flags);
7036:	
7037:		/*
7038:		 * kvmalloc() can always use VM_ALLOW_HUGE_VMAP,
7039:		 * since the callers already cannot assume anything
7040:		 * about the resulting pointer, and cannot play
7041:		 * protection games.
7042:		 */
7043:		return __vmalloc_node_range_noprof(size, align, VMALLOC_START, VMALLOC_END,
7044:				flags, PAGE_KERNEL, allow_block ? VM_ALLOW_HUGE_VMAP:0,
7045:				node, __builtin_return_address(0));
7046:	}
 SourceFile:mm/slub.c]

143/4 2026/10/13 22:53 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 22857
							output: 42
							thoughts: 233
						

Thoughts:
**Analyzing Potential Integer Overflow in `kvzalloc_objs`**

Okay, let's break this down. I'm looking at lines 7022-7025 in `mm/slub.c`. It's pretty clear that they're guarding against excessively large allocation sizes, specifically checking if `size > INT_MAX`. The key is what happens if that condition *is* true.

Now, I'm thinking about `kvzalloc_objs(struct drm_mode_object *, object_count)`.  I know that this function is involved, and I remember that the `flags` parameter passed to it is `GFP_KERNEL`. And, critically, `GFP_KERNEL` *does not* include the `__GFP_NOWARN` flag. So, if `size` does exceed `INT_MAX`, that `WARN_ON_ONCE` will trigger because the bitwise AND operation `(flags & __GFP_NOWARN)` will always be false.  The function will then return `NULL`.

The next important question is: what actually *is* `object_count`? Where does this come from? It's time to check the definition of `struct drm_mode_create_lease`. I need to figure out how `object_count` is calculated or passed in.  This looks like a potential area for integer overflow if the input from `struct drm_mode_create_lease` is large. Let's see how they handle it there.



144/4 2026/10/13 22:53 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_mode_create_lease]

Results:
map[SourceCode:1425:	/**
1426:	 * struct drm_mode_create_lease - Create lease
1427:	 *
1428:	 * Lease mode resources, creating another drm_master.
1429:	 *
1430:	 * The @object_ids array must reference at least one CRTC, one connector and
1431:	 * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively,
1432:	 * the lease can be completely empty.
1433:	 */
1434:	struct drm_mode_create_lease {
1435:		/** @object_ids: Pointer to array of object ids (__u32) */
1436:		__u64 object_ids;
1437:		/** @object_count: Number of object ids */
1438:		__u32 object_count;
1439:		/** @flags: flags for new FD (O_CLOEXEC, etc) */
1440:		__u32 flags;
1441:	
1442:		/** @lessee_id: Return: unique identifier for lessee. */
1443:		__u32 lessee_id;
1444:		/** @fd: Return: file descriptor to new drm_master file */
1445:		__u32 fd;
1446:	};
 SourceFile:include/uapi/drm/drm_mode.h]

145/4 2026/10/13 22:53 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 23837
							output: 39
							thoughts: 555
						

Thoughts:
**A Potential Integer Overflow Vulnerability in DRM Lease Creation**

Okay, let's break this down. I'm looking at the `drm_mode_create_lease` structure and the corresponding ioctl handler. I see that the `object_count` member in the structure is an `__u32`. In the `drm_mode_create_lease_ioctl` function, the `object_count` variable is defined as `size_t` and gets assigned the value from the user-provided `cl->object_count`. So far, so good. Then, the code allocates memory for `object_ids` based on this `object_count`.

However, here's where things get interesting. This `object_count` is then passed to the `fill_object_idr` function. And that's where the problem is because `fill_object_idr` takes `object_count` as an `int`. Now, if `cl->object_count` has a large value, say 0x80000000, which is perfectly valid for an unsigned 32-bit integer, and then that value is assigned to the `int object_count` inside `fill_object_idr`, then `object_count` would become negative due to the signed integer conversion. This is a classic integer overflow situation.

The next thing is that within `fill_object_idr`, there's a loop that iterates up to `object_count`. If `object_count` is negative due to overflow, the loop wouldn't run at all. Later, `validate_lease` might be used with `int object_count` depending on what `validate_lease` is, and that will be problematic. This is something that needs further investigation. It seems that there's a potential vulnerability here that an attacker could exploit to bypass checks or cause other unexpected behavior, or even potentially cause a crash. I need to understand what `validate_lease` does, so that I can figure out the impact of this overflow.



146/4 2026/10/13 22:53 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:330 LineCount:50]

Results:
map[Contents: 330:				if (master == top)
 331:					break;
 332:	
 333:				/* Over */
 334:				master = list_next_entry(master, lessee_list);
 335:			}
 336:		}
 337:	}
 338:	
 339:	void drm_lease_revoke(struct drm_master *top)
 340:	{
 341:		mutex_lock(&top->dev->mode_config.idr_mutex);
 342:		_drm_lease_revoke(top);
 343:		mutex_unlock(&top->dev->mode_config.idr_mutex);
 344:	}
 345:	
 346:	static int validate_lease(struct drm_device *dev,
 347:				  int object_count,
 348:				  struct drm_mode_object **objects,
 349:				  bool universal_planes)
 350:	{
 351:		int o;
 352:		int has_crtc = -1;
 353:		int has_connector = -1;
 354:		int has_plane = -1;
 355:	
 356:		/* we want to confirm that there is at least one crtc, plane
 357:		   connector object. */
 358:	
 359:		for (o = 0; o < object_count; o++) {
 360:			if (objects[o]->type == DRM_MODE_OBJECT_CRTC && has_crtc == -1) {
 361:				has_crtc = o;
 362:			}
 363:			if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
 364:				has_connector = o;
 365:	
 366:			if (universal_planes) {
 367:				if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
 368:					has_plane = o;
 369:			}
 370:		}
 371:		if (has_crtc == -1 || has_connector == -1)
 372:			return -EINVAL;
 373:		if (universal_planes && has_plane == -1)
 374:			return -EINVAL;
 375:		return 0;
 376:	}
 377:	
 378:	static int fill_object_idr(struct drm_device *dev,
 379:				   struct drm_file *lessor_priv,
]

147/4 2026/10/13 22:53 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 25590
							output: 25
							thoughts: 958
						

Thoughts:
**Analyzing `drm_mode_create_lease_ioctl` and Unbounded Allocations**

Okay, let's dive into this `drm_mode_create_lease_ioctl` function. The code takes an `object_count` from userspace, which is concerning because it could lead to unbounded allocations. I need to figure out what the reasonable limit for the number of mode objects is for a DRM device.

The historical context provided is helpful. It points to established patterns within the DRM subsystem for dealing with these situations. There are three key recommendations:

1.  **Switch to `kvmalloc`:** The primary fix is switching from `kzalloc_objs` to `kvzalloc_objs` and `kfree` to `kvfree`. This family is designed for large, user-controlled allocations without artificial limits.
2.  **Add an Upper Bound Check:** While `kvmalloc` avoids the `MAX_PAGE_ORDER` warning, it still has its limits. If the allocation size exceeds `INT_MAX`, it will trigger a `WARN_ON_ONCE`. Considering `object_count` is a `__u32` and `sizeof(struct drm_mode_object *)` is 8 bytes on 64-bit systems, a malicious user could pass a large `object_count` and cause an allocation size of up to 34GB, still triggering a kernel warning. The fix should involve a bounds check to prevent allocations larger than INT\_MAX / sizeof(void \*). The provided prior art, like commit `a1ba4594232c`, clearly demonstrates this pattern of checking user-supplied values before calling `kvmalloc`.
3.  **(Optional) Consistent Userspace Copying:** The code currently uses `memdup_array_user` for the `object_ids` array, which fails silently for large sizes due to `__GFP_NOWARN` but it still limits the maximum size to `MAX_PAGE_ORDER`. To support large arrays consistently, the suggested approach is to use `vmemdup_array_user` instead. This is consistent with what the DRM subsystem has been doing. The commits `cb77b79abf5f` and `c4ac100e9ae2` demonstrate how the `drm` subsystem replaced `kvmalloc_array + copy_from_user` or `memdup_user` with `vmemdup_array_user`.

So, the proposed solution involves:

*   Replacing the current allocation with `kvzalloc_objs` and `kvfree` in `fill_object_idr`.
*   Adding a bounds check in `drm_mode_create_lease_ioctl` to verify `object_count` doesn't exceed `INT_MAX / sizeof(void *)`.
*   And, as an optional improvement, switching to `vmemdup_array_user` to handle the `object_ids` allocation.

Now I need to inspect those example commits the text mentions!
I'll use `git-show` to review `cb77b79abf5f`, `c4ac100e9ae2`, `a1ba4594232c`, and `bca45af5998a`.



148/4 2026/10/13 22:53 tool git-show
0m Args:
map[Commit:cb77b79abf5f]

Results:
map[Output:commit cb77b79abf5ff8f4af07f7ebef196a003c826b7a
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Wed Nov 12 09:27:32 2025 +0000

    drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
    
    Use a helper to shrink the code and separate the user and kernel slabs for
    better security.
    
    While at it lets remove the useless debug message.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Reviewed-by: AndrΓ© Almeida <andrealmeid@igalia.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://lore.kernel.org/r/20251112092732.23584-1-tvrtko.ursulin@igalia.com

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index a1a9c828938b..68168d58a7c8 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -783,7 +783,6 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
 int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 			   int count, struct drm_gem_object ***objs_out)
 {
-	struct drm_device *dev = filp->minor->dev;
 	struct drm_gem_object **objs;
 	u32 *handles;
 	int ret;
@@ -798,15 +797,9 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 
 	*objs_out = objs;
 
-	handles = kvmalloc_array(count, sizeof(u32), GFP_KERNEL);
-	if (!handles) {
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	if (copy_from_user(handles, bo_handles, count * sizeof(u32))) {
-		ret = -EFAULT;
-		drm_dbg_core(dev, "Failed to copy in GEM handles\n");
+	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
+	if (IS_ERR(handles)) {
+		ret = PTR_ERR(handles);
 		goto out;
 	}
 
]

149/4 2026/10/13 22:53 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 27990
							output: 26
							thoughts: 18
						

Thoughts:
Okay, let's dive into this. I need to take a look at `a1ba4594232c`. Let me assess this thing…



150/4 2026/10/13 22:54 tool git-show
0m Args:
map[Commit:a1ba4594232c]

Results:
map[Output:commit a1ba4594232c87c3b8defd6f89a2e40f8b08395d
Author: Ziyi Guo <n7l8m4@u.northwestern.edu>
Date:   Sun Feb 8 00:02:55 2026 +0000

    drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO
    
    kvcalloc(args->num_entries, sizeof(*vm_entries), GFP_KERNEL) at
    amdgpu_gem.c:1050 uses the user-supplied num_entries directly without
    any upper bounds check. Since num_entries is a __u32 and
    sizeof(drm_amdgpu_gem_vm_entry) is 32 bytes, a large num_entries
    produces an allocation exceeding INT_MAX, triggering
    WARNING in __kvmalloc_node_noprof(), causing a kernel WARNING,
    TAINT_WARN, and panic on CONFIG_PANIC_ON_WARN=y systems.
    
    Add a size bounds check before we invoke the kvzalloc() to
    reject oversized num_entries early with -EINVAL.
    
    Fixes: 4d82724f7f2b ("drm/amdgpu: Add mapping info option for GEM_OP ioctl")
    Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 1fe7bf5457f6efd7be60b17e23163ba54341d73d)
    Cc: stable@vger.kernel.org

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 06dd2e8a5b47..fe6d988e7f24 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -1093,6 +1093,11 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
 		 * If that number is larger than the size of the array, the ioctl must
 		 * be retried.
 		 */
+		if (args->num_entries > INT_MAX / sizeof(*vm_entries)) {
+			r = -EINVAL;
+			goto out_exec;
+		}
+
 		vm_entries = kvcalloc(args->num_entries, sizeof(*vm_entries), GFP_KERNEL);
 		if (!vm_entries) {
 			r = -ENOMEM;
]

151/4 2026/10/13 22:54 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 28800
							output: 25
							thoughts: 97
						

Thoughts:
Okay, let's break this down.

**Examining a Kernel Commit and Potential Vulnerabilities**

Alright, so I'm looking at this snippet from `amdgpu`, specifically this check for `args->num_entries` in relation to the size of `vm_entries`. The code is doing a sanity check: `if (args->num_entries > INT_MAX / sizeof(*vm_entries))`.  Essentially, it's preventing an integer overflow when calculating the memory allocation size.  It's a pretty standard defensive programming technique, protecting against a scenario where `args->num_entries` is a large value that, when multiplied by `sizeof(*vm_entries)`, could wrap around, resulting in a smaller allocation than expected. That could then lead to a buffer overflow.

The `kvcalloc` call confirms this is a kernel-mode allocation. The check is good, but it makes me wonder: can we exploit this? Are there any weaknesses in how `args->num_entries` is populated? Are there other integer-related vulnerabilities in this area? How does `bca45af5998a` interact with this? Perhaps it introduces another way to manipulate this value. It's a common pattern to look for dependencies and interaction points. It's important to understand the context and how the `args` structure is populated and how the value of `num_entries` is derived.



152/4 2026/10/13 22:54 tool git-show
0m Args:
map[Commit:bca45af5998a]

Results:
map[Output:commit bca45af5998a05f34b13a2ef11e639bac9c62643
Author: MaΓ­ra Canal <mcanal@igalia.com>
Date:   Wed Sep 30 16:06:51 2026 -0300

    drm/vc4: Use kvmalloc_objs() for the BO cache size list
    
    The BO cache size list has one entry per BO page count, so its size
    scales with the largest BO ever freed. A 64 MiB BO already needs at
    least an order-6 allocation, which fails under fragmentation and
    triggers a warn_alloc() splat on BO close:
    
      page allocation failure: order:7, mode:0x40cc0(GFP_KERNEL|__GFP_COMP)
      Call trace:
       ...
       warn_alloc+0x118/0x190
       __alloc_pages_slowpath+0x4a8/0x520
       ...
       __kmalloc_noprof+0x3ac/0x5d8
       vc4_free_object+0x128/0x370 [vc4]
       drm_gem_object_handle_put_unlocked+0xb8/0x158 [drm]
       drm_gem_object_release_handle+0x74/0xe8 [drm]
       drm_gem_handle_delete+0x6c/0xa8 [drm]
       drm_gem_close_ioctl+0x34/0x50 [drm]
    
    The list doesn't need physically contiguous memory. Use kvmalloc_objs()
    so large lists can fall back to vmalloc(), avoiding the allocation
    failure.
    
    Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
    Reviewed-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
    Link: https://patch.msgid.link/20260930190721.1897264-2-mcanal@igalia.com
    Signed-off-by: MaΓ­ra Canal <mcanal@igalia.com>

diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index ea1be891ac78..7b8b3364000f 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -204,7 +204,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev,
 		struct list_head *new_list;
 		uint32_t i;
 
-		new_list = kmalloc_objs(struct list_head, new_size);
+		new_list = kvmalloc_objs(struct list_head, new_size);
 		if (!new_list)
 			return NULL;
 
@@ -224,7 +224,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev,
 		for (i = vc4->bo_cache.size_list_size; i < new_size; i++)
 			INIT_LIST_HEAD(&new_list[i]);
 
-		kfree(vc4->bo_cache.size_list);
+		kvfree(vc4->bo_cache.size_list);
 		vc4->bo_cache.size_list = new_list;
 		vc4->bo_cache.size_list_size = new_size;
 	}
@@ -1052,7 +1052,7 @@ static void vc4_bo_cache_destroy(struct drm_device *dev, void *unused)
 	cancel_work_sync(&vc4->bo_cache.time_work);
 
 	vc4_bo_cache_purge(dev);
-	kfree(vc4->bo_cache.size_list);
+	kvfree(vc4->bo_cache.size_list);
 
 	for (i = 0; i < vc4->num_labels; i++) {
 		if (vc4->bo_labels[i].num_allocated) {
]

153/4 2026/10/13 22:54 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 30320
							output: 25
							thoughts: 18
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and written in the first person:

**Analyzing the New Data Point: 0829b5bcdd3b**

Alright, let's dissect this new element: `0829b5bcdd3b`. I need to assess its place in the broader picture. What's its potential significance? My immediate questions are: What system is it from? What metadata is associated with it? What are the immediate and direct connections from this to anything else?

My first instinct is to run it through my standard battery of initial analysis tools: entropy checks, character distribution, known hash databases, any readily available online resources. Does this look like code? Is this an identifier, a timestamp, a key, or something entirely new?

I'll be looking for any inherent patterns and correlations that emerge immediately. Is there an obvious relationship to other data points I'm already aware of? Does the hexadecimal format suggest anything about its origin or purpose? Are there any clear markers indicating its use as a unique identifier?

Once I get these initial results, I'll examine the immediate network. What links exist? Is this piece of data referenced in any logs? Is there any record of this information being accessed? I need to build a connection map to gain a full understanding of its function and importance.



154/4 2026/10/13 22:54 tool git-show
0m Args:
map[Commit:0829b5bcdd3b]

Results:
map[Output:commit 0829b5bcdd3ba077c408e71e22ac2bfa85bf2c95
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Tue May 21 11:12:01 2024 +0100

    drm/i915: 2 GiB of relocations ought to be enough for anybody*
    
    Kernel test robot reports i915 can hit a warn in kvmalloc_node which has
    a purpose of dissalowing crazy size kernel allocations. This was added in
    7661809d493b ("mm: don't allow oversized kvmalloc() calls"):
    
           /* Don't even allow crazy sizes */
           if (WARN_ON_ONCE(size > INT_MAX))
                   return NULL;
    
    This would be kind of okay since i915 at one point dropped the need for
    making a shadow copy of the relocation list, but then it got re-added in
    fd1500fcd442 ("Revert "drm/i915/gem: Drop relocation slowpath".") a year
    after Linus added the above warning.
    
    It is plausible that the issue was not seen until now because to trigger
    gem_exec_reloc test requires a combination of an relatively older
    generation hardware but with at least 8GiB of RAM installed. Probably even
    more depending on runtime checks.
    
    Lets cap what we allow userspace to pass in using the matching limit.
    There should be no issue for real userspace since we are talking about
    "crazy" number of relocations which have no practical purpose.
    
    *) Well IGT tests might get upset but they can be easily adjusted.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Reported-by: kernel test robot <oliver.sang@intel.com>
    Closes: https://lore.kernel.org/oe-lkp/202405151008.6ddd1aaf-oliver.sang@intel.com
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Kent Overstreet <kent.overstreet@linux.dev>
    Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240521101201.18978-1-tursulin@igalia.com

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 090724fa766c..8aff06933f54 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1533,7 +1533,7 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)
 		u64_to_user_ptr(entry->relocs_ptr);
 	unsigned long remain = entry->relocation_count;
 
-	if (unlikely(remain > N_RELOC(ULONG_MAX)))
+	if (unlikely(remain > N_RELOC(INT_MAX)))
 		return -EINVAL;
 
 	/*
@@ -1641,7 +1641,7 @@ static int check_relocations(const struct drm_i915_gem_exec_object2 *entry)
 	if (size == 0)
 		return 0;
 
-	if (size > N_RELOC(ULONG_MAX))
+	if (size > N_RELOC(INT_MAX))
 		return -EINVAL;
 
 	addr = u64_to_user_ptr(entry->relocs_ptr);
]

155/4 2026/10/13 22:54 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 31772
							output: 44
							thoughts: 1473
						

Thoughts:
**Deep Dive into drm_lease.c: A Type Mismatch Conundrum**

Alright, this is quite clear, and it's time to dig into `drm_lease.c` with a fine-tooth comb. I'm focusing on the `drm_mode_create_lease_ioctl` function and its interactions, specifically, `fill_object_idr`.

I'm immediately looking at how `object_count` is handled. It starts as a `size_t` variable within `drm_mode_create_lease_ioctl`, but then it's assigned the value of `cl->object_count`, which is a `__u32`. This raises a red flag. The crucial part is how `object_count` is then passed to `fill_object_idr`.

Initially, `fill_object_idr` takes an `int object_count`. This is where it gets interesting. I'm questioning the rationale behind this type change. If `object_count` is `__u32` which might be passed in `int object_count`, there might be an overflow, so let's check.

I'm thinking, if `object_count` is a `__u32`, the code could handle values up to the maximum value of a 32-bit unsigned integer. I'm calculating the potential maximum:  the maximum size would be roughly 2GB divided by the size of a pointer (`sizeof(struct drm_mode_object *)`). However, a 32-bit `int` (`INT_MAX`) can handle at most `2,147,483,647`.

I'm getting curious: Why isn't there a check to ensure that `object_count` doesn't exceed `INT_MAX / sizeof(struct drm_mode_object *)` or maybe `INT_MAX / sizeof(void *)`? This seems like a potential vulnerability if `object_count` is large enough. If `object_count` is too large, the function might return `-EINVAL`. This also makes me think about how `object_ids` might be allocated using `vmemdup_array_user`.

I need to confirm the sizes for `object_ids`: `sizeof(__u32)` which is 4 and `sizeof(struct drm_mode_object *)`, is 8 on 64-bit systems and 4 on 32-bit systems. We are safe because we check for this.

I'm further analyzing the code and its use in `validate_lease`. The same `object_count` is passed to `validate_lease`, which takes `int object_count`.  However, `object_count` will always fit within a positive `int` if it's bounded by `INT_MAX / sizeof(struct drm_mode_object *)`.

This raises a broader question:  Why use `int` when the `object_count` can clearly be `size_t` throughout? Let's check `fill_object_idr`:
```c
static int fill_object_idr(struct drm_device *dev,
			   struct drm_file *lessor_priv,
			   struct idr *leases,
			   size_t object_count,
			   u32 *object_ids)
```

Interestingly, I find the usage of `size_t` in `fill_object_idr`. But I'm going to look deeper. There should not be a change to the function signature without a good reason. I'll need to check the git blame to understand the history of this part of the code and the reasoning behind these design choices.



156/4 2026/10/13 22:54 tool git-blame
0m Args:
map[End:525 File:drivers/gpu/drm/drm_lease.c LineCount:<nil> Start:505]

Results:
map[Output:56f0729a510f9 505) 	}
56f0729a510f9 506) 
62884cd386b87 507) 	object_count = cl->object_count;
62884cd386b87 508) 
4bb2d367a5a28 509) 	/* Handle leased objects, if any */
62884cd386b87 510) 	idr_init(&leases);
4bb2d367a5a28 511) 	if (object_count != 0) {
f37d63e219c39 512) 		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
f37d63e219c39 513) 					       object_count, sizeof(__u32));
4bb2d367a5a28 514) 		if (IS_ERR(object_ids)) {
4bb2d367a5a28 515) 			ret = PTR_ERR(object_ids);
4bb2d367a5a28 516) 			idr_destroy(&leases);
4bb2d367a5a28 517) 			goto out_lessor;
4bb2d367a5a28 518) 		}
62884cd386b87 519) 
4bb2d367a5a28 520) 		/* fill and validate the object idr */
4bb2d367a5a28 521) 		ret = fill_object_idr(dev, lessor_priv, &leases,
4bb2d367a5a28 522) 				      object_count, object_ids);
4bb2d367a5a28 523) 		kfree(object_ids);
4bb2d367a5a28 524) 		if (ret) {
7bd224b6625ab 525) 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
]

157/4 2026/10/13 22:54 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 34689
							output: 28
							thoughts: 35
						

Thoughts:
Okay, here's my interpretation of those commits, presented as a personal thought process, as requested:

**Analyzing Commits f37d63e219c39 and 62884cd386b87**

Alright, let's dive into these commits. First, I want to take a look at `f37d63e219c39`. Based on the context and the commit message (which I'd obviously need to see to be *truly* insightful!), I'm expecting something in the realm of [**Insert relevant technical area related to their expertise, e.g., "algorithm optimization," "database schema migration," "frontend UI refactoring" etc. Here**]. I'll need to pay close attention to the code diffs, specifically the lines added and deleted, the specific files modified, and any associated unit tests that were affected. I'll be looking for potential side effects, performance implications, and adherence to established coding standards. Depending on the size of the diff, I might need to run a quick local build and test cycle just to get a feel for the changes and the committers' motivations for them.

Now, let's pivot to `62884cd386b87`. Given its position in the commit history or if it's referenced after the first commit (again, I'd need more context), this one probably builds on or relates to the first. Perhaps it's a follow-up fix, a refactoring based on feedback from a review of the prior commit, or maybe it addresses a previously identified edge case or performance bottleneck. I'll be examining the changes with an eye towards understanding their relationship with the first. Are they complementary? Do they introduce any conflicts? Do they address the same problem in an alternative way? I would assess the quality of the changes and see whether or not they follow best practices and contribute to the overall project's stability. I would look at its associated commit message and, if necessary, compare and contrast it with commit `f37d63e219c39`. Ultimately, I will determine if these commits represent a cohesive, well-reasoned set of changes or if further investigation is warranted.



158/4 2026/10/13 22:54 tool git-show
0m Args:
map[Commit:f37d63e219c39]

Results:
map[Output:commit f37d63e219c39199a59b8b8a211412ff27192830
Author: Philipp Stanner <pstanner@redhat.com>
Date:   Wed Sep 20 14:36:12 2023 +0200

    drm_lease.c: copy user-array safely
    
    Currently, there is no overflow-check with memdup_user().
    
    Use the new function memdup_array_user() instead of memdup_user() for
    duplicating the user-space array safely.
    
    Suggested-by: David Airlie <airlied@redhat.com>
    Signed-off-by: Philipp Stanner <pstanner@redhat.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Zack Rusin <zackr@vmware.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-6-pstanner@redhat.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 150fe1555068..94375c6a5425 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -510,8 +510,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
-					 array_size(object_count, sizeof(__u32)));
+		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
+					       object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
]

159/4 2026/10/13 22:54 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 35822
							output: 27
							thoughts: 89
						

Thoughts:
Okay, here's my analysis of these commits, presented as a personal thought process:

**Diving into Memory Duplication Safety**

Alright, let's see... commit `f37d63e219c39` on `drm_lease.c` caught my eye. They've opted for `memdup_array_user` instead of just plain `memdup_user()`. Interesting. That immediately suggests a focus on more robust user-space memory handling, likely to avoid potential buffer overflows or other vulnerabilities when copying data from user space. The use of `_array` implies that they're dealing with an array-like structure from user space, which adds a layer of complexity that needs careful management to prevent security issues. The `_array` suffix signals that the size of the memory being duplicated is derived from user space, and must be validated.

Now, let's shift gears and look at commit `62884cd386b87`. I need to understand if this commit follows similar principles, or perhaps addresses a different aspect of memory safety. A quick peek at the commit message won't be enough. Let's fire up `git show 62884cd386b87` and see what it's all about. I'm especially interested to see if it deals with user-space data copying or handling, and if it references any similar memory duplication techniques. I'm anticipating that I will be looking for similarities and differences between the two, or perhaps checking if there are relationships between them. This will allow me to create a mental picture about the project's overall approach to memory security.



160/4 2026/10/13 22:54 tool git-show
0m Args:
map[Commit:62884cd386b87]

Results:
map[Output:commit 62884cd386b876638720ef88374b31a84ca7ee5f
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Mar 16 17:56:28 2017 -0700

    drm: Add four ioctls for managing drm mode object leases [v7]
    
    drm_mode_create_lease
    
            Creates a lease for a list of drm mode objects, returning an
            fd for the new drm_master and a 64-bit identifier for the lessee
    
    drm_mode_list_lesees
    
            List the identifiers of the lessees for a master file
    
    drm_mode_get_lease
    
            List the leased objects for a master file
    
    drm_mode_revoke_lease
    
            Erase the set of objects managed by a lease.
    
    This should suffice to at least create and query leases.
    
    Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
    
     * query ioctls only query the master associated with
       the provided file.
    
     * 'mask_lease' value has been removed
    
     * change ioctl has been removed.
    
    Changes for v3 suggested in part by Dave Airlie <airlied@gmail.com>
    
     * Add revoke ioctl.
    
    Changes for v4 suggested by Dave Airlie <airlied@gmail.com>
    
     * Expand on the comment about the magic use of &drm_lease_idr_object
     * Pad lease ioctl structures to align on 64-bit boundaries
    
    Changes for v5 suggested by Dave Airlie <airlied@gmail.com>
    
     * Check for non-negative object_id in create_lease to avoid debug
       output from the kernel.
    
    Changes for v6 provided by Dave Airlie <airlied@gmail.com>
    
     * For non-universal planes add primary/cursor planes to lease
    
       If we aren't exposing universal planes to this userspace client,
       and it requests a lease on a crtc, we should implicitly export the
       primary and cursor planes for the crtc.
    
       If the lessee doesn't request universal planes, it will just see
       the crtc, but if it does request them it will then see the plane
       objects as well.
    
       This also moves the object look ups earlier as a side effect, so
       we'd exit the ioctl quicker for non-existant objects.
    
     * Restrict leases to crtc/connector/planes.
    
       This only allows leasing for objects we wish to allow.
    
    Changes for v7 provided by Dave Airlie <airlied@gmail.com>
    
     * Check pad args are 0
     * Check create flags and object count are valid.
     * Check return from fd allocation
     * Refactor lease idr setup and add some simple validation
     * Use idr_mutex uniformly (Keith)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 9c435a4c0c82..4aafe4802099 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -665,6 +665,10 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
 		      DRM_UNLOCKED|DRM_RENDER_ALLOW),
 	DRM_IOCTL_DEF(DRM_IOCTL_CRTC_GET_SEQUENCE, drm_crtc_get_sequence_ioctl, DRM_UNLOCKED),
 	DRM_IOCTL_DEF(DRM_IOCTL_CRTC_QUEUE_SEQUENCE, drm_crtc_queue_sequence_ioctl, DRM_UNLOCKED),
+	DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_LEASE, drm_mode_create_lease_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+	DRM_IOCTL_DEF(DRM_IOCTL_MODE_LIST_LESSEES, drm_mode_list_lessees_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+	DRM_IOCTL_DEF(DRM_IOCTL_MODE_GET_LEASE, drm_mode_get_lease_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+	DRM_IOCTL_DEF(DRM_IOCTL_MODE_REVOKE_LEASE, drm_mode_revoke_lease_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
 };
 
 #define DRM_CORE_IOCTL_COUNT	ARRAY_SIZE( drm_ioctls )
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 030db1170570..d1eb56a1eff4 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -23,6 +23,8 @@
 #define drm_for_each_lessee(lessee, lessor) \
 	list_for_each_entry((lessee), &(lessor)->lessees, lessee_list)
 
+static uint64_t drm_lease_idr_object;
+
 /**
  * drm_lease_owner - return ancestor owner drm_master
  * @master: drm_master somewhere within tree of lessees and lessors
@@ -353,3 +355,413 @@ void drm_lease_revoke(struct drm_master *top)
 	_drm_lease_revoke(top);
 	mutex_unlock(&top->dev->mode_config.idr_mutex);
 }
+
+static int validate_lease(struct drm_device *dev,
+			  struct drm_file *lessor_priv,
+			  int object_count,
+			  struct drm_mode_object **objects)
+{
+	int o;
+	int has_crtc = -1;
+	int has_connector = -1;
+	int has_plane = -1;
+
+	/* we want to confirm that there is at least one crtc, plane
+	   connector object. */
+
+	for (o = 0; o < object_count; o++) {
+		if (objects[o]->type == DRM_MODE_OBJECT_CRTC && has_crtc == -1) {
+			has_crtc = o;
+		}
+		if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
+			has_connector = o;
+
+		if (lessor_priv->universal_planes) {
+			if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
+				has_plane = o;
+		}
+	}
+	if (has_crtc == -1 || has_connector == -1)
+		return -EINVAL;
+	if (lessor_priv->universal_planes && has_plane == -1)
+		return -EINVAL;
+	return 0;
+}
+
+static int fill_object_idr(struct drm_device *dev,
+			   struct drm_file *lessor_priv,
+			   struct idr *leases,
+			   int object_count,
+			   u32 *object_ids)
+{
+	struct drm_mode_object **objects;
+	u32 o;
+	int ret;
+	objects = kcalloc(object_count, sizeof(struct drm_mode_object *),
+			  GFP_KERNEL);
+	if (!objects)
+		return -ENOMEM;
+
+	/* step one - get references to all the mode objects
+	   and check for validity. */
+	for (o = 0; o < object_count; o++) {
+		if ((int) object_ids[o] < 0) {
+			ret = -EINVAL;
+			goto out_free_objects;
+		}
+
+		objects[o] = drm_mode_object_find(dev, lessor_priv,
+						  object_ids[o],
+						  DRM_MODE_OBJECT_ANY);
+		if (!objects[o]) {
+			ret = -ENOENT;
+			goto out_free_objects;
+		}
+
+		if (!drm_mode_object_lease_required(objects[o]->type)) {
+			ret = -EINVAL;
+			goto out_free_objects;
+		}
+	}
+
+	ret = validate_lease(dev, lessor_priv, object_count, objects);
+	if (ret)
+		goto out_free_objects;
+
+	/* add their IDs to the lease request - taking into account
+	   universal planes */
+	for (o = 0; o < object_count; o++) {
+		struct drm_mode_object *obj = objects[o];
+		u32 object_id = objects[o]->id;
+		DRM_DEBUG_LEASE("Adding object %d to lease\n", object_id);
+
+		/*
+		 * We're using an IDR to hold the set of leased
+		 * objects, but we don't need to point at the object's
+		 * data structure from the lease as the main crtc_idr
+		 * will be used to actually find that. Instead, all we
+		 * really want is a 'leased/not-leased' result, for
+		 * which any non-NULL pointer will work fine.
+		 */
+		ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
+		if (ret < 0) {
+			DRM_DEBUG_LEASE("Object %d cannot be inserted into leases (%d)\n",
+					object_id, ret);
+			goto out_free_objects;
+		}
+		if (obj->type == DRM_MODE_OBJECT_CRTC && !lessor_priv->universal_planes) {
+			struct drm_crtc *crtc = obj_to_crtc(obj);
+			ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
+			if (ret < 0) {
+				DRM_DEBUG_LEASE("Object primary plane %d cannot be inserted into leases (%d)\n",
+						object_id, ret);
+				goto out_free_objects;
+			}
+			if (crtc->cursor) {
+				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
+				if (ret < 0) {
+					DRM_DEBUG_LEASE("Object cursor plane %d cannot be inserted into leases (%d)\n",
+							object_id, ret);
+					goto out_free_objects;
+				}
+			}
+		}
+	}
+
+	ret = 0;
+out_free_objects:
+	for (o = 0; o < object_count; o++) {
+		if (objects[o])
+			drm_mode_object_put(objects[o]);
+	}
+	kfree(objects);
+	return ret;
+}
+
+/**
+ * drm_mode_create_lease_ioctl - create a new lease
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_create_lease
+ * @file_priv: the file being manipulated
+ *
+ * The master associated with the specified file will have a lease
+ * created containing the objects specified in the ioctl structure.
+ * A file descriptor will be allocated for that and returned to the
+ * application.
+ */
+int drm_mode_create_lease_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *lessor_priv)
+{
+	struct drm_mode_create_lease *cl = data;
+	size_t object_count;
+	int ret = 0;
+	struct idr leases;
+	struct drm_master *lessor = lessor_priv->master;
+	struct drm_master *lessee = NULL;
+	struct file *lessee_file = NULL;
+	struct file *lessor_file = lessor_priv->filp;
+	struct drm_file *lessee_priv;
+	int fd = -1;
+	uint32_t *object_ids;
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	/* Do not allow sub-leases */
+	if (lessor->lessor)
+		return -EINVAL;
+
+	/* need some objects */
+	if (cl->object_count == 0)
+		return -EINVAL;
+
+	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK)))
+		return -EINVAL;
+
+	object_count = cl->object_count;
+
+	object_ids = memdup_user(u64_to_user_ptr(cl->object_ids), object_count * sizeof(__u32));
+	if (IS_ERR(object_ids))
+		return PTR_ERR(object_ids);
+
+	idr_init(&leases);
+
+	/* fill and validate the object idr */
+	ret = fill_object_idr(dev, lessor_priv, &leases,
+			      object_count, object_ids);
+	kfree(object_ids);
+	if (ret) {
+		idr_destroy(&leases);
+		return ret;
+	}
+
+	/* Allocate a file descriptor for the lease */
+	fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
+	if (fd < 0) {
+		idr_destroy(&leases);
+		return fd;
+	}
+
+	DRM_DEBUG_LEASE("Creating lease\n");
+	lessee = drm_lease_create(lessor, &leases);
+
+	if (IS_ERR(lessee)) {
+		ret = PTR_ERR(lessee);
+		goto out_leases;
+	}
+
+	/* Clone the lessor file to create a new file for us */
+	DRM_DEBUG_LEASE("Allocating lease file\n");
+	path_get(&lessor_file->f_path);
+	lessee_file = alloc_file(&lessor_file->f_path,
+				 lessor_file->f_mode,
+				 fops_get(lessor_file->f_inode->i_fop));
+
+	if (IS_ERR(lessee_file)) {
+		ret = PTR_ERR(lessee_file);
+		goto out_lessee;
+	}
+
+	/* Initialize the new file for DRM */
+	DRM_DEBUG_LEASE("Initializing the file with %p\n", lessee_file->f_op->open);
+	ret = lessee_file->f_op->open(lessee_file->f_inode, lessee_file);
+	if (ret)
+		goto out_lessee_file;
+
+	lessee_priv = lessee_file->private_data;
+
+	/* Change the file to a master one */
+	drm_master_put(&lessee_priv->master);
+	lessee_priv->master = lessee;
+	lessee_priv->is_master = 1;
+	lessee_priv->authenticated = 1;
+
+	/* Hook up the fd */
+	fd_install(fd, lessee_file);
+
+	/* Pass fd back to userspace */
+	DRM_DEBUG_LEASE("Returning fd %d id %d\n", fd, lessee->lessee_id);
+	cl->fd = fd;
+	cl->lessee_id = lessee->lessee_id;
+
+	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n");
+	return 0;
+
+out_lessee_file:
+	fput(lessee_file);
+
+out_lessee:
+	drm_master_put(&lessee);
+
+out_leases:
+	put_unused_fd(fd);
+	idr_destroy(&leases);
+
+	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl failed: %d\n", ret);
+	return ret;
+}
+
+/**
+ * drm_mode_list_lessees_ioctl - list lessee ids
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_list_lessees
+ * @lessor_priv: the file being manipulated
+ *
+ * Starting from the master associated with the specified file,
+ * the master with the provided lessee_id is found, and then
+ * an array of lessee ids associated with leases from that master
+ * are returned.
+ */
+
+int drm_mode_list_lessees_ioctl(struct drm_device *dev,
+			       void *data, struct drm_file *lessor_priv)
+{
+	struct drm_mode_list_lessees *arg = data;
+	__u32 __user *lessee_ids = (__u32 __user *) (uintptr_t) (arg->lessees_ptr);
+	__u32 count_lessees = arg->count_lessees;
+	struct drm_master *lessor = lessor_priv->master, *lessee;
+	int count;
+	int ret = 0;
+
+	if (arg->pad)
+		return -EINVAL;
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	DRM_DEBUG_LEASE("List lessees for %d\n", lessor->lessee_id);
+
+	mutex_lock(&dev->mode_config.idr_mutex);
+
+	count = 0;
+	drm_for_each_lessee(lessee, lessor) {
+		/* Only list un-revoked leases */
+		if (!idr_is_empty(&lessee->leases)) {
+			if (count_lessees > count) {
+				DRM_DEBUG_LEASE("Add lessee %d\n", lessee->lessee_id);
+				ret = put_user(lessee->lessee_id, lessee_ids + count);
+				if (ret)
+					break;
+			}
+			count++;
+		}
+	}
+
+	DRM_DEBUG_LEASE("Lessor leases to %d\n", count);
+	if (ret == 0)
+		arg->count_lessees = count;
+
+	mutex_unlock(&dev->mode_config.idr_mutex);
+
+	return ret;
+}
+
+/**
+ * drm_mode_get_lease_ioctl - list leased objects
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_get_lease
+ * @file_priv: the file being manipulated
+ *
+ * Return the list of leased objects for the specified lessee
+ */
+
+int drm_mode_get_lease_ioctl(struct drm_device *dev,
+			     void *data, struct drm_file *lessee_priv)
+{
+	struct drm_mode_get_lease *arg = data;
+	__u32 __user *object_ids = (__u32 __user *) (uintptr_t) (arg->objects_ptr);
+	__u32 count_objects = arg->count_objects;
+	struct drm_master *lessee = lessee_priv->master;
+	struct idr *object_idr;
+	int count;
+	void *entry;
+	int object;
+	int ret = 0;
+
+	if (arg->pad)
+		return -EINVAL;
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	DRM_DEBUG_LEASE("get lease for %d\n", lessee->lessee_id);
+
+	mutex_lock(&dev->mode_config.idr_mutex);
+
+	if (lessee->lessor == NULL)
+		/* owner can use all objects */
+		object_idr = &lessee->dev->mode_config.crtc_idr;
+	else
+		/* lessee can only use allowed object */
+		object_idr = &lessee->leases;
+
+	count = 0;
+	idr_for_each_entry(object_idr, entry, object) {
+		if (count_objects > count) {
+			DRM_DEBUG_LEASE("adding object %d\n", object);
+			ret = put_user(object, object_ids + count);
+			if (ret)
+				break;
+		}
+		count++;
+	}
+
+	DRM_DEBUG("lease holds %d objects\n", count);
+	if (ret == 0)
+		arg->count_objects = count;
+
+	mutex_unlock(&dev->mode_config.idr_mutex);
+
+	return ret;
+}
+
+/**
+ * drm_mode_revoke_lease_ioctl - revoke lease
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_revoke_lease
+ * @file_priv: the file being manipulated
+ *
+ * This removes all of the objects from the lease without
+ * actually getting rid of the lease itself; that way all
+ * references to it still work correctly
+ */
+int drm_mode_revoke_lease_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *lessor_priv)
+{
+	struct drm_mode_revoke_lease *arg = data;
+	struct drm_master *lessor = lessor_priv->master;
+	struct drm_master *lessee;
+	int ret = 0;
+
+	DRM_DEBUG_LEASE("revoke lease for %d\n", arg->lessee_id);
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	mutex_lock(&dev->mode_config.idr_mutex);
+
+	lessee = _drm_find_lessee(lessor, arg->lessee_id);
+
+	/* No such lessee */
+	if (!lessee) {
+		ret = -ENOENT;
+		goto fail;
+	}
+
+	/* Lease is not held by lessor */
+	if (lessee->lessor != lessor) {
+		ret = -EACCES;
+		goto fail;
+	}
+
+	_drm_lease_revoke(lessee);
+
+fail:
+	mutex_unlock(&dev->mode_config.idr_mutex);
+
+	return ret;
+}
diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index d1599f36b605..7c8b2698c6a7 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -111,7 +111,7 @@ void drm_mode_object_unregister(struct drm_device *dev,
  * Returns whether the provided type of drm_mode_object must
  * be owned or leased to be used by a process.
  */
-static bool drm_lease_required(uint32_t type)
+bool drm_mode_object_lease_required(uint32_t type)
 {
 	switch(type) {
 	case DRM_MODE_OBJECT_CRTC:
@@ -136,7 +136,8 @@ struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
 	if (obj && obj->id != id)
 		obj = NULL;
 
-	if (obj && drm_lease_required(obj->type) && !_drm_lease_held(file_priv, obj->id))
+	if (obj && drm_mode_object_lease_required(obj->type) &&
+	    !_drm_lease_held(file_priv, obj->id))
 		obj = NULL;
 
 	if (obj && obj->free_cb) {
diff --git a/include/drm/drm_lease.h b/include/drm/drm_lease.h
index 6149e56ddbf3..fbc0ab54855b 100644
--- a/include/drm/drm_lease.h
+++ b/include/drm/drm_lease.h
@@ -31,4 +31,16 @@ void drm_lease_revoke(struct drm_master *master);
 
 uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs);
 
+int drm_mode_create_lease_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *file_priv);
+
+int drm_mode_list_lessees_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *file_priv);
+
+int drm_mode_get_lease_ioctl(struct drm_device *dev,
+			     void *data, struct drm_file *file_priv);
+
+int drm_mode_revoke_lease_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *file_priv);
+
 #endif /* _DRM_LEASE_H_ */
diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h
index c8155cb5a932..7ba3913f30b5 100644
--- a/include/drm/drm_mode_object.h
+++ b/include/drm/drm_mode_object.h
@@ -154,4 +154,6 @@ int drm_object_property_get_value(struct drm_mode_object *obj,
 void drm_object_attach_property(struct drm_mode_object *obj,
 				struct drm_property *property,
 				uint64_t init_val);
+
+bool drm_mode_object_lease_required(uint32_t type);
 #endif
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 91d83c1747c0..6fdff5945c8a 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -888,6 +888,11 @@ extern "C" {
 #define DRM_IOCTL_SYNCOBJ_RESET		DRM_IOWR(0xC4, struct drm_syncobj_array)
 #define DRM_IOCTL_SYNCOBJ_SIGNAL	DRM_IOWR(0xC5, struct drm_syncobj_array)
 
+#define DRM_IOCTL_MODE_CREATE_LEASE	DRM_IOWR(0xC6, struct drm_mode_create_lease)
+#define DRM_IOCTL_MODE_LIST_LESSEES	DRM_IOWR(0xC7, struct drm_mode_list_lessees)
+#define DRM_IOCTL_MODE_GET_LEASE	DRM_IOWR(0xC8, struct drm_mode_get_lease)
+#define DRM_IOCTL_MODE_REVOKE_LEASE	DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
+
 /**
  * Device specific ioctls should only be in their respective headers
  * The device specific ioctl range is from 0x40 to 0x9f.
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 34b6bb34b002..5597a87154e5 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -782,6 +782,72 @@ struct drm_mode_destroy_blob {
 	__u32 blob_id;
 };
 
+/**
+ * Lease mode resources, creating another drm_master.
+ */
+struct drm_mode_create_lease {
+	/** Pointer to array of object ids (__u32) */
+	__u64 object_ids;
+	/** Number of object ids */
+	__u32 object_count;
+	/** flags for new FD (O_CLOEXEC, etc) */
+	__u32 flags;
+
+	/** Return: unique identifier for lessee. */
+	__u32 lessee_id;
+	/** Return: file descriptor to new drm_master file */
+	__u32 fd;
+};
+
+/**
+ * List lesses from a drm_master
+ */
+struct drm_mode_list_lessees {
+	/** Number of lessees.
+	 * On input, provides length of the array.
+	 * On output, provides total number. No
+	 * more than the input number will be written
+	 * back, so two calls can be used to get
+	 * the size and then the data.
+	 */
+	__u32 count_lessees;
+	__u32 pad;
+
+	/** Pointer to lessees.
+	 * pointer to __u64 array of lessee ids
+	 */
+	__u64 lessees_ptr;
+};
+
+/**
+ * Get leased objects
+ */
+struct drm_mode_get_lease {
+	/** Number of leased objects.
+	 * On input, provides length of the array.
+	 * On output, provides total number. No
+	 * more than the input number will be written
+	 * back, so two calls can be used to get
+	 * the size and then the data.
+	 */
+	__u32 count_objects;
+	__u32 pad;
+
+	/** Pointer to objects.
+	 * pointer to __u32 array of object ids
+	 */
+	__u64 objects_ptr;
+};
+
+/**
+ * Revoke lease
+ */
+struct drm_mode_revoke_lease {
+	/** Unique ID of lessee
+	 */
+	__u32 lessee_id;
+};
+
 #if defined(__cplusplus)
 }
 #endif
]

161/4 2026/10/13 22:54 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 44130
							output: 39
							thoughts: 227
						

Thoughts:
**Analyzing the Evolution of `object_count` Usage**

Okay, let's trace the history of how `object_count` has been used. My initial thought process is to understand the context and evolution of a specific line of code. I'm seeing changes related to memory allocation, specifically the `object_count` variable. Initially, I observe that commit `62884cd386b87` used `kcalloc` and `memdup_user` in relation to `object_count`. After that commit, commit `f37d63e219c39` altered `memdup_user` to the `memdup_array_user` variant. Now, I see a newer modification where `kcalloc` has been swapped out for `kzalloc_objs`, which piques my interest. It is important to know why this modification was made. To delve further, my next step is to use `git blame` on line 389 of `drivers/gpu/drm/drm_lease.c`. This will give me information about who modified the code, when, and with what commit. With this information, I can understand the context and rationale for the change and its potential impact on the overall code.



162/4 2026/10/13 22:55 tool git-blame
0m Args:
map[End:392 File:drivers/gpu/drm/drm_lease.c Start:388]

Results:
map[Output:968029057192e 388) 
32a92f8c89326 389) 	objects = kzalloc_objs(struct drm_mode_object *, object_count);
62884cd386b87 390) 	if (!objects)
62884cd386b87 391) 		return -ENOMEM;
62884cd386b87 392) 
]

163/4 2026/10/13 22:55 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 44804
							output: 28
							thoughts: 20
						

Thoughts:
Okay, here's my interpretation of what's going through my mind when I encounter that prompt, rendered in the first person:

**Analyzing the Commit Context**

Alright, show me commit `32a92f8c89326`. That commit hash is a good starting point. I need to understand what changed there. My initial thought process is geared towards efficient context switching. What was the context of the work? What was the problem being solved or the feature being implemented? Is this something I'm already familiar with, or is it a completely new area for me? My immediate goal is to establish a mental model of the changes and their potential implications within the existing codebase. I will quickly scan the commit diff, focusing on file paths, function signatures, and any comments that might offer quick insights. I'm looking for clues about the scope and purpose of the changes. I'll need to assess the magnitude of the modification. Was it an isolated fix, a refactor, or a substantial feature implementation? The answers to those questions will dictate how deep I need to dive into the associated codebase for an effective analysis.



164/4 2026/10/13 22:55 tool git-show
0m Args:
map[Commit:32a92f8c89326]

Results:
map[Output:commit 32a92f8c89326985e05dce8b22d3f0aa07a3e1bd
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Feb 21 20:03:00 2026 -0800

    Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
    
    This converts some of the visually simpler cases that have been split
    over multiple lines.  I only did the ones that are easy to verify the
    resulting diff by having just that final GFP_KERNEL argument on the next
    line.
    
    Somebody should probably do a proper coccinelle script for this, but for
    me the trivial script actually resulted in an assertion failure in the
    middle of the script.  I probably had made it a bit _too_ trivial.
    
    So after fighting that far a while I decided to just do some of the
    syntactically simpler cases with variations of the previous 'sed'
    scripts.
    
    The more syntactically complex multi-line cases would mostly really want
    whitespace cleanup anyway.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index a4dae1baae99..b6cce510c343 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -294,8 +294,7 @@ static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
 {
 	int i;
 
-	omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size,
-					  GFP_KERNEL);
+	omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size);
 	if (!omap_mcbsp_devices) {
 		printk(KERN_ERR "Could not register McBSP devices\n");
 		return;
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
index 34d761ef08b0..592dd8668de4 100644
--- a/arch/arm64/kernel/vdso.c
+++ b/arch/arm64/kernel/vdso.c
@@ -81,8 +81,7 @@ static int __init __vdso_init(enum vdso_abi abi)
 			vdso_info[abi].vdso_code_start) >>
 			PAGE_SHIFT;
 
-	vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages,
-				     GFP_KERNEL);
+	vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages);
 	if (vdso_pagelist == NULL)
 		return -ENOMEM;
 
diff --git a/arch/loongarch/kernel/vdso.c b/arch/loongarch/kernel/vdso.c
index 222be8fc4aec..0aa10cadb959 100644
--- a/arch/loongarch/kernel/vdso.c
+++ b/arch/loongarch/kernel/vdso.c
@@ -52,8 +52,7 @@ static int __init init_vdso(void)
 
 	vdso_info.size = PAGE_ALIGN(vdso_end - vdso_start);
 	vdso_info.code_mapping.pages =
-		kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE,
-			     GFP_KERNEL);
+		kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE);
 
 	if (!vdso_info.code_mapping.pages)
 		return -ENOMEM;
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index b7fdb089f2af..2ba2dd26a7ea 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1738,8 +1738,7 @@ static int kvmppc_core_vcpu_create_pr(struct kvm_vcpu *vcpu)
 	vcpu->arch.book3s = vcpu_book3s;
 
 #ifdef CONFIG_KVM_BOOK3S_32_HANDLER
-	vcpu->arch.shadow_vcpu = kzalloc_obj(*vcpu->arch.shadow_vcpu,
-					     GFP_KERNEL);
+	vcpu->arch.shadow_vcpu = kzalloc_obj(*vcpu->arch.shadow_vcpu);
 	if (!vcpu->arch.shadow_vcpu)
 		goto free_vcpu3s;
 #endif
diff --git a/arch/powerpc/mm/book3s64/mmu_context.c b/arch/powerpc/mm/book3s64/mmu_context.c
index c7302dd2ef25..2fe787e6c2dc 100644
--- a/arch/powerpc/mm/book3s64/mmu_context.c
+++ b/arch/powerpc/mm/book3s64/mmu_context.c
@@ -96,8 +96,7 @@ static int hash__init_new_context(struct mm_struct *mm)
 {
 	int index;
 
-	mm->context.hash_context = kmalloc_obj(struct hash_mm_context,
-					       GFP_KERNEL);
+	mm->context.hash_context = kmalloc_obj(struct hash_mm_context);
 	if (!mm->context.hash_context)
 		return -ENOMEM;
 
@@ -124,8 +123,7 @@ static int hash__init_new_context(struct mm_struct *mm)
 #ifdef CONFIG_PPC_SUBPAGE_PROT
 		/* inherit subpage prot details if we have one. */
 		if (current->mm->context.hash_context->spt) {
-			mm->context.hash_context->spt = kmalloc_obj(struct subpage_prot_table,
-								    GFP_KERNEL);
+			mm->context.hash_context->spt = kmalloc_obj(struct subpage_prot_table);
 			if (!mm->context.hash_context->spt) {
 				kfree(mm->context.hash_context);
 				return -ENOMEM;
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 8a8d8c2b8930..243c0a1c8cda 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -917,8 +917,7 @@ static int create_events_from_catalog(struct attribute ***events_,
 		goto e_event_attrs;
 	}
 
-	event_long_descs = kmalloc_objs(*event_long_descs, event_idx + 1,
-					GFP_KERNEL);
+	event_long_descs = kmalloc_objs(*event_long_descs, event_idx + 1);
 	if (!event_long_descs) {
 		ret = -ENOMEM;
 		goto e_event_descs;
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index e3cb23906fcd..db98e9af8812 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1527,8 +1527,7 @@ static int init_nest_pmu_ref(void)
 {
 	int nid, i, cpu;
 
-	nest_imc_refc = kzalloc_objs(*nest_imc_refc, num_possible_nodes(),
-				     GFP_KERNEL);
+	nest_imc_refc = kzalloc_objs(*nest_imc_refc, num_possible_nodes());
 
 	if (!nest_imc_refc)
 		return -ENOMEM;
@@ -1714,14 +1713,12 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent,
 			goto err;
 
 		nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
-		pmu_ptr->mem_info = kzalloc_objs(struct imc_mem_info, nr_cores,
-						 GFP_KERNEL);
+		pmu_ptr->mem_info = kzalloc_objs(struct imc_mem_info, nr_cores);
 
 		if (!pmu_ptr->mem_info)
 			goto err;
 
-		core_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores,
-					     GFP_KERNEL);
+		core_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores);
 
 		if (!core_imc_refc) {
 			kfree(pmu_ptr->mem_info);
@@ -1754,8 +1751,7 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent,
 			return -ENOMEM;
 
 		nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
-		trace_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores,
-					      GFP_KERNEL);
+		trace_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores);
 		if (!trace_imc_refc)
 			return -ENOMEM;
 
diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
index 1389a3131993..6cd461f82968 100644
--- a/arch/powerpc/platforms/powernv/idle.c
+++ b/arch/powerpc/platforms/powernv/idle.c
@@ -1336,8 +1336,7 @@ static int __init pnv_parse_cpuidle_dt(void)
 	nr_idle_states = of_property_count_u32_elems(np,
 						"ibm,cpu-idle-state-flags");
 
-	pnv_idle_states = kzalloc_objs(*pnv_idle_states, nr_idle_states,
-				       GFP_KERNEL);
+	pnv_idle_states = kzalloc_objs(*pnv_idle_states, nr_idle_states);
 	temp_u32 = kcalloc(nr_idle_states, sizeof(u32),  GFP_KERNEL);
 	temp_u64 = kcalloc(nr_idle_states, sizeof(u64),  GFP_KERNEL);
 	temp_string = kcalloc(nr_idle_states, sizeof(char *),  GFP_KERNEL);
diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
index 5214e2d43e78..6aa578e6348d 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -133,8 +133,7 @@ static int memtrace_init_regions_runtime(u64 size)
 	u32 nid;
 	u64 m;
 
-	memtrace_array = kzalloc_objs(struct memtrace_entry, num_online_nodes(),
-				      GFP_KERNEL);
+	memtrace_array = kzalloc_objs(struct memtrace_entry, num_online_nodes());
 	if (!memtrace_array) {
 		pr_err("Failed to allocate memtrace_array\n");
 		return -EINVAL;
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index ed2842bea1cb..b3fd5c648dea 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -108,8 +108,7 @@ static int imc_get_mem_addr_nest(struct device_node *node,
 								nr_chips))
 		goto error;
 
-	pmu_ptr->mem_info = kzalloc_objs(*pmu_ptr->mem_info, nr_chips + 1,
-					 GFP_KERNEL);
+	pmu_ptr->mem_info = kzalloc_objs(*pmu_ptr->mem_info, nr_chips + 1);
 	if (!pmu_ptr->mem_info)
 		goto error;
 
diff --git a/arch/powerpc/platforms/powernv/opal-powercap.c b/arch/powerpc/platforms/powernv/opal-powercap.c
index 0e297d70647f..9bb73cb42a65 100644
--- a/arch/powerpc/platforms/powernv/opal-powercap.c
+++ b/arch/powerpc/platforms/powernv/opal-powercap.c
@@ -181,13 +181,11 @@ void __init opal_powercap_init(void)
 			has_cur = true;
 		}
 
-		pcaps[i].pattrs = kzalloc_objs(struct powercap_attr, j,
-					       GFP_KERNEL);
+		pcaps[i].pattrs = kzalloc_objs(struct powercap_attr, j);
 		if (!pcaps[i].pattrs)
 			goto out_pcaps_pattrs;
 
-		pcaps[i].pg.attrs = kzalloc_objs(struct attribute *, j + 1,
-						 GFP_KERNEL);
+		pcaps[i].pg.attrs = kzalloc_objs(struct attribute *, j + 1);
 		if (!pcaps[i].pg.attrs) {
 			kfree(pcaps[i].pattrs);
 			goto out_pcaps_pattrs;
diff --git a/arch/powerpc/platforms/powernv/opal-psr.c b/arch/powerpc/platforms/powernv/opal-psr.c
index 731d8b355343..24d0a894d965 100644
--- a/arch/powerpc/platforms/powernv/opal-psr.c
+++ b/arch/powerpc/platforms/powernv/opal-psr.c
@@ -132,8 +132,7 @@ void __init opal_psr_init(void)
 		return;
 	}
 
-	psr_attrs = kzalloc_objs(*psr_attrs, of_get_child_count(psr),
-				 GFP_KERNEL);
+	psr_attrs = kzalloc_objs(*psr_attrs, of_get_child_count(psr));
 	if (!psr_attrs)
 		goto out_put_psr;
 
diff --git a/arch/powerpc/platforms/powernv/opal-sensor-groups.c b/arch/powerpc/platforms/powernv/opal-sensor-groups.c
index 2a3474246908..87fd6d7769e9 100644
--- a/arch/powerpc/platforms/powernv/opal-sensor-groups.c
+++ b/arch/powerpc/platforms/powernv/opal-sensor-groups.c
@@ -190,13 +190,11 @@ void __init opal_sensor_groups_init(void)
 		if (!nr_attrs)
 			continue;
 
-		sgs[i].sgattrs = kzalloc_objs(*sgs[i].sgattrs, nr_attrs,
-					      GFP_KERNEL);
+		sgs[i].sgattrs = kzalloc_objs(*sgs[i].sgattrs, nr_attrs);
 		if (!sgs[i].sgattrs)
 			goto out_sgs_sgattrs;
 
-		sgs[i].sg.attrs = kzalloc_objs(*sgs[i].sg.attrs, nr_attrs + 1,
-					       GFP_KERNEL);
+		sgs[i].sg.attrs = kzalloc_objs(*sgs[i].sg.attrs, nr_attrs + 1);
 
 		if (!sgs[i].sg.attrs) {
 			kfree(sgs[i].sgattrs);
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index eba277134224..257886ec3f70 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1639,8 +1639,7 @@ void __init mpic_init(struct mpic *mpic)
 
 #ifdef CONFIG_PM
 	/* allocate memory to save mpic state */
-	mpic->save_data = kmalloc_objs(*mpic->save_data, mpic->num_sources,
-				       GFP_KERNEL);
+	mpic->save_data = kmalloc_objs(*mpic->save_data, mpic->num_sources);
 	BUG_ON(mpic->save_data == NULL);
 #endif
 
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c
index e9af4fa940b1..26f62ae5f671 100644
--- a/arch/powerpc/sysdev/mpic_msgr.c
+++ b/arch/powerpc/sysdev/mpic_msgr.c
@@ -188,8 +188,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
 		dev_info(&dev->dev, "Found %d message registers\n",
 				mpic_msgr_count);
 
-		mpic_msgrs = kzalloc_objs(*mpic_msgrs, mpic_msgr_count,
-					  GFP_KERNEL);
+		mpic_msgrs = kzalloc_objs(*mpic_msgrs, mpic_msgr_count);
 		if (!mpic_msgrs) {
 			dev_err(&dev->dev,
 				"No memory for message register blocks\n");
diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 7e3749131c59..9c2f5e442338 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -55,8 +55,7 @@ static void __init __vdso_init(struct __vdso_info *vdso_info)
 		vdso_info->vdso_code_start) >>
 		PAGE_SHIFT;
 
-	vdso_pagelist = kzalloc_objs(struct page *, vdso_info->vdso_pages,
-				     GFP_KERNEL);
+	vdso_pagelist = kzalloc_objs(struct page *, vdso_info->vdso_pages);
 	if (vdso_pagelist == NULL)
 		panic("vDSO kcalloc failed!\n");
 
diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c
index fc80495027ba..86d93e8dddae 100644
--- a/arch/s390/kvm/pci.c
+++ b/arch/s390/kvm/pci.c
@@ -126,8 +126,7 @@ int kvm_s390_pci_aen_init(u8 nisc)
 		return -EPERM;
 
 	mutex_lock(&aift->aift_lock);
-	aift->kzdev = kzalloc_objs(struct kvm_zdev *, ZPCI_NR_DEVICES,
-				   GFP_KERNEL);
+	aift->kzdev = kzalloc_objs(struct kvm_zdev *, ZPCI_NR_DEVICES);
 	if (!aift->kzdev) {
 		rc = -ENOMEM;
 		goto unlock;
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 0ae82e529c21..2a430722cbe4 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -1073,8 +1073,7 @@ static int zpci_mem_init(void)
 	if (!zdev_fmb_cache)
 		goto error_fmb;
 
-	zpci_iomap_start = kzalloc_objs(*zpci_iomap_start, ZPCI_IOMAP_ENTRIES,
-					GFP_KERNEL);
+	zpci_iomap_start = kzalloc_objs(*zpci_iomap_start, ZPCI_IOMAP_ENTRIES);
 	if (!zpci_iomap_start)
 		goto error_iomap;
 
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index 1e67082eb3b4..cbbb94d41fd0 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -558,8 +558,7 @@ static int __init sh7786_pcie_init(void)
 	if (unlikely(nr_ports == 0))
 		return -ENODEV;
 
-	sh7786_pcie_ports = kzalloc_objs(struct sh7786_pcie_port, nr_ports,
-					 GFP_KERNEL);
+	sh7786_pcie_ports = kzalloc_objs(struct sh7786_pcie_port, nr_ports);
 	if (unlikely(!sh7786_pcie_ports))
 		return -ENOMEM;
 
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 81f0be76f48a..371460e34484 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -297,8 +297,7 @@ static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg,
 	unsigned long hv_err;
 	int i;
 
-	hdesc = kzalloc_flex(*hdesc, maps, num_kernel_image_mappings,
-		             GFP_KERNEL);
+	hdesc = kzalloc_flex(*hdesc, maps, num_kernel_image_mappings);
 	if (!hdesc) {
 		printk(KERN_ERR "ldom_startcpu_cpuid: Cannot allocate "
 		       "hvtramp_descr.\n");
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 8d5e2d5c0bc5..ecefcffcf7b1 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -647,8 +647,7 @@ SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type,
 	}
 	if (!current_thread_info()->utraps) {
 		current_thread_info()->utraps =
-			kzalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1,
-				     GFP_KERNEL);
+			kzalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1);
 		if (!current_thread_info()->utraps)
 			return -ENOMEM;
 		current_thread_info()->utraps[0] = 1;
@@ -658,8 +657,7 @@ SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type,
 			unsigned long *p = current_thread_info()->utraps;
 
 			current_thread_info()->utraps =
-				kmalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1,
-					     GFP_KERNEL);
+				kmalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1);
 			if (!current_thread_info()->utraps) {
 				current_thread_info()->utraps = p;
 				return -ENOMEM;
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 5434c87542e5..2cc90055499a 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -544,11 +544,9 @@ static struct vector_queue *create_queue(
 	result->max_iov_frags = num_extra_frags;
 	for (i = 0; i < max_size; i++) {
 		if (vp->header_size > 0)
-			iov = kmalloc_objs(struct iovec, 3 + num_extra_frags,
-					   GFP_KERNEL);
+			iov = kmalloc_objs(struct iovec, 3 + num_extra_frags);
 		else
-			iov = kmalloc_objs(struct iovec, 2 + num_extra_frags,
-					   GFP_KERNEL);
+			iov = kmalloc_objs(struct iovec, 2 + num_extra_frags);
 		if (iov == NULL)
 			goto out_fail;
 		mmsg_vector->msg_hdr.msg_iov = iov;
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 069e6b788280..5ed6e0b7e715 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3753,8 +3753,7 @@ static int pmu_alloc_topology(struct intel_uncore_type *type, int topology_type)
 		goto err;
 
 	for (die = 0; die < uncore_max_dies(); die++) {
-		topology[die] = kzalloc_objs(**topology, type->num_boxes,
-					     GFP_KERNEL);
+		topology[die] = kzalloc_objs(**topology, type->num_boxes);
 		if (!topology[die])
 			goto clear;
 		for (idx = 0; idx < type->num_boxes; idx++) {
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index e945ed623027..323adc93f2dc 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -467,8 +467,7 @@ void __init hyperv_init(void)
 	if (hv_isolation_type_tdx())
 		hv_vp_assist_page = NULL;
 	else
-		hv_vp_assist_page = kzalloc_objs(*hv_vp_assist_page, nr_cpu_ids,
-						 GFP_KERNEL);
+		hv_vp_assist_page = kzalloc_objs(*hv_vp_assist_page, nr_cpu_ids);
 	if (!hv_vp_assist_page) {
 		ms_hyperv.hints &= ~HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
 
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 852e8ff5ebd9..5d364540673d 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -68,8 +68,7 @@ static int amd_cache_northbridges(void)
 
 	amd_northbridges.num = amd_num_nodes();
 
-	nb = kzalloc_objs(struct amd_northbridge, amd_northbridges.num,
-			  GFP_KERNEL);
+	nb = kzalloc_objs(struct amd_northbridge, amd_northbridges.num);
 	if (!nb)
 		return -ENOMEM;
 
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index 1021a4e33ac6..38b7fd2f63be 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -798,8 +798,7 @@ static bool __init sgx_page_cache_init(void)
 	int nid;
 	int i;
 
-	sgx_numa_nodes = kmalloc_objs(*sgx_numa_nodes, num_possible_nodes(),
-				      GFP_KERNEL);
+	sgx_numa_nodes = kmalloc_objs(*sgx_numa_nodes, num_possible_nodes());
 	if (!sgx_numa_nodes)
 		return false;
 
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c196aa0c1bd1..d2486506a808 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1991,8 +1991,7 @@ int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
 	if (sanity_check_entries(entries, cpuid->nent, type))
 		return -EINVAL;
 
-	array.entries = kvzalloc_objs(struct kvm_cpuid_entry2, cpuid->nent,
-				      GFP_KERNEL);
+	array.entries = kvzalloc_objs(struct kvm_cpuid_entry2, cpuid->nent);
 	if (!array.entries)
 		return -ENOMEM;
 
diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
index 8517d5fbf79c..d22cabe119b1 100644
--- a/arch/x86/kvm/vmx/tdx.c
+++ b/arch/x86/kvm/vmx/tdx.c
@@ -2218,8 +2218,7 @@ static int tdx_get_capabilities(struct kvm_tdx_cmd *cmd)
 	if (nr_user_entries < td_conf->num_cpuid_config)
 		return -E2BIG;
 
-	caps = kzalloc_flex(*caps, cpuid.entries, td_conf->num_cpuid_config,
-			    GFP_KERNEL);
+	caps = kzalloc_flex(*caps, cpuid.entries, td_conf->num_cpuid_config);
 	if (!caps)
 		return -ENOMEM;
 
diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c
index 9a05abe8d43f..24b8b1c40e25 100644
--- a/block/blk-crypto-fallback.c
+++ b/block/blk-crypto-fallback.c
@@ -546,8 +546,7 @@ static int blk_crypto_fallback_init(void)
 		goto out;
 
 	/* Dynamic allocation is needed because of lockdep_register_key(). */
-	blk_crypto_fallback_profile = kzalloc_obj(*blk_crypto_fallback_profile,
-						  GFP_KERNEL);
+	blk_crypto_fallback_profile = kzalloc_obj(*blk_crypto_fallback_profile);
 	if (!blk_crypto_fallback_profile) {
 		err = -ENOMEM;
 		goto fail_free_bioset;
diff --git a/block/blk-crypto-profile.c b/block/blk-crypto-profile.c
index 970880d9adf4..4ac74443687a 100644
--- a/block/blk-crypto-profile.c
+++ b/block/blk-crypto-profile.c
@@ -120,8 +120,7 @@ int blk_crypto_profile_init(struct blk_crypto_profile *profile,
 
 	profile->log_slot_ht_size = ilog2(slot_hashtable_size);
 	profile->slot_hashtable =
-		kvmalloc_objs(profile->slot_hashtable[0], slot_hashtable_size,
-			      GFP_KERNEL);
+		kvmalloc_objs(profile->slot_hashtable[0], slot_hashtable_size);
 	if (!profile->slot_hashtable)
 		goto err_destroy;
 	for (i = 0; i < slot_hashtable_size; i++)
diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
index a561674bac97..8c290ddd3251 100644
--- a/drivers/accel/amdxdna/amdxdna_gem.c
+++ b/drivers/accel/amdxdna/amdxdna_gem.c
@@ -210,8 +210,7 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
 		return -ENOMEM;
 
 	nr_pages = (PAGE_ALIGN(addr + len) - (addr & PAGE_MASK)) >> PAGE_SHIFT;
-	mapp->range.hmm_pfns = kvzalloc_objs(*mapp->range.hmm_pfns, nr_pages,
-					     GFP_KERNEL);
+	mapp->range.hmm_pfns = kvzalloc_objs(*mapp->range.hmm_pfns, nr_pages);
 	if (!mapp->range.hmm_pfns) {
 		ret = -ENOMEM;
 		goto free_map;
diff --git a/drivers/accel/ethosu/ethosu_drv.c b/drivers/accel/ethosu/ethosu_drv.c
index ae5e6b15e7de..9992193d7338 100644
--- a/drivers/accel/ethosu/ethosu_drv.c
+++ b/drivers/accel/ethosu/ethosu_drv.c
@@ -144,8 +144,7 @@ static int ethosu_open(struct drm_device *ddev, struct drm_file *file)
 	if (!try_module_get(THIS_MODULE))
 		return -EINVAL;
 
-	struct ethosu_file_priv __free(kfree) *priv = kzalloc_obj(*priv,
-								  GFP_KERNEL);
+	struct ethosu_file_priv __free(kfree) *priv = kzalloc_obj(*priv);
 	if (!priv) {
 		ret = -ENOMEM;
 		goto err_put_mod;
diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c
index cbd74e3adb9f..4fbd4bbf2909 100644
--- a/drivers/accel/ethosu/ethosu_gem.c
+++ b/drivers/accel/ethosu/ethosu_gem.c
@@ -352,8 +352,7 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev,
 						  struct ethosu_gem_object *bo,
 						  u32 size)
 {
-	struct ethosu_validated_cmdstream_info __free(kfree) *info = kzalloc_obj(*info,
-										 GFP_KERNEL);
+	struct ethosu_validated_cmdstream_info __free(kfree) *info = kzalloc_obj(*info);
 	struct ethosu_device *edev = to_ethosu_device(ddev);
 	u32 *bocmds = bo->base.vaddr;
 	struct cmd_state st;
diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c
index 6c896eb816de..ba4257bda77b 100644
--- a/drivers/accel/habanalabs/common/command_submission.c
+++ b/drivers/accel/habanalabs/common/command_submission.c
@@ -1422,8 +1422,7 @@ static int hl_cs_copy_chunk_array(struct hl_device *hdev,
 
 	*cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks, GFP_ATOMIC);
 	if (!*cs_chunk_array)
-		*cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks,
-					       GFP_KERNEL);
+		*cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks);
 	if (!*cs_chunk_array) {
 		atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
 		atomic64_inc(&hdev->aggregated_cs_counters.out_of_mem_drop_cnt);
diff --git a/drivers/accel/habanalabs/common/debugfs.c b/drivers/accel/habanalabs/common/debugfs.c
index 05b1cc7918c5..1d5e29fc6463 100644
--- a/drivers/accel/habanalabs/common/debugfs.c
+++ b/drivers/accel/habanalabs/common/debugfs.c
@@ -2052,8 +2052,7 @@ int hl_debugfs_device_init(struct hl_device *hdev)
 	int count = ARRAY_SIZE(hl_debugfs_list);
 
 	dev_entry->hdev = hdev;
-	dev_entry->entry_arr = kmalloc_objs(struct hl_debugfs_entry, count,
-					    GFP_KERNEL);
+	dev_entry->entry_arr = kmalloc_objs(struct hl_debugfs_entry, count);
 	if (!dev_entry->entry_arr)
 		return -ENOMEM;
 
diff --git a/drivers/accel/habanalabs/common/hw_queue.c b/drivers/accel/habanalabs/common/hw_queue.c
index d499063a79ec..f0ab99dd74d6 100644
--- a/drivers/accel/habanalabs/common/hw_queue.c
+++ b/drivers/accel/habanalabs/common/hw_queue.c
@@ -837,8 +837,7 @@ static int ext_and_cpu_queue_init(struct hl_device *hdev, struct hl_hw_queue *q,
 
 	q->kernel_address = p;
 
-	q->shadow_queue = kmalloc_objs(struct hl_cs_job *, HL_QUEUE_LENGTH,
-				       GFP_KERNEL);
+	q->shadow_queue = kmalloc_objs(struct hl_cs_job *, HL_QUEUE_LENGTH);
 	if (!q->shadow_queue) {
 		dev_err(hdev->dev,
 			"Failed to allocate shadow queue for H/W queue %d\n",
diff --git a/drivers/accel/habanalabs/common/mmu/mmu.c b/drivers/accel/habanalabs/common/mmu/mmu.c
index 1f8f7cf2d3fb..6c7c4ff8a8a9 100644
--- a/drivers/accel/habanalabs/common/mmu/mmu.c
+++ b/drivers/accel/habanalabs/common/mmu/mmu.c
@@ -843,8 +843,7 @@ int hl_mmu_hr_init(struct hl_device *hdev, struct hl_mmu_hr_priv *hr_priv, u32 h
 		return -ENOMEM;
 	}
 
-	hr_priv->mmu_asid_hop0 = kvzalloc_objs(struct pgt_info, prop->max_asid,
-					       GFP_KERNEL);
+	hr_priv->mmu_asid_hop0 = kvzalloc_objs(struct pgt_info, prop->max_asid);
 	if (ZERO_OR_NULL_PTR(hr_priv->mmu_asid_hop0)) {
 		dev_err(hdev->dev, "Failed to allocate hr-mmu hop0 table\n");
 		rc = -ENOMEM;
diff --git a/drivers/accel/habanalabs/common/security.c b/drivers/accel/habanalabs/common/security.c
index 8a0da0194cab..abe5ed0d405a 100644
--- a/drivers/accel/habanalabs/common/security.c
+++ b/drivers/accel/habanalabs/common/security.c
@@ -312,8 +312,7 @@ int hl_init_pb_with_mask(struct hl_device *hdev, u32 num_dcores,
 	int i, j;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
@@ -392,8 +391,7 @@ int hl_init_pb_ranges_with_mask(struct hl_device *hdev, u32 num_dcores,
 	int i, j, rc = 0;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
@@ -474,8 +472,7 @@ int hl_init_pb_single_dcore(struct hl_device *hdev, u32 dcore_offset,
 	int i, rc = 0;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
@@ -521,8 +518,7 @@ int hl_init_pb_ranges_single_dcore(struct hl_device *hdev, u32 dcore_offset,
 	int i;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2_security.c b/drivers/accel/habanalabs/gaudi2/gaudi2_security.c
index f4f8f9122f5c..ea3a0e57c836 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2_security.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2_security.c
@@ -2620,8 +2620,7 @@ static int gaudi2_init_pb_tpc(struct hl_device *hdev)
 
 	block_array_size = ARRAY_SIZE(gaudi2_pb_dcr0_tpc0);
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, block_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, block_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
diff --git a/drivers/accel/qaic/qaic_ssr.c b/drivers/accel/qaic/qaic_ssr.c
index e3daeaad057d..a5bb6078824b 100644
--- a/drivers/accel/qaic/qaic_ssr.c
+++ b/drivers/accel/qaic/qaic_ssr.c
@@ -457,8 +457,7 @@ static struct ssr_dump_info *alloc_dump_info(struct qaic_device *qdev,
 	}
 
 	/* Buffer used to send MEMORY READ request to device via MHI */
-	dump_info->read_buf_req = kzalloc_obj(*dump_info->read_buf_req,
-					      GFP_KERNEL);
+	dump_info->read_buf_req = kzalloc_obj(*dump_info->read_buf_req);
 	if (!dump_info->read_buf_req) {
 		ret = -ENOMEM;
 		goto free_dump_info;
diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c
index 751697899a98..a9248af078f6 100644
--- a/drivers/acpi/apei/einj-core.c
+++ b/drivers/acpi/apei/einj-core.c
@@ -1021,8 +1021,7 @@ static bool setup_einjv2_component_files(void)
 {
 	char name[32];
 
-	syndrome_data = kzalloc_objs(syndrome_data[0], max_nr_components,
-				     GFP_KERNEL);
+	syndrome_data = kzalloc_objs(syndrome_data[0], max_nr_components);
 	if (!syndrome_data)
 		return false;
 
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 5c2116171789..f0e513e9ed5d 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -636,8 +636,7 @@ static int pcc_data_alloc(int pcc_ss_id)
 	if (pcc_data[pcc_ss_id]) {
 		pcc_data[pcc_ss_id]->refcount++;
 	} else {
-		pcc_data[pcc_ss_id] = kzalloc_obj(struct cppc_pcc_data,
-						  GFP_KERNEL);
+		pcc_data[pcc_ss_id] = kzalloc_obj(struct cppc_pcc_data);
 		if (!pcc_data[pcc_ss_id])
 			return -ENOMEM;
 		pcc_data[pcc_ss_id]->refcount++;
diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c
index 328093ed7136..ea4bffe3c02d 100644
--- a/drivers/acpi/mipi-disco-img.c
+++ b/drivers/acpi/mipi-disco-img.c
@@ -91,8 +91,7 @@ static acpi_status parse_csi2_resource(struct acpi_resource *res, void *context)
 		return AE_OK;
 	}
 
-	conn = kmalloc_flex(*conn, remote_name, csi2_res_src_length + 1,
-			    GFP_KERNEL);
+	conn = kmalloc_flex(*conn, remote_name, csi2_res_src_length + 1);
 	if (!conn)
 		return AE_OK;
 
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index bd4d332520bb..79d2e92e5c28 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -560,8 +560,7 @@ struct device *platform_profile_register(struct device *dev, const char *name,
 	    !ops->profile_set || !ops->probe))
 		return ERR_PTR(-EINVAL);
 
-	struct platform_profile_handler *pprof __free(kfree) = kzalloc_obj(*pprof,
-									   GFP_KERNEL);
+	struct platform_profile_handler *pprof __free(kfree) = kzalloc_obj(*pprof);
 	if (!pprof)
 		return ERR_PTR(-ENOMEM);
 
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index f1c7c2ad5094..fdf55c285c9a 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -341,8 +341,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
 
 	pr->performance->state_count = pss->package.count;
 	pr->performance->states =
-	    kmalloc_objs(struct acpi_processor_px, pss->package.count,
-			 GFP_KERNEL);
+	    kmalloc_objs(struct acpi_processor_px, pss->package.count);
 	if (!pr->performance->states) {
 		result = -ENOMEM;
 		goto end;
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 2d398ae5c662..c0f92b93747d 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -512,8 +512,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
 
 	pr->throttling.state_count = tss->package.count;
 	pr->throttling.states_tss =
-	    kmalloc_objs(struct acpi_processor_tx_tss, tss->package.count,
-			 GFP_KERNEL);
+	    kmalloc_objs(struct acpi_processor_tx_tss, tss->package.count);
 	if (!pr->throttling.states_tss) {
 		result = -ENOMEM;
 		goto end;
diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c
index c1f759fb5758..afffde4cfe7a 100644
--- a/drivers/acpi/riscv/irq.c
+++ b/drivers/acpi/riscv/irq.c
@@ -384,8 +384,7 @@ static u32 riscv_acpi_add_irq_dep(acpi_handle handle)
 	     riscv_acpi_irq_get_dep(handle, i, &gsi_handle);
 	     i++) {
 		dep_devices.count = 1;
-		dep_devices.handles = kzalloc_objs(*dep_devices.handles, 1,
-						   GFP_KERNEL);
+		dep_devices.handles = kzalloc_objs(*dep_devices.handles, 1);
 		if (!dep_devices.handles) {
 			acpi_handle_err(handle, "failed to allocate memory\n");
 			continue;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a6f453d4785b..dfdd004fb1a9 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -757,8 +757,7 @@ int acpi_device_add(struct acpi_device *device)
 		if (result)
 			goto err_unlock;
 	} else {
-		acpi_device_bus_id = kzalloc_obj(*acpi_device_bus_id,
-						 GFP_KERNEL);
+		acpi_device_bus_id = kzalloc_obj(*acpi_device_bus_id);
 		if (!acpi_device_bus_id) {
 			result = -ENOMEM;
 			goto err_unlock;
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 12c3a0330f67..f37247e7a5cb 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -594,8 +594,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
 	 * We cannot use devm_ here, since ahci_platform_put_resources() uses
 	 * target_pwrs after devm_ have freed memory
 	 */
-	hpriv->target_pwrs = kzalloc_objs(*hpriv->target_pwrs, hpriv->nports,
-					  GFP_KERNEL);
+	hpriv->target_pwrs = kzalloc_objs(*hpriv->target_pwrs, hpriv->nports);
 	if (!hpriv->target_pwrs) {
 		rc = -ENOMEM;
 		goto err_out;
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 8108ef0c089a..bb9cb00f9585 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -786,8 +786,7 @@ static int he_init_group(struct he_dev *he_dev, int group)
 	}
 
 	/* rbpl_virt 64-bit pointers */
-	he_dev->rbpl_virt = kmalloc_objs(*he_dev->rbpl_virt, RBPL_TABLE_SIZE,
-					 GFP_KERNEL);
+	he_dev->rbpl_virt = kmalloc_objs(*he_dev->rbpl_virt, RBPL_TABLE_SIZE);
 	if (!he_dev->rbpl_virt) {
 		hprintk("unable to allocate rbpl virt table\n");
 		goto out_free_rbpl_table;
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index b90761dcd87f..0d38e93772c2 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -1978,8 +1978,7 @@ static int tx_init(struct atm_dev *dev)
 		buf_desc_ptr++;		  
 		tx_pkt_start += iadev->tx_buf_sz;  
 	}  
-	iadev->tx_buf = kmalloc_objs(*iadev->tx_buf, iadev->num_tx_desc,
-				     GFP_KERNEL);
+	iadev->tx_buf = kmalloc_objs(*iadev->tx_buf, iadev->num_tx_desc);
         if (!iadev->tx_buf) {
             printk(KERN_ERR DEV_LABEL " couldn't get mem\n");
 	    goto err_free_dle;
@@ -1999,8 +1998,7 @@ static int tx_init(struct atm_dev *dev)
 						       sizeof(*cpcs),
 						       DMA_TO_DEVICE);
         }
-	iadev->desc_tbl = kmalloc_objs(*iadev->desc_tbl, iadev->num_tx_desc,
-				       GFP_KERNEL);
+	iadev->desc_tbl = kmalloc_objs(*iadev->desc_tbl, iadev->num_tx_desc);
 	if (!iadev->desc_tbl) {
 		printk(KERN_ERR DEV_LABEL " couldn't get mem\n");
 		goto err_free_all_tx_bufs;
@@ -2128,8 +2126,7 @@ static int tx_init(struct atm_dev *dev)
 	memset((caddr_t)(iadev->seg_ram+i),  0, iadev->num_vc*4);
 	vc = (struct main_vc *)iadev->MAIN_VC_TABLE_ADDR;  
 	evc = (struct ext_vc *)iadev->EXT_VC_TABLE_ADDR;  
-	iadev->testTable = kmalloc_objs(*iadev->testTable, iadev->num_vc,
-					GFP_KERNEL);
+	iadev->testTable = kmalloc_objs(*iadev->testTable, iadev->num_vc);
         if (!iadev->testTable) {
            printk("Get freepage  failed\n");
 	   goto err_free_desc_tbl;
@@ -2138,8 +2135,7 @@ static int tx_init(struct atm_dev *dev)
 	{  
 		memset((caddr_t)vc, 0, sizeof(*vc));  
 		memset((caddr_t)evc, 0, sizeof(*evc));  
-                iadev->testTable[i] = kmalloc_obj(struct testTable_t,
-						  GFP_KERNEL);
+                iadev->testTable[i] = kmalloc_obj(struct testTable_t);
 		if (!iadev->testTable[i])
 			goto err_free_test_tables;
               	iadev->testTable[i]->lastTime = 0;
diff --git a/drivers/base/physical_location.c b/drivers/base/physical_location.c
index 06a2797e0213..2e723fff6e8a 100644
--- a/drivers/base/physical_location.c
+++ b/drivers/base/physical_location.c
@@ -21,8 +21,7 @@ bool dev_add_physical_location(struct device *dev)
 	if (!acpi_get_physical_device_location(ACPI_HANDLE(dev), &pld))
 		return false;
 
-	dev->physical_location = kzalloc_obj(*dev->physical_location,
-					     GFP_KERNEL);
+	dev->physical_location = kzalloc_obj(*dev->physical_location);
 	if (!dev->physical_location) {
 		ACPI_FREE(pld);
 		return false;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index c2dd784bc14b..3cfef456a1f3 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3932,8 +3932,7 @@ static int receive_sizes(struct drbd_connection *connection, struct packet_info
 		if (my_usize != p_usize) {
 			struct disk_conf *old_disk_conf, *new_disk_conf = NULL;
 
-			new_disk_conf = kzalloc_obj(struct disk_conf,
-						    GFP_KERNEL);
+			new_disk_conf = kzalloc_obj(struct disk_conf);
 			if (!new_disk_conf) {
 				put_ldev(device);
 				return -ENOMEM;
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 7844424f7b17..41cc8cefea01 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -401,8 +401,7 @@ static int ps3vram_cache_init(struct ps3_system_bus_device *dev)
 
 	priv->cache.page_count = CACHE_PAGE_COUNT;
 	priv->cache.page_size = CACHE_PAGE_SIZE;
-	priv->cache.tags = kzalloc_objs(struct ps3vram_tag, CACHE_PAGE_COUNT,
-					GFP_KERNEL);
+	priv->cache.tags = kzalloc_objs(struct ps3vram_tag, CACHE_PAGE_COUNT);
 	if (!priv->cache.tags)
 		return -ENOMEM;
 
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index bc665b8abd7b..7871099bc0d4 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -846,8 +846,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring,
 			 * We are using persistent grants, the grant is
 			 * not mapped but we might have room for it.
 			 */
-			persistent_gnt = kmalloc_obj(struct persistent_gnt,
-						     GFP_KERNEL);
+			persistent_gnt = kmalloc_obj(struct persistent_gnt);
 			if (!persistent_gnt) {
 				/*
 				 * If we don't have enough memory to
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index adfd61af86ee..4b865ef800b1 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -131,8 +131,7 @@ static int xen_blkif_alloc_rings(struct xen_blkif *blkif)
 {
 	unsigned int r;
 
-	blkif->rings = kzalloc_objs(struct xen_blkif_ring, blkif->nr_rings,
-				    GFP_KERNEL);
+	blkif->rings = kzalloc_objs(struct xen_blkif_ring, blkif->nr_rings);
 	if (!blkif->rings)
 		return -ENOMEM;
 
@@ -1014,14 +1013,12 @@ static int read_per_ring_refs(struct xen_blkif_ring *ring, const char *dir)
 			goto fail;
 		list_add_tail(&req->free_list, &ring->pending_free);
 		for (j = 0; j < MAX_INDIRECT_SEGMENTS; j++) {
-			req->segments[j] = kzalloc_obj(*req->segments[0],
-						       GFP_KERNEL);
+			req->segments[j] = kzalloc_obj(*req->segments[0]);
 			if (!req->segments[j])
 				goto fail;
 		}
 		for (j = 0; j < MAX_INDIRECT_PAGES; j++) {
-			req->indirect_pages[j] = kzalloc_obj(*req->indirect_pages[0],
-							     GFP_KERNEL);
+			req->indirect_pages[j] = kzalloc_obj(*req->indirect_pages[0]);
 			if (!req->indirect_pages[j])
 				goto fail;
 		}
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 777a5ae0cd33..8fc7fc3bf867 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2207,8 +2207,7 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo)
 
 	for (i = 0; i < BLK_RING_SIZE(info); i++) {
 		rinfo->shadow[i].grants_used =
-			kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants,
-				      GFP_KERNEL);
+			kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants);
 		rinfo->shadow[i].sg = kvzalloc_objs(rinfo->shadow[i].sg[0],
 						    psegs, GFP_KERNEL);
 		if (info->max_indirect_segments)
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index e12abdec2647..b216cba1c3bf 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -187,8 +187,7 @@ static int z2_open(struct gendisk *disk, blk_mode_t mode)
 			    (unsigned long)z_remap_nocache_nonser(paddr, size);
 #endif
 			z2ram_map =
-			    kmalloc_objs(z2ram_map[0], size / Z2RAM_CHUNKSIZE,
-					 GFP_KERNEL);
+			    kmalloc_objs(z2ram_map[0], size / Z2RAM_CHUNKSIZE);
 			if (z2ram_map == NULL) {
 				printk(KERN_ERR DEVICE_NAME
 				       ": cannot get mem for z2ram_map\n");
diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index a27261914bd1..879b8b706428 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -1459,8 +1459,7 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
 	if (ret)
 		return ret;
 
-	mhi_cntrl->mhi_cmd = kzalloc_objs(*mhi_cntrl->mhi_cmd, NR_OF_CMD_RINGS,
-					  GFP_KERNEL);
+	mhi_cntrl->mhi_cmd = kzalloc_objs(*mhi_cntrl->mhi_cmd, NR_OF_CMD_RINGS);
 	if (!mhi_cntrl->mhi_cmd) {
 		ret = -ENOMEM;
 		goto err_free_ch;
diff --git a/drivers/bus/mhi/host/boot.c b/drivers/bus/mhi/host/boot.c
index 7845fc7fe6c2..f16a1e67a667 100644
--- a/drivers/bus/mhi/host/boot.c
+++ b/drivers/bus/mhi/host/boot.c
@@ -380,8 +380,7 @@ int mhi_alloc_bhie_table(struct mhi_controller *mhi_cntrl,
 		return -ENOMEM;
 
 	/* Allocate memory for entries */
-	img_info->mhi_buf = kzalloc_objs(*img_info->mhi_buf, segments,
-					 GFP_KERNEL);
[Output truncated: showing 1000 of 15164 lines]]

165/4 2026/10/13 22:55 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 63160
							output: 36
							thoughts: 1309
						

Thoughts:
**Analyzing Potential Memory Allocation Issues in DRM Lease Handling**

Okay, Linus just mass-converted `kcalloc` to `kzalloc_objs`. Interesting. I need to dive into this change to understand any potential implications. Before this commit, it was using the older `kzalloc_objs` function with a `struct drm_mode_object *` pointer and `object_count` as an argument. I see it's now used in `fill_object_idr`.

My initial thought is to examine situations with a large `object_count`. Let's look at `drm_mode_create_lease_ioctl`. I see `object_count` is passed. A critical piece to examine is how `object_ids` is allocated using `memdup_array_user`. This uses `kmalloc`, and when `object_count` becomes large, say 1,000,000, and we are allocating `__u32` elements, this could trigger issues if the allocated size grows. It looks like `memdup_array_user` allocates this data with `kmalloc`. So a large `object_count` might result in a substantial allocation, in the example of 1,000,000 elements * 4 bytes each equals 4MB, which is fine.

However, in `fill_object_idr`, `objects` is allocated using `kzalloc_objs`, which allocates an array of `struct drm_mode_object *` pointers. And a `struct drm_mode_object *` is 8 bytes. With `object_count` being 1,000,000, that is 8,000,000 bytes or 8MB. Because it uses `GFP_KERNEL` without the `__GFP_NOWARN` flag, this could trigger a warning from the kernel's memory allocation subsystem.

Wait, what if `vmemdup_array_user` was used instead? That's interesting! If `object_ids` were allocated using that instead, then it will use `vmalloc()`. And that will also change how we free the data. I'll need to confirm that `kvfree` can correctly free memory allocated by `vmemdup_array_user`. The documentation confirms this: use `kvfree()` to free this memory. Then, `objects` should use `kvzalloc_objs` instead, which is followed by `kvfree(objects)`. This seems to be a significant optimization here, avoiding the order 11 allocation limit in the kernel.

Now, let's consider extremely large `object_count` values. What if `object_count` is, say, 500,000,000?  That would translate to 4,000,000,000 bytes (4GB) for the `objects` array alone! This exceeds the maximum size allowed in `__kvmalloc_node_noprof` and will trigger a warning. With a large `size > INT_MAX` the `WARN_ON_ONCE` in `__kvmalloc_node_noprof()` will trigger because the call passes `GFP_KERNEL`. What about the `vmemdup_array_user` case? What about `kmem_buckets_valloc`? I will need to look into this more closely.



166/4 2026/10/13 22:55 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/util.c Name:kmem_buckets_valloc]

Results:
map[SourceCode: SourceFile:]

167/4 2026/10/13 22:55 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 65249
							output: 21
							thoughts: 14
						

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

**Analyzing Memory Allocation**

Alright, time to get to the root of this memory issue. My immediate instinct is to dive into the kernel memory allocation details. Since I'm thinking about memory buckets, I'm going to reach for `grep` and search for the `kmem_buckets_valloc` function. This function's name suggests it's involved in virtual allocation related to those buckets, making it a likely candidate for pinpointing memory leaks or inefficiencies within that specific subsystem. This is my starting point to understand the allocation behavior and pinpoint anything unusual.



168/4 2026/10/13 22:55 tool grepper
0m Args:
map[Expression:kmem_buckets_valloc]

Results:
map[Output:include/linux/slab.h=1352=void *kvmalloc_node(size_t size, gfp_t flags, int node);
--
include/linux/slab.h-1362-
include/linux/slab.h:1363:#define kmem_buckets_valloc(_b, _size, _flags)	\
include/linux/slab.h-1364-	alloc_hooks(__kvmalloc_node_noprof(PASS_KMALLOC_PARAMS(_size, _b, __kmalloc_token(_size)), 1, _flags, NUMA_NO_NODE))
--
mm/util.c=243=void *vmemdup_user(const void __user *src, size_t len)
--
mm/util.c-246-
mm/util.c:247:	p = kmem_buckets_valloc(user_buckets, len, GFP_USER);
mm/util.c-248-	if (!p)
]

169/4 2026/10/13 22:55 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 65678
							output: 30
							thoughts: 2154
						

Thoughts:
**Analysis of Potential Integer Overflow Vulnerability in DRM Lease Handling**

Okay, so I've been digging into this potential integer overflow issue related to the DRM lease functionality. My initial thought was: Hmm, that `kmem_buckets_valloc` call with `GFP_USER` is concerning. Since `GFP_USER` doesn't include `__GFP_NOWARN`, a large `len` exceeding `INT_MAX` could trigger a warning in `__kvmalloc_node_noprof`, potentially in `vmemdup_user` or `vmemdup_array_user` if used later. Similarly, allocations with `kvzalloc_objs` (using `GFP_KERNEL`) could also warn on oversized `size`.

My immediate question was why would such a large `object_count` even be permitted? I went back to the summary, and the proposed fix highlights three key points: switching `kvzalloc_objs` and `kvfree` in `fill_object_idr`, adding a sanity check to `drm_mode_create_lease_ioctl` and optionally using `vmemdup_array_user` for graceful fallback.

So, I started examining the relevant functions to see what's actually happening. In `fill_object_idr` and `validate_lease`, `object_count` is an `int` right now! This means the code *should* be safe. But then, I looked at `drm_mode_create_lease_ioctl`, where `object_count` comes from `cl->object_count`, which is a `__u32`. This implies a potential size mismatch.

If `object_count > INT_MAX / sizeof(struct drm_mode_object *)`, we could run into issues. On a 64-bit system, that limit is roughly 268 million, which is still within `INT_MAX`, and on 32-bit systems, the limit is 536 million, also within `INT_MAX`. Since `INT_MAX / sizeof(...)` is always < `INT_MAX`, and `object_count` will then fit within an `int`, we can proceed with a sanity check.

My train of thought then turned to where the best place is to add this check. I observed that `object_count` is first inspected in the `drm_mode_create_lease_ioctl` function. And while `object_count` *can* be zero (for an empty lease as the documentation states), I need to be sure that the check is implemented correctly.

So, after considering the need to call `drm_master_put` on error and checking other DRM ioctls for integer check idioms, I'm confident that adding the bounds check *before* the `drm_file_get_master` call is the best approach. This prevents any unnecessary resource allocation if the `object_count` is out of bounds and results in an earlier return. So, something like:

```c
	object_count = cl->object_count;
	if (object_count > INT_MAX / sizeof(struct drm_mode_object *))
		return -EINVAL;
```

It is worth noting that we can check `cl->object_count` before `drm_file_get_master`.
This is a good, safe approach. Now, I'll review other DRM ioctls for this integer check idiom.



170/4 2026/10/13 22:56 tool grepper
0m Args:
map[Expression:INT_MAX / PathPrefixes:[drivers/gpu/drm]]

Results:
map[Output:drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c=1028=int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c-1123-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:1124:		if (args->num_entries > INT_MAX / sizeof(*vm_entries)) {
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c-1125-			r = -EINVAL;
--
drivers/gpu/drm/tests/drm_format_test.c=225=static void drm_test_format_min_pitch_two_plane(struct kunit *test)
--
drivers/gpu/drm/tests/drm_format_test.c-251-			(uint64_t)UINT_MAX);
drivers/gpu/drm/tests/drm_format_test.c:252:	KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 1, UINT_MAX / 2 + 1),
drivers/gpu/drm/tests/drm_format_test.c-253-			(uint64_t)UINT_MAX + 1);
--
drivers/gpu/drm/tests/drm_format_test.c=260=static void drm_test_format_min_pitch_three_plane_8bpp(struct kunit *test)
--
drivers/gpu/drm/tests/drm_format_test.c-294-			(uint64_t)UINT_MAX);
drivers/gpu/drm/tests/drm_format_test.c:295:	KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 1, UINT_MAX / 2 + 1),
drivers/gpu/drm/tests/drm_format_test.c:296:			(uint64_t)UINT_MAX / 2 + 1);
drivers/gpu/drm/tests/drm_format_test.c:297:	KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 2, UINT_MAX / 2 + 1),
drivers/gpu/drm/tests/drm_format_test.c:298:			(uint64_t)UINT_MAX / 2 + 1);
drivers/gpu/drm/tests/drm_format_test.c-299-	KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 0, (UINT_MAX - 1) / 2),
--
drivers/gpu/drm/tests/drm_framebuffer_test.c=34=static const struct drm_framebuffer_test drm_framebuffer_create_cases[] = {
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-87-	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
drivers/gpu/drm/tests/drm_framebuffer_test.c:88:		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-89-		 .pitches = { 4 * MAX_WIDTH, 0, 0 },
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-98-	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
drivers/gpu/drm/tests/drm_framebuffer_test.c:99:		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, UINT_MAX / 2, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-100-		 .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS,
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-105-	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
drivers/gpu/drm/tests/drm_framebuffer_test.c:106:		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-107-		 .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_INVALID,
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-111-	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
drivers/gpu/drm/tests/drm_framebuffer_test.c:112:		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-113-		 .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS,
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-117-	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
drivers/gpu/drm/tests/drm_framebuffer_test.c:118:		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-119-		 .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS,
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-125-	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
drivers/gpu/drm/tests/drm_framebuffer_test.c:126:		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-127-		 .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS,
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-132-	.cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888,
drivers/gpu/drm/tests/drm_framebuffer_test.c:133:		 .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-134-		 .pitches = { 4 * MAX_WIDTH, 4 * MAX_WIDTH, 0 },
--
drivers/gpu/drm/tests/drm_framebuffer_test.c=423=static void drm_test_framebuffer_modifiers_not_supported(struct kunit *test)
--
drivers/gpu/drm/tests/drm_framebuffer_test.c-432-		.pixel_format = DRM_FORMAT_ABGR8888, .handles = { 1, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c:433:		.offsets = { UINT_MAX / 2, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 },
drivers/gpu/drm/tests/drm_framebuffer_test.c-434-		.flags = DRM_MODE_FB_MODIFIERS,
--
drivers/gpu/drm/vc4/vc4_gem.c=735=vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
--
drivers/gpu/drm/vc4/vc4_gem.c-753-	    exec_size < uniforms_offset ||
drivers/gpu/drm/vc4/vc4_gem.c:754:	    args->shader_rec_count >= (UINT_MAX /
drivers/gpu/drm/vc4/vc4_gem.c-755-					  sizeof(struct vc4_shader_state)) ||
]

171/4 2026/10/13 22:56 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 70786
							output: 33
							thoughts: 50
						

Thoughts:
Okay, let's dive into this. I need to get a handle on how array counts are validated and how data is copied from user space within the DRM subsystem. My initial thought is to see how other parts of the code base handle this safely, to avoid introducing any vulnerabilities, so let's start with a code-based exploration.

**DRM Array Count Validation and User Space Data Copy**

My immediate plan is to understand existing practices within `drivers/gpu/drm/`. I'm going to leverage my existing knowledge to see if I can find examples. Specifically, I'm going to search for instances of `vmemdup_array_user` within that directory, as that function is likely to be a key element for secure user space data transfer. Finding existing usages of `vmemdup_array_user` is the first place to start.



172/4 2026/10/13 22:56 tool grepper
0m Args:
map[Expression:vmemdup_array_user PathPrefixes:[drivers/gpu/drm]]

Results:
map[Output:drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c=164=amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-174-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c:175:	return vmemdup_array_user(uptr, bo_number,
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-176-				  sizeof(struct drm_amdgpu_bo_list_entry));
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c=179=static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-219-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:220:		p->chunks[i].kdata = vmemdup_array_user(u64_to_user_ptr(user_chunk.chunk_data),
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-221-							size,
--
drivers/gpu/drm/drm_gem.c=832=int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
--
drivers/gpu/drm/drm_gem.c-847-
drivers/gpu/drm/drm_gem.c:848:	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
drivers/gpu/drm/drm_gem.c-849-	if (IS_ERR(handles)) {
]

173/4 2026/10/13 22:56 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 71526
							output: 47
							thoughts: 3830
						

Thoughts:
**Analysis of a Potential Integer Overflow Vulnerability in DRM Lease Handling**

Okay, so I've been digging into this potential integer overflow vulnerability in the DRM lease code, specifically within `drm_mode_create_lease_ioctl`. The core issue stems from how the code handles a user-provided `object_count` when allocating memory for a list of DRM mode objects. It seems if the `object_count` is large enough, and particularly when multiplied by the size of a mode object, we can hit an integer overflow.  This can then lead to a `WARN_ON_ONCE` within the kernel or out-of-bounds memory accesses when `vmemdup_array_user` or `kvzalloc_objs` are called.

I started by looking at `drm_gem_objects_lookup`, which gives a good example of how memory is freed after allocation using `kvfree`. This quickly led me to investigate the code in `drm_lease.c`, especially the use of `memdup_array_user`. I realized it's replaced with `vmemdup_array_user` which calls `__kvmalloc_node_noprof` which has the size check.  If the allocated memory size is larger than `INT_MAX`, there's a kernel warning. This also holds true for `kvzalloc_objs`.

Then the thought occurred that we needed to add a check for the size *before* the allocations. My first instinct was to check if `object_count > INT_MAX / sizeof(struct drm_mode_object *)`. I figured, if we check for an overflow *before* the multiplication, we're guaranteed to avoid exceeding INT_MAX during the multiplication. Then the question became whether `sizeof(struct drm_mode_object *)` or `sizeof(__u32)` is the right check. Since the object size is guaranteed to be larger than `__u32`, `sizeof(struct drm_mode_object *)` is the right choice.

The next question was where to put the check. It's best to place the check early. Reading the code, I realized this check could and *should* be done *before* calling `drm_file_get_master`, which is the first function after the arguments have been set.  This avoids acquiring unnecessary references if the arguments are invalid. We want to catch the potentially invalid `object_count` *before* getting any master references.

So, the optimal fix involves: 1) adding a check for `object_count > INT_MAX / sizeof(struct drm_mode_object *)` right at the start of `drm_mode_create_lease_ioctl`, immediately after the flag checks.  This check ensures that a large `object_count` doesn't lead to a memory allocation that overflows INT_MAX and triggers a kernel warning.  It's cleaner, more efficient, and prevents resource acquisition if the argument is out-of-bounds.



174/4 2026/10/13 22:56 tool codesearch-find-references
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c IncludeSnippetLines:1 Name:fill_object_idr]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:drm_mode_create_lease_ioctl SourceFile:drivers/gpu/drm/drm_lease.c SourceLine:521 SourceSnippet: 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
]] TruncatedOutput:false]

175/4 2026/10/13 22:56 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 76168
							output: 35
							thoughts: 3719
						

Thoughts:
**Analysis of `drm_mode_create_lease_ioctl` and Related Functions**

Okay, so I'm digging into `drm_mode_create_lease_ioctl` and its supporting functions, specifically `fill_object_idr` and `validate_lease`. It seems there's a type mismatch issue. The primary entry point, `drm_mode_create_lease_ioctl`, uses `size_t object_count` which is derived from `cl->object_count`, where `cl->object_count` is a `__u32`. This `object_count` is then passed to `fill_object_idr`. Inside `fill_object_idr`, however, `object_count` is declared as an `int`. This discrepancy causes some serious concern.

My initial thought was that a `size_t` would be more appropriate for `fill_object_idr` given that's what's passed down from the ioctl. However, I need to ensure there are no unintended consequences. The current code has the loop variable `o` declared as `u32 o;` inside `fill_object_idr`, and `int o;` inside `validate_lease`. So, if I change it to `size_t object_count`, I'd also have to change `o` to `size_t o;` to avoid potential sign comparison warnings. I also need to make sure I don't introduce any overflow issues if `object_count` is large.

Then, I remember there's a historical patch related to `kvzalloc_objs` and `kvfree` in `fill_object_idr`. I re-read the context, and it suggests a bounds check and potentially `vmemdup_array_user` as a replacement for `memdup_array_user`. I'm concerned that `memdup_array_user` allocates with `kmalloc`, but `kvzalloc_objs` uses `vmalloc` if the requested size exceeds a limit. This could cause `kvfree` and `kfree` mismatches. Since `vmemdup_array_user` can also fall back to vmalloc, I should be using `kvfree`.

Thinking about this, I need to consider the current constraints. `cl->object_count` is `__u32`. This is used to calculate the size of an array with `object_count` elements of type `struct drm_mode_object *`. Now, even if `cl->object_count` is `0xFFFFFFFF` (the maximum value of a 32-bit unsigned integer), the resulting size will fit in `INT_MAX`, provided the size of `struct drm_mode_object *` is a reasonable value. Therefore, I can actually keep the code as is. I can simply add a check that `cl->object_count` does not exceed `INT_MAX / sizeof(void*)`. Because `memdup_array_user` can return `ERR_PTR`, it does not actually *need* to be changed to `vmemdup_array_user`. If it *is* changed, then `kvfree` must be used.

Also, I checked `drm_gem_objects_lookup`, which has `int count`. If `drm_mode_create_lease_ioctl` calls `drm_gem_objects_lookup`, then a `size_t object_count` needs to be `int count` anyway.

So, adding a bounds check in `drm_mode_create_lease_ioctl` to ensure `object_count` doesn't exceed `INT_MAX / sizeof(void *)` is sufficient. This fixes the original issue and any potential integer overflow issues. And it keeps existing type constraints in `fill_object_idr` and related functions. There is no need to switch `memdup_array_user` to `vmemdup_array_user` at this time, though the option does remain open.



176/4 2026/10/13 22:57 tool grepper
0m Args:
map[Expression:alloc|dup PathPrefixes:[drivers/gpu/drm/drm_lease.c]]

Results:
map[Output:drivers/gpu/drm/drm_lease.c=154=uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in)
--
drivers/gpu/drm/drm_lease.c-196-/*
drivers/gpu/drm/drm_lease.c:197: * Uses drm_master_create to allocate a new drm_master, then checks to
drivers/gpu/drm/drm_lease.c-198- * make sure all of the desired objects can be leased, atomically
--
drivers/gpu/drm/drm_lease.c-204- *	ERR_PTR(-EEXIST)	same object specified more than once in the provided list
drivers/gpu/drm/drm_lease.c:205: *	ERR_PTR(-ENOMEM)	allocation failed
drivers/gpu/drm/drm_lease.c-206- */
drivers/gpu/drm/drm_lease.c=207=static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr *leases)
--
drivers/gpu/drm/drm_lease.c-239-	/* Insert the new lessee into the tree */
drivers/gpu/drm/drm_lease.c:240:	id = idr_alloc(&(drm_lease_owner(lessor)->lessee_idr), lessee, 1, 0, GFP_KERNEL);
drivers/gpu/drm/drm_lease.c-241-	if (id < 0) {
--
drivers/gpu/drm/drm_lease.c=378=static int fill_object_idr(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-388-
drivers/gpu/drm/drm_lease.c:389:	objects = kzalloc_objs(struct drm_mode_object *, object_count);
drivers/gpu/drm/drm_lease.c-390-	if (!objects)
--
drivers/gpu/drm/drm_lease.c-432-		 */
drivers/gpu/drm/drm_lease.c:433:		ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
drivers/gpu/drm/drm_lease.c-434-		if (ret < 0) {
--
drivers/gpu/drm/drm_lease.c-441-
drivers/gpu/drm/drm_lease.c:442:			ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
drivers/gpu/drm/drm_lease.c-443-			if (ret < 0) {
--
drivers/gpu/drm/drm_lease.c-448-			if (crtc->cursor) {
drivers/gpu/drm/drm_lease.c:449:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
drivers/gpu/drm/drm_lease.c-450-				if (ret < 0) {
--
drivers/gpu/drm/drm_lease.c-471- * created containing the objects specified in the ioctl structure.
drivers/gpu/drm/drm_lease.c:472: * A file descriptor will be allocated for that and returned to the
drivers/gpu/drm/drm_lease.c-473- * application.
--
drivers/gpu/drm/drm_lease.c=475=int drm_mode_create_lease_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-511-	if (object_count != 0) {
drivers/gpu/drm/drm_lease.c:512:		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
drivers/gpu/drm/drm_lease.c-513-					       object_count, sizeof(__u32));
]

177/4 2026/10/13 22:57 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 81812
							output: 43
							thoughts: 1073
						

Thoughts:
**Analyzing DRM Lease Allocations**

Okay, let's break down the memory allocation situation within `drm_lease.c`. First, I need to confirm my understanding of the landscape. I've examined `drm_mode_list_lessees_ioctl`, `drm_mode_get_lease_ioctl`, and `drm_mode_revoke_lease_ioctl`, and it appears that none of these directly allocate any memory. They involve `put_user` calls within loops, but no dynamic allocation is happening there. This means `fill_object_idr` and `drm_mode_create_lease_ioctl` are the prime suspects, as they are the ONLY places with allocations in `drm_lease.c`.

Now, I'm trying to nail down the precise headers needed for the allocation functions used in those two problematic ioctls. I checked the included headers in `drivers/gpu/drm/drm_lease.c` and saw the usual suspects: file, uaccess, drm auth, crtc, driver, file, lease, and print headers. But that doesn't immediately tell me where the allocation functions are declared.

I'm thinking, do I need to explicitly include `<linux/slab.h>` or `<linux/string.h>`? My brain is racing. Was this already included indirectly? It's often the case that these are brought in through dependencies. I quickly check whether the code compiled and ran previously with `kzalloc_objs` and `kfree`, and the answer is yes, so perhaps it's already included. But I need to be *sure*.

So the logical next step is to find where `kvzalloc_objs` and `kvfree` are declared. Okay, it's definitely `<linux/slab.h>`.  And `vmemdup_array_user` is declared in `<linux/string.h>`.  Alright. Now, are either of these headers already included? Let me check by grepping through the included headers in `drm_crtc.h` and the others. Or, even better, I can just add `#include <linux/slab.h>` and see if it breaks the build. If it's already there, it shouldn't, but if it's missing and needed, this will confirm the need.

Wait, it's pretty standard for kernel code that allocates memory to include `<linux/slab.h>`. Why isn't it already explicitly included? I need to figure out the dependencies to understand why the code might have compiled previously without it.  So, I need to check if one of the included headers already brings in `<linux/slab.h>`. That's the next task.



178/4 2026/10/13 22:57 tool grepper
0m Args:
map[Expression:#include <linux/slab\.h> PathPrefixes:[include/drm/ drivers/gpu/drm/]]

Results:
map[Output:
Full output is too long, showing 200 out of 1063 lines.
Use more precise expression or PathPrefixes if possible.

Number of matching lines per file (266 files in total):
drivers/gpu/drm/amd/acp/acp_hw.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c:1
drivers/gpu/drm/amd/amdgpu/atom.c:1
drivers/gpu/drm/amd/amdgpu/cik.c:1
drivers/gpu/drm/amd/amdgpu/nv.c:1
drivers/gpu/drm/amd/amdgpu/si.c:1
drivers/gpu/drm/amd/amdgpu/soc15.c:1
drivers/gpu/drm/amd/amdgpu/soc21.c:1
drivers/gpu/drm/amd/amdgpu/soc24.c:1
drivers/gpu/drm/amd/amdgpu/vi.c:1
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:1
drivers/gpu/drm/amd/amdkfd/kfd_device.c:1
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c:1
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c:1
drivers/gpu/drm/amd/amdkfd/kfd_events.c:1
drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c:1
drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c:1
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c:1
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c:1
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c:1
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c:1
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c:1
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c:1
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c:1
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c:1
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c:1
drivers/gpu/drm/amd/amdkfd/kfd_process.c:1
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c:1
drivers/gpu/drm/amd/amdkfd/kfd_queue.c:1
drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c:1
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_hdcp_test.c:1
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c:1
drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c:1
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c:1
drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c:1
drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c:1
... and 216 more files

drivers/gpu/drm/amd/acp/acp_hw.c-24-#include <linux/mm.h>
drivers/gpu/drm/amd/acp/acp_hw.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/acp/acp_hw.c-26-#include <linux/device.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c-27-#include <linux/backlight.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:28:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c-29-#include <linux/xarray.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c-27-#include <linux/sched.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c:28:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c-29-#include <linux/sched/mm.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c-8-#include <linux/vga_switcheroo.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c:9:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c-10-#include <linux/acpi.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c-33-#include <linux/pci.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c:34:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c-35-#include <linux/acpi.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c-25-#include <linux/pci.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c-27-
--
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c-33-#include <linux/console.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:34:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c-35-#include <linux/iommu.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c-34-#include <linux/kref.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:35:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c-36-#include <linux/firmware.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c-29-#include <linux/seq_file.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c:30:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c-31-
--
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c-38-#include <linux/vga_switcheroo.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:39:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c-40-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c-32-#include <linux/list.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:33:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c-34-#include <linux/dma-buf.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-29-#include <linux/seq_file.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:30:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-31-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c-22- */
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c:23:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c-24-#include <drm/drm_print.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c-38-#include <linux/seq_file.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:39:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c-40-#include <linux/swap.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c-24-#include <linux/firmware.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c-26-#include <linux/module.h>
--
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c-25-#include <linux/kref.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c-27-#include <linux/dma-fence-unwrap.h>
--
drivers/gpu/drm/amd/amdgpu/atom.c-26-#include <linux/sched.h>
drivers/gpu/drm/amd/amdgpu/atom.c:27:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/atom.c-28-#include <linux/string_helpers.h>
--
drivers/gpu/drm/amd/amdgpu/cik.c-24-#include <linux/firmware.h>
drivers/gpu/drm/amd/amdgpu/cik.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/cik.c-26-#include <linux/module.h>
--
drivers/gpu/drm/amd/amdgpu/nv.c-23-#include <linux/firmware.h>
drivers/gpu/drm/amd/amdgpu/nv.c:24:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/nv.c-25-#include <linux/module.h>
--
drivers/gpu/drm/amd/amdgpu/si.c-24-#include <linux/firmware.h>
drivers/gpu/drm/amd/amdgpu/si.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/si.c-26-#include <linux/module.h>
--
drivers/gpu/drm/amd/amdgpu/soc15.c-23-#include <linux/firmware.h>
drivers/gpu/drm/amd/amdgpu/soc15.c:24:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/soc15.c-25-#include <linux/module.h>
--
drivers/gpu/drm/amd/amdgpu/soc21.c-23-#include <linux/firmware.h>
drivers/gpu/drm/amd/amdgpu/soc21.c:24:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/soc21.c-25-#include <linux/module.h>
--
drivers/gpu/drm/amd/amdgpu/soc24.c-23-#include <linux/firmware.h>
drivers/gpu/drm/amd/amdgpu/soc24.c:24:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/soc24.c-25-#include <linux/module.h>
--
drivers/gpu/drm/amd/amdgpu/vi.c-24-#include <linux/pci.h>
drivers/gpu/drm/amd/amdgpu/vi.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdgpu/vi.c-26-
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-30-#include <linux/sched.h>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:31:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-32-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_device.c-25-#include <linux/pci.h>
drivers/gpu/drm/amd/amdkfd/kfd_device.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_device.c-27-#include "kfd_priv.h"
--
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c-26-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c:27:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c-28-#include <linux/list.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c-25-#include <linux/mman.h>
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c-27-#include <linux/io.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_events.c-24-#include <linux/mm_types.h>
drivers/gpu/drm/amd/amdkfd/kfd_events.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_events.c-26-#include <linux/types.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c-28-#include <linux/sched.h>
drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c:29:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c-30-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c-43-
drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c:44:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c-45-#include <linux/device.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c-26-#include <linux/mutex.h>
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c:27:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c-28-#include <linux/printk.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c-25-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c-27-#include <linux/mm_types.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c-25-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c-27-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c-24-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c-26-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c-25-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c-27-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c-25-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c-27-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c-25-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c-27-#include <linux/uaccess.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c-25-#include <linux/printk.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c-27-#include <linux/mm_types.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c-24-
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c-26-#include <linux/mutex.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_process.c-29-#include <linux/mmu_context.h>
drivers/gpu/drm/amd/amdkfd/kfd_process.c:30:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_process.c-31-#include <linux/notifier.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c-24-
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c-26-#include <linux/list.h>
--
drivers/gpu/drm/amd/amdkfd/kfd_queue.c-24-
drivers/gpu/drm/amd/amdkfd/kfd_queue.c:25:#include <linux/slab.h>
drivers/gpu/drm/amd/amdkfd/kfd_queue.c-26-#include <linux/overflow.h>
--
drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c-27-#include <linux/platform_device.h>
drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c:28:#include <linux/slab.h>
drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c-29-
--
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_hdcp_test.c-10-#include <linux/kobject.h>
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_hdcp_test.c:11:#include <linux/slab.h>
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_hdcp_test.c-12-#include <linux/sysfs.h>
--
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c-25-
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c-27-
--
drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c-25-
drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c-27-
--
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c-25-
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c-27-
--
drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c-25-
drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c-27-
--
drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c-25-
drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c:26:#include <linux/slab.h>
drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c-27-
--

]

179/4 2026/10/13 22:57 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 89778
							output: 64
							thoughts: 35
						

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

**Investigating Potential Header Dependencies**

Alright, I need to quickly determine the header inclusion landscape. My gut tells me there might be a subtle dependency on `linux/slab.h` creeping in via either `include/drm/drm_file.h` or, less likely but still possible, `drm_crtc.h`. I've encountered similar scenarios before, and it's always prudent to double-check these things, especially in a kernel context where hidden dependencies can lead to surprising issues down the line – particularly around memory management or locking. I want to rule out any unexpected uses of slab allocators that might impact the overall system's memory footprint or lead to subtle locking issues down the line. Let's see if those headers are bringing it in directly or indirectly.



180/4 2026/10/13 22:57 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:#include <linux/slab\.h> PathPrefixes:[include/drm/drm_file.h include/drm/drm_crtc.h include/drm/drm_drv.h]]

Results:
map[Output:]

181/4 2026/10/13 22:57 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 90071
							output: 30
							thoughts: 23
						

Thoughts:
Okay, here's my summary, tailored for an expert audience, presented as if it were my own thought process:

**Diving into DRM Lease Dependencies**

Alright, time to get my hands dirty. I need to understand the dependencies within `drm_lease.c`, specifically concerning the slab allocator. The immediate question is which header file, if any, is responsible for pulling in `linux/slab.h` for this module. I need to trace this back. This is crucial for understanding how memory is managed within the lease subsystem and any potential conflicts or design choices around slab allocation. I suspect it's implicitly included, but I need to confirm and identify the mechanism. Let's start digging.



182/4 2026/10/13 22:57 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:linux/slab\.h PathPrefixes:[include/drm/]]

Results:
map[Output:]

183/4 2026/10/13 22:57 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 90284
							output: 38
							thoughts: 239
						

Thoughts:
**My Analysis of Potential Header Inclusion in `drm_lease.c`**

Okay, first things first, I need to verify whether `drm_lease.c` explicitly includes `<linux/slab.h>`. Let's take a look at the file itself… hmm, nope. It's not there. Although it's not strictly *required* because of dependency trees, I've always held the belief that explicitly including `<linux/slab.h>` whenever using functions like `kvfree` or `kvzalloc_objs` is just good, clean Linux kernel coding practice. It adds a layer of clarity and self-documentation to the code.

Now, wait a minute, I should also check if `<linux/overflow.h>` is needed. I see an integer division involving `INT_MAX` and the `sizeof(struct drm_mode_object *)`. Hold on... no, that won't require `<linux/overflow.h>`. Integer division, even with `INT_MAX`, won't overflow the result. The overflow protection isn't needed here.

Okay, let's take a step back. Is `INT_MAX` properly defined? It should be in `<linux/limits.h>` or `<linux/kernel.h>`, which are common headers in the kernel. I should make a note to check that.

To get a better perspective, I'm going to quickly glance at some other DRM core files. Specifically, I'll check `drivers/gpu/drm/drm_gem.c` to see how those files handle similar limit checks and header inclusions. Looking at their practices may influence my own decision here.



184/4 2026/10/13 22:57 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_gem.c FirstLine:20 LineCount:40]

Results:
map[Contents:  20:	 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21:	 * IN THE SOFTWARE.
  22:	 *
  23:	 * Authors:
  24:	 *    Eric Anholt <eric@anholt.net>
  25:	 *
  26:	 */
  27:	
  28:	#include <linux/dma-buf.h>
  29:	#include <linux/export.h>
  30:	#include <linux/file.h>
  31:	#include <linux/fs.h>
  32:	#ifdef CONFIG_TRANSPARENT_HUGEPAGE
  33:	#include <linux/fs_context.h>
  34:	#endif
  35:	#include <linux/iosys-map.h>
  36:	#include <linux/mem_encrypt.h>
  37:	#include <linux/mm.h>
  38:	#include <linux/mman.h>
  39:	#include <linux/module.h>
  40:	#include <linux/pagemap.h>
  41:	#include <linux/folio_batch.h>
  42:	#include <linux/sched/mm.h>
  43:	#include <linux/shmem_fs.h>
  44:	#include <linux/slab.h>
  45:	#include <linux/string_helpers.h>
  46:	#include <linux/types.h>
  47:	#include <linux/uaccess.h>
  48:	
  49:	#include <drm/drm.h>
  50:	#include <drm/drm_device.h>
  51:	#include <drm/drm_drv.h>
  52:	#include <drm/drm_file.h>
  53:	#include <drm/drm_gem.h>
  54:	#include <drm/drm_managed.h>
  55:	#include <drm/drm_print.h>
  56:	#include <drm/drm_vma_manager.h>
  57:	
  58:	#include "drm_internal.h"
  59:	
]

185/4 2026/10/13 22:57 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 91500
							output: 37
							thoughts: 6706
						

Thoughts:
**Analysis of drm_lease.c Changes**

Okay, so I've carefully reviewed the proposed changes to `drm_lease.c`, focusing on potential issues related to memory allocation, integer overflows, and code correctness, and it's quite straightforward. My initial instinct to include `<linux/slab.h>` is confirmed, it's clean and standard practice.

First, concerning the `fill_object_idr()` function: the `kvzalloc_objs` and `kvfree` calls are correctly paired, and the error handling for allocation failure (`!objects`) is properly handled by returning `-ENOMEM` and avoiding the subsequent cleanup. The existing `out_free_objects` label ensures that any partially allocated `objects` are freed in all execution paths, so that's all good.

The second change within `drm_mode_create_lease_ioctl()` replacing `memdup_array_user` with `vmemdup_array_user` and `kfree` with `kvfree` is also completely sound. I double-checked the logic around `vmemdup_array_user`, `fill_object_idr`, and the subsequent `kvfree(object_ids)` call. If `fill_object_idr` returns an error, the `object_ids` are freed before the function exits. And the `leases` are destroyed if errors are encountered. This ensures memory is freed properly and avoids leaks.

The most critical aspect is the third change, the bounds check on `object_count`. This is where I have to be the most rigorous. The addition of the check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))` within `drm_mode_create_lease_ioctl` is correct and necessary. It should be placed early in the function, before any allocations or references to user-provided data take place. This ensures that the code isn't vulnerable to integer overflows that could lead to memory corruption. I decided that `"invalid object count"` or `"too many objects"` is a reasonable debug message. Also, ensuring that `sizeof(struct drm_mode_object *)` is used in the check is the most explicit and clearest way to do this.

I've also checked whether this would impact any of the other ioctls, `drm_mode_list_lessees_ioctl` and `drm_mode_get_lease_ioctl`, and found that neither of these perform any allocation and simply read/write to user space. Therefore, the change doesn't need to be applied to either function.

After double-checking, I conclude that there is NO reason to change `int object_count` to `size_t object_count` in `fill_object_idr`, `validate_lease`, or `drm_mode_create_lease_ioctl`. Since the `cl->object_count` comes from a `__u32` which is the user-supplied value.

Since the added bound check ensures the size is less than `INT_MAX`, and that value fits into `int object_count` - therefore, there is NO reason to change these types.

Finally, the existing checks around `object_count == 0` are consistent with the documentation. An empty lease is a valid option. If the user calls with `object_count == 0`, no allocations happen, which is fine. The existing code is correct here.

I believe this is a robust and safe change.



186/4 2026/10/13 22:58 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/slub.c Name:kmalloc_gfp_adjust]

Results:
map[SourceCode:6976:	static gfp_t kmalloc_gfp_adjust(gfp_t flags, size_t size)
6977:	{
6978:		/*
6979:		 * We want to attempt a large physically contiguous block first because
6980:		 * it is less likely to fragment multiple larger blocks and therefore
6981:		 * contribute to a long term fragmentation less than vmalloc fallback.
6982:		 * However make sure that larger requests are not too disruptive - i.e.
6983:		 * do not direct reclaim unless physically continuous memory is preferred
6984:		 * (__GFP_RETRY_MAYFAIL mode). We still kick in kswapd/kcompactd to
6985:		 * start working in the background
6986:		 */
6987:		if (size > PAGE_SIZE) {
6988:			flags |= __GFP_NOWARN;
6989:	
6990:			if (!(flags & __GFP_RETRY_MAYFAIL))
6991:				flags &= ~__GFP_DIRECT_RECLAIM;
6992:	
6993:			/* nofail semantic is implemented by the vmalloc fallback */
6994:			flags &= ~__GFP_NOFAIL;
6995:		}
6996:	
6997:		return flags;
6998:	}
 SourceFile:mm/slub.c]

187/4 2026/10/13 22:58 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 99356
							output: 35
							thoughts: 3681
						

Thoughts:
**Analysis and Refinement of DRM Lease Object Allocation**

Alright, let's break this down. My focus here is ensuring robustness and safety in the DRM lease object handling, specifically addressing potential integer overflows and memory allocation issues, as per the user's instructions.

First off, I need to understand that the system's allocation strategy is to use `kmalloc` with a fallback to `__vmalloc` in `kvmalloc`. I've determined that integer overflow is prevented by the check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;`. This check ensures that the requested `size` for allocation never exceeds `INT_MAX`, preventing the warning from `if (unlikely(size > INT_MAX))`.

Now, the core issue seems to revolve around potentially large user-controlled arrays, specifically the `object_ids` and `objects` arrays in `drm_mode_create_lease_ioctl`. The use of `vmemdup_array_user` is a good thing as it addresses the potential `-ENOMEM` errors that `memdup_array_user` could suffer when dealing with large arrays. This is because `vmemdup_array_user` gracefully falls back to `vmalloc`, which is better for this situation.

My next step is to examine the placement of the bounds check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))`. I'm going to put it after the `cl->flags` check, as that's early validation that doesn't involve unnecessary references or allocations. This allows for early error detection, reporting via `drm_dbg_lease()`, and prevents any further processing if the object count is excessive.

The existing code used `kfree` for `object_ids` and `objects` after `vmemdup_array_user` and `kvzalloc_objs` respectively. This is a potential bug because `vmalloc` returns memory that is *not* allocated with `kmalloc`. It is crucial to switch to `kvfree` when freeing the arrays. I've updated the code in both `drm_mode_create_lease_ioctl` and `fill_object_idr` from `kfree` to `kvfree`.

I've also confirmed that the necessary `#include <linux/slab.h>` is missing in `drm_lease.c`, which is required for `kvzalloc` and `kvfree`. I'll add this include to ensure proper function declaration.

Finally, I've checked the rest of the file `drivers/gpu/drm/drm_lease.c` and made sure there are no other allocations or similar coding patterns that I need to be concerned about. I made a thorough, line-by-line inspection of the file.

I also considered other error messages, and determined that the error message `drm_dbg_lease(dev, "invalid object count\n");` is more appropriate than others for the failed bounds check.

I did this carefully, given that I can't directly compile and test the changes. I'm very confident that these changes address the core vulnerability, provide the best overall solution for this memory management issue, and adhere to the guidelines.



188/4 2026/10/13 22:59 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:include/linux/slab.h Name:__alloc_objs]

Results:
map[SourceCode: SourceFile:]

189/4 2026/10/13 22:59 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 103790
							output: 34
							thoughts: 22
						

Thoughts:
Here's my thought process, as if I were thinking it:

**Digging into Kernel Memory Allocation**

Alright, I need to understand the memory allocation strategy, specifically how these object allocations are handled. My first move is to dive straight into the code. Let's start with a focused search. I'm going to use `grep` to hunt down the definition of `__alloc_objs` in `include/linux/slab.h`. That macro or function likely holds the key to the core logic I'm after. This should give me a good entry point to trace the allocation path.



190/4 2026/10/13 22:59 tool grepper
0m Args:
map[Expression:#define __alloc_objs PathPrefixes:[include/linux/slab.h]]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1086- */
include/linux/slab.h:1087:#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
include/linux/slab.h-1088-({									\
]

191/4 2026/10/13 22:59 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 104088
							output: 36
							thoughts: 26
						

Thoughts:
Okay, let's dive into this. Here's my thought process:

**Diving into Slab Allocation in `linux/slab.h`**

Alright, I need to understand this part of the kernel's memory management, and `include/linux/slab.h` seems like the right place to start. I'm going to use `read-file` to get a look at the file. Now, based on my understanding of this system, I'm going to jump to around line 1087. I'm expecting to find some interesting details there, hopefully related to slab cache structures, object allocation/deallocation, or perhaps some key function definitions. This line number is a general estimate, of course. My experience tells me that significant structures related to object management are often defined or declared around this point, so it's a good initial probe to assess the overall code. I'll read and analyze that section carefully. I'll be looking for things like the declaration of `kmem_cache` structures, slab allocation functions like `kmem_cache_alloc`, and potentially functions like `kmem_cache_free`. I know the kernel, and I know this is a hot spot, and it's time to dig in.



192/4 2026/10/13 22:59 tool read-file
0m Args:
map[File:include/linux/slab.h FirstLine:1085 LineCount:40]

Results:
map[Contents:1085:	 * allocated @TYPE objects, or NULL on failure.
1086:	 */
1087:	#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
1088:	({									\
1089:		const size_t __obj_size = size_mul(sizeof(TYPE), COUNT);	\
1090:		(TYPE *)KMALLOC(__obj_size, GFP);				\
1091:	})
1092:	
1093:	/**
1094:	 * __alloc_flex - Allocate an object that has a trailing flexible array
1095:	 * @KMALLOC: kmalloc wrapper function to use for allocation.
1096:	 * @GFP: GFP flags for the allocation.
1097:	 * @TYPE: type of structure to allocate space for.
1098:	 * @FAM: The name of the flexible array member of @TYPE structure.
1099:	 * @COUNT: how many @FAM elements to allocate space for.
1100:	 *
1101:	 * Returns: Newly allocated pointer to @TYPE with @COUNT-many trailing
1102:	 * @FAM elements, or NULL on failure or if @COUNT cannot be represented
1103:	 * by the member of @TYPE that counts the @FAM elements (annotated via
1104:	 * __counted_by()).
1105:	 */
1106:	#define __alloc_flex(KMALLOC, GFP, TYPE, FAM, COUNT)			\
1107:	({									\
1108:		const size_t __count = (COUNT);					\
1109:		const size_t __obj_size = struct_size_t(TYPE, FAM, __count);	\
1110:		TYPE *__obj_ptr = KMALLOC(__obj_size, GFP);			\
1111:		if (__obj_ptr)							\
1112:			__set_flex_counter(__obj_ptr->FAM, __count);		\
1113:		__obj_ptr;							\
1114:	})
1115:	
1116:	/**
1117:	 * kmalloc_obj - Allocate a single instance of the given type
1118:	 * @VAR_OR_TYPE: Variable or type to allocate.
1119:	 * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
1120:	 *
1121:	 * Returns: newly allocated pointer to a @VAR_OR_TYPE on success, or NULL
1122:	 * on failure.
1123:	 */
1124:	#define kmalloc_obj(VAR_OR_TYPE, ...) \
]

193/4 2026/10/13 22:59 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 105112
							output: 35
							thoughts: 781
						

Thoughts:
**Analyzing Memory Allocation and Type Handling in DRM Lease Code**

Okay, let's break this down piece by piece. First, that macro, `__alloc_objs`: I see how it's used with `kvzalloc_objs`. The `TYPE` gets substituted with `struct drm_mode_object *`, `sizeof(TYPE)` becomes `sizeof(struct drm_mode_object *)`, and `KMALLOC` is `kvzalloc`. So, the return type becomes a `struct drm_mode_object **`, and the resulting pointer gets assigned directly to `objects`, which is also a `struct drm_mode_object **`. The compiler's happy, type-checking is fine, everything's working as expected here, a double pointer correctly allocated using `kvzalloc`.

Next, `vmemdup_array_user`: It looks like the core purpose is to safely duplicate an array of user-space data into kernel space, handling potential overflows. In `drm_mode_create_lease_ioctl`, the call uses `vmemdup_array_user` to copy `cl->object_ids`, which is of type `__u64`, using `u64_to_user_ptr` to get a `void __user *`. The critical type here is `sizeof(__u32)` as the size of each element in the array we're copying.  The return `void *` from `vmemdup_array_user` works fine because of C's implicit pointer conversion to `uint32_t *` for assignment to `object_ids`. The subsequent use of `IS_ERR` and `PTR_ERR` is the standard way to check for errors returned as a pointer and retrieve the error code respectively, and finally `kvfree` is used to free the memory. This is exactly how `memdup_array_user` and `kfree` would have worked. I'm seeing this code handling the vmalloc fallback in a clean way for user space data.

Alright, now the critical part. What if `cl->object_count` gets too large? The code already includes a check:

```c
	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
		return -EINVAL;
	}
```

The division `INT_MAX / sizeof(struct drm_mode_object *)` is intended to prevent an integer overflow in the size calculation. The check is present, but I must know if `INT_MAX` is visible and what it's type is in this context. Is it defined directly or being pulled in via an included header? I need to verify that `INT_MAX` is correctly defined and accessible within this particular `.c` file. I need to make sure that the definition of `INT_MAX` is correct for the architecture and that the integer division behaves correctly with respect to the desired bounds check. I will `grep` for `INT_MAX` in this file or look at included headers to be sure.



194/4 2026/10/13 22:59 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:INT_MAX PathPrefixes:[drivers/gpu/drm/drm_lease.c]]

Results:
map[Output:]

195/4 2026/10/13 22:59 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 106613
							output: 30
							thoughts: 16
						

Thoughts:
Okay, here's my summary, tailored for an expert audience, as if I'm thinking these things myself:

**Investigating the Definition of INT_MAX Across Kernel Headers**

Alright, I need to pinpoint the definition of `INT_MAX`. It's crucial, and I want to be *absolutely* sure where the canonical definition resides within the kernel header landscape. This isn't just about finding *a* definition; I need to know *the* definition the kernel relies on. I'm thinking cross-referencing and header file exploration. I need to be diligent about this, given the potential for subtle differences or overrides. I'm going to carefully track the various locations and any potential source of the definition, to make certain that the definition in question aligns with the rest of my work.



196/4 2026/10/13 22:59 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:#define INT_MAX PathPrefixes:[include/linux/]]

Results:
map[Output:]

197/4 2026/10/13 23:00 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 106841
							output: 28
							thoughts: 17
						

Thoughts:
Here's a summary of my thought process:

**Where's That Maximum Integer Defined?**

Okay, so I need to find the definition of `INT_MAX`. It's a standard macro, so it's most likely in a standard header file. Given that this is likely a C or C++ codebase, my first instinct is to check the `include/` directory. That's the logical place where the project's developers, or the system itself, would house the standard headers. I'll navigate there and start looking. `limits.h` is the most obvious candidate, since it's the standard header for integer limits. I'll check that one first. If it's not there, I'll need to broaden my search. But, `limits.h` is the safe bet, and likely where I'll find my answer.



198/4 2026/10/13 23:00 tool grepper
0m Args:
map[Expression:#define INT_MAX PathPrefixes:[include/]]

Results:
map[Output:include/vdso/limits.h-7-#define SHRT_MIN	((short)(-SHRT_MAX - 1))
include/vdso/limits.h:8:#define INT_MAX		((int)(~0U >> 1))
include/vdso/limits.h-9-#define INT_MIN		(-INT_MAX - 1)
]

199/4 2026/10/13 23:00 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 107162
							output: 50
							thoughts: 142
						

Thoughts:
Here's my thought process, as it stands:

**Digging into Header Dependencies**

Okay, so I see that `include/linux/limits.h` pulls in `<vdso/limits.h>`.  And that's interesting because `<linux/kernel.h>` also includes `<linux/limits.h>`.  The real kicker is that pretty much *every* kernel file eventually includes `<linux/kernel.h>`.  I need to figure out if `drm_lease.c` (or any file in this project) is *redundantly* including `<linux/limits.h>` through one of these header chains. That's the first thing I need to confirm.

To do that, I'll leverage my resources. Either I'll query `codeexpert` – if it's got up-to-date kernel knowledge – or I'll just dive into a direct code search. I'll need to know where `INT_MAX` is being used to tell.

I'll check if `INT_MAX` is used in any of the other `drivers/gpu/drm/*.c` files. That's a reasonable starting point, given the context. Then I'll expand that search to include any files in the `drivers/gpu/drm/` directory. Gotta make sure I'm not missing anything.



200/4 2026/10/13 23:00 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:INT_MAX PathPrefixes:[drivers/gpu/drm/drm_ioctl.c drivers/gpu/drm/drm_crtc.c]]

Results:
map[Output:]

201/4 2026/10/13 23:00 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 107654
							output: 63
							thoughts: 20
						

Thoughts:
Okay, here's my summary, taking the perspective of someone familiar with kernel development and the DRM subsystem:

**Hunting for `INT_MAX` in the DRM Landscape**

Alright, I'm thinking I need to find all instances of `INT_MAX` within the DRM driver code. That's a classic code review target, right? Potential integer overflows, subtle bugs... you name it. It's time to use grep. Specifically, I'll restrict the search to the core DRM driver files. The intention is to identify any uses within the `drivers/gpu/drm/*.c` directory. This should zero in on the relevant code. Let's see what pops up. I'm expecting to find a few, and then I'll need to evaluate each case contextually to determine if it's correct usage, a potential bug, or perhaps some optimization opportunity. It's going to be interesting to see what the initial results are.



202/4 2026/10/13 23:00 tool grepper
0m Args:
map[Expression:INT_MAX PathPrefixes:[drivers/gpu/drm/drm_atomic.c drivers/gpu/drm/drm_connector.c drivers/gpu/drm/drm_modes.c]]

Results:
map[Output:drivers/gpu/drm/drm_atomic.c=784=static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state,
--
drivers/gpu/drm/drm_atomic.c-827-	/* Give drivers some help against integer overflows */
drivers/gpu/drm/drm_atomic.c:828:	if (new_plane_state->crtc_w > INT_MAX ||
drivers/gpu/drm/drm_atomic.c:829:	    new_plane_state->crtc_x > INT_MAX - (int32_t) new_plane_state->crtc_w ||
drivers/gpu/drm/drm_atomic.c:830:	    new_plane_state->crtc_h > INT_MAX ||
drivers/gpu/drm/drm_atomic.c:831:	    new_plane_state->crtc_y > INT_MAX - (int32_t) new_plane_state->crtc_h) {
drivers/gpu/drm/drm_atomic.c-832-		drm_dbg_atomic(plane->dev,
--
drivers/gpu/drm/drm_modes.c=2660=int drm_mode_convert_umode(struct drm_device *dev,
--
drivers/gpu/drm/drm_modes.c-2663-{
drivers/gpu/drm/drm_modes.c:2664:	if (in->clock > INT_MAX || in->vrefresh > INT_MAX)
drivers/gpu/drm/drm_modes.c-2665-		return -ERANGE;
]

203/4 2026/10/13 23:00 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 108339
							output: 40
							thoughts: 835
						

Thoughts:
**Analyzing Object Count Limits in DRM Lease Creation**

Okay, so I'm digging into the DRM code, specifically `drm_lease.c`, around line 490. I need to understand the object count checks in the lease creation process. First, I noticed that `INT_MAX` is available within the DRM file without needing a `limits.h` include, which is something I always keep in mind when parsing code.

Now, looking at the code, there's a check for `cl->object_count` to prevent an integer overflow when calculating the number of objects. The current code checks `cl->object_count` directly. My immediate thought was, "Could we move the assignment of `object_count = cl->object_count;` *before* the overflow check?" However, after a quick scan, it looks like that assignment actually happens later, and for good reason!

Then I thought again! I realized that `cl->object_count` is being checked directly against a limit based on `INT_MAX`. This is similar to the check on `cl->flags` immediately above. The checks on both `cl->flags` and `cl->object_count` are made early in the function, before any resource allocation or object referencing happens which is a good coding pattern for safety. It's consistent and efficient.

It hits me, the `cl` struct is being validated up front which is a good practice. They are both fields of the client's structure, `cl`, and are checked in sequence. This seems like a reasonable and robust approach.

Finally, just to be absolutely certain, I wanted to double-check the format specifier used in `drm_dbg_lease`. Specifically, I was curious if `%u` was appropriate for `__u32` which is the type of `cl->object_count`. I need to ensure it's not a print vulnerability. After a quick look, yep, `%u` is correct for an unsigned 32-bit integer. All checks out. I have to confirm the usage of `drm_dbg_lease` to make sure it is correct!



204/4 2026/10/13 23:00 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_dbg_lease]

Results:
map[SourceCode: SourceFile:]

205/4 2026/10/13 23:00 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 109684
							output: 20
							thoughts: 12
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, presented in the first person:

**Investigating the `drm_dbg_lease` Code**

Alright, let's dive in. My first thought is to leverage the power of `grep`. Given the context, I'm likely dealing with debugging or investigating the Direct Rendering Manager (DRM) subsystem, and specifically, lease management. The presence of `drm_dbg_lease` strongly suggests a debug-related variable, function, or macro dedicated to lease functionality within the DRM. My goal is to quickly pinpoint its occurrences and context within the codebase. This initial `grep` operation is the fastest way to get a bird's-eye view, to understand where this thing is used. This will inform my next steps, whether I go digging through the surrounding code, check documentation, or trace call paths. This initial search should quickly uncover the declaration, initialization, and any usages of `drm_dbg_lease`. From there, I can start to understand its function and purpose within the broader DRM lease system.



206/4 2026/10/13 23:00 tool grepper
0m Args:
map[Expression:define drm_dbg_lease]

Results:
map[Output:include/drm/drm_print.h=608=static inline struct device *__drm_to_dev(const struct drm_device *drm)
--
include/drm/drm_print.h-661-	drm_dev_dbg(__drm_to_dev(drm), DRM_UT_STATE, fmt, ##__VA_ARGS__)
include/drm/drm_print.h:662:#define drm_dbg_lease(drm, fmt, ...)					\
include/drm/drm_print.h-663-	drm_dev_dbg(__drm_to_dev(drm), DRM_UT_LEASE, fmt, ##__VA_ARGS__)
]

207/4 2026/10/13 23:00 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 110107
							output: 36
							thoughts: 2871
						

Thoughts:
**Analysis of Lease Object Creation in DRM**

Okay, let's break this down. My initial thought was that adding `drm_dbg_lease` calls for cases of "too many objects" or "invalid object count" was a good practice, even if not directly removing a `WARN_ON`. I'm already seeing some good uses, let me examine...

I then focused on what would happen if `object_count` was zero, and confirmed it's correctly handled due to the conditional check with `object_count != 0`. Then, I moved on to larger values of `object_count` to stress the allocation routines and found the following: The integer division (`INT_MAX / sizeof(...)`) prevents large values, the memory allocation sizes are reasonable, the `vmemdup_array_user` copies safely into memory. The use of `kvzalloc` within the `fill_object_idr` function, with its fallback to `vmalloc`, seems robust, plus there is no call to `WARN_ON_ONCE_GFP`. All memory is deallocated using `kvfree`, regardless of successes or failures along the execution path.

Next, I considered error scenarios with `vmemdup_array_user` and `fill_object_idr` and ensured that the subsequent error handling, including the usage of `kvfree` for both `object_ids` and `objects`, is all correct and consistent, handling the case of `ERR_PTR` return values. Also, the check for `check_mul_overflow` in `vmemdup_array_user` seems appropriate and that the size of the objects would not overflow.

Next, I had to consider if the signed integer overflow in `object_count` was possible, as it is passed around. I investigated the function parameter types in `fill_object_idr`, specifically its `int object_count` to ensure it always correctly handles the maximum size. I quickly see that in all cases, `object_count` is less than `INT_MAX`, and that the `size_t` value passed into `int` in `fill_object_idr` is safe. I considered if it should be changed, but after further thought, keeping it the same and bounded makes sense.

After that, I made sure that the loop and object puts within `fill_object_idr` and the allocation size within `kvzalloc_objs` are properly handled, and the loop is clean, initializing each object pointer to NULL so they will be properly freed. I confirmed that the memory management functions are consistently being updated to `kvfree` from `kfree`. Also, the `memdup_array_user` has properly updated to `vmemdup_array_user`.

I verified the bounds check is correct, the inclusion of `<linux/slab.h>` is handled. I also confirmed through cross-referencing and git searches that `drm_mode_create_lease_ioctl` is called from the DRM ioctl table and that its signature and return types are consistent with other parts of the DRM code. I have verified that no new return error codes are necessary, as `-EINVAL` is already returned on invalid flags or parameters. I have searched the git history for the commit.



208/4 2026/10/13 23:01 tool git-log
5m Args:
map[CodeRegexp:vmemdup_array_user PathPrefixes:drivers/gpu/drm]

Results:
map[Output:0131a305886f drm/amdgpu: Remove output parameter in bo list handling
2a8e1e297cfc drm/amdgpu: Drop support for variable struct drm_amdgpu_bo_list_entry size
cb77b79abf5f drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
d4b6274cbf0b drm/amdgpu: Use (v)memdup_array_user in amdgpu_cs_pass1
c4ac100e9ae2 drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
2fe16088c3c7 tty/vt: use guard()s in con_font_set/get() and con_{set,get}_unimap()
7d78a7773355 string: Add additional __realloc_size() annotations for "dup" helpers
1f829359c8c3 KVM: Harden copying of userspace-array against overflow
573cc0e5cf14 KVM: x86: Harden copying of userspace-array against overflow
e651faa2fba4 drivers/tty/vt: use standard array-copy-functions
]

209/4 2026/10/13 23:06 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 114023
							output: 25
							thoughts: 23
						

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

**Analyzing Commit c4ac100e9ae2**

Alright, let's dive into commit `c4ac100e9ae2`. I need to understand the implications of this change. My initial focus will be on the direct code modifications. I'll probably start by checking the diff to identify the files touched and the key functions or data structures that were altered.

I'll be looking for potential regressions first and foremost. Does this commit introduce any subtle bugs, performance bottlenecks, or unintended side effects? I'll probably look for any test changes to start, since the tests should tell me about the intention of the commit. Was the existing test coverage modified, or were new tests written? If so, does the new testing cover the changes?

I will also be on the lookout for architectural implications. Did this commit introduce any dependencies, break existing abstractions, or necessitate changes in other parts of the system? I'll be thinking about the long-term maintainability of the codebase.

Finally, I'll consider the context. What was the purpose of this commit? Was it a bug fix, a feature addition, a refactoring, or something else entirely? Understanding the "why" will help me assess the quality of the solution and whether it aligns with the overall project goals. Time to get to work.



210/4 2026/10/13 23:06 tool git-show
0m Args:
map[Commit:c4ac100e9ae2]

Results:
map[Output:commit c4ac100e9ae252b09986766ad23b1f83ca3a369d
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Thu Jun 12 11:44:26 2025 +0100

    drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
    
    Replace kvmalloc_array() + copy_from_user() with vmemdup_array_user() on
    the fast path.
    
    This shrinks the source code and improves separation between the kernel
    and userspace slabs.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
index 702f6610d024..66fb37b64388 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
@@ -184,43 +184,36 @@ void amdgpu_bo_list_put(struct amdgpu_bo_list *list)
 int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
 				      struct drm_amdgpu_bo_list_entry **info_param)
 {
-	const void __user *uptr = u64_to_user_ptr(in->bo_info_ptr);
 	const uint32_t info_size = sizeof(struct drm_amdgpu_bo_list_entry);
+	const void __user *uptr = u64_to_user_ptr(in->bo_info_ptr);
+	const uint32_t bo_info_size = in->bo_info_size;
+	const uint32_t bo_number = in->bo_number;
 	struct drm_amdgpu_bo_list_entry *info;
-	int r;
-
-	info = kvmalloc_array(in->bo_number, info_size, GFP_KERNEL);
-	if (!info)
-		return -ENOMEM;
 
 	/* copy the handle array from userspace to a kernel buffer */
-	r = -EFAULT;
-	if (likely(info_size == in->bo_info_size)) {
-		unsigned long bytes = in->bo_number *
-			in->bo_info_size;
-
-		if (copy_from_user(info, uptr, bytes))
-			goto error_free;
-
+	if (likely(info_size == bo_info_size)) {
+		info = vmemdup_array_user(uptr, bo_number, info_size);
+		if (IS_ERR(info))
+			return PTR_ERR(info);
 	} else {
-		unsigned long bytes = min(in->bo_info_size, info_size);
+		const uint32_t bytes = min(bo_info_size, info_size);
 		unsigned i;
 
-		memset(info, 0, in->bo_number * info_size);
-		for (i = 0; i < in->bo_number; ++i) {
-			if (copy_from_user(&info[i], uptr, bytes))
-				goto error_free;
+		info = kvmalloc_array(bo_number, info_size, GFP_KERNEL);
+		if (!info)
+			return -ENOMEM;
 
-			uptr += in->bo_info_size;
+		memset(info, 0, bo_number * info_size);
+		for (i = 0; i < bo_number; ++i, uptr += bo_info_size) {
+			if (copy_from_user(&info[i], uptr, bytes)) {
+				kvfree(info);
+				return -EFAULT;
+			}
 		}
 	}
 
 	*info_param = info;
 	return 0;
-
-error_free:
-	kvfree(info);
-	return r;
 }
 
 int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
]

211/4 2026/10/13 23:06 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 115524
							output: 26
							thoughts: 45
						

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

**Examining Commit d4b6274cbf0b**

Okay, let's take a quick look at commit `d4b6274cbf0b`. I remember that one; it was a while back. I'm specifically interested in its contribution to `drm/amdgpu`. From the commit message, the focus appears to be on replacing something with `(v)memdup_array_user` within the `amdgpu_cs_pass1` function. Right, so this is likely a security hardening or performance optimization concerning how user-space memory is handled within the command submission process. I need to refresh my memory on the context of `amdgpu_cs_pass1` itself. I'll need to think about how these functions fit into the command stream processing. And I should keep in mind potential race conditions.



212/4 2026/10/13 23:07 tool git-show
0m Args:
map[Commit:d4b6274cbf0b]

Results:
map[Output:commit d4b6274cbf0b0ee92294d699f138b63aa4796ad0
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Thu Jun 12 11:44:28 2025 +0100

    drm/amdgpu: Use (v)memdup_array_user in amdgpu_cs_pass1
    
    Replace k(v)malloc_array() + copy_from_user() with (v)memdup_array_user().
    
    This shrinks the source code and improves separation between the kernel
    and userspace slabs.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 0e41589a7f18..2e93d570153c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -178,25 +178,17 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
 	struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
 	unsigned int num_ibs[AMDGPU_CS_GANG_SIZE] = { };
 	struct amdgpu_vm *vm = &fpriv->vm;
-	uint64_t *chunk_array_user;
 	uint64_t *chunk_array;
 	uint32_t uf_offset = 0;
 	size_t size;
 	int ret;
 	int i;
 
-	chunk_array = kvmalloc_array(cs->in.num_chunks, sizeof(uint64_t),
-				     GFP_KERNEL);
-	if (!chunk_array)
-		return -ENOMEM;
-
-	/* get chunks */
-	chunk_array_user = u64_to_user_ptr(cs->in.chunks);
-	if (copy_from_user(chunk_array, chunk_array_user,
-			   sizeof(uint64_t)*cs->in.num_chunks)) {
-		ret = -EFAULT;
-		goto free_chunk;
-	}
+	chunk_array = memdup_array_user(u64_to_user_ptr(cs->in.chunks),
+					cs->in.num_chunks,
+					sizeof(uint64_t));
+	if (IS_ERR(chunk_array))
+		return PTR_ERR(chunk_array);
 
 	p->nchunks = cs->in.num_chunks;
 	p->chunks = kvmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk),
@@ -209,7 +201,6 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
 	for (i = 0; i < p->nchunks; i++) {
 		struct drm_amdgpu_cs_chunk __user *chunk_ptr = NULL;
 		struct drm_amdgpu_cs_chunk user_chunk;
-		uint32_t __user *cdata;
 
 		chunk_ptr = u64_to_user_ptr(chunk_array[i]);
 		if (copy_from_user(&user_chunk, chunk_ptr,
@@ -222,20 +213,16 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
 		p->chunks[i].length_dw = user_chunk.length_dw;
 
 		size = p->chunks[i].length_dw;
-		cdata = u64_to_user_ptr(user_chunk.chunk_data);
 
-		p->chunks[i].kdata = kvmalloc_array(size, sizeof(uint32_t),
-						    GFP_KERNEL);
-		if (p->chunks[i].kdata == NULL) {
-			ret = -ENOMEM;
+		p->chunks[i].kdata = vmemdup_array_user(u64_to_user_ptr(user_chunk.chunk_data),
+							size,
+							sizeof(uint32_t));
+		if (IS_ERR(p->chunks[i].kdata)) {
+			ret = PTR_ERR(p->chunks[i].kdata);
 			i--;
 			goto free_partial_kdata;
 		}
 		size *= sizeof(uint32_t);
-		if (copy_from_user(p->chunks[i].kdata, cdata, size)) {
-			ret = -EFAULT;
-			goto free_partial_kdata;
-		}
 
 		/* Assume the worst on the following checks */
 		ret = -EINVAL;
]

213/4 2026/10/13 23:07 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 117096
							output: 199
							thoughts: 339
						

Thoughts:
**Analyzing `vmemdup_array_user` Usage and Safety**

Okay, so I've been reviewing this patch, and I've spotted a pattern with `vmemdup_array_user`. I see that in commit `d4b6274cbf0b`, it's used alongside `kvfree(p->chunks[i].kdata)`. Then, in commit `cb77b79abf5f`, the same function is used with `kvfree(handles)`. Now, I'm looking at this `drm_lease.c` file, and I'm noticing a similar pairing: `vmemdup_array_user` is being used with `kvfree(object_ids)`. That's the key thing.

My concern is to ensure these calls are truly balanced and don't introduce any subtle memory leaks or use-after-free scenarios. I need to make sure I haven't missed anything obvious. I'm going to run this by `codeexpert`. To that end, I'll formulate a precise question, covering all the bases.

Here's my question for `codeexpert`:

"In drivers/gpu/drm/drm_lease.c:

1.  I'm changing `kzalloc_objs(struct drm_mode_object *, object_count)` to `kvzalloc_objs` and `kfree(objects)` to `kvfree(objects)` within the `fill_object_idr()` function.
2.  In `drm_mode_create_lease_ioctl()`, I'm switching from `memdup_array_user(...)` to `vmemdup_array_user(...)` and replacing `kfree(object_ids)` with `kvfree(object_ids)`.
3.  I'm adding an early check in `drm_mode_create_lease_ioctl()`: `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;`.

Are there any corner cases, lifetime issues, or missing includes/prerequisites that I need to be aware of with these proposed changes? I need to be completely sure that the memory management is sound and that I haven't inadvertently introduced a vulnerability or instability."



214/4 2026/10/13 23:07 tool codeexpert
6m Args:
map[Question:In drivers/gpu/drm/drm_lease.c:
1. In fill_object_idr(), changing kzalloc_objs(struct drm_mode_object *, object_count) to kvzalloc_objs(struct drm_mode_object *, object_count) and kfree(objects) to kvfree(objects).
2. In drm_mode_create_lease_ioctl(), changing memdup_array_user() to vmemdup_array_user() and kfree(object_ids) to kvfree(object_ids).
3. In drm_mode_create_lease_ioctl(), adding an early check:
if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;
Are there any corner cases, lifetime issues, or missing includes/prerequisites with these changes?]

Results:
map[Answer:Analysis of the proposed changes in `drivers/gpu/drm/drm_lease.c`:

### 1. Lifetime Issues
* **Lessor Master Reference Leak (Corner Case / Placement Issue in Change 3)**:
  * In `drm_mode_create_lease_ioctl()`, `lessor = drm_file_get_master(lessor_priv)` increments the reference count of the lessor (`drm_master`).
  * If the early check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;` is placed **after** `drm_file_get_master()`, an immediate `return -EINVAL;` will **leak the lessor reference**.
  * To avoid leaking `lessor`, the check must either be placed **before** `drm_file_get_master()` (e.g., right alongside the `cl->flags` check), or jump to `goto out_lessor;`.
* **Allocation Lifetimes (Changes 1 & 2)**:
  * No lifetime issues with the allocated buffers.
  * `objects` in `fill_object_idr()` is strictly local to the function: all acquired `drm_mode_object` references are released via `drm_mode_object_put()` before `kvfree(objects)` is called.
  * `object_ids` in `drm_mode_create_lease_ioctl()` is strictly local to the ioctl and is freed with `kvfree(object_ids)` immediately after `fill_object_idr()` returns. Replacing `kfree()` with `kvfree()` correctly matches `vmemdup_array_user()`.

### 2. Corner Cases and Type Interactions
* **Signed vs Unsigned / Integer Overflow in `fill_object_idr()` and `validate_lease()`**:
  * In `struct drm_mode_create_lease`, `cl->object_count` is `__u32`.
  * However, `fill_object_idr()` and `validate_lease()` declare `object_count` as signed `int`, and `validate_lease()` uses `int o` as its loop counter.
  * Without a bound on `cl->object_count`, passing a count $> \text{INT\_MAX}$ would result in sign overflow when converted to `int`. Checking `cl->object_count > INT_MAX / sizeof(...)` ensures that `object_count` fits safely in `int` without signed integer overflow.
* **Empty Leases (`object_count == 0`)**:
  * An `object_count` of 0 is valid in DRM leasing (commit `4bb2d367a5a2 drm/lease: allow empty leases`). Because `0 <= INT_MAX / sizeof(...)`, the check correctly handles empty leases without triggering early rejection.
* **Error Return Code Difference**:
  * Previously, allocating an excessively huge array via `memdup_array_user()` would return `-ENOMEM` (or `-EOVERFLOW` from `check_mul_overflow()`). Returning `-EINVAL` early changes the user-visible errno on oversized requests from `-ENOMEM`/`-EOVERFLOW` to `-EINVAL`.

### 3. Missing Includes / Prerequisites
* **`INT_MAX`**:
  * Defined in `<linux/limits.h>`. `drivers/gpu/drm/drm_lease.c` does not explicitly include `<linux/limits.h>` or `<linux/kernel.h>`. While it may be pulled in transitively via other headers on some configs, `<linux/limits.h>` should be explicitly included.
* **`vmemdup_array_user`**:
  * Defined in `<linux/string.h>`.
* **`kvzalloc_objs` and `kvfree`**:
  * Defined in `<linux/slab.h>`. Explicit inclusion of `<linux/slab.h>` is recommended if not relying on transitive includes.]

215/5 2026/10/13 23:07 agent codeexpert
6m Model:
core

Results:
map[Answer:Analysis of the proposed changes in `drivers/gpu/drm/drm_lease.c`:

### 1. Lifetime Issues
* **Lessor Master Reference Leak (Corner Case / Placement Issue in Change 3)**:
  * In `drm_mode_create_lease_ioctl()`, `lessor = drm_file_get_master(lessor_priv)` increments the reference count of the lessor (`drm_master`).
  * If the early check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;` is placed **after** `drm_file_get_master()`, an immediate `return -EINVAL;` will **leak the lessor reference**.
  * To avoid leaking `lessor`, the check must either be placed **before** `drm_file_get_master()` (e.g., right alongside the `cl->flags` check), or jump to `goto out_lessor;`.
* **Allocation Lifetimes (Changes 1 & 2)**:
  * No lifetime issues with the allocated buffers.
  * `objects` in `fill_object_idr()` is strictly local to the function: all acquired `drm_mode_object` references are released via `drm_mode_object_put()` before `kvfree(objects)` is called.
  * `object_ids` in `drm_mode_create_lease_ioctl()` is strictly local to the ioctl and is freed with `kvfree(object_ids)` immediately after `fill_object_idr()` returns. Replacing `kfree()` with `kvfree()` correctly matches `vmemdup_array_user()`.

### 2. Corner Cases and Type Interactions
* **Signed vs Unsigned / Integer Overflow in `fill_object_idr()` and `validate_lease()`**:
  * In `struct drm_mode_create_lease`, `cl->object_count` is `__u32`.
  * However, `fill_object_idr()` and `validate_lease()` declare `object_count` as signed `int`, and `validate_lease()` uses `int o` as its loop counter.
  * Without a bound on `cl->object_count`, passing a count $> \text{INT\_MAX}$ would result in sign overflow when converted to `int`. Checking `cl->object_count > INT_MAX / sizeof(...)` ensures that `object_count` fits safely in `int` without signed integer overflow.
* **Empty Leases (`object_count == 0`)**:
  * An `object_count` of 0 is valid in DRM leasing (commit `4bb2d367a5a2 drm/lease: allow empty leases`). Because `0 <= INT_MAX / sizeof(...)`, the check correctly handles empty leases without triggering early rejection.
* **Error Return Code Difference**:
  * Previously, allocating an excessively huge array via `memdup_array_user()` would return `-ENOMEM` (or `-EOVERFLOW` from `check_mul_overflow()`). Returning `-EINVAL` early changes the user-visible errno on oversized requests from `-ENOMEM`/`-EOVERFLOW` to `-EINVAL`.

### 3. Missing Includes / Prerequisites
* **`INT_MAX`**:
  * Defined in `<linux/limits.h>`. `drivers/gpu/drm/drm_lease.c` does not explicitly include `<linux/limits.h>` or `<linux/kernel.h>`. While it may be pulled in transitively via other headers on some configs, `<linux/limits.h>` should be explicitly included.
* **`vmemdup_array_user`**:
  * Defined in `<linux/string.h>`.
* **`kvzalloc_objs` and `kvfree`**:
  * Defined in `<linux/slab.h>`. Explicit inclusion of `<linux/slab.h>` is recommended if not relying on transitive includes.]

Instruction:
You are a capable Linux kernel developer tasked with researching complex questions
about kernel source code. You will be given a concrete question, and need to provide
a concrete answer.
Research the question using targeted, efficient tool calls. Don't make assumptions,
or rely on your previous knowledge about the kernel source code, use available tools
to access the actual source code. Keep your tool calls focused and limited to the
scope of the question. Do not explore tangential code paths or perform unbounded searches.
Use all available sources of information:
 - kernel source code
 - documentation in the Documentation dir in the source tree
 - git commits descriptions, git blame

Do not guess file names or file paths and attempt to read them without
verifying their existence first using content search or directory listing tools.
If a file, symbol, or directory is not found via content search (grepper) or
directory listing (codesearch-dir-index), treat it as completely absent.
Do not attempt to guess alternative names, extensions, or directories.

Tool Selection Guidelines:
1. For C functions, structs, and variables: Prefer codesearch-definition-source
   or codesearch-struct-layout FIRST to retrieve clean, exact definitions
   without line-number guessing.
2. If symbol lookup fails (e.g., preprocessor macros, macro-generated code, or
   disabled #ifdef branches), fall back to read-file or grepper.
3. For file headers, #include directives, preprocessor macro definitions, and
   non-C files (Kconfig, Makefiles, docs): Use read-file or grepper directly.
4. Be concise and targeted. Answer the question as directly and concisely as possible
   once you have located the relevant code or definitions. If a symbol or function cannot
   be found after targeted searches, conclude with the best available information rather
   than continuing repetitive searches.
Do NOT use git-log to search for the presence or existence of files in the
repository. git-log is only for tracing commit history of files that are
already present in the current checkout. If a file does not exist in the
current checkout, it cannot be used for reproduction.

Avoid running broad git-log queries (such as searches on the entire repo)
without a specific 'PathPrefix' to restrict the scope, as these are very
expensive and will time out.
If a git-log tool call times out, do not retry the query with the same broad
scope. You must specify a tighter, narrower 'PathPrefix' for subsequent queries.

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:
In drivers/gpu/drm/drm_lease.c:
1. In fill_object_idr(), changing kzalloc_objs(struct drm_mode_object *, object_count) to kvzalloc_objs(struct drm_mode_object *, object_count) and kfree(objects) to kvfree(objects).
2. In drm_mode_create_lease_ioctl(), changing memdup_array_user() to vmemdup_array_user() and kfree(object_ids) to kvfree(object_ids).
3. In drm_mode_create_lease_ioctl(), adding an early check:
if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;
Are there any corner cases, lifetime issues, or missing includes/prerequisites with these changes?

216/6 2026/10/13 23:07 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 4470
							output: 38
							thoughts: 318
						

Thoughts:
**Analyzing Potential Issues in DRM Lease Code Changes**

Okay, let's break this down. The user is asking about potential problems with a few code modifications in `drivers/gpu/drm/drm_lease.c`, specifically related to memory allocation and size limits. My immediate thought is to meticulously assess each change in the context of the surrounding code.

First, the `fill_object_idr()` function: the suggestion involves switching from `kzalloc_objs` to `kvzalloc_objs` and from `kfree` to `kvfree`. Right off the bat, I need to confirm whether `kzalloc_objs` and `kvzalloc_objs` are even valid function calls. It's likely they are meant to be a variation of `kcalloc`, `kmalloc_array`, or similar memory allocation routines. I need to verify their actual definitions and usage within the kernel to understand the change's impact, especially regarding memory alignment and zero initialization. I'll need to scrutinize the allocation/deallocation patterns in that function, and whether any assumptions are made about the initial state of the memory.

Second, in `drm_mode_create_lease_ioctl()`, there's a proposed change from `memdup_array_user` to `vmemdup_array_user` and `kfree` to `kvfree`. This warrants closer examination. `memdup_array_user` is copying data from user space. The change suggests a `vmemdup` variant. The key here is to confirm that any differences in the functions aren't subtle, and correctly handle potential user-space input vulnerabilities. The change to `kvfree` needs to be considered along with the allocation function being used. The deallocation *must* match the allocation.

Finally, the addition of an early check for `cl->object_count` exceeding `INT_MAX / sizeof(struct drm_mode_object *)` is a good practice. It's designed to prevent integer overflows and potentially out-of-memory errors due to overly large object counts. However, I have to ensure that the check is placed correctly, that the logic is sound and correctly handles all reasonable input. There might be some edge cases to consider when dealing with large numbers, and how they interact with existing code.

Before I jump to conclusions, I need to thoroughly read and understand the sections of `drivers/gpu/drm/drm_lease.c` around `fill_object_idr` and `drm_mode_create_lease_ioctl` in order to determine any corner cases, lifetimes, or missing includes or prerequisites related to these changes.



217/6 2026/10/13 23:07 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:1 LineCount:100]

Results:
map[Contents:   1:	// SPDX-License-Identifier: GPL-2.0-or-later
   2:	/*
   3:	 * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
   4:	 */
   5:	#include <linux/file.h>
   6:	#include <linux/uaccess.h>
   7:	
   8:	#include <drm/drm_auth.h>
   9:	#include <drm/drm_crtc.h>
  10:	#include <drm/drm_drv.h>
  11:	#include <drm/drm_file.h>
  12:	#include <drm/drm_lease.h>
  13:	#include <drm/drm_print.h>
  14:	
  15:	#include "drm_crtc_internal.h"
  16:	#include "drm_internal.h"
  17:	
  18:	/**
  19:	 * DOC: drm leasing
  20:	 *
  21:	 * DRM leases provide information about whether a DRM master may control a DRM
  22:	 * mode setting object. This enables the creation of multiple DRM masters that
  23:	 * manage subsets of display resources.
  24:	 *
  25:	 * The original DRM master of a device 'owns' the available drm resources. It
  26:	 * may create additional DRM masters and 'lease' resources which it controls
  27:	 * to the new DRM master. This gives the new DRM master control over the
  28:	 * leased resources until the owner revokes the lease, or the new DRM master
  29:	 * is closed. Some helpful terminology:
  30:	 *
  31:	 * - An 'owner' is a &struct drm_master that is not leasing objects from
  32:	 *   another &struct drm_master, and hence 'owns' the objects. The owner can be
  33:	 *   identified as the &struct drm_master for which &drm_master.lessor is NULL.
  34:	 *
  35:	 * - A 'lessor' is a &struct drm_master which is leasing objects to one or more
  36:	 *   other &struct drm_master. Currently, lessees are not allowed to
  37:	 *   create sub-leases, hence the lessor is the same as the owner.
  38:	 *
  39:	 * - A 'lessee' is a &struct drm_master which is leasing objects from some
  40:	 *   other &struct drm_master. Each lessee only leases resources from a single
  41:	 *   lessor recorded in &drm_master.lessor, and holds the set of objects that
  42:	 *   it is leasing in &drm_master.leases.
  43:	 *
  44:	 * - A 'lease' is a contract between the lessor and lessee that identifies
  45:	 *   which resources may be controlled by the lessee. All of the resources
  46:	 *   that are leased must be owned by or leased to the lessor, and lessors are
  47:	 *   not permitted to lease the same object to multiple lessees.
  48:	 *
  49:	 * The set of objects any &struct drm_master 'controls' is limited to the set
  50:	 * of objects it leases (for lessees) or all objects (for owners).
  51:	 *
  52:	 * Objects not controlled by a &struct drm_master cannot be modified through
  53:	 * the various state manipulating ioctls, and any state reported back to user
  54:	 * space will be edited to make them appear idle and/or unusable. For
  55:	 * instance, connectors always report 'disconnected', while encoders
  56:	 * report no possible crtcs or clones.
  57:	 *
  58:	 * Since each lessee may lease objects from a single lessor, display resource
  59:	 * leases form a tree of &struct drm_master. As lessees are currently not
  60:	 * allowed to create sub-leases, the tree depth is limited to 1. All of
  61:	 * these get activated simultaneously when the top level device owner changes
  62:	 * through the SETMASTER or DROPMASTER IOCTL, so &drm_device.master points to
  63:	 * the owner at the top of the lease tree (i.e. the &struct drm_master for which
  64:	 * &drm_master.lessor is NULL). The full list of lessees that are leasing
  65:	 * objects from the owner can be searched via the owner's
  66:	 * &drm_master.lessee_idr.
  67:	 */
  68:	
  69:	#define drm_for_each_lessee(lessee, lessor) \
  70:		list_for_each_entry((lessee), &(lessor)->lessees, lessee_list)
  71:	
  72:	static uint64_t drm_lease_idr_object;
  73:	
  74:	struct drm_master *drm_lease_owner(struct drm_master *master)
  75:	{
  76:		while (master->lessor != NULL)
  77:			master = master->lessor;
  78:		return master;
  79:	}
  80:	
  81:	static struct drm_master*
  82:	_drm_find_lessee(struct drm_master *master, int lessee_id)
  83:	{
  84:		lockdep_assert_held(&master->dev->mode_config.idr_mutex);
  85:		return idr_find(&drm_lease_owner(master)->lessee_idr, lessee_id);
  86:	}
  87:	
  88:	static int _drm_lease_held_master(struct drm_master *master, int id)
  89:	{
  90:		lockdep_assert_held(&master->dev->mode_config.idr_mutex);
  91:		if (master->lessor)
  92:			return idr_find(&master->leases, id) != NULL;
  93:		return true;
  94:	}
  95:	
  96:	/* Checks if the given object has been leased to some lessee of drm_master */
  97:	static bool _drm_has_leased(struct drm_master *master, int id)
  98:	{
  99:		struct drm_master *lessee;
 100:	
]

218/6 2026/10/13 23:07 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 7037
							output: 48
							thoughts: 42
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach summarizing the code, thinking like a seasoned developer in this domain:

**Analyzing `drivers/gpu/drm/drm_lease.c`**

Alright, I'm heading into `drivers/gpu/drm/drm_lease.c` to see what's going on. Specifically, I need to get a handle on how these leases are implemented in the DRM subsystem, so I'll be homing in on the `fill_object_idr` and `drm_mode_create_lease_ioctl` functions. The former likely deals with populating an IDR (Integer ID Registry) with lease-related objects, and the latter is probably the ioctl that handles the creation of a lease. I need to understand how the IDR is used to track the leased objects. I'll be looking for things like how objects are allocated and deallocated within the IDR, any locking mechanisms used to protect the IDR, and how the information is being passed to the user space through the `ioctl` call. I expect `fill_object_idr` to handle the IDR population in a thread safe manner, considering that multiple processes could be creating and using leases simultaneously. I'll keep an eye out for potential race conditions and how the code mitigates them. Specifically, I'm interested in the security aspect of this design - how are these leases created and managed? What permissions are being checked? I'll also look for error handling; I'm curious what happens if something goes wrong during lease creation or object registration.



219/6 2026/10/13 23:07 tool grepper
0m Args:
map[Expression:fill_object_idr|drm_mode_create_lease_ioctl PathPrefixes:[drivers/gpu/drm/drm_lease.c]]

Results:
map[Output:drivers/gpu/drm/drm_lease.c=346=static int validate_lease(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-377-
drivers/gpu/drm/drm_lease.c:378:static int fill_object_idr(struct drm_device *dev,
drivers/gpu/drm/drm_lease.c-379-			   struct drm_file *lessor_priv,
--
drivers/gpu/drm/drm_lease.c-474- */
drivers/gpu/drm/drm_lease.c:475:int drm_mode_create_lease_ioctl(struct drm_device *dev,
drivers/gpu/drm/drm_lease.c-476-				void *data, struct drm_file *lessor_priv)
--
drivers/gpu/drm/drm_lease.c-520-		/* fill and validate the object idr */
drivers/gpu/drm/drm_lease.c:521:		ret = fill_object_idr(dev, lessor_priv, &leases,
drivers/gpu/drm/drm_lease.c-522-				      object_count, object_ids);
--
drivers/gpu/drm/drm_lease.c-572-	drm_master_put(&lessor);
drivers/gpu/drm/drm_lease.c:573:	drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
drivers/gpu/drm/drm_lease.c-574-	return 0;
--
drivers/gpu/drm/drm_lease.c-583-	drm_master_put(&lessor);
drivers/gpu/drm/drm_lease.c:584:	drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
drivers/gpu/drm/drm_lease.c-585-	return ret;
]

220/6 2026/10/13 23:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 7951
							output: 40
							thoughts: 48
						

Thoughts:
Okay, let's dive into `drivers/gpu/drm/drm_lease.c`. Specifically, I want to refresh my memory on the lease creation process, so I'll zero in on `fill_object_idr` and `drm_mode_create_lease_ioctl`, covering lines 375 to 600. I need to understand how the DRM subsystem manages and tracks leased objects. Specifically, I'm thinking about the object ID assignment within the IDR and the actual IOCTL implementation for lease creation. I'm going to pay close attention to the data structures involved, the locking mechanisms used, and the error handling flow. This should refresh my knowledge of the interaction between the driver and the kernel within the context of hardware leasing.



221/6 2026/10/13 23:08 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:375 LineCount:100]

Results:
map[Contents: 375:		return 0;
 376:	}
 377:	
 378:	static int fill_object_idr(struct drm_device *dev,
 379:				   struct drm_file *lessor_priv,
 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
 465:		kfree(objects);
 466:		return ret;
 467:	}
 468:	
 469:	/*
 470:	 * The master associated with the specified file will have a lease
 471:	 * created containing the objects specified in the ioctl structure.
 472:	 * A file descriptor will be allocated for that and returned to the
 473:	 * application.
 474:	 */
]

222/6 2026/10/13 23:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 9788
							output: 40
							thoughts: 30
						

Thoughts:
Okay, let's dive into this `drm_mode_create_lease_ioctl` function, specifically focusing on lines 470 to 590. My immediate thought is, what are we trying to achieve here? This ioctl likely deals with the allocation or establishment of some kind of lease related to DRM modes – very interesting. I need to understand the control flow, the data structures involved, and the potential error conditions handled within this section. Given the length, it's probably handling several steps of the lease creation process. I expect to see allocations, permission checks, perhaps some synchronization primitives, and definitely some error handling. Let's see how they've chosen to implement this in the kernel. This is probably a critical part for security and resource management within the display system. I’m keen to see if they're employing any innovative strategies or whether it’s a standard approach. Let's get reading and dissect this.



223/6 2026/10/13 23:08 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:470 LineCount:100]

Results:
map[Contents: 470:	 * The master associated with the specified file will have a lease
 471:	 * created containing the objects specified in the ioctl structure.
 472:	 * A file descriptor will be allocated for that and returned to the
 473:	 * application.
 474:	 */
 475:	int drm_mode_create_lease_ioctl(struct drm_device *dev,
 476:					void *data, struct drm_file *lessor_priv)
 477:	{
 478:		struct drm_mode_create_lease *cl = data;
 479:		size_t object_count;
 480:		int ret = 0;
 481:		struct idr leases;
 482:		struct drm_master *lessor;
 483:		struct drm_master *lessee = NULL;
 484:		struct file *lessee_file = NULL;
 485:		struct file *lessor_file = lessor_priv->filp;
 486:		struct drm_file *lessee_priv;
 487:		int fd = -1;
 488:		uint32_t *object_ids;
 489:	
 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
 535:			ret = fd;
 536:			goto out_lessor;
 537:		}
 538:	
 539:		drm_dbg_lease(dev, "Creating lease\n");
 540:		/* lessee will take the ownership of leases */
 541:		lessee = drm_lease_create(lessor, &leases);
 542:	
 543:		if (IS_ERR(lessee)) {
 544:			ret = PTR_ERR(lessee);
 545:			idr_destroy(&leases);
 546:			goto out_leases;
 547:		}
 548:	
 549:		/* Clone the lessor file to create a new file for us */
 550:		drm_dbg_lease(dev, "Allocating lease file\n");
 551:		lessee_file = file_clone_open(lessor_file);
 552:		if (IS_ERR(lessee_file)) {
 553:			ret = PTR_ERR(lessee_file);
 554:			goto out_lessee;
 555:		}
 556:	
 557:		lessee_priv = lessee_file->private_data;
 558:		/* Change the file to a master one */
 559:		drm_master_put(&lessee_priv->master);
 560:		lessee_priv->master = lessee;
 561:		lessee_priv->is_master = 1;
 562:		lessee_priv->authenticated = 1;
 563:	
 564:		/* Pass fd back to userspace */
 565:		drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id);
 566:		cl->fd = fd;
 567:		cl->lessee_id = lessee->lessee_id;
 568:	
 569:		/* Hook up the fd */
]

224/6 2026/10/13 23:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 11610
							output: 39
							thoughts: 21
						

Thoughts:
Okay, here's the summary, rendered as a first-person account, focusing on the specified task, assuming the user is an expert.

**Analyzing the Concluding Section**

Alright, I'm diving back in. I've been working my way through this document, but I want to make sure I grasp the final arguments in their entirety. Let me just skip ahead to lines 570-600. It's often the concluding section that really crystallizes the core claims and ties everything together. I want to see how this wraps up, what nuances are added, and if there are any subtle shifts in the author's position from earlier points. Often, the conclusion will bring in a summarization of all that has come before, and I am especially curious as to what points will be emphasized as well as what will be left out. I'll need to pay close attention to the rhetoric, too – see if the tone solidifies or softens the argument. I want to get the final flavor of the piece. I'm looking for a clean, strong finish here, not a rushed or ambiguous one, especially in the conclusion.



225/6 2026/10/13 23:08 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:569 LineCount:35]

Results:
map[Contents: 569:		/* Hook up the fd */
 570:		fd_install(fd, lessee_file);
 571:	
 572:		drm_master_put(&lessor);
 573:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
 574:		return 0;
 575:	
 576:	out_lessee:
 577:		drm_master_put(&lessee);
 578:	
 579:	out_leases:
 580:		put_unused_fd(fd);
 581:	
 582:	out_lessor:
 583:		drm_master_put(&lessor);
 584:		drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
 585:		return ret;
 586:	}
 587:	
 588:	int drm_mode_list_lessees_ioctl(struct drm_device *dev,
 589:				       void *data, struct drm_file *lessor_priv)
 590:	{
 591:		struct drm_mode_list_lessees *arg = data;
 592:		__u32 __user *lessee_ids = (__u32 __user *) (uintptr_t) (arg->lessees_ptr);
 593:		__u32 count_lessees = arg->count_lessees;
 594:		struct drm_master *lessor, *lessee;
 595:		int count;
 596:		int ret = 0;
 597:	
 598:		if (arg->pad)
 599:			return -EINVAL;
 600:	
 601:		/* Can't lease without MODESET */
 602:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 603:			return -EOPNOTSUPP;
]

226/6 2026/10/13 23:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 12455
							output: 23
							thoughts: 298
						

Thoughts:
**Analyzing Proposed Lease Code Changes**

Okay, let's break this down. The question presents three specific changes in `drivers/gpu/drm/drm_lease.c` and asks for potential issues. First, I need to methodically dissect each alteration. I'm seeing changes in memory allocation and deallocation functions, and an integer overflow check being introduced. This raises a few immediate questions.

The first change is switching `kzalloc_objs` to `kvzalloc_objs` and `kfree` to `kvfree`. Right away, my alarm bells are going off. Are these functions even valid replacements? I know the kernel memory allocation ecosystem, but I need to be *sure*. This calls for immediate verification. Is `kvzalloc_objs` defined anywhere? And more critically, does `kzalloc_objs` exist in the kernel? I need to check both before proceeding. Let's go ahead and grep across the codebase to confirm their existence and usage. I'll search for *both* to ensure the proposed change makes sense and to understand where these functions are defined.

This initial analysis is crucial before jumping to broader concerns about lifetimes, corner cases, or missing dependencies. Need to establish that the basic building blocks are what they're supposed to be.



227/6 2026/10/13 23:08 tool grepper
0m Args:
map[Expression:k(zalloc|vzalloc)_objs]

Results:
map[Output:
Full output is too long, showing 200 out of 15737 lines.
Use more precise expression or PathPrefixes if possible.

Number of matching lines per file (1652 files in total):
Documentation/process/coding-style.rst:2
Documentation/process/deprecated.rst:1
Documentation/translations/it_IT/process/coding-style.rst:2
Documentation/translations/it_IT/process/deprecated.rst:1
Documentation/translations/pt_BR/process/deprecated.rst:1
arch/alpha/kernel/module.c:1
arch/arm/kernel/vdso.c:1
arch/arm/mach-footbridge/dc21285.c:1
arch/arm/mach-omap1/mcbsp.c:1
arch/arm/mach-omap2/omap_device.c:1
arch/arm/mach-omap2/pm33xx-core.c:1
arch/arm/mach-omap2/sr_device.c:1
arch/arm/mach-versatile/spc.c:1
arch/arm/xen/enlighten.c:1
arch/arm64/kernel/vdso.c:1
arch/arm64/kvm/nested.c:1
arch/arm64/kvm/vgic/vgic-init.c:2
arch/arm64/kvm/vgic/vgic-irqfd.c:1
arch/arm64/kvm/vgic/vgic-v4.c:1
arch/arm64/net/bpf_jit_comp.c:1
arch/csky/kernel/vdso.c:1
arch/loongarch/kernel/vdso.c:1
arch/loongarch/kvm/intc/pch_pic.c:1
arch/mips/alchemy/common/clock.c:2
arch/mips/alchemy/common/dbdma.c:1
arch/mips/alchemy/common/platform.c:1
arch/mips/alchemy/devboards/platform.c:2
arch/mips/bcm47xx/buttons.c:4
arch/mips/kernel/smp-cps.c:3
arch/parisc/kernel/vdso.c:1
arch/parisc/net/bpf_jit_core.c:1
arch/powerpc/kernel/smp.c:1
arch/powerpc/kernel/vdso.c:1
arch/powerpc/kvm/e500_mmu.c:4
arch/powerpc/mm/drmem.c:2
arch/powerpc/perf/imc-pmu.c:7
arch/powerpc/perf/vpa-dtl.c:1
arch/powerpc/platforms/44x/pci.c:1
arch/powerpc/platforms/powernv/idle.c:1
arch/powerpc/platforms/powernv/memtrace.c:1
arch/powerpc/platforms/powernv/opal-async.c:1
arch/powerpc/platforms/powernv/opal-imc.c:1
arch/powerpc/platforms/powernv/opal-irqchip.c:1
arch/powerpc/platforms/powernv/opal-powercap.c:3
arch/powerpc/platforms/powernv/opal-psr.c:1
arch/powerpc/platforms/powernv/opal-sensor-groups.c:3
arch/powerpc/platforms/powernv/opal-sysparam.c:1
arch/powerpc/platforms/pseries/papr_platform_attributes.c:2
arch/powerpc/sysdev/mpic.c:1
arch/powerpc/sysdev/mpic_msgr.c:1
... and 1602 more files

Documentation/process/coding-style.rst=938=The kernel provides the following general purpose memory allocators:
Documentation/process/coding-style.rst:939:kmalloc(), kzalloc(), kmalloc_objs(), kzalloc_objs(), vmalloc(), and
Documentation/process/coding-style.rst-940-vzalloc().  Please refer to the API documentation for further information
--
Documentation/process/coding-style.rst=964=The preferred form for allocating a zeroed array is the following:
--
Documentation/process/coding-style.rst-967-
Documentation/process/coding-style.rst:968:	p = kzalloc_objs(*p, n, ...);
Documentation/process/coding-style.rst-969-
--
Documentation/process/deprecated.rst=398=become, respectively::
--
Documentation/process/deprecated.rst-402-	ptr = kmalloc_objs(*ptr, count [, gfp] );
Documentation/process/deprecated.rst:403:	ptr = kzalloc_objs(*ptr, count [, gfp] );
Documentation/process/deprecated.rst-404-	ptr = kmalloc_flex(*ptr, flex_member, count [, gfp] );
--
Documentation/translations/it_IT/process/coding-style.rst=940=Il kernel fornisce i seguenti assegnatori ad uso generico:
Documentation/translations/it_IT/process/coding-style.rst:941:kmalloc(), kzalloc(), kmalloc_objs(), kzalloc_objs(), vmalloc(), e vzalloc().
Documentation/translations/it_IT/process/coding-style.rst-942-Per maggiori informazioni, consultate la documentazione dell'API:
--
Documentation/translations/it_IT/process/coding-style.rst=965=Il modo preferito per assegnare un vettore a zero Γ¨ il seguente:
--
Documentation/translations/it_IT/process/coding-style.rst-968-
Documentation/translations/it_IT/process/coding-style.rst:969:	p = kzalloc_objs(*p, n, ...);
Documentation/translations/it_IT/process/coding-style.rst-970-
--
Documentation/translations/it_IT/process/deprecated.rst=441=diventano, rispettivamente::
--
Documentation/translations/it_IT/process/deprecated.rst-445-	ptr = kmalloc_objs(*ptr, count [, gfp] );
Documentation/translations/it_IT/process/deprecated.rst:446:	ptr = kzalloc_objs(*ptr, count [, gfp] );
Documentation/translations/it_IT/process/deprecated.rst-447-	ptr = kmalloc_flex(*ptr, flex_member, count [, gfp] );
--
Documentation/translations/pt_BR/process/deprecated.rst=410=tornam-se, respectivamente::
--
Documentation/translations/pt_BR/process/deprecated.rst-414-        ptr = kmalloc_objs(*ptr, count [, gfp] );
Documentation/translations/pt_BR/process/deprecated.rst:415:        ptr = kzalloc_objs(*ptr, count [, gfp] );
Documentation/translations/pt_BR/process/deprecated.rst-416-        ptr = kmalloc_flex(*ptr, flex_member, count [, gfp] );
--
arch/alpha/kernel/module.c=64=module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
--
arch/alpha/kernel/module.c-95-	nsyms = symtab->sh_size / sizeof(Elf64_Sym);
arch/alpha/kernel/module.c:96:	chains = kzalloc_objs(struct got_entry, nsyms);
arch/alpha/kernel/module.c-97-	if (!chains) {
--
arch/arm/kernel/vdso.c=169=static int __init vdso_init(void)
--
arch/arm/kernel/vdso.c-181-	/* Allocate the VDSO text pagelist */
arch/arm/kernel/vdso.c:182:	vdso_text_pagelist = kzalloc_objs(struct page *, text_pages);
arch/arm/kernel/vdso.c-183-	if (vdso_text_pagelist == NULL)
--
arch/arm/mach-footbridge/dc21285.c=261=int __init dc21285_setup(int nr, struct pci_sys_data *sys)
--
arch/arm/mach-footbridge/dc21285.c-264-
arch/arm/mach-footbridge/dc21285.c:265:	res = kzalloc_objs(struct resource, 2);
arch/arm/mach-footbridge/dc21285.c-266-	if (!res) {
--
arch/arm/mach-omap1/mcbsp.c=292=static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
--
arch/arm/mach-omap1/mcbsp.c-296-
arch/arm/mach-omap1/mcbsp.c:297:	omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size);
arch/arm/mach-omap1/mcbsp.c-298-	if (!omap_mcbsp_devices) {
--
arch/arm/mach-omap2/omap_device.c=131=static int omap_device_build_from_dt(struct platform_device *pdev)
--
arch/arm/mach-omap2/omap_device.c-158-
arch/arm/mach-omap2/omap_device.c:159:	hwmods = kzalloc_objs(struct omap_hwmod *, oh_cnt);
arch/arm/mach-omap2/omap_device.c-160-	if (!hwmods) {
--
arch/arm/mach-omap2/pm33xx-core.c=379=static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
--
arch/arm/mach-omap2/pm33xx-core.c-412-
arch/arm/mach-omap2/pm33xx-core.c:413:	idle_states = kzalloc_objs(*idle_states, state_count);
arch/arm/mach-omap2/pm33xx-core.c-414-	if (!idle_states)
--
arch/arm/mach-omap2/sr_device.c=30=static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
--
arch/arm/mach-omap2/sr_device.c-41-
arch/arm/mach-omap2/sr_device.c:42:	nvalue_table = kzalloc_objs(*nvalue_table, count);
arch/arm/mach-omap2/sr_device.c-43-	if (!nvalue_table)
--
arch/arm/mach-versatile/spc.c=393=static int ve_spc_populate_opps(uint32_t cluster)
--
arch/arm/mach-versatile/spc.c-397-
arch/arm/mach-versatile/spc.c:398:	opps = kzalloc_objs(*opps, MAX_OPPS);
arch/arm/mach-versatile/spc.c-399-	if (!opps)
--
arch/arm/xen/enlighten.c=316=int __init arch_xen_unpopulated_init(struct resource **res)
--
arch/arm/xen/enlighten.c-343-
arch/arm/xen/enlighten.c:344:	regs = kzalloc_objs(*regs, nr_reg);
arch/arm/xen/enlighten.c-345-	if (!regs) {
--
arch/arm64/kernel/vdso.c=68=static int __init __vdso_init(enum vdso_abi abi)
--
arch/arm64/kernel/vdso.c-83-
arch/arm64/kernel/vdso.c:84:	vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages);
arch/arm64/kernel/vdso.c-85-	if (vdso_pagelist == NULL)
--
arch/arm64/kvm/nested.c=83=int kvm_vcpu_init_nested(struct kvm_vcpu *vcpu)
--
arch/arm64/kvm/nested.c-106-
arch/arm64/kvm/nested.c:107:		tmp = kvzalloc_objs(*tmp, S2_MMU_PER_VCPU, GFP_KERNEL_ACCOUNT);
arch/arm64/kvm/nested.c-108-		if (!tmp)
--
arch/arm64/kvm/vgic/vgic-init.c=204=static int kvm_vgic_dist_init(struct kvm *kvm, unsigned int nr_spis)
--
arch/arm64/kvm/vgic/vgic-init.c-213-	dist->active_spis = (atomic_t)ATOMIC_INIT(0);
arch/arm64/kvm/vgic/vgic-init.c:214:	dist->spis = kzalloc_objs(struct vgic_irq, nr_spis, GFP_KERNEL_ACCOUNT);
arch/arm64/kvm/vgic/vgic-init.c-215-	if (!dist->spis)
--
arch/arm64/kvm/vgic/vgic-init.c=316=static int vgic_allocate_private_irqs_locked(struct kvm_vcpu *vcpu, u32 type)
--
arch/arm64/kvm/vgic/vgic-init.c-331-
arch/arm64/kvm/vgic/vgic-init.c:332:	vgic_cpu->private_irqs = kzalloc_objs(struct vgic_irq,
arch/arm64/kvm/vgic/vgic-init.c-333-					      num_private_irqs,
--
arch/arm64/kvm/vgic/vgic-irqfd.c=142=int kvm_vgic_setup_default_irq_routing(struct kvm *kvm)
--
arch/arm64/kvm/vgic/vgic-irqfd.c-148-
arch/arm64/kvm/vgic/vgic-irqfd.c:149:	entries = kzalloc_objs(*entries, nr, GFP_KERNEL_ACCOUNT);
arch/arm64/kvm/vgic/vgic-irqfd.c-150-	if (!entries)
--
arch/arm64/kvm/vgic/vgic-v4.c=242=int vgic_v4_init(struct kvm *kvm)
--
arch/arm64/kvm/vgic/vgic-v4.c-258-
arch/arm64/kvm/vgic/vgic-v4.c:259:	dist->its_vm.vpes = kzalloc_objs(*dist->its_vm.vpes, nr_vcpus,
arch/arm64/kvm/vgic/vgic-v4.c-260-					 GFP_KERNEL_ACCOUNT);
--
arch/arm64/net/bpf_jit_comp.c=2158=struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)
--
arch/arm64/net/bpf_jit_comp.c-2213-
arch/arm64/net/bpf_jit_comp.c:2214:	ctx.offset = kvzalloc_objs(int, prog->len + 1);
arch/arm64/net/bpf_jit_comp.c-2215-	if (ctx.offset == NULL)
--
arch/csky/kernel/vdso.c=17=static int __init vdso_init(void)
--
arch/csky/kernel/vdso.c-22-	vdso_pagelist =
arch/csky/kernel/vdso.c:23:		kzalloc_objs(struct page *, vdso_pages);
arch/csky/kernel/vdso.c-24-	if (unlikely(vdso_pagelist == NULL)) {
--
arch/loongarch/kernel/vdso.c=45=static int __init init_vdso(void)
--
arch/loongarch/kernel/vdso.c-55-	vdso_info.code_mapping.pages =
arch/loongarch/kernel/vdso.c:56:		kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE);
arch/loongarch/kernel/vdso.c-57-
--
arch/loongarch/kvm/intc/pch_pic.c=413=static int kvm_setup_default_irq_routing(struct kvm *kvm)
--
arch/loongarch/kvm/intc/pch_pic.c-418-
arch/loongarch/kvm/intc/pch_pic.c:419:	entries = kzalloc_objs(*entries, nr);
arch/loongarch/kvm/intc/pch_pic.c-420-	if (!entries)
--
arch/mips/alchemy/common/clock.c=754=static int __init alchemy_clk_init_fgens(int ctype)
--
arch/mips/alchemy/common/clock.c-777-
arch/mips/alchemy/common/clock.c:778:	a = kzalloc_objs(*a, 6);
arch/mips/alchemy/common/clock.c-779-	if (!a)
--
arch/mips/alchemy/common/clock.c=960=static int __init alchemy_clk_setup_imux(int ctype)
--
arch/mips/alchemy/common/clock.c-998-
arch/mips/alchemy/common/clock.c:999:	a = kzalloc_objs(*a, 6);
arch/mips/alchemy/common/clock.c-1000-	if (!a)
--
arch/mips/alchemy/common/dbdma.c=1056=static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable)
--
arch/mips/alchemy/common/dbdma.c-1059-
arch/mips/alchemy/common/dbdma.c:1060:	dbdev_tab = kzalloc_objs(dbdev_tab_t, DBDEV_TAB_SIZE);
arch/mips/alchemy/common/dbdma.c-1061-	if (!dbdev_tab)
--
arch/mips/alchemy/common/platform.c=203=static int __init _new_usbres(struct resource **r, struct platform_device **d)
arch/mips/alchemy/common/platform.c-204-{
arch/mips/alchemy/common/platform.c:205:	*r = kzalloc_objs(struct resource, 2);
arch/mips/alchemy/common/platform.c-206-	if (!*r)
--
arch/mips/alchemy/devboards/platform.c=70=int __init db1x_register_pcmcia_socket(phys_addr_t pcmcia_attr_start,
--
arch/mips/alchemy/devboards/platform.c-91-
arch/mips/alchemy/devboards/platform.c:92:	sr = kzalloc_objs(struct resource, cnt);
arch/mips/alchemy/devboards/platform.c-93-	if (!sr)
--
arch/mips/alchemy/devboards/platform.c=154=int __init db1x_register_norflash(unsigned long size, int width,
--
arch/mips/alchemy/devboards/platform.c-166-	ret = -ENOMEM;
arch/mips/alchemy/devboards/platform.c:167:	parts = kzalloc_objs(struct mtd_partition, 5);
arch/mips/alchemy/devboards/platform.c-168-	if (!parts)
--
arch/mips/bcm47xx/buttons.c=501=bcm47xx_buttons_add(const struct bcm47xx_gpio_key *buttons, int nbuttons)
--
arch/mips/bcm47xx/buttons.c-525-	const struct software_node **node_group __free(kfree) =
arch/mips/bcm47xx/buttons.c:526:		kzalloc_objs(*node_group, 1 + nbuttons + 1);
arch/mips/bcm47xx/buttons.c-527-	if (!node_group)
--
arch/mips/bcm47xx/buttons.c-531-	struct property_entry *props __free(kfree) =
arch/mips/bcm47xx/buttons.c:532:		kzalloc_objs(*props, nbuttons * 3);
arch/mips/bcm47xx/buttons.c-533-	if (!props)
--
arch/mips/bcm47xx/buttons.c-537-	struct software_node *nodes __free(kfree) =
arch/mips/bcm47xx/buttons.c:538:		kzalloc_objs(*nodes, 1 + nbuttons);
arch/mips/bcm47xx/buttons.c-539-	if (!nodes)

]

228/6 2026/10/13 23:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 18474
							output: 33
							thoughts: 46
						

Thoughts:
Okay, here's my interpretation of that thought process, from an expert's perspective:

**Finding the Source: `kzalloc_objs` and `kvzalloc_objs`**

Right, let's track down the definitions for `kzalloc_objs` and `kvzalloc_objs`. These are obviously macros, likely related to kernel memory allocation, but I need to know precisely *where* they're defined. That's crucial for understanding their context and how they're used. Time to leverage `grep` – the workhorse! I'll target the preprocessor definitions directly. A simple search for `#define` followed by either of the target macros – `#define.*kzalloc_objs` and `#define.*kvzalloc_objs` – should get me the exact lines I'm after, making it quick to locate where these macros are declared. This approach is efficient and directly targets the desired information within the codebase.



229/6 2026/10/13 23:08 tool grepper
0m Args:
map[Expression:#define (kzalloc_objs|kvzalloc_objs|kmalloc_objs)]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1135- */
include/linux/slab.h:1136:#define kmalloc_objs(VAR_OR_TYPE, COUNT, ...) \
include/linux/slab.h-1137-	__alloc_objs(kmalloc, default_gfp(__VA_ARGS__), typeof(VAR_OR_TYPE), COUNT)
--
include/linux/slab.h-1156-	__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
include/linux/slab.h:1157:#define kzalloc_objs(P, COUNT, ...) \
include/linux/slab.h-1158-	__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
--
include/linux/slab.h-1172-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
include/linux/slab.h:1173:#define kvzalloc_objs(P, COUNT, ...) \
include/linux/slab.h-1174-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
--
tools/virtio/linux/kernel.h=63=static inline void *kmalloc_array(unsigned n, size_t s, gfp_t gfp)
--
tools/virtio/linux/kernel.h-70-
tools/virtio/linux/kernel.h:71:#define kmalloc_objs(VAR_OR_TYPE, COUNT, ...) \
tools/virtio/linux/kernel.h-72-	((typeof(VAR_OR_TYPE) *)kmalloc(sizeof(typeof(VAR_OR_TYPE)) * (COUNT), 0))
]

230/6 2026/10/13 23:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 19244
							output: 36
							thoughts: 51
						

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

**Diving into Slab Allocation Details**

Okay, I need to refresh my memory on the specifics of those kernel allocation functions, `kzalloc_objs`, `kvzalloc_objs`, and their kin. I seem to recall they're defined within the `slab.h` header, but I should double-check. I'll navigate to `include/linux/slab.h` and target around lines 1130 to 1180. That should give me the source for the `*zalloc_objs` definitions.

I'm particularly interested in the header files this code includes as a refresher on their dependencies. It's important to understand the layering and the interaction with other kernel subsystems when looking at allocation routines. I need to make sure I grasp the relevant structures and macros. Time to get down to specifics.



231/6 2026/10/13 23:09 tool read-file
0m Args:
map[File:include/linux/slab.h FirstLine:1130 LineCount:55]

Results:
map[Contents:1130:	 * @COUNT: How many elements in the array.
1131:	 * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
1132:	 *
1133:	 * Returns: newly allocated pointer to array of @VAR_OR_TYPE on success,
1134:	 * or NULL on failure.
1135:	 */
1136:	#define kmalloc_objs(VAR_OR_TYPE, COUNT, ...) \
1137:		__alloc_objs(kmalloc, default_gfp(__VA_ARGS__), typeof(VAR_OR_TYPE), COUNT)
1138:	
1139:	/**
1140:	 * kmalloc_flex - Allocate a single instance of the given flexible structure
1141:	 * @VAR_OR_TYPE: Variable or type to allocate (with its flex array).
1142:	 * @FAM: The name of the flexible array member of the structure.
1143:	 * @COUNT: How many flexible array member elements are desired.
1144:	 * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
1145:	 *
1146:	 * Returns: newly allocated pointer to @VAR_OR_TYPE on success, NULL on
1147:	 * failure. If @FAM has been annotated with __counted_by(), the allocation
1148:	 * will immediately fail if @COUNT is larger than what the type of the
1149:	 * struct's counter variable can represent.
1150:	 */
1151:	#define kmalloc_flex(VAR_OR_TYPE, FAM, COUNT, ...) \
1152:		__alloc_flex(kmalloc, default_gfp(__VA_ARGS__), typeof(VAR_OR_TYPE), FAM, COUNT)
1153:	
1154:	/* All kzalloc aliases for kmalloc_(obj|objs|flex). */
1155:	#define kzalloc_obj(P, ...) \
1156:		__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
1157:	#define kzalloc_objs(P, COUNT, ...) \
1158:		__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
1159:	#define kzalloc_flex(P, FAM, COUNT, ...)		\
1160:		__alloc_flex(kzalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
1161:	
1162:	/* All kvmalloc aliases for kmalloc_(obj|objs|flex). */
1163:	#define kvmalloc_obj(P, ...) \
1164:		__alloc_objs(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
1165:	#define kvmalloc_objs(P, COUNT, ...) \
1166:		__alloc_objs(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
1167:	#define kvmalloc_flex(P, FAM, COUNT, ...) \
1168:		__alloc_flex(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
1169:	
1170:	/* All kvzalloc aliases for kmalloc_(obj|objs|flex). */
1171:	#define kvzalloc_obj(P, ...) \
1172:		__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
1173:	#define kvzalloc_objs(P, COUNT, ...) \
1174:		__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
1175:	#define kvzalloc_flex(P, FAM, COUNT, ...) \
1176:		__alloc_flex(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
1177:	
1178:	#define kmem_buckets_alloc(_b, _size, _flags)	\
1179:		alloc_hooks(__kmalloc_node_noprof(PASS_KMALLOC_PARAMS(_size, _b, __kmalloc_token(_size)), _flags, NUMA_NO_NODE))
1180:	
1181:	#define kmem_buckets_alloc_node_track_caller(_b, _size, _flags, _node)	\
1182:		alloc_hooks(__kmalloc_node_track_caller_noprof(PASS_KMALLOC_PARAMS(_size, _b, __kmalloc_token(_size)), _flags, _node, _RET_IP_))
1183:	
1184:	#define kmem_buckets_alloc_track_caller(_b, _size, _flags) \
]

232/6 2026/10/13 23:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 20766
							output: 36
							thoughts: 39
						

Thoughts:
Okay, let's dive into this. I need to understand the inner workings of `__alloc_objs`. Since I'm very familiar with kernel internals, I'll go straight to the source, looking at the header file. Specifically, I need to understand what's happening from line 1100 to 1135 in `include/linux/slab.h`. That should give me the relevant definitions and perhaps some inline comments to get a handle on the function's intended purpose and likely implementation details. From there, I'll be able to extrapolate to how it works within the broader memory allocation subsystem.



233/6 2026/10/13 23:09 tool read-file
0m Args:
map[File:include/linux/slab.h FirstLine:1100 LineCount:35]

Results:
map[Contents:1100:	 *
1101:	 * Returns: Newly allocated pointer to @TYPE with @COUNT-many trailing
1102:	 * @FAM elements, or NULL on failure or if @COUNT cannot be represented
1103:	 * by the member of @TYPE that counts the @FAM elements (annotated via
1104:	 * __counted_by()).
1105:	 */
1106:	#define __alloc_flex(KMALLOC, GFP, TYPE, FAM, COUNT)			\
1107:	({									\
1108:		const size_t __count = (COUNT);					\
1109:		const size_t __obj_size = struct_size_t(TYPE, FAM, __count);	\
1110:		TYPE *__obj_ptr = KMALLOC(__obj_size, GFP);			\
1111:		if (__obj_ptr)							\
1112:			__set_flex_counter(__obj_ptr->FAM, __count);		\
1113:		__obj_ptr;							\
1114:	})
1115:	
1116:	/**
1117:	 * kmalloc_obj - Allocate a single instance of the given type
1118:	 * @VAR_OR_TYPE: Variable or type to allocate.
1119:	 * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
1120:	 *
1121:	 * Returns: newly allocated pointer to a @VAR_OR_TYPE on success, or NULL
1122:	 * on failure.
1123:	 */
1124:	#define kmalloc_obj(VAR_OR_TYPE, ...) \
1125:		__alloc_objs(kmalloc, default_gfp(__VA_ARGS__), typeof(VAR_OR_TYPE), 1)
1126:	
1127:	/**
1128:	 * kmalloc_objs - Allocate an array of the given type
1129:	 * @VAR_OR_TYPE: Variable or type to allocate an array of.
1130:	 * @COUNT: How many elements in the array.
1131:	 * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
1132:	 *
1133:	 * Returns: newly allocated pointer to array of @VAR_OR_TYPE on success,
1134:	 * or NULL on failure.
]

234/6 2026/10/13 23:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 21598
							output: 34
							thoughts: 26
						

Thoughts:
Here's a summary of my thought process:

**Hunting Down the Definition of `__alloc_objs`**

Okay, so I see `__alloc_objs` and my first thought is, "Where the heck is that defined?" It's not a standard function I immediately recognize. Given that it's likely a memory allocation function, my next move is to check the header files for common memory allocation routines, specifically `include/linux/slab.h`. That's the most logical place to start digging for its declaration and likely its implementation details. Let's see if it's hiding in there.



235/6 2026/10/13 23:09 tool grepper
0m Args:
map[Expression:#define __alloc_objs PathPrefixes:[include/linux/slab.h]]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1086- */
include/linux/slab.h:1087:#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
include/linux/slab.h-1088-({									\
]

236/6 2026/10/13 23:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 21903
							output: 36
							thoughts: 26
						

Thoughts:
Okay, let's dive into this. Here's my take on those lines:

**Analyzing `include/linux/slab.h` - Lines 1080-1105**

Alright, I'm heading over to `include/linux/slab.h`, specifically lines 1080 to 1105. My brain immediately starts running through the implications. I'm expecting to see something pretty critical about the slab allocator's internals, probably related to object allocation, free lists, or maybe even some of the more advanced features like per-CPU caches or NUMA awareness. Given the range, it's likely a relatively concise block of code, probably defining a structure, a macro, or a key function used in the allocation path. I'm hoping I can glean information about data structures or algorithms employed in the slab allocator to improve the performance of object allocation and deallocation. Or perhaps an important piece of information on memory utilization. Let's get to it and see what's actually there. I'm ready to interpret the details as they unfold.



237/6 2026/10/13 23:09 tool read-file
0m Args:
map[File:include/linux/slab.h FirstLine:1080 LineCount:26]

Results:
map[Contents:1080:	 * @GFP: GFP flags for the allocation.
1081:	 * @TYPE: type to allocate space for.
1082:	 * @COUNT: how many @TYPE objects to allocate.
1083:	 *
1084:	 * Returns: Newly allocated pointer to (first) @TYPE of @COUNT-many
1085:	 * allocated @TYPE objects, or NULL on failure.
1086:	 */
1087:	#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
1088:	({									\
1089:		const size_t __obj_size = size_mul(sizeof(TYPE), COUNT);	\
1090:		(TYPE *)KMALLOC(__obj_size, GFP);				\
1091:	})
1092:	
1093:	/**
1094:	 * __alloc_flex - Allocate an object that has a trailing flexible array
1095:	 * @KMALLOC: kmalloc wrapper function to use for allocation.
1096:	 * @GFP: GFP flags for the allocation.
1097:	 * @TYPE: type of structure to allocate space for.
1098:	 * @FAM: The name of the flexible array member of @TYPE structure.
1099:	 * @COUNT: how many @FAM elements to allocate space for.
1100:	 *
1101:	 * Returns: Newly allocated pointer to @TYPE with @COUNT-many trailing
1102:	 * @FAM elements, or NULL on failure or if @COUNT cannot be represented
1103:	 * by the member of @TYPE that counts the @FAM elements (annotated via
1104:	 * __counted_by()).
1105:	 */
]

238/6 2026/10/13 23:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 22647
							output: 40
							thoughts: 150
						

Thoughts:
**Dissecting the Memory Allocation Macros**

Okay, so I'm looking at `__alloc_objs` and it's calling `KMALLOC` with some arguments: `GFP`, `TYPE`, and `COUNT`. Standard stuff, but hold on a minute, line 1173 has something interesting:

```c
#define kvzalloc_objs(P, COUNT, ...) \
	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
```

Huh, `kvzalloc`... what's that? I need to check if `kvzalloc` is defined in `slab.h`, or somewhere else in the kernel memory management subsystem. That's unusual, I should know this.

And, if we're looking at allocation, where's the corresponding free function? Where is `kvfree` declared? And while I'm at it, I should also find where `vmemdup_array_user` is declared. Gotta get the full picture, so let's get searching.



239/6 2026/10/13 23:10 tool grepper
0m Args:
map[Expression:(kvfree|vmemdup_array_user|kvzalloc)\( PathPrefixes:[include/]]

Results:
map[Output:include/linux/bpfptr.h=68=static inline void *kvmemdup_bpfptr_noprof(bpfptr_t src, size_t len)
--
include/linux/bpfptr.h-74-	if (copy_from_bpfptr(p, src, len)) {
include/linux/bpfptr.h:75:		kvfree(p);
include/linux/bpfptr.h-76-		return ERR_PTR(-EFAULT);
--
include/linux/fwctl.h=22=struct fwctl_ops {
--
include/linux/fwctl.h-53-	 * response pointer. Otherwise the returned pointer is freed with
include/linux/fwctl.h:54:	 * kvfree().
include/linux/fwctl.h-55-	 */
--
include/linux/kvm_host.h=1709=static inline void __kvm_arch_free_vm(struct kvm *kvm)
include/linux/kvm_host.h-1710-{
include/linux/kvm_host.h:1711:	kvfree(kvm);
include/linux/kvm_host.h-1712-}
--
include/linux/ptr_ring.h=619=static inline int ptr_ring_resize_noprof(struct ptr_ring *r, int size, gfp_t gfp,
--
include/linux/ptr_ring.h-636-
include/linux/ptr_ring.h:637:	kvfree(old);
include/linux/ptr_ring.h-638-
--
include/linux/ptr_ring.h=649=static inline int ptr_ring_resize_multiple_bh_noprof(struct ptr_ring **rings,
--
include/linux/ptr_ring.h-676-	for (i = 0; i < nrings; ++i)
include/linux/ptr_ring.h:677:		kvfree(queues[i]);
include/linux/ptr_ring.h-678-
--
include/linux/ptr_ring.h-684-	while (--i >= 0)
include/linux/ptr_ring.h:685:		kvfree(queues[i]);
include/linux/ptr_ring.h-686-
--
include/linux/ptr_ring.h=695=static inline void ptr_ring_cleanup(struct ptr_ring *r, void (*destroy)(void *))
--
include/linux/ptr_ring.h-701-			destroy(ptr);
include/linux/ptr_ring.h:702:	kvfree(r->queue);
include/linux/ptr_ring.h-703-}
--
include/linux/rcupdate.h=994=static inline void rcu_read_unlock_migrate(void)
--
include/linux/rcupdate.h-1096- *
include/linux/rcupdate.h:1097: * where @ptr is the pointer to be freed by kvfree().
include/linux/rcupdate.h-1098- *
--
include/linux/sbitmap.h=185=static inline void sbitmap_free(struct sbitmap *sb)
--
include/linux/sbitmap.h-187-	free_percpu(sb->alloc_hint);
include/linux/sbitmap.h:188:	kvfree(sb->map);
include/linux/sbitmap.h-189-	sb->map = NULL;
--
include/linux/slab.h=1352=void *kvmalloc_node(size_t size, gfp_t flags, int node);
--
include/linux/slab.h-1358-#define kvmalloc_noprof(_size, _flags)		kvmalloc_node_noprof(_size, _flags, NUMA_NO_NODE)
include/linux/slab.h:1359:#define kvzalloc(_size, _flags)			kvmalloc(_size, (_flags)|__GFP_ZERO)
include/linux/slab.h-1360-
--
include/linux/slab.h=1385=void *kvrealloc_node_align_noprof(const void *p, DECL_TOKEN_PARAMS(size, token), unsigned long align,
--
include/linux/slab.h-1409- *
include/linux/slab.h:1410: * This function must not be called concurrently with itself or kvfree() for the
include/linux/slab.h-1411- * same memory allocation.
--
include/linux/slab.h=1415=void *kvrealloc_node_align(const void *p, size_t size, unsigned long align, gfp_t flags, int nid);
--
include/linux/slab.h-1421-
include/linux/slab.h:1422:extern void kvfree(const void *addr);
include/linux/slab.h:1423:DEFINE_FREE(kvfree, void *, if (!IS_ERR_OR_NULL(_T)) kvfree(_T))
include/linux/slab.h-1424-
--
include/linux/string.h=32=void *memdup_array_user(const void __user *src, size_t n, size_t size)
--
include/linux/string.h-48- * Return: an ERR_PTR() on failure. Result may be not
include/linux/string.h:49: * physically contiguous. Use kvfree() to free.
include/linux/string.h-50- */
include/linux/string.h=51=static inline __realloc_size(2, 3)
include/linux/string.h:52:void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
include/linux/string.h-53-{
--
include/net/fq_impl.h=349=static int fq_init(struct fq *fq, int flows_cnt)
--
include/net/fq_impl.h-366-	if (!fq->flows_bitmap) {
include/net/fq_impl.h:367:		kvfree(fq->flows);
include/net/fq_impl.h-368-		fq->flows = NULL;
--
include/net/fq_impl.h=378=static void fq_reset(struct fq *fq,
--
include/net/fq_impl.h-385-
include/net/fq_impl.h:386:	kvfree(fq->flows);
include/net/fq_impl.h-387-	fq->flows = NULL;
--
include/net/inet_hashtables.h=207=static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo)
include/net/inet_hashtables.h-208-{
include/net/inet_hashtables.h:209:	kvfree(hashinfo->ehash_locks);
include/net/inet_hashtables.h-210-	hashinfo->ehash_locks = NULL;
--
include/rdma/rdmavt_qp.h=955=static inline void rvt_free_rq(struct rvt_rq *rq)
include/rdma/rdmavt_qp.h-956-{
include/rdma/rdmavt_qp.h:957:	kvfree(rq->kwq);
include/rdma/rdmavt_qp.h-958-	rq->kwq = NULL;
--
include/trace/events/rcu.h=598=TRACE_EVENT_RCU(rcu_invoke_callback,
--
include/trace/events/rcu.h-621- * Tracepoint for the invocation of a single RCU callback of the special
include/trace/events/rcu.h:622: * kvfree() form.  The first argument is the RCU flavor, the second
include/trace/events/rcu.h-623- * argument is a pointer to the RCU callback, and the third argument
]

240/6 2026/10/13 23:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 25075
							output: 32
							thoughts: 725
						

Thoughts:
**Analyzing Potential Issues in DRM Lease Code**

Okay, so I'm looking at these proposed changes to `drivers/gpu/drm/drm_lease.c`, and my initial thought is, "Hey, `kvzalloc_objs`, `kvfree`, and `vmemdup_array_user` are already defined and used. They're part of standard headers!" It's a bit surprising the question even highlights these functions specifically as needing changes.

Let me take a look at the included headers within the file. I want to be certain that all prerequisites are met. Okay, the includes are: `<linux/file.h>`, `<linux/uaccess.h>`, and the DRM-specific headers: `<drm/drm_auth.h>`, `<drm/drm_crtc.h>`, `<drm/drm_drv.h>`, `<drm/drm_file.h>`, `<drm/drm_lease.h>`, `<drm/drm_print.h>`, along with some internal DRM headers.

The first thing I did was make sure I wasn't missing a header or importing some other function from slab.h or string.h.

I double-checked line 389 and 512 of `drm_lease.c` just to be sure... I see that `kzalloc_objs` is already being used at line 389 and `memdup_array_user` is at line 512. So, changing to the `kv` variants should be straightforward if the kernel configuration permits this.

The question also mentions an integer overflow check. That makes sense, a sanity check is always a good idea, particularly when dealing with user-supplied counts. And it is being added in the same function as `vmemdup_array_user`. That looks fine to me, a good addition.

My next step is to carefully re-read the question's focus. The question's intent is to assess whether there are any corner cases, lifetime issues, or missing includes/prerequisites with *these* specific changes. I see that the question is asking about these *specific* changes.

Therefore, my main concern becomes whether I'm missing something contextually, perhaps a subtlety within the DRM lease code or its interaction with other parts of the graphics stack. So, I will look at the `git log` for this file. It may reveal relevant recent patches, discussions, or bug reports that I need to be aware of.



241/6 2026/10/13 23:10 tool git-log
0m Args:
map[Count:20 PathPrefix:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
f37d63e219c3 drm_lease.c: copy user-array safely
cde3d37b19df drm: Remove unnecessary include statements for drm_crtc_helper.h
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
4bb2d367a5a2 drm/lease: allow empty leases
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
d793b8f732d6 drm: clarify usage of drm leases
56f0729a510f drm: protect drm_master pointers in drm_lease.c
7988fdf5f0a3 drm: Don't include drm_legacy.h in drm_lease.c
948de84233d3 drm : Insert blank lines after declarations.
b216a8e7908c drm/lease: fix WARNING in idr_destroy
c942fddf8793 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
0500c04ea14a drm: drop use of drmP.h in drm/*
46b757780dfe drm/lease: Check for lessor outside of locks
ae9d6c076c0d drm/lease: Drop recursive leads checks
e40b76428842 drm/leases: Drop object_id validation for negative ids
69ef943dbc14 drm: Use array_size() when creating lease
b5f06893c499 drm: Rename crtc_idr as object_idr to KMS cleanups
ce85882860f0 drm/lease: Send a distinct uevent
]

242/6 2026/10/13 23:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 26853
							output: 27
							thoughts: 36
						

Thoughts:
Okay, here's my interpretation of that request, formatted for a user who's an expert in the field:

**Analyzing Commit f37d63e219c3: "drm_lease.c: copy user-array safely"**

Alright, let's dive into commit `f37d63e219c3`.  I need to see this one; the description *specifically* mentions "copy user-array safely" within `drm_lease.c`.  Given my experience, that phrase practically screams potential vulnerability and likely a very specific class of security concern related to user-space interactions in Direct Rendering Manager (DRM). I'm immediately thinking about race conditions, buffer overflows, or format string bugs – anything that could be exploited by malicious user-space code leveraging `drm_lease.c` to manipulate kernel memory or data structures.  The emphasis on safety indicates someone was likely concerned about potential security flaws stemming from improper handling of data received from user space. I'm keen to see the specific mechanism used for the copy and how it's now safeguarded. My immediate concern is if it relates to a memory leak.



243/6 2026/10/13 23:10 tool git-show
0m Args:
map[Commit:f37d63e219c3]

Results:
map[Output:commit f37d63e219c39199a59b8b8a211412ff27192830
Author: Philipp Stanner <pstanner@redhat.com>
Date:   Wed Sep 20 14:36:12 2023 +0200

    drm_lease.c: copy user-array safely
    
    Currently, there is no overflow-check with memdup_user().
    
    Use the new function memdup_array_user() instead of memdup_user() for
    duplicating the user-space array safely.
    
    Suggested-by: David Airlie <airlied@redhat.com>
    Signed-off-by: Philipp Stanner <pstanner@redhat.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Zack Rusin <zackr@vmware.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-6-pstanner@redhat.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 150fe1555068..94375c6a5425 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -510,8 +510,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
-					 array_size(object_count, sizeof(__u32)));
+		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
+					       object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
]

244/6 2026/10/13 23:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 27757
							output: 43
							thoughts: 32
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in my code and referencing those specific commits:

**Diving Deep into Specific Commits**

Alright, I need to get laser-focused on these specific commits: `32a92f8c8932` and `69050f8d6d07`. It's pretty clear something's happening or changing, so I need to understand the relationship between them. I'm going to start by pulling up the diffs, examining the code changes, and tracing any dependencies that might have been impacted. I need to understand the intent of each commit individually, and *then* how they interact. Are these sequential changes addressing a single issue, or are they related in some other way? I need to look closely for any breaking changes, performance implications, or even subtle functional differences. I'm looking for the "why" behind these changes, not just the "what." This analysis is vital for understanding the flow, and any possible issues that may have occurred with the new versions of my work.



245/6 2026/10/13 23:10 tool git-show
0m Args:
map[Commit:32a92f8c8932 File:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:commit 32a92f8c89326985e05dce8b22d3f0aa07a3e1bd
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Feb 21 20:03:00 2026 -0800

    Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
    
    This converts some of the visually simpler cases that have been split
    over multiple lines.  I only did the ones that are easy to verify the
    resulting diff by having just that final GFP_KERNEL argument on the next
    line.
    
    Somebody should probably do a proper coccinelle script for this, but for
    me the trivial script actually resulted in an assertion failure in the
    middle of the script.  I probably had made it a bit _too_ trivial.
    
    So after fighting that far a while I decided to just do some of the
    syntactically simpler cases with variations of the previous 'sed'
    scripts.
    
    The more syntactically complex multi-line cases would mostly really want
    whitespace cleanup anyway.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index f0a5cef17164..5d2cf724cbd7 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,8 +386,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count,
-			       GFP_KERNEL);
+	objects = kzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
]

246/6 2026/10/13 23:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 28592
							output: 24
							thoughts: 56
						

Thoughts:
Here's a summary of my thought process, as requested:

**Diving into DRM Lease Fixes**

Alright, let's get down to brass tacks. I need to take a look at these two commits: `69ef943dbc14` ("drm: Use array_size() when creating lease") and `b216a8e7908c` ("drm/lease: fix WARNING in idr_destroy"). My initial thought is that these are likely related to recent issues I've been tracking concerning the Direct Rendering Manager (DRM) lease handling. The title of the first commit is pretty self-explanatory – I'm expecting to see a proper usage of `array_size()` to improve the clarity and maintainability of some memory allocation. It should be a straightforward change, aiming to prevent buffer overflows or size mismatches. I want to quickly evaluate the before-and-after and make sure it doesn't introduce any regressions, but the intent seems sound.

The second commit, `b216a8e7908c`, has a more concerning title; that "WARNING" flag is always something to pay attention to! An `idr_destroy` warning suggests potential memory corruption or a resource leak related to IDR (ID Radix Tree) management within the DRM lease framework. I need to check the patch and the context of the fix very carefully. I'll need to understand *why* the warning was triggered and confirm that the fix genuinely addresses the root cause and doesn't just silence it. I'll look for potential race conditions, incorrect cleanup routines, or improper usage of the IDR APIs. It's likely related to lease revocation or device detachment, but I'll need to go deeper to be sure. I'm especially interested in the exact warning message and the circumstances that trigger it. I need to ensure this fix doesn't introduce any new flaws in this already complex part of the kernel.



247/6 2026/10/13 23:10 tool git-show
0m Args:
map[Commit:69ef943dbc14]

Results:
map[Output:commit 69ef943dbc14b21987c79f8399ffea08f9a1b446
Author: Matthew Wilcox <willy@infradead.org>
Date:   Thu Feb 14 11:03:48 2019 -0800

    drm: Use array_size() when creating lease
    
    Passing an object_count of sufficient size will make
    object_count * 4 wrap around to be very small, then a later function
    will happily iterate off the end of the object_ids array.  Using
    array_size() will saturate at SIZE_MAX, the kmalloc() will fail and
    we'll return an -ENOMEM to the norty userspace.
    
    Fixes: 62884cd386b8 ("drm: Add four ioctls for managing drm mode object leases [v7]")
    Signed-off-by: Matthew Wilcox <willy@infradead.org>
    Acked-by: Kees Cook <keescook@chromium.org>
    Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: <stable@vger.kernel.org> # v4.15+
    Signed-off-by: Dave Airlie <airlied@redhat.com>

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 99cba8ea5d82..5df1256618cc 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -528,7 +528,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 
 	object_count = cl->object_count;
 
-	object_ids = memdup_user(u64_to_user_ptr(cl->object_ids), object_count * sizeof(__u32));
+	object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
+			array_size(object_count, sizeof(__u32)));
 	if (IS_ERR(object_ids))
 		return PTR_ERR(object_ids);
 
]

248/6 2026/10/13 23:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 29670
							output: 27
							thoughts: 32
						

Thoughts:
Okay, let's dive into this commit, `b216a8e7908c`, which is tagged as "drm/lease: fix WARNING in idr_destroy". I need to understand the context of the `idr_destroy` call within the DRM (Direct Rendering Manager) lease mechanism. This likely deals with resource management, specifically the releasing of IDs associated with leases. A "WARNING" suggests a potential issue, maybe a memory leak, use-after-free, or some kind of race condition during the destruction process. I'll need to scrutinize the code diff to understand where `idr_destroy` is being called and how the relevant structures are being managed, specifically focusing on the lease handling. I need to figure out the conditions that trigger the warning and, crucially, confirm the fix actually addresses the root cause correctly without introducing any regressions or new vulnerabilities. My immediate thought is to check if all necessary cleanup steps are being performed. I need to make sure this fix doesn't simply mask a more fundamental flaw by suppressing the warning, if I can, I can also review the testing done to see how well it covers this fix.



249/6 2026/10/13 23:10 tool git-show
0m Args:
map[Commit:b216a8e7908c]

Results:
map[Output:commit b216a8e7908cd750550c0480cf7d2b3a37f06954
Author: Qiujun Huang <hqjagain@gmail.com>
Date:   Wed Mar 18 15:53:50 2020 +0800

    drm/lease: fix WARNING in idr_destroy
    
    drm_lease_create takes ownership of leases. And leases will be released
    by drm_master_put.
    
    drm_master_put
        ->drm_master_destroy
                ->idr_destroy
    
    So we needn't call idr_destroy again.
    
    Reported-and-tested-by: syzbot+05835159fe322770fe3d@syzkaller.appspotmail.com
    Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/1584518030-4173-1-git-send-email-hqjagain@gmail.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index b481cafdde28..825abe38201a 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -542,10 +542,12 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	}
 
 	DRM_DEBUG_LEASE("Creating lease\n");
+	/* lessee will take the ownership of leases */
 	lessee = drm_lease_create(lessor, &leases);
 
 	if (IS_ERR(lessee)) {
 		ret = PTR_ERR(lessee);
+		idr_destroy(&leases);
 		goto out_leases;
 	}
 
@@ -580,7 +582,6 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 
 out_leases:
 	put_unused_fd(fd);
-	idr_destroy(&leases);
 
 	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl failed: %d\n", ret);
 	return ret;
]

250/6 2026/10/13 23:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 30621
							output: 42
							thoughts: 1128
						

Thoughts:
**Analyzing `drm_mode_create_lease_ioctl` and Proposed Changes**

Okay, let's break this down. I'm looking at the `drm_mode_create_lease_ioctl` function, and my initial thoughts are around the lease creation process.  First, the function checks if modesetting is supported. Then, it validates the input flags and ensures we don't have recursive leases, which is good.  It then handles the object count and processes the object IDs, using an IDR to manage the leased objects.

Now, those changes. Let's start with Change 1.  Switching from `kzalloc_objs` and `kfree` to `kvzalloc_objs` and `kvfree` in `fill_object_idr`?  That's about using vmalloc memory instead of the regular kernel allocator, which could be important for very large object counts or if dealing with fragmented memory.  I need to remember why the original choice was made.

Change 2, in `drm_mode_create_lease_ioctl`, is similar: `memdup_array_user` to `vmemdup_array_user` and `kfree` to `kvfree`. Again, vmalloc usage.  Makes sense, potentially for handling large user-provided arrays.  The goal here is to deal with large `object_count` efficiently.

However, Change 3 is the one that's making me pause.  Adding that early check: `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;`. This is an *integer overflow* protection, presumably to prevent a massive allocation request. But, *where* is it being added?

The crucial question is, *where* does this early check go in the function's execution flow?  If it's *before* the call to `drm_file_get_master(lessor_priv)`, that's straightforward: we're doing a sanity check on the input *before* acquiring a reference to the master.  But if it's *after* `drm_file_get_master(lessor_priv)`, that changes things.  

Look at lines 499-505.

```c
	lessor = drm_file_get_master(lessor_priv);
	/* Do not allow sub-leases */
	if (lessor->lessor) {
		drm_dbg_lease(dev, "recursive leasing not allowed\n");
		ret = -EINVAL;
		goto out_lessor;
	}
```
If the new check is *after* this call, and the check fails, returning `-EINVAL`, we *have* already incremented the reference count on `lessor`. *That's a leak*. We need to be very careful to decrement the reference somehow. This check cannot be inserted after the master reference acquisition.

I need to quickly verify that `drm_file_get_master` does, in fact, increment a reference.  I'll check the source of that function.  I am thinking this check has to be before `drm_file_get_master`.



251/6 2026/10/13 23:11 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_file_get_master]

Results:
map[SourceCode: 378:	/**
 379:	 * drm_file_get_master - reference &drm_file.master of @file_priv
 380:	 * @file_priv: DRM file private
 381:	 *
 382:	 * Increments the reference count of @file_priv's &drm_file.master and returns
 383:	 * the &drm_file.master. If @file_priv has no &drm_file.master, returns NULL.
 384:	 *
 385:	 * Master pointers returned from this function should be unreferenced using
 386:	 * drm_master_put().
 387:	 */
 388:	struct drm_master *drm_file_get_master(struct drm_file *file_priv)
 389:	{
 390:		struct drm_master *master = NULL;
 391:	
 392:		spin_lock(&file_priv->master_lookup_lock);
 393:		if (!file_priv->master)
 394:			goto unlock;
 395:		master = drm_master_get(file_priv->master);
 396:	
 397:	unlock:
 398:		spin_unlock(&file_priv->master_lookup_lock);
 399:		return master;
 400:	}
 SourceFile:drivers/gpu/drm/drm_auth.c]

252/6 2026/10/13 23:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 32865
							output: 42
							thoughts: 290
						

Thoughts:
**Vulnerability Assessment: Lease Object Count Overflow**

Okay, here's what's running through my mind. I'm looking at this code and immediately see a potential issue. If we place the return after `drm_file_get_master`, returning directly *before* a call to `drm_master_put(&lessor)` – or a `goto out_lessor` – we have a pretty clear resource leak of the `lessor` object. That's the obvious one.

But what if we shift things around? My immediate thought is, "What if it's placed before?" – and that makes me think there's some kind of integer overflow possibility.

My next step is to examine the types and parameter to check what `INT_MAX / sizeof(...)` is.

Hold on, let me look at `fill_object_idr`! I see it!
```c
static int fill_object_idr(struct drm_device *dev,
			   struct drm_file *lessor_priv,
			   struct idr *leases,
			   int object_count,
			   u32 *object_ids)
```
Wait! It's the parameter `int object_count`! I notice that `object_count` is of type `int`!

Okay, so I'm connecting the dots now. Let's see what happens within `drm_mode_create_lease_ioctl`:
```c
	struct drm_mode_create_lease *cl = data;
	size_t object_count;
...
	object_count = cl->object_count;
```

Hold on, what is the type of `cl->object_count` in `struct drm_mode_create_lease`? I need to check the definition! This could be a classic integer overflow vulnerability. I think I have a good idea of what's going on now.



253/6 2026/10/13 23:11 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_mode_create_lease]

Results:
map[SourceCode:1425:	/**
1426:	 * struct drm_mode_create_lease - Create lease
1427:	 *
1428:	 * Lease mode resources, creating another drm_master.
1429:	 *
1430:	 * The @object_ids array must reference at least one CRTC, one connector and
1431:	 * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively,
1432:	 * the lease can be completely empty.
1433:	 */
1434:	struct drm_mode_create_lease {
1435:		/** @object_ids: Pointer to array of object ids (__u32) */
1436:		__u64 object_ids;
1437:		/** @object_count: Number of object ids */
1438:		__u32 object_count;
1439:		/** @flags: flags for new FD (O_CLOEXEC, etc) */
1440:		__u32 flags;
1441:	
1442:		/** @lessee_id: Return: unique identifier for lessee. */
1443:		__u32 lessee_id;
1444:		/** @fd: Return: file descriptor to new drm_master file */
1445:		__u32 fd;
1446:	};
 SourceFile:include/uapi/drm/drm_mode.h]

254/6 2026/10/13 23:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 33998
							output: 38
							thoughts: 377
						

Thoughts:
**Vulnerability Detection: Integer Overflow in DRM Lease Creation**

Okay, here's what's running through my head. I'm looking at this `drm_mode_create_lease_ioctl` function, specifically how it handles object counts.  I see `cl->object_count` is defined as a `__u32`. Great. But then, inside this `ioctl`, they're assigning `cl->object_count` to a `size_t` variable called `object_count`. And, looking further, this `object_count` gets passed into `fill_object_idr`.

Now I need to check something... Right, `fill_object_idr` takes an *`int`* for the `object_count` parameter. Hmm... If `cl->object_count`, which is a `__u32` (so potentially a larger value) becomes larger than `INT_MAX`, what's going to happen when that value gets truncated down to an `int`? This is starting to look like an integer overflow vulnerability.

Let me think this through... the comparison looks like this `cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)`. Okay, that makes sense. We are concerned about the number of objects we can pass to the IDR. This means we're limiting the size of the objects. What's the size of the pointer? I know on a 64-bit system, a pointer is 8 bytes. On a 32-bit system, it's 4.  So if we're on a 64-bit system, `INT_MAX / 8` would be around 2^28, or roughly 268 million objects. This is a bit high, but I'm thinking... why this exact calculation of integer division? I'll probably look into this later.

But wait, why am I only looking at this one place? There's `validate_lease`! Let me just quickly go over there and double check to see if something similar occurs there as well.



255/6 2026/10/13 23:11 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:validate_lease]

Results:
map[SourceCode: 346:	static int validate_lease(struct drm_device *dev,
 347:				  int object_count,
 348:				  struct drm_mode_object **objects,
 349:				  bool universal_planes)
 350:	{
 351:		int o;
 352:		int has_crtc = -1;
 353:		int has_connector = -1;
 354:		int has_plane = -1;
 355:	
 356:		/* we want to confirm that there is at least one crtc, plane
 357:		   connector object. */
 358:	
 359:		for (o = 0; o < object_count; o++) {
 360:			if (objects[o]->type == DRM_MODE_OBJECT_CRTC && has_crtc == -1) {
 361:				has_crtc = o;
 362:			}
 363:			if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
 364:				has_connector = o;
 365:	
 366:			if (universal_planes) {
 367:				if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
 368:					has_plane = o;
 369:			}
 370:		}
 371:		if (has_crtc == -1 || has_connector == -1)
 372:			return -EINVAL;
 373:		if (universal_planes && has_plane == -1)
 374:			return -EINVAL;
 375:		return 0;
 376:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

256/6 2026/10/13 23:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 35360
							output: 38
							thoughts: 144
						

Thoughts:
**Analyzing Potential Integer Overflow Vulnerability**

Okay, let's dive into this code. My initial focus is on the `fill_object_idr` function and these loops:

```c
	for (o = 0; o < object_count; o++) {
```

I see that `o` is declared as an `u32` here. However, I'm already noticing a potential discrepancy when I compare it to `validate_lease`, where `o` is an `int`. Furthermore, `object_count` itself is also an `int`. This has immediately raised a red flag. What happens if the `object_count`, and therefore the number of loops, is sufficiently large? The integer `o` could potentially overflow! 

This smells like a possible vulnerability. I need to keep this in mind and dig deeper. The next thing I'll do is check out `vmemdup_array_user` to see if it's related. I'll examine its definition to understand its role in this system.



257/6 2026/10/13 23:11 tool codesearch-definition-source
0m Args:
map[ContextFile:include/linux/string.h Name:vmemdup_array_user]

Results:
map[SourceCode:  42:	/**
  43:	 * vmemdup_array_user - duplicate array from user space
  44:	 * @src: source address in user space
  45:	 * @n: number of array members to copy
  46:	 * @size: size of one array member
  47:	 *
  48:	 * Return: an ERR_PTR() on failure. Result may be not
  49:	 * physically contiguous. Use kvfree() to free.
  50:	 */
  51:	static inline __realloc_size(2, 3)
  52:	void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
  53:	{
  54:		size_t nbytes;
  55:	
  56:		if (check_mul_overflow(n, size, &nbytes))
  57:			return ERR_PTR(-EOVERFLOW);
  58:	
  59:		return vmemdup_user(src, nbytes);
  60:	}
 SourceFile:include/linux/string.h]

258/6 2026/10/13 23:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 36063
							output: 36
							thoughts: 23
						

Thoughts:
Here's my thought process, as if I were considering this code:

**Diving into `vmemdup_user`**

Wait a minute, hold on! My focus just snapped to `vmemdup_user`. Okay, that function name immediately piques my interest. It strongly suggests a user-space memory duplication, meaning we're dealing with transferring data *from* user space *to* the kernel. That's a critical point for security and reliability. Now, the next logical question – where is `vmemdup_user` actually *defined*? I need to track down the implementation. Is it a core kernel function, or part of some module? What header files are included around it? I need the exact source to understand its behavior thoroughly. Understanding how it handles errors, permissions, and potential race conditions is paramount to determining its implications in the broader context of whatever I'm examining. I need that definition!



259/6 2026/10/13 23:11 tool codesearch-definition-source
0m Args:
map[ContextFile:include/linux/string.h Name:vmemdup_user]

Results:
map[SourceCode: 234:	/**
 235:	 * vmemdup_user - duplicate memory region from user space
 236:	 *
 237:	 * @src: source address in user space
 238:	 * @len: number of bytes to copy
 239:	 *
 240:	 * Return: an ERR_PTR() on failure.  Result may be not
 241:	 * physically contiguous.  Use kvfree() to free.
 242:	 */
 243:	void *vmemdup_user(const void __user *src, size_t len)
 244:	{
 245:		void *p;
 246:	
 247:		p = kmem_buckets_valloc(user_buckets, len, GFP_USER);
 248:		if (!p)
 249:			return ERR_PTR(-ENOMEM);
 250:	
 251:		if (copy_from_user(p, src, len)) {
 252:			kvfree(p);
 253:			return ERR_PTR(-EFAULT);
 254:		}
 255:	
 256:		return p;
 257:	}
 SourceFile:mm/util.c]

260/6 2026/10/13 23:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 36667
							output: 34
							thoughts: 382
						

Thoughts:
**Investigating the Mystery of `kzalloc_objs` in `drm_lease.c`**

Okay, here's what's going through my mind as I dig into this. I'm starting by trying to get a lay of the land, specifically regarding what headers are included directly in `drivers/gpu/drm/drm_lease.c`. Let's confirm the included headers: `linux/file.h`, `linux/uaccess.h`, and then the DRM-specific ones like `drm/drm_auth.h`, `drm/drm_crtc.h`, `drm/drm_drv.h`, etc., down to `drm/drm_lease.h` and some internal DRM headers.

Now, my radar is up because I'm looking for indirect dependencies, or unexpected ones. I'm wondering if `<linux/slab.h>` is sneakily included through one of the DRM headers.  I'm also curious about other potential suspects that might introduce memory allocation functions like `<linux/overflow.h>`, `<linux/string.h>`, or `<linux/limits.h>`.

The immediate goal is to understand how `kzalloc_objs` is getting pulled into the compilation.  I need to figure out the include chain leading to `kzalloc_objs`. I know that `linux/slab.h` defines the functions like `kzalloc_objs`, `kvzalloc_objs`, and `kvfree`, so let's start there.

But wait a minute, how did `drm_lease.c` even *compile* with `kzalloc_objs`? Is this even a valid concern? It's essential to confirm that the code actually compiles. Where does `kzalloc_objs` come from within the context of `drm_lease.c`? What is the include hierarchy?

So, I'm going to systematically examine the include files within the DRM space, like `drm_crtc.h`, `drm_file.h`, and others. Then, I could grep the `include/drm/` directory for `slab.h` directly, or check which headers have it included. That should help me figure out the include path!



261/6 2026/10/13 23:11 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:#include <linux/slab.h> PathPrefixes:[include/drm/]]

Results:
map[Output:]

262/6 2026/10/13 23:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 37561
							output: 58
							thoughts: 67
						

Thoughts:
Here's my thought process, as if I were considering this issue:

**Investigating the Missing `<linux/slab.h>` Inclusion**

Okay, so I'm seeing something odd here. I was under the impression that the DRM headers might have a direct dependency on `<linux/slab.h>`, but it seems that's not the case based on what I'm seeing. I need to get a better handle on how memory allocation is handled within the DRM subsystem. Let me double-check a few key headers in `include/drm/` to be sure. I'll start with `drm_print.h`, `drm_crtc.h`, and a few others that seem like they might touch memory management. I really need to understand the inclusion paths and dependencies. If it's not a direct inclusion, where *is* it happening? I can't just assume anything here.

Alright, let's cut to the chase, I'm going to run a quick `grep` for `slab.h` directly within the `drivers/gpu/drm/` directory. That'll show me all the files that explicitly include it, allowing me to understand how slab allocation is incorporated at a lower level. Hopefully, I'll find the culprit and understand how it's being used.



263/6 2026/10/13 23:12 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:#include <linux/slab.h> PathPrefixes:[drivers/gpu/drm/drm_crtc_internal.h drivers/gpu/drm/drm_internal.h]]

Results:
map[Output:]

264/6 2026/10/13 23:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 37974
							output: 28
							thoughts: 185
						

Thoughts:
Okay, let's see. My objective is to pinpoint where `slab.h` is being included within the context of `drivers/gpu/drm/drm_lease.c`. That's a reasonable starting point for debugging some memory allocation issues, or understanding dependencies.

My first thought is to employ a good old `grep`. I'll scan through the include tree of `drm_lease.c` for `slab.h`. Before I launch the `grep`, I'd better confirm the includes to avoid wasting time.

Aha, looks like `drm_lease.c` includes:

*   `<linux/file.h>`
*   `<linux/uaccess.h>`
*   `<drm/drm_auth.h>`
*   `<drm/drm_crtc.h>`
*   `<drm/drm_drv.h>`
*   `<drm/drm_file.h>`
*   `<drm/drm_lease.h>`
*   `<drm/drm_print.h>`
*   `"drm_crtc_internal.h"`
*   `"drm_internal.h"`

Now I'll focus my `grep` on these headers. Based on my experience, it's quite likely that `slab.h` is included transitively. I'll start with the more generic headers, specifically `drm_print.h` and the other drm headers, as those are my best bets. Now it's time for the investigation!



265/6 2026/10/13 23:12 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:slab.h PathPrefixes:[include/drm/]]

Results:
map[Output:]

266/6 2026/10/13 23:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 38521
							output: 35
							thoughts: 16
						

Thoughts:
Okay, let's dive into this. Here's my summary, taking the first-person perspective as requested:

**Peeking Inside `drm/drm_drv.h`**

Alright, time to crack open `drm/drm_drv.h`. I need to get a clear picture of what this core header file pulls in. It's the foundation, the starting point for a lot of the Direct Rendering Manager driver work, so understanding its dependencies is crucial for any deeper analysis or debugging. I'm especially interested in the core structures and function prototypes it defines, and which other headers it relies on to build those definitions. This should quickly give me a sense of the conceptual architecture and what fundamental elements this header exposes. I'm expecting this to be a fast, informative glance rather than an exhaustive line-by-line inspection – but it is the first step!



267/6 2026/10/13 23:12 tool read-file
0m Args:
map[File:include/drm/drm_drv.h FirstLine:1 LineCount:45]

Results:
map[Contents:   1:	/*
   2:	 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
   3:	 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
   4:	 * Copyright (c) 2009-2010, Code Aurora Forum.
   5:	 * Copyright 2016 Intel Corp.
   6:	 *
   7:	 * Permission is hereby granted, free of charge, to any person obtaining a
   8:	 * copy of this software and associated documentation files (the "Software"),
   9:	 * to deal in the Software without restriction, including without limitation
  10:	 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11:	 * and/or sell copies of the Software, and to permit persons to whom the
  12:	 * Software is furnished to do so, subject to the following conditions:
  13:	 *
  14:	 * The above copyright notice and this permission notice (including the next
  15:	 * paragraph) shall be included in all copies or substantial portions of the
  16:	 * Software.
  17:	 *
  18:	 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19:	 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20:	 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  21:	 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  22:	 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  23:	 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  24:	 * OTHER DEALINGS IN THE SOFTWARE.
  25:	 */
  26:	
  27:	#ifndef _DRM_DRV_H_
  28:	#define _DRM_DRV_H_
  29:	
  30:	#include <linux/list.h>
  31:	#include <linux/irqreturn.h>
  32:	
  33:	#include <video/nomodeset.h>
  34:	
  35:	#include <drm/drm_device.h>
  36:	
  37:	struct dmem_cgroup_init;
  38:	struct dmem_cgroup_region;
  39:	struct drm_fb_helper;
  40:	struct drm_fb_helper_surface_size;
  41:	struct drm_file;
  42:	struct drm_gem_object;
  43:	struct drm_master;
  44:	struct drm_minor;
  45:	struct dma_buf;
]

268/6 2026/10/13 23:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 39447
							output: 35
							thoughts: 13
						

Thoughts:
Okay, here's my take on summarizing those thoughts, speaking as an expert:

**Delving into drm/drm_device.h**

Alright, let's see... My brain's buzzing with the standard thought process when I encounter a header like `drm/drm_device.h`. First, my mind jumps to a core question: **"What's in this thing? What key elements define a DRM device in the kernel's eyes?"** I immediately begin to anticipate its contents. I'm thinking, of course, about the fundamental data structures, macros, and function prototypes. Things like the `drm_device` structure itself – that's gotta be central, obviously. What fields are included? How is it laid out? What are the implications of the layout? Are there any significant bitfields to remember? I'm picturing it, trying to remember the major components.

Then the thought process continues: I'm also expecting to find definitions related to device management: How are these devices represented? How are they initialized, registered, and unregistered within the DRM framework? There might be function prototypes for things like resource allocation, memory management related to the device. Any hooks for probe/remove operations would be there.

Are there macros defining some of the device flags, capabilities, or modes? What standard error codes are defined related to the DRM device operations? Any critical inline functions for accessing members of the `drm_device` structure safely? Any important internal helper structs that the kernel uses to deal with DRM device details? I'll probably be able to anticipate most of them, but I need to ensure my assumptions are correct. I need a clear mental model of how the DRM core interacts with these hardware devices.

So, in essence, I'm trying to mentally unpack the contents of `drm/drm_device.h` to solidify my understanding of the DRM device abstraction layer, its role within the graphics stack, and its relationship to the underlying hardware. Knowing it backwards and forwards is crucial!



269/6 2026/10/13 23:12 tool read-file
0m Args:
map[File:include/drm/drm_device.h FirstLine:1 LineCount:40]

Results:
map[Contents:   1:	#ifndef _DRM_DEVICE_H_
   2:	#define _DRM_DEVICE_H_
   3:	
   4:	#include <linux/list.h>
   5:	#include <linux/kref.h>
   6:	#ifdef CONFIG_TRANSPARENT_HUGEPAGE
   7:	#include <linux/mount.h>
   8:	#endif
   9:	#include <linux/mutex.h>
  10:	#include <linux/idr.h>
  11:	#include <linux/sched.h>
  12:	
  13:	#include <drm/drm_mode_config.h>
  14:	
  15:	struct drm_driver;
  16:	struct drm_minor;
  17:	struct drm_master;
  18:	struct drm_vblank_crtc;
  19:	struct drm_vma_offset_manager;
  20:	struct drm_vram_mm;
  21:	struct drm_fb_helper;
  22:	
  23:	struct inode;
  24:	
  25:	struct pci_dev;
  26:	struct pci_controller;
  27:	
  28:	/*
  29:	 * Recovery methods for wedged device in order of less to more side-effects.
  30:	 * To be used with drm_dev_wedged_event() as recovery @method. Callers can
  31:	 * use any one, multiple (or'd) or none depending on their needs.
  32:	 *
  33:	 * Refer to "Device Wedging" chapter in Documentation/gpu/drm-uapi.rst for more
  34:	 * details.
  35:	 */
  36:	#define DRM_WEDGE_RECOVERY_NONE		BIT(0)	/* optional telemetry collection */
  37:	#define DRM_WEDGE_RECOVERY_REBIND	BIT(1)	/* unbind + bind driver */
  38:	#define DRM_WEDGE_RECOVERY_BUS_RESET	BIT(2)	/* unbind + reset bus device + bind */
  39:	#define DRM_WEDGE_RECOVERY_VENDOR	BIT(3)	/* vendor specific recovery method */
  40:	
]

270/6 2026/10/13 23:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 40507
							output: 84
							thoughts: 105
						

Thoughts:
Okay, here's my thought process on this, as if I were working through it:

**Tracing the Origins of Memory Management Functions**

Alright, hang on a second... I was looking at `drm_lease.c` and I'm seeing `kzalloc` and `kfree`, but I'm not sure where these are defined. I thought I knew my memory management, but it's always good to refresh. So, let's step back and figure out where these functions actually originate. I'm seeing that `kfree(objects)` is already used in `drm_lease.c`, which is interesting.

Right, so a quick check. I'm going to bet it's something fundamental, almost certainly `linux/slab.h`. Let's confirm that. Yes, `linux/slab.h` is the likely candidate.

Okay, so the next step is: how is `linux/slab.h` being pulled into `drm_lease.c`? We're going to need to trace the includes. I need to understand the dependencies. Let's see... I'll check the typical suspects in the DRM subsystem, like `drm/drm_file.h`, `drm/drm_auth.h`, etc. Let's see if we can find the include chain that leads to `linux/slab.h`. Then I'll have a complete picture.



271/6 2026/10/13 23:12 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:slab\.h PathPrefixes:[include/drm/drm_file.h include/drm/drm_auth.h include/drm/drm_crtc.h include/drm/drm_lease.h include/drm/drm_mode_config.h]]

Results:
map[Output:]

272/6 2026/10/13 23:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 41047
							output: 37
							thoughts: 25
						

Thoughts:
Here's my take on those files.

**Analyzing Header File Dependencies in the DRM Subsystem**

Alright, let's dive into this. My initial thought is to figure out the architectural landscape of these internal DRM headers. Specifically, I need to know what `drm_crtc_internal.h` and `drm_internal.h` pull in. I'm looking for the scope of their dependencies. Are they tightly coupled with core DRM data structures, or do they reach out into other areas? Are they relying on other internal headers, other kernel subsystems, or userland interfaces? Understanding these inclusions is the first step.



273/6 2026/10/13 23:12 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_internal.h FirstLine:1 LineCount:40]

Results:
map[Contents:   1:	/*
   2:	 * Copyright Β© 2014 Intel Corporation
   3:	 *   Daniel Vetter <daniel.vetter@ffwll.ch>
   4:	 *
   5:	 * Permission is hereby granted, free of charge, to any person obtaining a
   6:	 * copy of this software and associated documentation files (the "Software"),
   7:	 * to deal in the Software without restriction, including without limitation
   8:	 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
   9:	 * and/or sell copies of the Software, and to permit persons to whom the
  10:	 * Software is furnished to do so, subject to the following conditions:
  11:	 *
  12:	 * The above copyright notice and this permission notice shall be included in
  13:	 * all copies or substantial portions of the Software.
  14:	 *
  15:	 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16:	 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17:	 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  18:	 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  19:	 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  20:	 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  21:	 * OTHER DEALINGS IN THE SOFTWARE.
  22:	 */
  23:	
  24:	#ifndef __DRM_INTERNAL_H__
  25:	#define __DRM_INTERNAL_H__
  26:	
  27:	#include <linux/kthread.h>
  28:	#include <linux/types.h>
  29:	
  30:	#include <drm/drm_ioctl.h>
  31:	#include <drm/drm_vblank.h>
  32:	
  33:	#define DRM_IF_MAJOR 1
  34:	#define DRM_IF_MINOR 4
  35:	
  36:	#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
  37:	
  38:	struct dentry;
  39:	struct dma_buf;
  40:	struct iosys_map;
]

274/6 2026/10/13 23:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 41848
							output: 40
							thoughts: 17
						

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

**Diving into `drm_crtc_internal.h`**

Alright, let's take a look at what's being included in `drm_crtc_internal.h`. I'm specifically interested in understanding the dependencies and the overall architecture this header file contributes to within the Direct Rendering Manager (DRM) driver framework. My initial hypothesis is that it's going to pull in definitions and structures specifically pertinent to CRTC managementβ€”the core of display output. We'll likely see dependencies on other DRM core components like modesetting structures, framebuffer management, and possibly some hardware-specific definitions depending on the level of abstraction it intends. I expect a good chunk of it will be related to managing the CRTC's state, enabling, disabling, and handling the various aspects of the display pipeline from the driver perspective. I need to get a better handle on the internal representation and the key data structures used for the CRTC.



275/6 2026/10/13 23:12 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_crtc_internal.h FirstLine:1 LineCount:40]

Results:
map[Contents:   1:	/*
   2:	 * Copyright Β© 2006 Keith Packard
   3:	 * Copyright Β© 2007-2008 Dave Airlie
   4:	 * Copyright Β© 2007-2008 Intel Corporation
   5:	 *   Jesse Barnes <jesse.barnes@intel.com>
   6:	 * Copyright Β© 2014 Intel Corporation
   7:	 *   Daniel Vetter <daniel.vetter@ffwll.ch>
   8:	 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
   9:	 *
  10:	 * Permission is hereby granted, free of charge, to any person obtaining a
  11:	 * copy of this software and associated documentation files (the "Software"),
  12:	 * to deal in the Software without restriction, including without limitation
  13:	 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  14:	 * and/or sell copies of the Software, and to permit persons to whom the
  15:	 * Software is furnished to do so, subject to the following conditions:
  16:	 *
  17:	 * The above copyright notice and this permission notice shall be included in
  18:	 * all copies or substantial portions of the Software.
  19:	 *
  20:	 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21:	 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22:	 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  23:	 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  24:	 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  25:	 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  26:	 * OTHER DEALINGS IN THE SOFTWARE.
  27:	 */
  28:	
  29:	/*
  30:	 * This header file contains mode setting related functions and definitions
  31:	 * which are only used within the drm module as internal implementation details
  32:	 * and are not exported to drivers.
  33:	 */
  34:	
  35:	#ifndef __DRM_CRTC_INTERNAL_H__
  36:	#define __DRM_CRTC_INTERNAL_H__
  37:	
  38:	#include <linux/err.h>
  39:	#include <linux/types.h>
  40:	
]

276/6 2026/10/13 23:13 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 42874
							output: 881
							thoughts: 2071
						

Thoughts:
**Analysis of DRM Lease Code Changes**

Okay, let's break this down systematically. My primary concern here is correctness and potential regressions, so I'm focusing on lifetimes, potential integer overflows, and missing dependencies. Given the context, these changes in the DRM lease code look relatively straightforward, but as always, the devil is in the details.

First, regarding the memory allocation changes in `fill_object_idr()` – swapping `kzalloc_objs` and `kfree` for `kvzalloc_objs` and `kvfree`, respectively, seem okay. The function allocates, populates, validates, and *then* frees the memory within its scope. The use of `kvzalloc` means we potentially use vmalloc for large allocations, but `kvfree` correctly handles both kmalloc and vmalloc allocations, thus ensuring no leaks or dangling pointers are introduced. The references to `drm_mode_object` are managed via `drm_mode_object_put()`, which is crucial for reference counting, and all allocations are cleaned up before function exit. I don't see any apparent issues here. Header prerequisites are likely met, as `<linux/slab.h>` is probably included either directly or indirectly, but it's worth double-checking.

Next, the change in `drm_mode_create_lease_ioctl()` – replacing `memdup_array_user()` with `vmemdup_array_user()` and correspondingly using `kvfree` – is also sound, *provided* that `vmemdup_array_user`'s return value is correctly handled. And it is – the code checks for `IS_ERR()` before proceeding. The lifetimes are well-defined: memory is allocated, used, and freed within the scope of the function. No leaks here, provided `kvfree` is called after allocation, which it is. Again, the inclusion of `<linux/string.h>` for `vmemdup_array_user()` might need explicit checking, but it is typically included by other headers.

Finally, the addition of the `object_count` limit check is a good practice. It's designed to prevent excessively large leases. However, placement is critical. If the check is *after* the `drm_file_get_master` call, returning immediately with `-EINVAL` will cause a reference leak of the `lessor` master object. The fix would be to either move the check *before* the `drm_file_get_master` call or add a jump to the `out_lessor` label on error to ensure the reference is released. This is a very common mistake and needs to be addressed during code review. Now, let's consider the type safety/integer overflow aspects: the original code uses signed `int object_count` in `fill_object_idr()` and `validate_lease()` and the iteration variable `o` in `validate_lease` is signed int, while `cl->object_count` is an unsigned `__u32`. The check `cl->object_count > INT_MAX / sizeof(...)` is key here. It protects against integer overflow and ensures `object_count` fits into the `int` for these internal calls. It also correctly allows empty leases (`object_count == 0`), which are explicitly supported. The inclusion of `<linux/limits.h>` for `INT_MAX` is now required and must be checked, or the build will fail.

In summary, the memory allocation changes are safe. The new check is a valuable addition, but its *placement* is critical to prevent reference leaks. Integer overflow issues are effectively addressed by the limit check, which must be combined with the inclusion of required headers. I'll need to double-check the placement of that check and explicitly add the `#include` directives to make the code robust.



277/6 2026/10/13 23:13 tool set-results
0m Args:
map[Answer:Analysis of the proposed changes in `drivers/gpu/drm/drm_lease.c`:

### 1. Lifetime Issues
* **Lessor Master Reference Leak (Corner Case / Placement Issue in Change 3)**:
  * In `drm_mode_create_lease_ioctl()`, `lessor = drm_file_get_master(lessor_priv)` increments the reference count of the lessor (`drm_master`).
  * If the early check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;` is placed **after** `drm_file_get_master()`, an immediate `return -EINVAL;` will **leak the lessor reference**.
  * To avoid leaking `lessor`, the check must either be placed **before** `drm_file_get_master()` (e.g., right alongside the `cl->flags` check), or jump to `goto out_lessor;`.
* **Allocation Lifetimes (Changes 1 & 2)**:
  * No lifetime issues with the allocated buffers.
  * `objects` in `fill_object_idr()` is strictly local to the function: all acquired `drm_mode_object` references are released via `drm_mode_object_put()` before `kvfree(objects)` is called.
  * `object_ids` in `drm_mode_create_lease_ioctl()` is strictly local to the ioctl and is freed with `kvfree(object_ids)` immediately after `fill_object_idr()` returns. Replacing `kfree()` with `kvfree()` correctly matches `vmemdup_array_user()`.

### 2. Corner Cases and Type Interactions
* **Signed vs Unsigned / Integer Overflow in `fill_object_idr()` and `validate_lease()`**:
  * In `struct drm_mode_create_lease`, `cl->object_count` is `__u32`.
  * However, `fill_object_idr()` and `validate_lease()` declare `object_count` as signed `int`, and `validate_lease()` uses `int o` as its loop counter.
  * Without a bound on `cl->object_count`, passing a count $> \text{INT\_MAX}$ would result in sign overflow when converted to `int`. Checking `cl->object_count > INT_MAX / sizeof(...)` ensures that `object_count` fits safely in `int` without signed integer overflow.
* **Empty Leases (`object_count == 0`)**:
  * An `object_count` of 0 is valid in DRM leasing (commit `4bb2d367a5a2 drm/lease: allow empty leases`). Because `0 <= INT_MAX / sizeof(...)`, the check correctly handles empty leases without triggering early rejection.
* **Error Return Code Difference**:
  * Previously, allocating an excessively huge array via `memdup_array_user()` would return `-ENOMEM` (or `-EOVERFLOW` from `check_mul_overflow()`). Returning `-EINVAL` early changes the user-visible errno on oversized requests from `-ENOMEM`/`-EOVERFLOW` to `-EINVAL`.

### 3. Missing Includes / Prerequisites
* **`INT_MAX`**:
  * Defined in `<linux/limits.h>`. `drivers/gpu/drm/drm_lease.c` does not explicitly include `<linux/limits.h>` or `<linux/kernel.h>`. While it may be pulled in transitively via other headers on some configs, `<linux/limits.h>` should be explicitly included.
* **`vmemdup_array_user`**:
  * Defined in `<linux/string.h>`.
* **`kvzalloc_objs` and `kvfree`**:
  * Defined in `<linux/slab.h>`. Explicit inclusion of `<linux/slab.h>` is recommended if not relying on transitive includes.]

Results:
map[Answer:Analysis of the proposed changes in `drivers/gpu/drm/drm_lease.c`:

### 1. Lifetime Issues
* **Lessor Master Reference Leak (Corner Case / Placement Issue in Change 3)**:
  * In `drm_mode_create_lease_ioctl()`, `lessor = drm_file_get_master(lessor_priv)` increments the reference count of the lessor (`drm_master`).
  * If the early check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) return -EINVAL;` is placed **after** `drm_file_get_master()`, an immediate `return -EINVAL;` will **leak the lessor reference**.
  * To avoid leaking `lessor`, the check must either be placed **before** `drm_file_get_master()` (e.g., right alongside the `cl->flags` check), or jump to `goto out_lessor;`.
* **Allocation Lifetimes (Changes 1 & 2)**:
  * No lifetime issues with the allocated buffers.
  * `objects` in `fill_object_idr()` is strictly local to the function: all acquired `drm_mode_object` references are released via `drm_mode_object_put()` before `kvfree(objects)` is called.
  * `object_ids` in `drm_mode_create_lease_ioctl()` is strictly local to the ioctl and is freed with `kvfree(object_ids)` immediately after `fill_object_idr()` returns. Replacing `kfree()` with `kvfree()` correctly matches `vmemdup_array_user()`.

### 2. Corner Cases and Type Interactions
* **Signed vs Unsigned / Integer Overflow in `fill_object_idr()` and `validate_lease()`**:
  * In `struct drm_mode_create_lease`, `cl->object_count` is `__u32`.
  * However, `fill_object_idr()` and `validate_lease()` declare `object_count` as signed `int`, and `validate_lease()` uses `int o` as its loop counter.
  * Without a bound on `cl->object_count`, passing a count $> \text{INT\_MAX}$ would result in sign overflow when converted to `int`. Checking `cl->object_count > INT_MAX / sizeof(...)` ensures that `object_count` fits safely in `int` without signed integer overflow.
* **Empty Leases (`object_count == 0`)**:
  * An `object_count` of 0 is valid in DRM leasing (commit `4bb2d367a5a2 drm/lease: allow empty leases`). Because `0 <= INT_MAX / sizeof(...)`, the check correctly handles empty leases without triggering early rejection.
* **Error Return Code Difference**:
  * Previously, allocating an excessively huge array via `memdup_array_user()` would return `-ENOMEM` (or `-EOVERFLOW` from `check_mul_overflow()`). Returning `-EINVAL` early changes the user-visible errno on oversized requests from `-ENOMEM`/`-EOVERFLOW` to `-EINVAL`.

### 3. Missing Includes / Prerequisites
* **`INT_MAX`**:
  * Defined in `<linux/limits.h>`. `drivers/gpu/drm/drm_lease.c` does not explicitly include `<linux/limits.h>` or `<linux/kernel.h>`. While it may be pulled in transitively via other headers on some configs, `<linux/limits.h>` should be explicitly included.
* **`vmemdup_array_user`**:
  * Defined in `<linux/string.h>`.
* **`kvzalloc_objs` and `kvfree`**:
  * Defined in `<linux/slab.h>`. Explicit inclusion of `<linux/slab.h>` is recommended if not relying on transitive includes.]

278/4 2026/10/13 23:13 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 119001
							output: 37
							thoughts: 857
						

Thoughts:
**Code Review: DRM Lease Fix Verification**

Okay, so the code expert's confirmation is spot-on. They've really drilled down into the details, which is exactly what's needed. The key is placing the check *before* the call to `drm_file_get_master()`. This prevents any potential resource leaks, ensuring that we catch the error condition before any critical data structures are allocated.

They've also highlighted the necessity of including the `<linux/limits.h>` and `<linux/slab.h>` headers, along with the existing `<linux/string.h>` (which, of course, might already be included implicitly, but explicitly including it is good practice). Let me double-check the current headers in `drivers/gpu/drm/drm_lease.c`:

```c
#include <linux/file.h>
#include <linux/uaccess.h>

#include <drm/drm_auth.h>
#include <drm/drm_crtc.h>
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
#include <drm/drm_lease.h>
#include <drm/drm_print.h>

#include "drm_crtc_internal.h"
#include "drm_internal.h"
```

Yup, adding the other `<linux/...>` headers ( `<linux/limits.h>`, `<linux/slab.h>`, and potentially including `<linux/string.h>`) fits perfectly, and they should be alphabetized for consistency. Excellent, following the standard Linux kernel style.

Now, let's confirm the exact location of the `cl->object_count` check within the existing code. Examining lines 494-498:

```c
	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
		drm_dbg_lease(dev, "invalid flags\n");
		return -EINVAL;
	}

	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
		return -EINVAL;
	}

	lessor = drm_file_get_master(lessor_priv);
```

Exactly, right *after* the `cl->flags` check, just as intended. The code checks `cl->object_count` against `INT_MAX / sizeof(struct drm_mode_object *)`, logs using `drm_dbg_lease`, and returns `-EINVAL`. The important thing is that *no* references are taken before this check, so there's nothing to clean up if the check fails. Very clean.

Let's check lines 384-392 and 465 from `drivers/gpu/drm/drm_lease.c`:

```c
	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
	if (!objects)
		return -ENOMEM;
```

```c
	kvfree(objects);
	return ret;
```
Okay, so the memory allocation and deallocation of `objects` is handled correctly using `kvzalloc_objs` and `kvfree` respectively.

And lines 512-524:

```c
		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
						object_count, sizeof(__u32));
		if (IS_ERR(object_ids)) {
			ret = PTR_ERR(object_ids);
			idr_destroy(&leases);
			goto out_lessor;
		}

		/* fill and validate the object idr */
		ret = fill_object_idr(dev, lessor_priv, &leases,
				      object_count, object_ids);
		kvfree(object_ids);
```

Here it's copying object IDs from userspace, which is handled and cleaned correctly.

Everything checks out. The proposed change is logically sound, safe, and follows established kernel coding conventions. We can proceed with the integration. Now, let's copy the code from the editor and integrate.



279/4 2026/10/13 23:13 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:1 LineCount:20]

Results:
map[Contents:   1:	// SPDX-License-Identifier: GPL-2.0-or-later
   2:	/*
   3:	 * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
   4:	 */
   5:	#include <linux/file.h>
   6:	#include <linux/uaccess.h>
   7:	
   8:	#include <drm/drm_auth.h>
   9:	#include <drm/drm_crtc.h>
  10:	#include <drm/drm_drv.h>
  11:	#include <drm/drm_file.h>
  12:	#include <drm/drm_lease.h>
  13:	#include <drm/drm_print.h>
  14:	
  15:	#include "drm_crtc_internal.h"
  16:	#include "drm_internal.h"
  17:	
  18:	/**
  19:	 * DOC: drm leasing
  20:	 *
]

280/4 2026/10/13 23:13 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 121121
							output: 39
							thoughts: 28
						

Thoughts:
Okay, here's my interpretation of what's going on in that section of `drm_lease.c`, presented as if it were my thought process:

**Diving into the Lease Handling**

Alright, time to focus on lines 380 to 470 of `drivers/gpu/drm/drm_lease.c`. Let's get down to the core logic of these DRM lease operations. I know this code pretty well, but it always pays to refresh the context. I need to fully grasp how the lease management is working. I need to remind myself of the conditions that define valid lease granting and revocation. I'm guessing this section probably deals with the core functions for requesting, granting, and potentially revoking those leases.

I'm expecting to see calls related to the lease request structure, likely involving data structures associated with the client requesting the lease and the device granting it. This should contain logic around device access checks and if those checks fail, the code must implement the fallback behaviors, such as rejecting the request or queuing it. Furthermore, there might be concurrency issues, considering we have multiple clients trying to access the device. The developers must be using mutexes or semaphores to avoid race conditions. I bet there are some important considerations for handling lease revocation too, whether due to a client closing or the device driver itself needing to reclaim resources. There might be error handling here, too, like what to do if the lease request fails for whatever reason and how it reports it to the caller. Okay, let's see how they've implemented it in this section. I'm keen to see if they're addressing the potential corner cases I'm thinking about.



281/4 2026/10/13 23:13 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:380 LineCount:90]

Results:
map[Contents: 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
 465:		kfree(objects);
 466:		return ret;
 467:	}
 468:	
 469:	/*
]

282/4 2026/10/13 23:13 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 122986
							output: 39
							thoughts: 29
						

Thoughts:
Okay, here's my interpretation of what's going through my mind as I analyze that code, keeping in mind that the user is an expert in the field:

**Diving into `drm_lease.c`: Lines 490-535**

Alright, let's get down to brass tacks. I need to understand how this lease mechanism is functioning within the DRM framework, specifically looking at the implementation details within `drivers/gpu/drm/drm_lease.c`. I'm going to focus my attention on lines 490 to 535. This is likely where the core of some interaction or state transition is happening related to these leases. I have a feeling I'll find some intricate dance involving file descriptors, permissions, and some kind of signaling.

Okay, scanning quickly... I'm looking for the key functions or structures involved here. Is this an acquisition phase, release, or maybe some kind of renewal logic? Based on the surrounding code I know, it's likely part of the device setup. Let's see... looking for loops, conditional statements, and anything related to userspace interaction – that's often where the magic, or the bugs, happen.

I'm expecting to see calls to `drm_ioctl`, `fput`, or possibly interactions with `inode` or `file` structures. I'm also anticipating some kind of locking mechanism to ensure concurrency is handled gracefully, hopefully leveraging spinlocks or mutexes appropriately. The context here is critical; I'm assuming we're dealing with either a master device, a client, or perhaps some kind of intermediary device that's being leased out.

This is going to involve understanding the intended data flows and where the specific actions or permissions are checked. I'll need to figure out what happens if something goes wrong, too. Error handling is important. Hopefully, it is robustly handled.



283/4 2026/10/13 23:14 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:490 LineCount:45]

Results:
map[Contents: 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
]

284/4 2026/10/13 23:14 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 124165
							output: 34
							thoughts: 60
						

Thoughts:
Okay, here's my thought process as I'd articulate it:

**Digging into Potential Memory Corruption in `drm_lease.c`**

Alright, I need to be absolutely certain we've covered our bases in `drm_lease.c` regarding memory management. The potential for misuse of `kfree` where `kvfree` or a related function might be more appropriate is a common class of memory bug, and frankly, I need to rule it out entirely here. My next step, and it's a critical one, is to systematically examine the code to ensure we are using the correct free calls for the allocators. It's time to grep for `kfree` within the specific file: `drivers/gpu/drm/drm_lease.c`. That will give me a manageable list of candidates to review closely, looking for opportunities to tighten up the memory safety.



285/4 2026/10/13 23:14 tool grepper
0m Args:
map[Expression:kfree PathPrefixes:[drivers/gpu/drm/drm_lease.c]]

Results:
map[Output:drivers/gpu/drm/drm_lease.c=378=static int fill_object_idr(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-464-	}
drivers/gpu/drm/drm_lease.c:465:	kfree(objects);
drivers/gpu/drm/drm_lease.c-466-	return ret;
--
drivers/gpu/drm/drm_lease.c=475=int drm_mode_create_lease_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-522-				      object_count, object_ids);
drivers/gpu/drm/drm_lease.c:523:		kfree(object_ids);
drivers/gpu/drm/drm_lease.c-524-		if (ret) {
]

286/4 2026/10/13 23:14 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 124669
							output: 108
							thoughts: 594
						

Thoughts:
**My Analysis and Proposed Changes**

Okay, so I've been poring over this code, specifically focusing on memory allocation and deallocation within `drivers/gpu/drm/drm_lease.c` and associated calls. The critical part is to optimize how memory is handled.

First things first, I've tracked down the `kfree` calls within the file – just two of them, actually, at lines 465 and 523. Both are associated with the `objects` and `object_ids` variables, respectively. Now, to make sure everything is consistent, let's look at the associated allocation calls. `memdup` call at line 512, and `kzalloc` at line 389.

Alright, so to improve this, I'm going to make the following changes, all using the `codeeditor` tool, of course:

1.  **Header Inclusion:**  I'll begin by adding necessary headers to `drivers/gpu/drm/drm_lease.c`. Specifically, I need `<linux/file.h>`, `<linux/limits.h>`, `<linux/slab.h>`, `<linux/string.h>`, and `<linux/uaccess.h>`.

2.  **`fill_object_idr()` Modification:** Within this function, I'll replace `kzalloc_objs(...)` with `kvzalloc_objs(...)` to leverage the kernel's virtual addressing capabilities for the `objects` allocation, and replace `kfree(objects)` with `kvfree(objects)` for the appropriate deallocation.

3.  **`drm_mode_create_lease_ioctl()` Enhancements:** Here's where it gets a little more involved. First, I'm going to add an early bounds check on `cl->flags` and `cl->object_count` for invalid and too large values, respectively, as an early error condition. Next, I'll switch the allocation of `object_ids` from `memdup_array_user` to `vmemdup_array_user` for the same virtual addressing reason, and of course change the corresponding `kfree(object_ids)` call to `kvfree(object_ids)`.

Let's call the `codeeditor` function for the first change (adding the headers). This should make our code more robust and efficient.



287/4 2026/10/13 23:14 tool codeeditor
0m Args:
map[CurrentCode:#include <linux/file.h>
#include <linux/uaccess.h> NewCode:#include <linux/file.h>
#include <linux/limits.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/uaccess.h> SourceFile:drivers/gpu/drm/drm_lease.c]

Results:
map[]

288/4 2026/10/13 23:14 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 125882
							output: 105
							thoughts: 17
						

Thoughts:
Okay, let's get this done. Here's how I'd approach summarizing the prompt:

**Focusing on the `fill_object_idr` Function**

Alright, so the task at hand is crystal clear. I'm focusing in on the next step, specifically the second change needed within the `fill_object_idr` function. This signals a continuation of a previously initiated process. The request is specific; my expertise tells me that this function plays a crucial role in object identification and retrieval. Knowing this context, I now understand that I need to be precise and efficient. It's time to dive in and get this implemented.



289/4 2026/10/13 23:14 tool codeeditor
0m Args:
map[CurrentCode:	objects = kzalloc_objs(struct drm_mode_object *, object_count);
	if (!objects)
		return -ENOMEM; NewCode:	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
	if (!objects)
		return -ENOMEM; SourceFile:drivers/gpu/drm/drm_lease.c]

Results:
map[]

290/4 2026/10/13 23:14 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 126148
							output: 110
							thoughts: 17
						

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

**Analyzing the Memory Allocation Change**

Alright, so the shift from `kfree(objects)` to `kvfree(objects)` has landed. I immediately start mentally parsing the implications. This isn't just a trivial find-and-replace; it signifies a deliberate choice in kernel memory management. We're moving from a generic `kmalloc`-based allocation to something leveraging the "v" variant. My first instinct is to understand the context: what specific allocation strategy triggered this? Was it a global change or confined to a particular subsystem or driver? What are the underlying performance or security justifications? The devil is always in the details, so I need to dig deeper.
I'm guessing they are trying to fix a security issue or improve the memory management strategy. Is this allocation coming from contiguous or virtual allocations?



291/4 2026/10/13 23:14 tool codeeditor
0m Args:
map[CurrentCode:		if (objects[o])
			drm_mode_object_put(objects[o]);
	}
	kfree(objects);
	return ret; NewCode:		if (objects[o])
			drm_mode_object_put(objects[o]);
	}
	kvfree(objects);
	return ret; SourceFile:drivers/gpu/drm/drm_lease.c]

Results:
map[]

292/4 2026/10/13 23:14 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 126468
							output: 237
							thoughts: 30
						

Thoughts:
Okay, here's my take on those thoughts, framed as a first-person expert summary:

**Analyzing the DRM Lease Creation IOCTL Modification**

Alright, let's break down this `drm_mode_create_lease_ioctl` change. My initial focus, as always, hones in on potential vulnerabilities and resource management. The very first thing that jumps out is that early bounds check on `cl->object_count`. This is precisely where I'd start too. We need to be absolutely certain that any object count passed into this function is reasonable before we even begin to allocate resources. A flawed check here is a potential attack vector for denial-of-service or even something more sinister, so I would certainly focus on the robustness of that check and its coverage. I'm keen to understand the implications of this particular check with respect to our overall memory safety guarantees and the maximum lease object limit.



293/4 2026/10/13 23:14 tool codeeditor
0m Args:
map[CurrentCode:	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
		drm_dbg_lease(dev, "invalid flags\n");
		return -EINVAL;
	}

	lessor = drm_file_get_master(lessor_priv); NewCode:	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
		drm_dbg_lease(dev, "invalid flags\n");
		return -EINVAL;
	}

	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
		return -EINVAL;
	}

	lessor = drm_file_get_master(lessor_priv); SourceFile:drivers/gpu/drm/drm_lease.c]

Results:
map[]

294/4 2026/10/13 23:15 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 126930
							output: 312
							thoughts: 22
						

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

**Re-evaluating Memory Allocation Strategy**

Alright, so the focus is shifting. I'm looking at `vmemdup_array_user` and the `kvfree(object_ids)` call. This change, or *these* changes, are the key to the next phase of optimization. I immediately start wondering about the implications of the memory duplication strategy in the user context, specifically `vmemdup_array_user`. I need to remember the architectural implications of how this function is implemented in the target architecture. Are there any particular nuances related to the user memory access that could result in bottlenecks or performance degradation, especially with regard to the `object_ids` array, since the intention is to free them with a `kvfree`.

My immediate question is: am I overlooking anything? Are there alignment considerations? Potential for fragmentation? Are there any hidden performance implications when there are a large number of object IDs? The current implementation using `vmemdup_array_user` is a well-established and tested memory allocation and copy methodology, which is one of the important reasons I keep coming back to these areas of code.

It is clear I'll need to double check the allocation and free calls to see if they are symmetrical with the object IDs, and also ensure the security boundaries for user memory access are maintained. Is the allocation large enough? Are there any unaddressed race conditions lurking? I'll need to thoroughly review the surrounding code to understand the context and potential side effects this change, or these changes, might bring.

Essentially, I am thinking through the specifics of the memory copy, and free calls and their implications on system performance. Time to dig in!



295/4 2026/10/13 23:15 tool codeeditor
0m Args:
map[CurrentCode:		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
		if (IS_ERR(object_ids)) {
			ret = PTR_ERR(object_ids);
			idr_destroy(&leases);
			goto out_lessor;
		}

		/* fill and validate the object idr */
		ret = fill_object_idr(dev, lessor_priv, &leases,
				      object_count, object_ids);
		kfree(object_ids); NewCode:		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
						object_count, sizeof(__u32));
		if (IS_ERR(object_ids)) {
			ret = PTR_ERR(object_ids);
			idr_destroy(&leases);
			goto out_lessor;
		}

		/* fill and validate the object idr */
		ret = fill_object_idr(dev, lessor_priv, &leases,
				      object_count, object_ids);
		kvfree(object_ids); SourceFile:drivers/gpu/drm/drm_lease.c]

Results:
map[]

296/4 2026/10/13 23:15 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 127640
							output: 10
							thoughts: 10
						

Thoughts:
Okay, here's my interpretation of that:

**Analyzing the Proposed Changes**

Right, let's get down to brass tacks. I need to take a look at these proposed changes, so I'm going to run the `patch-diff` command. This is the standard procedure to understand exactly what's being added, removed, or modified. I'm hoping it's well-formatted and easy to parse, because the clarity of the diff is critical for a smooth review and integration. I need to assess the scope of the change and if the change has a potential impact on any dependencies.



297/4 2026/10/13 23:15 tool patch-diff
0m Results:
map[Output:diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -1,70 +1,73 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_file.h>
 #include <drm/drm_lease.h>
 #include <drm/drm_print.h>
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
 
 /**
  * DOC: drm leasing
  *
  * DRM leases provide information about whether a DRM master may control a DRM
  * mode setting object. This enables the creation of multiple DRM masters that
  * manage subsets of display resources.
  *
  * The original DRM master of a device 'owns' the available drm resources. It
  * may create additional DRM masters and 'lease' resources which it controls
  * to the new DRM master. This gives the new DRM master control over the
  * leased resources until the owner revokes the lease, or the new DRM master
  * is closed. Some helpful terminology:
  *
  * - An 'owner' is a &struct drm_master that is not leasing objects from
  *   another &struct drm_master, and hence 'owns' the objects. The owner can be
  *   identified as the &struct drm_master for which &drm_master.lessor is NULL.
  *
  * - A 'lessor' is a &struct drm_master which is leasing objects to one or more
  *   other &struct drm_master. Currently, lessees are not allowed to
  *   create sub-leases, hence the lessor is the same as the owner.
  *
  * - A 'lessee' is a &struct drm_master which is leasing objects from some
  *   other &struct drm_master. Each lessee only leases resources from a single
  *   lessor recorded in &drm_master.lessor, and holds the set of objects that
  *   it is leasing in &drm_master.leases.
  *
  * - A 'lease' is a contract between the lessor and lessee that identifies
  *   which resources may be controlled by the lessee. All of the resources
  *   that are leased must be owned by or leased to the lessor, and lessors are
  *   not permitted to lease the same object to multiple lessees.
  *
  * The set of objects any &struct drm_master 'controls' is limited to the set
  * of objects it leases (for lessees) or all objects (for owners).
  *
  * Objects not controlled by a &struct drm_master cannot be modified through
  * the various state manipulating ioctls, and any state reported back to user
  * space will be edited to make them appear idle and/or unusable. For
  * instance, connectors always report 'disconnected', while encoders
  * report no possible crtcs or clones.
  *
  * Since each lessee may lease objects from a single lessor, display resource
  * leases form a tree of &struct drm_master. As lessees are currently not
  * allowed to create sub-leases, the tree depth is limited to 1. All of
  * these get activated simultaneously when the top level device owner changes
  * through the SETMASTER or DROPMASTER IOCTL, so &drm_device.master points to
  * the owner at the top of the lease tree (i.e. the &struct drm_master for which
  * &drm_master.lessor is NULL). The full list of lessees that are leasing
  * objects from the owner can be searched via the owner's
  * &drm_master.lessee_idr.
  */
 
 #define drm_for_each_lessee(lessee, lessor) \
 	list_for_each_entry((lessee), &(lessor)->lessees, lessee_list)
@@ -378,209 +381,214 @@ static int validate_lease(struct drm_device *dev,
 static int fill_object_idr(struct drm_device *dev,
 			   struct drm_file *lessor_priv,
 			   struct idr *leases,
 			   int object_count,
 			   u32 *object_ids)
 {
 	struct drm_mode_object **objects;
 	u32 o;
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
 	/* step one - get references to all the mode objects
 	   and check for validity. */
 	for (o = 0; o < object_count; o++) {
 		objects[o] = drm_mode_object_find(dev, lessor_priv,
 						  object_ids[o],
 						  DRM_MODE_OBJECT_ANY);
 		if (!objects[o]) {
 			ret = -ENOENT;
 			goto out_free_objects;
 		}
 
 		if (!drm_mode_object_lease_required(objects[o]->type)) {
 			DRM_DEBUG_KMS("invalid object for lease\n");
 			ret = -EINVAL;
 			goto out_free_objects;
 		}
 	}
 
 	ret = validate_lease(dev, object_count, objects, universal_planes);
 	if (ret) {
 		drm_dbg_lease(dev, "lease validation failed\n");
 		goto out_free_objects;
 	}
 
 	/* add their IDs to the lease request - taking into account
 	   universal planes */
 	for (o = 0; o < object_count; o++) {
 		struct drm_mode_object *obj = objects[o];
 		u32 object_id = objects[o]->id;
 
 		drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 
 		/*
 		 * We're using an IDR to hold the set of leased
 		 * objects, but we don't need to point at the object's
 		 * data structure from the lease as the main object_idr
 		 * will be used to actually find that. Instead, all we
 		 * really want is a 'leased/not-leased' result, for
 		 * which any non-NULL pointer will work fine.
 		 */
 		ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 		if (ret < 0) {
 			drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 				      object_id, ret);
 			goto out_free_objects;
 		}
 		if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 			struct drm_crtc *crtc = obj_to_crtc(obj);
 
 			ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 			if (ret < 0) {
 				drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 					      object_id, ret);
 				goto out_free_objects;
 			}
 			if (crtc->cursor) {
 				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 				if (ret < 0) {
 					drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 						      object_id, ret);
 					goto out_free_objects;
 				}
 			}
 		}
 	}
 
 	ret = 0;
 out_free_objects:
 	for (o = 0; o < object_count; o++) {
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
 /*
  * The master associated with the specified file will have a lease
  * created containing the objects specified in the ioctl structure.
  * A file descriptor will be allocated for that and returned to the
  * application.
  */
 int drm_mode_create_lease_ioctl(struct drm_device *dev,
 				void *data, struct drm_file *lessor_priv)
 {
 	struct drm_mode_create_lease *cl = data;
 	size_t object_count;
 	int ret = 0;
 	struct idr leases;
 	struct drm_master *lessor;
 	struct drm_master *lessee = NULL;
 	struct file *lessee_file = NULL;
 	struct file *lessor_file = lessor_priv->filp;
 	struct drm_file *lessee_priv;
 	int fd = -1;
 	uint32_t *object_ids;
 
 	/* Can't lease without MODESET */
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		return -EOPNOTSUPP;
 
 	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 		drm_dbg_lease(dev, "invalid flags\n");
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
 		drm_dbg_lease(dev, "recursive leasing not allowed\n");
 		ret = -EINVAL;
 		goto out_lessor;
 	}
 
 	object_count = cl->object_count;
 
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
 			goto out_lessor;
 		}
 
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);
 			goto out_lessor;
 		}
 	}
 
 	/* Allocate a file descriptor for the lease */
 	fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 	if (fd < 0) {
 		idr_destroy(&leases);
 		ret = fd;
 		goto out_lessor;
 	}
 
 	drm_dbg_lease(dev, "Creating lease\n");
 	/* lessee will take the ownership of leases */
 	lessee = drm_lease_create(lessor, &leases);
 
 	if (IS_ERR(lessee)) {
 		ret = PTR_ERR(lessee);
 		idr_destroy(&leases);
 		goto out_leases;
 	}
 
 	/* Clone the lessor file to create a new file for us */
 	drm_dbg_lease(dev, "Allocating lease file\n");
 	lessee_file = file_clone_open(lessor_file);
 	if (IS_ERR(lessee_file)) {
 		ret = PTR_ERR(lessee_file);
 		goto out_lessee;
 	}
 
 	lessee_priv = lessee_file->private_data;
 	/* Change the file to a master one */
 	drm_master_put(&lessee_priv->master);
 	lessee_priv->master = lessee;
 	lessee_priv->is_master = 1;
 	lessee_priv->authenticated = 1;
 
 	/* Pass fd back to userspace */
 	drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id);
 	cl->fd = fd;
 	cl->lessee_id = lessee->lessee_id;
 
 	/* Hook up the fd */
 	fd_install(fd, lessee_file);
 
 	drm_master_put(&lessor);
 	drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
 	return 0;
 
 out_lessee:
 	drm_master_put(&lessee);
 
 out_leases:
 	put_unused_fd(fd);
 
 out_lessor:
 	drm_master_put(&lessor);
 	drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
 	return ret;
 }
]

298/4 2026/10/13 23:15 llm patch-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 131418
							output: 831
							thoughts: 688
						

Thoughts:
**Reviewing the Patch: A Deep Dive**

Okay, let's break this down. First, I see the header includes are updated. We've brought in `<linux/limits.h>`, `<linux/slab.h>`, and `<linux/string.h>`.  These additions provide us with critical tools: `INT_MAX`, the `kvzalloc_objs` and `kvfree` allocators, and `vmemdup_array_user`.  This is a good sign; we're preparing to handle potentially large allocations and address the previous concerns.

Next, I see changes in `fill_object_idr()`. The switch from `kzalloc_objs` to `kvzalloc_objs` and from `kfree` to `kvfree` is significant.  The goal here is clearly to leverage `vmalloc()` as a fallback when the required memory exceeds the constraints of regular kernel allocation (specifically `PAGE_SIZE` or `MAX_PAGE_ORDER`). This avoids the warning in `alloc_order_allowed()` and, crucially, ensures proper deallocation. The use of `kvzalloc_objs` and `kvfree` is consistent and clean, exactly what's needed.

Moving on to `drm_mode_create_lease_ioctl()`, a critical check has been added early on: `cl->object_count` is now validated against `INT_MAX / sizeof(struct drm_mode_object *)`. This is *excellent* defensive programming. It prevents the allocation size of both `objects` and `object_ids` from overflowing and passing `INT_MAX`, and more importantly, it avoids a resource leak by ensuring this check happens before grabbing a reference to `lessor_priv`.  This completely addresses the potential integer overflow issue that was flagged earlier. This also addresses the possible integer overflow when `cl->object_count` is passed as `int object_count` to `fill_object_idr()` and `validate_lease()`.

Finally, the `drm_mode_create_lease_ioctl()` function has updated the user array duplication from `memdup_array_user` to `vmemdup_array_user`, and, of course, updated the corresponding free to `kvfree`. This follows the same strategy as the other allocation: a safe fallback to `vmalloc()` for potentially large user arrays and matching deallocation.

This diff is clean, minimal, directly addresses the root cause of the issue, and adheres precisely to all the requirements. It's a complete and robust solution. Time to write the explanation and move on.



299/3 2026/10/13 23:15 action test-patch
39m Results:
map[PatchDiff:diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -3,6 +3,9 @@
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
@@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
@@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
@@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
@@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);
 TestError:]

300/3 2026/10/13 23:55 action If
23m Args:
map[TestError:]

301/4 2026/10/13 23:55 agent patch-reviewer
22m Model:
core

Results:
map[ReviewApproved:true ReviewComments:[]]

Instruction:
You are an experienced Linux kernel maintainer reviewing a proposed patch that compiles and passes reproducer tests.
Evaluate the patch diff against the crash report, root cause, and the architectural design guidelines below.

Scope Constraint (Single-Patch Submissions):
We only generate single, standalone patches (not patch series). If a comprehensive architectural redesign would require a multi-patch series touching many files, accept a localized single-patch fix as long as it correctly fixes the bug, does not introduce new issues, and avoids sentinel band-aids within its local scope.

Evaluation:
- Set ReviewApproved=true (and leave ReviewComments empty) if the patch is acceptable for upstream submission as a single-patch fix.
- Set ReviewApproved=false and list concise, actionable feedback in ReviewComments if the patch contains fixable "Kernel Architectural Design & Maintainer Taste" violations.

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.

---

# Kernel Architectural Design & Maintainer Taste

Evaluate kernel patches and fix proposals beyond binary bug presence. Enforce **maintainer taste**, **lifecycle symmetry**, **typestate soundness**, and **topological graph simplicity**.

---

## 1. Core Philosophy: Band-Aid vs. Architectural Design

Naive patches often introduce **defensive sentinel guards** (e.g., ad-hoc `if (!ptr) return;` checks, status flags, or suppressed warnings) directly at the point of failure. While locally avoiding crashes, they degrade subsystem architecture by leaving uninitialized states reachable.

Maintainer "good taste" solves the root cause by **shifting invariants** (making invalid states unrepresentable) and moving dynamic runtime checks into static typestate guarantees.

```
HACKY BAND-AID FIX (Monolithic Cleanup)            ARCHITECTURAL DESIGN (Scoped RAII / Invariant Shift)
───────────────────────────────────────            ────────────────────────────────────────────────────
           [ Init / Entry ]                                         [ Init / Entry ]
                  β”‚                                                         β”‚
      (Register Global Cleanup)                                    (Allocate Resource A)
                  β”‚                                                         β”‚
            [ Init Sub-B ] ──fail──┐                                  [ Init Sub-B ] ──fail──┐
                  β”‚ (success)      β”‚                                        β”‚ (success)      β”‚
                  β–Ό                β”‚                                        β–Ό                β–Ό
          [ Setup Complete ]       β”‚                             (Arm B Cleanup / RAII)  (Unwind A Only:
                  β”‚                β”‚                                        β”‚             B never armed)
         (Deferred Teardown)       β”‚                                        β–Ό                β”‚
                  β”‚                β”‚                                [ Setup Complete ]       β–Ό
                  β–Ό                β–Ό                                        β”‚            [ Error Exit ]
           [ release_all ] β—„β”€β”€β”€β”€β”€β”€β”€β”˜                               (LIFO Scope Teardown)
                  β”‚                                                         β”‚
      (if (!ctx->b) return;) <-- Defensive guard!                           β–Ό
                  β”‚                                                [ Clean Destruction ]
           [ Unsafe State ]                                        (Zero sentinel checks needed)
```

```c
// ANTI-PATTERN (Defensive Sentinel Guard): Teardown called on partial init -> callee needs guard
void driver_cleanup(struct ctx *ctx) {
    if (!ctx->buf) return; // <-- Sentinel band-aid
    free_buffer(ctx->buf);
}
// CANONICAL SHIFT (Granular Scoped Action): Registered only upon complete initialization
ctx->buf = alloc_buffer();
if (!ctx->buf) return -ENOMEM;
devm_add_action_or_reset(dev, free_buffer_action, ctx->buf);
```

---

## 2. Maintainer Taste as Graph Topology & Structural Simplicity

Software design quality maps directly to graph-theoretic properties across the Control-Flow Graph (CFG), Data-Flow Graph (DFG), and Object Lifecycle DAG:

### A. Control-Flow Graph (CFG) Simplification
* **Branch Minimization & Path Explosion (McCabe 1976):** Every defensive check added to a compound destructor or callback (`if (!ctx->buffer) return;`) adds a predicate node ($\pi$), increases cyclomatic complexity $v(G) = |E| - |V| + 2$, causes exponential path explosion ($O(2^k)$ paths), and enlarges explicit state spaces ($|S| = \prod |D_i|$). Good taste eliminates the branch by guaranteeing destructors are invoked only on initialized typestates. *(Note: Standard idempotent leaf deallocators like `kfree(NULL)` and public API input sanitizers are exempt).*
* **Single-Entry Single-Exit (SESE) Symmetry (Ferrante 1987, Johnson 1994, Dijkstra 1972):** Resource acquisition and release must form strict **nested dominator trees**. If resource $R_i$ is acquired at node $A$, the set of release actions $\{B_1, \dots, B_m\}$ must form a strict **post-dominating cut** relative to $A$ across all maximal exit paths.
* **Pointer Uniformity (Linus's "Good Taste" Rule):** Eliminate special-case conditional branches by operating on address indirection (e.g., indirect pointers `**curr` in linked list unlinking) to unify edge and interior cases into a branchless invariant.
* **Lexical Scope Invariants & Affine Lifecycles (Wadler 1990, RAII):** Enforce SESE symmetry and "consumed exactly once" affine invariants using compiler-backed scoped cleanup (`<linux/cleanup.h>` `guard()`, `scoped_guard()`, `__free()`).

### B. Ownership & Lifetime DAGs
* **Acyclic Lifecycles & Topological Teardown (Tarjan 1972, Kahn 1962):** Resource ownership must form a strict Directed Acyclic Graph (DAG) $G = (R, E)$. Teardown order must strictly follow reverse topological sort $\text{toposort}(G)^R$. Mixing conflicting lifetime paradigms (e.g., embedding a dynamic refcounted `kref`/socket struct inside a device-managed `devres` buffer or parent container) violates DAG acyclicity, creating synchronous blocking hacks (`wait_for_completion`), circular pins, and Use-After-Free hazards.
* **Three-Phase Concurrent Quiescence:** Multi-threaded and asynchronous teardown (networking, block layer, RCU) must strictly sequence: (1) **Deactivation/Delisting** (make unreachable) -> (2) **Quiescence & Draining** (`synchronize_rcu()`, `cancel_work_sync()`, `napi_disable()`) -> (3) **Physical Reclamation** (`kfree()`, `kmem_cache_destroy()`).
* **Typestate Validity (Strom & Yemini 1986, Aldrich et al. 2009):** A struct with $N$ fields should not use runtime boolean flags (`ctx->is_initialized`) to model incomplete typestates. Sub-resources must transition as a deterministic typestate automaton ($S_{uninit} \xrightarrow{\text{alloc}} S_{init} \xrightarrow{\text{publish}} S_{registered}$), and registration functions must accept only fully initialized typestates.

---

## 3. Deterministic Decision Trigger Matrix

| Code Symptom / Trigger (When you see X) | Anti-Pattern Band-Aid (DO NOT DO Z) | Canonical Invariant Shift (DO Y) |
| :--- | :--- | :--- |
| **Null deref in compound destructor / cleanup callback** | Add `if (!priv->buf) return;` in composite cleanup handler | Register granular cleanup immediately upon allocation via `devm_add_action_or_reset()`, `<linux/cleanup.h>` `__free()`, or discrete reverse LIFO labels |
| **UAF on dynamic object after container unbind** | Allocate with `devm_kzalloc()` and block on `wait_for_completion()` | Allocate with `kzalloc()`, manage lifetime via `kref_get()`/`kref_put()`, call unbind/delist on unbind, free in `kref` release callback |
| **Goto ladder lock leaks on early error exit** | Sprinkle manual `mutex_unlock()` across error returns | Use `guard(mutex)(&lock)` or `scoped_guard(spinlock, &lock)` from `<linux/cleanup.h>` |
| **Callback / IRQ / timer fires before full init** | Add `if (!priv->ready)` check inside IRQ/timer handler | Move `request_irq()`, `timer_setup()`, or `napi_enable()` strictly to the end of setup after all state structures are fully initialized |
| **Multi-step setup failure leaks resources** | Route all errors to a single `err:` label calling a monolithic `cleanup(priv)` with NULL checks | Use `cleanup.h` RAII, granular `devm` actions, or a strict reverse LIFO goto ladder (`err_free_b:` -> `err_free_a:`) |
| **Mixed ownership / asymmetric refcount drops** | Conditionally call `kref_put()` in caller based on error code | Enforce unconditional callee-cleans or caller-cleans ownership convention across all paths |
| **Ad-hoc state flag polling during teardown** | Add `priv->stopping = true` and spin/poll in callbacks | Use atomic typestate transitions and synchronous flush/drain APIs (`cancel_work_sync()`, `drain_workqueue()`) |

---

## 4. The Architectural Review Checklist

Before finalizing any kernel fix or review, audit against the following four criteria:

1. **The Sentinel Test (Caller vs. Callee Responsibility):**
   * *Smell:* Adding a defensive guard (`if (!ptr)` or `if (flags & INITIALIZED)`) inside a compound teardown callback or destructor to mask partial initialization.
   * *Invariant:* If a destructor executes on uninitialized data, the defect is at the **caller's registration/invocation point**, not the callee.
   * *Note:* Standard C allocator no-ops (`kfree(NULL)`) and public API parameter validators (`if (WARN_ON(!ptr)) return -EINVAL;`) are exempt; this rule targets *internal subsystem lifecycle pipelines and teardown paths*.
   * *Action:* Move registration to the point of complete initialization (`devm_add_action_or_reset()`, RAII/`__free()`, or discrete caller unwinding).

2. **LIFO Stack Unwinding Symmetry:**
   * *Smell:* Releasing resources in arbitrary order or invoking destructors for partially initialized subsystems.
   * *Invariant:* Resource release must strictly mirror acquisition order in reverse (LIFO) without monolithic cleanup guards.
   * *Action:* Verify that partial setup/initialization failures (e.g., `probe()`, `mount()`, `open()`, `alloc_pool()`) unwind only already-allocated resources in reverse order via strict LIFO labels or `cleanup.h` scope exit.

3. **Ownership Decoupling:**
   * *Smell:* Embedding dynamically refcounted objects (`kref`, `struct sock`, `struct inode`, `struct file`) directly inside hardware device-bound allocations (`devres`) or parent containers (`super_block`, `net_device`).
   * *Invariant:* Dynamic consumer references must outlive parent unregistration without use-after-free, circular pins, or blocking hacks.
   * *Action:* Decouple the refcounted core object from the container binding; container teardown must unbind/delist the object, but memory is freed exclusively by the final `kref_put()`.

4. **Codebase Idiom Alignment:**
   * *Smell:* Using legacy custom rollback ladders, ad-hoc state flags, or manual lock unlocking on error paths.
   * *Invariant:* Prefer standard, modern kernel abstractions with compiler-enforced safety guarantees.
   * *Action (Modern >= 6.6):* Replace manual boilerplate with `cleanup.h` (`guard()`, `scoped_guard()`, `__free()`), `devm_add_action_or_reset()`, `refcount_t`, and standard `kref` helpers.
   * *Action (Legacy / LTS / No-RAII Subsystems):* Enforce clean, branchless reverse LIFO goto ladders (`err_free_b:` -> `err_free_a:`).
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Bug title:
WARNING in alloc_frozen_pages_noprof

The crash report:
------------[ cut here ]------------
WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline], CPU#1: syz.0.17/7032
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397, CPU#1: syz.0.17/7032
Modules linked in:
CPU: 1 UID: 0 PID: 7032 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : alloc_order_allowed mm/page_alloc.c:5340 [inline]
pc : __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
lr : __alloc_frozen_pages_noprof+0xa8/0x640 mm/page_alloc.c:5388
sp : ffff80009d2e7580
x29: ffff80009d2e7650 x28: ffff700013a5cf18 x27: ffff80009d2e75a0
x26: 1ffff0001302e474 x25: dfff800000000000 x24: ffff700013a5ceb4
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000040dc0
x20: 0000000000000000 x19: 000000000000000b x18: 00000000ffffffff
x17: 0000000000000000 x16: ffff80008b5b9788 x15: 0000000000000005
x14: 1ffff00013a5ceb8 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700013a5cebd x10: dfff800000000000 x9 : 0000000000000001
x8 : ffff8000939c7000 x7 : 0000000000000000 x6 : ffff0000e8bd0900
x5 : ffff0000e8bd0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline] (P)
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397 (P)
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 __do_kmalloc_node mm/slub.c:5402 [inline]
 __kmalloc_noprof+0x3ec/0x6bc mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 _kzalloc_noprof include/linux/slab.h:1312 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:583
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758
 el0t_64_sync_handler+0x68/0xdc arch/arm64/kernel/entry-common.c:777
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590
irq event stamp: 4228
hardirqs last  enabled at (4227): [<ffff80008b64f030>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (4227): [<ffff80008b64f030>] __arm64_exit_to_kernel_mode+0x64/0x78 arch/arm64/kernel/entry-common.c:60
hardirqs last disabled at (4228): [<ffff80008b64afb0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:445
softirqs last  enabled at (3568): [<ffff8000803f5178>] softirq_handle_end kernel/softirq.c:491 [inline]
softirqs last  enabled at (3568): [<ffff8000803f5178>] handle_softirqs+0xc88/0xdfc kernel/softirq.c:673
softirqs last disabled at (3415): [<ffff800080020ff4>] __do_softirq+0x14/0x20 kernel/softirq.c:679
---[ end trace 0000000000000000 ]---


The root cause explanation:
An analysis of the crash reveals that it is caused by an unbounded user-controlled allocation size in the DRM lease creation ioctl, which attempts to allocate a contiguous memory block larger than `MAX_PAGE_ORDER` using the `kmalloc` family of functions.

### Root Cause Analysis

The crash is a warning triggered in `alloc_order_allowed()` because `__alloc_frozen_pages_noprof()` is called with an allocation order that exceeds `MAX_PAGE_ORDER` (typically 10, which corresponds to 4MB on systems with 4KB pages).

This happens in `fill_object_idr()` when allocating the `objects` array:
```c
// drivers/gpu/drm/drm_lease.c:389
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```
The `kzalloc_objs` macro expands to a `kmalloc`-family allocation (equivalent to `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`). 

The `object_count` comes directly from the user-space `drm_mode_create_lease` struct via `cl->object_count` in `drm_mode_create_lease_ioctl()`. There is no upper bound check on this value.

Before calling `fill_object_idr()`, `drm_mode_create_lease_ioctl()` allocates the `object_ids` array using `memdup_array_user()`:
```c
// drivers/gpu/drm/drm_lease.c:512
		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
```
`memdup_array_user()` uses `memdup_user()`, which allocates memory with `GFP_USER | __GFP_NOWARN`. Because of the `__GFP_NOWARN` flag, if `object_count` is extremely large (e.g., requiring > 4MB), `memdup_array_user()` will silently fail and return `-ENOMEM` without triggering any warnings.

However, there is a specific window where `object_count` is large enough to require more than 4MB for the `objects` array (which has 8-byte pointers on 64-bit systems), but small enough that the `object_ids` array (which has 4-byte `__u32` elements) fits within 4MB. 

In the provided syzkaller reproducer:
```c
*(uint32_t*)0x200003c8 = 0xf4240; // object_count = 1,000,000
```
1. `object_count` is set to `1,000,000`.
2. `memdup_array_user()` allocates `1,000,000 * 4 = 4,000,000` bytes. This is order 10, which is `<= MAX_PAGE_ORDER`. The allocation succeeds.
3. `fill_object_idr()` then calls `kzalloc_objs()` to allocate `1,000,000 * 8 = 8,000,000` bytes. This requires order 11, which is `> MAX_PAGE_ORDER`. 
4. Since `kzalloc_objs()` uses `GFP_KERNEL` without `__GFP_NOWARN`, the page allocator loudly complains and triggers the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)` warning.

### Proposed Fix

To fix this, the allocation of the `objects` array in `fill_object_idr()` should be changed to use `kvzalloc_objs()`, which gracefully falls back to `vmalloc()` for large allocations and does not trigger the page allocator warning. The corresponding `kfree()` must also be updated to `kvfree()`.

```c
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,7 +386,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +462,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
```

*(Note: While adding an arbitrary upper bound check to `object_count` in `drm_mode_create_lease_ioctl()` is another option, using `kvzalloc_objs()` is the standard kernel pattern for handling user-controlled array sizes without imposing artificial limits).*

The proposed patch diff:
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -3,6 +3,9 @@
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
@@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
@@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
@@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
@@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);


Review this patch diff against the crash report, root cause explanation, and kernel architectural design guidelines.

302/5 2026/10/13 23:55 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 11067
							output: 39
							thoughts: 58
						

Thoughts:
Okay, let's dive into this. Someone wants me to review a kernel patch, specifically one addressing a bug. My immediate thought is, "Right, let's break this down systematically."

**Patch Review Protocol Activated**

First, I need to fully understand the nature of the crash. What's the context? What are the symptoms? Then, and *only* then, can I make heads or tails of the proposed patch. Next, I need to get my hands on the actual code, the patch itself, and preferably a local copy of the repository for easy inspection. We are dealing with low-level kernel code so the tooling is everything. It will also make it much easier to explore related areas and ensure the fix is complete and doesn't introduce regressions.

Let's start by digging into the core issue. I've been directed to examine `drivers/gpu/drm/drm_lease.c`. Alright, fire up the IDE, load the repository, and let's start dissecting that file. We'll start with a straightforward reading and then move to a more thorough analysis.



303/5 2026/10/13 23:55 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:380 LineCount:80]

Results:
map[Contents: 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
]

304/5 2026/10/13 23:55 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 12720
							output: 39
							thoughts: 30
						

Thoughts:
Okay, here's my take on those lines of code, presented as a personal thought process, assuming I'm already pretty familiar with the DRM and lease concepts:

**Deep Dive into DRM Lease Management**

Alright, let's get into the nitty-gritty of how the lease mechanism works, specifically within `drivers/gpu/drm/drm_lease.c`, focusing on the area around line 460 through 560. I need to refresh my memory on the critical sections here.

Okay, I'm expecting this section to likely handle things like lease creation, revocation, or maybe even the granting/revocation of file descriptors associated with the lease, based on prior exposure to other DRM code. I'll need to see how the code deals with the specific lease's permissions, ownership, and client connections. I wonder if it includes the logic for validating client requests or handling conflict resolution when multiple clients are requesting the same resources. It could also detail the interactions with the underlying kernel memory and DRM resources.

I'll be looking carefully to see how the kernel handles the potential race conditions that can happen when juggling access rights. I'll be expecting to see a lot of locking, maybe mutexes or spinlocks, to protect shared data structures related to the lease. I'm especially interested in how the driver ensures atomicity of the operation, given that DRM is such a low-level and latency-sensitive part of the system. I'll be keeping an eye out for any subtle bugs or optimizations that stand out to me as I read. I'll be looking for things like reference counting and memory management.



305/5 2026/10/13 23:55 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:460 LineCount:90]

Results:
map[Contents: 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
 465:		kfree(objects);
 466:		return ret;
 467:	}
 468:	
 469:	/*
 470:	 * The master associated with the specified file will have a lease
 471:	 * created containing the objects specified in the ioctl structure.
 472:	 * A file descriptor will be allocated for that and returned to the
 473:	 * application.
 474:	 */
 475:	int drm_mode_create_lease_ioctl(struct drm_device *dev,
 476:					void *data, struct drm_file *lessor_priv)
 477:	{
 478:		struct drm_mode_create_lease *cl = data;
 479:		size_t object_count;
 480:		int ret = 0;
 481:		struct idr leases;
 482:		struct drm_master *lessor;
 483:		struct drm_master *lessee = NULL;
 484:		struct file *lessee_file = NULL;
 485:		struct file *lessor_file = lessor_priv->filp;
 486:		struct drm_file *lessee_priv;
 487:		int fd = -1;
 488:		uint32_t *object_ids;
 489:	
 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
 535:			ret = fd;
 536:			goto out_lessor;
 537:		}
 538:	
 539:		drm_dbg_lease(dev, "Creating lease\n");
 540:		/* lessee will take the ownership of leases */
 541:		lessee = drm_lease_create(lessor, &leases);
 542:	
 543:		if (IS_ERR(lessee)) {
 544:			ret = PTR_ERR(lessee);
 545:			idr_destroy(&leases);
 546:			goto out_leases;
 547:		}
 548:	
 549:		/* Clone the lessor file to create a new file for us */
]

306/5 2026/10/13 23:55 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 14476
							output: 32
							thoughts: 49
						

Thoughts:
Okay, let's dive into this. Here's how I'm approaching this problem:

**Analyzing Potential Issues in DRM Lease Handling**

Alright, my initial thought is to get a handle on what's been happening with `drm_lease.c` and potentially related issues within the DRM subsystem, especially where memory management – specifically `page_alloc` – is concerned. The goal is to identify a pattern or trace a history.

So, I'm going to start by getting a clean view of the git history for the `drm_lease.c` file itself. I'll execute a `git log` command directly on that file. This should give me a chronological record of all modifications, additions, and removals specific to this source file. From there, I'll review relevant changes and try to identify commits with related warnings, error messages, or suspicious behavior. I'll be looking for changes concerning leases that might have unintentionally interacted with memory allocation in ways that cause problems. If I can understand the history of this code then, potentially, I can better understand its current issues.



307/5 2026/10/13 23:56 tool git-log
0m Args:
map[Count:10 PathPrefix:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
f37d63e219c3 drm_lease.c: copy user-array safely
cde3d37b19df drm: Remove unnecessary include statements for drm_crtc_helper.h
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
4bb2d367a5a2 drm/lease: allow empty leases
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
d793b8f732d6 drm: clarify usage of drm leases
56f0729a510f drm: protect drm_master pointers in drm_lease.c
7988fdf5f0a3 drm: Don't include drm_legacy.h in drm_lease.c
]

308/5 2026/10/13 23:56 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 15052
							output: 27
							thoughts: 19
						

Thoughts:
Okay, I'm ready. Let's dig into this commit:

**Analyzing Commit f37d63e219c3**

Alright, let's pull up that commit, `f37d63e219c3`. Hmm, let me quickly review the diff. Okay, so it looks like we've got some changes in [briefly describe the area or files affected, e.g., the core API, the data processing module, or the UI component]. I need to assess the implications here. First, I'm scanning for potential regressions. Given my understanding of the system, are there any obvious areas that might be impacted negatively by these modifications? I see a change to [specific function/class/variable]. My immediate thought is to consider the downstream dependencies of this particular component - how are others calling it? Does this modification follow the expected pattern? I have to consider side effects. Are there any potential performance bottlenecks introduced? I'll need to do some more in-depth static analysis to be certain. Next, I need to focus on any new functionality. It's crucial for me to understand the purpose of these changes at a high level. Is this intended to address a specific bug? Does it enhance the performance, or is this related to a new feature? Are the comments and commit message clear enough to explain the motivation behind this modification? Does this commit follow our architectural principles and coding guidelines? If this commit modifies any external dependencies, I'll review these too. Finally, let me see if these changes are accompanied by test coverage. Any unit tests or integration tests to validate the intended behavior? Good test coverage is critical to avoid any issues in the future.



309/5 2026/10/13 23:56 tool git-show
0m Args:
map[Commit:f37d63e219c3]

Results:
map[Output:commit f37d63e219c39199a59b8b8a211412ff27192830
Author: Philipp Stanner <pstanner@redhat.com>
Date:   Wed Sep 20 14:36:12 2023 +0200

    drm_lease.c: copy user-array safely
    
    Currently, there is no overflow-check with memdup_user().
    
    Use the new function memdup_array_user() instead of memdup_user() for
    duplicating the user-space array safely.
    
    Suggested-by: David Airlie <airlied@redhat.com>
    Signed-off-by: Philipp Stanner <pstanner@redhat.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Zack Rusin <zackr@vmware.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-6-pstanner@redhat.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 150fe1555068..94375c6a5425 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -510,8 +510,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
-					 array_size(object_count, sizeof(__u32)));
+		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
+					       object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
]

310/5 2026/10/13 23:56 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 16048
							output: 19
							thoughts: 944
						

Thoughts:
**Analyzing the DRM Lease Patch**

Okay, first things first, let me thoroughly examine this proposed patch. I need to understand the nuances of these changes to the DRM lease code. My initial thought is to make sure nothing fishy is going on, and to assess whether the suggested modifications improve the driver's robustness and efficiency.

Alright, I see a few key areas of interest right away. First, there's a replacement of `kzalloc_objs` with `kvzalloc_objs`. I need to understand why this change was made. What is the distinction? Does the new function align with the existing kernel memory management strategies? Does it have any implications for memory alignment or other low-level considerations within this DRM context?

Then, I'm noting that `kfree` is being swapped to `kvfree`. Again, I have to determine why this change has been made. I need to cross-check this to see if it's the correct change.

I also see a new check added in `drm_mode_create_lease_ioctl`, specifically regarding `object_count`. This is good, ensuring that we're handling potentially large object counts gracefully. Preventing an integer overflow or an allocation of excessive memory is key. I'll need to confirm that the `INT_MAX` limit is appropriate here, and that the check is implemented correctly.

Finally, there is a swap out of `memdup_array_user` to `vmemdup_array_user`. I wonder what the performance implications, if any, there are between these two functions?

Alright, before I proceed further, I should verify the existence of `kvzalloc_objs` and the other new memory functions! A quick search within the kernel source is in order, just to confirm that these functions are actually defined and part of the kernel's memory management system. It's always wise to verify before trusting anything.



311/5 2026/10/13 23:56 tool grepper
0m Args:
map[Expression:kvzalloc_objs]

Results:
map[Output:
Full output is too long, showing 200 out of 1188 lines.
Use more precise expression or PathPrefixes if possible.

Number of matching lines per file (137 files in total):
arch/arm64/kvm/nested.c:1
arch/arm64/net/bpf_jit_comp.c:1
arch/riscv/kvm/vcpu_pmu.c:1
arch/riscv/net/bpf_jit_comp64.c:1
arch/riscv/net/bpf_jit_core.c:1
arch/x86/kvm/cpuid.c:1
arch/x86/kvm/mmu/mmu.c:1
arch/x86/kvm/svm/sev.c:1
block/blk-crypto-profile.c:1
drivers/accel/amdxdna/amdxdna_gem.c:1
drivers/accel/amdxdna/amdxdna_ubuf.c:1
drivers/accel/habanalabs/common/mmu/mmu.c:1
drivers/accel/qaic/qaic_data.c:1
drivers/android/binder_alloc.c:1
drivers/block/xen-blkfront.c:3
drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:1
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c:1
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:6
drivers/gpu/drm/amd/amdkfd/kfd_svm.c:1
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:8
drivers/gpu/drm/drm_gpusvm.c:1
drivers/gpu/drm/nouveau/nouveau_dmem.c:1
drivers/gpu/drm/nouveau/nouveau_svm.c:1
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1
drivers/gpu/drm/radeon/radeon_cs.c:2
drivers/gpu/drm/ttm/ttm_tt.c:1
drivers/gpu/drm/virtio/virtgpu_submit.c:2
drivers/gpu/drm/xe/xe_vm.c:2
drivers/infiniband/hw/hns/hns_roce_debugfs.c:1
drivers/infiniband/hw/hns/hns_roce_main.c:1
drivers/infiniband/hw/hns/hns_roce_mr.c:2
drivers/infiniband/ulp/ipoib/ipoib_main.c:1
drivers/iommu/amd/init.c:2
drivers/iommu/dma-iommu.c:1
drivers/iommu/iommufd/selftest.c:1
drivers/iommu/iommufd/viommu.c:1
drivers/md/dm-pcache/cache.c:1
drivers/md/dm-pcache/cache_key.c:1
drivers/md/dm-snap-persistent.c:1
drivers/md/raid0.c:1
drivers/media/common/videobuf2/videobuf2-dma-sg.c:1
drivers/media/v4l2-core/v4l2-ctrls-core.c:1
drivers/media/v4l2-core/v4l2-subdev.c:2
drivers/net/ethernet/alibaba/eea/eea_net.c:3
drivers/net/ethernet/alibaba/eea/eea_rx.c:1
drivers/net/ethernet/alibaba/eea/eea_tx.c:1
drivers/net/ethernet/broadcom/cnic.c:1
drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c:1
... and 87 more files

arch/arm64/kvm/nested.c=83=int kvm_vcpu_init_nested(struct kvm_vcpu *vcpu)
--
arch/arm64/kvm/nested.c-106-
arch/arm64/kvm/nested.c:107:		tmp = kvzalloc_objs(*tmp, S2_MMU_PER_VCPU, GFP_KERNEL_ACCOUNT);
arch/arm64/kvm/nested.c-108-		if (!tmp)
--
arch/arm64/net/bpf_jit_comp.c=2158=struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)
--
arch/arm64/net/bpf_jit_comp.c-2213-
arch/arm64/net/bpf_jit_comp.c:2214:	ctx.offset = kvzalloc_objs(int, prog->len + 1);
arch/arm64/net/bpf_jit_comp.c-2215-	if (ctx.offset == NULL)
--
arch/riscv/kvm/vcpu_pmu.c=488=int kvm_riscv_vcpu_pmu_event_info(struct kvm_vcpu *vcpu, unsigned long saddr_low,
--
arch/riscv/kvm/vcpu_pmu.c-514-
arch/riscv/kvm/vcpu_pmu.c:515:	einfo = kvzalloc_objs(*einfo, num_events,
arch/riscv/kvm/vcpu_pmu.c-516-			      GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
--
arch/riscv/net/bpf_jit_comp64.c=1019=static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
--
arch/riscv/net/bpf_jit_comp64.c-1206-	if (fmod_ret->nr_nodes) {
arch/riscv/net/bpf_jit_comp64.c:1207:		branches_off = kvzalloc_objs(int, fmod_ret->nr_nodes);
arch/riscv/net/bpf_jit_comp64.c-1208-		if (!branches_off)
--
arch/riscv/net/bpf_jit_core.c=44=struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)
--
arch/riscv/net/bpf_jit_core.c-74-	ctx->prog = prog;
arch/riscv/net/bpf_jit_core.c:75:	ctx->offset = kvzalloc_objs(int, prog->len);
arch/riscv/net/bpf_jit_core.c-76-	if (!ctx->offset)
--
arch/x86/kvm/cpuid.c=1992=int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
--
arch/x86/kvm/cpuid.c-2012-
arch/x86/kvm/cpuid.c:2013:	array.entries = kvzalloc_objs(struct kvm_cpuid_entry2, cpuid->nent);
arch/x86/kvm/cpuid.c-2014-	if (!array.entries)
--
arch/x86/kvm/mmu/mmu.c=4044=static int kvm_mmu_alloc_page_hash(struct kvm *kvm)
--
arch/x86/kvm/mmu/mmu.c-4050-
arch/x86/kvm/mmu/mmu.c:4051:	h = kvzalloc_objs(*h, KVM_NUM_MMU_PAGES, GFP_KERNEL_ACCOUNT);
arch/x86/kvm/mmu/mmu.c-4052-	if (!h)
--
arch/x86/kvm/svm/sev.c=776=static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr,
--
arch/x86/kvm/svm/sev.c-807-	 */
arch/x86/kvm/svm/sev.c:808:	pages = kvzalloc_objs(*pages, npages, GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
arch/x86/kvm/svm/sev.c-809-	if (!pages)
--
block/blk-crypto-profile.c=76=int blk_crypto_profile_init(struct blk_crypto_profile *profile,
--
block/blk-crypto-profile.c-97-
block/blk-crypto-profile.c:98:	profile->slots = kvzalloc_objs(profile->slots[0], num_slots);
block/blk-crypto-profile.c-99-	if (!profile->slots)
--
drivers/accel/amdxdna/amdxdna_gem.c=348=static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
--
drivers/accel/amdxdna/amdxdna_gem.c-383-	nr_pages = (PAGE_ALIGN(addr + len) - (addr & PAGE_MASK)) >> PAGE_SHIFT;
drivers/accel/amdxdna/amdxdna_gem.c:384:	mapp->range.hmm_pfns = kvzalloc_objs(*mapp->range.hmm_pfns, nr_pages);
drivers/accel/amdxdna/amdxdna_gem.c-385-	if (!mapp->range.hmm_pfns) {
--
drivers/accel/amdxdna/amdxdna_ubuf.c=78=struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev,
--
drivers/accel/amdxdna/amdxdna_ubuf.c-99-
drivers/accel/amdxdna/amdxdna_ubuf.c:100:	va_ent = kvzalloc_objs(*va_ent, num_entries);
drivers/accel/amdxdna/amdxdna_ubuf.c-101-	if (!va_ent) {
--
drivers/accel/habanalabs/common/mmu/mmu.c=824=int hl_mmu_hr_init(struct hl_device *hdev, struct hl_mmu_hr_priv *hr_priv, u32 hop_table_size,
--
drivers/accel/habanalabs/common/mmu/mmu.c-845-
drivers/accel/habanalabs/common/mmu/mmu.c:846:	hr_priv->mmu_asid_hop0 = kvzalloc_objs(struct pgt_info, prop->max_asid);
drivers/accel/habanalabs/common/mmu/mmu.c-847-	if (ZERO_OR_NULL_PTR(hr_priv->mmu_asid_hop0)) {
--
drivers/accel/qaic/qaic_data.c=391=static int qaic_map_one_slice(struct qaic_device *qdev, struct qaic_bo *bo,
--
drivers/accel/qaic/qaic_data.c-407-
drivers/accel/qaic/qaic_data.c:408:	slice->reqs = kvzalloc_objs(*slice->reqs, sgt->nents);
drivers/accel/qaic/qaic_data.c-409-	if (!slice->reqs) {
--
drivers/android/binder_alloc.c=894=int binder_alloc_mmap_handler(struct binder_alloc *alloc,
--
drivers/android/binder_alloc.c-918-
drivers/android/binder_alloc.c:919:	alloc->pages = kvzalloc_objs(alloc->pages[0],
drivers/android/binder_alloc.c-920-				     alloc->buffer_size / PAGE_SIZE);
--
drivers/block/xen-blkfront.c=2170=static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo)
--
drivers/block/xen-blkfront.c-2218-		rinfo->shadow[i].grants_used =
drivers/block/xen-blkfront.c:2219:			kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants);
drivers/block/xen-blkfront.c:2220:		rinfo->shadow[i].sg = kvzalloc_objs(rinfo->shadow[i].sg[0],
drivers/block/xen-blkfront.c-2221-						    psegs);
--
drivers/block/xen-blkfront.c-2223-			rinfo->shadow[i].indirect_grants =
drivers/block/xen-blkfront.c:2224:				kvzalloc_objs(rinfo->shadow[i].indirect_grants[0],
drivers/block/xen-blkfront.c-2225-					      INDIRECT_GREFS(grants));
--
drivers/crypto/intel/qat/qat_common/qat_comp_algs.c=40=static void *qat_zstd_alloc_scratch(void)
--
drivers/crypto/intel/qat/qat_common/qat_comp_algs.c-61-
drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:62:	scratch->out_seqs = kvzalloc_objs(ZSTD_Sequence, QAT_MAX_SEQUENCES);
drivers/crypto/intel/qat/qat_common/qat_comp_algs.c-63-	if (!scratch->out_seqs)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c=546=void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c-605-	if (ring_count)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:606:		coredump->rings = kvzalloc_objs(struct amdgpu_coredump_ring,
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c-607-						ring_count, GFP_NOWAIT);
--
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c=1194=int amdgpu_gem_list_handles_ioctl(struct drm_device *dev, void *data,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c-1218-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:1219:	bo_entries = kvzalloc_objs(*bo_entries, num_bos);
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c-1220-	if (!bo_entries)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c=1264=amdgpu_ras_debugfs_table_read_uniras(struct amdgpu_device *adev,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c-1295-	if (num_recs) {
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c:1296:		records = kvzalloc_objs(*records, num_recs);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c-1297-		if (!records) {
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c=1957=static int criu_checkpoint_devices(struct kfd_process *p,
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-1966-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:1967:	device_buckets = kvzalloc_objs(*device_buckets, num_devices);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-1968-	if (!device_buckets) {
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-1972-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:1973:	device_priv = kvzalloc_objs(*device_priv, num_devices);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-1974-	if (!device_priv) {
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c=2081=static int criu_checkpoint_bos(struct kfd_process *p,
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2092-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:2093:	bo_buckets = kvzalloc_objs(*bo_buckets, num_bos);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2094-	if (!bo_buckets)
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2096-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:2097:	bo_privs = kvzalloc_objs(*bo_privs, num_bos);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2098-	if (!bo_privs) {
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2102-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:2103:	files = kvzalloc_objs(struct file *, num_bos);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2104-	if (!files) {
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c=2613=static int criu_restore_bos(struct kfd_process *p,
--
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2633-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:2634:	files = kvzalloc_objs(struct file *, args->num_bos);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c-2635-	if (!files) {
--
drivers/gpu/drm/amd/amdkfd/kfd_svm.c=159=svm_range_dma_map_dev(struct amdgpu_device *adev, struct svm_range *prange,
--
drivers/gpu/drm/amd/amdkfd/kfd_svm.c-169-	if (!addr) {
drivers/gpu/drm/amd/amdkfd/kfd_svm.c:170:		addr = kvzalloc_objs(*addr, prange->npages);
drivers/gpu/drm/amd/amdkfd/kfd_svm.c-171-		if (!addr)
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c=1672=bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1718-	if (map_user_ramp && ramp && ramp->type == GAMMA_RGB_256) {
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1719:		rgb_user = kvzalloc_objs(*rgb_user,
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1720-					 ramp->num_entries + _EXTRA_POINTS);
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1723-
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1724:		axis_x = kvzalloc_objs(*axis_x,
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1725-				       ramp->num_entries + _EXTRA_POINTS);
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1740-
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1741:	curve = kvzalloc_objs(*curve, MAX_HW_POINTS + _EXTRA_POINTS);
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1742-	if (!curve)
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1744-
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1745:	coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS);
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1746-	if (!coeff)
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c=1907=bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1941-	    (map_user_ramp || ramp->type != GAMMA_RGB_256)) {
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1942:		rgb_user = kvzalloc_objs(*rgb_user,
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1943-					 ramp->num_entries + _EXTRA_POINTS);
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1946-
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1947:		axis_x = kvzalloc_objs(*axis_x, ramp->num_entries + 3);
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1948-		if (!axis_x)
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1965-
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1966:	rgb_regamma = kvzalloc_objs(*rgb_regamma, MAX_HW_POINTS + _EXTRA_POINTS);
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1967-	if (!rgb_regamma)
--
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1969-
drivers/gpu/drm/amd/display/modules/color/color_gamma.c:1970:	coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS);
drivers/gpu/drm/amd/display/modules/color/color_gamma.c-1971-	if (!coeff)
--
drivers/gpu/drm/drm_gpusvm.c=1459=int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
--
drivers/gpu/drm/drm_gpusvm.c-1546-		svm_pages->dma_addr =
drivers/gpu/drm/drm_gpusvm.c:1547:			kvzalloc_objs(*svm_pages->dma_addr, npages);
drivers/gpu/drm/drm_gpusvm.c-1548-		if (!svm_pages->dma_addr) {
--
drivers/gpu/drm/nouveau/nouveau_dmem.c=489=nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk)
--
drivers/gpu/drm/nouveau/nouveau_dmem.c-497-	dst_pfns = kvcalloc(npages, sizeof(*dst_pfns), GFP_KERNEL | __GFP_NOFAIL);

]

312/5 2026/10/13 23:56 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 23629
							output: 21
							thoughts: 43
						

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

**Examining the kvzalloc_objs Definition**

Alright, so `kvzalloc_objs` is declared in `include/linux/slab.h`. That's where it *should* be, but let's not make assumptions. I need to be absolutely sure about the actual definition, and what other factors come into play. I'll need to go directly to `include/linux/slab.h` and check the actual declaration, look for dependencies, and any potentially important macro expansions or inline behaviors. I want to thoroughly understand its structure and purpose before proceeding. Let's make sure it is exactly what I expect.



313/5 2026/10/13 23:56 tool grepper
0m Args:
map[Expression:#define kvzalloc_objs]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1172-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
include/linux/slab.h:1173:#define kvzalloc_objs(P, COUNT, ...) \
include/linux/slab.h-1174-	__alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
]

314/5 2026/10/13 23:56 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 24005
							output: 20
							thoughts: 23
						

Thoughts:
Here's my thought process, as if I were considering this myself:

**Investigating `kzalloc_objs` Definition**

Okay, so I'm deep into this memory allocation issue, and I need to understand the fundamental building blocks. My first thought is: I need to refresh my memory on exactly how `kzalloc_objs` is defined. Knowing the specifics of this structure, especially in `include/linux/slab.h`, will give me a vital view on how the kernel is handling zeroed memory allocations, which is relevant to the issue I am debugging. I need to see the data structures involved, and any associated context or macros. Let me go check that header file and take a look.



315/5 2026/10/13 23:56 tool grepper
0m Args:
map[Expression:#define kzalloc_objs]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1156-	__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
include/linux/slab.h:1157:#define kzalloc_objs(P, COUNT, ...) \
include/linux/slab.h-1158-	__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
]

316/5 2026/10/13 23:57 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 24354
							output: 21
							thoughts: 47
						

Thoughts:
Okay, let's dive into this.

**Examining the `vmemdup_array_user` Function**

Right, my focus is now on `vmemdup_array_user`. I need to confirm its existence first. It's time to run a quick grep search across the kernel source. I'm going to quickly look for any instances of `vmemdup_array_user` to get a sense of where it's used and, crucially, to make sure it's actually defined within the codebase. This initial check is fundamental. Knowing the function exists is the foundation for any deeper investigation into its behavior and potential interactions. I'll be looking for both the declaration and any calls to it.



317/5 2026/10/13 23:57 tool grepper
0m Args:
map[Expression:vmemdup_array_user]

Results:
map[Output:arch/x86/kvm/cpuid.c=590=int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
--
arch/x86/kvm/cpuid.c-601-	if (cpuid->nent) {
arch/x86/kvm/cpuid.c:602:		e = vmemdup_array_user(entries, cpuid->nent, sizeof(*e));
arch/x86/kvm/cpuid.c-603-		if (IS_ERR(e))
--
arch/x86/kvm/cpuid.c=635=int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
--
arch/x86/kvm/cpuid.c-645-	if (cpuid->nent) {
arch/x86/kvm/cpuid.c:646:		e2 = vmemdup_array_user(entries, cpuid->nent, sizeof(*e2));
arch/x86/kvm/cpuid.c-647-		if (IS_ERR(e2))
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c=164=amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-174-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c:175:	return vmemdup_array_user(uptr, bo_number,
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-176-				  sizeof(struct drm_amdgpu_bo_list_entry));
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c=179=static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-219-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:220:		p->chunks[i].kdata = vmemdup_array_user(u64_to_user_ptr(user_chunk.chunk_data),
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-221-							size,
--
drivers/gpu/drm/drm_gem.c=832=int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
--
drivers/gpu/drm/drm_gem.c-847-
drivers/gpu/drm/drm_gem.c:848:	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
drivers/gpu/drm/drm_gem.c-849-	if (IS_ERR(handles)) {
--
drivers/tty/vt/consolemap.c=632=int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
--
drivers/tty/vt/consolemap.c-640-
drivers/tty/vt/consolemap.c:641:	struct unipair *unilist __free(kvfree) = vmemdup_array_user(list, ct, sizeof(*unilist));
drivers/tty/vt/consolemap.c-642-	if (IS_ERR(unilist))
--
include/linux/string.h=32=void *memdup_array_user(const void __user *src, size_t n, size_t size)
--
include/linux/string.h-42-/**
include/linux/string.h:43: * vmemdup_array_user - duplicate array from user space
include/linux/string.h-44- * @src: source address in user space
--
include/linux/string.h=51=static inline __realloc_size(2, 3)
include/linux/string.h:52:void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
include/linux/string.h-53-{
--
virt/kvm/kvm_main.c=5177=static long kvm_vm_ioctl(struct file *filp,
--
virt/kvm/kvm_main.c-5344-			urouting = argp;
virt/kvm/kvm_main.c:5345:			entries = vmemdup_array_user(urouting->entries,
virt/kvm/kvm_main.c-5346-						     routing.nr, sizeof(*entries));
]

318/5 2026/10/13 23:57 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 25786
							output: 34
							thoughts: 43
						

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

**Diving into String Manipulation in the Kernel**

Okay, so `vmemdup_array_user`... right, I seem to recall that's defined somewhere in the kernel's string header. Let me just confirm that.  I'm pretty sure it's `include/linux/string.h`.  Alright, let's navigate straight to that file and, given the common function structure I'm expecting it to be around the more basic `memcpy` kind of functions, I'll focus on lines 40-70. Let's start there and see if it's got what I'm looking for. That should give me the function's definition, any relevant comments, and probably its arguments.



319/5 2026/10/13 23:57 tool read-file
0m Args:
map[File:include/linux/string.h FirstLine:40 LineCount:35]

Results:
map[Contents:  40:	}
  41:	
  42:	/**
  43:	 * vmemdup_array_user - duplicate array from user space
  44:	 * @src: source address in user space
  45:	 * @n: number of array members to copy
  46:	 * @size: size of one array member
  47:	 *
  48:	 * Return: an ERR_PTR() on failure. Result may be not
  49:	 * physically contiguous. Use kvfree() to free.
  50:	 */
  51:	static inline __realloc_size(2, 3)
  52:	void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
  53:	{
  54:		size_t nbytes;
  55:	
  56:		if (check_mul_overflow(n, size, &nbytes))
  57:			return ERR_PTR(-EOVERFLOW);
  58:	
  59:		return vmemdup_user(src, nbytes);
  60:	}
  61:	
  62:	/*
  63:	 * Include machine specific inline routines
  64:	 */
  65:	#include <asm/string.h>
  66:	
  67:	#ifndef __HAVE_ARCH_STRCPY
  68:	extern char * strcpy(char *,const char *);
  69:	#endif
  70:	ssize_t sized_strscpy(char *, const char *, size_t);
  71:	
  72:	/*
  73:	 * The 2 argument style can only be used when dst is an array with a
  74:	 * known size.
]

320/5 2026/10/13 23:57 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 26490
							output: 39
							thoughts: 81
						

Thoughts:
Here's my take on those lines of code, seeing as I'm familiar with this area:

**Analyzing `drm_gem_objects_lookup` and Its Handle Processing**

Okay, so I'm digging into `drm_gem_objects_lookup` now, specifically around line 848. I see that `handles = vmemdup_array_user(bo_handles, count, sizeof(u32));` is the key line in question. Essentially, it appears we're using `vmemdup_array_user` to create a kernel-space copy of a user-provided array of buffer object handles. The goal here, as I understand it, is to securely copy a list of handle values from user space into a kernel-allocated buffer for internal use.

To fully grasp the context and potential pitfalls here, I'll need to refresh my memory on how this `drm_gem_objects_lookup` function interacts with the overall GEM object management scheme. I'll need to go back to `drivers/gpu/drm/drm_gem.c`, probably around lines 830-860, to see how these handles are validated, used, and subsequently released. I'm keen to check for potential security issues like integer overflows, or any possible information leak from how the handles are being sanitized, mapped, or handled in this section.



321/5 2026/10/13 23:57 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_gem.c FirstLine:830 LineCount:40]

Results:
map[Contents: 830:	 * Zero on success or a negative error code.
 831:	 */
 832:	int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 833:				   int count, struct drm_gem_object ***objs_out)
 834:	{
 835:		struct drm_gem_object **objs;
 836:		u32 *handles;
 837:		int ret;
 838:	
 839:		*objs_out = NULL;
 840:	
 841:		if (!count)
 842:			return 0;
 843:	
 844:		objs = kvmalloc_objs(*objs, count);
 845:		if (!objs)
 846:			return -ENOMEM;
 847:	
 848:		handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
 849:		if (IS_ERR(handles)) {
 850:			ret = PTR_ERR(handles);
 851:			goto err_free_objs;
 852:		}
 853:	
 854:		ret = objects_lookup(filp, handles, count, objs);
 855:		if (ret)
 856:			goto err_free_handles;
 857:	
 858:		kvfree(handles);
 859:		*objs_out = objs;
 860:		return 0;
 861:	
 862:	err_free_handles:
 863:		kvfree(handles);
 864:	err_free_objs:
 865:		kvfree(objs);
 866:		return ret;
 867:	}
 868:	EXPORT_SYMBOL(drm_gem_objects_lookup);
 869:	
]

322/5 2026/10/13 23:57 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 27426
							output: 42
							thoughts: 292
						

Thoughts:
**Analyzing Lease Creation in the DRM Subsystem**

Alright, let's see, I'm taking a look at how leases are handled, specifically focusing on the object handling and creation flow. I'm noticing this `drm_gem_objects_lookup` function first; it looks like it's responsible for retrieving the GEM objects. I see memory allocation with `kvmalloc_objs` and handle duplication with `vmemdup_array_user`. I'm also seeing the subsequent freeing with `kvfree`, which is good to see for resource management.

Now, let's dig into `drm_lease.c`, and specifically the `drm_mode_create_lease_ioctl` function. Okay, so we have this structure, `drm_mode_create_lease`, and it looks like it's receiving a data pointer. There's an `idr leases`, a `lessor` master, and a potential `lessee` master. We've got file pointers for both the lessor and lessee, and an FD that is initialized to -1.

Wait a second... I need to double-check something. What *exactly* is the type of `cl->object_count`? That's critical information here. Time to go find the definition of `struct drm_mode_create_lease` and make sure I know what I'm dealing with.



323/5 2026/10/13 23:57 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_mode_create_lease]

Results:
map[SourceCode:1425:	/**
1426:	 * struct drm_mode_create_lease - Create lease
1427:	 *
1428:	 * Lease mode resources, creating another drm_master.
1429:	 *
1430:	 * The @object_ids array must reference at least one CRTC, one connector and
1431:	 * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively,
1432:	 * the lease can be completely empty.
1433:	 */
1434:	struct drm_mode_create_lease {
1435:		/** @object_ids: Pointer to array of object ids (__u32) */
1436:		__u64 object_ids;
1437:		/** @object_count: Number of object ids */
1438:		__u32 object_count;
1439:		/** @flags: flags for new FD (O_CLOEXEC, etc) */
1440:		__u32 flags;
1441:	
1442:		/** @lessee_id: Return: unique identifier for lessee. */
1443:		__u32 lessee_id;
1444:		/** @fd: Return: file descriptor to new drm_master file */
1445:		__u32 fd;
1446:	};
 SourceFile:include/uapi/drm/drm_mode.h]

324/5 2026/10/13 23:57 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 28437
							output: 38
							thoughts: 1361
						

Thoughts:
**Analyzing a Potential Integer Overflow Vulnerability in DRM Lease Code**

Okay, so I'm looking at this DRM lease code and immediately something jumps out at me. We've got `cl->object_count`, which is a `__u32`, and it's being assigned to a `size_t` variable called `object_count`. Fine, that's normal. Then, that `object_count` (which, as a `size_t`, is unsigned) is being passed to the `fill_object_idr` function.

But, hang on... the *signature* of `fill_object_idr` takes an *`int`* for the `object_count` argument! This is a classic potential integer overflow vulnerability. If `cl->object_count` has a value greater than `INT_MAX`, the conversion to `int` will cause it to become a *negative* number.

The original code didn't handle the case where `cl->object_count` could be greater than `INT_MAX`, which means that it can result in a negative number, which results in very bad outcomes down the line.

The fix I'm seeing adds a check:
```c
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
```

This prevents the integer overflow by checking if `cl->object_count` exceeds a safe upper bound when converted to `int` based on the size of the objects.  That's a good start, but I need to make sure I understand the scope of the fix.  The patch also has other changes: It uses `kvzalloc_objs` and `kvfree` instead of `kzalloc_objs` and `kfree`, which is just a change from `GFP_KERNEL` to `GFP_KERNEL | __GFP_ZERO`. It also uses `vmemdup_array_user` instead of `memdup_array_user`. I need to ensure these changes are correct and don't introduce other issues.

Specifically, I need to ensure that the change of `object_count` being passed to `validate_lease` is still safe after this fix is added and that all of these changes are applied correctly.



325/5 2026/10/13 23:57 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:validate_lease]

Results:
map[SourceCode: 346:	static int validate_lease(struct drm_device *dev,
 347:				  int object_count,
 348:				  struct drm_mode_object **objects,
 349:				  bool universal_planes)
 350:	{
 351:		int o;
 352:		int has_crtc = -1;
 353:		int has_connector = -1;
 354:		int has_plane = -1;
 355:	
 356:		/* we want to confirm that there is at least one crtc, plane
 357:		   connector object. */
 358:	
 359:		for (o = 0; o < object_count; o++) {
 360:			if (objects[o]->type == DRM_MODE_OBJECT_CRTC && has_crtc == -1) {
 361:				has_crtc = o;
 362:			}
 363:			if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
 364:				has_connector = o;
 365:	
 366:			if (universal_planes) {
 367:				if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
 368:					has_plane = o;
 369:			}
 370:		}
 371:		if (has_crtc == -1 || has_connector == -1)
 372:			return -EINVAL;
 373:		if (universal_planes && has_plane == -1)
 374:			return -EINVAL;
 375:		return 0;
 376:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

326/5 2026/10/13 23:57 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 30854
							output: 39
							thoughts: 1749
						

Thoughts:
**Analyzing the DRM Lease Implementation**

Okay, let's break this down. First, `validate_lease`… what's the core concept here? What kinds of objects are we even leasing? Specifically in the context of DRM, if `DRM_CLIENT_CAP_UNIVERSAL_PLANES` is enabled, the `@object_ids` array *must* reference at least one CRTC, one connector, and one plane. The number of mode objects on a device is limited, typically in the hundreds or low thousands – certainly not a million. I need to keep that in mind.

Now, that `if` statement… `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))`. Where did that come from? It's there to prevent a huge value, but that check *does* appear in the diff, but *not* the root cause explanation, even though it *is* in the presented function: `drm_mode_create_lease_ioctl()`.

The provided fix suggests using `kvzalloc_objs()` instead of `kzalloc_objs` in `fill_object_idr()` to handle potentially large user-controlled array sizes gracefully. This aligns with the "standard kernel pattern" to avoid artificial limits, and it's accompanied by the appropriate `kvfree()` to go with it. So, that part makes sense as a standard and reasonable approach to this class of issue.

Let's look more closely at the patch placement of the `if (cl->object_count > ...)` check within `drm_mode_create_lease_ioctl()` code block. It appears *after* the `object_count` is read from the user space structure, *before* the master lessor is retrieved, and *before* the sub-lease check.

Looking at the context, this suggests the author is trying to prevent an integer overflow (although an issue with the allocation is mentioned in the prompt). The `object_count` could be an excessively large value, leading to a huge allocation request. The integer overflow check should also be in place for `kvzalloc_objs`! I should consider if there is another potential issue: `memdup_array_user` and `vmemdup_array_user` in the code, too! The use of `vmemdup_array_user` *could* be because this has similar issues to the page allocator warning.



327/5 2026/10/13 23:58 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:490 LineCount:25]

Results:
map[Contents: 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
]

328/5 2026/10/13 23:58 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 33570
							output: 42
							thoughts: 52
						

Thoughts:
Okay, let's break this down.

**Diving into the DRM Master Retrieval**

Hold on a second, that line caught my eye: `lessor = drm_file_get_master(lessor_priv);` I need to understand what's happening here. The critical function is `drm_file_get_master()`. It’s not immediately obvious what this function does from the surrounding context, so my next thought is, β€œWhat exactly *does* `drm_file_get_master()` *do*?". Time to investigate its implementation to determine its purpose! Let's go look at `drm_file_get_master`!



329/5 2026/10/13 23:58 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_file_get_master]

Results:
map[SourceCode: 378:	/**
 379:	 * drm_file_get_master - reference &drm_file.master of @file_priv
 380:	 * @file_priv: DRM file private
 381:	 *
 382:	 * Increments the reference count of @file_priv's &drm_file.master and returns
 383:	 * the &drm_file.master. If @file_priv has no &drm_file.master, returns NULL.
 384:	 *
 385:	 * Master pointers returned from this function should be unreferenced using
 386:	 * drm_master_put().
 387:	 */
 388:	struct drm_master *drm_file_get_master(struct drm_file *file_priv)
 389:	{
 390:		struct drm_master *master = NULL;
 391:	
 392:		spin_lock(&file_priv->master_lookup_lock);
 393:		if (!file_priv->master)
 394:			goto unlock;
 395:		master = drm_master_get(file_priv->master);
 396:	
 397:	unlock:
 398:		spin_unlock(&file_priv->master_lookup_lock);
 399:		return master;
 400:	}
 SourceFile:drivers/gpu/drm/drm_auth.c]

330/5 2026/10/13 23:58 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 34190
							output: 20
							thoughts: 688
						

Thoughts:
**Analyzing the Lease Creation Patch**

Okay, let's break this down. First, the patch includes a check for invalid flags, and now a check for an `object_count` that is too large. My initial thought was that there might be a potential `lessor` leak if `drm_file_get_master` failed, but the `lessor` variable is only assigned *before* the invalid flag check, so the code is structured correctly and there's no leak. However, I need to confirm what is done if `drm_file_get_master` returns NULL. The following lines of code seem to indicate that the return is checked. I have confirmed that the DRM master flag is checked before `drm_mode_create_lease_ioctl` is called. So, the kernel code seems safe there.

My real question is why the added `object_count` check is there. I see the addition, and it looks like a size check to me, but I need to understand the implications of the value of this field. It's used in `vmemdup_array_user` and `fill_object_idr`. That's where it's used. The interesting thing is that `fill_object_idr` takes `int object_count` as an argument, and `validate_lease` also uses this integer. I should see if `object_count` itself is being converted. It also looks like a size check, as I suspect. In `fill_object_idr`, it is used to allocate `objects = kvzalloc_objs(struct drm_mode_object *, object_count);`. I should inspect this function to be sure. I'm going to follow the expansion of `kvzalloc_objs` to see where the memory allocation actually happens.



331/5 2026/10/13 23:58 tool grepper
0m Args:
map[Expression:#define __alloc_objs]

Results:
map[Output:include/linux/slab.h=1073=void *kmalloc_nolock(size_t size, gfp_t gfp_flags, int node);
--
include/linux/slab.h-1086- */
include/linux/slab.h:1087:#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
include/linux/slab.h-1088-({									\
--
tools/include/linux/slab.h=200=static inline unsigned int kmem_cache_sheaf_size(struct slab_sheaf *sheaf)
--
tools/include/linux/slab.h-204-
tools/include/linux/slab.h:205:#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
tools/include/linux/slab.h-206-({									\
]

332/5 2026/10/13 23:58 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 35502
							output: 36
							thoughts: 21
						

Thoughts:
Okay, let's dive into this. Here's my take on those lines in `include/linux/slab.h`:

**Analyzing Slab Allocation - A Deep Dive**

Alright, I'm heading into `include/linux/slab.h` and pinpointing around line 1087. I'm immediately looking for how the kernel handles slab allocation, specifically how it's optimized. My focus is going to be on the interplay between memory zones, cachelines, and how this impacts overall performance. I need to understand the specifics of the data structures and how they're used to efficiently manage kernel memory. The goal is to see any recent changes and consider their impact on system stability and throughput. I'm anticipating some complex logic; I'll need to pay close attention to the lock management and how it interacts with the slab allocator to prevent contention. This is where the kernel gets interesting; I'll be looking to quickly pinpoint bottlenecks and potential areas for tuning. I'm ready to get my hands dirty and start digging into the intricacies.



333/5 2026/10/13 23:58 tool read-file
0m Args:
map[File:include/linux/slab.h FirstLine:1085 LineCount:40]

Results:
map[Contents:1085:	 * allocated @TYPE objects, or NULL on failure.
1086:	 */
1087:	#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
1088:	({									\
1089:		const size_t __obj_size = size_mul(sizeof(TYPE), COUNT);	\
1090:		(TYPE *)KMALLOC(__obj_size, GFP);				\
1091:	})
1092:	
1093:	/**
1094:	 * __alloc_flex - Allocate an object that has a trailing flexible array
1095:	 * @KMALLOC: kmalloc wrapper function to use for allocation.
1096:	 * @GFP: GFP flags for the allocation.
1097:	 * @TYPE: type of structure to allocate space for.
1098:	 * @FAM: The name of the flexible array member of @TYPE structure.
1099:	 * @COUNT: how many @FAM elements to allocate space for.
1100:	 *
1101:	 * Returns: Newly allocated pointer to @TYPE with @COUNT-many trailing
1102:	 * @FAM elements, or NULL on failure or if @COUNT cannot be represented
1103:	 * by the member of @TYPE that counts the @FAM elements (annotated via
1104:	 * __counted_by()).
1105:	 */
1106:	#define __alloc_flex(KMALLOC, GFP, TYPE, FAM, COUNT)			\
1107:	({									\
1108:		const size_t __count = (COUNT);					\
1109:		const size_t __obj_size = struct_size_t(TYPE, FAM, __count);	\
1110:		TYPE *__obj_ptr = KMALLOC(__obj_size, GFP);			\
1111:		if (__obj_ptr)							\
1112:			__set_flex_counter(__obj_ptr->FAM, __count);		\
1113:		__obj_ptr;							\
1114:	})
1115:	
1116:	/**
1117:	 * kmalloc_obj - Allocate a single instance of the given type
1118:	 * @VAR_OR_TYPE: Variable or type to allocate.
1119:	 * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
1120:	 *
1121:	 * Returns: newly allocated pointer to a @VAR_OR_TYPE on success, or NULL
1122:	 * on failure.
1123:	 */
1124:	#define kmalloc_obj(VAR_OR_TYPE, ...) \
]

334/5 2026/10/13 23:58 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 36477
							output: 37
							thoughts: 168
						

Thoughts:
**Analyzing Memory Allocation in the Kernel**

Okay, let's dive into this `__alloc_objs` macro, specifically lines 1088-1090. I'm seeing this construct:

```c
#define __alloc_objs(KMALLOC, GFP, TYPE, COUNT)				\
({									\
	const size_t __obj_size = size_mul(sizeof(TYPE), COUNT);	\
	(TYPE *)KMALLOC(__obj_size, GFP);				\
})
```

My immediate concern is the `size_mul` function. How does the kernel's memory allocation handle the potential for huge sizes or, more critically, *overflow* within `size_mul`? My experience tells me this is where vulnerabilities often lurk. I know from my work that `size_mul` will return `SIZE_MAX` on overflow, that's not what's interesting.

So, the next logical step is to understand what happens when `kvmalloc` receives `SIZE_MAX` as a size argument. Let's see what happens if we pass that value to the underlying `kvmalloc_node` call. I need to understand the behaviour.

Let's check the implementation of `kvmalloc_node` in `mm/util.c`. That's where I need to be. I'll need to go there to understand how the system reacts to these values.



335/5 2026/10/13 23:58 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/util.c Name:kvmalloc_node_noprof]

Results:
map[SourceCode: SourceFile:]

336/5 2026/10/13 23:58 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 37007
							output: 27
							thoughts: 11
						

Thoughts:
Okay, here's my summary, framed as my internal thought process, assuming I'm a seasoned kernel developer:

**Locating the `kvmalloc` Implementation**

Alright, time to get to work. First things first, I need to track down the implementation of `kvmalloc`. Given its name, it's pretty clear that it's likely involved in kernel virtual memory allocation, so the logical place to start digging is the `mm/` directory within the kernel source tree. Let's head over there and see what we can find. I suspect it won't be too hard to spot, but it's always good to be methodical about these things, especially in such a vast codebase. Searching for it now.



337/5 2026/10/13 23:59 tool grepper
0m Args:
map[Expression:kvmalloc_node PathPrefixes:[mm/]]

Results:
map[Output:mm/slub.c=6976=static gfp_t kmalloc_gfp_adjust(gfp_t flags, size_t size)
--
mm/slub.c-6999-
mm/slub.c:7000:void *__kvmalloc_node_noprof(DECL_KMALLOC_PARAMS(size, b, token), unsigned long align,
mm/slub.c-7001-			     gfp_t flags, int node)
--
mm/slub.c-7046-}
mm/slub.c:7047:EXPORT_SYMBOL(__kvmalloc_node_noprof);
mm/slub.c-7048-
--
mm/slub.c=7102=void *kvrealloc_node_align_noprof(const void *p, DECL_TOKEN_PARAMS(size, token), unsigned long align,
--
mm/slub.c-7112-		/* We failed to krealloc(), fall back to kvmalloc(). */
mm/slub.c:7113:		n = __kvmalloc_node_noprof(PASS_KMALLOC_PARAMS(size, NULL, token), align, flags, nid);
mm/slub.c-7114-		if (!n)
]

338/5 2026/10/13 23:59 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 37522
							output: 35
							thoughts: 19
						

Thoughts:
Okay, let's dive into this. Here's my take on those lines around 7000 in `mm/slub.c`:

**Deep Dive into `mm/slub.c` Around Line 7000**

Alright, so I'm focusing on around line 7000 in `mm/slub.c`. My initial assumption is that we're dealing with either cache management, object allocation, or possibly deallocation within the SLUB allocator at that point. Given the position in the file, it's likely a relatively low-level function related to the mechanics of the allocator itself, rather than user-facing high-level calls. I’m expecting to see things like object initialization, bookkeeping on free lists, or maybe even atomic operations related to concurrent access. We could also be looking at functions that handle page allocation or page freeing, since SLUB is built on the slab infrastructure which relies on page-based memory management. It is important to know which exact function we are discussing, as this will help guide the interpretation. I'm keen to see if we're looking at operations on the `slab` struct or the `kmem_cache` structure. More specifically, I wonder if the code is dealing with the creation or destruction of slabs, the addition or removal of objects from a slab, or perhaps interactions with the per-cpu data structures used by SLUB to optimize for locality. My gut feeling is that it's going to be something critical to the overall performance and correctness of SLUB. Let's see what’s actually there and see if my assumptions hold true.



339/5 2026/10/13 23:59 tool read-file
0m Args:
map[File:mm/slub.c FirstLine:7000 LineCount:45]

Results:
map[Contents:7000:	void *__kvmalloc_node_noprof(DECL_KMALLOC_PARAMS(size, b, token), unsigned long align,
7001:				     gfp_t flags, int node)
7002:	{
7003:		bool allow_block;
7004:		void *ret;
7005:		const struct slab_alloc_context ac = {
7006:			.caller_addr = _RET_IP_,
7007:			.orig_size = size,
7008:			.alloc_flags = SLAB_ALLOC_DEFAULT,
7009:		};
7010:	
7011:		/*
7012:		 * It doesn't really make sense to fallback to vmalloc for sub page
7013:		 * requests
7014:		 */
7015:		ret = __do_kmalloc_node(PASS_BUCKET_PARAM(b),
7016:					kmalloc_gfp_adjust(flags, size),
7017:					node, PASS_TOKEN_PARAM(token), &ac);
7018:		if (ret || size <= PAGE_SIZE)
7019:			return ret;
7020:	
7021:		/* Don't even allow crazy sizes */
7022:		if (unlikely(size > INT_MAX)) {
7023:			WARN_ON_ONCE(!(flags & __GFP_NOWARN));
7024:			return NULL;
7025:		}
7026:	
7027:		/*
7028:		 * For non-blocking the VM_ALLOW_HUGE_VMAP is not used
7029:		 * because the huge-mapping path in vmalloc contains at
7030:		 * least one might_sleep() call.
7031:		 *
7032:		 * TODO: Revise huge-mapping path to support non-blocking
7033:		 * flags.
7034:		 */
7035:		allow_block = gfpflags_allow_blocking(flags);
7036:	
7037:		/*
7038:		 * kvmalloc() can always use VM_ALLOW_HUGE_VMAP,
7039:		 * since the callers already cannot assume anything
7040:		 * about the resulting pointer, and cannot play
7041:		 * protection games.
7042:		 */
7043:		return __vmalloc_node_range_noprof(size, align, VMALLOC_START, VMALLOC_END,
7044:				flags, PAGE_KERNEL, allow_block ? VM_ALLOW_HUGE_VMAP:0,
]

340/5 2026/10/13 23:59 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 38612
							output: 34
							thoughts: 694
						

Thoughts:
**Analyzing Potential Integer Overflow in DRM Lease Object Allocation**

Okay, so I'm looking at this code and immediately my attention is drawn to line 7022, that `WARN_ON_ONCE` within the `__kvmalloc_node_noprof` function. Right, so if `size` is greater than `INT_MAX`, it will WARN.

Now, I'm thinking about how this relates to `kvzalloc_objs`. If you call `kvzalloc_objs` with a `size > INT_MAX`, you're going to trigger that `WARN_ON_ONCE`. Specifically, the size is calculated as `object_count * sizeof(struct drm_mode_object *)`. So, the critical point is if `object_count` becomes greater than `INT_MAX / sizeof(struct drm_mode_object *)`, the allocation size will exceed `INT_MAX`.

This is where it gets interesting. I see that `fill_object_idr` takes `int object_count`.  If `cl->object_count` is larger than INT_MAX, it overflows to a negative integer! That's when I recognize the purpose of this check:

```c
	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
		return -EINVAL;
	}
```

This check is specifically here to prevent the integer overflow _and_ to avoid the potential `WARN_ON_ONCE` in `__kvmalloc_node_noprof`.

But here's where I start to question the assumptions. Is `INT_MAX / sizeof(...)` a reasonable limit for leases? Let's take a step back and consider what DRM leases are *for*. Ah, right, these are used by VR compositors, Wayland compositors, and similar applications to give non-privileged clients access to DRM resources like connectors, CRTCs, and planes.  Thinking about typical hardware, GPUs don't have *that* many of these. Four CRTCs, maybe ten planes, a few connectors... so maybe a few dozen DRM mode objects at most.

Now the question is, does DRM enforce this limit anywhere else? Are there other checks? Let's quickly search the code for other examples of `drm_mode_create_lease` or other related functions. Let's see if there are other places where the number of objects is constrained. I need to get a better sense of any existing DRM limits.



341/5 2026/10/13 23:59 tool grepper
0m Args:
map[Expression:drm_mode_create_lease PathPrefixes:[drivers/gpu/drm/]]

Results:
map[Output:drivers/gpu/drm/drm_ioctl.c=644=static const struct drm_ioctl_desc drm_ioctls[] = {
--
drivers/gpu/drm/drm_ioctl.c-743-	DRM_IOCTL_DEF(DRM_IOCTL_CRTC_QUEUE_SEQUENCE, drm_crtc_queue_sequence_ioctl, 0),
drivers/gpu/drm/drm_ioctl.c:744:	DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_LEASE, drm_mode_create_lease_ioctl, DRM_MASTER),
drivers/gpu/drm/drm_ioctl.c-745-	DRM_IOCTL_DEF(DRM_IOCTL_MODE_LIST_LESSEES, drm_mode_list_lessees_ioctl, DRM_MASTER),
--
drivers/gpu/drm/drm_lease.c=378=static int fill_object_idr(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-474- */
drivers/gpu/drm/drm_lease.c:475:int drm_mode_create_lease_ioctl(struct drm_device *dev,
drivers/gpu/drm/drm_lease.c-476-				void *data, struct drm_file *lessor_priv)
drivers/gpu/drm/drm_lease.c-477-{
drivers/gpu/drm/drm_lease.c:478:	struct drm_mode_create_lease *cl = data;
drivers/gpu/drm/drm_lease.c-479-	size_t object_count;
--
drivers/gpu/drm/drm_lease.c-572-	drm_master_put(&lessor);
drivers/gpu/drm/drm_lease.c:573:	drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n");
drivers/gpu/drm/drm_lease.c-574-	return 0;
--
drivers/gpu/drm/drm_lease.c-583-	drm_master_put(&lessor);
drivers/gpu/drm/drm_lease.c:584:	drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret);
drivers/gpu/drm/drm_lease.c-585-	return ret;
]

342/5 2026/10/13 23:59 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 40489
							output: 44
							thoughts: 301
						

Thoughts:
**Analyzing DRM GEM Object Lookup**

Okay, let's dive into this `drm_gem_objects_lookup` function and see how it handles user-provided arrays. First, I need to check how it deals with potential security vulnerabilities when taking user data. My initial thought is to examine how it handles the array passed in and how it allocates memory for that array.

Alright, I see it clearly: `drm_gem_objects_lookup` uses `kvmalloc_objs` to allocate memory for an array of `drm_gem_object` pointers, specifically `objs`.  Then, it uses `vmemdup_array_user` to safely copy the user-provided handle array (`bo_handles`) into a kernel-allocated buffer named `handles`. Perfect, `vmemdup_array_user` is the key for verifying the user's data! Then, both memory allocations, the object array `objs`, and the user handle array `handles` are freed via `kvfree()`. This looks like a reasonable implementation to me. Next, I should probably check the commit history and maybe the associated documentation to understand the rationale behind this approach and see if it has been audited or reviewed recently.



343/5 2026/10/13 23:59 tool git-log
0m Error:
log-in to see details

Args:
map[Count:5 PathPrefix:drivers/gpu/drm/drm_gem.c SymbolName:drm_gem_objects_lookup]

Results:
map[Output:]

344/5 2026/10/13 23:59 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 41106
							output: 44
							thoughts: 10
						

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

**Analyzing Git Log Output with a Specific Source Path**

Alright, time to get down to brass tacks. I'm thinking, let's fire up `git log` now, but with a crucial detail – we need to specify a particular `SourcePath`. This isn't just a generic `git log` call; we're targeting a specific area of the repository for analysis. It's about efficiently sifting through the commit history to extract the information most relevant to our current task. We know full well the potential breadth of git log, and while we can configure it to be very specific, or very generic, using `SourcePath` as a filter here allows us to streamline that process. We are very aware that running a generic git log, especially on large repositories with extensive history, can be computationally expensive and time-consuming. We don't have time for that! We are thinking, we are smart, and we know this approach will give us the desired insights with surgical precision. Let's see what the log reveals once we've narrowed the scope.



345/5 2026/10/13 23:59 tool git-log
0m Args:
map[Count:5 SourcePath:drivers/gpu/drm/drm_gem.c SymbolName:drm_gem_objects_lookup]

Results:
map[Output:8b85987d3cf5 Merge drm/drm-next into drm-misc-next
dbce431756f8 drm/gem: Make drm_gem_objects_lookup() self-cleaning on failure v6
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
922682d48d62 drm/gem: Correct error condition in drm_gem_objects_lookup
cb77b79abf5f drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
]

346/5 2026/10/13 23:59 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 41565
							output: 25
							thoughts: 23
						

Thoughts:
Okay, here's my interpretation of that prompt, and my response:

**Initial Assessment of Commit cb77b79abf5f**

Alright, let's dive into this commit, `cb77b79abf5f`. Immediately, my mental process jumps to "inspection mode." This commit's identifier is the key, and I’m already formulating the ideal approach. Given the nature of my field, I'll likely begin by considering the repository context, the timing, and any prior knowledge I have of this particular codebase or project. From there, the exploration will follow the classic principles. Is this a functional change or a structural refactor? What files are touched, and what's the delta? I'll probably start with a `git show` to get a quick overview, then consider diffs to the code's changes in order to form an understanding. From there I'll dive into the specifics of the changed files to perform an informed critique. I'll be looking for potential side effects, edge cases, and areas that might warrant further investigation.



347/5 2026/10/14 00:00 tool git-show
0m Args:
map[Commit:cb77b79abf5f]

Results:
map[Output:commit cb77b79abf5ff8f4af07f7ebef196a003c826b7a
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Wed Nov 12 09:27:32 2025 +0000

    drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
    
    Use a helper to shrink the code and separate the user and kernel slabs for
    better security.
    
    While at it lets remove the useless debug message.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Reviewed-by: AndrΓ© Almeida <andrealmeid@igalia.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://lore.kernel.org/r/20251112092732.23584-1-tvrtko.ursulin@igalia.com

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index a1a9c828938b..68168d58a7c8 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -783,7 +783,6 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
 int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 			   int count, struct drm_gem_object ***objs_out)
 {
-	struct drm_device *dev = filp->minor->dev;
 	struct drm_gem_object **objs;
 	u32 *handles;
 	int ret;
@@ -798,15 +797,9 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 
 	*objs_out = objs;
 
-	handles = kvmalloc_array(count, sizeof(u32), GFP_KERNEL);
-	if (!handles) {
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	if (copy_from_user(handles, bo_handles, count * sizeof(u32))) {
-		ret = -EFAULT;
-		drm_dbg_core(dev, "Failed to copy in GEM handles\n");
+	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
+	if (IS_ERR(handles)) {
+		ret = PTR_ERR(handles);
 		goto out;
 	}
 
]

348/5 2026/10/14 00:00 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 42558
							output: 25
							thoughts: 108
						

Thoughts:
Okay, let's break this down.

**Analyzing `drm_gem_objects_lookup` and Its Related Commit**

Alright, I see a section in `drm_gem_objects_lookup`. The core of the issue, from my perspective, revolves around memory allocation and error handling within this function. I'm focusing on these lines: `objs = kvmalloc_objs(*objs, count);` and `handles = vmemdup_array_user(bo_handles, count, sizeof(u32));`. Specifically, `kvmalloc_objs` and `vmemdup_array_user` are allocating memory for the objects and the handles respectively. My immediate thought is, are these allocations robust? Are we accounting for all possible failure scenarios? That leads me to the commit message: `dbce431756f8 drm/gem: Make drm_gem_objects_lookup() self-cleaning on failure v6`. It immediately flags something important. This commit is likely addressing how the function handles those failure cases, particularly related to the allocated memory I was just looking at. It's almost certain it includes important error-checking logic. Given the context of the function and the keywords in the commit message, the implementation is likely aiming to prevent memory leaks and ensure the system remains stable even when the object lookup fails for any reason. I'll need to dig into the details of commit `dbce431756f8` to understand the specific self-cleaning mechanisms. I'll be looking for `kfree` calls and the like!



349/5 2026/10/14 00:00 tool git-show
0m Args:
map[Commit:dbce431756f8]

Results:
map[Output:commit dbce431756f85ec76a189312afdae2dee14fb0de
Author: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Date:   Fri Feb 6 18:51:41 2026 +0530

    drm/gem: Make drm_gem_objects_lookup() self-cleaning on failure v6
    
    drm_gem_objects_lookup() can allocate the output array and take
    references on GEM objects before it fails.
    
    If an error happens part-way through, callers previously had to clean up
    partially created results themselves. This relied on subtle and
    undocumented behavior and was easy to get wrong.
    
    Make drm_gem_objects_lookup() clean up on failure. The function now
    drops any references it already took, frees the array, and sets
    *objs_out to NULL before returning an error.
    
    On success, behavior is unchanged. Existing callers remain correct and
    their error cleanup paths simply do nothing when *objs_out is NULL.
    
    v2/v3: Move partial-lookup cleanup into objects_lookup(), perform
    reference dropping outside the lock, and remove reliance on __GFP_ZERO
    or implicit NULL handling. (Christian)
    
    v4: Use goto-style error handling in objects_lookup(), drop partial
    references outside the lock, and simplify drm_gem_objects_lookup()
    cleanup by routing failures through err_free_handles as suggested.
    (Christian)
    
    v5: Rebase on drm-misc-next, drop the ret local variable. (Christian)
    
    v6: Drop superfluous initialization of handles. (Christian/Tvrtko)
    
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Suggested-by: Christian KΓΆnig <christian.koenig@amd.com>
    Suggested-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
    Reviewed-by: Christian KΓΆnig <christian.koenig@amd.com>
    Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
    Link: https://patch.msgid.link/20260206132141.1474191-1-srinivasan.shanmugam@amd.com

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 7ff6b7bbeb73..c4a3de3b920e 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -783,7 +783,7 @@ EXPORT_SYMBOL(drm_gem_put_pages);
 static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
 			  struct drm_gem_object **objs)
 {
-	int i, ret = 0;
+	int i;
 	struct drm_gem_object *obj;
 
 	spin_lock(&filp->table_lock);
@@ -791,16 +791,23 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
 	for (i = 0; i < count; i++) {
 		/* Check if we currently have a reference on the object */
 		obj = idr_find(&filp->object_idr, handle[i]);
-		if (!obj) {
-			ret = -ENOENT;
-			break;
-		}
+		if (!obj)
+			goto err;
+
 		drm_gem_object_get(obj);
 		objs[i] = obj;
 	}
+
 	spin_unlock(&filp->table_lock);
+	return 0;
 
-	return ret;
+err:
+	spin_unlock(&filp->table_lock);
+
+	while (i--)
+		drm_gem_object_put(objs[i]);
+
+	return -ENOENT;
 }
 
 /**
@@ -828,24 +835,34 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 	u32 *handles;
 	int ret;
 
+	*objs_out = NULL;
+
 	if (!count)
 		return 0;
 
-	objs = kvmalloc_array(count, sizeof(struct drm_gem_object *),
-			     GFP_KERNEL | __GFP_ZERO);
+	objs = kvmalloc_array(count, sizeof(*objs), GFP_KERNEL);
 	if (!objs)
 		return -ENOMEM;
 
-	*objs_out = objs;
-
 	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
-	if (IS_ERR(handles))
-		return PTR_ERR(handles);
+	if (IS_ERR(handles)) {
+		ret = PTR_ERR(handles);
+		goto err_free_objs;
+	}
 
 	ret = objects_lookup(filp, handles, count, objs);
+	if (ret)
+		goto err_free_handles;
+
 	kvfree(handles);
-	return ret;
+	*objs_out = objs;
+	return 0;
 
+err_free_handles:
+	kvfree(handles);
+err_free_objs:
+	kvfree(objs);
+	return ret;
 }
 EXPORT_SYMBOL(drm_gem_objects_lookup);
 
]

350/5 2026/10/14 00:00 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 44485
							output: 34
							thoughts: 2026
						

Thoughts:
**Analyzing Memory Allocation and Overflow in drm_mode_create_lease_ioctl**

Okay, so I'm looking at this code and immediately I see some interesting patterns. In `drm_gem_objects_lookup`, `vmemdup_array_user` is paired with `kvfree`, and `objs` uses `kvmalloc_objs` with `kvfree`, which is a good sign. However, I'm trying to understand why commit `f37d63e219c3` originally used `memdup_array_user` instead of `vmemdup_array_user` in `drm_lease.c`, when the intention was to safely duplicate a user-space array. The commit message indicates that `memdup_array_user` provides overflow safety, and it was used with `kfree(object_ids)` at the time.

Now, let's dive deeper into `drm_mode_create_lease_ioctl`. I notice in `drm_lease.c`, a block of code related to leased objects uses `memdup_array_user` to copy `object_ids`. Then, the patch changes `memdup_array_user` to `vmemdup_array_user` and `kfree` to `kvfree`.

But hold on! The patch also adds this check: `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))`. I need to figure out if this is correct. I am going to carefully evaluate what the patch is doing and check every detail against our guidelines! Is this check correct, or is it arbitrary? I need to analyze why we're dividing `INT_MAX` by `sizeof(struct drm_mode_object *)`.

Let's look at the type of `object_count`. It's a `size_t` in the `drm_mode_create_lease_ioctl` function, but it is passed as an `int` to `fill_object_idr`. That is potentially problematic. Inside `fill_object_idr`, `objects = kvzalloc_objs(struct drm_mode_object *, object_count);` is called, and `kvzalloc_objs` is using `object_count` to determine the number of objects to allocate. It takes the argument `COUNT` which can cause an integer overflow! Further inside `fill_object_idr` there is a loop that iterates up to `object_count`.

If `cl->object_count` (which is `u32`) is greater than `INT_MAX`, the `object_count` passed to `fill_object_idr` becomes negative due to integer truncation!

This is where the check comes in: `cl->object_count * sizeof(struct drm_mode_object *) > INT_MAX`. This is an overflow check! The code is preventing the multiplication of the number of objects by the size of each object from exceeding `INT_MAX`. Because if `cl->object_count * sizeof(struct drm_mode_object *)` is larger than `INT_MAX`, `kvmalloc` will warn via `WARN_ON_ONCE`!

Now, the question is, does `vmemdup_array_user` emit a warning in case of overflow? I need to look at `vmemdup_array_user`. It calls `vmemdup_user` which calls `check_mul_overflow`, and if overflow happens, returns `ERR_PTR(-EOVERFLOW)`.

So, the new code is a bit more robust; `vmemdup_array_user` and `kvfree` are the correct tools for the job, and the added `INT_MAX` check is critical for preventing integer overflow during memory allocation.



351/5 2026/10/14 00:00 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/util.c Name:vmemdup_user]

Results:
map[SourceCode: 234:	/**
 235:	 * vmemdup_user - duplicate memory region from user space
 236:	 *
 237:	 * @src: source address in user space
 238:	 * @len: number of bytes to copy
 239:	 *
 240:	 * Return: an ERR_PTR() on failure.  Result may be not
 241:	 * physically contiguous.  Use kvfree() to free.
 242:	 */
 243:	void *vmemdup_user(const void __user *src, size_t len)
 244:	{
 245:		void *p;
 246:	
 247:		p = kmem_buckets_valloc(user_buckets, len, GFP_USER);
 248:		if (!p)
 249:			return ERR_PTR(-ENOMEM);
 250:	
 251:		if (copy_from_user(p, src, len)) {
 252:			kvfree(p);
 253:			return ERR_PTR(-EFAULT);
 254:		}
 255:	
 256:		return p;
 257:	}
 SourceFile:mm/util.c]

352/5 2026/10/14 00:00 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 47700
							output: 36
							thoughts: 14
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach summarizing the prompt, given my assumed expertise:

**Checking `kmem_buckets_valloc`**

Right, so the prompt is directing me to focus on `kmem_buckets_valloc`. My initial thought is, "Ah, `kmem_buckets_valloc`, that's a key function within the kernel's memory management." I'm immediately running through its purpose in my head – it's likely responsible for allocating virtual memory from the `kmem_buckets` subsystem, usually for kernel-internal structures and buffers. I know the `buckets` part indicates it's likely using a slab allocator or something similar, optimizing allocation and deallocation of smaller, frequently used memory regions. I'm wondering if this is a recent performance issue.

What's the context? What are we trying to understand about `kmem_buckets_valloc`? Is this about debugging a memory leak? Or perhaps performance tuning? Are we trying to understand how it interacts with other kernel subsystems? I need more information to fully assess the significance of this focus. I'm assuming that it is to understand the performance and functionality of this function.

I'd want to check the following things immediately: its usage, how memory is actually allocated, if there are any locks being utilized, if there are any potential race conditions, and how much fragmentation it creates. I'm also thinking about what kernel version this relates to, as implementations can vary significantly. I need to understand the specifics of how this function operates in this particular kernel version. I'm already formulating questions in my mind: What are the typical call sites? How does it interact with the underlying virtual memory management? What's the impact on overall system performance when it's heavily utilized?



353/5 2026/10/14 00:00 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/util.c Name:kmem_buckets_valloc]

Results:
map[SourceCode: SourceFile:]

354/5 2026/10/14 00:00 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 48152
							output: 21
							thoughts: 13
						

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

**Hunting Down `kmem_buckets_valloc`**

Right, let's get down to it. My initial thought is to zero in on finding the function `kmem_buckets_valloc`. Why? Well, depending on the context, and without more info, it could be the key to understanding a specific memory allocation scheme within the kernel. It’s got that β€œbuckets” in the name, which immediately suggests some kind of categorized allocation, perhaps slab or slub-based. Knowing its location is critical for any deeper dive. Is it in the core kernel, a module, or something more obscure? I'll probably need to start by tracing calls, using tools like `kprobe` or even looking at the symbol table. Knowing the location will inform the best next steps, whether that's static analysis, dynamic tracing, or simply examining the source. Time to get digging!



355/5 2026/10/14 00:00 tool grepper
0m Args:
map[Expression:kmem_buckets_valloc]

Results:
map[Output:include/linux/slab.h=1352=void *kvmalloc_node(size_t size, gfp_t flags, int node);
--
include/linux/slab.h-1362-
include/linux/slab.h:1363:#define kmem_buckets_valloc(_b, _size, _flags)	\
include/linux/slab.h-1364-	alloc_hooks(__kvmalloc_node_noprof(PASS_KMALLOC_PARAMS(_size, _b, __kmalloc_token(_size)), 1, _flags, NUMA_NO_NODE))
--
mm/util.c=243=void *vmemdup_user(const void __user *src, size_t len)
--
mm/util.c-246-
mm/util.c:247:	p = kmem_buckets_valloc(user_buckets, len, GFP_USER);
mm/util.c-248-	if (!p)
]

356/5 2026/10/14 00:00 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 48641
							output: 32
							thoughts: 565
						

Thoughts:
Here's my analysis of this code, as I understand it:

**Digging into Potential Integer Overflow Vulnerabilities**

Okay, so I'm looking at this code and immediately I see `kmem_buckets_valloc` calling `__kvmalloc_node_noprof` with `GFP_USER`. The important thing here is that `GFP_USER` *doesn't* include `__GFP_NOWARN`. This immediately raises a red flag. If the requested length (`len`) in `vmemdup_user` is larger than `INT_MAX`, then `__kvmalloc_node_noprof` gets called with a `size > INT_MAX`. That's where the problem shows itself: the kernel will `WARN_ON_ONCE` because it should never see sizes that are that large. Exactly the same issue exists in `kvzalloc_objs`! It also uses `GFP_KERNEL` without `__GFP_NOWARN`, so a size greater than `INT_MAX` would also trigger a `WARN_ON_ONCE`.

However, the check `cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)` seems to address this issue. Looking at this, it ensures a few things:

1.  `cl->object_count * sizeof(struct drm_mode_object *)` will never exceed `INT_MAX`.
2.  `cl->object_count * sizeof(__u32)` also doesn't.
3.  `cl->object_count` itself doesn't exceed `INT_MAX`, ensuring there are no integer overflows when passed to `fill_object_idr`.

Now I'm questioning myself. Is this check truly safe? I'm missing something, so I look at the include statements that were added to understand the context.

I see that the includes are there because `<linux/limits.h>` defines `INT_MAX`, `<linux/slab.h>` contains `kvzalloc_objs` and `kvfree`, and `<linux/string.h>` is needed for `vmemdup_array_user`. Okay, that makes sense now!

But wait, I need to ask a bigger question: Does a DRM lease *ever* actually need `vmemdup_array_user` or `kvzalloc_objs`? Are these functions even appropriate for what DRM is doing? This feels a bit suspicious. I need to understand the scale of potential DRM objects. How many objects can a DRM device *possibly* have? Can we have millions of these? My instinct is no. I need to investigate the DRM code itself. I'm going to search through it, starting with how DRM objects are created and how their IDs are assigned, in order to get a better sense of the limits here. This smells like potential for a misunderstanding of scale.



357/5 2026/10/14 00:00 tool grepper
0m Args:
map[Expression:drm_mode_object PathPrefixes:[drivers/gpu/drm/]]

Results:
map[Output:
Full output is too long, showing 200 out of 615 lines.
Use more precise expression or PathPrefixes if possible.

Number of matching lines per file (23 files in total):
drivers/gpu/drm/Makefile:1
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c:1
drivers/gpu/drm/armada/armada_overlay.c:1
drivers/gpu/drm/display/drm_hdcp_helper.c:1
drivers/gpu/drm/drm_atomic_uapi.c:12
drivers/gpu/drm/drm_bridge.c:1
drivers/gpu/drm/drm_colorop.c:1
drivers/gpu/drm/drm_connector.c:8
drivers/gpu/drm/drm_crtc.c:5
drivers/gpu/drm/drm_crtc_internal.h:17
drivers/gpu/drm/drm_drv.c:1
drivers/gpu/drm/drm_encoder.c:3
drivers/gpu/drm/drm_framebuffer.c:6
drivers/gpu/drm/drm_lease.c:7
drivers/gpu/drm/drm_mode_object.c:51
drivers/gpu/drm/drm_plane.c:6
drivers/gpu/drm/drm_property.c:14
drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c:1
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c:1
drivers/gpu/drm/omapdrm/omap_overlay.h:1
drivers/gpu/drm/omapdrm/omap_plane.c:1
drivers/gpu/drm/omapdrm/omap_plane.h:2
drivers/gpu/drm/tests/drm_framebuffer_test.c:3

drivers/gpu/drm/Makefile=35=drm-y := \
--
drivers/gpu/drm/Makefile-60-	drm_mode_config.o \
drivers/gpu/drm/Makefile:61:	drm_mode_object.o \
drivers/gpu/drm/Makefile-62-	drm_modes.o \
--
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c-16-#include <drm/drm_managed.h>
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c:17:#include <drm/drm_mode_object.h>
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c-18-#include <drm/drm_modes.h>
--
drivers/gpu/drm/armada/armada_overlay.c=542=int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs)
--
drivers/gpu/drm/armada/armada_overlay.c-544-	struct armada_private *priv = drm_to_armada_dev(dev);
drivers/gpu/drm/armada/armada_overlay.c:545:	struct drm_mode_object *mobj;
drivers/gpu/drm/armada/armada_overlay.c-546-	struct drm_plane *overlay;
--
drivers/gpu/drm/display/drm_hdcp_helper.c-20-#include <drm/drm_property.h>
drivers/gpu/drm/display/drm_hdcp_helper.c:21:#include <drm/drm_mode_object.h>
drivers/gpu/drm/display/drm_hdcp_helper.c-22-#include <drm/drm_connector.h>
--
drivers/gpu/drm/drm_atomic_uapi.c=980=drm_atomic_connector_get_property(struct drm_connector *connector,
--
drivers/gpu/drm/drm_atomic_uapi.c-1065-
drivers/gpu/drm/drm_atomic_uapi.c:1066:int drm_atomic_get_property(struct drm_mode_object *obj,
drivers/gpu/drm/drm_atomic_uapi.c-1067-		struct drm_property *property, uint64_t *val)
--
drivers/gpu/drm/drm_atomic_uapi.c=1203=int drm_atomic_set_property(struct drm_atomic_commit *state,
drivers/gpu/drm/drm_atomic_uapi.c-1204-			    struct drm_file *file_priv,
drivers/gpu/drm/drm_atomic_uapi.c:1205:			    struct drm_mode_object *obj,
drivers/gpu/drm/drm_atomic_uapi.c-1206-			    struct drm_property *prop,
--
drivers/gpu/drm/drm_atomic_uapi.c-1209-{
drivers/gpu/drm/drm_atomic_uapi.c:1210:	struct drm_mode_object *ref;
drivers/gpu/drm/drm_atomic_uapi.c-1211-	u64 old_val;
--
drivers/gpu/drm/drm_atomic_uapi.c=1611=int drm_mode_atomic_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_atomic_uapi.c-1685-		uint32_t obj_id, count_props;
drivers/gpu/drm/drm_atomic_uapi.c:1686:		struct drm_mode_object *obj;
drivers/gpu/drm/drm_atomic_uapi.c-1687-
--
drivers/gpu/drm/drm_atomic_uapi.c-1692-
drivers/gpu/drm/drm_atomic_uapi.c:1693:		obj = drm_mode_object_find(dev, file_priv, obj_id, DRM_MODE_OBJECT_ANY);
drivers/gpu/drm/drm_atomic_uapi.c-1694-		if (!obj) {
--
drivers/gpu/drm/drm_atomic_uapi.c-1701-			drm_dbg_atomic(dev, "[OBJECT:%d] has no properties", obj_id);
drivers/gpu/drm/drm_atomic_uapi.c:1702:			drm_mode_object_put(obj);
drivers/gpu/drm/drm_atomic_uapi.c-1703-			ret = -ENOENT;
--
drivers/gpu/drm/drm_atomic_uapi.c-1707-		if (get_user(count_props, count_props_ptr + copied_objs)) {
drivers/gpu/drm/drm_atomic_uapi.c:1708:			drm_mode_object_put(obj);
drivers/gpu/drm/drm_atomic_uapi.c-1709-			ret = -EFAULT;
--
drivers/gpu/drm/drm_atomic_uapi.c-1720-			if (get_user(prop_id, props_ptr + copied_props)) {
drivers/gpu/drm/drm_atomic_uapi.c:1721:				drm_mode_object_put(obj);
drivers/gpu/drm/drm_atomic_uapi.c-1722-				ret = -EFAULT;
--
drivers/gpu/drm/drm_atomic_uapi.c-1730-					       obj_id, prop_id);
drivers/gpu/drm/drm_atomic_uapi.c:1731:				drm_mode_object_put(obj);
drivers/gpu/drm/drm_atomic_uapi.c-1732-				ret = -ENOENT;
--
drivers/gpu/drm/drm_atomic_uapi.c-1738-					   sizeof(prop_value))) {
drivers/gpu/drm/drm_atomic_uapi.c:1739:				drm_mode_object_put(obj);
drivers/gpu/drm/drm_atomic_uapi.c-1740-				ret = -EFAULT;
--
drivers/gpu/drm/drm_atomic_uapi.c-1746-			if (ret) {
drivers/gpu/drm/drm_atomic_uapi.c:1747:				drm_mode_object_put(obj);
drivers/gpu/drm/drm_atomic_uapi.c-1748-				goto out;
--
drivers/gpu/drm/drm_atomic_uapi.c-1753-
drivers/gpu/drm/drm_atomic_uapi.c:1754:		drm_mode_object_put(obj);
drivers/gpu/drm/drm_atomic_uapi.c-1755-	}
--
drivers/gpu/drm/drm_bridge.c-59- *
drivers/gpu/drm/drm_bridge.c:60: * &drm_bridge, like &drm_panel, aren't &drm_mode_object entities like planes,
drivers/gpu/drm/drm_bridge.c-61- * CRTCs, encoders or connectors and hence are not visible to userspace. They
--
drivers/gpu/drm/drm_colorop.c=95=static int drm_plane_colorop_init(struct drm_device *dev, struct drm_colorop *colorop,
--
drivers/gpu/drm/drm_colorop.c-103-
drivers/gpu/drm/drm_colorop.c:104:	ret = drm_mode_object_add(dev, &colorop->base, DRM_MODE_OBJECT_COLOROP);
drivers/gpu/drm/drm_colorop.c-105-	if (ret)
--
drivers/gpu/drm/drm_connector.c=194=static void drm_connector_free(struct kref *kref)
--
drivers/gpu/drm/drm_connector.c-199-
drivers/gpu/drm/drm_connector.c:200:	drm_mode_object_unregister(dev, &connector->base);
drivers/gpu/drm/drm_connector.c-201-	connector->funcs->destroy(connector);
--
drivers/gpu/drm/drm_connector.c=204=void drm_connector_free_work_fn(struct work_struct *work)
--
drivers/gpu/drm/drm_connector.c-217-	llist_for_each_entry_safe(connector, n, freed, free_node) {
drivers/gpu/drm/drm_connector.c:218:		drm_mode_object_unregister(dev, &connector->base);
drivers/gpu/drm/drm_connector.c-219-		connector->funcs->destroy(connector);
--
drivers/gpu/drm/drm_connector.c=223=static int drm_connector_init_only(struct drm_device *dev,
--
drivers/gpu/drm/drm_connector.c-237-
drivers/gpu/drm/drm_connector.c:238:	ret = __drm_mode_object_add(dev, &connector->base,
drivers/gpu/drm/drm_connector.c-239-				    DRM_MODE_OBJECT_CONNECTOR,
--
drivers/gpu/drm/drm_connector.c-327-	if (ret)
drivers/gpu/drm/drm_connector.c:328:		drm_mode_object_unregister(dev, &connector->base);
drivers/gpu/drm/drm_connector.c-329-
--
drivers/gpu/drm/drm_connector.c=771=void drm_connector_cleanup(struct drm_connector *connector)
--
drivers/gpu/drm/drm_connector.c-807-	kfree(connector->display_info.vics);
drivers/gpu/drm/drm_connector.c:808:	drm_mode_object_unregister(dev, &connector->base);
drivers/gpu/drm/drm_connector.c-809-	kfree(connector->name);
--
drivers/gpu/drm/drm_connector.c=850=int drm_connector_register(struct drm_connector *connector)
--
drivers/gpu/drm/drm_connector.c-876-
drivers/gpu/drm/drm_connector.c:877:	drm_mode_object_register(connector->dev, &connector->base);
drivers/gpu/drm/drm_connector.c-878-
--
drivers/gpu/drm/drm_connector.c=3417=EXPORT_SYMBOL(drm_connector_update_privacy_screen);
drivers/gpu/drm/drm_connector.c-3418-
drivers/gpu/drm/drm_connector.c:3419:int drm_connector_set_obj_prop(struct drm_mode_object *obj,
drivers/gpu/drm/drm_connector.c-3420-				    struct drm_property *property,
--
drivers/gpu/drm/drm_connector.c=3496=int drm_mode_getconnector(struct drm_device *dev, void *data,
--
drivers/gpu/drm/drm_connector.c-3626-	 */
drivers/gpu/drm/drm_connector.c:3627:	ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic,
drivers/gpu/drm/drm_connector.c-3628-			file_priv->plane_color_pipeline,
--
drivers/gpu/drm/drm_crtc.c=254=static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
--
drivers/gpu/drm/drm_crtc.c-280-	drm_modeset_lock_init(&crtc->mutex);
drivers/gpu/drm/drm_crtc.c:281:	ret = drm_mode_object_add(dev, &crtc->base, DRM_MODE_OBJECT_CRTC);
drivers/gpu/drm/drm_crtc.c-282-	if (ret)
--
drivers/gpu/drm/drm_crtc.c-290-	if (!crtc->name) {
drivers/gpu/drm/drm_crtc.c:291:		drm_mode_object_unregister(dev, &crtc->base);
drivers/gpu/drm/drm_crtc.c-292-		return -ENOMEM;
--
drivers/gpu/drm/drm_crtc.c-313-	if (ret) {
drivers/gpu/drm/drm_crtc.c:314:		drm_mode_object_unregister(dev, &crtc->base);
drivers/gpu/drm/drm_crtc.c-315-		return ret;
--
drivers/gpu/drm/drm_crtc.c=500=void drm_crtc_cleanup(struct drm_crtc *crtc)
--
drivers/gpu/drm/drm_crtc.c-515-
drivers/gpu/drm/drm_crtc.c:516:	drm_mode_object_unregister(dev, &crtc->base);
drivers/gpu/drm/drm_crtc.c-517-	list_del(&crtc->head);
--
drivers/gpu/drm/drm_crtc.c=709=int drm_mode_setcrtc(struct drm_device *dev, void *data,
--
drivers/gpu/drm/drm_crtc.c-912-
drivers/gpu/drm/drm_crtc.c:913:int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
drivers/gpu/drm/drm_crtc.c-914-			       struct drm_property *property,
--
drivers/gpu/drm/drm_crtc_internal.h=58=struct drm_mode_fb_cmd;
drivers/gpu/drm/drm_crtc_internal.h:59:struct drm_mode_object;
drivers/gpu/drm/drm_crtc_internal.h-60-struct drm_mode_set;
--
drivers/gpu/drm/drm_crtc_internal.h=69=struct work_struct;
--
drivers/gpu/drm/drm_crtc_internal.h-71-/* drm_crtc.c */
drivers/gpu/drm/drm_crtc_internal.h:72:int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
drivers/gpu/drm/drm_crtc_internal.h-73-			       struct drm_property *property,
--
drivers/gpu/drm/drm_crtc_internal.h=136=bool drm_property_change_valid_get(struct drm_property *property,
drivers/gpu/drm/drm_crtc_internal.h-137-				   uint64_t value,
drivers/gpu/drm/drm_crtc_internal.h:138:				   struct drm_mode_object **ref);
drivers/gpu/drm/drm_crtc_internal.h-139-void drm_property_change_valid_put(struct drm_property *property,
drivers/gpu/drm/drm_crtc_internal.h:140:				   struct drm_mode_object *ref);
drivers/gpu/drm/drm_crtc_internal.h-141-
--
drivers/gpu/drm/drm_crtc_internal.h=149=int drm_mode_destroyblob_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_crtc_internal.h-151-
drivers/gpu/drm/drm_crtc_internal.h:152:/* drm_mode_object.c */
drivers/gpu/drm/drm_crtc_internal.h:153:int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
drivers/gpu/drm/drm_crtc_internal.h-154-			  uint32_t obj_type, bool register_obj,
drivers/gpu/drm/drm_crtc_internal.h-155-			  void (*obj_free_cb)(struct kref *kref));
drivers/gpu/drm/drm_crtc_internal.h:156:int drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
drivers/gpu/drm/drm_crtc_internal.h-157-			uint32_t obj_type);
drivers/gpu/drm/drm_crtc_internal.h:158:void drm_mode_object_register(struct drm_device *dev,
drivers/gpu/drm/drm_crtc_internal.h:159:			      struct drm_mode_object *obj);
drivers/gpu/drm/drm_crtc_internal.h:160:struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
drivers/gpu/drm/drm_crtc_internal.h-161-					       struct drm_file *file_priv,
drivers/gpu/drm/drm_crtc_internal.h-162-					       uint32_t id, uint32_t type);
drivers/gpu/drm/drm_crtc_internal.h:163:void drm_mode_object_unregister(struct drm_device *dev,
drivers/gpu/drm/drm_crtc_internal.h:164:				struct drm_mode_object *object);
drivers/gpu/drm/drm_crtc_internal.h:165:int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic,
drivers/gpu/drm/drm_crtc_internal.h-166-				   bool plane_color_pipeline,
--
drivers/gpu/drm/drm_crtc_internal.h-169-				   uint32_t *arg_count_props);
drivers/gpu/drm/drm_crtc_internal.h:170:struct drm_property *drm_mode_obj_find_prop_id(struct drm_mode_object *obj,
drivers/gpu/drm/drm_crtc_internal.h-171-					       uint32_t prop_id);
--
drivers/gpu/drm/drm_crtc_internal.h=192=int drm_connector_register_all(struct drm_device *dev);
drivers/gpu/drm/drm_crtc_internal.h:193:int drm_connector_set_obj_prop(struct drm_mode_object *obj,
drivers/gpu/drm/drm_crtc_internal.h-194-				    struct drm_property *property,
--
drivers/gpu/drm/drm_crtc_internal.h=260=int drm_atomic_set_property(struct drm_atomic_commit *state,
drivers/gpu/drm/drm_crtc_internal.h-261-			    struct drm_file *file_priv,

]

358/5 2026/10/14 00:00 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 55019
							output: 44
							thoughts: 15
						

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

**Analyzing the Lease Requirement**

Alright, let's dive into this `drm_mode_object_lease_required` situation. My initial thought is to examine exactly what this variable signifies and where it's utilized within the DRM (Direct Rendering Manager) framework. I need to quickly recall its implications regarding resource management and access control within the graphics stack. Does it impact lease acquisition strategies for modeset objects? Is it related to the negotiation and enforcement of leases between different processes or drivers? I'm immediately running through the potential implications for synchronization, particularly around the handover of resources during modesetting operations. Ultimately, I'm thinking about the implications for stability, security, and the overall performance of the rendering pipeline. I need to understand its role in the context of the larger DRM architecture.



359/5 2026/10/14 00:01 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_mode_object_lease_required]

Results:
map[SourceCode: 119:	/**
 120:	 * drm_mode_object_lease_required - check types which must be leased to be used
 121:	 * @type: type of object
 122:	 *
 123:	 * Returns whether the provided type of drm_mode_object must
 124:	 * be owned or leased to be used by a process.
 125:	 */
 126:	bool drm_mode_object_lease_required(uint32_t type)
 127:	{
 128:		switch(type) {
 129:		case DRM_MODE_OBJECT_CRTC:
 130:		case DRM_MODE_OBJECT_CONNECTOR:
 131:		case DRM_MODE_OBJECT_PLANE:
 132:			return true;
 133:		default:
 134:			return false;
 135:		}
 136:	}
 SourceFile:drivers/gpu/drm/drm_mode_object.c]

360/5 2026/10/14 00:01 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 55546
							output: 23
							thoughts: 1313
						

Thoughts:
**Analyzing the `drm_mode_create_lease_ioctl` Vulnerability**

Okay, so I'm looking at this code and immediately I see a potential issue. The `drm_mode_create_lease_ioctl` function is only supposed to deal with a limited number of CRTCs, Connectors, and Planesβ€”a few dozen at most, realistically. But the `drm_mode_create_lease_ioctl` takes an array of object IDs, `object_ids`, from user space via `cl->object_count`, and the user can essentially pass *any* value for `object_count`. This is the first red flag.

The reproducer and crash report highlight exactly this. A user sent a count of 1,000,000.  That means the code tries to allocate a 4MB array for the IDs (`memdup_array_user`).  Then, within `fill_object_idr`, it attempts to allocate another array, `objects`, of a structure for each ID, resulting in an 8MB allocation using `kzalloc_objs`. This second `kmalloc` with `GFP_KERNEL` fails because it's an order larger than `MAX_PAGE_ORDER`. Boom, a warning from the page allocator!

Now, the patch diff is interesting. It replaces `kzalloc_objs` with `kvzalloc_objs` and `kfree` with `kvfree`. That's a good step toward fixing the immediate allocation issue (using vmalloc, which can handle larger orders). Also, the patch adds a check: if `cl->object_count` is larger than `INT_MAX / sizeof(struct drm_mode_object *)`, it returns an error.  That's a basic sanity check, but I'm thinking... does it go far enough?

But wait! Replacing `memdup_array_user` with `vmemdup_array_user` is crucial. Why? If you had 2,000,000 objects, the memory would jump to 8MB in the object_ids array, which can still be problematic and lead to `kmalloc` failures.  `vmemdup_array_user` seems to be used to allocate user arrays, so this is a crucial point of concern.

The real question is... can a user space application really allocate *unlimited* memory through `vmemdup_array_user` or `kvzalloc_objs`?

I just calculated it: `INT_MAX / sizeof(struct drm_mode_object *)` is roughly 268 million.  So, if user space sets the count to 200,000,000: `vmemdup_array_user` attempts to allocate 800 MB (200M * 4 bytes) and `kvzalloc_objs` would then go for 1.6GB (200M * 8 bytes)!  This *looks* like a potential denial of service or, at the very least, a memory hog issue.

Now, who can call `drm_mode_create_lease_ioctl`? It's restricted to `DRM_MASTER`, which is usually root, or logind/a display server. Still, why would this function *allow* allocation sizes so enormous when no real device will ever approach those numbers? Is this just a maintainer taste issue, or is this architecture accepted?

I need to investigate further. What do upstream kernel and DRM maintainers think about this? Is this something they've addressed elsewhere? I'm going to search the git log in `drivers/gpu/drm` and commit history for this function (`drm_mode_create_lease_ioctl` or `fill_object_idr`). I need more context to understand the rationale and implications fully, before deciding whether this truly is a vulnerability.



361/5 2026/10/14 00:01 tool git-log
10m Error:
log-in to see details

Args:
map[CodeRegexp:fill_object_idr]

Results:
map[Output:]

362/5 2026/10/14 00:11 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 57742
							output: 35
							thoughts: 7
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in the weeds of a technical problem and aiming for a clean, efficient solution.

**Implementing PathPrefix: A Strategic Addition**

Alright, I'm thinking about the current architecture, and a thought just popped into my head: "Let's add `PathPrefix`." It's likely I'm considering a routing strategy, potentially dealing with multiple services or applications under a single domain. I'm probably looking at how to effectively direct traffic based on URL paths. The implications are probably that the routing logic needs to be flexible and that adding `PathPrefix` is the cleanest way. Perhaps I'm trying to avoid overly complex regular expressions in the configuration or in the code, or trying to centralize the management of routes. In short, the addition will hopefully make the system better.



363/5 2026/10/14 00:11 tool git-log
3m Args:
map[CodeRegexp:fill_object_idr PathPrefix:drivers/gpu/drm/]

Results:
map[Output:4bb2d367a5a2 drm/lease: allow empty leases
62884cd386b8 drm: Add four ioctls for managing drm mode object leases [v7]
]

364/5 2026/10/14 00:15 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 58025
							output: 26
							thoughts: 26
						

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

**Investigating Memory Allocation Constraints**

Alright, I need to dig deeper into how the kernel handles allocation order restrictions and the freezing of pages. My immediate thought is to leverage `git log` to trace relevant code modifications. I'll search for commit messages specifically referencing `alloc_order_allowed` and `alloc_frozen_pages`. These keywords are likely to point me to changes impacting the behavior, constraints, and potentially, the use cases or problem spaces where these allocation flags come into play.

By focusing on commit messages, I can quickly identify patches that directly touch these areas. I expect this approach will give me a timeline of changes, provide context on why modifications were made, and possibly reveal any related bugs or optimizations. This is more efficient than simply grepping the source code, as the commit message often explains the *intent* behind the change, which is crucial for my understanding. It’s also a good way to determine who to reach out to if I need more context. I'm hoping this will provide a clear picture of how these flags have evolved and are currently utilized.



365/5 2026/10/14 00:15 tool git-log
0m Args:
map[Count:5 MessageRegexps:[alloc_order_allowed]]

Results:
map[Output:2fc4c1d51d87 mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof()
]

366/5 2026/10/14 00:16 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 58364
							output: 25
							thoughts: 27
						

Thoughts:
Here's my thinking process:

**Hunting Down Those DRM Lease Issues**

Okay, so I've got a specific issue I need to address related to DRM leases, probably some warnings or allocation problems. The most efficient way to get a handle on this is to dig through commit messages. Let's focus on messages that mention either `drm_mode_create_lease` or just the broader term `drm_lease`. Those should be the most relevant and likely contain the fixes or discussions I need. That search should help me zero in on the relevant code changes quickly, which saves me a ton of time and allows me to see the context of these potentially problematic leases. Gotta find those fixes!



367/5 2026/10/14 00:16 tool git-log
0m Args:
map[Count:10 MessageRegexps:[drm_lease]]

Results:
map[Output:dbae67ed6ac6 drm/lease: make drm_lease.h self-contained
f37d63e219c3 drm_lease.c: copy user-array safely
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
d793b8f732d6 drm: clarify usage of drm leases
56f0729a510f drm: protect drm_master pointers in drm_lease.c
1f7ef07cfa14 drm: add a locked version of drm_is_current_master
1815d9c86e30 drm: add a locked version of drm_is_current_master
c336a5ee9847 drm: Lock pointer access in drm_master_release()
7988fdf5f0a3 drm: Don't include drm_legacy.h in drm_lease.c
]

368/5 2026/10/14 00:16 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 58824
							output: 28
							thoughts: 20
						

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

**Kernel-Wide Hunt for `memdup_array_user` Usage**

Alright, let's dive into this. My initial thought is to comprehensively examine the entire kernel source base. The goal here is specific: I want to identify every instance where `memdup_array_user` is employed. This function likely carries security implications, particularly around memory allocation and user-space data handling, so a complete understanding of its scope is essential. This search will be the foundation for either confirming a well-established pattern, or looking for something unexpected. This isn't just a casual grep; I anticipate needing a nuanced search strategy given the kernel's complexities. I'll need to consider how commit messages might offer context on the evolution and rationale behind each of these calls to `memdup_array_user`, as these are often well written and give an insight to intention. This information will inform any further analysis, vulnerability assessment, or code auditing I might need to perform. Time to get to work.



369/5 2026/10/14 00:16 tool git-log
0m Args:
map[Count:10 MessageRegexps:[memdup_array_user]]

Results:
map[Output:7d5c576cb1c8 Input: cs40l50-vibra - validate custom data from user space
2321831d7e95 drm/amdkfd: Use memdup_array_user to copy data from/to user space at kfd ioctls
84c4c36acd5c drm/amdgpu: validate CP_GFX_SHADOW chunk size in CS pass1
4eca4742eb21 drm/amdkfd: Use memdup_array_user to copy data from/to user space at kfd ioctls
7f61b2eef741 drm/amdgpu: validate CP_GFX_SHADOW chunk size in CS pass1
a1371d9f0e61 drm/amdgpu: rework amdgpu_userq_wait_ioctl v4
5eb2a72bac35 drm/amdgpu/userq: Use memdup_array_user in amdgpu_userq_signal_ioctl
fb1bf29acdd5 drm/amdgpu/userq: Use memdup_array_user in amdgpu_userq_wait_ioctl
922682d48d62 drm/gem: Correct error condition in drm_gem_objects_lookup
cb77b79abf5f drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
]

370/5 2026/10/14 00:16 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 59440
							output: 27
							thoughts: 19
						

Thoughts:
Okay, I'm ready. Here's a summary as if I'm processing the prompt:

**Analyzing Commit `922682d48d62`**

Alright, let's take a look at commit `922682d48d62`. Immediately, I need to understand the context. Without any additional information, this is just a cryptographic hash – a fingerprint. I can't derive much from it directly. I need to know the repository, the branch, and ideally, some surrounding information like the associated commit message or tickets. 

From my perspective, as a domain expert, this tells me nothing definitive on its own. It's a key; perhaps it is the key to further understanding the code and changes. It's the starting point for my investigation. My mind is already racing through the questions I need to answer. What was the change? Why was it made? What does it impact? Based on the lack of data, I would need more information about the commit's content or context before I could provide any kind of helpful analysis or insight.



371/5 2026/10/14 00:16 tool git-show
0m Args:
map[Commit:922682d48d62]

Results:
map[Output:commit 922682d48d628c6c5540da2eb5481f7f7694ce48
Author: Steven Price <steven.price@arm.com>
Date:   Mon Nov 24 11:20:38 2025 +0000

    drm/gem: Correct error condition in drm_gem_objects_lookup
    
    When vmemdup_array_user() fails, 'handles' is set to a negative error
    code and no memory is allocated. So the call to kvfree() should not
    happen. Instead just return early with the error code.
    
    Fixes: cb77b79abf5f ("drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup")
    Signed-off-by: Steven Price <steven.price@arm.com>
    Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Link: https://patch.msgid.link/20251124112039.117748-1-steven.price@arm.com

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 68168d58a7c8..efc79bbf3c73 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -798,13 +798,10 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 	*objs_out = objs;
 
 	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
-	if (IS_ERR(handles)) {
-		ret = PTR_ERR(handles);
-		goto out;
-	}
+	if (IS_ERR(handles))
+		return PTR_ERR(handles);
 
 	ret = objects_lookup(filp, handles, count, objs);
-out:
 	kvfree(handles);
 	return ret;
 
]

372/5 2026/10/14 00:16 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 60281
							output: 37
							thoughts: 4791
						

Thoughts:
**Analysis of the drm_lease.c Patch for Potential Vulnerabilities and Design Issues**

Okay, let's break this down. This patch is focused on hardening the `drm_mode_create_lease_ioctl` function, specifically related to the handling of `object_count` passed from userspace. The critical section seems to be around the allocation and handling of `object_ids` and `objects`.

First, I see the core fix: replacing `kfree` with `kvfree` and `kzalloc` with `kvzalloc` when working with user-provided data, and that's good. It ensures we're using the correct kernel memory allocators. Also, I see `vmemdup_array_user` is being used, which is a good thing to use when coping data from user space.

Next, I'm zeroing in on this added check:
```c
	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
		return -EINVAL;
	}
```
This is the heart of the matter. It's crucial because `object_count` is used to determine the size of the arrays that are allocated:

*   `object_ids`: Allocated using `vmemdup_array_user`, effectively `size * sizeof(u32)`.
*   `objects`: Allocated using `kvzalloc_objs`, effectively `size * sizeof(struct drm_mode_object *)`.

Without this check, a malicious user could pass a huge `object_count` to cause an integer overflow when allocating `objects`, which may lead to several issues. Here's why:

1.  **Integer Overflow:** Without the check, if `cl->object_count` is large enough, multiplying by `sizeof(struct drm_mode_object *)` *could* result in an integer overflow, leading to a small or even negative allocation size.
2.  **Size Overflow:** If the multiplication *doesn't* overflow, the result could still exceed `INT_MAX`, the maximum size that the kernel allocators can reliably handle, potentially leading to allocation failures or other unexpected behavior.
3.  **Potential for Out-of-Bounds Access:** Even if the allocation *succeeds*, a very large value for `object_count` combined with the unsigned nature of the loop counter `o` (`for (o = 0; o < object_count; o++)`) could lead to out-of-bounds access within the `fill_object_idr` function. Specifically, because `object_count` is passed as an `int` to `fill_object_idr`, a very large value would likely be interpreted as a negative integer within the function's scope, causing the loop condition to behave unexpectedly, and possibly leading to out-of-bounds reads or writes.

Therefore, the check `cl->object_count > INT_MAX / sizeof(...)` prevents the integer overflow and out-of-bounds access.

Also, it is crucial that there are not any issues with how the memory is freed in the error paths.

Finally, the added includes were likely not in the source file to begin with, so the patch is correct in adding them.

So, in summary, this patch is an important safety measure, and it's well-scoped:

*   It addresses a potential integer overflow vulnerability.
*   It protects against excessively large memory allocations requested from user space.
*   The check specifically prevents `kvmalloc` from being called with an illegal size, which protects against a `WARN_ON_ONCE` in `kvmalloc`.
*   It protects against a kernel crash or security vulnerability.
*   The patch's modifications are localized to this single file, and it is a complete fix to the reported issue.

Therefore, this patch is acceptable as a single-patch fix.



373/5 2026/10/14 00:17 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:1 LineCount:35]

Results:
map[Contents:   1:	// SPDX-License-Identifier: GPL-2.0-or-later
   2:	/*
   3:	 * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
   4:	 */
   5:	#include <linux/file.h>
   6:	#include <linux/uaccess.h>
   7:	
   8:	#include <drm/drm_auth.h>
   9:	#include <drm/drm_crtc.h>
  10:	#include <drm/drm_drv.h>
  11:	#include <drm/drm_file.h>
  12:	#include <drm/drm_lease.h>
  13:	#include <drm/drm_print.h>
  14:	
  15:	#include "drm_crtc_internal.h"
  16:	#include "drm_internal.h"
  17:	
  18:	/**
  19:	 * DOC: drm leasing
  20:	 *
  21:	 * DRM leases provide information about whether a DRM master may control a DRM
  22:	 * mode setting object. This enables the creation of multiple DRM masters that
  23:	 * manage subsets of display resources.
  24:	 *
  25:	 * The original DRM master of a device 'owns' the available drm resources. It
  26:	 * may create additional DRM masters and 'lease' resources which it controls
  27:	 * to the new DRM master. This gives the new DRM master control over the
  28:	 * leased resources until the owner revokes the lease, or the new DRM master
  29:	 * is closed. Some helpful terminology:
  30:	 *
  31:	 * - An 'owner' is a &struct drm_master that is not leasing objects from
  32:	 *   another &struct drm_master, and hence 'owns' the objects. The owner can be
  33:	 *   identified as the &struct drm_master for which &drm_master.lessor is NULL.
  34:	 *
  35:	 * - A 'lessor' is a &struct drm_master which is leasing objects to one or more
]

374/5 2026/10/14 00:17 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 66523
							output: 40
							thoughts: 713
						

Thoughts:
**My Thoughts on the `drm_lease.c` Patch**

Okay, so I'm looking at this patch for `drm_lease.c`. Adding those includes, `<linux/limits.h>`, `<linux/slab.h>`, and `<linux/string.h>`, is sensible. Alphabetical order, clean kernel style - good. However, wait a minute, let's not just rubber stamp this. I need to make sure I understand the consequences.

My immediate focus is on `drm_mode_create_lease_ioctl`. Let's step through the error paths there. Specifically, this section:

```c
		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
						object_count, sizeof(__u32));
		if (IS_ERR(object_ids)) {
			ret = PTR_ERR(object_ids);
			idr_destroy(&leases);
			goto out_lessor;
		}

		/* fill and validate the object idr */
		ret = fill_object_idr(dev, lessor_priv, &leases,
				      object_count, object_ids);
		kvfree(object_ids);
		if (ret) {
			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
			idr_destroy(&leases);
			goto out_lessor;
		}
```

Okay, the memory allocation and copying from userspace look standard. If that fails, it cleans up and bails. The `fill_object_idr` call looks interesting. Then I see `idr_destroy(&leases)`. *That* warrants attention. I need to be *sure* what `idr_destroy` does. Does it free any objects *within* the IDR? It's a critical point if `fill_object_idr` might only partially succeed.

Let's dive into `fill_object_idr`. Lines 433-455:

```c
			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
			if (ret < 0) {
				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
					      object_id, ret);
				goto out_free_objects;
			}
...
out_free_objects:
		for (o = 0; o < object_count; o++) {
			if (objects[o])
				drm_mode_object_put(objects[o]);
		}
		kvfree(objects);
		return ret;
```

Ah, here's the answer! If `idr_alloc` fails, it *does* clean up. It iterates through the partially populated `objects` array and calls `drm_mode_object_put` on the allocated objects, then frees the `objects` array itself. So the cleanup is *explicitly* handled if `fill_object_idr` fails.  This makes me feel more confident in that code path.

Coming back to `drm_mode_create_lease_ioctl`, the call to `idr_destroy(&leases)` is in the `ret` path after `fill_object_idr`.

Now I need to understand what happens if `fill_object_idr` *succeeds*. What is `drm_lease_create` doing with this populated IDR? I need to check how the IDR is used later on.



375/5 2026/10/14 00:17 tool codesearch-definition-source
0m Args:
map[ContextFile:drivers/gpu/drm/drm_lease.c Name:drm_lease_create]

Results:
map[SourceCode: 196:	/*
 197:	 * Uses drm_master_create to allocate a new drm_master, then checks to
 198:	 * make sure all of the desired objects can be leased, atomically
 199:	 * leasing them to the new drmmaster.
 200:	 *
 201:	 * 	ERR_PTR(-EACCES)	some other master holds the title to any object
 202:	 * 	ERR_PTR(-ENOENT)	some object is not a valid DRM object for this device
 203:	 * 	ERR_PTR(-EBUSY)		some other lessee holds title to this object
 204:	 *	ERR_PTR(-EEXIST)	same object specified more than once in the provided list
 205:	 *	ERR_PTR(-ENOMEM)	allocation failed
 206:	 */
 207:	static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr *leases)
 208:	{
 209:		struct drm_device *dev = lessor->dev;
 210:		int error;
 211:		struct drm_master *lessee;
 212:		int object;
 213:		int id;
 214:		void *entry;
 215:	
 216:		drm_dbg_lease(dev, "lessor %d\n", lessor->lessee_id);
 217:	
 218:		lessee = drm_master_create(lessor->dev);
 219:		if (!lessee) {
 220:			drm_dbg_lease(dev, "drm_master_create failed\n");
 221:			return ERR_PTR(-ENOMEM);
 222:		}
 223:	
 224:		mutex_lock(&dev->mode_config.idr_mutex);
 225:	
 226:		idr_for_each_entry(leases, entry, object) {
 227:			error = 0;
 228:			if (!idr_find(&dev->mode_config.object_idr, object))
 229:				error = -ENOENT;
 230:			else if (_drm_has_leased(lessor, object))
 231:				error = -EBUSY;
 232:	
 233:			if (error != 0) {
 234:				drm_dbg_lease(dev, "object %d failed %d\n", object, error);
 235:				goto out_lessee;
 236:			}
 237:		}
 238:	
 239:		/* Insert the new lessee into the tree */
 240:		id = idr_alloc(&(drm_lease_owner(lessor)->lessee_idr), lessee, 1, 0, GFP_KERNEL);
 241:		if (id < 0) {
 242:			error = id;
 243:			goto out_lessee;
 244:		}
 245:	
 246:		lessee->lessee_id = id;
 247:		lessee->lessor = drm_master_get(lessor);
 248:		list_add_tail(&lessee->lessee_list, &lessor->lessees);
 249:	
 250:		/* Move the leases over */
 251:		lessee->leases = *leases;
 252:		drm_dbg_lease(dev, "new lessee %d %p, lessor %d %p\n",
 253:			      lessee->lessee_id, lessee, lessor->lessee_id, lessor);
 254:	
 255:		mutex_unlock(&dev->mode_config.idr_mutex);
 256:		return lessee;
 257:	
 258:	out_lessee:
 259:		mutex_unlock(&dev->mode_config.idr_mutex);
 260:	
 261:		drm_master_put(&lessee);
 262:	
 263:		return ERR_PTR(error);
 264:	}
 SourceFile:drivers/gpu/drm/drm_lease.c]

376/5 2026/10/14 00:17 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 69200
							output: 42
							thoughts: 2434
						

Thoughts:
**Lease Object Validation and Resource Management Analysis**

Okay, so I'm diving into this lease object code, and my initial focus is on the `drm_mode_create_lease_ioctl` function. I see how the IDR is handled – it's moved to the `lessee` on success, and destroyed on failure, which is standard practice. Now, I'm checking what happens in the case of failure, and how `vmemdup_array_user` or `fill_object_idr` failures are managed, which is my main concern.

I noticed the careful handling of the IDR destruction (`idr_destroy(&leases)`) in the error paths of `drm_mode_create_lease_ioctl`, specifically after a failure in `fill_object_idr`. That call is critical as it populates the IDR with the objects to be leased and it needs to be cleaned up on failure. Good, it looks like `fill_object_idr` drops the references to the mode objects, and it also handles freeing `object_ids` and `objects`, which are allocated within the function. Then, I see `drm_lease_create` which can also destroy the IDR in the case of failure.

I'm now focusing on the object count validation. There is a new check: `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))`. This immediately flags a potential integer overflow issue. It's excellent to see that this validation happens *before* acquiring the lessor master, demonstrating a "fail fast" approach, ensuring the input is validated before any resources are acquired. This is very good.

Now, I'm verifying the bounds: `cl->object_count` is a `__u32` which is unsigned, and thus its conversion to `int` within `fill_object_idr` is safe because it's validated to be within `int` range, and therefore it guarantees it is never negative. Both `validate_lease` and `fill_object_idr` take `int object_count`, which is consistent, so this bounds check is very important!

Next, I'm checking the memory allocation. The code now uses `vmemdup_array_user` instead of `memdup_array_user` to handle potentially large object lists, so `kvfree` needs to be used to free them, which is a key improvement I see. That makes sense, since `vmemdup_array_user` (and `vmemdup_user`) allocates memory which must be freed by `kvfree`. And, it is correct that the allocations in `fill_object_idr` now use `kvzalloc_objs` and thus must be freed with `kvfree`.

I'm making sure that there is no other place where the objects are freed, and that the resources are managed correctly. Good, I checked the whole file to make sure that there are no leaks. It looks like the lease code does a good job of validating inputs before acquiring resources, handles errors correctly and cleans up after itself. That’s solid!



377/5 2026/10/14 00:17 tool grepper
0m Args:
map[Expression:\b(object_ids|objects)\b PathPrefixes:[drivers/gpu/drm/drm_lease.c]]

Results:
map[Output:drivers/gpu/drm/drm_lease.c-30- *
drivers/gpu/drm/drm_lease.c:31: * - An 'owner' is a &struct drm_master that is not leasing objects from
drivers/gpu/drm/drm_lease.c:32: *   another &struct drm_master, and hence 'owns' the objects. The owner can be
drivers/gpu/drm/drm_lease.c-33- *   identified as the &struct drm_master for which &drm_master.lessor is NULL.
drivers/gpu/drm/drm_lease.c-34- *
drivers/gpu/drm/drm_lease.c:35: * - A 'lessor' is a &struct drm_master which is leasing objects to one or more
drivers/gpu/drm/drm_lease.c-36- *   other &struct drm_master. Currently, lessees are not allowed to
--
drivers/gpu/drm/drm_lease.c-38- *
drivers/gpu/drm/drm_lease.c:39: * - A 'lessee' is a &struct drm_master which is leasing objects from some
drivers/gpu/drm/drm_lease.c-40- *   other &struct drm_master. Each lessee only leases resources from a single
drivers/gpu/drm/drm_lease.c:41: *   lessor recorded in &drm_master.lessor, and holds the set of objects that
drivers/gpu/drm/drm_lease.c-42- *   it is leasing in &drm_master.leases.
--
drivers/gpu/drm/drm_lease.c-48- *
drivers/gpu/drm/drm_lease.c:49: * The set of objects any &struct drm_master 'controls' is limited to the set
drivers/gpu/drm/drm_lease.c:50: * of objects it leases (for lessees) or all objects (for owners).
drivers/gpu/drm/drm_lease.c-51- *
--
drivers/gpu/drm/drm_lease.c-57- *
drivers/gpu/drm/drm_lease.c:58: * Since each lessee may lease objects from a single lessor, display resource
drivers/gpu/drm/drm_lease.c-59- * leases form a tree of &struct drm_master. As lessees are currently not
--
drivers/gpu/drm/drm_lease.c-64- * &drm_master.lessor is NULL). The full list of lessees that are leasing
drivers/gpu/drm/drm_lease.c:65: * objects from the owner can be searched via the owner's
drivers/gpu/drm/drm_lease.c-66- * &drm_master.lessee_idr.
--
drivers/gpu/drm/drm_lease.c=154=uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in)
--
drivers/gpu/drm/drm_lease.c-197- * Uses drm_master_create to allocate a new drm_master, then checks to
drivers/gpu/drm/drm_lease.c:198: * make sure all of the desired objects can be leased, atomically
drivers/gpu/drm/drm_lease.c-199- * leasing them to the new drmmaster.
--
drivers/gpu/drm/drm_lease.c=346=static int validate_lease(struct drm_device *dev,
drivers/gpu/drm/drm_lease.c-347-			  int object_count,
drivers/gpu/drm/drm_lease.c:348:			  struct drm_mode_object **objects,
drivers/gpu/drm/drm_lease.c-349-			  bool universal_planes)
--
drivers/gpu/drm/drm_lease.c-359-	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c:360:		if (objects[o]->type == DRM_MODE_OBJECT_CRTC && has_crtc == -1) {
drivers/gpu/drm/drm_lease.c-361-			has_crtc = o;
drivers/gpu/drm/drm_lease.c-362-		}
drivers/gpu/drm/drm_lease.c:363:		if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
drivers/gpu/drm/drm_lease.c-364-			has_connector = o;
--
drivers/gpu/drm/drm_lease.c-366-		if (universal_planes) {
drivers/gpu/drm/drm_lease.c:367:			if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
drivers/gpu/drm/drm_lease.c-368-				has_plane = o;
--
drivers/gpu/drm/drm_lease.c=378=static int fill_object_idr(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-381-			   int object_count,
drivers/gpu/drm/drm_lease.c:382:			   u32 *object_ids)
drivers/gpu/drm/drm_lease.c-383-{
drivers/gpu/drm/drm_lease.c:384:	struct drm_mode_object **objects;
drivers/gpu/drm/drm_lease.c-385-	u32 o;
--
drivers/gpu/drm/drm_lease.c-388-
drivers/gpu/drm/drm_lease.c:389:	objects = kzalloc_objs(struct drm_mode_object *, object_count);
drivers/gpu/drm/drm_lease.c:390:	if (!objects)
drivers/gpu/drm/drm_lease.c-391-		return -ENOMEM;
drivers/gpu/drm/drm_lease.c-392-
drivers/gpu/drm/drm_lease.c:393:	/* step one - get references to all the mode objects
drivers/gpu/drm/drm_lease.c-394-	   and check for validity. */
drivers/gpu/drm/drm_lease.c-395-	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c:396:		objects[o] = drm_mode_object_find(dev, lessor_priv,
drivers/gpu/drm/drm_lease.c:397:						  object_ids[o],
drivers/gpu/drm/drm_lease.c-398-						  DRM_MODE_OBJECT_ANY);
drivers/gpu/drm/drm_lease.c:399:		if (!objects[o]) {
drivers/gpu/drm/drm_lease.c-400-			ret = -ENOENT;
--
drivers/gpu/drm/drm_lease.c-403-
drivers/gpu/drm/drm_lease.c:404:		if (!drm_mode_object_lease_required(objects[o]->type)) {
drivers/gpu/drm/drm_lease.c-405-			DRM_DEBUG_KMS("invalid object for lease\n");
--
drivers/gpu/drm/drm_lease.c-410-
drivers/gpu/drm/drm_lease.c:411:	ret = validate_lease(dev, object_count, objects, universal_planes);
drivers/gpu/drm/drm_lease.c-412-	if (ret) {
--
drivers/gpu/drm/drm_lease.c-419-	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c:420:		struct drm_mode_object *obj = objects[o];
drivers/gpu/drm/drm_lease.c:421:		u32 object_id = objects[o]->id;
drivers/gpu/drm/drm_lease.c-422-
--
drivers/gpu/drm/drm_lease.c-426-		 * We're using an IDR to hold the set of leased
drivers/gpu/drm/drm_lease.c:427:		 * objects, but we don't need to point at the object's
drivers/gpu/drm/drm_lease.c-428-		 * data structure from the lease as the main object_idr
--
drivers/gpu/drm/drm_lease.c-461-	for (o = 0; o < object_count; o++) {
drivers/gpu/drm/drm_lease.c:462:		if (objects[o])
drivers/gpu/drm/drm_lease.c:463:			drm_mode_object_put(objects[o]);
drivers/gpu/drm/drm_lease.c-464-	}
drivers/gpu/drm/drm_lease.c:465:	kfree(objects);
drivers/gpu/drm/drm_lease.c-466-	return ret;
--
drivers/gpu/drm/drm_lease.c-470- * The master associated with the specified file will have a lease
drivers/gpu/drm/drm_lease.c:471: * created containing the objects specified in the ioctl structure.
drivers/gpu/drm/drm_lease.c-472- * A file descriptor will be allocated for that and returned to the
--
drivers/gpu/drm/drm_lease.c=475=int drm_mode_create_lease_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-487-	int fd = -1;
drivers/gpu/drm/drm_lease.c:488:	uint32_t *object_ids;
drivers/gpu/drm/drm_lease.c-489-
--
drivers/gpu/drm/drm_lease.c-508-
drivers/gpu/drm/drm_lease.c:509:	/* Handle leased objects, if any */
drivers/gpu/drm/drm_lease.c-510-	idr_init(&leases);
drivers/gpu/drm/drm_lease.c-511-	if (object_count != 0) {
drivers/gpu/drm/drm_lease.c:512:		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
drivers/gpu/drm/drm_lease.c-513-					       object_count, sizeof(__u32));
drivers/gpu/drm/drm_lease.c:514:		if (IS_ERR(object_ids)) {
drivers/gpu/drm/drm_lease.c:515:			ret = PTR_ERR(object_ids);
drivers/gpu/drm/drm_lease.c-516-			idr_destroy(&leases);
--
drivers/gpu/drm/drm_lease.c-521-		ret = fill_object_idr(dev, lessor_priv, &leases,
drivers/gpu/drm/drm_lease.c:522:				      object_count, object_ids);
drivers/gpu/drm/drm_lease.c:523:		kfree(object_ids);
drivers/gpu/drm/drm_lease.c-524-		if (ret) {
--
drivers/gpu/drm/drm_lease.c=588=int drm_mode_list_lessees_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-634-
drivers/gpu/drm/drm_lease.c:635:/* Return the list of leased objects for the specified lessee */
drivers/gpu/drm/drm_lease.c-636-int drm_mode_get_lease_ioctl(struct drm_device *dev,
--
drivers/gpu/drm/drm_lease.c-639-	struct drm_mode_get_lease *arg = data;
drivers/gpu/drm/drm_lease.c:640:	__u32 __user *object_ids = (__u32 __user *) (uintptr_t) (arg->objects_ptr);
drivers/gpu/drm/drm_lease.c-641-	__u32 count_objects = arg->count_objects;
--
drivers/gpu/drm/drm_lease.c-661-	if (lessee->lessor == NULL)
drivers/gpu/drm/drm_lease.c:662:		/* owner can use all objects */
drivers/gpu/drm/drm_lease.c-663-		object_idr = &lessee->dev->mode_config.object_idr;
--
drivers/gpu/drm/drm_lease.c-671-			drm_dbg_lease(dev, "adding object %d\n", object);
drivers/gpu/drm/drm_lease.c:672:			ret = put_user(object, object_ids + count);
drivers/gpu/drm/drm_lease.c-673-			if (ret)
--
drivers/gpu/drm/drm_lease.c-678-
drivers/gpu/drm/drm_lease.c:679:	DRM_DEBUG("lease holds %d objects\n", count);
drivers/gpu/drm/drm_lease.c-680-	if (ret == 0)
--
drivers/gpu/drm/drm_lease.c-689-/*
drivers/gpu/drm/drm_lease.c:690: * This removes all of the objects from the lease without
drivers/gpu/drm/drm_lease.c-691- * actually getting rid of the lease itself; that way all
]

378/5 2026/10/14 00:17 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 75713
							output: 33
							thoughts: 1010
						

Thoughts:
**Analyzing the get_lease ioctl and Patch Against Kernel Guidelines**

Okay, let's break this down. First, it's clear that `drm_mode_get_lease_ioctl` is a distinct function, which I already knew, but it's good to confirm. It's completely separate from the other function we are evaluating.

Now, let's run through the guidelines.

1.  **Sentinel Test:** The patch doesn't introduce any defensive guards *inside* a compound teardown. The `if` statement checking `cl->object_count` is a validation at the *ioctl entry point*. That's public API, which is explicitly exempt. Good, that's not a concern.

2.  **LIFO Stack Unwinding:** The order here is very clean. The check for `object_count` comes *before* any resource acquisition. If that fails, it returns immediately. `vmemdup_array_user` allocates `object_ids`. If it fails, we unwind to `idr_destroy` and `goto out_lessor`. `fill_object_idr` uses `object_ids` and creates `objects`. Immediately after `object_ids` is used, `kvfree(object_ids)` is called. Then, `kvfree(objects)` is paired with `kvzalloc_objs` in the `fill_object_idr`. This is a textbook LIFO unwind. Everything is properly handled and cleaned up as it should be.

3.  **Ownership Decoupling:** Not applicable here, this isn't relevant to dynamically refcounted objects and device-bound allocations.

4.  **Codebase Idiom Alignment:** Hmm, this is where it gets interesting. Can we leverage `__free(kvfree)` or `cleanup.h`? It's worth double-checking. Time to check the codebase. Gotta see if DRM uses this, in the `drivers/gpu/drm/` directory. If it doesn't, we can add it and create a patch. Otherwise, this check is good.



379/5 2026/10/14 00:17 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:__free\(kvfree\) PathPrefixes:[drivers/gpu/drm/]]

Results:
map[Output:]

380/5 2026/10/14 00:17 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 77211
							output: 33
							thoughts: 37
						

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

**Investigating Memory Management in the DRM Subsystem**

Alright, the initial hunch is that `__free(kvfree)` isn't being used in the `drivers/gpu/drm` directory. That's a reasonable starting point for an investigation. It's often the case that certain subsystems or kernel areas evolve with their own memory management conventions.  So, let's confirm that by digging into the usage of its close relative, `__free(kfree)` within the same `drivers/gpu/drm` space. Understanding *how* they're freeing memory, or more importantly *if* they're using this type of memory freeing, will illuminate whether the system is fully compliant, or if there's possibly some area of code that's worth a more in-depth look.



381/5 2026/10/14 00:18 tool grepper
0m Args:
map[Expression:__free\(kfree\) PathPrefixes:[drivers/gpu/drm/]]

Results:
map[Output:drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c=79=static int  amdgpu_debugfs_process_reg_op(bool read, struct file *f,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c-131-	 */
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:132:	u32 *data __free(kfree) = kmalloc(size, GFP_KERNEL);
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c-133-	if (!data)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c=241=static ssize_t amdgpu_debugfs_regs2_op(struct file *f, char __user *buf, u32 offset, size_t size, int write_en)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c-258-	 */
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:259:	u32 *data __free(kfree) = kmalloc(size, GFP_KERNEL);
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c-260-	if (!data)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c=484=static ssize_t amdgpu_ras_cper_debugfs_read(struct file *f, char __user *buf,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-488-	struct amdgpu_ring *ring = file_inode(f)->i_private;
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:489:	struct ras_cmd_cper_snapshot_req *snapshot_req __free(kfree) =
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-490-		kzalloc_obj(struct ras_cmd_cper_snapshot_req);
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:491:	struct ras_cmd_cper_snapshot_rsp *snapshot_rsp __free(kfree) =
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-492-		kzalloc_obj(struct ras_cmd_cper_snapshot_rsp);
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:493:	struct ras_cmd_cper_record_req *record_req __free(kfree) =
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-494-		kzalloc_obj(struct ras_cmd_cper_record_req);
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:495:	struct ras_cmd_cper_record_rsp *record_rsp __free(kfree) =
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-496-		kzalloc_obj(struct ras_cmd_cper_record_rsp);
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:497:	u32 *ring_header __free(kfree) =
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c-498-		kzalloc(ring_header_size, GFP_KERNEL);
--
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c=1728=static void dm_gpureset_commit_state(struct dc_state *dc_state,
--
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c-1736-		struct dc_stream_update stream_update;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1737:	} *bundle __free(kfree);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c-1738-	int k, m;
--
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c=541=static int smu_v13_0_6_tables_init(struct smu_context *smu)
--
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c-545-	struct smu_v13_0_6_gpu_metrics *gpu_metrics;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c:546:	void *driver_pptable __free(kfree) = NULL;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c:547:	void *metrics_table __free(kfree) = NULL;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c-548-	struct amdgpu_device *adev = smu->adev;
--
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c=197=static int smu_v15_0_8_tables_init(struct smu_context *smu)
--
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c-204-	struct smu_v15_0_8_gpu_metrics *gpu_metrics;
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c:205:	void *driver_pptable __free(kfree) = NULL;
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c:206:	void *metrics_table __free(kfree) = NULL;
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c-207-
--
drivers/gpu/drm/msm/msm_gpu.h=352=struct msm_perfcntr_state {
--
drivers/gpu/drm/msm/msm_gpu.h-363-	 * statically pre-allocated when the gpu is initialized to simplify
drivers/gpu/drm/msm/msm_gpu.h:364:	 * error path cleanup in PERFCNTR_CONFIG ioctl.  (__free(kfree)
drivers/gpu/drm/msm/msm_gpu.h-365-	 * doesn't really help with variable length arrays of allocated
--
drivers/gpu/drm/msm/msm_perfcntr.c=370=msm_ioctl_perfcntr_config(struct drm_device *dev, void *data, struct drm_file *file)
--
drivers/gpu/drm/msm/msm_perfcntr.c-420-
drivers/gpu/drm/msm/msm_perfcntr.c:421:	struct msm_perfcntr_context_state *perfctx __free(kfree) = kzalloc(
drivers/gpu/drm/msm/msm_perfcntr.c-422-		struct_size(perfctx, reserved_counters, gpu->num_perfcntr_groups),
--
drivers/gpu/drm/msm/msm_perfcntr.c-426-
drivers/gpu/drm/msm/msm_perfcntr.c:427:	struct msm_perfcntr_stream *stream __free(kfree) = kzalloc_obj(*stream);
drivers/gpu/drm/msm/msm_perfcntr.c-428-	if (!stream)
--
drivers/gpu/drm/msm/msm_perfcntr.c-430-
drivers/gpu/drm/msm/msm_perfcntr.c:431:	uint8_t *nr_counters __free(kfree) = kzalloc_objs(uint8_t, gpu->num_perfcntr_groups);
drivers/gpu/drm/msm/msm_perfcntr.c-432-	if (!nr_counters)
--
drivers/gpu/drm/msm/msm_perfcntr.c-434-
drivers/gpu/drm/msm/msm_perfcntr.c:435:	uint32_t *group_idx __free(kfree) = kzalloc_objs(uint32_t, args->nr_groups);
drivers/gpu/drm/msm/msm_perfcntr.c-436-	if (!group_idx)
--
drivers/gpu/drm/msm/msm_perfcntr.c-539-
drivers/gpu/drm/msm/msm_perfcntr.c:540:		void *buf __free(kfree) = kmalloc(stream->fifo_size, GFP_KERNEL);
drivers/gpu/drm/msm/msm_perfcntr.c-541-		if (!buf)
--
drivers/gpu/drm/xe/xe_configfs.c=412=static ssize_t gt_types_allowed_store(struct config_item *item, const char *page,
--
drivers/gpu/drm/xe/xe_configfs.c-415-	struct xe_config_group_device *dev = to_xe_config_group_device(item);
drivers/gpu/drm/xe/xe_configfs.c:416:	char *buf __free(kfree) = kstrdup(page, GFP_KERNEL);
drivers/gpu/drm/xe/xe_configfs.c-417-	char *p = buf;
--
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c=294=static ssize_t sched_groups_config_write(struct file *file, const char __user *ubuf,
--
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c-301-	u32 values[GUC_MAX_SCHED_GROUPS];
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c:302:	int *input __free(kfree) = NULL;
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c-303-	u32 count;
--
drivers/gpu/drm/xe/xe_pci.c=610=static int read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, u32 *revid)
--
drivers/gpu/drm/xe/xe_pci.c-626-		 */
drivers/gpu/drm/xe/xe_pci.c:627:		struct xe_gt *gt __free(kfree) = NULL;
drivers/gpu/drm/xe/xe_pci.c-628-		int err;
--
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c=217=static int sysctrl_receive_frames(struct xe_sysctrl *sc,
--
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c-224-	size_t remain = sizeof(*hdr) + data_out_len;
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c:225:	u8 *buffer __free(kfree) = kzalloc(remain, GFP_KERNEL);
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c-226-	size_t frame_size;
]

382/5 2026/10/14 00:18 llm patch-reviewer
0m Model:
gemini-3.8-flash

Tokens:
							input: 80504
							output: 19
							thoughts: 2020
						

Thoughts:
**Patch Review: drm/lease - Analysis and Approval**

Okay, let's break this down. This patch is aiming to fix a potential vulnerability within the DRM lease functionality, specifically addressing the allocation of large object ID arrays. The standard use of `goto` ladders and `kfree/kvfree` in `drm_lease.c` and `drm_gem.c` is fine, but we need to ensure this particular patch doesn't introduce any new problems.

First, I need to confirm this patch adheres to our single-patch policy, which it seems to be doing. We're looking for a localized fix, no architectural overhauls, and no band-aids. This appears to be precisely what we have.

The core of the patch involves replacing `kzalloc_objs` and `memdup_array_user` with `kvzalloc_objs` and `vmemdup_array_user`, respectively. This is a good sign, as `kvmalloc` and its related functions are intended for handling potentially large and user-controlled allocations. We're also seeing the introduction of checks for `cl->object_count` against `INT_MAX / sizeof(...)` to prevent overflows.

Alright, let's go over the allocation and deallocation process, starting with the integers.

I'm verifying that the allocation and deallocation pairs are correct: `kvzalloc_objs` with `kvfree`, and `vmemdup_array_user` with `kvfree`. All seems in order.

Next, I need to scrutinize the integer checks. The critical aspect is to ensure the checks for `cl->object_count` are sufficient. The initial thought is to make sure it is not 0 (allowed by commit `4bb2d367a5a2`). Then, the primary focus is on ensuring that `cl->object_count` *does* not result in integer overflows during calculations (that is, no allocation that exceeds `INT_MAX`). We are good on this front. The size checks before allocating with `kvzalloc_objs` and `vmemdup_array_user` are solid, thus they will never exceed `INT_MAX`.

Next, I'm verifying that the patch is robust against various failure scenarios for `vmemdup_array_user` and `fill_object_idr`. The code explicitly handles error returns like `-EFAULT` and `-ENOMEM` with appropriate checks using `IS_ERR` and jumps to `out_lessor` to handle cleanup gracefully. Also, I am checking the cleanup order, which appears to be LIFO.

Let's check for any compiler issues.

Now, I'll confirm that all necessary includes are present and properly placed in the source file. `<linux/limits.h>` for `INT_MAX`, `<linux/slab.h>` for `kvzalloc_objs` and `kvfree`, and `<linux/string.h>` for `vmemdup_array_user`. All seem to be present, and they're in the right place.

The underlying root cause here, as I understand it, is Syzkaller triggering an allocation that exceeds the `MAX_PAGE_ORDER` due to the use of `kmalloc` with `GFP_KERNEL` (and this is correctly addressed by this patch). The patch changes this to `vmemdup_array_user`, which can handle non-contiguous allocations and virtual memory and `kvmalloc`. The explicit `INT_MAX` check effectively prevents excessive allocation sizes from being passed to these functions in the first place, thus preventing any warnings from `__kvmalloc_node_noprof`.

Does this violate any architectural principles? Let's check:
- It's not a sentinel guard.
- No memory leaks or use-after-free conditions.
- LIFO lifecycle is maintained.
- Localized change, as it is only in `drivers/gpu/drm/drm_lease.c`.

Let's double-check again for any subtle flaws:
- `cl->object_ids` can't be NULL (handled by `vmemdup_array_user`).
- Zero `cl->object_count` (already verified and permitted).
- `cl->object_count` exceeding `INT_MAX / sizeof(...)` is blocked.
- Potential `kvzalloc_objs` failures are handled.
- `vmemdup_array_user` failures are handled.
- `kvfree` handles NULL.

Everything is very solid. This patch is a clean fix, follows the kernel's coding standards, handles potential errors correctly, and addresses the root cause directly. **ReviewApproved = true**. No comments are needed. Time to call the `set-results` tool.



383/5 2026/10/14 00:18 tool set-results
0m Args:
map[ReviewApproved:true ReviewComments:[]]

Results:
map[ReviewApproved:true ReviewComments:[]]

384/4 2026/10/14 00:18 action evaluate-patch-review
0m Results:
map[NeedsIteration:false ReviewFeedback:]

385/1 2026/10/14 00:18 action apply-patch
0m Results:
map[]

386/1 2026/10/14 00:18 action init-style-items
0m Results:
map[StyleItems:<nil>]

387/1 2026/10/14 00:18 action run-checkpatch
0m Results:
map[CheckpatchOutput:total: 0 errors, 0 warnings, 54 lines checked

Your patch has no obvious style problems and is ready for submission.
]

388/1 2026/10/14 00:18 loop
0m
389/2 2026/10/14 00:18 iteration 0
0m
390/3 2026/10/14 00:18 agent checkpatch-arbiter
0m Model:
core

Results:
map[ActionableIssues:[]]

Instruction:
You are an expert Linux kernel maintainer acting as a code style arbiter.
Your task is to review scripts/checkpatch.pl output and reviewer style requests for a proposed patch.

Determine which reported issues are genuine, actionable formatting/style defects (e.g. indentation, whitespace,
naming, syntax style) and should be fixed. List them in ActionableIssues.

Ignore issues that are false positives, intentional constructs (e.g. BUG_ON/XA_BUG_ON in test files, macros,
subsystem conventions), or unfixable without breaking code logic or tests. If no issues should be changed,
leave ActionableIssues empty.


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 patch diff is:

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -3,6 +3,9 @@
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
@@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
@@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
@@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
@@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);



The checkpatch.pl output is:
total: 0 errors, 0 warnings, 54 lines checked

Your patch has no obvious style problems and is ready for submission.







Carefully evaluate each issue and populate ActionableIssues.

391/4 2026/10/14 00:18 llm checkpatch-arbiter
0m Model:
gemini-3.8-flash

Tokens:
							input: 1252
							output: 15
							thoughts: 319
						

Thoughts:
**Reviewing the Patch for Style and Formatting**

Okay, so I need to go through this patch, looking at the output from `scripts/checkpatch.pl` and any reviewer comments to assess if there are any style or formatting issues. The goal is to determine if there are actionable defects that need fixing.

Right, the checkpatch output is clean: "total: 0 errors, 0 warnings, 54 lines checked. Your patch has no obvious style problems and is ready for submission." Fantastic! And there are no reviewer comments to sift through either.

So, the situation is straightforward. There are no reported issues from either checkpatch or the reviewers. Therefore, following the instructions, the `ActionableIssues` list should be empty. We have to consider things like false positives and those constructs that we can't alter without breaking the code, but there is no need to make those considerations here.

Now, let's make sure we're adhering to the tool call requirements. I need to call `set-results` exactly once before the final reply, with `ActionableIssues: []`. So, I will be setting `ActionableIssues` to an empty list `[]`. Let's get that done.



392/4 2026/10/14 00:18 tool set-results
0m Args:
map[ActionableIssues:[]]

Results:
map[ActionableIssues:[]]

393/3 2026/10/14 00:18 action evaluate-checkpatch-arbiter
0m Results:
map[NeedRefinement:false]

394/3 2026/10/14 00:18 action If
0m Args:
map[NeedRefinement:false]

395/1 2026/10/14 00:18 agent fixes-finder
18m Model:
core

Results:
map[FixesHash:62884cd386b876638720ef88374b31a84ca7ee5f]

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:

------------[ cut here ]------------
WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline], CPU#1: syz.0.17/7032
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397, CPU#1: syz.0.17/7032
Modules linked in:
CPU: 1 UID: 0 PID: 7032 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : alloc_order_allowed mm/page_alloc.c:5340 [inline]
pc : __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
lr : __alloc_frozen_pages_noprof+0xa8/0x640 mm/page_alloc.c:5388
sp : ffff80009d2e7580
x29: ffff80009d2e7650 x28: ffff700013a5cf18 x27: ffff80009d2e75a0
x26: 1ffff0001302e474 x25: dfff800000000000 x24: ffff700013a5ceb4
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000040dc0
x20: 0000000000000000 x19: 000000000000000b x18: 00000000ffffffff
x17: 0000000000000000 x16: ffff80008b5b9788 x15: 0000000000000005
x14: 1ffff00013a5ceb8 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700013a5cebd x10: dfff800000000000 x9 : 0000000000000001
x8 : ffff8000939c7000 x7 : 0000000000000000 x6 : ffff0000e8bd0900
x5 : ffff0000e8bd0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline] (P)
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397 (P)
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 __do_kmalloc_node mm/slub.c:5402 [inline]
 __kmalloc_noprof+0x3ec/0x6bc mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 _kzalloc_noprof include/linux/slab.h:1312 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:583
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758
 el0t_64_sync_handler+0x68/0xdc arch/arm64/kernel/entry-common.c:777
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590
irq event stamp: 4228
hardirqs last  enabled at (4227): [<ffff80008b64f030>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (4227): [<ffff80008b64f030>] __arm64_exit_to_kernel_mode+0x64/0x78 arch/arm64/kernel/entry-common.c:60
hardirqs last disabled at (4228): [<ffff80008b64afb0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:445
softirqs last  enabled at (3568): [<ffff8000803f5178>] softirq_handle_end kernel/softirq.c:491 [inline]
softirqs last  enabled at (3568): [<ffff8000803f5178>] handle_softirqs+0xc88/0xdfc kernel/softirq.c:673
softirqs last disabled at (3415): [<ffff800080020ff4>] __do_softirq+0x14/0x20 kernel/softirq.c:679
---[ end trace 0000000000000000 ]---



The explanation of the root cause is:

An analysis of the crash reveals that it is caused by an unbounded user-controlled allocation size in the DRM lease creation ioctl, which attempts to allocate a contiguous memory block larger than `MAX_PAGE_ORDER` using the `kmalloc` family of functions.

### Root Cause Analysis

The crash is a warning triggered in `alloc_order_allowed()` because `__alloc_frozen_pages_noprof()` is called with an allocation order that exceeds `MAX_PAGE_ORDER` (typically 10, which corresponds to 4MB on systems with 4KB pages).

This happens in `fill_object_idr()` when allocating the `objects` array:
```c
// drivers/gpu/drm/drm_lease.c:389
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```
The `kzalloc_objs` macro expands to a `kmalloc`-family allocation (equivalent to `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`). 

The `object_count` comes directly from the user-space `drm_mode_create_lease` struct via `cl->object_count` in `drm_mode_create_lease_ioctl()`. There is no upper bound check on this value.

Before calling `fill_object_idr()`, `drm_mode_create_lease_ioctl()` allocates the `object_ids` array using `memdup_array_user()`:
```c
// drivers/gpu/drm/drm_lease.c:512
		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
```
`memdup_array_user()` uses `memdup_user()`, which allocates memory with `GFP_USER | __GFP_NOWARN`. Because of the `__GFP_NOWARN` flag, if `object_count` is extremely large (e.g., requiring > 4MB), `memdup_array_user()` will silently fail and return `-ENOMEM` without triggering any warnings.

However, there is a specific window where `object_count` is large enough to require more than 4MB for the `objects` array (which has 8-byte pointers on 64-bit systems), but small enough that the `object_ids` array (which has 4-byte `__u32` elements) fits within 4MB. 

In the provided syzkaller reproducer:
```c
*(uint32_t*)0x200003c8 = 0xf4240; // object_count = 1,000,000
```
1. `object_count` is set to `1,000,000`.
2. `memdup_array_user()` allocates `1,000,000 * 4 = 4,000,000` bytes. This is order 10, which is `<= MAX_PAGE_ORDER`. The allocation succeeds.
3. `fill_object_idr()` then calls `kzalloc_objs()` to allocate `1,000,000 * 8 = 8,000,000` bytes. This requires order 11, which is `> MAX_PAGE_ORDER`. 
4. Since `kzalloc_objs()` uses `GFP_KERNEL` without `__GFP_NOWARN`, the page allocator loudly complains and triggers the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)` warning.

### Proposed Fix

To fix this, the allocation of the `objects` array in `fill_object_idr()` should be changed to use `kvzalloc_objs()`, which gracefully falls back to `vmalloc()` for large allocations and does not trigger the page allocator warning. The corresponding `kfree()` must also be updated to `kvfree()`.

```c
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,7 +386,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +462,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
```

*(Note: While adding an arbitrary upper bound check to `object_count` in `drm_mode_create_lease_ioctl()` is another option, using `kvzalloc_objs()` is the standard kernel pattern for handling user-controlled array sizes without imposing artificial limits).*


The patch that fixes the bug is:

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -3,6 +3,9 @@
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
@@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
@@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
@@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
@@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);


Search for the commit(s) that introduced this bug.

396/2 2026/10/14 00:18 llm fixes-finder
1m Model:
gemini-3.8-flash

Tokens:
							input: 8443
							output: 78
							thoughts: 976
						

Thoughts:
**Pinpointing the Bug-Fixing Commit**

Okay, so I need to track down the commit that introduced the bug this patch fixes. My first instinct is always to carefully dissect the patch itself. Looking at the `diff`, it's clear we're dealing with memory allocation and object handling within the DRM lease functionality. Specifically, changes are focused around `fill_object_idr` and `drm_mode_create_lease_ioctl`.

The patch makes several changes. It replaces `kzalloc_objs` with `kvzalloc_objs` and `kfree` with `kvfree`, indicating a shift towards using kernel virtual memory for allocations. Additionally, there are changes from `memdup_array_user` to `vmemdup_array_user`. This hints at potential issues with how user-provided data for object IDs is handled, possibly related to memory copying and validation. And finally, an integer overflow check has been added to `cl->object_count`.

Given these changes, my working hypothesis is that the bug likely involves memory allocation or integer overflow when dealing with the number or size of leased objects. The fact that the code is dealing with user provided data reinforces this. It makes sense to assume the vulnerability might be in memory handling that is exposed to userspace.

To get the necessary context to determine the root cause, I'll leverage my knowledge of the codebase and the `git` tools. I'll use `git blame` or `git log` on `drivers/gpu/drm/drm_lease.c` and focus on the lines related to the changes I just analyzed, namely `fill_object_idr`, `drm_mode_create_lease_ioctl` and the lines immediately surrounding them, to see when these allocation functions were introduced or modified, and if there are any associated commit messages that might shed light on the initial design or subsequent modifications. With that information, I should be able to narrow down the range of commits and identify the culprit.



397/2 2026/10/14 00:20 tool git-blame
0m Args:
map[End:400 File:drivers/gpu/drm/drm_lease.c Start:380]

Results:
map[Output:62884cd386b87 380) 			   struct idr *leases,
62884cd386b87 381) 			   int object_count,
62884cd386b87 382) 			   u32 *object_ids)
62884cd386b87 383) {
62884cd386b87 384) 	struct drm_mode_object **objects;
62884cd386b87 385) 	u32 o;
62884cd386b87 386) 	int ret;
968029057192e 387) 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
968029057192e 388) 
32a92f8c89326 389) 	objects = kzalloc_objs(struct drm_mode_object *, object_count);
62884cd386b87 390) 	if (!objects)
62884cd386b87 391) 		return -ENOMEM;
62884cd386b87 392) 
62884cd386b87 393) 	/* step one - get references to all the mode objects
62884cd386b87 394) 	   and check for validity. */
62884cd386b87 395) 	for (o = 0; o < object_count; o++) {
62884cd386b87 396) 		objects[o] = drm_mode_object_find(dev, lessor_priv,
62884cd386b87 397) 						  object_ids[o],
62884cd386b87 398) 						  DRM_MODE_OBJECT_ANY);
62884cd386b87 399) 		if (!objects[o]) {
62884cd386b87 400) 			ret = -ENOENT;
]

398/2 2026/10/14 00:20 tool git-blame
0m Args:
map[End:530 File:drivers/gpu/drm/drm_lease.c Start:505]

Results:
map[Output:56f0729a510f9 505) 	}
56f0729a510f9 506) 
62884cd386b87 507) 	object_count = cl->object_count;
62884cd386b87 508) 
4bb2d367a5a28 509) 	/* Handle leased objects, if any */
62884cd386b87 510) 	idr_init(&leases);
4bb2d367a5a28 511) 	if (object_count != 0) {
f37d63e219c39 512) 		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
f37d63e219c39 513) 					       object_count, sizeof(__u32));
4bb2d367a5a28 514) 		if (IS_ERR(object_ids)) {
4bb2d367a5a28 515) 			ret = PTR_ERR(object_ids);
4bb2d367a5a28 516) 			idr_destroy(&leases);
4bb2d367a5a28 517) 			goto out_lessor;
4bb2d367a5a28 518) 		}
62884cd386b87 519) 
4bb2d367a5a28 520) 		/* fill and validate the object idr */
4bb2d367a5a28 521) 		ret = fill_object_idr(dev, lessor_priv, &leases,
4bb2d367a5a28 522) 				      object_count, object_ids);
4bb2d367a5a28 523) 		kfree(object_ids);
4bb2d367a5a28 524) 		if (ret) {
7bd224b6625ab 525) 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
4bb2d367a5a28 526) 			idr_destroy(&leases);
4bb2d367a5a28 527) 			goto out_lessor;
4bb2d367a5a28 528) 		}
62884cd386b87 529) 	}
62884cd386b87 530) 
]

399/2 2026/10/14 00:20 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 11238
							output: 56
							thoughts: 85
						

Thoughts:
**Examining the Recent Commit History**

Alright, let's dive right in. The context suggests there's been some recent activity that warrants a closer look. My immediate thought is to examine the specific commits listed: `62884cd386b87`, `4bb2d367a5a28`, `f37d63e219c39`, and `32a92f8c89326`. To get a clear picture of the changes introduced by each, the most direct approach is to leverage `git-show`. This will allow me to quickly dissect the diffs and understand the what, why, and how behind these commits. Time to get my hands dirty and investigate.



400/2 2026/10/14 00:20 tool git-show
0m Args:
map[Commit:32a92f8c89326]

Results:
map[Output:commit 32a92f8c89326985e05dce8b22d3f0aa07a3e1bd
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Feb 21 20:03:00 2026 -0800

    Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
    
    This converts some of the visually simpler cases that have been split
    over multiple lines.  I only did the ones that are easy to verify the
    resulting diff by having just that final GFP_KERNEL argument on the next
    line.
    
    Somebody should probably do a proper coccinelle script for this, but for
    me the trivial script actually resulted in an assertion failure in the
    middle of the script.  I probably had made it a bit _too_ trivial.
    
    So after fighting that far a while I decided to just do some of the
    syntactically simpler cases with variations of the previous 'sed'
    scripts.
    
    The more syntactically complex multi-line cases would mostly really want
    whitespace cleanup anyway.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index a4dae1baae99..b6cce510c343 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -294,8 +294,7 @@ static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
 {
 	int i;
 
-	omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size,
-					  GFP_KERNEL);
+	omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size);
 	if (!omap_mcbsp_devices) {
 		printk(KERN_ERR "Could not register McBSP devices\n");
 		return;
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
index 34d761ef08b0..592dd8668de4 100644
--- a/arch/arm64/kernel/vdso.c
+++ b/arch/arm64/kernel/vdso.c
@@ -81,8 +81,7 @@ static int __init __vdso_init(enum vdso_abi abi)
 			vdso_info[abi].vdso_code_start) >>
 			PAGE_SHIFT;
 
-	vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages,
-				     GFP_KERNEL);
+	vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages);
 	if (vdso_pagelist == NULL)
 		return -ENOMEM;
 
diff --git a/arch/loongarch/kernel/vdso.c b/arch/loongarch/kernel/vdso.c
index 222be8fc4aec..0aa10cadb959 100644
--- a/arch/loongarch/kernel/vdso.c
+++ b/arch/loongarch/kernel/vdso.c
@@ -52,8 +52,7 @@ static int __init init_vdso(void)
 
 	vdso_info.size = PAGE_ALIGN(vdso_end - vdso_start);
 	vdso_info.code_mapping.pages =
-		kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE,
-			     GFP_KERNEL);
+		kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE);
 
 	if (!vdso_info.code_mapping.pages)
 		return -ENOMEM;
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index b7fdb089f2af..2ba2dd26a7ea 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1738,8 +1738,7 @@ static int kvmppc_core_vcpu_create_pr(struct kvm_vcpu *vcpu)
 	vcpu->arch.book3s = vcpu_book3s;
 
 #ifdef CONFIG_KVM_BOOK3S_32_HANDLER
-	vcpu->arch.shadow_vcpu = kzalloc_obj(*vcpu->arch.shadow_vcpu,
-					     GFP_KERNEL);
+	vcpu->arch.shadow_vcpu = kzalloc_obj(*vcpu->arch.shadow_vcpu);
 	if (!vcpu->arch.shadow_vcpu)
 		goto free_vcpu3s;
 #endif
diff --git a/arch/powerpc/mm/book3s64/mmu_context.c b/arch/powerpc/mm/book3s64/mmu_context.c
index c7302dd2ef25..2fe787e6c2dc 100644
--- a/arch/powerpc/mm/book3s64/mmu_context.c
+++ b/arch/powerpc/mm/book3s64/mmu_context.c
@@ -96,8 +96,7 @@ static int hash__init_new_context(struct mm_struct *mm)
 {
 	int index;
 
-	mm->context.hash_context = kmalloc_obj(struct hash_mm_context,
-					       GFP_KERNEL);
+	mm->context.hash_context = kmalloc_obj(struct hash_mm_context);
 	if (!mm->context.hash_context)
 		return -ENOMEM;
 
@@ -124,8 +123,7 @@ static int hash__init_new_context(struct mm_struct *mm)
 #ifdef CONFIG_PPC_SUBPAGE_PROT
 		/* inherit subpage prot details if we have one. */
 		if (current->mm->context.hash_context->spt) {
-			mm->context.hash_context->spt = kmalloc_obj(struct subpage_prot_table,
-								    GFP_KERNEL);
+			mm->context.hash_context->spt = kmalloc_obj(struct subpage_prot_table);
 			if (!mm->context.hash_context->spt) {
 				kfree(mm->context.hash_context);
 				return -ENOMEM;
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 8a8d8c2b8930..243c0a1c8cda 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -917,8 +917,7 @@ static int create_events_from_catalog(struct attribute ***events_,
 		goto e_event_attrs;
 	}
 
-	event_long_descs = kmalloc_objs(*event_long_descs, event_idx + 1,
-					GFP_KERNEL);
+	event_long_descs = kmalloc_objs(*event_long_descs, event_idx + 1);
 	if (!event_long_descs) {
 		ret = -ENOMEM;
 		goto e_event_descs;
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index e3cb23906fcd..db98e9af8812 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1527,8 +1527,7 @@ static int init_nest_pmu_ref(void)
 {
 	int nid, i, cpu;
 
-	nest_imc_refc = kzalloc_objs(*nest_imc_refc, num_possible_nodes(),
-				     GFP_KERNEL);
+	nest_imc_refc = kzalloc_objs(*nest_imc_refc, num_possible_nodes());
 
 	if (!nest_imc_refc)
 		return -ENOMEM;
@@ -1714,14 +1713,12 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent,
 			goto err;
 
 		nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
-		pmu_ptr->mem_info = kzalloc_objs(struct imc_mem_info, nr_cores,
-						 GFP_KERNEL);
+		pmu_ptr->mem_info = kzalloc_objs(struct imc_mem_info, nr_cores);
 
 		if (!pmu_ptr->mem_info)
 			goto err;
 
-		core_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores,
-					     GFP_KERNEL);
+		core_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores);
 
 		if (!core_imc_refc) {
 			kfree(pmu_ptr->mem_info);
@@ -1754,8 +1751,7 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent,
 			return -ENOMEM;
 
 		nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
-		trace_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores,
-					      GFP_KERNEL);
+		trace_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores);
 		if (!trace_imc_refc)
 			return -ENOMEM;
 
diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
index 1389a3131993..6cd461f82968 100644
--- a/arch/powerpc/platforms/powernv/idle.c
+++ b/arch/powerpc/platforms/powernv/idle.c
@@ -1336,8 +1336,7 @@ static int __init pnv_parse_cpuidle_dt(void)
 	nr_idle_states = of_property_count_u32_elems(np,
 						"ibm,cpu-idle-state-flags");
 
-	pnv_idle_states = kzalloc_objs(*pnv_idle_states, nr_idle_states,
-				       GFP_KERNEL);
+	pnv_idle_states = kzalloc_objs(*pnv_idle_states, nr_idle_states);
 	temp_u32 = kcalloc(nr_idle_states, sizeof(u32),  GFP_KERNEL);
 	temp_u64 = kcalloc(nr_idle_states, sizeof(u64),  GFP_KERNEL);
 	temp_string = kcalloc(nr_idle_states, sizeof(char *),  GFP_KERNEL);
diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
index 5214e2d43e78..6aa578e6348d 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -133,8 +133,7 @@ static int memtrace_init_regions_runtime(u64 size)
 	u32 nid;
 	u64 m;
 
-	memtrace_array = kzalloc_objs(struct memtrace_entry, num_online_nodes(),
-				      GFP_KERNEL);
+	memtrace_array = kzalloc_objs(struct memtrace_entry, num_online_nodes());
 	if (!memtrace_array) {
 		pr_err("Failed to allocate memtrace_array\n");
 		return -EINVAL;
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index ed2842bea1cb..b3fd5c648dea 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -108,8 +108,7 @@ static int imc_get_mem_addr_nest(struct device_node *node,
 								nr_chips))
 		goto error;
 
-	pmu_ptr->mem_info = kzalloc_objs(*pmu_ptr->mem_info, nr_chips + 1,
-					 GFP_KERNEL);
+	pmu_ptr->mem_info = kzalloc_objs(*pmu_ptr->mem_info, nr_chips + 1);
 	if (!pmu_ptr->mem_info)
 		goto error;
 
diff --git a/arch/powerpc/platforms/powernv/opal-powercap.c b/arch/powerpc/platforms/powernv/opal-powercap.c
index 0e297d70647f..9bb73cb42a65 100644
--- a/arch/powerpc/platforms/powernv/opal-powercap.c
+++ b/arch/powerpc/platforms/powernv/opal-powercap.c
@@ -181,13 +181,11 @@ void __init opal_powercap_init(void)
 			has_cur = true;
 		}
 
-		pcaps[i].pattrs = kzalloc_objs(struct powercap_attr, j,
-					       GFP_KERNEL);
+		pcaps[i].pattrs = kzalloc_objs(struct powercap_attr, j);
 		if (!pcaps[i].pattrs)
 			goto out_pcaps_pattrs;
 
-		pcaps[i].pg.attrs = kzalloc_objs(struct attribute *, j + 1,
-						 GFP_KERNEL);
+		pcaps[i].pg.attrs = kzalloc_objs(struct attribute *, j + 1);
 		if (!pcaps[i].pg.attrs) {
 			kfree(pcaps[i].pattrs);
 			goto out_pcaps_pattrs;
diff --git a/arch/powerpc/platforms/powernv/opal-psr.c b/arch/powerpc/platforms/powernv/opal-psr.c
index 731d8b355343..24d0a894d965 100644
--- a/arch/powerpc/platforms/powernv/opal-psr.c
+++ b/arch/powerpc/platforms/powernv/opal-psr.c
@@ -132,8 +132,7 @@ void __init opal_psr_init(void)
 		return;
 	}
 
-	psr_attrs = kzalloc_objs(*psr_attrs, of_get_child_count(psr),
-				 GFP_KERNEL);
+	psr_attrs = kzalloc_objs(*psr_attrs, of_get_child_count(psr));
 	if (!psr_attrs)
 		goto out_put_psr;
 
diff --git a/arch/powerpc/platforms/powernv/opal-sensor-groups.c b/arch/powerpc/platforms/powernv/opal-sensor-groups.c
index 2a3474246908..87fd6d7769e9 100644
--- a/arch/powerpc/platforms/powernv/opal-sensor-groups.c
+++ b/arch/powerpc/platforms/powernv/opal-sensor-groups.c
@@ -190,13 +190,11 @@ void __init opal_sensor_groups_init(void)
 		if (!nr_attrs)
 			continue;
 
-		sgs[i].sgattrs = kzalloc_objs(*sgs[i].sgattrs, nr_attrs,
-					      GFP_KERNEL);
+		sgs[i].sgattrs = kzalloc_objs(*sgs[i].sgattrs, nr_attrs);
 		if (!sgs[i].sgattrs)
 			goto out_sgs_sgattrs;
 
-		sgs[i].sg.attrs = kzalloc_objs(*sgs[i].sg.attrs, nr_attrs + 1,
-					       GFP_KERNEL);
+		sgs[i].sg.attrs = kzalloc_objs(*sgs[i].sg.attrs, nr_attrs + 1);
 
 		if (!sgs[i].sg.attrs) {
 			kfree(sgs[i].sgattrs);
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index eba277134224..257886ec3f70 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1639,8 +1639,7 @@ void __init mpic_init(struct mpic *mpic)
 
 #ifdef CONFIG_PM
 	/* allocate memory to save mpic state */
-	mpic->save_data = kmalloc_objs(*mpic->save_data, mpic->num_sources,
-				       GFP_KERNEL);
+	mpic->save_data = kmalloc_objs(*mpic->save_data, mpic->num_sources);
 	BUG_ON(mpic->save_data == NULL);
 #endif
 
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c
index e9af4fa940b1..26f62ae5f671 100644
--- a/arch/powerpc/sysdev/mpic_msgr.c
+++ b/arch/powerpc/sysdev/mpic_msgr.c
@@ -188,8 +188,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
 		dev_info(&dev->dev, "Found %d message registers\n",
 				mpic_msgr_count);
 
-		mpic_msgrs = kzalloc_objs(*mpic_msgrs, mpic_msgr_count,
-					  GFP_KERNEL);
+		mpic_msgrs = kzalloc_objs(*mpic_msgrs, mpic_msgr_count);
 		if (!mpic_msgrs) {
 			dev_err(&dev->dev,
 				"No memory for message register blocks\n");
diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 7e3749131c59..9c2f5e442338 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -55,8 +55,7 @@ static void __init __vdso_init(struct __vdso_info *vdso_info)
 		vdso_info->vdso_code_start) >>
 		PAGE_SHIFT;
 
-	vdso_pagelist = kzalloc_objs(struct page *, vdso_info->vdso_pages,
-				     GFP_KERNEL);
+	vdso_pagelist = kzalloc_objs(struct page *, vdso_info->vdso_pages);
 	if (vdso_pagelist == NULL)
 		panic("vDSO kcalloc failed!\n");
 
diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c
index fc80495027ba..86d93e8dddae 100644
--- a/arch/s390/kvm/pci.c
+++ b/arch/s390/kvm/pci.c
@@ -126,8 +126,7 @@ int kvm_s390_pci_aen_init(u8 nisc)
 		return -EPERM;
 
 	mutex_lock(&aift->aift_lock);
-	aift->kzdev = kzalloc_objs(struct kvm_zdev *, ZPCI_NR_DEVICES,
-				   GFP_KERNEL);
+	aift->kzdev = kzalloc_objs(struct kvm_zdev *, ZPCI_NR_DEVICES);
 	if (!aift->kzdev) {
 		rc = -ENOMEM;
 		goto unlock;
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 0ae82e529c21..2a430722cbe4 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -1073,8 +1073,7 @@ static int zpci_mem_init(void)
 	if (!zdev_fmb_cache)
 		goto error_fmb;
 
-	zpci_iomap_start = kzalloc_objs(*zpci_iomap_start, ZPCI_IOMAP_ENTRIES,
-					GFP_KERNEL);
+	zpci_iomap_start = kzalloc_objs(*zpci_iomap_start, ZPCI_IOMAP_ENTRIES);
 	if (!zpci_iomap_start)
 		goto error_iomap;
 
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index 1e67082eb3b4..cbbb94d41fd0 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -558,8 +558,7 @@ static int __init sh7786_pcie_init(void)
 	if (unlikely(nr_ports == 0))
 		return -ENODEV;
 
-	sh7786_pcie_ports = kzalloc_objs(struct sh7786_pcie_port, nr_ports,
-					 GFP_KERNEL);
+	sh7786_pcie_ports = kzalloc_objs(struct sh7786_pcie_port, nr_ports);
 	if (unlikely(!sh7786_pcie_ports))
 		return -ENOMEM;
 
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 81f0be76f48a..371460e34484 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -297,8 +297,7 @@ static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg,
 	unsigned long hv_err;
 	int i;
 
-	hdesc = kzalloc_flex(*hdesc, maps, num_kernel_image_mappings,
-		             GFP_KERNEL);
+	hdesc = kzalloc_flex(*hdesc, maps, num_kernel_image_mappings);
 	if (!hdesc) {
 		printk(KERN_ERR "ldom_startcpu_cpuid: Cannot allocate "
 		       "hvtramp_descr.\n");
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 8d5e2d5c0bc5..ecefcffcf7b1 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -647,8 +647,7 @@ SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type,
 	}
 	if (!current_thread_info()->utraps) {
 		current_thread_info()->utraps =
-			kzalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1,
-				     GFP_KERNEL);
+			kzalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1);
 		if (!current_thread_info()->utraps)
 			return -ENOMEM;
 		current_thread_info()->utraps[0] = 1;
@@ -658,8 +657,7 @@ SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type,
 			unsigned long *p = current_thread_info()->utraps;
 
 			current_thread_info()->utraps =
-				kmalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1,
-					     GFP_KERNEL);
+				kmalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1);
 			if (!current_thread_info()->utraps) {
 				current_thread_info()->utraps = p;
 				return -ENOMEM;
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 5434c87542e5..2cc90055499a 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -544,11 +544,9 @@ static struct vector_queue *create_queue(
 	result->max_iov_frags = num_extra_frags;
 	for (i = 0; i < max_size; i++) {
 		if (vp->header_size > 0)
-			iov = kmalloc_objs(struct iovec, 3 + num_extra_frags,
-					   GFP_KERNEL);
+			iov = kmalloc_objs(struct iovec, 3 + num_extra_frags);
 		else
-			iov = kmalloc_objs(struct iovec, 2 + num_extra_frags,
-					   GFP_KERNEL);
+			iov = kmalloc_objs(struct iovec, 2 + num_extra_frags);
 		if (iov == NULL)
 			goto out_fail;
 		mmsg_vector->msg_hdr.msg_iov = iov;
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 069e6b788280..5ed6e0b7e715 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3753,8 +3753,7 @@ static int pmu_alloc_topology(struct intel_uncore_type *type, int topology_type)
 		goto err;
 
 	for (die = 0; die < uncore_max_dies(); die++) {
-		topology[die] = kzalloc_objs(**topology, type->num_boxes,
-					     GFP_KERNEL);
+		topology[die] = kzalloc_objs(**topology, type->num_boxes);
 		if (!topology[die])
 			goto clear;
 		for (idx = 0; idx < type->num_boxes; idx++) {
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index e945ed623027..323adc93f2dc 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -467,8 +467,7 @@ void __init hyperv_init(void)
 	if (hv_isolation_type_tdx())
 		hv_vp_assist_page = NULL;
 	else
-		hv_vp_assist_page = kzalloc_objs(*hv_vp_assist_page, nr_cpu_ids,
-						 GFP_KERNEL);
+		hv_vp_assist_page = kzalloc_objs(*hv_vp_assist_page, nr_cpu_ids);
 	if (!hv_vp_assist_page) {
 		ms_hyperv.hints &= ~HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
 
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 852e8ff5ebd9..5d364540673d 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -68,8 +68,7 @@ static int amd_cache_northbridges(void)
 
 	amd_northbridges.num = amd_num_nodes();
 
-	nb = kzalloc_objs(struct amd_northbridge, amd_northbridges.num,
-			  GFP_KERNEL);
+	nb = kzalloc_objs(struct amd_northbridge, amd_northbridges.num);
 	if (!nb)
 		return -ENOMEM;
 
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index 1021a4e33ac6..38b7fd2f63be 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -798,8 +798,7 @@ static bool __init sgx_page_cache_init(void)
 	int nid;
 	int i;
 
-	sgx_numa_nodes = kmalloc_objs(*sgx_numa_nodes, num_possible_nodes(),
-				      GFP_KERNEL);
+	sgx_numa_nodes = kmalloc_objs(*sgx_numa_nodes, num_possible_nodes());
 	if (!sgx_numa_nodes)
 		return false;
 
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c196aa0c1bd1..d2486506a808 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1991,8 +1991,7 @@ int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
 	if (sanity_check_entries(entries, cpuid->nent, type))
 		return -EINVAL;
 
-	array.entries = kvzalloc_objs(struct kvm_cpuid_entry2, cpuid->nent,
-				      GFP_KERNEL);
+	array.entries = kvzalloc_objs(struct kvm_cpuid_entry2, cpuid->nent);
 	if (!array.entries)
 		return -ENOMEM;
 
diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
index 8517d5fbf79c..d22cabe119b1 100644
--- a/arch/x86/kvm/vmx/tdx.c
+++ b/arch/x86/kvm/vmx/tdx.c
@@ -2218,8 +2218,7 @@ static int tdx_get_capabilities(struct kvm_tdx_cmd *cmd)
 	if (nr_user_entries < td_conf->num_cpuid_config)
 		return -E2BIG;
 
-	caps = kzalloc_flex(*caps, cpuid.entries, td_conf->num_cpuid_config,
-			    GFP_KERNEL);
+	caps = kzalloc_flex(*caps, cpuid.entries, td_conf->num_cpuid_config);
 	if (!caps)
 		return -ENOMEM;
 
diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c
index 9a05abe8d43f..24b8b1c40e25 100644
--- a/block/blk-crypto-fallback.c
+++ b/block/blk-crypto-fallback.c
@@ -546,8 +546,7 @@ static int blk_crypto_fallback_init(void)
 		goto out;
 
 	/* Dynamic allocation is needed because of lockdep_register_key(). */
-	blk_crypto_fallback_profile = kzalloc_obj(*blk_crypto_fallback_profile,
-						  GFP_KERNEL);
+	blk_crypto_fallback_profile = kzalloc_obj(*blk_crypto_fallback_profile);
 	if (!blk_crypto_fallback_profile) {
 		err = -ENOMEM;
 		goto fail_free_bioset;
diff --git a/block/blk-crypto-profile.c b/block/blk-crypto-profile.c
index 970880d9adf4..4ac74443687a 100644
--- a/block/blk-crypto-profile.c
+++ b/block/blk-crypto-profile.c
@@ -120,8 +120,7 @@ int blk_crypto_profile_init(struct blk_crypto_profile *profile,
 
 	profile->log_slot_ht_size = ilog2(slot_hashtable_size);
 	profile->slot_hashtable =
-		kvmalloc_objs(profile->slot_hashtable[0], slot_hashtable_size,
-			      GFP_KERNEL);
+		kvmalloc_objs(profile->slot_hashtable[0], slot_hashtable_size);
 	if (!profile->slot_hashtable)
 		goto err_destroy;
 	for (i = 0; i < slot_hashtable_size; i++)
diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
index a561674bac97..8c290ddd3251 100644
--- a/drivers/accel/amdxdna/amdxdna_gem.c
+++ b/drivers/accel/amdxdna/amdxdna_gem.c
@@ -210,8 +210,7 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
 		return -ENOMEM;
 
 	nr_pages = (PAGE_ALIGN(addr + len) - (addr & PAGE_MASK)) >> PAGE_SHIFT;
-	mapp->range.hmm_pfns = kvzalloc_objs(*mapp->range.hmm_pfns, nr_pages,
-					     GFP_KERNEL);
+	mapp->range.hmm_pfns = kvzalloc_objs(*mapp->range.hmm_pfns, nr_pages);
 	if (!mapp->range.hmm_pfns) {
 		ret = -ENOMEM;
 		goto free_map;
diff --git a/drivers/accel/ethosu/ethosu_drv.c b/drivers/accel/ethosu/ethosu_drv.c
index ae5e6b15e7de..9992193d7338 100644
--- a/drivers/accel/ethosu/ethosu_drv.c
+++ b/drivers/accel/ethosu/ethosu_drv.c
@@ -144,8 +144,7 @@ static int ethosu_open(struct drm_device *ddev, struct drm_file *file)
 	if (!try_module_get(THIS_MODULE))
 		return -EINVAL;
 
-	struct ethosu_file_priv __free(kfree) *priv = kzalloc_obj(*priv,
-								  GFP_KERNEL);
+	struct ethosu_file_priv __free(kfree) *priv = kzalloc_obj(*priv);
 	if (!priv) {
 		ret = -ENOMEM;
 		goto err_put_mod;
diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c
index cbd74e3adb9f..4fbd4bbf2909 100644
--- a/drivers/accel/ethosu/ethosu_gem.c
+++ b/drivers/accel/ethosu/ethosu_gem.c
@@ -352,8 +352,7 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev,
 						  struct ethosu_gem_object *bo,
 						  u32 size)
 {
-	struct ethosu_validated_cmdstream_info __free(kfree) *info = kzalloc_obj(*info,
-										 GFP_KERNEL);
+	struct ethosu_validated_cmdstream_info __free(kfree) *info = kzalloc_obj(*info);
 	struct ethosu_device *edev = to_ethosu_device(ddev);
 	u32 *bocmds = bo->base.vaddr;
 	struct cmd_state st;
diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c
index 6c896eb816de..ba4257bda77b 100644
--- a/drivers/accel/habanalabs/common/command_submission.c
+++ b/drivers/accel/habanalabs/common/command_submission.c
@@ -1422,8 +1422,7 @@ static int hl_cs_copy_chunk_array(struct hl_device *hdev,
 
 	*cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks, GFP_ATOMIC);
 	if (!*cs_chunk_array)
-		*cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks,
-					       GFP_KERNEL);
+		*cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks);
 	if (!*cs_chunk_array) {
 		atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
 		atomic64_inc(&hdev->aggregated_cs_counters.out_of_mem_drop_cnt);
diff --git a/drivers/accel/habanalabs/common/debugfs.c b/drivers/accel/habanalabs/common/debugfs.c
index 05b1cc7918c5..1d5e29fc6463 100644
--- a/drivers/accel/habanalabs/common/debugfs.c
+++ b/drivers/accel/habanalabs/common/debugfs.c
@@ -2052,8 +2052,7 @@ int hl_debugfs_device_init(struct hl_device *hdev)
 	int count = ARRAY_SIZE(hl_debugfs_list);
 
 	dev_entry->hdev = hdev;
-	dev_entry->entry_arr = kmalloc_objs(struct hl_debugfs_entry, count,
-					    GFP_KERNEL);
+	dev_entry->entry_arr = kmalloc_objs(struct hl_debugfs_entry, count);
 	if (!dev_entry->entry_arr)
 		return -ENOMEM;
 
diff --git a/drivers/accel/habanalabs/common/hw_queue.c b/drivers/accel/habanalabs/common/hw_queue.c
index d499063a79ec..f0ab99dd74d6 100644
--- a/drivers/accel/habanalabs/common/hw_queue.c
+++ b/drivers/accel/habanalabs/common/hw_queue.c
@@ -837,8 +837,7 @@ static int ext_and_cpu_queue_init(struct hl_device *hdev, struct hl_hw_queue *q,
 
 	q->kernel_address = p;
 
-	q->shadow_queue = kmalloc_objs(struct hl_cs_job *, HL_QUEUE_LENGTH,
-				       GFP_KERNEL);
+	q->shadow_queue = kmalloc_objs(struct hl_cs_job *, HL_QUEUE_LENGTH);
 	if (!q->shadow_queue) {
 		dev_err(hdev->dev,
 			"Failed to allocate shadow queue for H/W queue %d\n",
diff --git a/drivers/accel/habanalabs/common/mmu/mmu.c b/drivers/accel/habanalabs/common/mmu/mmu.c
index 1f8f7cf2d3fb..6c7c4ff8a8a9 100644
--- a/drivers/accel/habanalabs/common/mmu/mmu.c
+++ b/drivers/accel/habanalabs/common/mmu/mmu.c
@@ -843,8 +843,7 @@ int hl_mmu_hr_init(struct hl_device *hdev, struct hl_mmu_hr_priv *hr_priv, u32 h
 		return -ENOMEM;
 	}
 
-	hr_priv->mmu_asid_hop0 = kvzalloc_objs(struct pgt_info, prop->max_asid,
-					       GFP_KERNEL);
+	hr_priv->mmu_asid_hop0 = kvzalloc_objs(struct pgt_info, prop->max_asid);
 	if (ZERO_OR_NULL_PTR(hr_priv->mmu_asid_hop0)) {
 		dev_err(hdev->dev, "Failed to allocate hr-mmu hop0 table\n");
 		rc = -ENOMEM;
diff --git a/drivers/accel/habanalabs/common/security.c b/drivers/accel/habanalabs/common/security.c
index 8a0da0194cab..abe5ed0d405a 100644
--- a/drivers/accel/habanalabs/common/security.c
+++ b/drivers/accel/habanalabs/common/security.c
@@ -312,8 +312,7 @@ int hl_init_pb_with_mask(struct hl_device *hdev, u32 num_dcores,
 	int i, j;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
@@ -392,8 +391,7 @@ int hl_init_pb_ranges_with_mask(struct hl_device *hdev, u32 num_dcores,
 	int i, j, rc = 0;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
@@ -474,8 +472,7 @@ int hl_init_pb_single_dcore(struct hl_device *hdev, u32 dcore_offset,
 	int i, rc = 0;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
@@ -521,8 +518,7 @@ int hl_init_pb_ranges_single_dcore(struct hl_device *hdev, u32 dcore_offset,
 	int i;
 	struct hl_block_glbl_sec *glbl_sec;
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2_security.c b/drivers/accel/habanalabs/gaudi2/gaudi2_security.c
index f4f8f9122f5c..ea3a0e57c836 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2_security.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2_security.c
@@ -2620,8 +2620,7 @@ static int gaudi2_init_pb_tpc(struct hl_device *hdev)
 
 	block_array_size = ARRAY_SIZE(gaudi2_pb_dcr0_tpc0);
 
-	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, block_array_size,
-				GFP_KERNEL);
+	glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, block_array_size);
 	if (!glbl_sec)
 		return -ENOMEM;
 
diff --git a/drivers/accel/qaic/qaic_ssr.c b/drivers/accel/qaic/qaic_ssr.c
index e3daeaad057d..a5bb6078824b 100644
--- a/drivers/accel/qaic/qaic_ssr.c
+++ b/drivers/accel/qaic/qaic_ssr.c
@@ -457,8 +457,7 @@ static struct ssr_dump_info *alloc_dump_info(struct qaic_device *qdev,
 	}
 
 	/* Buffer used to send MEMORY READ request to device via MHI */
-	dump_info->read_buf_req = kzalloc_obj(*dump_info->read_buf_req,
-					      GFP_KERNEL);
+	dump_info->read_buf_req = kzalloc_obj(*dump_info->read_buf_req);
 	if (!dump_info->read_buf_req) {
 		ret = -ENOMEM;
 		goto free_dump_info;
diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c
index 751697899a98..a9248af078f6 100644
--- a/drivers/acpi/apei/einj-core.c
+++ b/drivers/acpi/apei/einj-core.c
@@ -1021,8 +1021,7 @@ static bool setup_einjv2_component_files(void)
 {
 	char name[32];
 
-	syndrome_data = kzalloc_objs(syndrome_data[0], max_nr_components,
-				     GFP_KERNEL);
+	syndrome_data = kzalloc_objs(syndrome_data[0], max_nr_components);
 	if (!syndrome_data)
 		return false;
 
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 5c2116171789..f0e513e9ed5d 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -636,8 +636,7 @@ static int pcc_data_alloc(int pcc_ss_id)
 	if (pcc_data[pcc_ss_id]) {
 		pcc_data[pcc_ss_id]->refcount++;
 	} else {
-		pcc_data[pcc_ss_id] = kzalloc_obj(struct cppc_pcc_data,
-						  GFP_KERNEL);
+		pcc_data[pcc_ss_id] = kzalloc_obj(struct cppc_pcc_data);
 		if (!pcc_data[pcc_ss_id])
 			return -ENOMEM;
 		pcc_data[pcc_ss_id]->refcount++;
diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c
index 328093ed7136..ea4bffe3c02d 100644
--- a/drivers/acpi/mipi-disco-img.c
+++ b/drivers/acpi/mipi-disco-img.c
@@ -91,8 +91,7 @@ static acpi_status parse_csi2_resource(struct acpi_resource *res, void *context)
 		return AE_OK;
 	}
 
-	conn = kmalloc_flex(*conn, remote_name, csi2_res_src_length + 1,
-			    GFP_KERNEL);
+	conn = kmalloc_flex(*conn, remote_name, csi2_res_src_length + 1);
 	if (!conn)
 		return AE_OK;
 
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index bd4d332520bb..79d2e92e5c28 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -560,8 +560,7 @@ struct device *platform_profile_register(struct device *dev, const char *name,
 	    !ops->profile_set || !ops->probe))
 		return ERR_PTR(-EINVAL);
 
-	struct platform_profile_handler *pprof __free(kfree) = kzalloc_obj(*pprof,
-									   GFP_KERNEL);
+	struct platform_profile_handler *pprof __free(kfree) = kzalloc_obj(*pprof);
 	if (!pprof)
 		return ERR_PTR(-ENOMEM);
 
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index f1c7c2ad5094..fdf55c285c9a 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -341,8 +341,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
 
 	pr->performance->state_count = pss->package.count;
 	pr->performance->states =
-	    kmalloc_objs(struct acpi_processor_px, pss->package.count,
-			 GFP_KERNEL);
+	    kmalloc_objs(struct acpi_processor_px, pss->package.count);
 	if (!pr->performance->states) {
 		result = -ENOMEM;
 		goto end;
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 2d398ae5c662..c0f92b93747d 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -512,8 +512,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
 
 	pr->throttling.state_count = tss->package.count;
 	pr->throttling.states_tss =
-	    kmalloc_objs(struct acpi_processor_tx_tss, tss->package.count,
-			 GFP_KERNEL);
+	    kmalloc_objs(struct acpi_processor_tx_tss, tss->package.count);
 	if (!pr->throttling.states_tss) {
 		result = -ENOMEM;
 		goto end;
diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c
index c1f759fb5758..afffde4cfe7a 100644
--- a/drivers/acpi/riscv/irq.c
+++ b/drivers/acpi/riscv/irq.c
@@ -384,8 +384,7 @@ static u32 riscv_acpi_add_irq_dep(acpi_handle handle)
 	     riscv_acpi_irq_get_dep(handle, i, &gsi_handle);
 	     i++) {
 		dep_devices.count = 1;
-		dep_devices.handles = kzalloc_objs(*dep_devices.handles, 1,
-						   GFP_KERNEL);
+		dep_devices.handles = kzalloc_objs(*dep_devices.handles, 1);
 		if (!dep_devices.handles) {
 			acpi_handle_err(handle, "failed to allocate memory\n");
 			continue;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a6f453d4785b..dfdd004fb1a9 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -757,8 +757,7 @@ int acpi_device_add(struct acpi_device *device)
 		if (result)
 			goto err_unlock;
 	} else {
-		acpi_device_bus_id = kzalloc_obj(*acpi_device_bus_id,
-						 GFP_KERNEL);
+		acpi_device_bus_id = kzalloc_obj(*acpi_device_bus_id);
 		if (!acpi_device_bus_id) {
 			result = -ENOMEM;
 			goto err_unlock;
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 12c3a0330f67..f37247e7a5cb 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -594,8 +594,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
 	 * We cannot use devm_ here, since ahci_platform_put_resources() uses
 	 * target_pwrs after devm_ have freed memory
 	 */
-	hpriv->target_pwrs = kzalloc_objs(*hpriv->target_pwrs, hpriv->nports,
-					  GFP_KERNEL);
+	hpriv->target_pwrs = kzalloc_objs(*hpriv->target_pwrs, hpriv->nports);
 	if (!hpriv->target_pwrs) {
 		rc = -ENOMEM;
 		goto err_out;
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 8108ef0c089a..bb9cb00f9585 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -786,8 +786,7 @@ static int he_init_group(struct he_dev *he_dev, int group)
 	}
 
 	/* rbpl_virt 64-bit pointers */
-	he_dev->rbpl_virt = kmalloc_objs(*he_dev->rbpl_virt, RBPL_TABLE_SIZE,
-					 GFP_KERNEL);
+	he_dev->rbpl_virt = kmalloc_objs(*he_dev->rbpl_virt, RBPL_TABLE_SIZE);
 	if (!he_dev->rbpl_virt) {
 		hprintk("unable to allocate rbpl virt table\n");
 		goto out_free_rbpl_table;
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index b90761dcd87f..0d38e93772c2 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -1978,8 +1978,7 @@ static int tx_init(struct atm_dev *dev)
 		buf_desc_ptr++;		  
 		tx_pkt_start += iadev->tx_buf_sz;  
 	}  
-	iadev->tx_buf = kmalloc_objs(*iadev->tx_buf, iadev->num_tx_desc,
-				     GFP_KERNEL);
+	iadev->tx_buf = kmalloc_objs(*iadev->tx_buf, iadev->num_tx_desc);
         if (!iadev->tx_buf) {
             printk(KERN_ERR DEV_LABEL " couldn't get mem\n");
 	    goto err_free_dle;
@@ -1999,8 +1998,7 @@ static int tx_init(struct atm_dev *dev)
 						       sizeof(*cpcs),
 						       DMA_TO_DEVICE);
         }
-	iadev->desc_tbl = kmalloc_objs(*iadev->desc_tbl, iadev->num_tx_desc,
-				       GFP_KERNEL);
+	iadev->desc_tbl = kmalloc_objs(*iadev->desc_tbl, iadev->num_tx_desc);
 	if (!iadev->desc_tbl) {
 		printk(KERN_ERR DEV_LABEL " couldn't get mem\n");
 		goto err_free_all_tx_bufs;
@@ -2128,8 +2126,7 @@ static int tx_init(struct atm_dev *dev)
 	memset((caddr_t)(iadev->seg_ram+i),  0, iadev->num_vc*4);
 	vc = (struct main_vc *)iadev->MAIN_VC_TABLE_ADDR;  
 	evc = (struct ext_vc *)iadev->EXT_VC_TABLE_ADDR;  
-	iadev->testTable = kmalloc_objs(*iadev->testTable, iadev->num_vc,
-					GFP_KERNEL);
+	iadev->testTable = kmalloc_objs(*iadev->testTable, iadev->num_vc);
         if (!iadev->testTable) {
            printk("Get freepage  failed\n");
 	   goto err_free_desc_tbl;
@@ -2138,8 +2135,7 @@ static int tx_init(struct atm_dev *dev)
 	{  
 		memset((caddr_t)vc, 0, sizeof(*vc));  
 		memset((caddr_t)evc, 0, sizeof(*evc));  
-                iadev->testTable[i] = kmalloc_obj(struct testTable_t,
-						  GFP_KERNEL);
+                iadev->testTable[i] = kmalloc_obj(struct testTable_t);
 		if (!iadev->testTable[i])
 			goto err_free_test_tables;
               	iadev->testTable[i]->lastTime = 0;
diff --git a/drivers/base/physical_location.c b/drivers/base/physical_location.c
index 06a2797e0213..2e723fff6e8a 100644
--- a/drivers/base/physical_location.c
+++ b/drivers/base/physical_location.c
@@ -21,8 +21,7 @@ bool dev_add_physical_location(struct device *dev)
 	if (!acpi_get_physical_device_location(ACPI_HANDLE(dev), &pld))
 		return false;
 
-	dev->physical_location = kzalloc_obj(*dev->physical_location,
-					     GFP_KERNEL);
+	dev->physical_location = kzalloc_obj(*dev->physical_location);
 	if (!dev->physical_location) {
 		ACPI_FREE(pld);
 		return false;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index c2dd784bc14b..3cfef456a1f3 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3932,8 +3932,7 @@ static int receive_sizes(struct drbd_connection *connection, struct packet_info
 		if (my_usize != p_usize) {
 			struct disk_conf *old_disk_conf, *new_disk_conf = NULL;
 
-			new_disk_conf = kzalloc_obj(struct disk_conf,
-						    GFP_KERNEL);
+			new_disk_conf = kzalloc_obj(struct disk_conf);
 			if (!new_disk_conf) {
 				put_ldev(device);
 				return -ENOMEM;
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 7844424f7b17..41cc8cefea01 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -401,8 +401,7 @@ static int ps3vram_cache_init(struct ps3_system_bus_device *dev)
 
 	priv->cache.page_count = CACHE_PAGE_COUNT;
 	priv->cache.page_size = CACHE_PAGE_SIZE;
-	priv->cache.tags = kzalloc_objs(struct ps3vram_tag, CACHE_PAGE_COUNT,
-					GFP_KERNEL);
+	priv->cache.tags = kzalloc_objs(struct ps3vram_tag, CACHE_PAGE_COUNT);
 	if (!priv->cache.tags)
 		return -ENOMEM;
 
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index bc665b8abd7b..7871099bc0d4 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -846,8 +846,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring,
 			 * We are using persistent grants, the grant is
 			 * not mapped but we might have room for it.
 			 */
-			persistent_gnt = kmalloc_obj(struct persistent_gnt,
-						     GFP_KERNEL);
+			persistent_gnt = kmalloc_obj(struct persistent_gnt);
 			if (!persistent_gnt) {
 				/*
 				 * If we don't have enough memory to
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index adfd61af86ee..4b865ef800b1 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -131,8 +131,7 @@ static int xen_blkif_alloc_rings(struct xen_blkif *blkif)
 {
 	unsigned int r;
 
-	blkif->rings = kzalloc_objs(struct xen_blkif_ring, blkif->nr_rings,
-				    GFP_KERNEL);
+	blkif->rings = kzalloc_objs(struct xen_blkif_ring, blkif->nr_rings);
 	if (!blkif->rings)
 		return -ENOMEM;
 
@@ -1014,14 +1013,12 @@ static int read_per_ring_refs(struct xen_blkif_ring *ring, const char *dir)
 			goto fail;
 		list_add_tail(&req->free_list, &ring->pending_free);
 		for (j = 0; j < MAX_INDIRECT_SEGMENTS; j++) {
-			req->segments[j] = kzalloc_obj(*req->segments[0],
-						       GFP_KERNEL);
+			req->segments[j] = kzalloc_obj(*req->segments[0]);
 			if (!req->segments[j])
 				goto fail;
 		}
 		for (j = 0; j < MAX_INDIRECT_PAGES; j++) {
-			req->indirect_pages[j] = kzalloc_obj(*req->indirect_pages[0],
-							     GFP_KERNEL);
+			req->indirect_pages[j] = kzalloc_obj(*req->indirect_pages[0]);
 			if (!req->indirect_pages[j])
 				goto fail;
 		}
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 777a5ae0cd33..8fc7fc3bf867 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2207,8 +2207,7 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo)
 
 	for (i = 0; i < BLK_RING_SIZE(info); i++) {
 		rinfo->shadow[i].grants_used =
-			kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants,
-				      GFP_KERNEL);
+			kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants);
 		rinfo->shadow[i].sg = kvzalloc_objs(rinfo->shadow[i].sg[0],
 						    psegs, GFP_KERNEL);
 		if (info->max_indirect_segments)
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index e12abdec2647..b216cba1c3bf 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -187,8 +187,7 @@ static int z2_open(struct gendisk *disk, blk_mode_t mode)
 			    (unsigned long)z_remap_nocache_nonser(paddr, size);
 #endif
 			z2ram_map =
-			    kmalloc_objs(z2ram_map[0], size / Z2RAM_CHUNKSIZE,
-					 GFP_KERNEL);
+			    kmalloc_objs(z2ram_map[0], size / Z2RAM_CHUNKSIZE);
 			if (z2ram_map == NULL) {
 				printk(KERN_ERR DEVICE_NAME
 				       ": cannot get mem for z2ram_map\n");
diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index a27261914bd1..879b8b706428 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -1459,8 +1459,7 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
 	if (ret)
 		return ret;
 
-	mhi_cntrl->mhi_cmd = kzalloc_objs(*mhi_cntrl->mhi_cmd, NR_OF_CMD_RINGS,
-					  GFP_KERNEL);
+	mhi_cntrl->mhi_cmd = kzalloc_objs(*mhi_cntrl->mhi_cmd, NR_OF_CMD_RINGS);
 	if (!mhi_cntrl->mhi_cmd) {
 		ret = -ENOMEM;
 		goto err_free_ch;
diff --git a/drivers/bus/mhi/host/boot.c b/drivers/bus/mhi/host/boot.c
index 7845fc7fe6c2..f16a1e67a667 100644
--- a/drivers/bus/mhi/host/boot.c
+++ b/drivers/bus/mhi/host/boot.c
@@ -380,8 +380,7 @@ int mhi_alloc_bhie_table(struct mhi_controller *mhi_cntrl,
 		return -ENOMEM;
 
 	/* Allocate memory for entries */
-	img_info->mhi_buf = kzalloc_objs(*img_info->mhi_buf, segments,
-					 GFP_KERNEL);
[Output truncated: showing 1000 of 15164 lines]]

401/2 2026/10/14 00:20 tool git-show
0m Args:
map[Commit:f37d63e219c39]

Results:
map[Output:commit f37d63e219c39199a59b8b8a211412ff27192830
Author: Philipp Stanner <pstanner@redhat.com>
Date:   Wed Sep 20 14:36:12 2023 +0200

    drm_lease.c: copy user-array safely
    
    Currently, there is no overflow-check with memdup_user().
    
    Use the new function memdup_array_user() instead of memdup_user() for
    duplicating the user-space array safely.
    
    Suggested-by: David Airlie <airlied@redhat.com>
    Signed-off-by: Philipp Stanner <pstanner@redhat.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Zack Rusin <zackr@vmware.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-6-pstanner@redhat.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 150fe1555068..94375c6a5425 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -510,8 +510,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
-					 array_size(object_count, sizeof(__u32)));
+		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
+					       object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
]

402/2 2026/10/14 00:20 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 30207
							output: 27
							thoughts: 83
						

Thoughts:
Okay, let's dive into this. Here's my thought process on this task:

**Analyzing Recent Commits: A Focused Review**

Alright, my immediate thought is to zero in on the relevant commits. I've got to investigate the changes associated with those IDs. Specifically, I'm going to start with the commit labeled "drm: Add lease support [v8]" – that's 62884cd386b87. Lease support in DRM is a significant feature, so it warrants a close look to understand the implementation details. I also need to understand commit 4bb2d367a5a28 and how it relates to this. I'm going to review the changes introduced in each of those commits, paying close attention to any dependencies, potential conflicts, and, of course, the overall architectural impact.



403/2 2026/10/14 00:20 tool git-show
0m Args:
map[Commit:4bb2d367a5a28]

Results:
map[Output:commit 4bb2d367a5a2807185a04949ae922d247f650576
Author: Simon Ser <contact@emersion.fr>
Date:   Fri Sep 3 13:00:32 2021 +0000

    drm/lease: allow empty leases
    
    This can be used to create a separate DRM file description, thus
    creating a new GEM handle namespace.
    
    My use-case is wlroots. The library splits responsibilities between
    separate components: the GBM allocator creates buffers, the GLES2
    renderer uses EGL to import them and render to them, the DRM
    backend imports the buffers and displays them. wlroots has a
    modular architecture, and any of these components can be swapped
    and replaced with something else. For instance, the pipeline can
    be set up so that the DRM dumb buffer allocator is used instead of
    GBM and the Pixman renderer is used instead of GLES2. Library users
    can also replace any of these components with their own custom one.
    
    DMA-BUFs are used to pass buffer references across components. We
    could use GEM handles instead, but this would result in pain if
    multiple GPUs are in use: wlroots copies buffers across GPUs as
    needed. Importing a GEM handle created on one GPU into a completely
    different GPU will blow up (fail at best, mix unrelated buffers
    otherwise).
    
    Everything is fine if all components use Mesa. However, this isn't
    always desirable. For instance when running with DRM dumb buffers
    and the Pixman software renderer it's unfortunate to depend on GBM
    in the DRM backend just to turn DMA-BUFs into FB IDs. GBM loads
    Mesa drivers to perform an action which has nothing driver-specific.
    Additionally, drivers will fail the import if the 3D engine can't
    use the imported buffer, for instance amdgpu will refuse to import
    DRM dumb buffers [1]. We might also want to be running with a Vulkan
    renderer and a Vulkan allocator in the future, and GBM wouldn't be
    welcome in this setup.
    
    To address this, GBM can be side-stepped in the DRM backend, and
    can be replaced with drmPrimeFDToHandle calls. However because of
    GEM handle reference counting issues, care must be taken to avoid
    double-closing the same GEM handle. In particular, it's not
    possible to share a DRM FD with GBM or EGL and perform some
    drmPrimeFDToHandle calls manually.
    
    So wlroots needs to re-open the DRM FD to create a new GEM handle
    namespace. However there's no guarantee that the file-system
    permissions will be set up so that the primary FD can be opened
    by the compsoitor. On modern systems seatd or logind is a privileged
    process responsible for doing this, and other processes aren't
    expected to do it. For historical reasons systemd still allows
    physically logged in users to open primary DRM nodes, but this
    doesn't work on non-systemd setups and it's desirable to lock
    them down at some point.
    
    Some might suggest to open the render node instead of re-opening
    the primary node. However some systems don't have a render node
    at all (e.g. no GPU, or a split render/display SoC).
    
    Solutions to this issue have been discussed in [2]. One solution
    would be to open the magic /proc/self/fd/<fd> file, but it's a
    Linux-specific hack (wlroots supports BSDs too). Another solution
    is to add support for re-opening a DRM primary node to seatd/logind,
    but they don't support it now and really haven't been designed for
    this (logind would need to grow a completely new API, because it
    assumes unique dev_t IDs). Also this seems like pushing down a
    kernel limitation to user-space a bit too hard.
    
    Another solution is to allow creating empty DRM leases. The lessee
    FD would have its own GEM handle namespace, so wouldn't conflict
    wth GBM/EGL. It would have the master bit set, but would be able
    to manage zero resources. wlroots doesn't intend to share this FD
    with any other process.
    
    All in all IMHO that seems like a pretty reasonable solution to the
    issue at hand.
    
    Note, I've discussed with Jonas Γ…dahl and Mutter plans to adopt a
    similar design in the future.
    
    Example usage in wlroots is available at [3]. IGT test available
    at [4].
    
    [1]: https://github.com/swaywm/wlroots/issues/2916
    [2]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
    [3]: https://github.com/swaywm/wlroots/pull/3158
    [4]: https://patchwork.freedesktop.org/series/94323/
    
    Signed-off-by: Simon Ser <contact@emersion.fr>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Daniel Stone <daniels@collabora.com>
    Cc: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
    Cc: Michel DΓ€nzer <michel@daenzer.net>
    Cc: Emil Velikov <emil.l.velikov@gmail.com>
    Cc: Keith Packard <keithp@keithp.com>
    Cc: Boris Brezillon <boris.brezillon@collabora.com>
    Cc: Dave Airlie <airlied@redhat.com>
    Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
    Reviewed-by: Daniel Stone <daniels@collabora.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210903130000.1590-2-contact@emersion.fr

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index dee4f24a1808..d72c2fac0ff1 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -489,12 +489,6 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		return -EOPNOTSUPP;
 
-	/* need some objects */
-	if (cl->object_count == 0) {
-		DRM_DEBUG_LEASE("no objects in lease\n");
-		return -EINVAL;
-	}
-
 	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 		DRM_DEBUG_LEASE("invalid flags\n");
 		return -EINVAL;
@@ -510,23 +504,26 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 
 	object_count = cl->object_count;
 
-	object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
-			array_size(object_count, sizeof(__u32)));
-	if (IS_ERR(object_ids)) {
-		ret = PTR_ERR(object_ids);
-		goto out_lessor;
-	}
-
+	/* Handle leased objects, if any */
 	idr_init(&leases);
+	if (object_count != 0) {
+		object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
+					 array_size(object_count, sizeof(__u32)));
+		if (IS_ERR(object_ids)) {
+			ret = PTR_ERR(object_ids);
+			idr_destroy(&leases);
+			goto out_lessor;
+		}
 
-	/* fill and validate the object idr */
-	ret = fill_object_idr(dev, lessor_priv, &leases,
-			      object_count, object_ids);
-	kfree(object_ids);
-	if (ret) {
-		DRM_DEBUG_LEASE("lease object lookup failed: %i\n", ret);
-		idr_destroy(&leases);
-		goto out_lessor;
+		/* fill and validate the object idr */
+		ret = fill_object_idr(dev, lessor_priv, &leases,
+				      object_count, object_ids);
+		kfree(object_ids);
+		if (ret) {
+			DRM_DEBUG_LEASE("lease object lookup failed: %i\n", ret);
+			idr_destroy(&leases);
+			goto out_lessor;
+		}
 	}
 
 	/* Allocate a file descriptor for the lease */
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index e4a2570a6058..e1e351682872 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -1112,7 +1112,8 @@ struct drm_mode_destroy_blob {
  * Lease mode resources, creating another drm_master.
  *
  * The @object_ids array must reference at least one CRTC, one connector and
- * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled.
+ * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively,
+ * the lease can be completely empty.
  */
 struct drm_mode_create_lease {
 	/** @object_ids: Pointer to array of object ids (__u32) */
]

404/2 2026/10/14 00:20 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 32965
							output: 31
							thoughts: 19
						

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

**Analyzing Commit 62884cd386b87**

Alright, time to dive in. My immediate thought is to examine commit `62884cd386b87`. The naming convention looks familiar, I probably have a good idea of which repository this is from. I'm going to start by quickly pulling up the diff. I'll need to assess the scope of this change – single file modification, or a broader refactor? Are there dependencies I need to consider? Does the commit message provide enough context, or will I need to reconstruct the purpose from the code itself? Are there related issues or pull requests linked to the commit, which might provide useful context?

I'll be looking for potential regressions, performance impacts, and adherence to established coding standards. Are there any obvious code smells? Does it introduce any security vulnerabilities, or, critically, expose any vulnerabilities that were previously hidden? I'll probably run some of the tests while I'm at it, or, ideally, they were executed as part of the pipeline. I'm going to pay close attention to the nature of the changes. Are they adding new functionality, fixing a bug, optimizing existing code, or simply performing a refactor? And importantly, does this code fit within the established architecture of the project? What assumptions were made when this code was written? Are those assumptions still valid? I'll be particularly focused on any edge cases or unexpected behaviors.



405/2 2026/10/14 00:20 tool git-show
0m Args:
map[Commit:62884cd386b87 Stat:true]

Results:
map[Output:commit 62884cd386b876638720ef88374b31a84ca7ee5f
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Mar 16 17:56:28 2017 -0700

    drm: Add four ioctls for managing drm mode object leases [v7]
    
    drm_mode_create_lease
    
            Creates a lease for a list of drm mode objects, returning an
            fd for the new drm_master and a 64-bit identifier for the lessee
    
    drm_mode_list_lesees
    
            List the identifiers of the lessees for a master file
    
    drm_mode_get_lease
    
            List the leased objects for a master file
    
    drm_mode_revoke_lease
    
            Erase the set of objects managed by a lease.
    
    This should suffice to at least create and query leases.
    
    Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
    
     * query ioctls only query the master associated with
       the provided file.
    
     * 'mask_lease' value has been removed
    
     * change ioctl has been removed.
    
    Changes for v3 suggested in part by Dave Airlie <airlied@gmail.com>
    
     * Add revoke ioctl.
    
    Changes for v4 suggested by Dave Airlie <airlied@gmail.com>
    
     * Expand on the comment about the magic use of &drm_lease_idr_object
     * Pad lease ioctl structures to align on 64-bit boundaries
    
    Changes for v5 suggested by Dave Airlie <airlied@gmail.com>
    
     * Check for non-negative object_id in create_lease to avoid debug
       output from the kernel.
    
    Changes for v6 provided by Dave Airlie <airlied@gmail.com>
    
     * For non-universal planes add primary/cursor planes to lease
    
       If we aren't exposing universal planes to this userspace client,
       and it requests a lease on a crtc, we should implicitly export the
       primary and cursor planes for the crtc.
    
       If the lessee doesn't request universal planes, it will just see
       the crtc, but if it does request them it will then see the plane
       objects as well.
    
       This also moves the object look ups earlier as a side effect, so
       we'd exit the ioctl quicker for non-existant objects.
    
     * Restrict leases to crtc/connector/planes.
    
       This only allows leasing for objects we wish to allow.
    
    Changes for v7 provided by Dave Airlie <airlied@gmail.com>
    
     * Check pad args are 0
     * Check create flags and object count are valid.
     * Check return from fd allocation
     * Refactor lease idr setup and add some simple validation
     * Use idr_mutex uniformly (Keith)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

 drivers/gpu/drm/drm_ioctl.c       |   4 +
 drivers/gpu/drm/drm_lease.c       | 412 ++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_mode_object.c |   5 +-
 include/drm/drm_lease.h           |  12 ++
 include/drm/drm_mode_object.h     |   2 +
 include/uapi/drm/drm.h            |   5 +
 include/uapi/drm/drm_mode.h       |  66 ++++++
 7 files changed, 504 insertions(+), 2 deletions(-)
]

406/2 2026/10/14 00:20 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 34271
							output: 43
							thoughts: 49
						

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

**Diving into `drm_lease.c` – Specifically `fill_object_idr` and `drm_mode_create_lease_ioctl`**

Alright, let's dissect what's happening around `62884cd386b87` in `drm_lease.c`. I need to refresh my memory on the interactions of `fill_object_idr` and `drm_mode_create_lease_ioctl`, and how this commit might have touched them. We're obviously looking at lease management within the DRM framework. Specifically, I need to understand how the object IDR is being populated and managed in the context of creating a lease. Is the commit focusing on changes to lease object registration, ID assignment, or maybe error handling during the lease creation process? My initial thought is to check if it's related to some kind of object protection, perhaps with how object handles are distributed between clients. I'll need to confirm if this change impacted existing object IDs, as it could have a ripple effect. This commit's diff should tell me the focus.



407/2 2026/10/14 00:20 tool git-show
0m Args:
map[Commit:62884cd386b87 File:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:commit 62884cd386b876638720ef88374b31a84ca7ee5f
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Mar 16 17:56:28 2017 -0700

    drm: Add four ioctls for managing drm mode object leases [v7]
    
    drm_mode_create_lease
    
            Creates a lease for a list of drm mode objects, returning an
            fd for the new drm_master and a 64-bit identifier for the lessee
    
    drm_mode_list_lesees
    
            List the identifiers of the lessees for a master file
    
    drm_mode_get_lease
    
            List the leased objects for a master file
    
    drm_mode_revoke_lease
    
            Erase the set of objects managed by a lease.
    
    This should suffice to at least create and query leases.
    
    Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
    
     * query ioctls only query the master associated with
       the provided file.
    
     * 'mask_lease' value has been removed
    
     * change ioctl has been removed.
    
    Changes for v3 suggested in part by Dave Airlie <airlied@gmail.com>
    
     * Add revoke ioctl.
    
    Changes for v4 suggested by Dave Airlie <airlied@gmail.com>
    
     * Expand on the comment about the magic use of &drm_lease_idr_object
     * Pad lease ioctl structures to align on 64-bit boundaries
    
    Changes for v5 suggested by Dave Airlie <airlied@gmail.com>
    
     * Check for non-negative object_id in create_lease to avoid debug
       output from the kernel.
    
    Changes for v6 provided by Dave Airlie <airlied@gmail.com>
    
     * For non-universal planes add primary/cursor planes to lease
    
       If we aren't exposing universal planes to this userspace client,
       and it requests a lease on a crtc, we should implicitly export the
       primary and cursor planes for the crtc.
    
       If the lessee doesn't request universal planes, it will just see
       the crtc, but if it does request them it will then see the plane
       objects as well.
    
       This also moves the object look ups earlier as a side effect, so
       we'd exit the ioctl quicker for non-existant objects.
    
     * Restrict leases to crtc/connector/planes.
    
       This only allows leasing for objects we wish to allow.
    
    Changes for v7 provided by Dave Airlie <airlied@gmail.com>
    
     * Check pad args are 0
     * Check create flags and object count are valid.
     * Check return from fd allocation
     * Refactor lease idr setup and add some simple validation
     * Use idr_mutex uniformly (Keith)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 030db1170570..d1eb56a1eff4 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -23,6 +23,8 @@
 #define drm_for_each_lessee(lessee, lessor) \
 	list_for_each_entry((lessee), &(lessor)->lessees, lessee_list)
 
+static uint64_t drm_lease_idr_object;
+
 /**
  * drm_lease_owner - return ancestor owner drm_master
  * @master: drm_master somewhere within tree of lessees and lessors
@@ -353,3 +355,413 @@ void drm_lease_revoke(struct drm_master *top)
 	_drm_lease_revoke(top);
 	mutex_unlock(&top->dev->mode_config.idr_mutex);
 }
+
+static int validate_lease(struct drm_device *dev,
+			  struct drm_file *lessor_priv,
+			  int object_count,
+			  struct drm_mode_object **objects)
+{
+	int o;
+	int has_crtc = -1;
+	int has_connector = -1;
+	int has_plane = -1;
+
+	/* we want to confirm that there is at least one crtc, plane
+	   connector object. */
+
+	for (o = 0; o < object_count; o++) {
+		if (objects[o]->type == DRM_MODE_OBJECT_CRTC && has_crtc == -1) {
+			has_crtc = o;
+		}
+		if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
+			has_connector = o;
+
+		if (lessor_priv->universal_planes) {
+			if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
+				has_plane = o;
+		}
+	}
+	if (has_crtc == -1 || has_connector == -1)
+		return -EINVAL;
+	if (lessor_priv->universal_planes && has_plane == -1)
+		return -EINVAL;
+	return 0;
+}
+
+static int fill_object_idr(struct drm_device *dev,
+			   struct drm_file *lessor_priv,
+			   struct idr *leases,
+			   int object_count,
+			   u32 *object_ids)
+{
+	struct drm_mode_object **objects;
+	u32 o;
+	int ret;
+	objects = kcalloc(object_count, sizeof(struct drm_mode_object *),
+			  GFP_KERNEL);
+	if (!objects)
+		return -ENOMEM;
+
+	/* step one - get references to all the mode objects
+	   and check for validity. */
+	for (o = 0; o < object_count; o++) {
+		if ((int) object_ids[o] < 0) {
+			ret = -EINVAL;
+			goto out_free_objects;
+		}
+
+		objects[o] = drm_mode_object_find(dev, lessor_priv,
+						  object_ids[o],
+						  DRM_MODE_OBJECT_ANY);
+		if (!objects[o]) {
+			ret = -ENOENT;
+			goto out_free_objects;
+		}
+
+		if (!drm_mode_object_lease_required(objects[o]->type)) {
+			ret = -EINVAL;
+			goto out_free_objects;
+		}
+	}
+
+	ret = validate_lease(dev, lessor_priv, object_count, objects);
+	if (ret)
+		goto out_free_objects;
+
+	/* add their IDs to the lease request - taking into account
+	   universal planes */
+	for (o = 0; o < object_count; o++) {
+		struct drm_mode_object *obj = objects[o];
+		u32 object_id = objects[o]->id;
+		DRM_DEBUG_LEASE("Adding object %d to lease\n", object_id);
+
+		/*
+		 * We're using an IDR to hold the set of leased
+		 * objects, but we don't need to point at the object's
+		 * data structure from the lease as the main crtc_idr
+		 * will be used to actually find that. Instead, all we
+		 * really want is a 'leased/not-leased' result, for
+		 * which any non-NULL pointer will work fine.
+		 */
+		ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
+		if (ret < 0) {
+			DRM_DEBUG_LEASE("Object %d cannot be inserted into leases (%d)\n",
+					object_id, ret);
+			goto out_free_objects;
+		}
+		if (obj->type == DRM_MODE_OBJECT_CRTC && !lessor_priv->universal_planes) {
+			struct drm_crtc *crtc = obj_to_crtc(obj);
+			ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
+			if (ret < 0) {
+				DRM_DEBUG_LEASE("Object primary plane %d cannot be inserted into leases (%d)\n",
+						object_id, ret);
+				goto out_free_objects;
+			}
+			if (crtc->cursor) {
+				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
+				if (ret < 0) {
+					DRM_DEBUG_LEASE("Object cursor plane %d cannot be inserted into leases (%d)\n",
+							object_id, ret);
+					goto out_free_objects;
+				}
+			}
+		}
+	}
+
+	ret = 0;
+out_free_objects:
+	for (o = 0; o < object_count; o++) {
+		if (objects[o])
+			drm_mode_object_put(objects[o]);
+	}
+	kfree(objects);
+	return ret;
+}
+
+/**
+ * drm_mode_create_lease_ioctl - create a new lease
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_create_lease
+ * @file_priv: the file being manipulated
+ *
+ * The master associated with the specified file will have a lease
+ * created containing the objects specified in the ioctl structure.
+ * A file descriptor will be allocated for that and returned to the
+ * application.
+ */
+int drm_mode_create_lease_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *lessor_priv)
+{
+	struct drm_mode_create_lease *cl = data;
+	size_t object_count;
+	int ret = 0;
+	struct idr leases;
+	struct drm_master *lessor = lessor_priv->master;
+	struct drm_master *lessee = NULL;
+	struct file *lessee_file = NULL;
+	struct file *lessor_file = lessor_priv->filp;
+	struct drm_file *lessee_priv;
+	int fd = -1;
+	uint32_t *object_ids;
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	/* Do not allow sub-leases */
+	if (lessor->lessor)
+		return -EINVAL;
+
+	/* need some objects */
+	if (cl->object_count == 0)
+		return -EINVAL;
+
+	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK)))
+		return -EINVAL;
+
+	object_count = cl->object_count;
+
+	object_ids = memdup_user(u64_to_user_ptr(cl->object_ids), object_count * sizeof(__u32));
+	if (IS_ERR(object_ids))
+		return PTR_ERR(object_ids);
+
+	idr_init(&leases);
+
+	/* fill and validate the object idr */
+	ret = fill_object_idr(dev, lessor_priv, &leases,
+			      object_count, object_ids);
+	kfree(object_ids);
+	if (ret) {
+		idr_destroy(&leases);
+		return ret;
+	}
+
+	/* Allocate a file descriptor for the lease */
+	fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
+	if (fd < 0) {
+		idr_destroy(&leases);
+		return fd;
+	}
+
+	DRM_DEBUG_LEASE("Creating lease\n");
+	lessee = drm_lease_create(lessor, &leases);
+
+	if (IS_ERR(lessee)) {
+		ret = PTR_ERR(lessee);
+		goto out_leases;
+	}
+
+	/* Clone the lessor file to create a new file for us */
+	DRM_DEBUG_LEASE("Allocating lease file\n");
+	path_get(&lessor_file->f_path);
+	lessee_file = alloc_file(&lessor_file->f_path,
+				 lessor_file->f_mode,
+				 fops_get(lessor_file->f_inode->i_fop));
+
+	if (IS_ERR(lessee_file)) {
+		ret = PTR_ERR(lessee_file);
+		goto out_lessee;
+	}
+
+	/* Initialize the new file for DRM */
+	DRM_DEBUG_LEASE("Initializing the file with %p\n", lessee_file->f_op->open);
+	ret = lessee_file->f_op->open(lessee_file->f_inode, lessee_file);
+	if (ret)
+		goto out_lessee_file;
+
+	lessee_priv = lessee_file->private_data;
+
+	/* Change the file to a master one */
+	drm_master_put(&lessee_priv->master);
+	lessee_priv->master = lessee;
+	lessee_priv->is_master = 1;
+	lessee_priv->authenticated = 1;
+
+	/* Hook up the fd */
+	fd_install(fd, lessee_file);
+
+	/* Pass fd back to userspace */
+	DRM_DEBUG_LEASE("Returning fd %d id %d\n", fd, lessee->lessee_id);
+	cl->fd = fd;
+	cl->lessee_id = lessee->lessee_id;
+
+	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n");
+	return 0;
+
+out_lessee_file:
+	fput(lessee_file);
+
+out_lessee:
+	drm_master_put(&lessee);
+
+out_leases:
+	put_unused_fd(fd);
+	idr_destroy(&leases);
+
+	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl failed: %d\n", ret);
+	return ret;
+}
+
+/**
+ * drm_mode_list_lessees_ioctl - list lessee ids
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_list_lessees
+ * @lessor_priv: the file being manipulated
+ *
+ * Starting from the master associated with the specified file,
+ * the master with the provided lessee_id is found, and then
+ * an array of lessee ids associated with leases from that master
+ * are returned.
+ */
+
+int drm_mode_list_lessees_ioctl(struct drm_device *dev,
+			       void *data, struct drm_file *lessor_priv)
+{
+	struct drm_mode_list_lessees *arg = data;
+	__u32 __user *lessee_ids = (__u32 __user *) (uintptr_t) (arg->lessees_ptr);
+	__u32 count_lessees = arg->count_lessees;
+	struct drm_master *lessor = lessor_priv->master, *lessee;
+	int count;
+	int ret = 0;
+
+	if (arg->pad)
+		return -EINVAL;
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	DRM_DEBUG_LEASE("List lessees for %d\n", lessor->lessee_id);
+
+	mutex_lock(&dev->mode_config.idr_mutex);
+
+	count = 0;
+	drm_for_each_lessee(lessee, lessor) {
+		/* Only list un-revoked leases */
+		if (!idr_is_empty(&lessee->leases)) {
+			if (count_lessees > count) {
+				DRM_DEBUG_LEASE("Add lessee %d\n", lessee->lessee_id);
+				ret = put_user(lessee->lessee_id, lessee_ids + count);
+				if (ret)
+					break;
+			}
+			count++;
+		}
+	}
+
+	DRM_DEBUG_LEASE("Lessor leases to %d\n", count);
+	if (ret == 0)
+		arg->count_lessees = count;
+
+	mutex_unlock(&dev->mode_config.idr_mutex);
+
+	return ret;
+}
+
+/**
+ * drm_mode_get_lease_ioctl - list leased objects
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_get_lease
+ * @file_priv: the file being manipulated
+ *
+ * Return the list of leased objects for the specified lessee
+ */
+
+int drm_mode_get_lease_ioctl(struct drm_device *dev,
+			     void *data, struct drm_file *lessee_priv)
+{
+	struct drm_mode_get_lease *arg = data;
+	__u32 __user *object_ids = (__u32 __user *) (uintptr_t) (arg->objects_ptr);
+	__u32 count_objects = arg->count_objects;
+	struct drm_master *lessee = lessee_priv->master;
+	struct idr *object_idr;
+	int count;
+	void *entry;
+	int object;
+	int ret = 0;
+
+	if (arg->pad)
+		return -EINVAL;
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	DRM_DEBUG_LEASE("get lease for %d\n", lessee->lessee_id);
+
+	mutex_lock(&dev->mode_config.idr_mutex);
+
+	if (lessee->lessor == NULL)
+		/* owner can use all objects */
+		object_idr = &lessee->dev->mode_config.crtc_idr;
+	else
+		/* lessee can only use allowed object */
+		object_idr = &lessee->leases;
+
+	count = 0;
+	idr_for_each_entry(object_idr, entry, object) {
+		if (count_objects > count) {
+			DRM_DEBUG_LEASE("adding object %d\n", object);
+			ret = put_user(object, object_ids + count);
+			if (ret)
+				break;
+		}
+		count++;
+	}
+
+	DRM_DEBUG("lease holds %d objects\n", count);
+	if (ret == 0)
+		arg->count_objects = count;
+
+	mutex_unlock(&dev->mode_config.idr_mutex);
+
+	return ret;
+}
+
+/**
+ * drm_mode_revoke_lease_ioctl - revoke lease
+ * @dev: the drm device
+ * @data: pointer to struct drm_mode_revoke_lease
+ * @file_priv: the file being manipulated
+ *
+ * This removes all of the objects from the lease without
+ * actually getting rid of the lease itself; that way all
+ * references to it still work correctly
+ */
+int drm_mode_revoke_lease_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *lessor_priv)
+{
+	struct drm_mode_revoke_lease *arg = data;
+	struct drm_master *lessor = lessor_priv->master;
+	struct drm_master *lessee;
+	int ret = 0;
+
+	DRM_DEBUG_LEASE("revoke lease for %d\n", arg->lessee_id);
+
+	/* Can't lease without MODESET */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EINVAL;
+
+	mutex_lock(&dev->mode_config.idr_mutex);
+
+	lessee = _drm_find_lessee(lessor, arg->lessee_id);
+
+	/* No such lessee */
+	if (!lessee) {
+		ret = -ENOENT;
+		goto fail;
+	}
+
+	/* Lease is not held by lessor */
+	if (lessee->lessor != lessor) {
+		ret = -EACCES;
+		goto fail;
+	}
+
+	_drm_lease_revoke(lessee);
+
+fail:
+	mutex_unlock(&dev->mode_config.idr_mutex);
+
+	return ret;
+}
]

408/2 2026/10/14 00:20 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 40045
							output: 44
							thoughts: 256
						

Thoughts:
**Examining the DRM Lease Implementation**

Okay, let's dive into this `drm_lease.c` code. Specifically, I'm looking at commit `62884cd386b87` – that's the one that introduced it. I'm focusing on two key areas: `fill_object_idr()` and `drm_mode_create_lease_ioctl`. I see that in `fill_object_idr()`, they used `kcalloc` to allocate an array of `drm_mode_object` pointers. Seems standard enough. But I also notice how in `drm_mode_create_lease_ioctl`, they `memdup_user` the `object_ids` from userspace, initialize an `idr` structure, and then call `fill_object_idr()` to populate it. They then `kfree` the copy.

Now, a bell is ringing in the back of my head... Did they perhaps change that `kcalloc` call in `fill_object_idr()` later? It's not uncommon to optimize memory allocation strategies, or replace something that was found to be insecure. I should really check the git log of `fill_object_idr()` to confirm. Let's see if there were any later modifications to that allocation.



409/2 2026/10/14 00:20 tool git-log
0m Error:
log-in to see details

Args:
map[Count:10 PathPrefix:drivers/gpu/drm/drm_lease.c SymbolName:fill_object_idr]

Results:
map[Output:]

410/2 2026/10/14 00:20 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 40649
							output: 44
							thoughts: 14
						

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

**Analyzing Git History with SymbolName and SourcePath**

Right, so I'm thinking, "Let's leverage `git log`". Specifically, I want to use it in conjunction with `SymbolName` and `SourcePath`. This immediately suggests a deeper dive into how we can use this command and its output for a targeted analysis. I'm picturing a scenario where we're tracing the evolution of a particular function or class (the `SymbolName`) and understanding *where* it has been changed (the `SourcePath`). The key here is efficiency. We need a way to filter the git history down to the relevant commits quickly and reliably, using the source path of interest, coupled with the name we're looking for, rather than running a very broad search on the whole codebase. This will be critical for any real-world performance. I see this as a solid approach for pinpointing the exact commits that impacted a specific symbol, saving a lot of time and effort during debugging, refactoring, or impact analysis.



411/2 2026/10/14 00:21 tool git-log
0m Args:
map[Count:10 SourcePath:drivers/gpu/drm/drm_lease.c SymbolName:fill_object_idr]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
948de84233d3 drm : Insert blank lines after declarations.
e40b76428842 drm/leases: Drop object_id validation for negative ids
b5f06893c499 drm: Rename crtc_idr as object_idr to KMS cleanups
968029057192 drm/lease: look at ->universal_planes only once
a0c1af46e9d7 drm/lease: debug output for lease creation
7591844c197c drm: Fix kerneldoc warnings for drm_lease
]

412/2 2026/10/14 00:21 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 41206
							output: 47
							thoughts: 60
						

Thoughts:
Okay, let's dive into this.

**Examining a Recent DRM Commit and Related Lease Functionality**

Alright, I'm taking a look at commit `62884cd386b87` and it's proposing some new DRM functionality: "drm: Add four ioctls for managing drm mode object leases [v7]". My initial instinct is to go beyond just the code and its description. I need to get a broader understanding. Therefore, I need to check the Git log, specifically focusing on how the `drm_mode_create_lease_ioctl` function is implemented and has evolved. I'm keen on seeing the context, rationale, and any potential upstream discussions around this lease feature. This initial commit is likely just the tip of the iceberg, and the log will give me critical insights for a thorough assessment.



413/2 2026/10/14 00:21 tool git-log
0m Args:
map[Count:10 SourcePath:drivers/gpu/drm/drm_lease.c SymbolName:drm_mode_create_lease_ioctl]

Results:
map[Output:f37d63e219c3 drm_lease.c: copy user-array safely
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
4bb2d367a5a2 drm/lease: allow empty leases
56f0729a510f drm: protect drm_master pointers in drm_lease.c
b216a8e7908c drm/lease: fix WARNING in idr_destroy
69ef943dbc14 drm: Use array_size() when creating lease
d7563c55ef9f Merge tag 'drm-misc-next-2018-11-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
a0c1af46e9d7 drm/lease: debug output for lease creation
53b3b6bbfde6 Merge tag 'drm-next-2018-10-24' of git://anongit.freedesktop.org/drm/drm
69fdf4206a8b drm: Differentiate the lack of an interface from invalid parameter
]

414/2 2026/10/14 00:21 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 41788
							output: 51
							thoughts: 129
						

Thoughts:
Here's my analysis:

**Diving into Those Recent DRM Commits**

Okay, hold on a second. Something's caught my eye looking through these recent commits, specifically related to the DRM subsystem. I need to take a closer look at a few of them. Let's see... I've got:

*   `69ef943dbc14 drm: Use array_size() when creating lease`
*   `b216a8e7908c drm/lease: fix WARNING in idr_destroy`
*   `f37d63e219c3 drm_lease.c: copy user-array safely`

My initial thought is that these seem potentially interesting, particularly the ones that deal with `drm/lease` and the safety/management of arrays. I need to dig into `69ef943dbc14`, `b216a8e7908c`, and `f37d63e219c3`. Let me start by reviewing these individually.



415/2 2026/10/14 00:21 tool git-show
0m Args:
map[Commit:69ef943dbc14]

Results:
map[Output:commit 69ef943dbc14b21987c79f8399ffea08f9a1b446
Author: Matthew Wilcox <willy@infradead.org>
Date:   Thu Feb 14 11:03:48 2019 -0800

    drm: Use array_size() when creating lease
    
    Passing an object_count of sufficient size will make
    object_count * 4 wrap around to be very small, then a later function
    will happily iterate off the end of the object_ids array.  Using
    array_size() will saturate at SIZE_MAX, the kmalloc() will fail and
    we'll return an -ENOMEM to the norty userspace.
    
    Fixes: 62884cd386b8 ("drm: Add four ioctls for managing drm mode object leases [v7]")
    Signed-off-by: Matthew Wilcox <willy@infradead.org>
    Acked-by: Kees Cook <keescook@chromium.org>
    Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: <stable@vger.kernel.org> # v4.15+
    Signed-off-by: Dave Airlie <airlied@redhat.com>

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 99cba8ea5d82..5df1256618cc 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -528,7 +528,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 
 	object_count = cl->object_count;
 
-	object_ids = memdup_user(u64_to_user_ptr(cl->object_ids), object_count * sizeof(__u32));
+	object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
+			array_size(object_count, sizeof(__u32)));
 	if (IS_ERR(object_ids))
 		return PTR_ERR(object_ids);
 
]

416/2 2026/10/14 00:21 tool git-show
0m Args:
map[Commit:b216a8e7908c]

Results:
map[Output:commit b216a8e7908cd750550c0480cf7d2b3a37f06954
Author: Qiujun Huang <hqjagain@gmail.com>
Date:   Wed Mar 18 15:53:50 2020 +0800

    drm/lease: fix WARNING in idr_destroy
    
    drm_lease_create takes ownership of leases. And leases will be released
    by drm_master_put.
    
    drm_master_put
        ->drm_master_destroy
                ->idr_destroy
    
    So we needn't call idr_destroy again.
    
    Reported-and-tested-by: syzbot+05835159fe322770fe3d@syzkaller.appspotmail.com
    Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/1584518030-4173-1-git-send-email-hqjagain@gmail.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index b481cafdde28..825abe38201a 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -542,10 +542,12 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	}
 
 	DRM_DEBUG_LEASE("Creating lease\n");
+	/* lessee will take the ownership of leases */
 	lessee = drm_lease_create(lessor, &leases);
 
 	if (IS_ERR(lessee)) {
 		ret = PTR_ERR(lessee);
+		idr_destroy(&leases);
 		goto out_leases;
 	}
 
@@ -580,7 +582,6 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 
 out_leases:
 	put_unused_fd(fd);
-	idr_destroy(&leases);
 
 	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl failed: %d\n", ret);
 	return ret;
]

417/2 2026/10/14 00:21 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 43432
							output: 43
							thoughts: 2287
						

Thoughts:
**DRM Lease Creation Vulnerability: Deep Dive**

Okay, let's break this down. We have a crash, a warning in `mm/page_alloc.c`, specifically related to an allocation order exceeding `MAX_PAGE_ORDER`. The trace leads us right to the `drm_mode_create_lease_ioctl` function. The core of the problem stems from an unbounded user-controlled allocation size within this ioctl, specifically when creating a DRM lease.

The critical path, it seems, is the `fill_object_idr()` function. It's calling a `kmalloc`-family function via `kzalloc_objs` to allocate an `objects` array. The size of this allocation, `object_count`, is directly taken from user space via the `drm_mode_create_lease` struct. This is where the vulnerability lies: no size check!

Looking at the syzkaller reproducer, with `object_count` set to 1,000,000, we're allocating 8MB for the `objects` array (8 bytes per pointer), exceeding the typical `MAX_PAGE_ORDER` of 4MB (order 10). The `kmalloc` then goes off the rails.

Interestingly, prior to that the `object_ids` array, containing 4-byte `__u32` elements, is allocated using `memdup_array_user()`, which silently fails (due to `__GFP_NOWARN`) if the allocation is too large. This creates a window. The `object_ids` allocation may succeed silently, but then the subsequent allocation of the `objects` array with `GFP_KERNEL` triggers the warning.

The provided patch looks like it has three parts:

1.  Switches from `kzalloc_objs` to `kvzalloc_objs` for the `objects` array, then from `kfree` to `kvfree`. This implies a move to vmalloc, which can handle larger contiguous memory requirements.
2.  Adds a crucial size check. Now, if the `object_count` would result in an allocation larger than `INT_MAX / sizeof(struct drm_mode_object *)`, it returns an error.  This seems to be the critical fix to prevent the issue.
3.  Switches from `memdup_array_user` to `vmemdup_array_user` for the `object_ids` array, and `kfree` to `kvfree`. Likely also using vmalloc for larger contiguous memory.

Now, let's go further back, I have to confirm. What was `kzalloc_objs` originally, which is now `kcalloc`? We have to go back to the code commit `62884cd386b87`. The original code, even back then, used `kcalloc`, meaning `kmalloc_array`, which calls `kmalloc` with `GFP_KERNEL`. This means the same vulnerability existed from the beginning, where a large `object_count` could lead to an 8MB allocation using `GFP_KERNEL`! The problem always existed!

And `memdup_user`, which would silently fail if too large, at the time, still allocated up to 4MB of user memory. Then `kcalloc` tries to allocate 8MB, triggering the warning! The bug was there from the beginning!



418/2 2026/10/14 00:22 tool git-show
0m Args:
map[Commit:69050f8d6d07 File:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:commit 69050f8d6d075dc01af7a5f2f550a8067510366f
Author: Kees Cook <kees@kernel.org>
Date:   Fri Feb 20 23:49:23 2026 -0800

    treewide: Replace kmalloc with kmalloc_obj for non-scalar types
    
    This is the result of running the Coccinelle script from
    scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
    avoid scalar types (which need careful case-by-case checking), and
    instead replace kmalloc-family calls that allocate struct or union
    object instances:
    
    Single allocations:     kmalloc(sizeof(TYPE), ...)
    are replaced with:      kmalloc_obj(TYPE, ...)
    
    Array allocations:      kmalloc_array(COUNT, sizeof(TYPE), ...)
    are replaced with:      kmalloc_objs(TYPE, COUNT, ...)
    
    Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
    are replaced with:      kmalloc_flex(*PTR, FAM, COUNT, ...)
    
    (where TYPE may also be *VAR)
    
    The resulting allocations no longer return "void *", instead returning
    "TYPE *".
    
    Signed-off-by: Kees Cook <kees@kernel.org>

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 94375c6a5425..f0a5cef17164 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,8 +386,8 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kcalloc(object_count, sizeof(struct drm_mode_object *),
-			  GFP_KERNEL);
+	objects = kzalloc_objs(struct drm_mode_object *, object_count,
+			       GFP_KERNEL);
 	if (!objects)
 		return -ENOMEM;
 
]

419/2 2026/10/14 00:22 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 47071
							output: 46
							thoughts: 460
						

Thoughts:
**Recent Code Archaeology: Digging into Lease Management**

Okay, so I'm looking at these commits, `69050f8d6d07` and `32a92f8c8932`, that are practically brand new – February 2026, wow. They're just doing some straightforward conversions, basically replacing `kcalloc` with `kzalloc_objs` and defaulting to `GFP_KERNEL`. Before that, it was the more explicit `kcalloc` with a hardcoded size. Nothing too crazy yet.

But wait, this feels... familiar. I need to trace the evolution of `drm_mode_create_lease_ioctl` and `fill_object_idr`. Were there earlier changes that set the stage for these tweaks? My gut is telling me there's more here. Let's see... could it be `62884cd386b8`, `f37d63e219c3`, or `69ef943dbc14`?

Ah, bingo. Let's look at `69ef943dbc14`... "drm: Use array_size() when creating lease." And, it's fixing the *original* lease commit! This is interesting; the fix addresses a potential integer overflow when calculating object sizes. Matthew Wilcox added `array_size()` to prevent a multiplication that could wrap, leading to an out-of-bounds read later on in the code. Clever. `array_size()` saturates at `SIZE_MAX`, forcing the `kmalloc()` to fail and returning -ENOMEM to the caller. That's a good defensive programming approach.

Okay, that nails down the size calculation. Now, let's look at commit `f37d63e219c3`: "drm_lease.c: copy user-array safely." Ah, the copy from userspace! This is about security – the fix uses `memdup_array_user` instead of just plain `memdup_user` to safeguard against overflows when duplicating user-space arrays. Smart; that's a classic vulnerability.

Alright, now the question is: what was the original author of the fix thinking? I should search for related commits to see if there's any commentary. I need to use `git log` or grepper or search the commit messages. I bet there's some useful context out there! I'll look for similar patches and see what I can find.



420/2 2026/10/14 00:22 tool git-log
0m Args:
map[CodeRegexp:vmemdup_array_user Count:10 PathPrefix:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:]

421/2 2026/10/14 00:22 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 48130
							output: 28
							thoughts: 42
						

Thoughts:
Okay, here's my summary, presented as a first-person account reflecting the described thought process:

**Where's That Fix?**

Right, so the "fix commit" is *not* showing up directly in the `git log`. That makes sense; it's the current patch itself that's fixing the immediate issue. I need to track down the history of this fix, or related fixes, so I can see what changed. It's time to dig into the commit messages to see if I can find the origin. Let me search for key terms related to this DRM lease issue, like "drm\_lease" itself, or maybe some related functions used in this context, such as "fill\_object\_idr" or anything similar. Hopefully, the commit message provides some helpful context around this bug.



422/2 2026/10/14 00:22 tool git-log
0m Args:
map[Count:10 MessageRegexps:[fill_object_idr]]

Results:
map[Output:]

423/2 2026/10/14 00:23 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 48384
							output: 31
							thoughts: 24
						

Thoughts:
Here's my thought process, as if I were considering this search:

**Investigating `drm_mode_create_lease_ioctl` and `drm_lease` in Commit Messages**

Okay, so I'm thinking about digging into the commit history related to DRM leases. My initial thought is to specifically look for the `drm_mode_create_lease_ioctl` function. That's a pretty strong indicator, as it's the core system call involved in lease creation. I also need to be broad and consider variations, so I should also search generally for the term `drm_lease`. This should give me a good overview of the development, bug fixes, and usage of the feature. I'll need to use these search terms to get a comprehensive view of the context surrounding those functions and APIs, and how they’ve evolved over time. I'll need to figure out which tools I'll use, like `git log`, `git grep`, or whatever else is best.



424/2 2026/10/14 00:23 tool git-log
0m Args:
map[Count:10 MessageRegexps:[drm_mode_create_lease_ioctl]]

Results:
map[Output:676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
12d43deb1ee6 drm: fix use-after-free read in drm_mode_create_lease_ioctl()
b4e7a7a88b5d drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open()
7591844c197c drm: Fix kerneldoc warnings for drm_lease
bd36d3bab2e3 drm/drm_lease: Prevent deadlock in case drm_lease_create() fails
]

425/2 2026/10/14 00:23 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 48802
							output: 24
							thoughts: 16
						

Thoughts:
Okay, here's my interpretation of what's going through my mind, rendered in the first person, as if I'm the expert reviewing commit `12d43deb1ee6`.

**Initial Assessment: Diving into Commit 12d43deb1ee6**

Alright, let's get down to brass tacks. I'm taking a look at commit `12d43deb1ee6`. Immediately, I want to see what this thing is *actually* doing. The commit hash is just a label, a pointer to a set of changes. Now, my mind is already running through a mental checklist: what was the context of this commit? What's the area of the codebase? What's the likely impact? I need to analyze its changes, and I'm already formulating questions to assess its impact. Was this a quick fix? A large feature update? A refactor? Let's get to the meat of it. Show me the diff. Let's see how smart this commit really is.



426/2 2026/10/14 00:23 tool git-show
0m Args:
map[Commit:12d43deb1ee6]

Results:
map[Output:commit 12d43deb1ee639d01a2a8d2a7a4cc8ad31224475
Author: Jann Horn <jannh@google.com>
Date:   Mon Oct 1 17:31:17 2018 +0200

    drm: fix use-after-free read in drm_mode_create_lease_ioctl()
    
    fd_install() moves the reference given to it into the file descriptor table
    of the current process. If the current process is multithreaded, then
    immediately after fd_install(), another thread can close() the file
    descriptor and cause the file's resources to be cleaned up.
    
    Since the reference to "lessee" is held by the file, we must not access
    "lessee" after the fd_install() call.
    
    As far as I can tell, to reach this codepath, the caller must have an open
    file descriptor to a DRI device in master mode. I'm not sure what the
    requirements for that are.
    
    Signed-off-by: Jann Horn <jannh@google.com>
    Fixes: 62884cd386b8 ("drm: Add four ioctls for managing drm mode object leases [v7]")
    Cc: stable@vger.kernel.org
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20181001153117.216923-1-jannh@google.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index b54fb78a283c..b82da96ded5c 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -566,14 +566,14 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	lessee_priv->is_master = 1;
 	lessee_priv->authenticated = 1;
 
-	/* Hook up the fd */
-	fd_install(fd, lessee_file);
-
 	/* Pass fd back to userspace */
 	DRM_DEBUG_LEASE("Returning fd %d id %d\n", fd, lessee->lessee_id);
 	cl->fd = fd;
 	cl->lessee_id = lessee->lessee_id;
 
+	/* Hook up the fd */
+	fd_install(fd, lessee_file);
+
 	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n");
 	return 0;
 
]

427/2 2026/10/14 00:23 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 49774
							output: 24
							thoughts: 15
						

Thoughts:
Okay, here's my interpretation of what's going on, framed as a thought process I might have:

**Analyzing Commit bd36d3bab2e3**

Alright, let's dive into this commit, bd36d3bab2e3. Seems like we're zeroing in on a specific piece of the puzzle here. I'm going to carefully dissect the code changes introduced by this commit, because specific commits like these are often crucial for understanding the overall trajectory of a project. I'll be looking for clues on the overall architecture of this code, and paying special attention to how these changes interact with the existing codebase. My experience tells me that these commits will either be straightforward bug fixes, or potentially major architecture shifts. I'll look at the file differences to see if there are any obvious additions, deletions, or modifications. I need to understand the 'why' behind these changes. Is this addressing a performance bottleneck? Is it a security fix? Or perhaps a refactoring to improve maintainability? Knowing this context is key to assessing the long-term impact. Given my current project goals, this analysis will allow me to assess the scope of this commit, and how it relates to my current tasks.



428/2 2026/10/14 00:23 tool git-show
0m Args:
map[Commit:bd36d3bab2e3]

Results:
map[Output:commit bd36d3bab2e3d08f80766c86487090dbceed4651
Author: Marius Vlad <marius-cristian.vlad@nxp.com>
Date:   Wed Dec 13 20:10:48 2017 +0200

    drm/drm_lease: Prevent deadlock in case drm_lease_create() fails
    
    This case can been seen when creating the lease with the same objects passed.
    
    [  605.515097] 2 locks held by testapp/3337:
    [  605.519027]  #0:  (&dev->mode_config.idr_mutex){......}, at: [<ffff0000085f1664>] drm_mode_create_lease_ioctl+0x384/0x858
    [  605.530045]  #1:  (&dev->mode_config.idr_mutex){......}, at: [<ffff0000085f11bc>] drm_lease_destroy+0x2c/0x110
    
    Which was causing the process to hang:
    
    [  605.398827] [<ffff0000080856cc>] __switch_to+0x94/0xa8
    [  605.404030] [<ffff000008c05d00>] __schedule+0x1b0/0x698
    [  605.409322] [<ffff000008c06224>] schedule+0x3c/0xa8
    [  605.414260] [<ffff000008c06628>] schedule_preempt_disabled+0x20/0x38
    [  605.420677] [<ffff000008c07370>] mutex_lock_nested+0x158/0x340
    [  605.426572] [<ffff0000085f11bc>] drm_lease_destroy+0x2c/0x110
    [  605.432389] [<ffff0000085cecf0>] drm_master_put+0xc0/0xc8
    [  605.437845] [<ffff0000085f175c>] drm_mode_create_lease_ioctl+0x47c/0x858
    [  605.444612] [<ffff0000085d4460>] drm_ioctl+0x198/0x448
    [  605.449811] [<ffff000008201134>] do_vfs_ioctl+0xa4/0x748
    [  605.455192] [<ffff000008201864>] SyS_ioctl+0x8c/0xa0
    [  605.460216] [<ffff000008082f4c>] __sys_trace_return+0x0/0x4
    
    drm_mode_create_lease_ioctl() calls drm_lease_create() which acquires a lock
    on dev->mode_config.idr_mutex. In case of failure, drm_lease_create() calls
    drm_master_put() which in turn tries to acquire the same lock when calling
    drm_lease_destroy().
    
    v2: - Reverse the order at exit in case of fail, so that unlocking takes place
    before dropping the reference.
        - Include detail information about deadlock (Daniel Vetter)
    
    Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20171213181048.32719-1-marius-cristian.vlad@nxp.com

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index d1eb56a1eff4..59849f02e2ad 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -254,10 +254,10 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr
 	return lessee;
 
 out_lessee:
-	drm_master_put(&lessee);
-
 	mutex_unlock(&dev->mode_config.idr_mutex);
 
+	drm_master_put(&lessee);
+
 	return ERR_PTR(error);
 }
 
]

429/2 2026/10/14 00:23 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 51349
							output: 32
							thoughts: 52
						

Thoughts:
Okay, let's dive into this. I need to get a really solid understanding of the evolution of `drm_lease.c`, specifically focusing on how `fill_object_idr` and `drm_mode_create_lease_ioctl` have changed over time. I'm thinking a thorough commit history review is in order. Let's start by isolating all the commits that have touched `drm_lease.c`. This should give me a good timeline and context for any relevant modifications and the rationale behind them. From there, I can drill down into the specifics of these two functions, noting the changes and implications of those changes, especially as they relate to potential security vulnerabilities or performance bottlenecks. I want to see how this lease functionality has been shaped and whether the current implementation reflects any particular design choices or limitations. This approach should allow for a complete understanding of how these pieces fit together.



430/2 2026/10/14 00:23 tool git-log
0m Args:
map[Count:50 PathPrefix:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
f37d63e219c3 drm_lease.c: copy user-array safely
cde3d37b19df drm: Remove unnecessary include statements for drm_crtc_helper.h
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
4bb2d367a5a2 drm/lease: allow empty leases
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
d793b8f732d6 drm: clarify usage of drm leases
56f0729a510f drm: protect drm_master pointers in drm_lease.c
7988fdf5f0a3 drm: Don't include drm_legacy.h in drm_lease.c
948de84233d3 drm : Insert blank lines after declarations.
b216a8e7908c drm/lease: fix WARNING in idr_destroy
c942fddf8793 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
0500c04ea14a drm: drop use of drmP.h in drm/*
46b757780dfe drm/lease: Check for lessor outside of locks
ae9d6c076c0d drm/lease: Drop recursive leads checks
e40b76428842 drm/leases: Drop object_id validation for negative ids
69ef943dbc14 drm: Use array_size() when creating lease
b5f06893c499 drm: Rename crtc_idr as object_idr to KMS cleanups
ce85882860f0 drm/lease: Send a distinct uevent
968029057192 drm/lease: look at ->universal_planes only once
a0c1af46e9d7 drm/lease: debug output for lease creation
6caec6a04717 drm/lease: drop EXPORT_SYMBOL
918d89bb1a63 gpu: drm/lease: fix spelling mistake, EACCESS -> EACCES
12d43deb1ee6 drm: fix use-after-free read in drm_mode_create_lease_ioctl()
69fdf4206a8b drm: Differentiate the lack of an interface from invalid parameter
19f391eb05b8 turn filp_clone_open() into inline wrapper for dentry_open()
b4e7a7a88b5d drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open()
aec06c7606be gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
7591844c197c drm: Fix kerneldoc warnings for drm_lease
d2a48e52541c drm: move lease init after validation in drm_lease_create
bd36d3bab2e3 drm/drm_lease: Prevent deadlock in case drm_lease_create() fails
62884cd386b8 drm: Add four ioctls for managing drm mode object leases [v7]
2ed077e467ee drm: Add drm_object lease infrastructure [v5]
]

431/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 52490
							output: 29
							thoughts: 26
						

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

**Analyzing the Impact of Commit 2ed077e467ee**

Alright, I need to get a clear picture of what's going on. Before I dive too deep into the issue, it’s best to reference commit `2ed077e467ee`. I need to ensure that the origin of the issue is appropriately referenced, and what that specific commit was, relative to the current state of affairs. Often, a single commit can cascade into downstream changes. Seeing it directly might reveal some unexpected context or assumptions that were made at the time, helping me to understand the current situation and any potential root causes. I’m thinking there might be an upstream dependency or a subtle interaction that wasn’t immediately obvious from the current changeset alone. It's a quick sanity check before I go too deep.



432/2 2026/10/14 00:24 tool git-show
0m Args:
map[Commit:2ed077e467ee Stat:true]

Results:
map[Output:commit 2ed077e467eedb033032bc4b6e349365517662d6
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Mar 14 22:26:41 2017 -0700

    drm: Add drm_object lease infrastructure [v5]
    
    This provides new data structures to hold "lease" information about
    drm mode setting objects, and provides for creating new drm_masters
    which have access to a subset of the available drm resources.
    
    An 'owner' is a drm_master which is not leasing the objects from
    another drm_master, and hence 'owns' them.
    
    A 'lessee' is a drm_master which is leasing objects from some other
    drm_master. Each lessee holds the set of objects which it is leasing
    from the lessor.
    
    A 'lessor' is a drm_master which is leasing objects to another
    drm_master. This is the same as the owner in the current code.
    
    The set of objects any drm_master 'controls' is limited to the set of
    objects it leases (for lessees) or all objects (for owners).
    
    Objects not controlled by a drm_master cannot be modified through the
    various state manipulating ioctls, and any state reported back to user
    space will be edited to make them appear idle and/or unusable. For
    instance, connectors always report 'disconnected', while encoders
    report no possible crtcs or clones.
    
    The full list of lessees leasing objects from an owner (either
    directly, or indirectly through another lessee), can be searched from
    an idr in the drm_master of the owner.
    
    Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
    
    * Sub-leasing has been disabled.
    
    * BUG_ON for lock checking replaced with lockdep_assert_held
    
    * 'change' ioctl has been removed.
    
    * Leased objects can always be controlled by the lessor; the
      'mask_lease' flag has been removed
    
    * Checking for leased status has been simplified, replacing
      the drm_lease_check function with drm_lease_held.
    
    Changes in v3, some suggested by Dave Airlie <airlied@gmail.com>
    
    * Add revocation. This allows leases to be effectively revoked by
      removing all of the objects they have access to. The lease itself
      hangs around as it's hanging off a file.
    
    * Free the leases IDR when the master is destroyed
    
    * _drm_lease_held should look at lessees, not lessor
    
    * Allow non-master files to check for lease status
    
    Changes in v4, suggested by Dave Airlie <airlied@gmail.com>
    
    * Formatting and whitespace changes
    
    Changes in v5 (airlied)
    
    * check DRIVER_MODESET before lease destroy call
    * check DRIVER_MODESET for lease revoke (Chris)
    * Use idr_mutex uniformly for all lease elements of struct drm_master. (Keith)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

 drivers/gpu/drm/Makefile      |   2 +-
 drivers/gpu/drm/drm_auth.c    |  30 +++-
 drivers/gpu/drm/drm_lease.c   | 355 ++++++++++++++++++++++++++++++++++++++++++
 include/drm/drm_auth.h        |  21 +++
 include/drm/drm_lease.h       |  36 +++++
 include/drm/drm_mode_object.h |   1 +
 6 files changed, 443 insertions(+), 2 deletions(-)
]

433/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 53651
							output: 36
							thoughts: 716
						

Thoughts:
**Analyzing the Potential Vulnerability in Commit 62884cd386b8**

Okay, let's dive into commit 62884cd386b87 and how it interacts with the newly created `drm_lease.c` from commit 2ed077e467eedb033032bc4b6e349365517662d6. That initial file just had helper functions, a decent starting point with 355 lines. But the real meat seems to be in the ioctls added in the target commit. I'm focusing on the interaction between `fill_object_idr()` and `drm_mode_create_lease_ioctl`.

I'm seeing that `drm_mode_create_lease_ioctl` takes `object_count` directly from user space via `cl->object_count`, which is a `uint32_t`. The critical part is the allocation and copying of `object_ids`. `memdup_user` is used to copy the user-provided IDs, and then `kcalloc` is used to allocate space for `objects`.

Here's the problem: there's *no* validation of `object_count`. No upper bound check, nothing. It's just blindly trusted. And if the user provides a large value for `object_count`, say 1,000,000, that translates to allocating and copying 4,000,000 bytes. That's a huge potential DoS vulnerability. And this is being done in the kernel.

What makes me most nervous is that I don't recall exactly how `memdup_user` behaved back in 2017. I'll need to check the definition in `mm/util.c` for any potential mitigation in older versions of the kernel. This might be a classic case of integer overflow or allocation-related issues, which are always fun.

I need to confirm the behavior of `memdup_user` in the kernel at the time this code was introduced. This could be a significant problem.



434/2 2026/10/14 00:24 tool git-log
0m Args:
map[Count:5 MessageRegexps:[memdup_user] PathPrefix:mm/util.c]

Results:
map[Output:dd2a5b5514ab mm/util: make memdup_user_nul() similar to memdup_user()
d73778e4b867 mm/util: Use dedicated slab buckets for memdup_user()
50fd2f298bef new primitive: vmemdup_user()
6c2c97a24f09 memdup_user(): switch to GFP_USER
e9d408e107db new helper: memdup_user_nul()
]

435/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 54998
							output: 27
							thoughts: 26
						

Thoughts:
Okay, let's dive into commit `6c2c97a24f09` within `mm/util.c`. I need to understand what changed there. My initial thought is to quickly assess the context; what was the overall goal of the change? Was it a bug fix, performance optimization, or perhaps a new feature introduction related to memory management utilities? I'm going to look for the commit message first, as that usually provides a concise overview. Based on the file location, `mm/util.c`, I'd expect it deals with memory-related helper functions, potentially for allocation, deallocation, or addressing issues. Next, I’ll scan the diff for the core changes. I'll focus on any new function declarations, modifications to existing functions, and any changes to data structures. I'll need to pay close attention to things like atomic operations, synchronization primitives (if any), and any interactions with the page allocator or slab allocator, depending on what I see within the code. Based on the specific code changes, I'll attempt to correlate them to any known issues or areas of improvement within the memory management subsystem. Are there any potential impacts on other parts of the kernel, like interrupt handling or device drivers? I’ll need to consider those possibilities and any knock-on effects that might exist. I'll try to find any performance implications that would be important in any kernel version. Finally, I’ll compare the changes to any similar or related commits to build a complete picture of the change's purpose and impact.



436/2 2026/10/14 00:24 tool git-show
0m Args:
map[Commit:6c2c97a24f09]

Results:
map[Output:commit 6c2c97a24f096e3239bc54029b808c6bcba4f358
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Sun Jan 7 13:00:27 2018 -0500

    memdup_user(): switch to GFP_USER
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

diff --git a/mm/util.c b/mm/util.c
index 34e57fae959d..4b93ffa6df96 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -156,12 +156,7 @@ void *memdup_user(const void __user *src, size_t len)
 {
 	void *p;
 
-	/*
-	 * Always use GFP_KERNEL, since copy_from_user() can sleep and
-	 * cause pagefault, which makes it pointless to use GFP_NOFS
-	 * or GFP_ATOMIC.
-	 */
-	p = kmalloc_track_caller(len, GFP_KERNEL);
+	p = kmalloc_track_caller(len, GFP_USER);
 	if (!p)
 		return ERR_PTR(-ENOMEM);
 
]

437/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 55736
							output: 36
							thoughts: 33
						

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

**Investigating a Kernel Memory Allocation Detail**

Alright, so I'm thinking about `memdup_user` here. Specifically, I'm curious about the inclusion of `__GFP_NOWARN` in its implementation. It's a subtle but important detail. When did that change land? Best way to figure that out is to dig into the git log. I need to quickly see the history of changes related to `memdup_user`.  I'm looking for the commit that introduced that specific flag, to understand the rationale behind it and when it was deemed necessary. Time to fire up the git commands and see what comes up. This is likely to tell me something interesting about a memory allocation strategy that's easily overlooked, but potentially quite impactful.



438/2 2026/10/14 00:24 tool git-log
0m Args:
map[CodeRegexp:GFP_NOWARN Count:5 PathPrefix:mm/util.c]

Results:
map[Output:f1157db8b539 slab: Adjust placement of __kvmalloc_node_noprof
dd2a5b5514ab mm/util: make memdup_user_nul() similar to memdup_user()
590b9d576cae mm: kvmalloc: align kvrealloc() with krealloc()
d73778e4b867 mm/util: Use dedicated slab buckets for memdup_user()
0708a0afe291 mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls
]

439/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 56129
							output: 33
							thoughts: 38
						

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

**Investigating a Suspect Memory Duplication**

Alright, so I'm looking into something that smells fishy. My initial instinct is to dig into commit history. I need to understand when and why `memdup_user` was touched last. Specifically, I want to cross-reference commit `dd2a5b5514ab` and `d73778e4b867` – those are potential candidates to investigate. Those commits *could* have introduced or changed behavior related to memory duplication from user space. Alternatively, I'll go directly to the source and leverage `git blame` on the `memdup_user` function itself. I'm hoping to quickly identify the author(s) of the problematic code and see if the change log or previous discussions shed any light on the current situation. I need to understand the intent behind that code and whether anything has changed, so the root cause is apparent.



440/2 2026/10/14 00:24 tool git-blame
0m Args:
map[End:200 File:mm/util.c Start:180]

Results:
map[Output:0b7b8704ddcee 180) }
0b7b8704ddcee 181) EXPORT_SYMBOL(kvmemdup);
0b7b8704ddcee 182) 
f35157417215e 183) /**
f35157417215e 184)  * kmemdup_nul - Create a NUL-terminated string from unterminated data
f35157417215e 185)  * @s: The data to stringify
f35157417215e 186)  * @len: The size of the data
f35157417215e 187)  * @gfp: the GFP mask used in the kmalloc() call when allocating memory
a862f68a8b360 188)  *
a862f68a8b360 189)  * Return: newly allocated copy of @s with NUL-termination or %NULL in
a862f68a8b360 190)  * case of error
f35157417215e 191)  */
f35157417215e 192) char *kmemdup_nul(const char *s, size_t len, gfp_t gfp)
f35157417215e 193) {
43731516facc3 194) 	return s ? __kmemdup_nul(s, len, gfp) : NULL;
f35157417215e 195) }
f35157417215e 196) EXPORT_SYMBOL(kmemdup_nul);
f35157417215e 197) 
d73778e4b8675 198) static kmem_buckets *user_buckets __ro_after_init;
d73778e4b8675 199) 
d73778e4b8675 200) static int __init init_user_buckets(void)
]

441/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 57012
							output: 31
							thoughts: 18
						

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

**Hunting Down `memdup_user` in `mm/util.c`**

Alright, so the task at hand is to locate the `memdup_user` function. My initial instinct is to go straight to `mm/util.c`. That's where I'd expect to find something of this nature – a utility function related to memory management, user-space interaction, and possibly duplication. The naming convention strongly suggests it’s involved in safely copying data from userspace. I'll mentally prepare myself for potential kernel debugging, because this function is an interesting target. Given the context, this sounds like a core function, so the code should be readable and well documented. Let's see if this is as straightforward as it seems or if I have to do some deeper digging to get the full picture.



442/2 2026/10/14 00:24 tool grepper
0m Args:
map[Expression:memdup_user\( PathPrefixes:[mm/util.c]]

Results:
map[Output:mm/util.c=206=subsys_initcall(init_user_buckets);
--
mm/util.c-216- */
mm/util.c:217:void *memdup_user(const void __user *src, size_t len)
mm/util.c-218-{
--
mm/util.c=232=EXPORT_SYMBOL(memdup_user);
--
mm/util.c-242- */
mm/util.c:243:void *vmemdup_user(const void __user *src, size_t len)
mm/util.c-244-{
--
mm/util.c=267=char *strndup_user(const char __user *s, long n)
--
mm/util.c-279-
mm/util.c:280:	p = memdup_user(s, length);
mm/util.c-281-
]

443/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 57495
							output: 33
							thoughts: 20
						

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

**Investigating `mm/util.c` Line 217 with `git blame`**

Okay, so I need to understand the history of a specific line of code – line 217 in `mm/util.c`. My initial thought is to grab `git blame` and drill down. I know exactly what I'm looking for: the context of that line. I'm hoping to quickly identify the author, the commit that introduced it, and ideally, some indication of *why* that particular code exists in its current form. Perhaps there's a related bug report or commit message that sheds light on a tricky edge case. Maybe it's a performance optimization that's gone stale, or a workaround for some ancient hardware quirk. Regardless, `git blame` is my go-to for starting this kind of forensic investigation within the codebase. It's the most efficient way to immediately trace back responsibility and understand the historical motivations behind a specific line of code. Time to fire it up and see what it tells me.



444/2 2026/10/14 00:24 tool git-blame
0m Args:
map[End:230 File:mm/util.c Start:215]

Results:
map[Output:50fd2f298bef9 215)  * contiguous, to be freed by kfree().
610a77e04a8d9 216)  */
610a77e04a8d9 217) void *memdup_user(const void __user *src, size_t len)
610a77e04a8d9 218) {
610a77e04a8d9 219) 	void *p;
610a77e04a8d9 220) 
d73778e4b8675 221) 	p = kmem_buckets_alloc_track_caller(user_buckets, len, GFP_USER | __GFP_NOWARN);
610a77e04a8d9 222) 	if (!p)
610a77e04a8d9 223) 		return ERR_PTR(-ENOMEM);
610a77e04a8d9 224) 
610a77e04a8d9 225) 	if (copy_from_user(p, src, len)) {
610a77e04a8d9 226) 		kfree(p);
610a77e04a8d9 227) 		return ERR_PTR(-EFAULT);
610a77e04a8d9 228) 	}
610a77e04a8d9 229) 
610a77e04a8d9 230) 	return p;
]

445/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 58229
							output: 28
							thoughts: 20
						

Thoughts:
Okay, here's my interpretation of what's going on, formatted as you requested:

**Deconstructing Commit 610a77e04a8d9**

Alright, let's dive into commit 610a77e04a8d9. Given my expertise, I'm already mentally processing this as a specific point in a development timeline. The exact nature of what I'm looking for depends on the context, of course – the codebase, the project's history, the specific tasks I'm currently focused on. But my mind is immediately going to start running through potential scenarios: What kind of modifications were likely made? Were we fixing a bug, adding a new feature, refactoring something, or maybe just making a configuration change? I'm already anticipating the typical clues: What was the commit message like? Did it follow our team's conventions? Were there related JIRA tickets or pull requests that might give additional context? I'm preparing to evaluate the impact – locally, on the wider system, and potentially on our users. I'll need to assess the scope of the change, identify any potential dependencies, and ultimately gauge the overall quality and maintainability of the modifications. The specifics will vary depending on the system, of course, but the analytical framework remains the same: I'm ready to evaluate and understand.



446/2 2026/10/14 00:24 tool git-show
0m Args:
map[Commit:610a77e04a8d9]

Results:
map[Output:commit 610a77e04a8d9fe8764dc484e2182fa251ce1cc2
Author: Li Zefan <lizf@cn.fujitsu.com>
Date:   Tue Mar 31 15:23:16 2009 -0700

    memdup_user(): introduce
    
    I notice there are many places doing copy_from_user() which follows
    kmalloc():
    
            dst = kmalloc(len, GFP_KERNEL);
            if (!dst)
                    return -ENOMEM;
            if (copy_from_user(dst, src, len)) {
                    kfree(dst);
                    return -EFAULT
            }
    
    memdup_user() is a wrapper of the above code.  With this new function, we
    don't have to write 'len' twice, which can lead to typos/mistakes.  It
    also produces smaller code and kernel text.
    
    A quick grep shows 250+ places where memdup_user() *may* be used.  I'll
    prepare a patchset to do this conversion.
    
    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Cc: Americo Wang <xiyou.wangcong@gmail.com>
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/include/linux/string.h b/include/linux/string.h
index d18fc198aa2f..8852739f36df 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -12,6 +12,7 @@
 #include <linux/stddef.h>	/* for NULL */
 
 extern char *strndup_user(const char __user *, long);
+extern void *memdup_user(const void __user *, size_t);
 
 /*
  * Include machine specific inline routines
diff --git a/mm/util.c b/mm/util.c
index 37eaccdf3054..7c122e49f769 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -69,6 +69,36 @@ void *kmemdup(const void *src, size_t len, gfp_t gfp)
 }
 EXPORT_SYMBOL(kmemdup);
 
+/**
+ * memdup_user - duplicate memory region from user space
+ *
+ * @src: source address in user space
+ * @len: number of bytes to copy
+ *
+ * Returns an ERR_PTR() on failure.
+ */
+void *memdup_user(const void __user *src, size_t len)
+{
+	void *p;
+
+	/*
+	 * Always use GFP_KERNEL, since copy_from_user() can sleep and
+	 * cause pagefault, which makes it pointless to use GFP_NOFS
+	 * or GFP_ATOMIC.
+	 */
+	p = kmalloc_track_caller(len, GFP_KERNEL);
+	if (!p)
+		return ERR_PTR(-ENOMEM);
+
+	if (copy_from_user(p, src, len)) {
+		kfree(p);
+		return ERR_PTR(-EFAULT);
+	}
+
+	return p;
+}
+EXPORT_SYMBOL(memdup_user);
+
 /**
  * __krealloc - like krealloc() but don't free @p.
  * @p: object to reallocate memory for.
]

447/2 2026/10/14 00:24 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 59546
							output: 31
							thoughts: 46
						

Thoughts:
Here's my thought process, as if I were considering this myself:

**Investigating a `memdup_user` Change**

Hold on a second... I could have sworn `__GFP_NOWARN` wasn't part of `memdup_user` originally. That's a flag that's usually used for suppressing allocation failures, right? Interesting... I need to check the Git history. Let's fire up a CodeRegexp search. I'll search the relevant repository, looking specifically for commit messages or code changes that mention *both* `memdup_user` *and* `__GFP_NOWARN`. That should pinpoint when and why this flag was introduced. I'm assuming that this is going to show up in the history.



448/2 2026/10/14 00:25 tool git-log
10m Error:
log-in to see details

Args:
map[CodeRegexp:memdup_user.*__GFP_NOWARN Count:5]

Results:
map[Output:]

449/2 2026/10/14 00:35 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 59818
							output: 37
							thoughts: 18
						

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

**Investigating Memory Allocation with `GFP_NOWARN`**

Alright, let's dive in. I need to get a handle on where we're using `GFP_NOWARN`. This is usually a sign of something delicate – maybe a critical path, or an area where we really can't afford to trigger a warning message during allocation failures. The fact that it's important enough to investigate suggests a potential performance bottleneck, or perhaps a risk of silent data corruption if allocation fails. I'll start by checking `mm/util.c` because it's a likely candidate for core memory management utilities and often contains macros or helper functions dealing with allocation flags. I want to see how `GFP_NOWARN` is being used in context – what other flags are being combined with it? Are there any specific allocation paths or scenarios where it's prevalent? Understanding the surrounding code will clarify the intent and risk profile. I need to see if we are dealing with a design problem, an optimization, or maybe a potential bug. I can't just look at the line of code - I have to see it in context.



450/2 2026/10/14 00:35 tool git-log
0m Args:
map[CodeRegexp:__GFP_NOWARN Count:5 PathPrefix:mm/util.c]

Results:
map[Output:f1157db8b539 slab: Adjust placement of __kvmalloc_node_noprof
dd2a5b5514ab mm/util: make memdup_user_nul() similar to memdup_user()
590b9d576cae mm: kvmalloc: align kvrealloc() with krealloc()
d73778e4b867 mm/util: Use dedicated slab buckets for memdup_user()
0708a0afe291 mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls
]

451/2 2026/10/14 00:35 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 60272
							output: 27
							thoughts: 18
						

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

**Analyzing Commit d73778e4b867**

Alright, let's take a look at this commit, d73778e4b867. My initial thought process is geared towards understanding the context and impact of this specific revision. I'll need to immediately start reviewing the changes. I'll be looking for potential regressions, performance implications, and adherence to the established coding standards, of course. I'll want to quickly gauge the scope – is this a minor bug fix, a significant feature addition, or something in between? I'll be mentally parsing the code diff to identify the critical parts. I'll automatically be assessing how this commit ties into the wider architectural context. Any immediate red flags jump out, I’ll be asking the standard β€œwhy” questions. Are there any unusual techniques used? Does this introduce or remove any dependencies? What’s the rationale behind these changes? In short, my analysis will rapidly transition from an overview to a deep dive, all based on that commit hash.



452/2 2026/10/14 00:35 tool git-show
0m Args:
map[Commit:d73778e4b867]

Results:
map[Output:commit d73778e4b86755d527a0c6b249cde846770b2f66
Author: Kees Cook <kees@kernel.org>
Date:   Mon Jul 1 12:13:03 2024 -0700

    mm/util: Use dedicated slab buckets for memdup_user()
    
    Both memdup_user() and vmemdup_user() handle allocations that are
    regularly used for exploiting use-after-free type confusion flaws in
    the kernel (e.g. prctl() PR_SET_VMA_ANON_NAME[1] and setxattr[2][3][4]
    respectively).
    
    Since both are designed for contents coming from userspace, it allows
    for userspace-controlled allocation sizes. Use a dedicated set of kmalloc
    buckets so these allocations do not share caches with the global kmalloc
    buckets.
    
    After a fresh boot under Ubuntu 23.10, we can see the caches are already
    in active use:
    
     # grep ^memdup /proc/slabinfo
     memdup_user-8k         4      4   8192    4    8 : ...
     memdup_user-4k         8      8   4096    8    8 : ...
     memdup_user-2k        16     16   2048   16    8 : ...
     memdup_user-1k         0      0   1024   16    4 : ...
     memdup_user-512        0      0    512   16    2 : ...
     memdup_user-256        0      0    256   16    1 : ...
     memdup_user-128        0      0    128   32    1 : ...
     memdup_user-64       256    256     64   64    1 : ...
     memdup_user-32       512    512     32  128    1 : ...
     memdup_user-16      1024   1024     16  256    1 : ...
     memdup_user-8       2048   2048      8  512    1 : ...
     memdup_user-192        0      0    192   21    1 : ...
     memdup_user-96       168    168     96   42    1 : ...
    
    Link: https://starlabs.sg/blog/2023/07-prctl-anon_vma_name-an-amusing-heap-spray/ [1]
    Link: https://duasynt.com/blog/linux-kernel-heap-spray [2]
    Link: https://etenal.me/archives/1336 [3]
    Link: https://github.com/a13xp0p0v/kernel-hack-drill/blob/master/drill_exploit_uaf.c [4]
    Signed-off-by: Kees Cook <kees@kernel.org>
    Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

diff --git a/mm/util.c b/mm/util.c
index 28c5356b9f1c..29189f48ee04 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -198,6 +198,16 @@ char *kmemdup_nul(const char *s, size_t len, gfp_t gfp)
 }
 EXPORT_SYMBOL(kmemdup_nul);
 
+static kmem_buckets *user_buckets __ro_after_init;
+
+static int __init init_user_buckets(void)
+{
+	user_buckets = kmem_buckets_create("memdup_user", 0, 0, INT_MAX, NULL);
+
+	return 0;
+}
+subsys_initcall(init_user_buckets);
+
 /**
  * memdup_user - duplicate memory region from user space
  *
@@ -211,7 +221,7 @@ void *memdup_user(const void __user *src, size_t len)
 {
 	void *p;
 
-	p = kmalloc_track_caller(len, GFP_USER | __GFP_NOWARN);
+	p = kmem_buckets_alloc_track_caller(user_buckets, len, GFP_USER | __GFP_NOWARN);
 	if (!p)
 		return ERR_PTR(-ENOMEM);
 
@@ -237,7 +247,7 @@ void *vmemdup_user(const void __user *src, size_t len)
 {
 	void *p;
 
-	p = kvmalloc(len, GFP_USER);
+	p = kmem_buckets_valloc(user_buckets, len, GFP_USER);
 	if (!p)
 		return ERR_PTR(-ENOMEM);
 
]

453/2 2026/10/14 00:35 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 61824
							output: 41
							thoughts: 77
						

Thoughts:
Here's my analysis of the code change, from the perspective of an experienced kernel developer:

**Investigating a `kmalloc` Flag Change**

Okay, so I'm looking at this commit, `d73778e4b867`, and I notice a change in how `kmalloc` is being called. Before that commit, the code used `kmalloc_track_caller` with just `len` as the argument. Now, it's adding `GFP_USER | __GFP_NOWARN`. My immediate question is: when did those flags get introduced? They are important, so I need to find out when this change occurred. To figure this out quickly, I'm going to leverage `git log`. Specifically, I'll use `-S __GFP_NOWARN` to search the commit history for changes that *introduced* or *removed* references to that flag in `mm/util.c`. That should quickly pinpoint the commit (or commits) where this flag became relevant, and give me context on the rationale behind adding it, maybe even telling me who added the changes and why. From there, I can analyze the reasons for the changes and consider their impact on the system.



454/2 2026/10/14 00:35 tool git-log
0m Args:
map[CodeRegexp:GFP_USER \| __GFP_NOWARN Count:5 PathPrefix:mm/util.c]

Results:
map[Output:dd2a5b5514ab mm/util: make memdup_user_nul() similar to memdup_user()
d73778e4b867 mm/util: Use dedicated slab buckets for memdup_user()
6c8fcc096be9 mm: don't let userspace spam allocations warnings
]

455/2 2026/10/14 00:35 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 62289
							output: 24
							thoughts: 2036
						

Thoughts:
**Root Cause Analysis and Commit Identification**

Okay, so the crash I'm looking at stems from a user-controlled allocation size in the DRM lease creation ioctl. Essentially, `drm_mode_create_lease_ioctl()` is vulnerable because it attempts to allocate a contiguous memory block larger than `MAX_PAGE_ORDER` via the `kmalloc` family in the `fill_object_idr()` function.

The problem, as I see it, is rooted in the lack of bounds checking on `object_count`, which comes directly from user space via `cl->object_count`. This value then dictates the size of the `objects` array allocated using `kzalloc_objs()`, which expands to `kmalloc` and family. The key is that `kmalloc` uses contiguous memory, and exceeding `MAX_PAGE_ORDER` (typically 4MB) triggers a warning.  While the `object_ids` array, allocated with `memdup_array_user()` *could* fail silently if the requested size exceeds some threshold, it does not. The issue manifests where the smaller `object_ids` array allocation *succeeds*, but the subsequently larger `objects` array allocation *fails* because it needs a contiguous block larger than `MAX_PAGE_ORDER`.

The root cause is the lack of bounds check on `object_count` for the allocation size of the objects array.

Given this, I have to pinpoint the commit that introduced this vulnerability. My initial thought was `6c8fcc096be9`, because it added `__GFP_NOWARN` to `memdup_user()`, but that's a red herring.  The problem isn't with `memdup_user()`, but with the `kmalloc`-family allocation of `objects` in `fill_object_idr()`.

So, which commit introduced the problem? My primary suspect is `62884cd386b8`, the commit that introduced the ioctl itself. That's the one that brought in the `object_count` from user space, the call to `fill_object_idr()` using `kcalloc`, and the `kfree()`. `4bb2d367a5a2` is not a concern, because it merely allowed an empty lease.

I'm now considering the overflow with the array size calculations. This might be what triggers the issue with `memdup_array_user()`, or some other subtle problem. Commit `69ef943dbc14` changes the `memdup_user()` and it mentions that before that commit, multiplication could overflow, but in the case presented it doesn't. And the code is now `memdup_array_user()`. So, is `memdup_array_user()` a problem? Let me check its definition.

Looking at the code, `memdup_array_user()` is literally just `memdup_user(src, array_size(n, size))`. So, that shouldn't introduce any new issues.

Based on this, it all goes back to `62884cd386b8`!



456/2 2026/10/14 00:36 tool codesearch-definition-source
0m Args:
map[Name:memdup_array_user]

Results:
map[SourceCode:  22:	/**
  23:	 * memdup_array_user - duplicate array from user space
  24:	 * @src: source address in user space
  25:	 * @n: number of array members to copy
  26:	 * @size: size of one array member
  27:	 *
  28:	 * Return: an ERR_PTR() on failure. Result is physically
  29:	 * contiguous, to be freed by kfree().
  30:	 */
  31:	static inline __realloc_size(2, 3)
  32:	void *memdup_array_user(const void __user *src, size_t n, size_t size)
  33:	{
  34:		size_t nbytes;
  35:	
  36:		if (check_mul_overflow(n, size, &nbytes))
  37:			return ERR_PTR(-EOVERFLOW);
  38:	
  39:		return memdup_user(src, nbytes);
  40:	}
 SourceFile:include/linux/string.h]

457/2 2026/10/14 00:36 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 65317
							output: 37
							thoughts: 555
						

Thoughts:
**Analyzing Potential Memory Allocation Vulnerabilities**

Okay, so `memdup_array_user` is just a straightforward wrapper for `memdup_user`, nothing interesting there. But hang on, I need to dig deeper. I'm seeing a pattern here with these commits: `69050f8d6d07` and `32a92f8c89326`. It looks like these just swapped `kcalloc` for `kzalloc_objs`, but functionally, they are the same under the hood, since `kzalloc_objs` expands to `kmalloc_array_noprof` which, with the provided flags, is identical to `kcalloc`. This change doesn't seem to be the root cause.

Now, let's go back and look at the commit that introduced lease support, specifically `62884cd386b876638720ef88374b31a84ca7ee5f`. This is where it gets interesting! We see an allocation using `kcalloc` of `struct drm_mode_object *` based on `object_count`, and the allocation size is based on user input, and it looks like no validation or limit was applied! This could very well be where the problem was introduced.

I need to investigate further. Are there any other relevant commits, especially in `drm_lease.c` or other related areas? Could `62884cd386b8` really be the culprit? I need to know.

Now, I'm thinking about `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)` - was this a *new* warning that was introduced, or was it always a bug if `order > MAX_PAGE_ORDER` was allocated? If this check *is* new, that will help to solidify the window of the introduced bug. I should probably check `mm/page_alloc.c:5340` to confirm this.



458/2 2026/10/14 00:36 tool git-blame
0m Args:
map[End:5350 File:mm/page_alloc.c Start:5330]

Results:
map[Output:2fc4c1d51d878 5330) static inline bool alloc_order_allowed(gfp_t gfp, unsigned int order,
2fc4c1d51d878 5331) 				       unsigned int alloc_flags)
2fc4c1d51d878 5332) {
2fc4c1d51d878 5333) 	if (alloc_flags & ALLOC_NOLOCK)
2fc4c1d51d878 5334) 		return pcp_allowed_order(order);
2fc4c1d51d878 5335) 
2fc4c1d51d878 5336) 	/*
2fc4c1d51d878 5337) 	 * There are several places where we assume that the order value is sane
2fc4c1d51d878 5338) 	 * so bail out early if the request is out of bound.
2fc4c1d51d878 5339) 	 */
2fc4c1d51d878 5340) 	return !(WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp));
2fc4c1d51d878 5341) }
2fc4c1d51d878 5342) 
2fc4c1d51d878 5343) static inline bool alloc_nolock_allowed(void)
2fc4c1d51d878 5344) {
3a01af8281380 5345) 	if (!can_spin_trylock())
2fc4c1d51d878 5346) 		return false;
2fc4c1d51d878 5347) 
2fc4c1d51d878 5348) 	/* Bailout, since _deferred_grow_zone() needs to take a lock */
2fc4c1d51d878 5349) 	if (deferred_pages_enabled())
2fc4c1d51d878 5350) 		return false;
]

459/2 2026/10/14 00:36 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 66948
							output: 27
							thoughts: 19
						

Thoughts:
Okay, here's my interpretation of that request, formatted as requested:

**Deconstructing Commit 2fc4c1d51d878**

Alright, let's dive into commit 2fc4c1d51d878. Given the limited context, I'm already formulating hypotheses. Without knowing the codebase, the project, or the surrounding history, I'm going to approach this with a critical eye. I'll be looking for clues – the commit message (if present), the diff itself, the file changes, and the likely impact. My mental checklist kicks in: Are we talking bug fix, new feature, refactor, or optimization? Based on the hash I may be able to glean information from the commit in question.

My instinct tells me to isolate the functional changes. I'll ignore cosmetic changes as much as possible. I'll look for any potential regressions introduced, any obvious performance bottlenecks, and whether the code adheres to established style guidelines and best practices. I'll need to assess the maintainability of any modifications. Was this a good commit, or am I going to want to refactor it.
I'll also keep in mind whether this code may be a candidate for more scrutiny as the project grows.

Essentially, I'm mentally preparing for a deep dive, ready to dissect the changes methodically and form a concise, expert opinion on their quality and implications.



460/2 2026/10/14 00:36 tool git-show
0m Args:
map[Commit:2fc4c1d51d878]

Results:
map[Output:commit 2fc4c1d51d878bcd615774d19a97dc29ac0ce970
Author: Brendan Jackman <brendan.jackman@linux.dev>
Date:   Fri Jul 3 12:31:45 2026 +0000

    mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof()
    
    Currently the core allocator code is controlled by ALLOC_NOLOCK, but the
    main entry point function is significantly different from the normal
    __alloc_frozen_pages_nolock(), this is tiring when reading the code.
    
    Plumb the ALLOC_NOLOCK control one layer up in the call stack: create an
    alloc_flags argument to __alloc_frozen_pages_nolock() (which is only
    exposed to mm/) and then turn the nolock variant into a thin wrapper that
    just sets that flag (as well as handling NUMA_NO_NODE, similar to how some
    of the wrappers in gfp.h do).
    
    For consistency, set ALLOC_WMARK_MIN explicitly in fastpath_alloc_flags
    for the new ALLOC_NOLOCK path.  This was already "done" silently in
    __alloc_frozen_pages_nolock_noprof(): ALLOC_WMARK_MIN is 0.
    
    Rationale that this doesn't change anything:
    
    1. Simple bits: A bunch of the nolock-specific handling is just moved to
       the new alloc_order_allowed(), alloc_nolock_allowed() and
       gfp_nolock.
    
    2. __alloc_frozen_pages_noprof() has some extra logic that wasn't
       previously in the nolock variant:
    
       a. Application of gfp_allowed_mask; this only affects early boot,
          only flags that affect the slowpath get changed here, and the
          nolock allocation path isn't allowed to the GFP_BOOT_MASK flags.
    
       b. Application of current_gfp_context() - also only affects the
          slowpath
    
    3. The slowpath itself: this is now just explicitly skipped under
       !ALLOC_NOLOCK.
    
    Ulterior motive: adding an alloc_flags arg to the allocator's mm-internal
    entrypoint can later be used to do more allocation customisation without
    needing to create new GFP flags.
    
    No functional change intended.
    
    Link: https://lore.kernel.org/20260703-alloc-trylock-v5-5-c87b714e19d3@google.com
    Signed-off-by: Brendan Jackman <jackmanb@google.com>
    Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
    Acked-by: Zi Yan <ziy@nvidia.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 8ce6fe2a9a72..53c4e2ef8f6d 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1790,7 +1790,8 @@ static struct folio *alloc_buddy_frozen_folio(int order, gfp_t gfp_mask,
 	if (alloc_try_hard)
 		gfp_mask |= __GFP_RETRY_MAYFAIL;
 
-	folio = (struct folio *)__alloc_frozen_pages(gfp_mask, order, nid, nmask);
+	folio = (struct folio *)__alloc_frozen_pages(gfp_mask, order, nid, nmask,
+						     ALLOC_DEFAULT);
 
 	/*
 	 * If we did not specify __GFP_RETRY_MAYFAIL, but still got a
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 9c740324f916..41d630f0ea82 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2426,9 +2426,11 @@ static struct page *alloc_pages_preferred_many(gfp_t gfp, unsigned int order,
 	 */
 	preferred_gfp = gfp | __GFP_NOWARN;
 	preferred_gfp &= ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL);
-	page = __alloc_frozen_pages_noprof(preferred_gfp, order, nid, nodemask);
+	page = __alloc_frozen_pages_noprof(preferred_gfp, order, nid, nodemask,
+					   ALLOC_DEFAULT);
 	if (!page)
-		page = __alloc_frozen_pages_noprof(gfp, order, nid, NULL);
+		page = __alloc_frozen_pages_noprof(gfp, order, nid, NULL,
+						   ALLOC_DEFAULT);
 
 	return page;
 }
@@ -2476,7 +2478,7 @@ static struct page *alloc_pages_mpol(gfp_t gfp, unsigned int order,
 			 */
 			page = __alloc_frozen_pages_noprof(
 				gfp | __GFP_THISNODE | __GFP_NORETRY, order,
-				nid, NULL);
+				nid, NULL, ALLOC_DEFAULT);
 			if (page || !(gfp & __GFP_DIRECT_RECLAIM))
 				return page;
 			/*
@@ -2488,7 +2490,7 @@ static struct page *alloc_pages_mpol(gfp_t gfp, unsigned int order,
 		}
 	}
 
-	page = __alloc_frozen_pages_noprof(gfp, order, nid, nodemask);
+	page = __alloc_frozen_pages_noprof(gfp, order, nid, nodemask, ALLOC_DEFAULT);
 
 	if (unlikely(pol->mode == MPOL_INTERLEAVE ||
 		     pol->mode == MPOL_WEIGHTED_INTERLEAVE) && page) {
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 85cee8a0031f..f47a84855507 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5222,7 +5222,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
 		}
 		nr_account++;
 
-		prep_new_page(page, 0, gfp, 0);
+		prep_new_page(page, 0, gfp, ALLOC_DEFAULT);
 		set_page_refcounted(page);
 		page_array[nr_populated++] = page;
 	}
@@ -5271,24 +5271,99 @@ void free_pages_bulk(struct page **page_array, unsigned long nr_pages)
 	}
 }
 
+static inline bool alloc_order_allowed(gfp_t gfp, unsigned int order,
+				       unsigned int alloc_flags)
+{
+	if (alloc_flags & ALLOC_NOLOCK)
+		return pcp_allowed_order(order);
+
+	/*
+	 * There are several places where we assume that the order value is sane
+	 * so bail out early if the request is out of bound.
+	 */
+	return !(WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp));
+}
+
+static inline bool alloc_nolock_allowed(void)
+{
+	/*
+	 * In PREEMPT_RT spin_trylock() will call raw_spin_lock() which is
+	 * unsafe in NMI. If spin_trylock() is called from hard IRQ the current
+	 * task may be waiting for one rt_spin_lock, but rt_spin_trylock() will
+	 * mark the task as the owner of another rt_spin_lock which will
+	 * confuse PI logic, so return immediately if called from hard IRQ or
+	 * NMI.
+	 *
+	 * Note, irqs_disabled() case is ok. This function can be called
+	 * from raw_spin_lock_irqsave region.
+	 */
+	if (IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq()))
+		return false;
+
+	/* On UP, spin_trylock() always succeeds even when it is locked */
+	if (!IS_ENABLED(CONFIG_SMP) && in_nmi())
+		return false;
+
+	/* Bailout, since _deferred_grow_zone() needs to take a lock */
+	if (deferred_pages_enabled())
+		return false;
+
+	return true;
+}
+
+/*
+ * GFP flags to set for ALLOC_NOLOCK i.e. alloc_pages_nolock().
+ *
+ * Do not specify __GFP_DIRECT_RECLAIM, since direct claim is not allowed.
+ * Do not specify __GFP_KSWAPD_RECLAIM either, since wake up of kswapd
+ * is not safe in arbitrary context.
+ *
+ * These two are the conditions for gfpflags_allow_spinning() being true.
+ *
+ * Specify __GFP_NOWARN since failing alloc_pages_nolock() is not a reason
+ * to warn. Also warn would trigger printk() which is unsafe from
+ * various contexts. We cannot use printk_deferred_enter() to mitigate,
+ * since the running context is unknown.
+ *
+ * Specify __GFP_ZERO to make sure that call to kmsan_alloc_page() below
+ * is safe in any context. Also zeroing the page is mandatory for
+ * BPF use cases.
+ *
+ * Though __GFP_NOMEMALLOC is not checked in the code path below,
+ * specify it here to highlight that alloc_pages_nolock()
+ * doesn't want to deplete reserves.
+ */
+static const gfp_t gfp_nolock = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC |
+				__GFP_COMP;
+
 /*
  * This is the 'heart' of the zoned buddy allocator.
  */
 struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
-		int preferred_nid, nodemask_t *nodemask)
+		int preferred_nid, nodemask_t *nodemask, unsigned int alloc_flags)
 {
 	struct page *page;
-	unsigned int fastpath_alloc_flags = ALLOC_WMARK_LOW;
 	gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */
 	struct alloc_context ac = { };
+	unsigned int fastpath_alloc_flags = alloc_flags;
 
-	/*
-	 * There are several places where we assume that the order value is sane
-	 * so bail out early if the request is out of bound.
-	 */
-	if (WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp))
+	/* Other flags could be supported later if needed. */
+	if (WARN_ON(alloc_flags & ~ALLOC_NOLOCK))
 		return NULL;
 
+	if (!alloc_order_allowed(gfp, order, alloc_flags))
+		return NULL;
+
+	if (alloc_flags & ALLOC_NOLOCK) {
+		VM_WARN_ON_ONCE(gfp & ~__GFP_ACCOUNT);
+		if (!alloc_nolock_allowed())
+			return NULL;
+		gfp |= gfp_nolock;
+		fastpath_alloc_flags |= ALLOC_WMARK_MIN;
+	} else {
+		fastpath_alloc_flags |= ALLOC_WMARK_LOW;
+	}
+
 	gfp &= gfp_allowed_mask;
 	/*
 	 * Apply scoped allocation constraints. This is mainly about GFP_NOFS
@@ -5303,16 +5378,19 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 			&alloc_gfp, &fastpath_alloc_flags))
 		return NULL;
 
-	/*
-	 * Forbid the first pass from falling back to types that fragment
-	 * memory until all local zones are considered.
-	 */
-	fastpath_alloc_flags |= alloc_flags_nofragment(zonelist_zone(ac.preferred_zoneref), gfp);
+	if (!(alloc_flags & ALLOC_NOLOCK)) {
+		/*
+		 * Forbid the first pass from falling back to types that
+		 * fragment memory until all local zones are considered.
+		 */
+		fastpath_alloc_flags |= alloc_flags_nofragment(
+			zonelist_zone(ac.preferred_zoneref), gfp);
+	}
 	fastpath_alloc_flags |= alloc_flags_nonblocking(gfp, order) & ALLOC_HIGHATOMIC;
 
-	/* First allocation attempt */
+	/* First allocation attempt (or, for nolock, only attempt) */
 	page = get_page_from_freelist(alloc_gfp, order, fastpath_alloc_flags, &ac);
-	if (likely(page))
+	if (likely(page) || (alloc_flags & ALLOC_NOLOCK))
 		goto out;
 
 	alloc_gfp = gfp;
@@ -5329,7 +5407,8 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 out:
 	if (memcg_kmem_online() && (gfp & __GFP_ACCOUNT) && page &&
 	    unlikely(__memcg_kmem_charge_page(page, gfp, order) != 0)) {
-		free_frozen_pages(page, order);
+		__free_frozen_pages(page, order,
+				    alloc_flags & ALLOC_NOLOCK ? FPI_TRYLOCK : 0);
 		page = NULL;
 	}
 
@@ -5345,7 +5424,8 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
 {
 	struct page *page;
 
-	page = __alloc_frozen_pages_noprof(gfp, order, preferred_nid, nodemask);
+	page = __alloc_frozen_pages_noprof(gfp, order, preferred_nid, nodemask,
+					   ALLOC_DEFAULT);
 	if (page)
 		set_page_refcounted(page);
 	return page;
@@ -7875,80 +7955,10 @@ static bool __free_unaccepted(struct page *page)
 
 struct page *alloc_frozen_pages_nolock_noprof(gfp_t gfp_flags, int nid, unsigned int order)
 {
-	/*
-	 * Do not specify __GFP_DIRECT_RECLAIM, since direct claim is not allowed.
-	 * Do not specify __GFP_KSWAPD_RECLAIM either, since wake up of kswapd
-	 * is not safe in arbitrary context.
-	 *
-	 * These two are the conditions for gfpflags_allow_spinning() being true.
-	 *
-	 * Specify __GFP_NOWARN since failing alloc_pages_nolock() is not a reason
-	 * to warn. Also warn would trigger printk() which is unsafe from
-	 * various contexts. We cannot use printk_deferred_enter() to mitigate,
-	 * since the running context is unknown.
-	 *
-	 * Specify __GFP_ZERO to make sure that call to kmsan_alloc_page() below
-	 * is safe in any context. Also zeroing the page is mandatory for
-	 * BPF use cases.
-	 *
-	 * Though __GFP_NOMEMALLOC is not checked in the code path below,
-	 * specify it here to highlight that alloc_pages_nolock()
-	 * doesn't want to deplete reserves.
-	 */
-	gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC | __GFP_COMP
-			| gfp_flags;
-	unsigned int alloc_flags = ALLOC_NOLOCK;
-	struct alloc_context ac = { };
-	struct page *page;
-
-	VM_WARN_ON_ONCE(gfp_flags & ~__GFP_ACCOUNT);
-	/*
-	 * In PREEMPT_RT spin_trylock() will call raw_spin_lock() which is
-	 * unsafe in NMI. If spin_trylock() is called from hard IRQ the current
-	 * task may be waiting for one rt_spin_lock, but rt_spin_trylock() will
-	 * mark the task as the owner of another rt_spin_lock which will
-	 * confuse PI logic, so return immediately if called from hard IRQ or
-	 * NMI.
-	 *
-	 * Note, irqs_disabled() case is ok. This function can be called
-	 * from raw_spin_lock_irqsave region.
-	 */
-	if (IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq()))
-		return NULL;
-
-	/* On UP, spin_trylock() always succeeds even when it is locked */
-	if (!IS_ENABLED(CONFIG_SMP) && in_nmi())
-		return NULL;
-
-	if (!pcp_allowed_order(order))
-		return NULL;
-
-	/* Bailout, since _deferred_grow_zone() needs to take a lock */
-	if (deferred_pages_enabled())
-		return NULL;
-
 	if (nid == NUMA_NO_NODE)
 		nid = numa_node_id();
 
-	prepare_alloc_pages(alloc_gfp, order, nid, NULL, &ac,
-			    &alloc_gfp, &alloc_flags);
-
-	/*
-	 * Best effort allocation from percpu free list.
-	 * If it's empty attempt to spin_trylock zone->lock.
-	 */
-	page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac);
-
-	/* Unlike regular alloc_pages() there is no __alloc_pages_slowpath(). */
-
-	if (memcg_kmem_online() && page && (gfp_flags & __GFP_ACCOUNT) &&
-	    unlikely(__memcg_kmem_charge_page(page, alloc_gfp, order) != 0)) {
-		__free_frozen_pages(page, order, FPI_TRYLOCK);
-		page = NULL;
-	}
-	trace_mm_page_alloc(page, order, alloc_gfp, ac.migratetype);
-	kmsan_alloc_page(page, order, alloc_gfp);
-	return page;
+	return __alloc_frozen_pages_noprof(gfp_flags, order, nid, NULL, ALLOC_NOLOCK);
 }
 /**
  * alloc_pages_nolock - opportunistic reentrant allocation from any context
diff --git a/mm/page_alloc.h b/mm/page_alloc.h
index 3250d44f9645..a4f4b325381a 100644
--- a/mm/page_alloc.h
+++ b/mm/page_alloc.h
@@ -11,6 +11,7 @@
 #include <linux/nodemask.h>
 #include <linux/types.h>
 
+#define ALLOC_DEFAULT		0
 /* The ALLOC_WMARK bits are used as an index to zone->watermark */
 #define ALLOC_WMARK_MIN		WMARK_MIN
 #define ALLOC_WMARK_LOW		WMARK_LOW
@@ -219,7 +220,7 @@ extern bool free_pages_prepare(struct page *page, unsigned int order);
 extern int user_min_free_kbytes;
 
 struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order, int nid,
-		nodemask_t *nodemask);
+		nodemask_t *nodemask, unsigned int alloc_flags);
 #define __alloc_frozen_pages(...) \
 	alloc_hooks(__alloc_frozen_pages_noprof(__VA_ARGS__))
 void free_frozen_pages(struct page *page, unsigned int order);
@@ -230,7 +231,8 @@ struct page *alloc_frozen_pages_noprof(gfp_t, unsigned int order);
 #else
 static inline struct page *alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order)
 {
-	return __alloc_frozen_pages_noprof(gfp, order, numa_node_id(), NULL);
+	return __alloc_frozen_pages_noprof(gfp, order, numa_node_id(), NULL,
+					   ALLOC_DEFAULT);
 }
 #endif
 
diff --git a/mm/slub.c b/mm/slub.c
index 1362a1f8f05c..85599d227b9b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3264,7 +3264,8 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node,
 	else if (node == NUMA_NO_NODE)
 		page = alloc_frozen_pages(flags, order);
 	else
-		page = __alloc_frozen_pages(flags, order, node, NULL);
+		page = __alloc_frozen_pages(flags, order, node, NULL,
+					    ALLOC_DEFAULT);
 
 	if (!page)
 		return NULL;
@@ -5274,7 +5275,8 @@ static void *___kmalloc_large_node(size_t size, gfp_t flags, int node)
 	if (node == NUMA_NO_NODE)
 		page = alloc_frozen_pages_noprof(flags, order);
 	else
-		page = __alloc_frozen_pages_noprof(flags, order, node, NULL);
+		page = __alloc_frozen_pages_noprof(flags, order, node, NULL,
+						   ALLOC_DEFAULT);
 
 	if (page) {
 		ptr = page_address(page);
]

461/2 2026/10/14 00:36 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 72939
							output: 21
							thoughts: 274
						

Thoughts:
**My Analysis of a Potential Kernel Vulnerability**

Okay, so before commit `2fc4c1d51d878`, the code snippet related to memory allocation sanity checks in the kernel was already present:

```c
	/*
	 * There are several places where we assume that the order value is sane
	 * so bail out early if the request is out of bound.
	 */
	if (WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp))
		return NULL;
```

This is crucial. We're already checking for `order > MAX_PAGE_ORDER` with `WARN_ON_ONCE_GFP`, which is good practice. The core issue here is that any function that calls `page_alloc` with an `order` greater than `MAX_PAGE_ORDER` *without* the `__GFP_NOWARN` flag will trigger a warning. That in itself is not an issue.

However, a warning triggered by user-controllable input *could* indicate a denial-of-service (DOS) vulnerability. My instincts tell me that it's probably an ioctl, and if that's the case, we're looking at a bug, and my suspicion is pointing to `drivers/gpu/drm/drm_lease.c`! I know the DRI code well, and user access there is a common place to find issues.

Now, let's slow down and be methodical. The first thing I should do is check the `Fixes:` line in similar commits or other commits within the DRM lease subsystem. This will quickly tell me if this issue has been previously addressed. It's a key first step.

Next, I need to know: has there been an *official* upstream commit that addresses this specific bug? I'll search the git log, the Linux kernel mailing list (lore), and carefully scrutinize commit messages, looking for either the text of the patch itself or any explanation that seems relevant.

Finally, just in case, I should do some sleuthing. I'll grep the entire kernel source for `vmemdup_array_user`. This will help determine where this user-space memory duplication function was added and possibly narrow down where it is used. This can help with tracking down how the user might be able to influence the `order` parameter.



462/2 2026/10/14 00:36 tool grepper
0m Args:
map[Expression:vmemdup_array_user]

Results:
map[Output:arch/x86/kvm/cpuid.c=590=int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
--
arch/x86/kvm/cpuid.c-601-	if (cpuid->nent) {
arch/x86/kvm/cpuid.c:602:		e = vmemdup_array_user(entries, cpuid->nent, sizeof(*e));
arch/x86/kvm/cpuid.c-603-		if (IS_ERR(e))
--
arch/x86/kvm/cpuid.c=635=int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
--
arch/x86/kvm/cpuid.c-645-	if (cpuid->nent) {
arch/x86/kvm/cpuid.c:646:		e2 = vmemdup_array_user(entries, cpuid->nent, sizeof(*e2));
arch/x86/kvm/cpuid.c-647-		if (IS_ERR(e2))
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c=164=amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in)
--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-174-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c:175:	return vmemdup_array_user(uptr, bo_number,
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c-176-				  sizeof(struct drm_amdgpu_bo_list_entry));
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c=179=static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
--
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-219-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:220:		p->chunks[i].kdata = vmemdup_array_user(u64_to_user_ptr(user_chunk.chunk_data),
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c-221-							size,
--
drivers/gpu/drm/drm_gem.c=832=int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
--
drivers/gpu/drm/drm_gem.c-847-
drivers/gpu/drm/drm_gem.c:848:	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
drivers/gpu/drm/drm_gem.c-849-	if (IS_ERR(handles)) {
--
drivers/tty/vt/consolemap.c=632=int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
--
drivers/tty/vt/consolemap.c-640-
drivers/tty/vt/consolemap.c:641:	struct unipair *unilist __free(kvfree) = vmemdup_array_user(list, ct, sizeof(*unilist));
drivers/tty/vt/consolemap.c-642-	if (IS_ERR(unilist))
--
include/linux/string.h=32=void *memdup_array_user(const void __user *src, size_t n, size_t size)
--
include/linux/string.h-42-/**
include/linux/string.h:43: * vmemdup_array_user - duplicate array from user space
include/linux/string.h-44- * @src: source address in user space
--
include/linux/string.h=51=static inline __realloc_size(2, 3)
include/linux/string.h:52:void *vmemdup_array_user(const void __user *src, size_t n, size_t size)
include/linux/string.h-53-{
--
virt/kvm/kvm_main.c=5177=static long kvm_vm_ioctl(struct file *filp,
--
virt/kvm/kvm_main.c-5344-			urouting = argp;
virt/kvm/kvm_main.c:5345:			entries = vmemdup_array_user(urouting->entries,
virt/kvm/kvm_main.c-5346-						     routing.nr, sizeof(*entries));
]

463/2 2026/10/14 00:36 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 74948
							output: 44
							thoughts: 35
						

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

**Investigating Gem Object Creation and User-Space Interaction**

Alright, let's dive in. I'm trying to trace the lifecycle of DRM GEM objects within the kernel, specifically focusing on when they're looked up or initialized from user-space memory. The goal is to pinpoint potential areas for optimization, security analysis, or simply to understand the object management flow more deeply. I need to see precisely when `drm_gem_objects_lookup` or `vmemdup_array_user` are invoked within `drm_gem.c`. These two functions are key indicators: `drm_gem_objects_lookup` suggests a retrieval of pre-existing GEM objects, which implies shared memory access, while `vmemdup_array_user` is a strong signal that user space data is being copied into kernel structures, either to create new or initialize existing objects. I expect that tracking those calls will lead me toward areas which have potential performance and security implications.



464/2 2026/10/14 00:36 tool git-log
0m Error:
log-in to see details

Args:
map[Count:5 PathPrefix:drivers/gpu/drm/drm_gem.c SymbolName:drm_gem_objects_lookup]

Results:
map[Output:]

465/2 2026/10/14 00:36 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 75266
							output: 44
							thoughts: 15
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, presented in the first person:

**Analyzing the DRM GEM Commit**

Alright, let's dive in. My mind is immediately drawn to the commit related to `drm_gem.c` with the `SourcePath` – essentially, I'm keen to see what's being done at the core of the Direct Rendering Manager's Graphics Execution Manager (GEM) layer. This immediately raises a few questions: Is this a bug fix, performance optimization, or a functional addition? The context of the change is going to be crucial here.

Specifically, I'm thinking:

*   **Sourcepath**: What's the context for this path? Is it for debug, tracing, or perhaps a new driver-specific implementation? Is it a way to more specifically deal with an error?

*   **DRM GEM:** What part of DRM GEM is being affected? Are we talking about object allocation/management, fencing, eviction, or something deeper, like memory pinning or mapping? I hope this isn't just a basic refactoring.

I need to quickly assess the impact and novelty of this change. Is this a common pattern, or is it an edge case being addressed? How does this change interact with the rest of the DRM stack, particularly the memory manager? Does the change touch user-space APIs in any way?

I'll be looking closely at the diff. I'll need to immediately grok the code that's added or removed. What are the key data structures involved? Is it thread-safe? The quality of the commit message is critical, of course, because that's where I expect to find the rationale and context for the change. I hope this commit isn't introducing subtle regressions. Let's see...



466/2 2026/10/14 00:36 tool git-log
0m Args:
map[Count:5 SourcePath:drivers/gpu/drm/drm_gem.c SymbolName:drm_gem_objects_lookup]

Results:
map[Output:8b85987d3cf5 Merge drm/drm-next into drm-misc-next
dbce431756f8 drm/gem: Make drm_gem_objects_lookup() self-cleaning on failure v6
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
922682d48d62 drm/gem: Correct error condition in drm_gem_objects_lookup
cb77b79abf5f drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
]

467/2 2026/10/14 00:36 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 75861
							output: 25
							thoughts: 17
						

Thoughts:
Okay, here's my interpretation of that request, formatted as requested:

**Deconstructing `cb77b79abf5f`**

Alright, let's dive into this specific hash, `cb77b79abf5f`. My initial instinct is to treat this as potentially something critical. Given the context, this is most likely a commit hash, a transaction ID, or some sort of unique identifier within a system. I need to understand its significance. Is it from a version control system? A database? Is this a public identifier or a private one? The format itself suggests a hexadecimal string, which is common for these types of identifiers, but I can't jump to conclusions. I need to consider all possibilities and I need to start figuring out what to do with this. I'll need to know which platform or system this belongs to. I might need to run it against a database, a repository, or a search engine. The specifics here are key to uncovering its meaning, and where it fits into the broader picture.



468/2 2026/10/14 00:36 tool git-show
0m Args:
map[Commit:cb77b79abf5f]

Results:
map[Output:commit cb77b79abf5ff8f4af07f7ebef196a003c826b7a
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date:   Wed Nov 12 09:27:32 2025 +0000

    drm/gem: Use vmemdup_array_user in drm_gem_objects_lookup
    
    Use a helper to shrink the code and separate the user and kernel slabs for
    better security.
    
    While at it lets remove the useless debug message.
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Reviewed-by: AndrΓ© Almeida <andrealmeid@igalia.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://lore.kernel.org/r/20251112092732.23584-1-tvrtko.ursulin@igalia.com

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index a1a9c828938b..68168d58a7c8 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -783,7 +783,6 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
 int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 			   int count, struct drm_gem_object ***objs_out)
 {
-	struct drm_device *dev = filp->minor->dev;
 	struct drm_gem_object **objs;
 	u32 *handles;
 	int ret;
@@ -798,15 +797,9 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
 
 	*objs_out = objs;
 
-	handles = kvmalloc_array(count, sizeof(u32), GFP_KERNEL);
-	if (!handles) {
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	if (copy_from_user(handles, bo_handles, count * sizeof(u32))) {
-		ret = -EFAULT;
-		drm_dbg_core(dev, "Failed to copy in GEM handles\n");
+	handles = vmemdup_array_user(bo_handles, count, sizeof(u32));
+	if (IS_ERR(handles)) {
+		ret = PTR_ERR(handles);
 		goto out;
 	}
 
]

469/2 2026/10/14 00:36 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 76839
							output: 42
							thoughts: 2476
						

Thoughts:
**Root Cause Analysis and Patch Verification**

Okay, let's break this down. The kernel is crashing because a user-controlled value, `object_count`, is not properly bounded when used to allocate a contiguous memory block in the DRM lease creation ioctl. This leads to an attempted allocation order exceeding `MAX_PAGE_ORDER`, specifically when calling `kzalloc_objs` (which expands to a `kmalloc`-family call) inside `fill_object_idr`. The `object_count` variable comes directly from userspace, specifically from the `drm_mode_create_lease` struct in `drm_mode_create_lease_ioctl`, and previously lacked a maximum bound.

Now, let's analyze this patch. It introduces a check: `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))`. This looks like the solution! It's an integer overflow check to prevent `object_count` from becoming too large and causing an enormous allocation. This check is added inside the `drm_mode_create_lease_ioctl` function, before the allocation occurs. This change is a good start.

The patch also changed:
- `kzalloc_objs` to `kvzalloc_objs` (and `kfree` to `kvfree`). `kvzalloc` should prevent this issue.
- `memdup_array_user` to `vmemdup_array_user`. The `vmemdup_array_user` does bounds checking.

Now, let's confirm the code history. I know that the `fill_object_idr` function, and its allocations, were introduced in commit `62884cd386b8`. This initial commit used `kcalloc` to allocate `objects` and `memdup_user` for `object_ids`. Subsequent commits then modified the allocations as described previously in this patch.

I also see that `object_count` was *not* explicitly checked against a maximum at any point before this patch, by examining the Git log with `-S object_count`.  This confirms the root cause: an unbounded `object_count` allowed the allocation size to become too large. It's also interesting to trace the evolution of `memdup_user` and `kcalloc` into their current forms.

The changes in this patch seem correct: the integer overflow check on `object_count`, and the use of the appropriate `kvzalloc/vmemdup_array_user` functions, should prevent this crash.



470/2 2026/10/14 00:37 tool git-log
0m Args:
map[CodeRegexp:object_count Count:20 PathPrefix:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
f37d63e219c3 drm_lease.c: copy user-array safely
4bb2d367a5a2 drm/lease: allow empty leases
69ef943dbc14 drm: Use array_size() when creating lease
968029057192 drm/lease: look at ->universal_planes only once
a0c1af46e9d7 drm/lease: debug output for lease creation
62884cd386b8 drm: Add four ioctls for managing drm mode object leases [v7]
]

471/2 2026/10/14 00:37 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 80106
							output: 27
							thoughts: 477
						

Thoughts:
**Analyzing the Scope of `object_count` Usage**

Okay, so `object_count` has only popped up in these eight commits. That's a manageable set to review, and it's good practice to ensure I understand its behavior across the codebase. Let's delve into each one:

1.  `32a92f8c8932`: This commit is simply refactoring, shifting from `kzalloc_objs` with explicit `GFP_KERNEL` to a default parameter. No functional changes here, the underlying memory allocation logic or flags aren't altered by this. That's straightforward.

2.  `69050f8d6d07`: This looks like another straightforward replacement for `kcalloc` with `kzalloc_objs` for non-scalar types. Again, no modifications to the allocation logic, size calculation is identical. Okay, moving on.

3.  `f37d63e219c3`: It seems like it's a safe replacement. `memdup_user` is switched to `memdup_array_user`. There is no change in logic, which is great to see.

4.  `4bb2d367a5a2`: This is where things get a bit more interesting, though it is not too critical. A check related to `object_count` being zero was removed, and a condition check was added. The core functionality shouldn't be impacted with large values of `object_count`. This is a fine change.

5.  `69ef943dbc14`: Aha, another use of `array_size`. This commit is just a small refactor to be clearer.

6.  `968029057192`: Now, I want to see what this commit is all about...



472/2 2026/10/14 00:37 tool git-show
0m Args:
map[Commit:968029057192]

Results:
map[Output:commit 968029057192e46dd78e807b81c2aba2d7648c38
Author: Simona Vetter <simona.vetter@ffwll.ch>
Date:   Mon Nov 5 11:12:11 2018 +0100

    drm/lease: look at ->universal_planes only once
    
    It's lockless, and userspace might chance it underneath us. That's not
    really a problem, all userspace gets is a slightly dysfunctional
    lease with the current code. But this might change, and gcc might
    decide to reload a few too many times, and then boom. So better safe
    than sorry.
    
    v2: Remove the now unused lessor_priv argument from validate_lease()
    (Keith).
    
    v3: Actually add everything ... silly me.
    
    Cc: Keith Packard <keithp@keithp.com>
    Cc: Dave Airlie <airlied@gmail.com>
    Acked-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20181105101211.22737-1-daniel.vetter@ffwll.ch

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 4cfd8fe25536..3b367e07c87e 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -353,9 +353,9 @@ void drm_lease_revoke(struct drm_master *top)
 }
 
 static int validate_lease(struct drm_device *dev,
-			  struct drm_file *lessor_priv,
 			  int object_count,
-			  struct drm_mode_object **objects)
+			  struct drm_mode_object **objects,
+			  bool universal_planes)
 {
 	int o;
 	int has_crtc = -1;
@@ -372,14 +372,14 @@ static int validate_lease(struct drm_device *dev,
 		if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
 			has_connector = o;
 
-		if (lessor_priv->universal_planes) {
+		if (universal_planes) {
 			if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
 				has_plane = o;
 		}
 	}
 	if (has_crtc == -1 || has_connector == -1)
 		return -EINVAL;
-	if (lessor_priv->universal_planes && has_plane == -1)
+	if (universal_planes && has_plane == -1)
 		return -EINVAL;
 	return 0;
 }
@@ -393,6 +393,8 @@ static int fill_object_idr(struct drm_device *dev,
 	struct drm_mode_object **objects;
 	u32 o;
 	int ret;
+	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
+
 	objects = kcalloc(object_count, sizeof(struct drm_mode_object *),
 			  GFP_KERNEL);
 	if (!objects)
@@ -421,7 +423,7 @@ static int fill_object_idr(struct drm_device *dev,
 		}
 	}
 
-	ret = validate_lease(dev, lessor_priv, object_count, objects);
+	ret = validate_lease(dev, object_count, objects, universal_planes);
 	if (ret) {
 		DRM_DEBUG_LEASE("lease validation failed\n");
 		goto out_free_objects;
@@ -448,7 +450,7 @@ static int fill_object_idr(struct drm_device *dev,
 					object_id, ret);
 			goto out_free_objects;
 		}
-		if (obj->type == DRM_MODE_OBJECT_CRTC && !lessor_priv->universal_planes) {
+		if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 			struct drm_crtc *crtc = obj_to_crtc(obj);
 			ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 			if (ret < 0) {
]

473/2 2026/10/14 00:37 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 82223
							output: 26
							thoughts: 50
						

Thoughts:
Okay, let's dive into this commit, `a0c1af46e9d7`. I need to understand what this "drm/lease: debug output for lease creation" actually entails. It sounds like it's adding some logging to the lease creation process within the DRM (Direct Rendering Manager) subsystem.

So, I need to get into the details of this change. I'll need to analyze the patch to see exactly what debug output has been added, and where. I'll be looking for the specific `printk` calls, the level of logging, and the information being dumped. I'll want to assess the impact on performance and identify if there is any potential for sensitive data being exposed. I should check how this output relates to other existing debug mechanisms and whether it integrates with the overall DRM debugging strategy. This is a critical area for ensuring smooth operation of graphics drivers, so any additions should be carefully evaluated for their utility, performance impact, and appropriateness. I'll also want to determine the context. Is this for development, or is it going into a release build? If the latter, are there conditional compilation macros to disable it in production?

I'm ready to dig into the diff and get to the bottom of this.



474/2 2026/10/14 00:37 tool git-show
0m Args:
map[Commit:a0c1af46e9d7]

Results:
map[Output:commit a0c1af46e9d71fdae7df904b91542ce2518382a1
Author: Simona Vetter <simona.vetter@ffwll.ch>
Date:   Fri Nov 2 14:25:41 2018 +0100

    drm/lease: debug output for lease creation
    
    I spent a bit of time scratching heads and figuring out why the igts
    don't work. Probably useful to keep this work.
    
    Cc: Keith Packard <keithp@keithp.com>
    Cc: Dave Airlie <airlied@gmail.com>
    Acked-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20181102132543.16486-1-daniel.vetter@ffwll.ch

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 977f069f6d90..4cfd8fe25536 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -415,14 +415,17 @@ static int fill_object_idr(struct drm_device *dev,
 		}
 
 		if (!drm_mode_object_lease_required(objects[o]->type)) {
+			DRM_DEBUG_KMS("invalid object for lease\n");
 			ret = -EINVAL;
 			goto out_free_objects;
 		}
 	}
 
 	ret = validate_lease(dev, lessor_priv, object_count, objects);
-	if (ret)
+	if (ret) {
+		DRM_DEBUG_LEASE("lease validation failed\n");
 		goto out_free_objects;
+	}
 
 	/* add their IDs to the lease request - taking into account
 	   universal planes */
@@ -505,15 +508,21 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EOPNOTSUPP;
 
 	/* Do not allow sub-leases */
-	if (lessor->lessor)
+	if (lessor->lessor) {
+		DRM_DEBUG_LEASE("recursive leasing not allowed\n");
 		return -EINVAL;
+	}
 
 	/* need some objects */
-	if (cl->object_count == 0)
+	if (cl->object_count == 0) {
+		DRM_DEBUG_LEASE("no objects in lease\n");
 		return -EINVAL;
+	}
 
-	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK)))
+	if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
+		DRM_DEBUG_LEASE("invalid flags\n");
 		return -EINVAL;
+	}
 
 	object_count = cl->object_count;
 
@@ -528,6 +537,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 			      object_count, object_ids);
 	kfree(object_ids);
 	if (ret) {
+		DRM_DEBUG_LEASE("lease object lookup failed: %i\n", ret);
 		idr_destroy(&leases);
 		return ret;
 	}
]

475/2 2026/10/14 00:37 llm fixes-finder
0m Model:
gemini-3.8-flash

Tokens:
							input: 83502
							output: 53
							thoughts: 1764
						

Thoughts:
**Analysis of the Unbounded Allocation in DRM Lease Creation**

Okay, let's break this down. My initial focus is on commit `62884cd386b8` ("drm: Add four ioctls for managing drm mode object leases [v7]"). This commit is where `drm_mode_create_lease_ioctl` and `fill_object_idr` were introduced. I immediately see the direct assignment of `cl->object_count` to `object_count`: `object_count = cl->object_count;` and then `object_ids = memdup_user(...)`, followed by a call to `fill_object_idr()`. Inside `fill_object_idr()`, `objects = kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL);` is called.

The key observation is that when `object_count` is large (say, 1,000,000), this `objects` allocation requests an order 11 memory block, which exceeds `MAX_PAGE_ORDER` and triggers a warning because `kcalloc()` does not have the `__GFP_NOWARN` flag. The memory is then freed with `kfree(objects);`. This looks like a potential vulnerability due to the user-controlled size.

I needed to make sure I had the right commit, so I quickly double-checked the commit hash. It is indeed `62884cd386b876638720ef88374b31a84ca7ee5f`, which is the one I wanted. I initially wondered if `2ed077e467eedb033032bc4b6e349365517662d6` might be it but a quick `git log -S fill_object_idr` check shows it's not related. I verified with `git log` that the commit title, the changes, and the hash all match.

The next step was to consider if other commits, such as `f37d63e219c3` (which changed `memdup_user` to `memdup_array_user`), might have introduced this issue. The explanation states that `memdup_array_user()` *uses* `memdup_user()`, which can silently fail if allocation is too big (using `__GFP_NOWARN`). However, the real problem is the subsequent allocation of the `objects` array using `kcalloc()`. I looked at previous commits and confirmed that, before `f37d63e219c3`, the problematic `memdup_user` and `kcalloc` calls were already present.

I checked earlier versions and verified that the unbounded allocation issue has existed from the very beginning, with the introduction of `drm_mode_create_lease_ioctl` and `fill_object_idr` in commit `62884cd386b8`.

The bug description confirms this: the unbounded user-controlled allocation size in the DRM lease creation ioctl is the source, and `object_count` comes directly from the user-space and is not checked. That is, the bug was introduced when the DRM lease creation ioctl was first written!

Therefore, I'm confident that the root cause lies within commit `62884cd386b876638720ef88374b31a84ca7ee5f`. I then re-confirmed the commit details: `drm: Add four ioctls for managing drm mode object leases [v7]` by Keith Packard.



476/2 2026/10/14 00:37 tool set-results
0m Args:
map[FixesHash:62884cd386b876638720ef88374b31a84ca7ee5f]

Results:
map[FixesHash:62884cd386b876638720ef88374b31a84ca7ee5f]

477/1 2026/10/14 00:37 action format-fixes
0m Results:
map[Fixes:map[AuthorEmail:keithp@keithp.com AuthorName:Keith Packard Hash:62884cd386b876638720ef88374b31a84ca7ee5f Title:drm: Add four ioctls for managing drm mode object leases [v7]]]

478/1 2026/10/14 00:37 action get-maintainers
0m Results:
map[Recipients:[map[Email:airlied@gmail.com Name:David Airlie To:true] map[Email:dri-devel@lists.freedesktop.org Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:maarten.lankhorst@linux.intel.com Name:Maarten Lankhorst To:true] map[Email:mripard@kernel.org Name:Maxime Ripard To:true] map[Email:simona@ffwll.ch Name:Simona Vetter To:true] map[Email:tzimmermann@suse.de Name:Thomas Zimmermann To:true] map[Email:keithp@keithp.com Name:Keith Packard To:true]]]

479/1 2026/10/14 00:37 action get-recent-commits
0m Results:
map[RecentCommits:Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
drm_lease.c: copy user-array safely
drm: Remove unnecessary include statements for drm_crtc_helper.h
drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
drm/lease: allow empty leases
drm: clean up unused kerneldoc in drm_lease.c
drm: clarify usage of drm leases
drm: protect drm_master pointers in drm_lease.c
drm: Don't include drm_legacy.h in drm_lease.c
drm : Insert blank lines after declarations.
drm/lease: fix WARNING in idr_destroy
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
drm: drop use of drmP.h in drm/*
drm/lease: Check for lessor outside of locks
drm/lease: Drop recursive leads checks
drm/leases: Drop object_id validation for negative ids
drm: Use array_size() when creating lease
drm: Rename crtc_idr as object_idr to KMS cleanups
drm/lease: Send a distinct uevent
]

480/1 2026/10/14 00:37 agent description-generator
2m Model:
core

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:

------------[ cut here ]------------
WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline], CPU#1: syz.0.17/7032
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397, CPU#1: syz.0.17/7032
Modules linked in:
CPU: 1 UID: 0 PID: 7032 Comm: syz.0.17 Not tainted syzkaller #1 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : alloc_order_allowed mm/page_alloc.c:5340 [inline]
pc : __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
lr : __alloc_frozen_pages_noprof+0xa8/0x640 mm/page_alloc.c:5388
sp : ffff80009d2e7580
x29: ffff80009d2e7650 x28: ffff700013a5cf18 x27: ffff80009d2e75a0
x26: 1ffff0001302e474 x25: dfff800000000000 x24: ffff700013a5ceb4
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000040dc0
x20: 0000000000000000 x19: 000000000000000b x18: 00000000ffffffff
x17: 0000000000000000 x16: ffff80008b5b9788 x15: 0000000000000005
x14: 1ffff00013a5ceb8 x13: 0000000000000000 x12: 0000000000000000
x11: ffff700013a5cebd x10: dfff800000000000 x9 : 0000000000000001
x8 : ffff8000939c7000 x7 : 0000000000000000 x6 : ffff0000e8bd0900
x5 : ffff0000e8bd0900 x4 : 0000000000000000 x3 : 0000000000000020
x2 : 0000000000000008 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline] (P)
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397 (P)
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 __do_kmalloc_node mm/slub.c:5402 [inline]
 __kmalloc_noprof+0x3ec/0x6bc mm/slub.c:5439
 _kmalloc_noprof include/linux/slab.h:995 [inline]
 _kzalloc_noprof include/linux/slab.h:1312 [inline]
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:583
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758
 el0t_64_sync_handler+0x68/0xdc arch/arm64/kernel/entry-common.c:777
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590
irq event stamp: 4228
hardirqs last  enabled at (4227): [<ffff80008b64f030>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline]
hardirqs last  enabled at (4227): [<ffff80008b64f030>] __arm64_exit_to_kernel_mode+0x64/0x78 arch/arm64/kernel/entry-common.c:60
hardirqs last disabled at (4228): [<ffff80008b64afb0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:445
softirqs last  enabled at (3568): [<ffff8000803f5178>] softirq_handle_end kernel/softirq.c:491 [inline]
softirqs last  enabled at (3568): [<ffff8000803f5178>] handle_softirqs+0xc88/0xdfc kernel/softirq.c:673
softirqs last disabled at (3415): [<ffff800080020ff4>] __do_softirq+0x14/0x20 kernel/softirq.c:679
---[ end trace 0000000000000000 ]---




The explanation of the root cause of the bug is:

An analysis of the crash reveals that it is caused by an unbounded user-controlled allocation size in the DRM lease creation ioctl, which attempts to allocate a contiguous memory block larger than `MAX_PAGE_ORDER` using the `kmalloc` family of functions.

### Root Cause Analysis

The crash is a warning triggered in `alloc_order_allowed()` because `__alloc_frozen_pages_noprof()` is called with an allocation order that exceeds `MAX_PAGE_ORDER` (typically 10, which corresponds to 4MB on systems with 4KB pages).

This happens in `fill_object_idr()` when allocating the `objects` array:
```c
// drivers/gpu/drm/drm_lease.c:389
	objects = kzalloc_objs(struct drm_mode_object *, object_count);
```
The `kzalloc_objs` macro expands to a `kmalloc`-family allocation (equivalent to `kcalloc(object_count, sizeof(struct drm_mode_object *), GFP_KERNEL)`). 

The `object_count` comes directly from the user-space `drm_mode_create_lease` struct via `cl->object_count` in `drm_mode_create_lease_ioctl()`. There is no upper bound check on this value.

Before calling `fill_object_idr()`, `drm_mode_create_lease_ioctl()` allocates the `object_ids` array using `memdup_array_user()`:
```c
// drivers/gpu/drm/drm_lease.c:512
		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
					       object_count, sizeof(__u32));
```
`memdup_array_user()` uses `memdup_user()`, which allocates memory with `GFP_USER | __GFP_NOWARN`. Because of the `__GFP_NOWARN` flag, if `object_count` is extremely large (e.g., requiring > 4MB), `memdup_array_user()` will silently fail and return `-ENOMEM` without triggering any warnings.

However, there is a specific window where `object_count` is large enough to require more than 4MB for the `objects` array (which has 8-byte pointers on 64-bit systems), but small enough that the `object_ids` array (which has 4-byte `__u32` elements) fits within 4MB. 

In the provided syzkaller reproducer:
```c
*(uint32_t*)0x200003c8 = 0xf4240; // object_count = 1,000,000
```
1. `object_count` is set to `1,000,000`.
2. `memdup_array_user()` allocates `1,000,000 * 4 = 4,000,000` bytes. This is order 10, which is `<= MAX_PAGE_ORDER`. The allocation succeeds.
3. `fill_object_idr()` then calls `kzalloc_objs()` to allocate `1,000,000 * 8 = 8,000,000` bytes. This requires order 11, which is `> MAX_PAGE_ORDER`. 
4. Since `kzalloc_objs()` uses `GFP_KERNEL` without `__GFP_NOWARN`, the page allocator loudly complains and triggers the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)` warning.

### Proposed Fix

To fix this, the allocation of the `objects` array in `fill_object_idr()` should be changed to use `kvzalloc_objs()`, which gracefully falls back to `vmalloc()` for large allocations and does not trigger the page allocator warning. The corresponding `kfree()` must also be updated to `kvfree()`.

```c
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -386,7 +386,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +462,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
```

*(Note: While adding an arbitrary upper bound check to `object_count` in `drm_mode_create_lease_ioctl()` is another option, using `kvzalloc_objs()` is the standard kernel pattern for handling user-controlled array sizes without imposing artificial limits).*

The diff of the bug fix is:

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 5d2cf724c..6d31bc95d 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -3,6 +3,9 @@
  * Copyright Β© 2017 Keith Packard <keithp@keithp.com>
  */
 #include <linux/file.h>
+#include <linux/limits.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/uaccess.h>
 
 #include <drm/drm_auth.h>
@@ -386,7 +389,7 @@ static int fill_object_idr(struct drm_device *dev,
 	int ret;
 	bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 
-	objects = kzalloc_objs(struct drm_mode_object *, object_count);
+	objects = kvzalloc_objs(struct drm_mode_object *, object_count);
 	if (!objects)
 		return -ENOMEM;
 
@@ -462,7 +465,7 @@ static int fill_object_idr(struct drm_device *dev,
 		if (objects[o])
 			drm_mode_object_put(objects[o]);
 	}
-	kfree(objects);
+	kvfree(objects);
 	return ret;
 }
 
@@ -496,6 +499,11 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *)) {
+		drm_dbg_lease(dev, "too many objects: %u\n", cl->object_count);
+		return -EINVAL;
+	}
+
 	lessor = drm_file_get_master(lessor_priv);
 	/* Do not allow sub-leases */
 	if (lessor->lessor) {
@@ -509,8 +517,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
-					       object_count, sizeof(__u32));
+		object_ids = vmemdup_array_user(u64_to_user_ptr(cl->object_ids),
+						object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);
@@ -520,7 +528,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 		/* fill and validate the object idr */
 		ret = fill_object_idr(dev, lessor_priv, &leases,
 				      object_count, object_ids);
-		kfree(object_ids);
+		kvfree(object_ids);
 		if (ret) {
 			drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 			idr_destroy(&leases);


Additional description of the patch:

I have created a patch to address the page allocator warning triggered in `drm_mode_create_lease_ioctl()`.

### Root Cause & Engineering Analysis
1. In `fill_object_idr()`, the temporary `objects` pointer array was allocated using `kzalloc_objs(struct drm_mode_object *, object_count)`. Because `kzalloc_objs` expands to `kmalloc` with `GFP_KERNEL` (which lacks `__GFP_NOWARN`), when a userspace caller provides a sufficiently large `cl->object_count` (e.g., 1,000,000 mode objects), the requested size exceeds `MAX_PAGE_ORDER` (order 11 > 10), triggering the `WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, ...)` in `alloc_order_allowed()`.
2. Although `cl->object_ids` was duplicated from user space using `memdup_array_user()`, that allocation also relied on `kmalloc` and could fail under memory fragmentation or for larger order allocations.
3. While switching to the `kvmalloc` family (`kvzalloc_objs()`) enables falling back to `vmalloc()` to prevent the `MAX_PAGE_ORDER` splat, `__kvmalloc_node_noprof()` still triggers a `WARN_ON_ONCE(size > INT_MAX)` if user space passes a crazy allocation size (> 2GB). Since `cl->object_count` is an unbounded `__u32`, `object_count * sizeof(struct drm_mode_object *)` could otherwise easily exceed `INT_MAX`.
4. Furthermore, `cl->object_count` is a `__u32` in `struct drm_mode_create_lease`, but `fill_object_idr()` and `validate_lease()` accept `int object_count`. Without an upper bound, a value $\ge 2^{31}$ would suffer signed integer overflow.

### Changes Made
1. **Switch to `kvzalloc_objs()` / `kvfree()`**:
   In `fill_object_idr()`, switched the `objects` array allocation from `kzalloc_objs()` to `kvzalloc_objs()` so large allocations can gracefully fall back to `vmalloc()`, and updated `kfree(objects)` to `kvfree(objects)`.
2. **Switch to `vmemdup_array_user()` / `kvfree()`**:
   In `drm_mode_create_lease_ioctl()`, switched copying `cl->object_ids` from `memdup_array_user()` to `vmemdup_array_user()`, and updated `kfree(object_ids)` to `kvfree(object_ids)`.
3. **Early Upper Bounds Check**:
   Added an early check `if (cl->object_count > INT_MAX / sizeof(struct drm_mode_object *))` at the start of `drm_mode_create_lease_ioctl()`, alongside the `cl->flags` validation. Placing this check before `drm_file_get_master(lessor_priv)` ensures that invalid requests are rejected early with `-EINVAL` without leaking the lessor's `drm_master` reference, prevents `__kvmalloc_node_noprof()` from triggering `WARN_ON_ONCE(size > INT_MAX)` on both allocations, and guarantees that `object_count` safely fits within a positive `int`.
4. **Header Cleanups**:
   Included `<linux/limits.h>`, `<linux/slab.h>`, and `<linux/string.h>` in `drivers/gpu/drm/drm_lease.c` for `INT_MAX`, `kvzalloc_objs`/`kvfree`, and `vmemdup_array_user`.

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 more 'alloc_obj' cases to default GFP_KERNEL arguments
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
drm_lease.c: copy user-array safely
drm: Remove unnecessary include statements for drm_crtc_helper.h
drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
drm/lease: allow empty leases
drm: clean up unused kerneldoc in drm_lease.c
drm: clarify usage of drm leases
drm: protect drm_master pointers in drm_lease.c
drm: Don't include drm_legacy.h in drm_lease.c
drm : Insert blank lines after declarations.
drm/lease: fix WARNING in idr_destroy
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
drm: drop use of drmP.h in drm/*
drm/lease: Check for lessor outside of locks
drm/lease: Drop recursive leads checks
drm/leases: Drop object_id validation for negative ids
drm: Use array_size() when creating lease
drm: Rename crtc_idr as object_idr to KMS cleanups
drm/lease: Send a distinct uevent


Reply:
drm/lease: Use kvmalloc and bound object_count in create lease ioctl

In drm_mode_create_lease_ioctl(), user space supplies an object_count and
an array of object_ids to be leased. The kernel copies the IDs from user
space using memdup_array_user(), and then fill_object_idr() allocates a
temporary array of pointers using kzalloc_objs(struct drm_mode_object *,
object_count).

Because kzalloc_objs() performs a kmalloc-family allocation with GFP_KERNEL
(which lacks __GFP_NOWARN), if user space requests a sufficiently large
object_count (for example, 1,000,000 mode objects), the allocation for the
pointer array (1,000,000 * 8 = 8,000,000 bytes on 64-bit systems) requires
order 11 pages. This exceeds MAX_PAGE_ORDER and triggers a warning in the
page allocator:

WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340
[inline]
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640
mm/page_alloc.c:5397
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline]
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]

Furthermore, cl->object_count is an unbounded __u32, whereas
fill_object_idr() and validate_lease() treat object_count as a signed
integer. A value of cl->object_count greater than or equal to 2^31 results
in signed integer overflow. In addition, an allocation size exceeding
INT_MAX would trigger a WARN_ON_ONCE inside __kvmalloc_node_noprof().

Fix these issues by validating cl->object_count early in
drm_mode_create_lease_ioctl() so that requests with cl->object_count >
INT_MAX / sizeof(struct drm_mode_object *) are rejected with -EINVAL.
Additionally, switch the object_ids allocation to vmemdup_array_user() and
the objects pointer array allocation to kvzalloc_objs(), freeing both with
kvfree(), so that large allocations can fall back to vmalloc without
triggering allocator warnings or failing under memory fragmentation.

481/2 2026/10/14 00:37 llm description-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 9638
							output: 32
							thoughts: 601
						

Thoughts:
**My Commit Description Generation Process**

Okay, here's what I'm thinking. I need to craft a commit description for a kernel bug fix, and I need to do it precisely. First, the instructions are very clear: I need a concise, one-line summary (under 72 characters) that focuses on the *change*, not the tool that found the bug. Then, I need to elaborate on the bug itself and how the patch resolves it.

The constraints are also strict: no lines starting with `#`, `--`, or `---`. Those will break Git, so I *must* avoid them. I need to make sure the final output is *only* the commit description text; no extra fluff. Crucially, I'm *not* manually wrapping lines. The lines should remain single, not exceeding the maximum line length. I should also avoid mentioning syzkaller or fuzzers directly in the description.

If there's a sanitizer report (KASAN, KMSAN, lockdep, etc.) or a warning, I must include *relevant* parts. No irrelevant sections, such as long stack traces unless they illustrate the bug's execution path. If the warning has a `---[ end trace ... ]---` (which is forbidden) or `------------[ cut here ]------------` I'll exclude it!

The instructions mention something about `WARN_ON`, but this patch doesn't remove `WARN_ON`. It avoids triggering `WARN_ON_ONCE_GFP` or `WARN_ON_ONCE`.

I also shouldn't assume `panic_on_warn` is set. Finally, I'll review recent commit subjects from `drivers/gpu/drm/drm_lease.c` using `git log` to ensure I'm following the standard "drm/lease:..." format.



482/2 2026/10/14 00:38 tool git-log
0m Args:
map[Count:10 PathPrefix:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
f37d63e219c3 drm_lease.c: copy user-array safely
cde3d37b19df drm: Remove unnecessary include statements for drm_crtc_helper.h
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
4bb2d367a5a2 drm/lease: allow empty leases
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
d793b8f732d6 drm: clarify usage of drm leases
56f0729a510f drm: protect drm_master pointers in drm_lease.c
7988fdf5f0a3 drm: Don't include drm_legacy.h in drm_lease.c
]

483/2 2026/10/14 00:38 llm description-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 10923
							output: 32
							thoughts: 99
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience:

**Investigating Potential Lease-Related Issues**

Right, let's dive into some potentially relevant commits. I'm thinking I'll start by reviewing commit `4bb2d367a5a2`, then check out `676f11b5a4a0`, `56f0729a510f`, and `7bd224b6625a` to see if there's anything germane to the issue at hand. It seems like the "drm/lease: ..." component is pretty frequently utilized in the code base, and that makes it a prime suspect. To get a broader understanding and see the history, I should really use `git log --oneline drivers/gpu/drm/drm_lease.c` and go back further in the history of that file. This should give me some context about related modifications and perhaps pinpoint the root cause or interaction if this is an evolution of a known problem.



484/2 2026/10/14 00:38 tool git-log
0m Args:
map[Count:25 PathPrefix:drivers/gpu/drm/drm_lease.c]

Results:
map[Output:32a92f8c8932 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
f37d63e219c3 drm_lease.c: copy user-array safely
cde3d37b19df drm: Remove unnecessary include statements for drm_crtc_helper.h
7bd224b6625a drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
4bb2d367a5a2 drm/lease: allow empty leases
676f11b5a4a0 drm: clean up unused kerneldoc in drm_lease.c
d793b8f732d6 drm: clarify usage of drm leases
56f0729a510f drm: protect drm_master pointers in drm_lease.c
7988fdf5f0a3 drm: Don't include drm_legacy.h in drm_lease.c
948de84233d3 drm : Insert blank lines after declarations.
b216a8e7908c drm/lease: fix WARNING in idr_destroy
c942fddf8793 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
0500c04ea14a drm: drop use of drmP.h in drm/*
46b757780dfe drm/lease: Check for lessor outside of locks
ae9d6c076c0d drm/lease: Drop recursive leads checks
e40b76428842 drm/leases: Drop object_id validation for negative ids
69ef943dbc14 drm: Use array_size() when creating lease
b5f06893c499 drm: Rename crtc_idr as object_idr to KMS cleanups
ce85882860f0 drm/lease: Send a distinct uevent
968029057192 drm/lease: look at ->universal_planes only once
a0c1af46e9d7 drm/lease: debug output for lease creation
6caec6a04717 drm/lease: drop EXPORT_SYMBOL
918d89bb1a63 gpu: drm/lease: fix spelling mistake, EACCESS -> EACCES
12d43deb1ee6 drm: fix use-after-free read in drm_mode_create_lease_ioctl()
]

485/2 2026/10/14 00:38 llm description-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 11906
							output: 39
							thoughts: 1323
						

Thoughts:
**Analyzing the drm/lease Code for Lease Creation**

Alright, let's break this down. Seeing that "drm/lease: ..." prefix, I immediately know we're dealing with modifications to the DRM lease functionality, specifically `drm_lease.c`. Looking at the diff, it's clear the changes revolve around `drm_mode_create_lease_ioctl()` and the related `fill_object_idr()` function. The core concern is the allocation and handling of object arrays during lease creation. I can see the switch from `kzalloc_objs` to `kvmalloc/kvfree` and `vmemdup_array_user`, which suggests a move away from the potentially problematic page allocations. Also, I see the addition of a crucial check: `object_count` is being validated against `INT_MAX / sizeof(...)`. Good, that prevents the obvious integer overflow and potential denial of service.

Now, as for a concise summary... "drm/lease: Use kvmalloc and check bounds for object_count in lease" looks most appropriate.
That should clearly state the changes: the allocation is now using kvmalloc and the object count is validated.
The patch clearly highlights two key changes: the allocation calls and the `object_count` check. That should keep it under 70 characters. It is good!



486/2 2026/10/14 00:38 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:480 LineCount:60]

Results:
map[Contents: 480:		int ret = 0;
 481:		struct idr leases;
 482:		struct drm_master *lessor;
 483:		struct drm_master *lessee = NULL;
 484:		struct file *lessee_file = NULL;
 485:		struct file *lessor_file = lessor_priv->filp;
 486:		struct drm_file *lessee_priv;
 487:		int fd = -1;
 488:		uint32_t *object_ids;
 489:	
 490:		/* Can't lease without MODESET */
 491:		if (!drm_core_check_feature(dev, DRIVER_MODESET))
 492:			return -EOPNOTSUPP;
 493:	
 494:		if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
 495:			drm_dbg_lease(dev, "invalid flags\n");
 496:			return -EINVAL;
 497:		}
 498:	
 499:		lessor = drm_file_get_master(lessor_priv);
 500:		/* Do not allow sub-leases */
 501:		if (lessor->lessor) {
 502:			drm_dbg_lease(dev, "recursive leasing not allowed\n");
 503:			ret = -EINVAL;
 504:			goto out_lessor;
 505:		}
 506:	
 507:		object_count = cl->object_count;
 508:	
 509:		/* Handle leased objects, if any */
 510:		idr_init(&leases);
 511:		if (object_count != 0) {
 512:			object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
 513:						       object_count, sizeof(__u32));
 514:			if (IS_ERR(object_ids)) {
 515:				ret = PTR_ERR(object_ids);
 516:				idr_destroy(&leases);
 517:				goto out_lessor;
 518:			}
 519:	
 520:			/* fill and validate the object idr */
 521:			ret = fill_object_idr(dev, lessor_priv, &leases,
 522:					      object_count, object_ids);
 523:			kfree(object_ids);
 524:			if (ret) {
 525:				drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret);
 526:				idr_destroy(&leases);
 527:				goto out_lessor;
 528:			}
 529:		}
 530:	
 531:		/* Allocate a file descriptor for the lease */
 532:		fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
 533:		if (fd < 0) {
 534:			idr_destroy(&leases);
 535:			ret = fd;
 536:			goto out_lessor;
 537:		}
 538:	
 539:		drm_dbg_lease(dev, "Creating lease\n");
]

487/2 2026/10/14 00:38 llm description-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 14470
							output: 39
							thoughts: 28
						

Thoughts:
Okay, here's my interpretation of that request, formatted as requested:

**Diving into the Lease Implementation**

Alright, so we're talking about DRM leases, specifically how they're implemented in the kernel. I need to get a really good handle on this, so I'm going to take a closer look at the `drivers/gpu/drm/drm_lease.c` file. This is crucial for understanding how resource sharing is managed in the graphics stack. I'm especially interested in lines 380 through 465. That specific block likely contains the core logic or important interactions within that module and is the section to thoroughly analyze for this exploration. I need to understand this implementation well to make sure any improvements or debugging efforts are targeted effectively. Let's see what's in there.



488/2 2026/10/14 00:38 tool read-file
0m Args:
map[File:drivers/gpu/drm/drm_lease.c FirstLine:380 LineCount:85]

Results:
map[Contents: 380:				   struct idr *leases,
 381:				   int object_count,
 382:				   u32 *object_ids)
 383:	{
 384:		struct drm_mode_object **objects;
 385:		u32 o;
 386:		int ret;
 387:		bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
 388:	
 389:		objects = kzalloc_objs(struct drm_mode_object *, object_count);
 390:		if (!objects)
 391:			return -ENOMEM;
 392:	
 393:		/* step one - get references to all the mode objects
 394:		   and check for validity. */
 395:		for (o = 0; o < object_count; o++) {
 396:			objects[o] = drm_mode_object_find(dev, lessor_priv,
 397:							  object_ids[o],
 398:							  DRM_MODE_OBJECT_ANY);
 399:			if (!objects[o]) {
 400:				ret = -ENOENT;
 401:				goto out_free_objects;
 402:			}
 403:	
 404:			if (!drm_mode_object_lease_required(objects[o]->type)) {
 405:				DRM_DEBUG_KMS("invalid object for lease\n");
 406:				ret = -EINVAL;
 407:				goto out_free_objects;
 408:			}
 409:		}
 410:	
 411:		ret = validate_lease(dev, object_count, objects, universal_planes);
 412:		if (ret) {
 413:			drm_dbg_lease(dev, "lease validation failed\n");
 414:			goto out_free_objects;
 415:		}
 416:	
 417:		/* add their IDs to the lease request - taking into account
 418:		   universal planes */
 419:		for (o = 0; o < object_count; o++) {
 420:			struct drm_mode_object *obj = objects[o];
 421:			u32 object_id = objects[o]->id;
 422:	
 423:			drm_dbg_lease(dev, "Adding object %d to lease\n", object_id);
 424:	
 425:			/*
 426:			 * We're using an IDR to hold the set of leased
 427:			 * objects, but we don't need to point at the object's
 428:			 * data structure from the lease as the main object_idr
 429:			 * will be used to actually find that. Instead, all we
 430:			 * really want is a 'leased/not-leased' result, for
 431:			 * which any non-NULL pointer will work fine.
 432:			 */
 433:			ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL);
 434:			if (ret < 0) {
 435:				drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n",
 436:					      object_id, ret);
 437:				goto out_free_objects;
 438:			}
 439:			if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
 440:				struct drm_crtc *crtc = obj_to_crtc(obj);
 441:	
 442:				ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
 443:				if (ret < 0) {
 444:					drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n",
 445:						      object_id, ret);
 446:					goto out_free_objects;
 447:				}
 448:				if (crtc->cursor) {
 449:					ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL);
 450:					if (ret < 0) {
 451:						drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n",
 452:							      object_id, ret);
 453:						goto out_free_objects;
 454:					}
 455:				}
 456:			}
 457:		}
 458:	
 459:		ret = 0;
 460:	out_free_objects:
 461:		for (o = 0; o < object_count; o++) {
 462:			if (objects[o])
 463:				drm_mode_object_put(objects[o]);
 464:		}
]

489/2 2026/10/14 00:38 llm description-generator
0m Model:
gemini-3.8-flash

Tokens:
							input: 16110
							output: 838
							thoughts: 8718
						

Thoughts:
**drm/lease: Use kvmalloc and bound object_count in create lease ioctl**

In drm_mode_create_lease_ioctl(), user space supplies an object_count and an array of object_ids to be leased. The kernel first copies the IDs from user space using memdup_array_user(), and then fill_object_idr() allocates a temporary array of pointers using kzalloc_objs(struct drm_mode_object *, object_count).

Because kzalloc_objs() performs a kmalloc-family allocation with GFP_KERNEL (which does not include __GFP_NOWARN), if user space requests a sufficiently large object_count (for example, 1,000,000 mode objects), the allocation for the pointer array (1,000,000 * 8 = 8,000,000 bytes on 64-bit architectures) requires order 11 pages. This exceeds MAX_PAGE_ORDER (order 10) and triggers a warning in the page allocator:

WARNING: mm/page_alloc.c:5340 at alloc_order_allowed mm/page_alloc.c:5340 [inline]
WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
Call trace:
 alloc_order_allowed mm/page_alloc.c:5340 [inline]
 __alloc_frozen_pages_noprof+0xe4/0x640 mm/page_alloc.c:5397
 alloc_pages_mpol+0x1fc/0x3d0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof+0xe0/0x214 mm/mempolicy.c:2557
 ___kmalloc_large_node+0xf0/0x160 mm/slub.c:5353
 __kmalloc_large_node_noprof+0x2c/0x8c mm/slub.c:5385
 fill_object_idr drivers/gpu/drm/drm_lease.c:389 [inline]
 drm_mode_create_lease_ioctl+0x45c/0x15c8 drivers/gpu/drm/drm_lease.c:521
 drm_ioctl_kernel+0x250/0x328 drivers/gpu/drm/drm_ioctl.c:817
 drm_ioctl+0x65c/0xa58 drivers/gpu/drm/drm_ioctl.c:914
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]

Furthermore, cl->object_count is an unbounded __u32, whereas fill_object_idr() and validate_lease() treat object_count as a signed integer. A value of cl->object_count greater than or equal to 2^31 results in signed integer overflow. In addition, an allocation size larger than INT_MAX would trigger a WARN_ON_ONCE inside __kvmalloc_node_noprof().

To resolve these issues, validate cl->object_count early in drm_mode_create_lease_ioctl() to ensure that cl->object_count <= INT_MAX / sizeof(struct drm_mode_object *), rejecting oversized requests with -EINVAL. Also, switch the allocations of object_ids and the objects pointer array to vmemdup_array_user() and kvzalloc_objs(), respectively, and release them with kvfree(), so that large allocations can fall back to vmalloc without triggering allocation warnings or failing due to memory fragmentation.



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)