CVE-2026-23068 Overview
A double free vulnerability has been identified in the Linux kernel's spi-sprd-adi driver. The flaw exists in the error handling path during device probe initialization, where incorrect memory management leads to the spi_controller structure being freed twice. This memory corruption issue arises from a mismatch between the allocation method (spi_alloc_host()) and the registration method (devm_spi_register_controller()), causing both manual and automatic cleanup routines to attempt deallocation of the same resource.
Critical Impact
Exploitation of this double free condition can lead to kernel memory corruption, potentially enabling denial of service through kernel panic or, in certain scenarios, privilege escalation if an attacker can control the memory allocation patterns.
Affected Products
- Linux kernel with spi-sprd-adi driver enabled
- Systems using Spreadtrum/Unisoc ADI SPI interfaces
- Embedded Linux devices utilizing the affected SPI subsystem
Discovery Timeline
- February 4, 2026 - CVE CVE-2026-23068 published to NVD
- February 5, 2026 - Last updated in NVD database
Technical Details for CVE-2026-23068
Vulnerability Analysis
The vulnerability resides in the spi-sprd-adi driver's probe function error handling logic. When the driver initializes, it allocates an SPI controller using spi_alloc_host(), which performs a standard allocation requiring manual cleanup. However, the driver subsequently registers this controller using devm_spi_register_controller(), which is a device-managed (devm) function that automatically handles cleanup when the device is removed or when probe fails.
This creates a critical inconsistency: if devm_register_restart_handler() fails after successful controller registration, the error path explicitly calls spi_controller_put() via the put_ctlr label. Since the controller was registered with a devm function, the device core will also invoke spi_controller_put() automatically during cleanup. This results in the reference count being decremented twice, ultimately causing a double free of the spi_controller structure.
The consequences of a double free in kernel space are severe. The memory previously occupied by the controller structure may be reallocated for other purposes, and when the second free operation occurs, it can corrupt kernel heap metadata or overwrite legitimate data structures.
Root Cause
The root cause is an API mismatch between allocation and registration functions. The driver uses spi_alloc_host() for allocation but devm_spi_register_controller() for registration. The devm (device-managed) API assumes it owns the resource lifecycle and will automatically release resources on device removal or probe failure. When combined with manual cleanup in the error path, this leads to duplicate deallocation attempts. The fix correctly switches to devm_spi_alloc_host() for allocation, ensuring consistent device-managed lifecycle handling, and removes the now-redundant manual spi_controller_put() call.
Attack Vector
The attack vector for this vulnerability is local, requiring an attacker to have the ability to trigger driver probe failures on the target system. Potential exploitation scenarios include:
- Module Loading/Unloading: Triggering repeated module load/unload cycles with conditions that cause probe failures
- Device Hot-plug Events: Manipulating hardware or device tree configurations to create error conditions during device enumeration
- Resource Exhaustion: Creating conditions where devm_register_restart_handler() fails, such as memory pressure
Successful exploitation could allow a local attacker to corrupt kernel memory structures, potentially leading to privilege escalation or denial of service through kernel panic.
Detection Methods for CVE-2026-23068
Indicators of Compromise
- Kernel panic messages referencing double free or invalid memory access in SPI subsystem
- KASAN (Kernel Address Sanitizer) reports indicating use-after-free in spi_controller related functions
- Unexpected system reboots or crashes when loading or unloading the spi-sprd-adi module
- Kernel oops messages with stack traces involving spi_controller_put() or related SPI functions
Detection Strategies
- Enable KASAN and SLUB debugging in kernel configuration to detect double free conditions at runtime
- Monitor kernel logs for patterns matching spi-sprd-adi errors combined with memory corruption indicators
- Deploy kernel livepatching detection tools to identify systems running vulnerable kernel versions
- Use SentinelOne's kernel protection capabilities to detect anomalous memory operations in the SPI subsystem
Monitoring Recommendations
- Configure syslog monitoring for kernel panic and oops messages related to SPI subsystem components
- Implement automated kernel version tracking across fleet to identify systems requiring patching
- Enable kernel crash dump collection (kdump) for post-incident forensic analysis
- Monitor for unusual patterns of module loading/unloading activity that could indicate exploitation attempts
How to Mitigate CVE-2026-23068
Immediate Actions Required
- Update the Linux kernel to a patched version that includes the fix for the spi-sprd-adi driver
- If immediate patching is not possible, consider disabling or blacklisting the spi-sprd-adi module if not required for system operation
- Review system configurations to assess exposure to this vulnerability based on hardware usage
- Enable kernel hardening features such as KASAN to detect exploitation attempts
Patch Information
Multiple patches have been released to address this vulnerability. The fix involves switching from spi_alloc_host() to devm_spi_alloc_host() for controller allocation, ensuring consistent device-managed resource handling and removing the manual spi_controller_put() call from the error path.
Available patches:
Workarounds
- Blacklist the spi-sprd-adi module by adding blacklist spi-sprd-adi to /etc/modprobe.d/blacklist.conf if the hardware is not in use
- Restrict module loading capabilities using kernel lockdown features or SELinux/AppArmor policies
- Limit local access to systems where the vulnerable driver is required until patching can be completed
- Enable SLUB debugging with slub_debug=FZP kernel parameter to help detect exploitation attempts
# Configuration example
# Blacklist the vulnerable module until patching is complete
echo "blacklist spi-sprd-adi" | sudo tee /etc/modprobe.d/blacklist-spi-sprd-adi.conf
# Verify the module is not loaded
lsmod | grep spi_sprd_adi
# If loaded, remove the module (only if not required)
sudo modprobe -r spi_sprd_adi
# Update initramfs to apply blacklist on boot
sudo update-initramfs -u
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

