CVE-2024-40901: scsi: mpt3sas: Avoid test/set_bit() operating in non-allocated memory
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/
Security readout for executives and security teams
Plain-English summary
A Linux SCSI driver can access memory beyond a small allocation while adding a device. This may corrupt kernel memory, potentially causing crashes or unauthorized changes. The supplied CVSS score is 7.3, but the issue requires local, low-privileged access and relevant mpt3sas usage.
Executive priority
Treat this as a high-priority kernel maintenance issue on storage systems using mpt3sas, especially where untrusted users have local access. It is less urgent for systems without that driver or hardware path. Expedite vendor-supported updates, but do not characterize it as an actively exploited emergency.
Technical view
In mpt3sas _scsih_add_device, test_bit() and set_bit() operate on unsigned-long-sized values while the target allocation may hold only one smaller word. This can produce an eight-byte slab out-of-bounds access. The kernel fix allocates at least sizeof(unsigned long). KASAN detected the defect in a kernel worker.
Likely exposure
Exposure is most likely on systems running an affected Linux kernel with the mpt3sas SCSI driver and its device-add path in use. The bundle lists affected releases from 4.10 through several stable lines ending at 6.10, but administrators should verify downstream backports rather than rely solely on version numbers.
Exploitation context
The supplied vector describes a local, low-complexity attack requiring low privileges and no user interaction. Potential impacts are low confidentiality loss and high integrity and availability loss. The bundle marks KEV false and provides no evidence of active exploitation or a public working exploit.
Researcher notes
The evidence demonstrates an out-of-bounds kernel memory access and supplies fixes across stable branches. It does not establish a reliable exploitation primitive, exact attacker-controlled inputs, or exploitation in the wild. The affected-version data is unusually presented, so branch ancestry and distribution backports require direct verification.
Mitigation direction
Install a vendor-supported kernel containing the applicable stable fix.
Check distribution advisories because fixed code may be backported without changing the upstream version pattern.
Prioritize systems actively using mpt3sas for attached storage.
If patching is delayed, follow vendor guidance for safe interim risk reduction.
Validation and detection
Inventory running kernel versions across Linux systems.
Determine whether mpt3sas is present and used for active storage controllers.
Compare vendor changelogs against the referenced stable kernel fixes.
Confirm the corrected kernel is running after maintenance.
Review kernel logs for matching KASAN or slab-out-of-bounds reports.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-40901 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.