CVE-2024-40901

scsi: mpt3sas: Avoid test/set_bit() operating in non-allocated memory

7.3 high EPSS 0.32%

Published 12 Jul 2024 Updated 15 Oct 2026 CNA: Linux

Check your servers for CVE-2024-40901

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-40901 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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/

Severity (CVSS)

7.3 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality low, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.32%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 26.4% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 10 Sep 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from c696f7b83edeac804e898952058089143f49ca0a, before e9bce7c751f6d6c7be88c0bc081a66aaf61a23ee
affected from c696f7b83edeac804e898952058089143f49ca0a, before 19649e49a6df07cd2e03e0a11396fd3a99485ec2
affected from c696f7b83edeac804e898952058089143f49ca0a, before 0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16
affected from c696f7b83edeac804e898952058089143f49ca0a, before 521f333e644c4246ca04a4fc4772edc53dd2a801
affected from c696f7b83edeac804e898952058089143f49ca0a, before 46bab2bcd771e725ff5ca3a68ba68cfeac45676c
affected from c696f7b83edeac804e898952058089143f49ca0a, before 9079338c5a0d1f1fee34fb1c9e99b754efe414c5
affected from c696f7b83edeac804e898952058089143f49ca0a, before 18abb5db0aa9b2d48f7037a88b41af2eef821674
affected from c696f7b83edeac804e898952058089143f49ca0a, before 4254dfeda82f20844299dca6c38cbffcfd499f41
Other versions: unaffected
Linux
affected 4.10
unaffected before 4.10
unaffected from 4.19.317 up to and including 4.19.*
unaffected from 5.4.279 up to and including 5.4.*
unaffected from 5.10.221 up to and including 5.10.*
unaffected from 5.15.162 up to and including 5.15.*
unaffected from 6.1.95 up to and including 6.1.*
unaffected from 6.6.35 up to and including 6.6.*
unaffected from 6.9.6 up to and including 6.9.*
unaffected 6.10 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-40901 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-40901

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2024-40901
trivy image --scanners vuln IMAGE | grep CVE-2024-40901

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2024-40901 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.