Skip to main content

CVE-2024-40901: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-40901cvecve-2024-40901
Published: Fri Jul 12 2024 (07/12/2024, 12:20:42 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: scsi: mpt3sas: Avoid test/set_bit() operating in non-allocated memory There is a potential out-of-bounds access when using test_bit() on a single word. The test_bit() and set_bit() functions operate on long values, and when testing or setting a single word, they can exceed the word boundary. KASAN detects this issue and produces a dump: BUG: KASAN: slab-out-of-bounds in _scsih_add_device.constprop.0 (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 drivers/scsi/mpt3sas/mpt3sas_scsih.c:7331) mpt3sas Write of size 8 at addr ffff8881d26e3c60 by task kworker/u1536:2/2965 For full log, please look at [1]. Make the allocation at least the size of sizeof(unsigned long) so that set_bit() and test_bit() have sufficient room for read/write operations without overwriting unallocated memory. [1] Link: https://lore.kernel.org/all/ZkNcALr3W3KGYYJG@gmail.com/

AI-Powered Analysis

AILast updated: 06/29/2025, 12:56:57 UTC

Technical Analysis

CVE-2024-40901 is a vulnerability identified in the Linux kernel, specifically within the SCSI subsystem driver mpt3sas. The issue arises from improper handling of bit operations using the test_bit() and set_bit() functions on memory that is not properly allocated. These functions operate on long-sized values, but when used on a single word, they can exceed the allocated word boundary, leading to out-of-bounds memory access. This is detected by Kernel Address Sanitizer (KASAN) as a slab-out-of-bounds error, indicating that the kernel attempts to read or write beyond the allocated memory region. The vulnerability is triggered when test_bit() or set_bit() operates on memory smaller than sizeof(unsigned long), causing potential memory corruption or instability. The root cause is insufficient allocation size for the bit operations in the mpt3sas driver, which handles SAS (Serial Attached SCSI) devices. The fix involves ensuring that memory allocations are at least the size of an unsigned long, preventing out-of-bounds access during bit manipulation. No known exploits are currently reported in the wild, and the vulnerability was published on July 12, 2024. The affected versions are identified by specific commit hashes, indicating that this is a recent and targeted fix in the Linux kernel source code. This vulnerability could potentially lead to kernel crashes or memory corruption, which might be leveraged for privilege escalation or denial of service if exploited.

Potential Impact

For European organizations, the impact of CVE-2024-40901 depends largely on their use of Linux systems with the mpt3sas driver enabled, typically in environments utilizing SAS storage hardware. Organizations running enterprise Linux distributions or custom kernels with this driver are at risk of kernel instability or crashes, which could disrupt critical services or data access. While no active exploits are known, the vulnerability could be used by attackers with local access to cause denial of service or potentially escalate privileges by corrupting kernel memory. This is particularly concerning for data centers, cloud providers, and industries relying on high-availability storage systems such as finance, healthcare, and manufacturing sectors prevalent in Europe. The risk is heightened in environments where kernel debugging or sanitization tools like KASAN are not enabled, as the out-of-bounds access may go undetected until it causes system failures. Additionally, the vulnerability could affect virtualized environments and container hosts running vulnerable kernels, impacting multi-tenant cloud infrastructures common in European data centers.

Mitigation Recommendations

European organizations should prioritize applying the official Linux kernel patches that address this vulnerability by ensuring that the mpt3sas driver allocates memory at least the size of an unsigned long for bit operations. Kernel updates from trusted Linux distribution vendors should be deployed promptly. Organizations should audit their systems to identify those running kernels with the mpt3sas driver and verify if they are affected by this issue. Enabling kernel debugging and sanitization tools like KASAN in testing environments can help detect similar memory issues proactively. Additionally, restricting local access to trusted users and employing strict access controls can reduce the risk of exploitation. For critical systems, consider isolating storage controllers or using alternative drivers if feasible until patches are applied. Monitoring system logs for KASAN or kernel error messages related to slab-out-of-bounds can provide early warning signs of exploitation attempts or instability. Finally, coordinate with hardware vendors to ensure firmware and driver compatibility with patched kernels to avoid regressions.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-12T12:17:45.579Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9829c4522896dcbe2df5

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

Last enriched: 6/29/2025, 12:56:57 PM

Last updated: 7/30/2025, 4:17:34 AM

Views: 12

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