Skip to main content

CVE-2024-36930: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-36930cvecve-2024-36930
Published: Thu May 30 2024 (05/30/2024, 15:29:22 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: spi: fix null pointer dereference within spi_sync If spi_sync() is called with the non-empty queue and the same spi_message is then reused, the complete callback for the message remains set while the context is cleared, leading to a null pointer dereference when the callback is invoked from spi_finalize_current_message(). With function inlining disabled, the call stack might look like this: _raw_spin_lock_irqsave from complete_with_flags+0x18/0x58 complete_with_flags from spi_complete+0x8/0xc spi_complete from spi_finalize_current_message+0xec/0x184 spi_finalize_current_message from spi_transfer_one_message+0x2a8/0x474 spi_transfer_one_message from __spi_pump_transfer_message+0x104/0x230 __spi_pump_transfer_message from __spi_transfer_message_noqueue+0x30/0xc4 __spi_transfer_message_noqueue from __spi_sync+0x204/0x248 __spi_sync from spi_sync+0x24/0x3c spi_sync from mcp251xfd_regmap_crc_read+0x124/0x28c [mcp251xfd] mcp251xfd_regmap_crc_read [mcp251xfd] from _regmap_raw_read+0xf8/0x154 _regmap_raw_read from _regmap_bus_read+0x44/0x70 _regmap_bus_read from _regmap_read+0x60/0xd8 _regmap_read from regmap_read+0x3c/0x5c regmap_read from mcp251xfd_alloc_can_err_skb+0x1c/0x54 [mcp251xfd] mcp251xfd_alloc_can_err_skb [mcp251xfd] from mcp251xfd_irq+0x194/0xe70 [mcp251xfd] mcp251xfd_irq [mcp251xfd] from irq_thread_fn+0x1c/0x78 irq_thread_fn from irq_thread+0x118/0x1f4 irq_thread from kthread+0xd8/0xf4 kthread from ret_from_fork+0x14/0x28 Fix this by also setting message->complete to NULL when the transfer is complete.

AI-Powered Analysis

AILast updated: 06/29/2025, 10:12:32 UTC

Technical Analysis

CVE-2024-36930 is a vulnerability identified in the Linux kernel's SPI (Serial Peripheral Interface) subsystem, specifically within the spi_sync() function. The issue arises when spi_sync() is called with a non-empty queue and the same spi_message structure is reused without properly clearing the complete callback pointer. The vulnerability is a null pointer dereference triggered during the invocation of the callback from spi_finalize_current_message(). This occurs because the callback pointer remains set while the context it relies on has been cleared, leading to a dereference of a null pointer. The problem is rooted in the failure to reset the message->complete pointer to NULL after the transfer completes. The call stack provided shows the sequence of kernel functions involved, culminating in the callback invocation that triggers the fault. The vulnerability can cause a kernel crash (denial of service) due to the null pointer dereference. The fix involves explicitly setting the message->complete pointer to NULL once the transfer is complete, preventing the callback from being invoked with an invalid context. This vulnerability affects Linux kernel versions identified by the commit hashes provided, and it is relevant to systems using SPI devices, which are common in embedded systems, IoT devices, and some industrial control systems. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the primary impact of CVE-2024-36930 is the potential for denial of service (DoS) on Linux-based systems that utilize SPI devices. This includes embedded systems, industrial automation equipment, networking hardware, and IoT devices that run Linux kernels vulnerable to this issue. A successful exploitation could cause kernel crashes, leading to system reboots or failures, disrupting critical services or industrial processes. While this vulnerability does not directly lead to privilege escalation or remote code execution, the resulting instability can affect availability and operational continuity. Organizations in sectors such as manufacturing, telecommunications, automotive, and critical infrastructure that rely on Linux-based embedded systems are particularly at risk. The disruption could also impact supply chains and operational technology environments, which are prevalent in European industries. Since the vulnerability requires kernel-level interaction with SPI devices, the attack surface is somewhat limited to systems with such hardware interfaces, but the widespread use of Linux in embedded and industrial contexts in Europe means the risk is non-negligible.

Mitigation Recommendations

1. Apply Kernel Updates: European organizations should prioritize applying the official Linux kernel patches that address CVE-2024-36930 as soon as they become available from their Linux distribution vendors or directly from the Linux kernel source. 2. Audit SPI Device Usage: Conduct an inventory of systems using SPI devices and assess whether they run vulnerable kernel versions. 3. Limit Access to SPI Interfaces: Restrict access to SPI device interfaces to trusted processes and users only, minimizing the risk of malicious or accidental invocation of spi_sync() with problematic parameters. 4. Kernel Hardening: Employ kernel hardening techniques such as kernel lockdown modes, SELinux/AppArmor policies, and secure boot to reduce the risk of exploitation and unauthorized kernel interactions. 5. Monitoring and Logging: Implement enhanced monitoring of kernel logs and system stability metrics to detect abnormal crashes or reboots potentially related to this vulnerability. 6. Test Updates in Controlled Environments: Before wide deployment, test kernel updates in staging environments to ensure compatibility with existing SPI device drivers and applications. 7. Vendor Coordination: For embedded or industrial devices, coordinate with hardware and software vendors to ensure timely firmware and kernel updates are provided and applied.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-30T15:25:07.070Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9828c4522896dcbe26eb

Added to database: 5/21/2025, 9:08:56 AM

Last enriched: 6/29/2025, 10:12:32 AM

Last updated: 8/14/2025, 8:47:26 PM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats